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.
Files changed (197) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +5 -2
  3. data/LICENSE +1 -1
  4. data/README.md +39 -4
  5. data/Rakefile +8 -0
  6. data/artikcloud.gemspec +5 -16
  7. data/docs/Device.md +2 -0
  8. data/docs/DeviceShareInfo.md +8 -0
  9. data/docs/DeviceSharing.md +11 -0
  10. data/docs/DeviceSharingArray.md +8 -0
  11. data/docs/DeviceSharingEnvelope.md +11 -0
  12. data/docs/DeviceSharingId.md +8 -0
  13. data/docs/DeviceStatus.md +9 -0
  14. data/docs/DeviceStatusBatch.md +11 -0
  15. data/docs/DeviceStatusData.md +12 -0
  16. data/docs/DeviceStatusPut.md +8 -0
  17. data/docs/DeviceStatusPutData.md +8 -0
  18. data/docs/DevicessharesApi.md +235 -0
  19. data/docs/DevicestatusApi.md +183 -0
  20. data/docs/NotifMessage.md +15 -0
  21. data/docs/NotifMessageArray.md +8 -0
  22. data/docs/NotifMessagesResponse.md +12 -0
  23. data/docs/Subscription.md +24 -0
  24. data/docs/SubscriptionArray.md +8 -0
  25. data/docs/SubscriptionEnvelope.md +8 -0
  26. data/docs/SubscriptionInfo.md +20 -0
  27. data/docs/SubscriptionsApi.md +342 -0
  28. data/docs/SubscriptionsEnvelope.md +11 -0
  29. data/docs/TaskParameters.md +2 -0
  30. data/docs/UpdateParameters.md +8 -0
  31. data/docs/UsersApi.md +67 -1
  32. data/docs/ValidationCallbackInfo.md +9 -0
  33. data/git_push.sh +0 -12
  34. data/lib/artikcloud.rb +24 -13
  35. data/lib/artikcloud/api/device_types_api.rb +7 -55
  36. data/lib/artikcloud/api/devices_api.rb +12 -66
  37. data/lib/artikcloud/api/devices_management_api.rb +16 -118
  38. data/lib/artikcloud/api/devicesshares_api.rb +244 -0
  39. data/lib/artikcloud/api/devicestatus_api.rb +190 -0
  40. data/lib/artikcloud/api/export_api.rb +5 -41
  41. data/lib/artikcloud/api/messages_api.rb +10 -76
  42. data/lib/artikcloud/api/registrations_api.rb +4 -34
  43. data/lib/artikcloud/api/rules_api.rb +5 -41
  44. data/lib/artikcloud/api/subscriptions_api.rb +346 -0
  45. data/lib/artikcloud/api/tags_api.rb +4 -34
  46. data/lib/artikcloud/api/tokens_api.rb +5 -33
  47. data/lib/artikcloud/api/users_api.rb +79 -67
  48. data/lib/artikcloud/api_client.rb +17 -20
  49. data/lib/artikcloud/api_error.rb +8 -18
  50. data/lib/artikcloud/configuration.rb +1 -13
  51. data/lib/artikcloud/models/ack_envelope.rb +4 -16
  52. data/lib/artikcloud/models/acknowledgement.rb +4 -16
  53. data/lib/artikcloud/models/action.rb +4 -16
  54. data/lib/artikcloud/models/action_array.rb +4 -16
  55. data/lib/artikcloud/models/action_details.rb +4 -16
  56. data/lib/artikcloud/models/action_details_array.rb +4 -16
  57. data/lib/artikcloud/models/action_in.rb +4 -16
  58. data/lib/artikcloud/models/action_out.rb +4 -16
  59. data/lib/artikcloud/models/actions.rb +4 -16
  60. data/lib/artikcloud/models/aggregate_data.rb +4 -16
  61. data/lib/artikcloud/models/aggregates_histogram_data.rb +4 -16
  62. data/lib/artikcloud/models/aggregates_histogram_response.rb +4 -16
  63. data/lib/artikcloud/models/aggregates_response.rb +4 -16
  64. data/lib/artikcloud/models/app_properties.rb +8 -16
  65. data/lib/artikcloud/models/check_token_message.rb +4 -16
  66. data/lib/artikcloud/models/check_token_response.rb +4 -16
  67. data/lib/artikcloud/models/device.rb +28 -20
  68. data/lib/artikcloud/models/device_array.rb +4 -16
  69. data/lib/artikcloud/models/device_envelope.rb +8 -16
  70. data/lib/artikcloud/models/device_reg_complete_request.rb +4 -16
  71. data/lib/artikcloud/models/device_reg_confirm_user_request.rb +4 -16
  72. data/lib/artikcloud/models/device_reg_confirm_user_response.rb +4 -16
  73. data/lib/artikcloud/models/device_reg_confirm_user_response_envelope.rb +4 -16
  74. data/lib/artikcloud/models/device_reg_status_response.rb +4 -16
  75. data/lib/artikcloud/models/device_reg_status_response_envelope.rb +4 -16
  76. data/lib/artikcloud/models/device_share_info.rb +188 -0
  77. data/lib/artikcloud/models/device_sharing.rb +218 -0
  78. data/lib/artikcloud/models/device_sharing_array.rb +189 -0
  79. data/lib/artikcloud/models/device_sharing_envelope.rb +214 -0
  80. data/lib/artikcloud/models/device_sharing_id.rb +188 -0
  81. data/lib/artikcloud/models/device_status.rb +196 -0
  82. data/lib/artikcloud/models/device_status_batch.rb +216 -0
  83. data/lib/artikcloud/models/device_status_data.rb +225 -0
  84. data/lib/artikcloud/models/device_status_put.rb +187 -0
  85. data/lib/artikcloud/models/device_status_put_data.rb +187 -0
  86. data/lib/artikcloud/models/device_task.rb +4 -16
  87. data/lib/artikcloud/models/device_task_update_request.rb +4 -16
  88. data/lib/artikcloud/models/device_task_update_response.rb +4 -16
  89. data/lib/artikcloud/models/device_token.rb +20 -16
  90. data/lib/artikcloud/models/device_token_envelope.rb +8 -16
  91. data/lib/artikcloud/models/device_type.rb +4 -16
  92. data/lib/artikcloud/models/device_type_array.rb +4 -16
  93. data/lib/artikcloud/models/device_type_envelope.rb +8 -16
  94. data/lib/artikcloud/models/device_type_info.rb +4 -16
  95. data/lib/artikcloud/models/device_type_info_envelope.rb +4 -16
  96. data/lib/artikcloud/models/device_types_envelope.rb +16 -16
  97. data/lib/artikcloud/models/device_types_info.rb +4 -16
  98. data/lib/artikcloud/models/device_types_info_envelope.rb +4 -16
  99. data/lib/artikcloud/models/devices_envelope.rb +16 -16
  100. data/lib/artikcloud/models/error_envelope.rb +4 -16
  101. data/lib/artikcloud/models/event_feed_data.rb +4 -16
  102. data/lib/artikcloud/models/export_data.rb +4 -16
  103. data/lib/artikcloud/models/export_data_array.rb +4 -16
  104. data/lib/artikcloud/models/export_history_response.rb +4 -16
  105. data/lib/artikcloud/models/export_normalized_messages_response.rb +4 -16
  106. data/lib/artikcloud/models/export_request.rb +4 -16
  107. data/lib/artikcloud/models/export_request_data.rb +4 -16
  108. data/lib/artikcloud/models/export_request_info.rb +4 -16
  109. data/lib/artikcloud/models/export_request_response.rb +4 -16
  110. data/lib/artikcloud/models/export_response.rb +4 -16
  111. data/lib/artikcloud/models/export_status_response.rb +4 -16
  112. data/lib/artikcloud/models/field_path.rb +4 -16
  113. data/lib/artikcloud/models/field_presence.rb +8 -16
  114. data/lib/artikcloud/models/field_presence_envelope.rb +32 -16
  115. data/lib/artikcloud/models/fields_actions.rb +4 -16
  116. data/lib/artikcloud/models/manifest_properties.rb +8 -16
  117. data/lib/artikcloud/models/manifest_properties_envelope.rb +8 -16
  118. data/lib/artikcloud/models/manifest_versions.rb +8 -16
  119. data/lib/artikcloud/models/manifest_versions_envelope.rb +8 -16
  120. data/lib/artikcloud/models/message.rb +4 -16
  121. data/lib/artikcloud/models/message_action.rb +4 -16
  122. data/lib/artikcloud/models/message_id.rb +4 -16
  123. data/lib/artikcloud/models/message_id_envelope.rb +4 -16
  124. data/lib/artikcloud/models/message_in.rb +4 -16
  125. data/lib/artikcloud/models/message_out.rb +4 -16
  126. data/lib/artikcloud/models/metadata_envelope.rb +4 -16
  127. data/lib/artikcloud/models/metadata_properties_envelope.rb +4 -16
  128. data/lib/artikcloud/models/metadata_query_envelope.rb +4 -16
  129. data/lib/artikcloud/models/non_empty_string.rb +4 -16
  130. data/lib/artikcloud/models/normalized_action.rb +36 -16
  131. data/lib/artikcloud/models/normalized_actions_envelope.rb +16 -16
  132. data/lib/artikcloud/models/normalized_message.rb +36 -16
  133. data/lib/artikcloud/models/normalized_messages_envelope.rb +16 -16
  134. data/lib/artikcloud/models/notif_message.rb +252 -0
  135. data/lib/artikcloud/models/notif_message_array.rb +189 -0
  136. data/lib/artikcloud/models/notif_messages_response.rb +223 -0
  137. data/lib/artikcloud/models/output_rule.rb +4 -16
  138. data/lib/artikcloud/models/presence_envelope.rb +4 -16
  139. data/lib/artikcloud/models/presence_model.rb +4 -16
  140. data/lib/artikcloud/models/properties_envelope.rb +8 -16
  141. data/lib/artikcloud/models/refresh_token_response.rb +4 -16
  142. data/lib/artikcloud/models/register_message.rb +4 -16
  143. data/lib/artikcloud/models/rule_array.rb +4 -16
  144. data/lib/artikcloud/models/rule_creation_info.rb +4 -16
  145. data/lib/artikcloud/models/rule_envelope.rb +4 -16
  146. data/lib/artikcloud/models/rule_error.rb +4 -16
  147. data/lib/artikcloud/models/rule_update_info.rb +4 -16
  148. data/lib/artikcloud/models/rule_warning_output.rb +4 -16
  149. data/lib/artikcloud/models/rules_envelope.rb +4 -16
  150. data/lib/artikcloud/models/snapshot_response.rb +4 -16
  151. data/lib/artikcloud/models/snapshot_responses.rb +4 -16
  152. data/lib/artikcloud/models/snapshots_response_envelope.rb +4 -16
  153. data/lib/artikcloud/models/subscription.rb +348 -0
  154. data/lib/artikcloud/models/subscription_array.rb +189 -0
  155. data/lib/artikcloud/models/subscription_envelope.rb +187 -0
  156. data/lib/artikcloud/models/subscription_info.rb +308 -0
  157. data/lib/artikcloud/models/subscriptions_envelope.rb +214 -0
  158. data/lib/artikcloud/models/tag.rb +4 -16
  159. data/lib/artikcloud/models/tag_array.rb +4 -16
  160. data/lib/artikcloud/models/tags_envelope.rb +4 -16
  161. data/lib/artikcloud/models/task.rb +4 -16
  162. data/lib/artikcloud/models/task_by_did.rb +4 -16
  163. data/lib/artikcloud/models/task_by_did_list.rb +4 -16
  164. data/lib/artikcloud/models/task_by_did_list_envelope.rb +4 -16
  165. data/lib/artikcloud/models/task_envelope.rb +4 -16
  166. data/lib/artikcloud/models/task_history.rb +4 -16
  167. data/lib/artikcloud/models/task_history_list.rb +4 -16
  168. data/lib/artikcloud/models/task_list.rb +4 -16
  169. data/lib/artikcloud/models/task_list_envelope.rb +4 -16
  170. data/lib/artikcloud/models/task_parameters.rb +25 -17
  171. data/lib/artikcloud/models/task_request.rb +4 -16
  172. data/lib/artikcloud/models/task_status.rb +4 -16
  173. data/lib/artikcloud/models/task_status_counts.rb +4 -16
  174. data/lib/artikcloud/models/task_statuses.rb +4 -16
  175. data/lib/artikcloud/models/task_statuses_envelope.rb +4 -16
  176. data/lib/artikcloud/models/task_statuses_history_envelope.rb +4 -16
  177. data/lib/artikcloud/models/task_update_request.rb +4 -16
  178. data/lib/artikcloud/models/task_update_response.rb +4 -16
  179. data/lib/artikcloud/models/tasks_status_counts.rb +4 -16
  180. data/lib/artikcloud/models/token.rb +4 -16
  181. data/lib/artikcloud/models/token_info.rb +4 -16
  182. data/lib/artikcloud/models/token_info_success_response.rb +4 -16
  183. data/lib/artikcloud/models/token_request.rb +4 -16
  184. data/lib/artikcloud/models/token_response.rb +4 -16
  185. data/lib/artikcloud/models/unregister_device_response.rb +4 -16
  186. data/lib/artikcloud/models/unregister_device_response_envelope.rb +4 -16
  187. data/lib/artikcloud/models/update_parameters.rb +188 -0
  188. data/lib/artikcloud/models/user.rb +28 -16
  189. data/lib/artikcloud/models/user_envelope.rb +8 -16
  190. data/lib/artikcloud/models/validation_callback_info.rb +198 -0
  191. data/lib/artikcloud/models/web_socket_error.rb +4 -16
  192. data/lib/artikcloud/version.rb +2 -14
  193. data/pom.xml +1 -1
  194. data/spec/api/devicesshares_api_spec.rb +87 -0
  195. data/spec/api/devicestatus_api_spec.rb +75 -0
  196. data/spec/api/subscriptions_api_spec.rb +112 -0
  197. metadata +58 -26
@@ -1,24 +1,12 @@
1
1
  =begin
2
2
  #ARTIK Cloud API
3
3
 
4
- #No descripton provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
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'
@@ -129,7 +117,7 @@ module ArtikCloud
129
117
  def build_from_hash(attributes)
130
118
  return nil unless attributes.is_a?(Hash)
131
119
  self.class.swagger_types.each_pair do |key, type|
132
- if type =~ /^Array<(.*)>/i
120
+ if type =~ /\AArray<(.*)>/i
133
121
  # check to ensure the input is an array given that the the attribute
134
122
  # is documented as an array but the input is not
135
123
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -160,7 +148,7 @@ module ArtikCloud
160
148
  when :Float
161
149
  value.to_f
162
150
  when :BOOLEAN
163
- if value.to_s =~ /^(true|t|yes|y|1)$/i
151
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
164
152
  true
165
153
  else
166
154
  false
@@ -171,7 +159,7 @@ module ArtikCloud
171
159
  when /\AArray<(?<inner_type>.+)>\z/
172
160
  inner_type = Regexp.last_match[:inner_type]
173
161
  value.map { |v| _deserialize(inner_type, v) }
174
- when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
162
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
175
163
  k_type = Regexp.last_match[:k_type]
176
164
  v_type = Regexp.last_match[:v_type]
177
165
  {}.tap do |hash|
@@ -1,24 +1,12 @@
1
1
  =begin
2
2
  #ARTIK Cloud API
3
3
 
4
- #No descripton provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
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'
@@ -105,7 +93,7 @@ module ArtikCloud
105
93
  def build_from_hash(attributes)
106
94
  return nil unless attributes.is_a?(Hash)
107
95
  self.class.swagger_types.each_pair do |key, type|
108
- if type =~ /^Array<(.*)>/i
96
+ if type =~ /\AArray<(.*)>/i
109
97
  # check to ensure the input is an array given that the the attribute
110
98
  # is documented as an array but the input is not
111
99
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -136,7 +124,7 @@ module ArtikCloud
136
124
  when :Float
137
125
  value.to_f
138
126
  when :BOOLEAN
139
- if value.to_s =~ /^(true|t|yes|y|1)$/i
127
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
140
128
  true
141
129
  else
142
130
  false
@@ -147,7 +135,7 @@ module ArtikCloud
147
135
  when /\AArray<(?<inner_type>.+)>\z/
148
136
  inner_type = Regexp.last_match[:inner_type]
149
137
  value.map { |v| _deserialize(inner_type, v) }
150
- when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
138
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
151
139
  k_type = Regexp.last_match[:k_type]
152
140
  v_type = Regexp.last_match[:v_type]
153
141
  {}.tap do |hash|
@@ -1,24 +1,12 @@
1
1
  =begin
2
2
  #ARTIK Cloud API
3
3
 
4
- #No descripton provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
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'
@@ -125,7 +113,7 @@ module ArtikCloud
125
113
  def build_from_hash(attributes)
126
114
  return nil unless attributes.is_a?(Hash)
127
115
  self.class.swagger_types.each_pair do |key, type|
128
- if type =~ /^Array<(.*)>/i
116
+ if type =~ /\AArray<(.*)>/i
129
117
  # check to ensure the input is an array given that the the attribute
130
118
  # is documented as an array but the input is not
131
119
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -156,7 +144,7 @@ module ArtikCloud
156
144
  when :Float
157
145
  value.to_f
158
146
  when :BOOLEAN
159
- if value.to_s =~ /^(true|t|yes|y|1)$/i
147
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
160
148
  true
161
149
  else
162
150
  false
@@ -167,7 +155,7 @@ module ArtikCloud
167
155
  when /\AArray<(?<inner_type>.+)>\z/
168
156
  inner_type = Regexp.last_match[:inner_type]
169
157
  value.map { |v| _deserialize(inner_type, v) }
170
- when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
158
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
171
159
  k_type = Regexp.last_match[:k_type]
172
160
  v_type = Regexp.last_match[:v_type]
173
161
  {}.tap do |hash|
@@ -1,24 +1,12 @@
1
1
  =begin
2
2
  #ARTIK Cloud API
3
3
 
4
- #No descripton provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
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'
@@ -107,7 +95,7 @@ module ArtikCloud
107
95
  def build_from_hash(attributes)
108
96
  return nil unless attributes.is_a?(Hash)
109
97
  self.class.swagger_types.each_pair do |key, type|
110
- if type =~ /^Array<(.*)>/i
98
+ if type =~ /\AArray<(.*)>/i
111
99
  # check to ensure the input is an array given that the the attribute
112
100
  # is documented as an array but the input is not
113
101
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -138,7 +126,7 @@ module ArtikCloud
138
126
  when :Float
139
127
  value.to_f
140
128
  when :BOOLEAN
141
- if value.to_s =~ /^(true|t|yes|y|1)$/i
129
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
142
130
  true
143
131
  else
144
132
  false
@@ -149,7 +137,7 @@ module ArtikCloud
149
137
  when /\AArray<(?<inner_type>.+)>\z/
150
138
  inner_type = Regexp.last_match[:inner_type]
151
139
  value.map { |v| _deserialize(inner_type, v) }
152
- when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
140
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
153
141
  k_type = Regexp.last_match[:k_type]
154
142
  v_type = Regexp.last_match[:v_type]
155
143
  {}.tap do |hash|
@@ -1,24 +1,12 @@
1
1
  =begin
2
2
  #ARTIK Cloud API
3
3
 
4
- #No descripton provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
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'
@@ -116,7 +104,7 @@ module ArtikCloud
116
104
  def build_from_hash(attributes)
117
105
  return nil unless attributes.is_a?(Hash)
118
106
  self.class.swagger_types.each_pair do |key, type|
119
- if type =~ /^Array<(.*)>/i
107
+ if type =~ /\AArray<(.*)>/i
120
108
  # check to ensure the input is an array given that the the attribute
121
109
  # is documented as an array but the input is not
122
110
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -147,7 +135,7 @@ module ArtikCloud
147
135
  when :Float
148
136
  value.to_f
149
137
  when :BOOLEAN
150
- if value.to_s =~ /^(true|t|yes|y|1)$/i
138
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
151
139
  true
152
140
  else
153
141
  false
@@ -158,7 +146,7 @@ module ArtikCloud
158
146
  when /\AArray<(?<inner_type>.+)>\z/
159
147
  inner_type = Regexp.last_match[:inner_type]
160
148
  value.map { |v| _deserialize(inner_type, v) }
161
- when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
149
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
162
150
  k_type = Regexp.last_match[:k_type]
163
151
  v_type = Regexp.last_match[:v_type]
164
152
  {}.tap do |hash|
@@ -1,24 +1,12 @@
1
1
  =begin
2
2
  #ARTIK Cloud API
3
3
 
4
- #No descripton provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
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'
@@ -105,7 +93,7 @@ module ArtikCloud
105
93
  def build_from_hash(attributes)
106
94
  return nil unless attributes.is_a?(Hash)
107
95
  self.class.swagger_types.each_pair do |key, type|
108
- if type =~ /^Array<(.*)>/i
96
+ if type =~ /\AArray<(.*)>/i
109
97
  # check to ensure the input is an array given that the the attribute
110
98
  # is documented as an array but the input is not
111
99
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -136,7 +124,7 @@ module ArtikCloud
136
124
  when :Float
137
125
  value.to_f
138
126
  when :BOOLEAN
139
- if value.to_s =~ /^(true|t|yes|y|1)$/i
127
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
140
128
  true
141
129
  else
142
130
  false
@@ -147,7 +135,7 @@ module ArtikCloud
147
135
  when /\AArray<(?<inner_type>.+)>\z/
148
136
  inner_type = Regexp.last_match[:inner_type]
149
137
  value.map { |v| _deserialize(inner_type, v) }
150
- when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
138
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
151
139
  k_type = Regexp.last_match[:k_type]
152
140
  v_type = Regexp.last_match[:v_type]
153
141
  {}.tap do |hash|
@@ -0,0 +1,348 @@
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 Subscription
17
+ # AWS region (if subscriptionType is awsKinesis
18
+ attr_accessor :aws_region
19
+
20
+ # Include Shared Devices
21
+ attr_accessor :include_shared_devices
22
+
23
+ # Description
24
+ attr_accessor :description
25
+
26
+ # AWS key (if subscriptionType is awsKinesis
27
+ attr_accessor :aws_key
28
+
29
+ # AWS secret (if subscriptionType is awsKinesis
30
+ attr_accessor :aws_secret
31
+
32
+ # Creation timestamp
33
+ attr_accessor :created_on
34
+
35
+ # AWS Kinesis stream name (if subscriptionType is awsKinesis
36
+ attr_accessor :aws_kinesis_stream_name
37
+
38
+ # User ID
39
+ attr_accessor :uid
40
+
41
+ # Message type
42
+ attr_accessor :message_type
43
+
44
+ # Destination device ID
45
+ attr_accessor :ddid
46
+
47
+ # Subscription type (either httpCallback or awsKinesis, default to httpCallback)
48
+ attr_accessor :subscription_type
49
+
50
+ # Name
51
+ attr_accessor :name
52
+
53
+ # Source device ID
54
+ attr_accessor :sdid
55
+
56
+ # Callback URL
57
+ attr_accessor :callback_url
58
+
59
+ # Subscription ID
60
+ attr_accessor :id
61
+
62
+ # Application ID
63
+ attr_accessor :aid
64
+
65
+ # Source device type ID
66
+ attr_accessor :sdtid
67
+
68
+
69
+ # Attribute mapping from ruby-style variable name to JSON key.
70
+ def self.attribute_map
71
+ {
72
+ :'aws_region' => :'awsRegion',
73
+ :'include_shared_devices' => :'includeSharedDevices',
74
+ :'description' => :'description',
75
+ :'aws_key' => :'awsKey',
76
+ :'aws_secret' => :'awsSecret',
77
+ :'created_on' => :'createdOn',
78
+ :'aws_kinesis_stream_name' => :'awsKinesisStreamName',
79
+ :'uid' => :'uid',
80
+ :'message_type' => :'messageType',
81
+ :'ddid' => :'ddid',
82
+ :'subscription_type' => :'subscriptionType',
83
+ :'name' => :'name',
84
+ :'sdid' => :'sdid',
85
+ :'callback_url' => :'callbackUrl',
86
+ :'id' => :'id',
87
+ :'aid' => :'aid',
88
+ :'sdtid' => :'sdtid'
89
+ }
90
+ end
91
+
92
+ # Attribute type mapping.
93
+ def self.swagger_types
94
+ {
95
+ :'aws_region' => :'String',
96
+ :'include_shared_devices' => :'BOOLEAN',
97
+ :'description' => :'String',
98
+ :'aws_key' => :'String',
99
+ :'aws_secret' => :'String',
100
+ :'created_on' => :'Integer',
101
+ :'aws_kinesis_stream_name' => :'String',
102
+ :'uid' => :'String',
103
+ :'message_type' => :'String',
104
+ :'ddid' => :'String',
105
+ :'subscription_type' => :'String',
106
+ :'name' => :'String',
107
+ :'sdid' => :'String',
108
+ :'callback_url' => :'String',
109
+ :'id' => :'String',
110
+ :'aid' => :'String',
111
+ :'sdtid' => :'String'
112
+ }
113
+ end
114
+
115
+ # Initializes the object
116
+ # @param [Hash] attributes Model attributes in the form of hash
117
+ def initialize(attributes = {})
118
+ return unless attributes.is_a?(Hash)
119
+
120
+ # convert string to symbol for hash key
121
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
122
+
123
+ if attributes.has_key?(:'awsRegion')
124
+ self.aws_region = attributes[:'awsRegion']
125
+ end
126
+
127
+ if attributes.has_key?(:'includeSharedDevices')
128
+ self.include_shared_devices = attributes[:'includeSharedDevices']
129
+ end
130
+
131
+ if attributes.has_key?(:'description')
132
+ self.description = attributes[:'description']
133
+ end
134
+
135
+ if attributes.has_key?(:'awsKey')
136
+ self.aws_key = attributes[:'awsKey']
137
+ end
138
+
139
+ if attributes.has_key?(:'awsSecret')
140
+ self.aws_secret = attributes[:'awsSecret']
141
+ end
142
+
143
+ if attributes.has_key?(:'createdOn')
144
+ self.created_on = attributes[:'createdOn']
145
+ end
146
+
147
+ if attributes.has_key?(:'awsKinesisStreamName')
148
+ self.aws_kinesis_stream_name = attributes[:'awsKinesisStreamName']
149
+ end
150
+
151
+ if attributes.has_key?(:'uid')
152
+ self.uid = attributes[:'uid']
153
+ end
154
+
155
+ if attributes.has_key?(:'messageType')
156
+ self.message_type = attributes[:'messageType']
157
+ end
158
+
159
+ if attributes.has_key?(:'ddid')
160
+ self.ddid = attributes[:'ddid']
161
+ end
162
+
163
+ if attributes.has_key?(:'subscriptionType')
164
+ self.subscription_type = attributes[:'subscriptionType']
165
+ end
166
+
167
+ if attributes.has_key?(:'name')
168
+ self.name = attributes[:'name']
169
+ end
170
+
171
+ if attributes.has_key?(:'sdid')
172
+ self.sdid = attributes[:'sdid']
173
+ end
174
+
175
+ if attributes.has_key?(:'callbackUrl')
176
+ self.callback_url = attributes[:'callbackUrl']
177
+ end
178
+
179
+ if attributes.has_key?(:'id')
180
+ self.id = attributes[:'id']
181
+ end
182
+
183
+ if attributes.has_key?(:'aid')
184
+ self.aid = attributes[:'aid']
185
+ end
186
+
187
+ if attributes.has_key?(:'sdtid')
188
+ self.sdtid = attributes[:'sdtid']
189
+ end
190
+
191
+ end
192
+
193
+ # Show invalid properties with the reasons. Usually used together with valid?
194
+ # @return Array for valid properies with the reasons
195
+ def list_invalid_properties
196
+ invalid_properties = Array.new
197
+ return invalid_properties
198
+ end
199
+
200
+ # Check to see if the all the properties in the model are valid
201
+ # @return true if the model is valid
202
+ def valid?
203
+ return true
204
+ end
205
+
206
+ # Checks equality by comparing each attribute.
207
+ # @param [Object] Object to be compared
208
+ def ==(o)
209
+ return true if self.equal?(o)
210
+ self.class == o.class &&
211
+ aws_region == o.aws_region &&
212
+ include_shared_devices == o.include_shared_devices &&
213
+ description == o.description &&
214
+ aws_key == o.aws_key &&
215
+ aws_secret == o.aws_secret &&
216
+ created_on == o.created_on &&
217
+ aws_kinesis_stream_name == o.aws_kinesis_stream_name &&
218
+ uid == o.uid &&
219
+ message_type == o.message_type &&
220
+ ddid == o.ddid &&
221
+ subscription_type == o.subscription_type &&
222
+ name == o.name &&
223
+ sdid == o.sdid &&
224
+ callback_url == o.callback_url &&
225
+ id == o.id &&
226
+ aid == o.aid &&
227
+ sdtid == o.sdtid
228
+ end
229
+
230
+ # @see the `==` method
231
+ # @param [Object] Object to be compared
232
+ def eql?(o)
233
+ self == o
234
+ end
235
+
236
+ # Calculates hash code according to all attributes.
237
+ # @return [Fixnum] Hash code
238
+ def hash
239
+ [aws_region, include_shared_devices, description, aws_key, aws_secret, created_on, aws_kinesis_stream_name, uid, message_type, ddid, subscription_type, name, sdid, callback_url, id, aid, sdtid].hash
240
+ end
241
+
242
+ # Builds the object from hash
243
+ # @param [Hash] attributes Model attributes in the form of hash
244
+ # @return [Object] Returns the model itself
245
+ def build_from_hash(attributes)
246
+ return nil unless attributes.is_a?(Hash)
247
+ self.class.swagger_types.each_pair do |key, type|
248
+ if type =~ /\AArray<(.*)>/i
249
+ # check to ensure the input is an array given that the the attribute
250
+ # is documented as an array but the input is not
251
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
252
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
253
+ end
254
+ elsif !attributes[self.class.attribute_map[key]].nil?
255
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
256
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
257
+ end
258
+
259
+ self
260
+ end
261
+
262
+ # Deserializes the data based on type
263
+ # @param string type Data type
264
+ # @param string value Value to be deserialized
265
+ # @return [Object] Deserialized data
266
+ def _deserialize(type, value)
267
+ case type.to_sym
268
+ when :DateTime
269
+ DateTime.parse(value)
270
+ when :Date
271
+ Date.parse(value)
272
+ when :String
273
+ value.to_s
274
+ when :Integer
275
+ value.to_i
276
+ when :Float
277
+ value.to_f
278
+ when :BOOLEAN
279
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
280
+ true
281
+ else
282
+ false
283
+ end
284
+ when :Object
285
+ # generic object (usually a Hash), return directly
286
+ value
287
+ when /\AArray<(?<inner_type>.+)>\z/
288
+ inner_type = Regexp.last_match[:inner_type]
289
+ value.map { |v| _deserialize(inner_type, v) }
290
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
291
+ k_type = Regexp.last_match[:k_type]
292
+ v_type = Regexp.last_match[:v_type]
293
+ {}.tap do |hash|
294
+ value.each do |k, v|
295
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
296
+ end
297
+ end
298
+ else # model
299
+ temp_model = ArtikCloud.const_get(type).new
300
+ temp_model.build_from_hash(value)
301
+ end
302
+ end
303
+
304
+ # Returns the string representation of the object
305
+ # @return [String] String presentation of the object
306
+ def to_s
307
+ to_hash.to_s
308
+ end
309
+
310
+ # to_body is an alias to to_hash (backward compatibility)
311
+ # @return [Hash] Returns the object in the form of hash
312
+ def to_body
313
+ to_hash
314
+ end
315
+
316
+ # Returns the object in the form of hash
317
+ # @return [Hash] Returns the object in the form of hash
318
+ def to_hash
319
+ hash = {}
320
+ self.class.attribute_map.each_pair do |attr, param|
321
+ value = self.send(attr)
322
+ next if value.nil?
323
+ hash[param] = _to_hash(value)
324
+ end
325
+ hash
326
+ end
327
+
328
+ # Outputs non-array value in the form of hash
329
+ # For object, use to_hash. Otherwise, just return the value
330
+ # @param [Object] value Any valid value
331
+ # @return [Hash] Returns the value in the form of hash
332
+ def _to_hash(value)
333
+ if value.is_a?(Array)
334
+ value.compact.map{ |v| _to_hash(v) }
335
+ elsif value.is_a?(Hash)
336
+ {}.tap do |hash|
337
+ value.each { |k, v| hash[k] = _to_hash(v) }
338
+ end
339
+ elsif value.respond_to? :to_hash
340
+ value.to_hash
341
+ else
342
+ value
343
+ end
344
+ end
345
+
346
+ end
347
+
348
+ end