artikcloud 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (193) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +4 -0
  3. data/Gemfile.lock +65 -0
  4. data/LICENSE +202 -0
  5. data/README.md +230 -0
  6. data/artikcloud.gemspec +32 -0
  7. data/docs/AckEnvelope.md +8 -0
  8. data/docs/Acknowledgement.md +11 -0
  9. data/docs/ActionDetails.md +9 -0
  10. data/docs/ActionDetailsArray.md +8 -0
  11. data/docs/ActionIn.md +13 -0
  12. data/docs/ActionOut.md +12 -0
  13. data/docs/AggregateData.md +13 -0
  14. data/docs/AggregatesHistogramData.md +14 -0
  15. data/docs/AggregatesHistogramResponse.md +14 -0
  16. data/docs/AggregatesResponse.md +13 -0
  17. data/docs/AppProperties.md +10 -0
  18. data/docs/CheckTokenMessage.md +8 -0
  19. data/docs/CheckTokenResponse.md +8 -0
  20. data/docs/Device.md +21 -0
  21. data/docs/DeviceArray.md +8 -0
  22. data/docs/DeviceEnvelope.md +8 -0
  23. data/docs/DeviceRegCompleteRequest.md +8 -0
  24. data/docs/DeviceRegConfirmUserRequest.md +10 -0
  25. data/docs/DeviceRegConfirmUserResponse.md +8 -0
  26. data/docs/DeviceRegConfirmUserResponseEnvelope.md +8 -0
  27. data/docs/DeviceRegStatusResponse.md +9 -0
  28. data/docs/DeviceRegStatusResponseEnvelope.md +8 -0
  29. data/docs/DeviceToken.md +11 -0
  30. data/docs/DeviceTokenEnvelope.md +8 -0
  31. data/docs/DeviceType.md +25 -0
  32. data/docs/DeviceTypeArray.md +8 -0
  33. data/docs/DeviceTypeEnvelope.md +8 -0
  34. data/docs/DeviceTypesApi.md +284 -0
  35. data/docs/DeviceTypesEnvelope.md +11 -0
  36. data/docs/DevicesApi.md +382 -0
  37. data/docs/DevicesEnvelope.md +11 -0
  38. data/docs/ErrorEnvelope.md +8 -0
  39. data/docs/ExportApi.md +225 -0
  40. data/docs/ExportData.md +14 -0
  41. data/docs/ExportDataArray.md +8 -0
  42. data/docs/ExportHistoryResponse.md +11 -0
  43. data/docs/ExportNormalizedMessagesResponse.md +20 -0
  44. data/docs/ExportRequest.md +15 -0
  45. data/docs/ExportRequestData.md +18 -0
  46. data/docs/ExportRequestInfo.md +17 -0
  47. data/docs/ExportRequestResponse.md +8 -0
  48. data/docs/ExportResponse.md +18 -0
  49. data/docs/ExportStatusResponse.md +12 -0
  50. data/docs/FieldPath.md +8 -0
  51. data/docs/FieldPresence.md +8 -0
  52. data/docs/FieldPresenceEnvelope.md +14 -0
  53. data/docs/FieldsActions.md +9 -0
  54. data/docs/ManifestProperties.md +8 -0
  55. data/docs/ManifestPropertiesEnvelope.md +8 -0
  56. data/docs/ManifestVersions.md +8 -0
  57. data/docs/ManifestVersionsEnvelope.md +8 -0
  58. data/docs/MessageAction.md +12 -0
  59. data/docs/MessageID.md +8 -0
  60. data/docs/MessageIDEnvelope.md +8 -0
  61. data/docs/MessageIn.md +13 -0
  62. data/docs/MessageOut.md +12 -0
  63. data/docs/MessagesApi.md +382 -0
  64. data/docs/NonEmptyString.md +8 -0
  65. data/docs/NormalizedMessage.md +15 -0
  66. data/docs/NormalizedMessagesEnvelope.md +17 -0
  67. data/docs/OutputRule.md +21 -0
  68. data/docs/PropertiesEnvelope.md +8 -0
  69. data/docs/RefreshTokenResponse.md +11 -0
  70. data/docs/RegisterMessage.md +12 -0
  71. data/docs/RegistrationsApi.md +167 -0
  72. data/docs/RuleArray.md +8 -0
  73. data/docs/RuleCreationInfo.md +11 -0
  74. data/docs/RuleEnvelope.md +8 -0
  75. data/docs/RuleError.md +11 -0
  76. data/docs/RuleUpdateInfo.md +11 -0
  77. data/docs/RuleWarningOutput.md +9 -0
  78. data/docs/RulesApi.md +226 -0
  79. data/docs/RulesEnvelope.md +11 -0
  80. data/docs/Tag.md +9 -0
  81. data/docs/TagArray.md +8 -0
  82. data/docs/TagsApi.md +169 -0
  83. data/docs/TagsEnvelope.md +8 -0
  84. data/docs/Token.md +11 -0
  85. data/docs/TokenRequest.md +8 -0
  86. data/docs/TokenResponse.md +8 -0
  87. data/docs/TokensApi.md +117 -0
  88. data/docs/UnregisterDeviceResponse.md +18 -0
  89. data/docs/UnregisterDeviceResponseEnvelope.md +8 -0
  90. data/docs/User.md +14 -0
  91. data/docs/UserEnvelope.md +8 -0
  92. data/docs/UsersApi.md +474 -0
  93. data/docs/WebSocketError.md +10 -0
  94. data/git_push.sh +52 -0
  95. data/lib/artikcloud/api/device_types_api.rb +340 -0
  96. data/lib/artikcloud/api/devices_api.rb +450 -0
  97. data/lib/artikcloud/api/export_api.rb +269 -0
  98. data/lib/artikcloud/api/messages_api.rb +468 -0
  99. data/lib/artikcloud/api/registrations_api.rb +205 -0
  100. data/lib/artikcloud/api/rules_api.rb +276 -0
  101. data/lib/artikcloud/api/tags_api.rb +209 -0
  102. data/lib/artikcloud/api/tokens_api.rb +152 -0
  103. data/lib/artikcloud/api/users_api.rb +552 -0
  104. data/lib/artikcloud/api_client.rb +336 -0
  105. data/lib/artikcloud/api_error.rb +38 -0
  106. data/lib/artikcloud/configuration.rb +170 -0
  107. data/lib/artikcloud/models/ack_envelope.rb +164 -0
  108. data/lib/artikcloud/models/acknowledgement.rb +198 -0
  109. data/lib/artikcloud/models/action_details.rb +178 -0
  110. data/lib/artikcloud/models/action_details_array.rb +166 -0
  111. data/lib/artikcloud/models/action_in.rb +221 -0
  112. data/lib/artikcloud/models/action_out.rb +209 -0
  113. data/lib/artikcloud/models/aggregate_data.rb +214 -0
  114. data/lib/artikcloud/models/aggregates_histogram_data.rb +224 -0
  115. data/lib/artikcloud/models/aggregates_histogram_response.rb +226 -0
  116. data/lib/artikcloud/models/aggregates_response.rb +216 -0
  117. data/lib/artikcloud/models/app_properties.rb +184 -0
  118. data/lib/artikcloud/models/check_token_message.rb +164 -0
  119. data/lib/artikcloud/models/check_token_response.rb +164 -0
  120. data/lib/artikcloud/models/device.rb +310 -0
  121. data/lib/artikcloud/models/device_array.rb +166 -0
  122. data/lib/artikcloud/models/device_envelope.rb +164 -0
  123. data/lib/artikcloud/models/device_reg_complete_request.rb +165 -0
  124. data/lib/artikcloud/models/device_reg_confirm_user_request.rb +187 -0
  125. data/lib/artikcloud/models/device_reg_confirm_user_response.rb +165 -0
  126. data/lib/artikcloud/models/device_reg_confirm_user_response_envelope.rb +164 -0
  127. data/lib/artikcloud/models/device_reg_status_response.rb +176 -0
  128. data/lib/artikcloud/models/device_reg_status_response_envelope.rb +164 -0
  129. data/lib/artikcloud/models/device_token.rb +194 -0
  130. data/lib/artikcloud/models/device_token_envelope.rb +164 -0
  131. data/lib/artikcloud/models/device_type.rb +353 -0
  132. data/lib/artikcloud/models/device_type_array.rb +166 -0
  133. data/lib/artikcloud/models/device_type_envelope.rb +164 -0
  134. data/lib/artikcloud/models/device_types_envelope.rb +194 -0
  135. data/lib/artikcloud/models/devices_envelope.rb +194 -0
  136. data/lib/artikcloud/models/error_envelope.rb +165 -0
  137. data/lib/artikcloud/models/export_data.rb +225 -0
  138. data/lib/artikcloud/models/export_data_array.rb +166 -0
  139. data/lib/artikcloud/models/export_history_response.rb +194 -0
  140. data/lib/artikcloud/models/export_normalized_messages_response.rb +284 -0
  141. data/lib/artikcloud/models/export_request.rb +234 -0
  142. data/lib/artikcloud/models/export_request_data.rb +275 -0
  143. data/lib/artikcloud/models/export_request_info.rb +264 -0
  144. data/lib/artikcloud/models/export_request_response.rb +164 -0
  145. data/lib/artikcloud/models/export_response.rb +275 -0
  146. data/lib/artikcloud/models/export_status_response.rb +205 -0
  147. data/lib/artikcloud/models/field_path.rb +166 -0
  148. data/lib/artikcloud/models/field_presence.rb +164 -0
  149. data/lib/artikcloud/models/field_presence_envelope.rb +226 -0
  150. data/lib/artikcloud/models/fields_actions.rb +180 -0
  151. data/lib/artikcloud/models/manifest_properties.rb +164 -0
  152. data/lib/artikcloud/models/manifest_properties_envelope.rb +164 -0
  153. data/lib/artikcloud/models/manifest_versions.rb +166 -0
  154. data/lib/artikcloud/models/manifest_versions_envelope.rb +164 -0
  155. data/lib/artikcloud/models/message_action.rb +210 -0
  156. data/lib/artikcloud/models/message_id.rb +165 -0
  157. data/lib/artikcloud/models/message_id_envelope.rb +164 -0
  158. data/lib/artikcloud/models/message_in.rb +224 -0
  159. data/lib/artikcloud/models/message_out.rb +209 -0
  160. data/lib/artikcloud/models/non_empty_string.rb +164 -0
  161. data/lib/artikcloud/models/normalized_message.rb +236 -0
  162. data/lib/artikcloud/models/normalized_messages_envelope.rb +256 -0
  163. data/lib/artikcloud/models/output_rule.rb +296 -0
  164. data/lib/artikcloud/models/properties_envelope.rb +164 -0
  165. data/lib/artikcloud/models/refresh_token_response.rb +194 -0
  166. data/lib/artikcloud/models/register_message.rb +211 -0
  167. data/lib/artikcloud/models/rule_array.rb +166 -0
  168. data/lib/artikcloud/models/rule_creation_info.rb +200 -0
  169. data/lib/artikcloud/models/rule_envelope.rb +164 -0
  170. data/lib/artikcloud/models/rule_error.rb +196 -0
  171. data/lib/artikcloud/models/rule_update_info.rb +200 -0
  172. data/lib/artikcloud/models/rule_warning_output.rb +174 -0
  173. data/lib/artikcloud/models/rules_envelope.rb +194 -0
  174. data/lib/artikcloud/models/tag.rb +176 -0
  175. data/lib/artikcloud/models/tag_array.rb +166 -0
  176. data/lib/artikcloud/models/tags_envelope.rb +164 -0
  177. data/lib/artikcloud/models/token.rb +194 -0
  178. data/lib/artikcloud/models/token_request.rb +164 -0
  179. data/lib/artikcloud/models/token_response.rb +164 -0
  180. data/lib/artikcloud/models/unregister_device_response.rb +275 -0
  181. data/lib/artikcloud/models/unregister_device_response_envelope.rb +164 -0
  182. data/lib/artikcloud/models/user.rb +224 -0
  183. data/lib/artikcloud/models/user_envelope.rb +164 -0
  184. data/lib/artikcloud/models/web_socket_error.rb +187 -0
  185. data/lib/artikcloud/version.rb +17 -0
  186. data/lib/artikcloud.rb +128 -0
  187. data/pom.xml +60 -0
  188. data/spec/api/messages_api_spec.rb +79 -0
  189. data/spec/api/tokens_api_spec.rb +79 -0
  190. data/spec/api/users_api_spec.rb +50 -0
  191. data/spec/spec.opts +4 -0
  192. data/spec/spec_helper.rb +36 -0
  193. metadata +420 -0
@@ -0,0 +1,284 @@
1
+ =begin
2
+ ARTIK Cloud API
3
+
4
+ OpenAPI spec version: 2.0.0
5
+
6
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
7
+
8
+ License: MIT
9
+ http://en.wikipedia.org/wiki/MIT_License
10
+
11
+ Terms of Service: http://www.samsung.com/global/business/mobile/info/terms-and-conditions.html
12
+
13
+ =end
14
+
15
+ require 'date'
16
+
17
+ module ArtikCloud
18
+ # Export Normalized Messages Response.
19
+ class ExportNormalizedMessagesResponse
20
+ attr_accessor :csv_headers
21
+
22
+ attr_accessor :end_date
23
+
24
+ attr_accessor :export_id
25
+
26
+ attr_accessor :format
27
+
28
+ attr_accessor :order
29
+
30
+ attr_accessor :sdid
31
+
32
+ attr_accessor :sdids
33
+
34
+ attr_accessor :start_date
35
+
36
+ attr_accessor :stdids
37
+
38
+ attr_accessor :trial_id
39
+
40
+ attr_accessor :uid
41
+
42
+ attr_accessor :uids
43
+
44
+ attr_accessor :url
45
+
46
+ # Attribute mapping from ruby-style variable name to JSON key.
47
+ def self.attribute_map
48
+ {
49
+
50
+ :'csv_headers' => :'csvHeaders',
51
+
52
+ :'end_date' => :'endDate',
53
+
54
+ :'export_id' => :'exportId',
55
+
56
+ :'format' => :'format',
57
+
58
+ :'order' => :'order',
59
+
60
+ :'sdid' => :'sdid',
61
+
62
+ :'sdids' => :'sdids',
63
+
64
+ :'start_date' => :'startDate',
65
+
66
+ :'stdids' => :'stdids',
67
+
68
+ :'trial_id' => :'trialId',
69
+
70
+ :'uid' => :'uid',
71
+
72
+ :'uids' => :'uids',
73
+
74
+ :'url' => :'url'
75
+
76
+ }
77
+ end
78
+
79
+ # Attribute type mapping.
80
+ def self.swagger_types
81
+ {
82
+ :'csv_headers' => :'BOOLEAN',
83
+ :'end_date' => :'Integer',
84
+ :'export_id' => :'String',
85
+ :'format' => :'String',
86
+ :'order' => :'String',
87
+ :'sdid' => :'String',
88
+ :'sdids' => :'String',
89
+ :'start_date' => :'Integer',
90
+ :'stdids' => :'String',
91
+ :'trial_id' => :'String',
92
+ :'uid' => :'String',
93
+ :'uids' => :'String',
94
+ :'url' => :'String'
95
+
96
+ }
97
+ end
98
+
99
+ def initialize(attributes = {})
100
+ return unless attributes.is_a?(Hash)
101
+
102
+ # convert string to symbol for hash key
103
+ attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
104
+
105
+
106
+ if attributes[:'csvHeaders']
107
+ self.csv_headers = attributes[:'csvHeaders']
108
+ end
109
+
110
+ if attributes[:'endDate']
111
+ self.end_date = attributes[:'endDate']
112
+ end
113
+
114
+ if attributes[:'exportId']
115
+ self.export_id = attributes[:'exportId']
116
+ end
117
+
118
+ if attributes[:'format']
119
+ self.format = attributes[:'format']
120
+ end
121
+
122
+ if attributes[:'order']
123
+ self.order = attributes[:'order']
124
+ end
125
+
126
+ if attributes[:'sdid']
127
+ self.sdid = attributes[:'sdid']
128
+ end
129
+
130
+ if attributes[:'sdids']
131
+ self.sdids = attributes[:'sdids']
132
+ end
133
+
134
+ if attributes[:'startDate']
135
+ self.start_date = attributes[:'startDate']
136
+ end
137
+
138
+ if attributes[:'stdids']
139
+ self.stdids = attributes[:'stdids']
140
+ end
141
+
142
+ if attributes[:'trialId']
143
+ self.trial_id = attributes[:'trialId']
144
+ end
145
+
146
+ if attributes[:'uid']
147
+ self.uid = attributes[:'uid']
148
+ end
149
+
150
+ if attributes[:'uids']
151
+ self.uids = attributes[:'uids']
152
+ end
153
+
154
+ if attributes[:'url']
155
+ self.url = attributes[:'url']
156
+ end
157
+
158
+ end
159
+
160
+ # Check equality by comparing each attribute.
161
+ def ==(o)
162
+ return true if self.equal?(o)
163
+ self.class == o.class &&
164
+ csv_headers == o.csv_headers &&
165
+ end_date == o.end_date &&
166
+ export_id == o.export_id &&
167
+ format == o.format &&
168
+ order == o.order &&
169
+ sdid == o.sdid &&
170
+ sdids == o.sdids &&
171
+ start_date == o.start_date &&
172
+ stdids == o.stdids &&
173
+ trial_id == o.trial_id &&
174
+ uid == o.uid &&
175
+ uids == o.uids &&
176
+ url == o.url
177
+ end
178
+
179
+ # @see the `==` method
180
+ def eql?(o)
181
+ self == o
182
+ end
183
+
184
+ # Calculate hash code according to all attributes.
185
+ def hash
186
+ [csv_headers, end_date, export_id, format, order, sdid, sdids, start_date, stdids, trial_id, uid, uids, url].hash
187
+ end
188
+
189
+ # build the object from hash
190
+ def build_from_hash(attributes)
191
+ return nil unless attributes.is_a?(Hash)
192
+ self.class.swagger_types.each_pair do |key, type|
193
+ if type =~ /^Array<(.*)>/i
194
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
195
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
196
+ else
197
+ #TODO show warning in debug mode
198
+ end
199
+ elsif !attributes[self.class.attribute_map[key]].nil?
200
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
201
+ else
202
+ # data not found in attributes(hash), not an issue as the data can be optional
203
+ end
204
+ end
205
+
206
+ self
207
+ end
208
+
209
+ def _deserialize(type, value)
210
+ case type.to_sym
211
+ when :DateTime
212
+ DateTime.parse(value)
213
+ when :Date
214
+ Date.parse(value)
215
+ when :String
216
+ value.to_s
217
+ when :Integer
218
+ value.to_i
219
+ when :Float
220
+ value.to_f
221
+ when :BOOLEAN
222
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
223
+ true
224
+ else
225
+ false
226
+ end
227
+ when :Object
228
+ # generic object (usually a Hash), return directly
229
+ value
230
+ when /\AArray<(?<inner_type>.+)>\z/
231
+ inner_type = Regexp.last_match[:inner_type]
232
+ value.map { |v| _deserialize(inner_type, v) }
233
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
234
+ k_type = Regexp.last_match[:k_type]
235
+ v_type = Regexp.last_match[:v_type]
236
+ {}.tap do |hash|
237
+ value.each do |k, v|
238
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
239
+ end
240
+ end
241
+ else # model
242
+ _model = ArtikCloud.const_get(type).new
243
+ _model.build_from_hash(value)
244
+ end
245
+ end
246
+
247
+ def to_s
248
+ to_hash.to_s
249
+ end
250
+
251
+ # to_body is an alias to to_body (backward compatibility))
252
+ def to_body
253
+ to_hash
254
+ end
255
+
256
+ # return the object in the form of hash
257
+ def to_hash
258
+ hash = {}
259
+ self.class.attribute_map.each_pair do |attr, param|
260
+ value = self.send(attr)
261
+ next if value.nil?
262
+ hash[param] = _to_hash(value)
263
+ end
264
+ hash
265
+ end
266
+
267
+ # Method to output non-array value in the form of hash
268
+ # For object, use to_hash. Otherwise, just return the value
269
+ def _to_hash(value)
270
+ if value.is_a?(Array)
271
+ value.compact.map{ |v| _to_hash(v) }
272
+ elsif value.is_a?(Hash)
273
+ {}.tap do |hash|
274
+ value.each { |k, v| hash[k] = _to_hash(v) }
275
+ end
276
+ elsif value.respond_to? :to_hash
277
+ value.to_hash
278
+ else
279
+ value
280
+ end
281
+ end
282
+
283
+ end
284
+ end
@@ -0,0 +1,234 @@
1
+ =begin
2
+ ARTIK Cloud API
3
+
4
+ OpenAPI spec version: 2.0.0
5
+
6
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
7
+
8
+ License: MIT
9
+ http://en.wikipedia.org/wiki/MIT_License
10
+
11
+ Terms of Service: http://www.samsung.com/global/business/mobile/info/terms-and-conditions.html
12
+
13
+ =end
14
+
15
+ require 'date'
16
+
17
+ module ArtikCloud
18
+ # Export Request.
19
+ class ExportRequest
20
+ attr_accessor :end_date
21
+
22
+ attr_accessor :format
23
+
24
+ attr_accessor :order
25
+
26
+ attr_accessor :sdids
27
+
28
+ attr_accessor :sdtids
29
+
30
+ attr_accessor :start_date
31
+
32
+ attr_accessor :trial_id
33
+
34
+ attr_accessor :uids
35
+
36
+ # Attribute mapping from ruby-style variable name to JSON key.
37
+ def self.attribute_map
38
+ {
39
+
40
+ :'end_date' => :'endDate',
41
+
42
+ :'format' => :'format',
43
+
44
+ :'order' => :'order',
45
+
46
+ :'sdids' => :'sdids',
47
+
48
+ :'sdtids' => :'sdtids',
49
+
50
+ :'start_date' => :'startDate',
51
+
52
+ :'trial_id' => :'trialId',
53
+
54
+ :'uids' => :'uids'
55
+
56
+ }
57
+ end
58
+
59
+ # Attribute type mapping.
60
+ def self.swagger_types
61
+ {
62
+ :'end_date' => :'Integer',
63
+ :'format' => :'String',
64
+ :'order' => :'String',
65
+ :'sdids' => :'String',
66
+ :'sdtids' => :'String',
67
+ :'start_date' => :'Integer',
68
+ :'trial_id' => :'String',
69
+ :'uids' => :'String'
70
+
71
+ }
72
+ end
73
+
74
+ def initialize(attributes = {})
75
+ return unless attributes.is_a?(Hash)
76
+
77
+ # convert string to symbol for hash key
78
+ attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
79
+
80
+
81
+ if attributes[:'endDate']
82
+ self.end_date = attributes[:'endDate']
83
+ end
84
+
85
+ if attributes[:'format']
86
+ self.format = attributes[:'format']
87
+ end
88
+
89
+ if attributes[:'order']
90
+ self.order = attributes[:'order']
91
+ end
92
+
93
+ if attributes[:'sdids']
94
+ self.sdids = attributes[:'sdids']
95
+ end
96
+
97
+ if attributes[:'sdtids']
98
+ self.sdtids = attributes[:'sdtids']
99
+ end
100
+
101
+ if attributes[:'startDate']
102
+ self.start_date = attributes[:'startDate']
103
+ end
104
+
105
+ if attributes[:'trialId']
106
+ self.trial_id = attributes[:'trialId']
107
+ end
108
+
109
+ if attributes[:'uids']
110
+ self.uids = attributes[:'uids']
111
+ end
112
+
113
+ end
114
+
115
+ # Check equality by comparing each attribute.
116
+ def ==(o)
117
+ return true if self.equal?(o)
118
+ self.class == o.class &&
119
+ end_date == o.end_date &&
120
+ format == o.format &&
121
+ order == o.order &&
122
+ sdids == o.sdids &&
123
+ sdtids == o.sdtids &&
124
+ start_date == o.start_date &&
125
+ trial_id == o.trial_id &&
126
+ uids == o.uids
127
+ end
128
+
129
+ # @see the `==` method
130
+ def eql?(o)
131
+ self == o
132
+ end
133
+
134
+ # Calculate hash code according to all attributes.
135
+ def hash
136
+ [end_date, format, order, sdids, sdtids, start_date, trial_id, uids].hash
137
+ end
138
+
139
+ # build the object from hash
140
+ def build_from_hash(attributes)
141
+ return nil unless attributes.is_a?(Hash)
142
+ self.class.swagger_types.each_pair do |key, type|
143
+ if type =~ /^Array<(.*)>/i
144
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
145
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
146
+ else
147
+ #TODO show warning in debug mode
148
+ end
149
+ elsif !attributes[self.class.attribute_map[key]].nil?
150
+ 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
154
+ end
155
+
156
+ self
157
+ end
158
+
159
+ def _deserialize(type, value)
160
+ case type.to_sym
161
+ when :DateTime
162
+ DateTime.parse(value)
163
+ when :Date
164
+ Date.parse(value)
165
+ when :String
166
+ value.to_s
167
+ when :Integer
168
+ value.to_i
169
+ when :Float
170
+ value.to_f
171
+ when :BOOLEAN
172
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
173
+ true
174
+ else
175
+ false
176
+ end
177
+ when :Object
178
+ # generic object (usually a Hash), return directly
179
+ value
180
+ when /\AArray<(?<inner_type>.+)>\z/
181
+ inner_type = Regexp.last_match[:inner_type]
182
+ value.map { |v| _deserialize(inner_type, v) }
183
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
184
+ k_type = Regexp.last_match[:k_type]
185
+ v_type = Regexp.last_match[:v_type]
186
+ {}.tap do |hash|
187
+ value.each do |k, v|
188
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
189
+ end
190
+ end
191
+ else # model
192
+ _model = ArtikCloud.const_get(type).new
193
+ _model.build_from_hash(value)
194
+ end
195
+ end
196
+
197
+ def to_s
198
+ to_hash.to_s
199
+ end
200
+
201
+ # to_body is an alias to to_body (backward compatibility))
202
+ def to_body
203
+ to_hash
204
+ end
205
+
206
+ # return the object in the form of hash
207
+ def to_hash
208
+ hash = {}
209
+ self.class.attribute_map.each_pair do |attr, param|
210
+ value = self.send(attr)
211
+ next if value.nil?
212
+ hash[param] = _to_hash(value)
213
+ end
214
+ hash
215
+ end
216
+
217
+ # Method to output non-array value in the form of hash
218
+ # For object, use to_hash. Otherwise, just return the value
219
+ def _to_hash(value)
220
+ if value.is_a?(Array)
221
+ value.compact.map{ |v| _to_hash(v) }
222
+ elsif value.is_a?(Hash)
223
+ {}.tap do |hash|
224
+ value.each { |k, v| hash[k] = _to_hash(v) }
225
+ end
226
+ elsif value.respond_to? :to_hash
227
+ value.to_hash
228
+ else
229
+ value
230
+ end
231
+ end
232
+
233
+ end
234
+ end