artikcloud 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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,275 @@
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 Data.
19
+ class ExportRequestData
20
+ # Add header to csv format
21
+ attr_accessor :csv_headers
22
+
23
+ # Timestamp of latest message (in milliseconds since epoch).
24
+ attr_accessor :end_date
25
+
26
+ # Returned Export ID that should be used to check status and get the export result.
27
+ attr_accessor :export_id
28
+
29
+ # Format of the export.
30
+ attr_accessor :format
31
+
32
+ # Ascending or descending sort order.
33
+ attr_accessor :order
34
+
35
+ # Source Device IDs being searched for messages (Comma-separated for multiple Device IDs).
36
+ attr_accessor :sdids
37
+
38
+ # Source Device Type IDs being searched for messages (Comma-separated for multiple Device Type IDs).
39
+ attr_accessor :sdtids
40
+
41
+ # Timestamp of earliest message (in milliseconds since epoch).
42
+ attr_accessor :start_date
43
+
44
+ # Trial ID being searched for messages.
45
+ attr_accessor :trial_id
46
+
47
+ # Owner's user IDs being searched for messages (Comma-separated for multiple User IDs).
48
+ attr_accessor :uids
49
+
50
+ # URL added to successful email message.
51
+ attr_accessor :url
52
+
53
+ # Attribute mapping from ruby-style variable name to JSON key.
54
+ def self.attribute_map
55
+ {
56
+
57
+ :'csv_headers' => :'csvHeaders',
58
+
59
+ :'end_date' => :'endDate',
60
+
61
+ :'export_id' => :'exportId',
62
+
63
+ :'format' => :'format',
64
+
65
+ :'order' => :'order',
66
+
67
+ :'sdids' => :'sdids',
68
+
69
+ :'sdtids' => :'sdtids',
70
+
71
+ :'start_date' => :'startDate',
72
+
73
+ :'trial_id' => :'trialId',
74
+
75
+ :'uids' => :'uids',
76
+
77
+ :'url' => :'url'
78
+
79
+ }
80
+ end
81
+
82
+ # Attribute type mapping.
83
+ def self.swagger_types
84
+ {
85
+ :'csv_headers' => :'BOOLEAN',
86
+ :'end_date' => :'Integer',
87
+ :'export_id' => :'String',
88
+ :'format' => :'String',
89
+ :'order' => :'String',
90
+ :'sdids' => :'String',
91
+ :'sdtids' => :'String',
92
+ :'start_date' => :'Integer',
93
+ :'trial_id' => :'String',
94
+ :'uids' => :'String',
95
+ :'url' => :'String'
96
+
97
+ }
98
+ end
99
+
100
+ def initialize(attributes = {})
101
+ return unless attributes.is_a?(Hash)
102
+
103
+ # convert string to symbol for hash key
104
+ attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
105
+
106
+
107
+ if attributes[:'csvHeaders']
108
+ self.csv_headers = attributes[:'csvHeaders']
109
+ end
110
+
111
+ if attributes[:'endDate']
112
+ self.end_date = attributes[:'endDate']
113
+ end
114
+
115
+ if attributes[:'exportId']
116
+ self.export_id = attributes[:'exportId']
117
+ end
118
+
119
+ if attributes[:'format']
120
+ self.format = attributes[:'format']
121
+ end
122
+
123
+ if attributes[:'order']
124
+ self.order = attributes[:'order']
125
+ end
126
+
127
+ if attributes[:'sdids']
128
+ self.sdids = attributes[:'sdids']
129
+ end
130
+
131
+ if attributes[:'sdtids']
132
+ self.sdtids = attributes[:'sdtids']
133
+ end
134
+
135
+ if attributes[:'startDate']
136
+ self.start_date = attributes[:'startDate']
137
+ end
138
+
139
+ if attributes[:'trialId']
140
+ self.trial_id = attributes[:'trialId']
141
+ end
142
+
143
+ if attributes[:'uids']
144
+ self.uids = attributes[:'uids']
145
+ end
146
+
147
+ if attributes[:'url']
148
+ self.url = attributes[:'url']
149
+ end
150
+
151
+ end
152
+
153
+ # Check equality by comparing each attribute.
154
+ def ==(o)
155
+ return true if self.equal?(o)
156
+ self.class == o.class &&
157
+ csv_headers == o.csv_headers &&
158
+ end_date == o.end_date &&
159
+ export_id == o.export_id &&
160
+ format == o.format &&
161
+ order == o.order &&
162
+ sdids == o.sdids &&
163
+ sdtids == o.sdtids &&
164
+ start_date == o.start_date &&
165
+ trial_id == o.trial_id &&
166
+ uids == o.uids &&
167
+ url == o.url
168
+ end
169
+
170
+ # @see the `==` method
171
+ def eql?(o)
172
+ self == o
173
+ end
174
+
175
+ # Calculate hash code according to all attributes.
176
+ def hash
177
+ [csv_headers, end_date, export_id, format, order, sdids, sdtids, start_date, trial_id, uids, url].hash
178
+ end
179
+
180
+ # build the object from hash
181
+ def build_from_hash(attributes)
182
+ return nil unless attributes.is_a?(Hash)
183
+ self.class.swagger_types.each_pair do |key, type|
184
+ if type =~ /^Array<(.*)>/i
185
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
186
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
187
+ else
188
+ #TODO show warning in debug mode
189
+ end
190
+ elsif !attributes[self.class.attribute_map[key]].nil?
191
+ 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
195
+ end
196
+
197
+ self
198
+ end
199
+
200
+ def _deserialize(type, value)
201
+ case type.to_sym
202
+ when :DateTime
203
+ DateTime.parse(value)
204
+ when :Date
205
+ Date.parse(value)
206
+ when :String
207
+ value.to_s
208
+ when :Integer
209
+ value.to_i
210
+ when :Float
211
+ value.to_f
212
+ when :BOOLEAN
213
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
214
+ true
215
+ else
216
+ false
217
+ end
218
+ when :Object
219
+ # generic object (usually a Hash), return directly
220
+ value
221
+ when /\AArray<(?<inner_type>.+)>\z/
222
+ inner_type = Regexp.last_match[:inner_type]
223
+ value.map { |v| _deserialize(inner_type, v) }
224
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
225
+ k_type = Regexp.last_match[:k_type]
226
+ v_type = Regexp.last_match[:v_type]
227
+ {}.tap do |hash|
228
+ value.each do |k, v|
229
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
230
+ end
231
+ end
232
+ else # model
233
+ _model = ArtikCloud.const_get(type).new
234
+ _model.build_from_hash(value)
235
+ end
236
+ end
237
+
238
+ def to_s
239
+ to_hash.to_s
240
+ end
241
+
242
+ # to_body is an alias to to_body (backward compatibility))
243
+ def to_body
244
+ to_hash
245
+ end
246
+
247
+ # return the object in the form of hash
248
+ def to_hash
249
+ hash = {}
250
+ self.class.attribute_map.each_pair do |attr, param|
251
+ value = self.send(attr)
252
+ next if value.nil?
253
+ hash[param] = _to_hash(value)
254
+ end
255
+ hash
256
+ end
257
+
258
+ # Method to output non-array value in the form of hash
259
+ # For object, use to_hash. Otherwise, just return the value
260
+ def _to_hash(value)
261
+ if value.is_a?(Array)
262
+ value.compact.map{ |v| _to_hash(v) }
263
+ elsif value.is_a?(Hash)
264
+ {}.tap do |hash|
265
+ value.each { |k, v| hash[k] = _to_hash(v) }
266
+ end
267
+ elsif value.respond_to? :to_hash
268
+ value.to_hash
269
+ else
270
+ value
271
+ end
272
+ end
273
+
274
+ end
275
+ end
@@ -0,0 +1,264 @@
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 Info.
19
+ class ExportRequestInfo
20
+ # Add header to csv format
21
+ attr_accessor :csv_headers
22
+
23
+ # Timestamp of latest message (in milliseconds since epoch).
24
+ attr_accessor :end_date
25
+
26
+ # Format of the export.
27
+ attr_accessor :format
28
+
29
+ # Ascending or descending sort order.
30
+ attr_accessor :order
31
+
32
+ # Source Device IDs being searched for messages (Comma-separated for multiple Device IDs).
33
+ attr_accessor :sdids
34
+
35
+ # Source Device Type IDs being searched for messages (Comma-separated for multiple Device Type IDs).
36
+ attr_accessor :sdtids
37
+
38
+ # Timestamp of earliest message (in milliseconds since epoch).
39
+ attr_accessor :start_date
40
+
41
+ # Trial ID being searched for messages.
42
+ attr_accessor :trial_id
43
+
44
+ # Owner's user IDs being searched for messages (Comma-separated for multiple User IDs).
45
+ attr_accessor :uids
46
+
47
+ # URL added to successful email message.
48
+ attr_accessor :url
49
+
50
+ # Attribute mapping from ruby-style variable name to JSON key.
51
+ def self.attribute_map
52
+ {
53
+
54
+ :'csv_headers' => :'csvHeaders',
55
+
56
+ :'end_date' => :'endDate',
57
+
58
+ :'format' => :'format',
59
+
60
+ :'order' => :'order',
61
+
62
+ :'sdids' => :'sdids',
63
+
64
+ :'sdtids' => :'sdtids',
65
+
66
+ :'start_date' => :'startDate',
67
+
68
+ :'trial_id' => :'trialId',
69
+
70
+ :'uids' => :'uids',
71
+
72
+ :'url' => :'url'
73
+
74
+ }
75
+ end
76
+
77
+ # Attribute type mapping.
78
+ def self.swagger_types
79
+ {
80
+ :'csv_headers' => :'BOOLEAN',
81
+ :'end_date' => :'Integer',
82
+ :'format' => :'String',
83
+ :'order' => :'String',
84
+ :'sdids' => :'String',
85
+ :'sdtids' => :'String',
86
+ :'start_date' => :'Integer',
87
+ :'trial_id' => :'String',
88
+ :'uids' => :'String',
89
+ :'url' => :'String'
90
+
91
+ }
92
+ end
93
+
94
+ def initialize(attributes = {})
95
+ return unless attributes.is_a?(Hash)
96
+
97
+ # convert string to symbol for hash key
98
+ attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
99
+
100
+
101
+ if attributes[:'csvHeaders']
102
+ self.csv_headers = attributes[:'csvHeaders']
103
+ end
104
+
105
+ if attributes[:'endDate']
106
+ self.end_date = attributes[:'endDate']
107
+ end
108
+
109
+ if attributes[:'format']
110
+ self.format = attributes[:'format']
111
+ end
112
+
113
+ if attributes[:'order']
114
+ self.order = attributes[:'order']
115
+ end
116
+
117
+ if attributes[:'sdids']
118
+ self.sdids = attributes[:'sdids']
119
+ end
120
+
121
+ if attributes[:'sdtids']
122
+ self.sdtids = attributes[:'sdtids']
123
+ end
124
+
125
+ if attributes[:'startDate']
126
+ self.start_date = attributes[:'startDate']
127
+ end
128
+
129
+ if attributes[:'trialId']
130
+ self.trial_id = attributes[:'trialId']
131
+ end
132
+
133
+ if attributes[:'uids']
134
+ self.uids = attributes[:'uids']
135
+ end
136
+
137
+ if attributes[:'url']
138
+ self.url = attributes[:'url']
139
+ end
140
+
141
+ end
142
+
143
+ # Check equality by comparing each attribute.
144
+ def ==(o)
145
+ return true if self.equal?(o)
146
+ self.class == o.class &&
147
+ csv_headers == o.csv_headers &&
148
+ end_date == o.end_date &&
149
+ format == o.format &&
150
+ order == o.order &&
151
+ sdids == o.sdids &&
152
+ sdtids == o.sdtids &&
153
+ start_date == o.start_date &&
154
+ trial_id == o.trial_id &&
155
+ uids == o.uids &&
156
+ url == o.url
157
+ end
158
+
159
+ # @see the `==` method
160
+ def eql?(o)
161
+ self == o
162
+ end
163
+
164
+ # Calculate hash code according to all attributes.
165
+ def hash
166
+ [csv_headers, end_date, format, order, sdids, sdtids, start_date, trial_id, uids, url].hash
167
+ end
168
+
169
+ # build the object from hash
170
+ def build_from_hash(attributes)
171
+ return nil unless attributes.is_a?(Hash)
172
+ self.class.swagger_types.each_pair do |key, type|
173
+ if type =~ /^Array<(.*)>/i
174
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
175
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
176
+ else
177
+ #TODO show warning in debug mode
178
+ end
179
+ elsif !attributes[self.class.attribute_map[key]].nil?
180
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
181
+ else
182
+ # data not found in attributes(hash), not an issue as the data can be optional
183
+ end
184
+ end
185
+
186
+ self
187
+ end
188
+
189
+ def _deserialize(type, value)
190
+ case type.to_sym
191
+ when :DateTime
192
+ DateTime.parse(value)
193
+ when :Date
194
+ Date.parse(value)
195
+ when :String
196
+ value.to_s
197
+ when :Integer
198
+ value.to_i
199
+ when :Float
200
+ value.to_f
201
+ when :BOOLEAN
202
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
203
+ true
204
+ else
205
+ false
206
+ end
207
+ when :Object
208
+ # generic object (usually a Hash), return directly
209
+ value
210
+ when /\AArray<(?<inner_type>.+)>\z/
211
+ inner_type = Regexp.last_match[:inner_type]
212
+ value.map { |v| _deserialize(inner_type, v) }
213
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
214
+ k_type = Regexp.last_match[:k_type]
215
+ v_type = Regexp.last_match[:v_type]
216
+ {}.tap do |hash|
217
+ value.each do |k, v|
218
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
219
+ end
220
+ end
221
+ else # model
222
+ _model = ArtikCloud.const_get(type).new
223
+ _model.build_from_hash(value)
224
+ end
225
+ end
226
+
227
+ def to_s
228
+ to_hash.to_s
229
+ end
230
+
231
+ # to_body is an alias to to_body (backward compatibility))
232
+ def to_body
233
+ to_hash
234
+ end
235
+
236
+ # return the object in the form of hash
237
+ def to_hash
238
+ hash = {}
239
+ self.class.attribute_map.each_pair do |attr, param|
240
+ value = self.send(attr)
241
+ next if value.nil?
242
+ hash[param] = _to_hash(value)
243
+ end
244
+ hash
245
+ end
246
+
247
+ # Method to output non-array value in the form of hash
248
+ # For object, use to_hash. Otherwise, just return the value
249
+ def _to_hash(value)
250
+ if value.is_a?(Array)
251
+ value.compact.map{ |v| _to_hash(v) }
252
+ elsif value.is_a?(Hash)
253
+ {}.tap do |hash|
254
+ value.each { |k, v| hash[k] = _to_hash(v) }
255
+ end
256
+ elsif value.respond_to? :to_hash
257
+ value.to_hash
258
+ else
259
+ value
260
+ end
261
+ end
262
+
263
+ end
264
+ end
@@ -0,0 +1,164 @@
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 Response.
19
+ class ExportRequestResponse
20
+ attr_accessor :data
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+
26
+ :'data' => :'data'
27
+
28
+ }
29
+ end
30
+
31
+ # Attribute type mapping.
32
+ def self.swagger_types
33
+ {
34
+ :'data' => :'ExportRequestData'
35
+
36
+ }
37
+ end
38
+
39
+ def initialize(attributes = {})
40
+ return unless attributes.is_a?(Hash)
41
+
42
+ # convert string to symbol for hash key
43
+ attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
44
+
45
+
46
+ if attributes[:'data']
47
+ self.data = attributes[:'data']
48
+ end
49
+
50
+ end
51
+
52
+ # Check equality by comparing each attribute.
53
+ def ==(o)
54
+ return true if self.equal?(o)
55
+ self.class == o.class &&
56
+ data == o.data
57
+ end
58
+
59
+ # @see the `==` method
60
+ def eql?(o)
61
+ self == o
62
+ end
63
+
64
+ # Calculate hash code according to all attributes.
65
+ def hash
66
+ [data].hash
67
+ end
68
+
69
+ # build the object from hash
70
+ def build_from_hash(attributes)
71
+ return nil unless attributes.is_a?(Hash)
72
+ self.class.swagger_types.each_pair do |key, type|
73
+ if type =~ /^Array<(.*)>/i
74
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
75
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
76
+ else
77
+ #TODO show warning in debug mode
78
+ end
79
+ elsif !attributes[self.class.attribute_map[key]].nil?
80
+ 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
84
+ end
85
+
86
+ self
87
+ end
88
+
89
+ def _deserialize(type, value)
90
+ case type.to_sym
91
+ when :DateTime
92
+ DateTime.parse(value)
93
+ when :Date
94
+ Date.parse(value)
95
+ when :String
96
+ value.to_s
97
+ when :Integer
98
+ value.to_i
99
+ when :Float
100
+ value.to_f
101
+ when :BOOLEAN
102
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
103
+ true
104
+ else
105
+ false
106
+ end
107
+ when :Object
108
+ # generic object (usually a Hash), return directly
109
+ value
110
+ when /\AArray<(?<inner_type>.+)>\z/
111
+ inner_type = Regexp.last_match[:inner_type]
112
+ value.map { |v| _deserialize(inner_type, v) }
113
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
114
+ k_type = Regexp.last_match[:k_type]
115
+ v_type = Regexp.last_match[:v_type]
116
+ {}.tap do |hash|
117
+ value.each do |k, v|
118
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
119
+ end
120
+ end
121
+ else # model
122
+ _model = ArtikCloud.const_get(type).new
123
+ _model.build_from_hash(value)
124
+ end
125
+ end
126
+
127
+ def to_s
128
+ to_hash.to_s
129
+ end
130
+
131
+ # to_body is an alias to to_body (backward compatibility))
132
+ def to_body
133
+ to_hash
134
+ end
135
+
136
+ # return the object in the form of hash
137
+ def to_hash
138
+ hash = {}
139
+ self.class.attribute_map.each_pair do |attr, param|
140
+ value = self.send(attr)
141
+ next if value.nil?
142
+ hash[param] = _to_hash(value)
143
+ end
144
+ hash
145
+ end
146
+
147
+ # Method to output non-array value in the form of hash
148
+ # For object, use to_hash. Otherwise, just return the value
149
+ def _to_hash(value)
150
+ if value.is_a?(Array)
151
+ value.compact.map{ |v| _to_hash(v) }
152
+ elsif value.is_a?(Hash)
153
+ {}.tap do |hash|
154
+ value.each { |k, v| hash[k] = _to_hash(v) }
155
+ end
156
+ elsif value.respond_to? :to_hash
157
+ value.to_hash
158
+ else
159
+ value
160
+ end
161
+ end
162
+
163
+ end
164
+ end