artikcloud 2.0.0 → 2.0.5

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