artikcloud 2.0.0 → 2.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (144) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +12 -12
  3. data/README.md +33 -10
  4. data/artikcloud.gemspec +5 -6
  5. data/docs/Action.md +9 -0
  6. data/docs/ActionArray.md +8 -0
  7. data/docs/Actions.md +12 -0
  8. data/docs/DeviceTypesApi.md +10 -10
  9. data/docs/DevicesApi.md +68 -15
  10. data/docs/ExportApi.md +10 -10
  11. data/docs/Message.md +11 -0
  12. data/docs/MessagesApi.md +205 -27
  13. data/docs/NormalizedAction.md +16 -0
  14. data/docs/NormalizedActionsEnvelope.md +17 -0
  15. data/docs/PresenceEnvelope.md +9 -0
  16. data/docs/PresenceModel.md +9 -0
  17. data/docs/RegistrationsApi.md +6 -6
  18. data/docs/RulesApi.md +8 -8
  19. data/docs/RulesEnvelope.md +1 -1
  20. data/docs/SnapshotResponse.md +9 -0
  21. data/docs/SnapshotResponses.md +10 -0
  22. data/docs/SnapshotsResponseEnvelope.md +9 -0
  23. data/docs/TagsApi.md +7 -7
  24. data/docs/TokenInfo.md +11 -0
  25. data/docs/TokenInfoSuccessResponse.md +8 -0
  26. data/docs/TokensApi.md +54 -7
  27. data/docs/UsersApi.md +18 -20
  28. data/git_push.sh +16 -1
  29. data/lib/artikcloud/api/device_types_api.rb +52 -59
  30. data/lib/artikcloud/api/devices_api.rb +120 -76
  31. data/lib/artikcloud/api/export_api.rb +43 -45
  32. data/lib/artikcloud/api/messages_api.rb +285 -103
  33. data/lib/artikcloud/api/registrations_api.rb +34 -34
  34. data/lib/artikcloud/api/rules_api.rb +43 -48
  35. data/lib/artikcloud/api/tags_api.rb +37 -35
  36. data/lib/artikcloud/api/tokens_api.rb +85 -30
  37. data/lib/artikcloud/api/users_api.rb +83 -102
  38. data/lib/artikcloud/api_client.rb +56 -13
  39. data/lib/artikcloud/api_error.rb +13 -4
  40. data/lib/artikcloud/configuration.rb +45 -1
  41. data/lib/artikcloud/models/ack_envelope.rb +59 -24
  42. data/lib/artikcloud/models/acknowledgement.rb +65 -33
  43. data/lib/artikcloud/models/action.rb +212 -0
  44. data/lib/artikcloud/models/action_array.rb +201 -0
  45. data/lib/artikcloud/models/action_details.rb +61 -27
  46. data/lib/artikcloud/models/action_details_array.rb +59 -24
  47. data/lib/artikcloud/models/action_in.rb +69 -39
  48. data/lib/artikcloud/models/action_out.rb +67 -36
  49. data/lib/artikcloud/models/actions.rb +241 -0
  50. data/lib/artikcloud/models/aggregate_data.rb +69 -39
  51. data/lib/artikcloud/models/aggregates_histogram_data.rb +71 -42
  52. data/lib/artikcloud/models/aggregates_histogram_response.rb +71 -42
  53. data/lib/artikcloud/models/aggregates_response.rb +69 -39
  54. data/lib/artikcloud/models/app_properties.rb +64 -30
  55. data/lib/artikcloud/models/check_token_message.rb +59 -24
  56. data/lib/artikcloud/models/check_token_response.rb +59 -24
  57. data/lib/artikcloud/models/device.rb +85 -63
  58. data/lib/artikcloud/models/device_array.rb +59 -24
  59. data/lib/artikcloud/models/device_envelope.rb +60 -24
  60. data/lib/artikcloud/models/device_reg_complete_request.rb +59 -24
  61. data/lib/artikcloud/models/device_reg_confirm_user_request.rb +63 -30
  62. data/lib/artikcloud/models/device_reg_confirm_user_response.rb +59 -24
  63. data/lib/artikcloud/models/device_reg_confirm_user_response_envelope.rb +59 -24
  64. data/lib/artikcloud/models/device_reg_status_response.rb +61 -27
  65. data/lib/artikcloud/models/device_reg_status_response_envelope.rb +59 -24
  66. data/lib/artikcloud/models/device_token.rb +69 -33
  67. data/lib/artikcloud/models/device_token_envelope.rb +60 -24
  68. data/lib/artikcloud/models/device_type.rb +93 -75
  69. data/lib/artikcloud/models/device_type_array.rb +59 -24
  70. data/lib/artikcloud/models/device_type_envelope.rb +60 -24
  71. data/lib/artikcloud/models/device_types_envelope.rb +68 -33
  72. data/lib/artikcloud/models/devices_envelope.rb +68 -33
  73. data/lib/artikcloud/models/error_envelope.rb +59 -24
  74. data/lib/artikcloud/models/export_data.rb +71 -42
  75. data/lib/artikcloud/models/export_data_array.rb +59 -24
  76. data/lib/artikcloud/models/export_history_response.rb +65 -33
  77. data/lib/artikcloud/models/export_normalized_messages_response.rb +83 -60
  78. data/lib/artikcloud/models/export_request.rb +73 -45
  79. data/lib/artikcloud/models/export_request_data.rb +79 -54
  80. data/lib/artikcloud/models/export_request_info.rb +77 -51
  81. data/lib/artikcloud/models/export_request_response.rb +59 -24
  82. data/lib/artikcloud/models/export_response.rb +79 -54
  83. data/lib/artikcloud/models/export_status_response.rb +67 -36
  84. data/lib/artikcloud/models/field_path.rb +59 -24
  85. data/lib/artikcloud/models/field_presence.rb +60 -24
  86. data/lib/artikcloud/models/field_presence_envelope.rb +78 -42
  87. data/lib/artikcloud/models/fields_actions.rb +61 -27
  88. data/lib/artikcloud/models/manifest_properties.rb +60 -24
  89. data/lib/artikcloud/models/manifest_properties_envelope.rb +60 -24
  90. data/lib/artikcloud/models/manifest_versions.rb +60 -24
  91. data/lib/artikcloud/models/manifest_versions_envelope.rb +60 -24
  92. data/lib/artikcloud/models/message.rb +233 -0
  93. data/lib/artikcloud/models/message_action.rb +67 -36
  94. data/lib/artikcloud/models/message_id.rb +59 -24
  95. data/lib/artikcloud/models/message_id_envelope.rb +59 -24
  96. data/lib/artikcloud/models/message_in.rb +69 -39
  97. data/lib/artikcloud/models/message_out.rb +67 -36
  98. data/lib/artikcloud/models/non_empty_string.rb +59 -24
  99. data/lib/artikcloud/models/normalized_action.rb +279 -0
  100. data/lib/artikcloud/models/normalized_actions_envelope.rb +285 -0
  101. data/lib/artikcloud/models/normalized_message.rb +81 -45
  102. data/lib/artikcloud/models/normalized_messages_envelope.rb +80 -51
  103. data/lib/artikcloud/models/output_rule.rb +85 -63
  104. data/lib/artikcloud/models/presence_envelope.rb +208 -0
  105. data/lib/artikcloud/models/presence_model.rb +208 -0
  106. data/lib/artikcloud/models/properties_envelope.rb +60 -24
  107. data/lib/artikcloud/models/refresh_token_response.rb +65 -33
  108. data/lib/artikcloud/models/register_message.rb +67 -36
  109. data/lib/artikcloud/models/rule_array.rb +59 -24
  110. data/lib/artikcloud/models/rule_creation_info.rb +65 -33
  111. data/lib/artikcloud/models/rule_envelope.rb +59 -24
  112. data/lib/artikcloud/models/rule_error.rb +65 -33
  113. data/lib/artikcloud/models/rule_update_info.rb +65 -33
  114. data/lib/artikcloud/models/rule_warning_output.rb +61 -27
  115. data/lib/artikcloud/models/rules_envelope.rb +69 -35
  116. data/lib/artikcloud/models/snapshot_response.rb +210 -0
  117. data/lib/artikcloud/models/snapshot_responses.rb +219 -0
  118. data/lib/artikcloud/models/snapshots_response_envelope.rb +208 -0
  119. data/lib/artikcloud/models/tag.rb +61 -27
  120. data/lib/artikcloud/models/tag_array.rb +59 -24
  121. data/lib/artikcloud/models/tags_envelope.rb +59 -24
  122. data/lib/artikcloud/models/token.rb +65 -33
  123. data/lib/artikcloud/models/token_info.rb +226 -0
  124. data/lib/artikcloud/models/token_info_success_response.rb +199 -0
  125. data/lib/artikcloud/models/token_request.rb +59 -24
  126. data/lib/artikcloud/models/token_response.rb +59 -24
  127. data/lib/artikcloud/models/unregister_device_response.rb +79 -54
  128. data/lib/artikcloud/models/unregister_device_response_envelope.rb +59 -24
  129. data/lib/artikcloud/models/user.rb +77 -42
  130. data/lib/artikcloud/models/user_envelope.rb +60 -24
  131. data/lib/artikcloud/models/web_socket_error.rb +63 -30
  132. data/lib/artikcloud/version.rb +14 -5
  133. data/lib/artikcloud.rb +26 -4
  134. data/spec/api/device_types_api_spec.rb +110 -0
  135. data/spec/api/devices_api_spec.rb +143 -0
  136. data/spec/api/export_api_spec.rb +96 -0
  137. data/spec/api/messages_api_spec.rb +7 -7
  138. data/spec/api/registrations_api_spec.rb +82 -0
  139. data/spec/api/rules_api_spec.rb +96 -0
  140. data/spec/api/tags_api_spec.rb +84 -0
  141. data/spec/api/tokens_api_spec.rb +12 -21
  142. data/spec/api/users_api_spec.rb +1 -1
  143. data/spec/spec_helper.rb +1 -1
  144. metadata +60 -22
@@ -1,14 +1,23 @@
1
1
  =begin
2
- ARTIK Cloud API
2
+ #ARTIK Cloud API
3
+
4
+ #No descripton provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
3
5
 
4
6
  OpenAPI spec version: 2.0.0
5
7
 
6
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
7
9
 
8
- License: MIT
9
- http://en.wikipedia.org/wiki/MIT_License
10
+ Licensed under the Apache License, Version 2.0 (the "License");
11
+ you may not use this file except in compliance with the License.
12
+ You may obtain a copy of the License at
13
+
14
+ http://www.apache.org/licenses/LICENSE-2.0
10
15
 
11
- Terms of Service: http://www.samsung.com/global/business/mobile/info/terms-and-conditions.html
16
+ Unless required by applicable law or agreed to in writing, software
17
+ distributed under the License is distributed on an "AS IS" BASIS,
18
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ See the License for the specific language governing permissions and
20
+ limitations under the License.
12
21
 
13
22
  =end
14
23
 
@@ -19,12 +28,11 @@ module ArtikCloud
19
28
  class DeviceTokenEnvelope
20
29
  attr_accessor :data
21
30
 
31
+
22
32
  # Attribute mapping from ruby-style variable name to JSON key.
23
33
  def self.attribute_map
24
34
  {
25
-
26
35
  :'data' => :'data'
27
-
28
36
  }
29
37
  end
30
38
 
@@ -32,24 +40,39 @@ module ArtikCloud
32
40
  def self.swagger_types
33
41
  {
34
42
  :'data' => :'DeviceToken'
35
-
36
43
  }
37
44
  end
38
45
 
46
+ # Initializes the object
47
+ # @param [Hash] attributes Model attributes in the form of hash
39
48
  def initialize(attributes = {})
40
49
  return unless attributes.is_a?(Hash)
41
50
 
42
51
  # convert string to symbol for hash key
43
- attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
52
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
44
53
 
45
-
46
- if attributes[:'data']
54
+ if attributes.has_key?(:'data')
47
55
  self.data = attributes[:'data']
48
56
  end
49
-
57
+
58
+ end
59
+
60
+ # Show invalid properties with the reasons. Usually used together with valid?
61
+ # @return Array for valid properies with the reasons
62
+ def list_invalid_properties
63
+ invalid_properties = Array.new
64
+ return invalid_properties
50
65
  end
51
66
 
52
- # Check equality by comparing each attribute.
67
+ # Check to see if the all the properties in the model are valid
68
+ # @return true if the model is valid
69
+ def valid?
70
+ return false if @data.nil?
71
+ return true
72
+ end
73
+
74
+ # Checks equality by comparing each attribute.
75
+ # @param [Object] Object to be compared
53
76
  def ==(o)
54
77
  return true if self.equal?(o)
55
78
  self.class == o.class &&
@@ -57,35 +80,41 @@ module ArtikCloud
57
80
  end
58
81
 
59
82
  # @see the `==` method
83
+ # @param [Object] Object to be compared
60
84
  def eql?(o)
61
85
  self == o
62
86
  end
63
87
 
64
- # Calculate hash code according to all attributes.
88
+ # Calculates hash code according to all attributes.
89
+ # @return [Fixnum] Hash code
65
90
  def hash
66
91
  [data].hash
67
92
  end
68
93
 
69
- # build the object from hash
94
+ # Builds the object from hash
95
+ # @param [Hash] attributes Model attributes in the form of hash
96
+ # @return [Object] Returns the model itself
70
97
  def build_from_hash(attributes)
71
98
  return nil unless attributes.is_a?(Hash)
72
99
  self.class.swagger_types.each_pair do |key, type|
73
100
  if type =~ /^Array<(.*)>/i
101
+ # check to ensure the input is an array given that the the attribute
102
+ # is documented as an array but the input is not
74
103
  if attributes[self.class.attribute_map[key]].is_a?(Array)
75
104
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
76
- else
77
- #TODO show warning in debug mode
78
105
  end
79
106
  elsif !attributes[self.class.attribute_map[key]].nil?
80
107
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
81
- else
82
- # data not found in attributes(hash), not an issue as the data can be optional
83
- end
108
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
84
109
  end
85
110
 
86
111
  self
87
112
  end
88
113
 
114
+ # Deserializes the data based on type
115
+ # @param string type Data type
116
+ # @param string value Value to be deserialized
117
+ # @return [Object] Deserialized data
89
118
  def _deserialize(type, value)
90
119
  case type.to_sym
91
120
  when :DateTime
@@ -119,21 +148,25 @@ module ArtikCloud
119
148
  end
120
149
  end
121
150
  else # model
122
- _model = ArtikCloud.const_get(type).new
123
- _model.build_from_hash(value)
151
+ temp_model = ArtikCloud.const_get(type).new
152
+ temp_model.build_from_hash(value)
124
153
  end
125
154
  end
126
155
 
156
+ # Returns the string representation of the object
157
+ # @return [String] String presentation of the object
127
158
  def to_s
128
159
  to_hash.to_s
129
160
  end
130
161
 
131
- # to_body is an alias to to_body (backward compatibility))
162
+ # to_body is an alias to to_hash (backward compatibility)
163
+ # @return [Hash] Returns the object in the form of hash
132
164
  def to_body
133
165
  to_hash
134
166
  end
135
167
 
136
- # return the object in the form of hash
168
+ # Returns the object in the form of hash
169
+ # @return [Hash] Returns the object in the form of hash
137
170
  def to_hash
138
171
  hash = {}
139
172
  self.class.attribute_map.each_pair do |attr, param|
@@ -144,8 +177,10 @@ module ArtikCloud
144
177
  hash
145
178
  end
146
179
 
147
- # Method to output non-array value in the form of hash
180
+ # Outputs non-array value in the form of hash
148
181
  # For object, use to_hash. Otherwise, just return the value
182
+ # @param [Object] value Any valid value
183
+ # @return [Hash] Returns the value in the form of hash
149
184
  def _to_hash(value)
150
185
  if value.is_a?(Array)
151
186
  value.compact.map{ |v| _to_hash(v) }
@@ -161,4 +196,5 @@ module ArtikCloud
161
196
  end
162
197
 
163
198
  end
199
+
164
200
  end
@@ -1,14 +1,23 @@
1
1
  =begin
2
- ARTIK Cloud API
2
+ #ARTIK Cloud API
3
+
4
+ #No descripton provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
3
5
 
4
6
  OpenAPI spec version: 2.0.0
5
7
 
6
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
7
9
 
8
- License: MIT
9
- http://en.wikipedia.org/wiki/MIT_License
10
+ Licensed under the Apache License, Version 2.0 (the "License");
11
+ you may not use this file except in compliance with the License.
12
+ You may obtain a copy of the License at
13
+
14
+ http://www.apache.org/licenses/LICENSE-2.0
10
15
 
11
- Terms of Service: http://www.samsung.com/global/business/mobile/info/terms-and-conditions.html
16
+ Unless required by applicable law or agreed to in writing, software
17
+ distributed under the License is distributed on an "AS IS" BASIS,
18
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ See the License for the specific language governing permissions and
20
+ limitations under the License.
12
21
 
13
22
  =end
14
23
 
@@ -70,46 +79,28 @@ module ArtikCloud
70
79
  # Vendor ID. (Used in SDR)
71
80
  attr_accessor :vid
72
81
 
82
+
73
83
  # Attribute mapping from ruby-style variable name to JSON key.
74
84
  def self.attribute_map
75
85
  {
76
-
77
86
  :'id' => :'id',
78
-
79
87
  :'unique_name' => :'uniqueName',
80
-
81
88
  :'latest_version' => :'latestVersion',
82
-
83
89
  :'last_updated' => :'lastUpdated',
84
-
85
90
  :'name' => :'name',
86
-
87
91
  :'description' => :'description',
88
-
89
92
  :'uid' => :'uid',
90
-
91
93
  :'oid' => :'oid',
92
-
93
94
  :'has_cloud_connector' => :'hasCloudConnector',
94
-
95
95
  :'approved' => :'approved',
96
-
97
96
  :'published' => :'published',
98
-
99
97
  :'protected' => :'protected',
100
-
101
98
  :'in_store' => :'inStore',
102
-
103
99
  :'owned_by_current_user' => :'ownedByCurrentUser',
104
-
105
100
  :'tags' => :'tags',
106
-
107
101
  :'rsp' => :'rsp',
108
-
109
102
  :'issuer_dn' => :'issuerDn',
110
-
111
103
  :'vid' => :'vid'
112
-
113
104
  }
114
105
  end
115
106
 
@@ -134,94 +125,108 @@ module ArtikCloud
134
125
  :'rsp' => :'BOOLEAN',
135
126
  :'issuer_dn' => :'String',
136
127
  :'vid' => :'String'
137
-
138
128
  }
139
129
  end
140
130
 
131
+ # Initializes the object
132
+ # @param [Hash] attributes Model attributes in the form of hash
141
133
  def initialize(attributes = {})
142
134
  return unless attributes.is_a?(Hash)
143
135
 
144
136
  # convert string to symbol for hash key
145
- attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
137
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
146
138
 
147
-
148
- if attributes[:'id']
139
+ if attributes.has_key?(:'id')
149
140
  self.id = attributes[:'id']
150
141
  end
151
-
152
- if attributes[:'uniqueName']
142
+
143
+ if attributes.has_key?(:'uniqueName')
153
144
  self.unique_name = attributes[:'uniqueName']
154
145
  end
155
-
156
- if attributes[:'latestVersion']
146
+
147
+ if attributes.has_key?(:'latestVersion')
157
148
  self.latest_version = attributes[:'latestVersion']
158
149
  end
159
-
160
- if attributes[:'lastUpdated']
150
+
151
+ if attributes.has_key?(:'lastUpdated')
161
152
  self.last_updated = attributes[:'lastUpdated']
162
153
  end
163
-
164
- if attributes[:'name']
154
+
155
+ if attributes.has_key?(:'name')
165
156
  self.name = attributes[:'name']
166
157
  end
167
-
168
- if attributes[:'description']
158
+
159
+ if attributes.has_key?(:'description')
169
160
  self.description = attributes[:'description']
170
161
  end
171
-
172
- if attributes[:'uid']
162
+
163
+ if attributes.has_key?(:'uid')
173
164
  self.uid = attributes[:'uid']
174
165
  end
175
-
176
- if attributes[:'oid']
166
+
167
+ if attributes.has_key?(:'oid')
177
168
  self.oid = attributes[:'oid']
178
169
  end
179
-
180
- if attributes[:'hasCloudConnector']
170
+
171
+ if attributes.has_key?(:'hasCloudConnector')
181
172
  self.has_cloud_connector = attributes[:'hasCloudConnector']
182
173
  end
183
-
184
- if attributes[:'approved']
174
+
175
+ if attributes.has_key?(:'approved')
185
176
  self.approved = attributes[:'approved']
186
177
  end
187
-
188
- if attributes[:'published']
178
+
179
+ if attributes.has_key?(:'published')
189
180
  self.published = attributes[:'published']
190
181
  end
191
-
192
- if attributes[:'protected']
182
+
183
+ if attributes.has_key?(:'protected')
193
184
  self.protected = attributes[:'protected']
194
185
  end
195
-
196
- if attributes[:'inStore']
186
+
187
+ if attributes.has_key?(:'inStore')
197
188
  self.in_store = attributes[:'inStore']
198
189
  end
199
-
200
- if attributes[:'ownedByCurrentUser']
190
+
191
+ if attributes.has_key?(:'ownedByCurrentUser')
201
192
  self.owned_by_current_user = attributes[:'ownedByCurrentUser']
202
193
  end
203
-
204
- if attributes[:'tags']
194
+
195
+ if attributes.has_key?(:'tags')
205
196
  if (value = attributes[:'tags']).is_a?(Array)
206
197
  self.tags = value
207
198
  end
208
199
  end
209
-
210
- if attributes[:'rsp']
200
+
201
+ if attributes.has_key?(:'rsp')
211
202
  self.rsp = attributes[:'rsp']
212
203
  end
213
-
214
- if attributes[:'issuerDn']
204
+
205
+ if attributes.has_key?(:'issuerDn')
215
206
  self.issuer_dn = attributes[:'issuerDn']
216
207
  end
217
-
218
- if attributes[:'vid']
208
+
209
+ if attributes.has_key?(:'vid')
219
210
  self.vid = attributes[:'vid']
220
211
  end
221
-
212
+
222
213
  end
223
214
 
224
- # Check equality by comparing each attribute.
215
+ # Show invalid properties with the reasons. Usually used together with valid?
216
+ # @return Array for valid properies with the reasons
217
+ def list_invalid_properties
218
+ invalid_properties = Array.new
219
+ return invalid_properties
220
+ end
221
+
222
+ # Check to see if the all the properties in the model are valid
223
+ # @return true if the model is valid
224
+ def valid?
225
+ return true
226
+ end
227
+
228
+ # Checks equality by comparing each attribute.
229
+ # @param [Object] Object to be compared
225
230
  def ==(o)
226
231
  return true if self.equal?(o)
227
232
  self.class == o.class &&
@@ -246,35 +251,41 @@ module ArtikCloud
246
251
  end
247
252
 
248
253
  # @see the `==` method
254
+ # @param [Object] Object to be compared
249
255
  def eql?(o)
250
256
  self == o
251
257
  end
252
258
 
253
- # Calculate hash code according to all attributes.
259
+ # Calculates hash code according to all attributes.
260
+ # @return [Fixnum] Hash code
254
261
  def hash
255
262
  [id, unique_name, latest_version, last_updated, name, description, uid, oid, has_cloud_connector, approved, published, protected, in_store, owned_by_current_user, tags, rsp, issuer_dn, vid].hash
256
263
  end
257
264
 
258
- # build the object from hash
265
+ # Builds the object from hash
266
+ # @param [Hash] attributes Model attributes in the form of hash
267
+ # @return [Object] Returns the model itself
259
268
  def build_from_hash(attributes)
260
269
  return nil unless attributes.is_a?(Hash)
261
270
  self.class.swagger_types.each_pair do |key, type|
262
271
  if type =~ /^Array<(.*)>/i
272
+ # check to ensure the input is an array given that the the attribute
273
+ # is documented as an array but the input is not
263
274
  if attributes[self.class.attribute_map[key]].is_a?(Array)
264
275
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
265
- else
266
- #TODO show warning in debug mode
267
276
  end
268
277
  elsif !attributes[self.class.attribute_map[key]].nil?
269
278
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
270
- else
271
- # data not found in attributes(hash), not an issue as the data can be optional
272
- end
279
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
273
280
  end
274
281
 
275
282
  self
276
283
  end
277
284
 
285
+ # Deserializes the data based on type
286
+ # @param string type Data type
287
+ # @param string value Value to be deserialized
288
+ # @return [Object] Deserialized data
278
289
  def _deserialize(type, value)
279
290
  case type.to_sym
280
291
  when :DateTime
@@ -308,21 +319,25 @@ module ArtikCloud
308
319
  end
309
320
  end
310
321
  else # model
311
- _model = ArtikCloud.const_get(type).new
312
- _model.build_from_hash(value)
322
+ temp_model = ArtikCloud.const_get(type).new
323
+ temp_model.build_from_hash(value)
313
324
  end
314
325
  end
315
326
 
327
+ # Returns the string representation of the object
328
+ # @return [String] String presentation of the object
316
329
  def to_s
317
330
  to_hash.to_s
318
331
  end
319
332
 
320
- # to_body is an alias to to_body (backward compatibility))
333
+ # to_body is an alias to to_hash (backward compatibility)
334
+ # @return [Hash] Returns the object in the form of hash
321
335
  def to_body
322
336
  to_hash
323
337
  end
324
338
 
325
- # return the object in the form of hash
339
+ # Returns the object in the form of hash
340
+ # @return [Hash] Returns the object in the form of hash
326
341
  def to_hash
327
342
  hash = {}
328
343
  self.class.attribute_map.each_pair do |attr, param|
@@ -333,8 +348,10 @@ module ArtikCloud
333
348
  hash
334
349
  end
335
350
 
336
- # Method to output non-array value in the form of hash
351
+ # Outputs non-array value in the form of hash
337
352
  # For object, use to_hash. Otherwise, just return the value
353
+ # @param [Object] value Any valid value
354
+ # @return [Hash] Returns the value in the form of hash
338
355
  def _to_hash(value)
339
356
  if value.is_a?(Array)
340
357
  value.compact.map{ |v| _to_hash(v) }
@@ -350,4 +367,5 @@ module ArtikCloud
350
367
  end
351
368
 
352
369
  end
370
+
353
371
  end
@@ -1,14 +1,23 @@
1
1
  =begin
2
- ARTIK Cloud API
2
+ #ARTIK Cloud API
3
+
4
+ #No descripton provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
3
5
 
4
6
  OpenAPI spec version: 2.0.0
5
7
 
6
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
7
9
 
8
- License: MIT
9
- http://en.wikipedia.org/wiki/MIT_License
10
+ Licensed under the Apache License, Version 2.0 (the "License");
11
+ you may not use this file except in compliance with the License.
12
+ You may obtain a copy of the License at
13
+
14
+ http://www.apache.org/licenses/LICENSE-2.0
10
15
 
11
- Terms of Service: http://www.samsung.com/global/business/mobile/info/terms-and-conditions.html
16
+ Unless required by applicable law or agreed to in writing, software
17
+ distributed under the License is distributed on an "AS IS" BASIS,
18
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ See the License for the specific language governing permissions and
20
+ limitations under the License.
12
21
 
13
22
  =end
14
23
 
@@ -19,12 +28,11 @@ module ArtikCloud
19
28
  class DeviceTypeArray
20
29
  attr_accessor :device_types
21
30
 
31
+
22
32
  # Attribute mapping from ruby-style variable name to JSON key.
23
33
  def self.attribute_map
24
34
  {
25
-
26
35
  :'device_types' => :'deviceTypes'
27
-
28
36
  }
29
37
  end
30
38
 
@@ -32,26 +40,40 @@ module ArtikCloud
32
40
  def self.swagger_types
33
41
  {
34
42
  :'device_types' => :'Array<DeviceType>'
35
-
36
43
  }
37
44
  end
38
45
 
46
+ # Initializes the object
47
+ # @param [Hash] attributes Model attributes in the form of hash
39
48
  def initialize(attributes = {})
40
49
  return unless attributes.is_a?(Hash)
41
50
 
42
51
  # convert string to symbol for hash key
43
- attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
52
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
44
53
 
45
-
46
- if attributes[:'deviceTypes']
54
+ if attributes.has_key?(:'deviceTypes')
47
55
  if (value = attributes[:'deviceTypes']).is_a?(Array)
48
56
  self.device_types = value
49
57
  end
50
58
  end
51
-
59
+
60
+ end
61
+
62
+ # Show invalid properties with the reasons. Usually used together with valid?
63
+ # @return Array for valid properies with the reasons
64
+ def list_invalid_properties
65
+ invalid_properties = Array.new
66
+ return invalid_properties
52
67
  end
53
68
 
54
- # Check equality by comparing each attribute.
69
+ # Check to see if the all the properties in the model are valid
70
+ # @return true if the model is valid
71
+ def valid?
72
+ return true
73
+ end
74
+
75
+ # Checks equality by comparing each attribute.
76
+ # @param [Object] Object to be compared
55
77
  def ==(o)
56
78
  return true if self.equal?(o)
57
79
  self.class == o.class &&
@@ -59,35 +81,41 @@ module ArtikCloud
59
81
  end
60
82
 
61
83
  # @see the `==` method
84
+ # @param [Object] Object to be compared
62
85
  def eql?(o)
63
86
  self == o
64
87
  end
65
88
 
66
- # Calculate hash code according to all attributes.
89
+ # Calculates hash code according to all attributes.
90
+ # @return [Fixnum] Hash code
67
91
  def hash
68
92
  [device_types].hash
69
93
  end
70
94
 
71
- # build the object from hash
95
+ # Builds the object from hash
96
+ # @param [Hash] attributes Model attributes in the form of hash
97
+ # @return [Object] Returns the model itself
72
98
  def build_from_hash(attributes)
73
99
  return nil unless attributes.is_a?(Hash)
74
100
  self.class.swagger_types.each_pair do |key, type|
75
101
  if type =~ /^Array<(.*)>/i
102
+ # check to ensure the input is an array given that the the attribute
103
+ # is documented as an array but the input is not
76
104
  if attributes[self.class.attribute_map[key]].is_a?(Array)
77
105
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
78
- else
79
- #TODO show warning in debug mode
80
106
  end
81
107
  elsif !attributes[self.class.attribute_map[key]].nil?
82
108
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
83
- else
84
- # data not found in attributes(hash), not an issue as the data can be optional
85
- end
109
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
86
110
  end
87
111
 
88
112
  self
89
113
  end
90
114
 
115
+ # Deserializes the data based on type
116
+ # @param string type Data type
117
+ # @param string value Value to be deserialized
118
+ # @return [Object] Deserialized data
91
119
  def _deserialize(type, value)
92
120
  case type.to_sym
93
121
  when :DateTime
@@ -121,21 +149,25 @@ module ArtikCloud
121
149
  end
122
150
  end
123
151
  else # model
124
- _model = ArtikCloud.const_get(type).new
125
- _model.build_from_hash(value)
152
+ temp_model = ArtikCloud.const_get(type).new
153
+ temp_model.build_from_hash(value)
126
154
  end
127
155
  end
128
156
 
157
+ # Returns the string representation of the object
158
+ # @return [String] String presentation of the object
129
159
  def to_s
130
160
  to_hash.to_s
131
161
  end
132
162
 
133
- # to_body is an alias to to_body (backward compatibility))
163
+ # to_body is an alias to to_hash (backward compatibility)
164
+ # @return [Hash] Returns the object in the form of hash
134
165
  def to_body
135
166
  to_hash
136
167
  end
137
168
 
138
- # return the object in the form of hash
169
+ # Returns the object in the form of hash
170
+ # @return [Hash] Returns the object in the form of hash
139
171
  def to_hash
140
172
  hash = {}
141
173
  self.class.attribute_map.each_pair do |attr, param|
@@ -146,8 +178,10 @@ module ArtikCloud
146
178
  hash
147
179
  end
148
180
 
149
- # Method to output non-array value in the form of hash
181
+ # Outputs non-array value in the form of hash
150
182
  # For object, use to_hash. Otherwise, just return the value
183
+ # @param [Object] value Any valid value
184
+ # @return [Hash] Returns the value in the form of hash
151
185
  def _to_hash(value)
152
186
  if value.is_a?(Array)
153
187
  value.compact.map{ |v| _to_hash(v) }
@@ -163,4 +197,5 @@ module ArtikCloud
163
197
  end
164
198
 
165
199
  end
200
+
166
201
  end