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
 
@@ -33,26 +42,18 @@ module ArtikCloud
33
42
 
34
43
  attr_accessor :uids
35
44
 
45
+
36
46
  # Attribute mapping from ruby-style variable name to JSON key.
37
47
  def self.attribute_map
38
48
  {
39
-
40
49
  :'end_date' => :'endDate',
41
-
42
50
  :'format' => :'format',
43
-
44
51
  :'order' => :'order',
45
-
46
52
  :'sdids' => :'sdids',
47
-
48
53
  :'sdtids' => :'sdtids',
49
-
50
54
  :'start_date' => :'startDate',
51
-
52
55
  :'trial_id' => :'trialId',
53
-
54
56
  :'uids' => :'uids'
55
-
56
57
  }
57
58
  end
58
59
 
@@ -67,52 +68,66 @@ module ArtikCloud
67
68
  :'start_date' => :'Integer',
68
69
  :'trial_id' => :'String',
69
70
  :'uids' => :'String'
70
-
71
71
  }
72
72
  end
73
73
 
74
+ # Initializes the object
75
+ # @param [Hash] attributes Model attributes in the form of hash
74
76
  def initialize(attributes = {})
75
77
  return unless attributes.is_a?(Hash)
76
78
 
77
79
  # convert string to symbol for hash key
78
- attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
80
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
79
81
 
80
-
81
- if attributes[:'endDate']
82
+ if attributes.has_key?(:'endDate')
82
83
  self.end_date = attributes[:'endDate']
83
84
  end
84
-
85
- if attributes[:'format']
85
+
86
+ if attributes.has_key?(:'format')
86
87
  self.format = attributes[:'format']
87
88
  end
88
-
89
- if attributes[:'order']
89
+
90
+ if attributes.has_key?(:'order')
90
91
  self.order = attributes[:'order']
91
92
  end
92
-
93
- if attributes[:'sdids']
93
+
94
+ if attributes.has_key?(:'sdids')
94
95
  self.sdids = attributes[:'sdids']
95
96
  end
96
-
97
- if attributes[:'sdtids']
97
+
98
+ if attributes.has_key?(:'sdtids')
98
99
  self.sdtids = attributes[:'sdtids']
99
100
  end
100
-
101
- if attributes[:'startDate']
101
+
102
+ if attributes.has_key?(:'startDate')
102
103
  self.start_date = attributes[:'startDate']
103
104
  end
104
-
105
- if attributes[:'trialId']
105
+
106
+ if attributes.has_key?(:'trialId')
106
107
  self.trial_id = attributes[:'trialId']
107
108
  end
108
-
109
- if attributes[:'uids']
109
+
110
+ if attributes.has_key?(:'uids')
110
111
  self.uids = attributes[:'uids']
111
112
  end
112
-
113
+
113
114
  end
114
115
 
115
- # Check equality by comparing each attribute.
116
+ # Show invalid properties with the reasons. Usually used together with valid?
117
+ # @return Array for valid properies with the reasons
118
+ def list_invalid_properties
119
+ invalid_properties = Array.new
120
+ return invalid_properties
121
+ end
122
+
123
+ # Check to see if the all the properties in the model are valid
124
+ # @return true if the model is valid
125
+ def valid?
126
+ return true
127
+ end
128
+
129
+ # Checks equality by comparing each attribute.
130
+ # @param [Object] Object to be compared
116
131
  def ==(o)
117
132
  return true if self.equal?(o)
118
133
  self.class == o.class &&
@@ -127,35 +142,41 @@ module ArtikCloud
127
142
  end
128
143
 
129
144
  # @see the `==` method
145
+ # @param [Object] Object to be compared
130
146
  def eql?(o)
131
147
  self == o
132
148
  end
133
149
 
134
- # Calculate hash code according to all attributes.
150
+ # Calculates hash code according to all attributes.
151
+ # @return [Fixnum] Hash code
135
152
  def hash
136
153
  [end_date, format, order, sdids, sdtids, start_date, trial_id, uids].hash
137
154
  end
138
155
 
139
- # build the object from hash
156
+ # Builds the object from hash
157
+ # @param [Hash] attributes Model attributes in the form of hash
158
+ # @return [Object] Returns the model itself
140
159
  def build_from_hash(attributes)
141
160
  return nil unless attributes.is_a?(Hash)
142
161
  self.class.swagger_types.each_pair do |key, type|
143
162
  if type =~ /^Array<(.*)>/i
163
+ # check to ensure the input is an array given that the the attribute
164
+ # is documented as an array but the input is not
144
165
  if attributes[self.class.attribute_map[key]].is_a?(Array)
145
166
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
146
- else
147
- #TODO show warning in debug mode
148
167
  end
149
168
  elsif !attributes[self.class.attribute_map[key]].nil?
150
169
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
151
- else
152
- # data not found in attributes(hash), not an issue as the data can be optional
153
- end
170
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
154
171
  end
155
172
 
156
173
  self
157
174
  end
158
175
 
176
+ # Deserializes the data based on type
177
+ # @param string type Data type
178
+ # @param string value Value to be deserialized
179
+ # @return [Object] Deserialized data
159
180
  def _deserialize(type, value)
160
181
  case type.to_sym
161
182
  when :DateTime
@@ -189,21 +210,25 @@ module ArtikCloud
189
210
  end
190
211
  end
191
212
  else # model
192
- _model = ArtikCloud.const_get(type).new
193
- _model.build_from_hash(value)
213
+ temp_model = ArtikCloud.const_get(type).new
214
+ temp_model.build_from_hash(value)
194
215
  end
195
216
  end
196
217
 
218
+ # Returns the string representation of the object
219
+ # @return [String] String presentation of the object
197
220
  def to_s
198
221
  to_hash.to_s
199
222
  end
200
223
 
201
- # to_body is an alias to to_body (backward compatibility))
224
+ # to_body is an alias to to_hash (backward compatibility)
225
+ # @return [Hash] Returns the object in the form of hash
202
226
  def to_body
203
227
  to_hash
204
228
  end
205
229
 
206
- # return the object in the form of hash
230
+ # Returns the object in the form of hash
231
+ # @return [Hash] Returns the object in the form of hash
207
232
  def to_hash
208
233
  hash = {}
209
234
  self.class.attribute_map.each_pair do |attr, param|
@@ -214,8 +239,10 @@ module ArtikCloud
214
239
  hash
215
240
  end
216
241
 
217
- # Method to output non-array value in the form of hash
242
+ # Outputs non-array value in the form of hash
218
243
  # For object, use to_hash. Otherwise, just return the value
244
+ # @param [Object] value Any valid value
245
+ # @return [Hash] Returns the value in the form of hash
219
246
  def _to_hash(value)
220
247
  if value.is_a?(Array)
221
248
  value.compact.map{ |v| _to_hash(v) }
@@ -231,4 +258,5 @@ module ArtikCloud
231
258
  end
232
259
 
233
260
  end
261
+
234
262
  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
 
@@ -50,32 +59,21 @@ module ArtikCloud
50
59
  # URL added to successful email message.
51
60
  attr_accessor :url
52
61
 
62
+
53
63
  # Attribute mapping from ruby-style variable name to JSON key.
54
64
  def self.attribute_map
55
65
  {
56
-
57
66
  :'csv_headers' => :'csvHeaders',
58
-
59
67
  :'end_date' => :'endDate',
60
-
61
68
  :'export_id' => :'exportId',
62
-
63
69
  :'format' => :'format',
64
-
65
70
  :'order' => :'order',
66
-
67
71
  :'sdids' => :'sdids',
68
-
69
72
  :'sdtids' => :'sdtids',
70
-
71
73
  :'start_date' => :'startDate',
72
-
73
74
  :'trial_id' => :'trialId',
74
-
75
75
  :'uids' => :'uids',
76
-
77
76
  :'url' => :'url'
78
-
79
77
  }
80
78
  end
81
79
 
@@ -93,64 +91,78 @@ module ArtikCloud
93
91
  :'trial_id' => :'String',
94
92
  :'uids' => :'String',
95
93
  :'url' => :'String'
96
-
97
94
  }
98
95
  end
99
96
 
97
+ # Initializes the object
98
+ # @param [Hash] attributes Model attributes in the form of hash
100
99
  def initialize(attributes = {})
101
100
  return unless attributes.is_a?(Hash)
102
101
 
103
102
  # convert string to symbol for hash key
104
- attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
103
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
105
104
 
106
-
107
- if attributes[:'csvHeaders']
105
+ if attributes.has_key?(:'csvHeaders')
108
106
  self.csv_headers = attributes[:'csvHeaders']
109
107
  end
110
-
111
- if attributes[:'endDate']
108
+
109
+ if attributes.has_key?(:'endDate')
112
110
  self.end_date = attributes[:'endDate']
113
111
  end
114
-
115
- if attributes[:'exportId']
112
+
113
+ if attributes.has_key?(:'exportId')
116
114
  self.export_id = attributes[:'exportId']
117
115
  end
118
-
119
- if attributes[:'format']
116
+
117
+ if attributes.has_key?(:'format')
120
118
  self.format = attributes[:'format']
121
119
  end
122
-
123
- if attributes[:'order']
120
+
121
+ if attributes.has_key?(:'order')
124
122
  self.order = attributes[:'order']
125
123
  end
126
-
127
- if attributes[:'sdids']
124
+
125
+ if attributes.has_key?(:'sdids')
128
126
  self.sdids = attributes[:'sdids']
129
127
  end
130
-
131
- if attributes[:'sdtids']
128
+
129
+ if attributes.has_key?(:'sdtids')
132
130
  self.sdtids = attributes[:'sdtids']
133
131
  end
134
-
135
- if attributes[:'startDate']
132
+
133
+ if attributes.has_key?(:'startDate')
136
134
  self.start_date = attributes[:'startDate']
137
135
  end
138
-
139
- if attributes[:'trialId']
136
+
137
+ if attributes.has_key?(:'trialId')
140
138
  self.trial_id = attributes[:'trialId']
141
139
  end
142
-
143
- if attributes[:'uids']
140
+
141
+ if attributes.has_key?(:'uids')
144
142
  self.uids = attributes[:'uids']
145
143
  end
146
-
147
- if attributes[:'url']
144
+
145
+ if attributes.has_key?(:'url')
148
146
  self.url = attributes[:'url']
149
147
  end
150
-
148
+
149
+ end
150
+
151
+ # Show invalid properties with the reasons. Usually used together with valid?
152
+ # @return Array for valid properies with the reasons
153
+ def list_invalid_properties
154
+ invalid_properties = Array.new
155
+ return invalid_properties
151
156
  end
152
157
 
153
- # Check equality by comparing each attribute.
158
+ # Check to see if the all the properties in the model are valid
159
+ # @return true if the model is valid
160
+ def valid?
161
+ return true
162
+ end
163
+
164
+ # Checks equality by comparing each attribute.
165
+ # @param [Object] Object to be compared
154
166
  def ==(o)
155
167
  return true if self.equal?(o)
156
168
  self.class == o.class &&
@@ -168,35 +180,41 @@ module ArtikCloud
168
180
  end
169
181
 
170
182
  # @see the `==` method
183
+ # @param [Object] Object to be compared
171
184
  def eql?(o)
172
185
  self == o
173
186
  end
174
187
 
175
- # Calculate hash code according to all attributes.
188
+ # Calculates hash code according to all attributes.
189
+ # @return [Fixnum] Hash code
176
190
  def hash
177
191
  [csv_headers, end_date, export_id, format, order, sdids, sdtids, start_date, trial_id, uids, url].hash
178
192
  end
179
193
 
180
- # build the object from hash
194
+ # Builds the object from hash
195
+ # @param [Hash] attributes Model attributes in the form of hash
196
+ # @return [Object] Returns the model itself
181
197
  def build_from_hash(attributes)
182
198
  return nil unless attributes.is_a?(Hash)
183
199
  self.class.swagger_types.each_pair do |key, type|
184
200
  if type =~ /^Array<(.*)>/i
201
+ # check to ensure the input is an array given that the the attribute
202
+ # is documented as an array but the input is not
185
203
  if attributes[self.class.attribute_map[key]].is_a?(Array)
186
204
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
187
- else
188
- #TODO show warning in debug mode
189
205
  end
190
206
  elsif !attributes[self.class.attribute_map[key]].nil?
191
207
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
192
- else
193
- # data not found in attributes(hash), not an issue as the data can be optional
194
- end
208
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
195
209
  end
196
210
 
197
211
  self
198
212
  end
199
213
 
214
+ # Deserializes the data based on type
215
+ # @param string type Data type
216
+ # @param string value Value to be deserialized
217
+ # @return [Object] Deserialized data
200
218
  def _deserialize(type, value)
201
219
  case type.to_sym
202
220
  when :DateTime
@@ -230,21 +248,25 @@ module ArtikCloud
230
248
  end
231
249
  end
232
250
  else # model
233
- _model = ArtikCloud.const_get(type).new
234
- _model.build_from_hash(value)
251
+ temp_model = ArtikCloud.const_get(type).new
252
+ temp_model.build_from_hash(value)
235
253
  end
236
254
  end
237
255
 
256
+ # Returns the string representation of the object
257
+ # @return [String] String presentation of the object
238
258
  def to_s
239
259
  to_hash.to_s
240
260
  end
241
261
 
242
- # to_body is an alias to to_body (backward compatibility))
262
+ # to_body is an alias to to_hash (backward compatibility)
263
+ # @return [Hash] Returns the object in the form of hash
243
264
  def to_body
244
265
  to_hash
245
266
  end
246
267
 
247
- # return the object in the form of hash
268
+ # Returns the object in the form of hash
269
+ # @return [Hash] Returns the object in the form of hash
248
270
  def to_hash
249
271
  hash = {}
250
272
  self.class.attribute_map.each_pair do |attr, param|
@@ -255,8 +277,10 @@ module ArtikCloud
255
277
  hash
256
278
  end
257
279
 
258
- # Method to output non-array value in the form of hash
280
+ # Outputs non-array value in the form of hash
259
281
  # For object, use to_hash. Otherwise, just return the value
282
+ # @param [Object] value Any valid value
283
+ # @return [Hash] Returns the value in the form of hash
260
284
  def _to_hash(value)
261
285
  if value.is_a?(Array)
262
286
  value.compact.map{ |v| _to_hash(v) }
@@ -272,4 +296,5 @@ module ArtikCloud
272
296
  end
273
297
 
274
298
  end
299
+
275
300
  end