ultracart_api 3.1.47 → 3.1.48

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,316 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ OpenAPI spec version: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.15-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module UltracartClient
16
+ class IntegrationLog
17
+ attr_accessor :action
18
+
19
+ attr_accessor :direction
20
+
21
+ attr_accessor :email
22
+
23
+ attr_accessor :files
24
+
25
+ attr_accessor :integration_log_oid
26
+
27
+ attr_accessor :item_id
28
+
29
+ attr_accessor :item_ipn_oid
30
+
31
+ attr_accessor :log_dts
32
+
33
+ attr_accessor :log_type
34
+
35
+ attr_accessor :logger_id
36
+
37
+ attr_accessor :logs
38
+
39
+ attr_accessor :order_ids
40
+
41
+ attr_accessor :pk
42
+
43
+ attr_accessor :sk
44
+
45
+ attr_accessor :status
46
+
47
+ # Attribute mapping from ruby-style variable name to JSON key.
48
+ def self.attribute_map
49
+ {
50
+ :'action' => :'action',
51
+ :'direction' => :'direction',
52
+ :'email' => :'email',
53
+ :'files' => :'files',
54
+ :'integration_log_oid' => :'integration_log_oid',
55
+ :'item_id' => :'item_id',
56
+ :'item_ipn_oid' => :'item_ipn_oid',
57
+ :'log_dts' => :'log_dts',
58
+ :'log_type' => :'log_type',
59
+ :'logger_id' => :'logger_id',
60
+ :'logs' => :'logs',
61
+ :'order_ids' => :'order_ids',
62
+ :'pk' => :'pk',
63
+ :'sk' => :'sk',
64
+ :'status' => :'status'
65
+ }
66
+ end
67
+
68
+ # Attribute type mapping.
69
+ def self.swagger_types
70
+ {
71
+ :'action' => :'String',
72
+ :'direction' => :'String',
73
+ :'email' => :'String',
74
+ :'files' => :'Array<IntegrationLogFile>',
75
+ :'integration_log_oid' => :'Integer',
76
+ :'item_id' => :'String',
77
+ :'item_ipn_oid' => :'Integer',
78
+ :'log_dts' => :'String',
79
+ :'log_type' => :'String',
80
+ :'logger_id' => :'String',
81
+ :'logs' => :'Array<IntegrationLogLog>',
82
+ :'order_ids' => :'Array<String>',
83
+ :'pk' => :'String',
84
+ :'sk' => :'String',
85
+ :'status' => :'String'
86
+ }
87
+ end
88
+
89
+ # Initializes the object
90
+ # @param [Hash] attributes Model attributes in the form of hash
91
+ def initialize(attributes = {})
92
+ return unless attributes.is_a?(Hash)
93
+
94
+ # convert string to symbol for hash key
95
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
96
+
97
+ if attributes.has_key?(:'action')
98
+ self.action = attributes[:'action']
99
+ end
100
+
101
+ if attributes.has_key?(:'direction')
102
+ self.direction = attributes[:'direction']
103
+ end
104
+
105
+ if attributes.has_key?(:'email')
106
+ self.email = attributes[:'email']
107
+ end
108
+
109
+ if attributes.has_key?(:'files')
110
+ if (value = attributes[:'files']).is_a?(Array)
111
+ self.files = value
112
+ end
113
+ end
114
+
115
+ if attributes.has_key?(:'integration_log_oid')
116
+ self.integration_log_oid = attributes[:'integration_log_oid']
117
+ end
118
+
119
+ if attributes.has_key?(:'item_id')
120
+ self.item_id = attributes[:'item_id']
121
+ end
122
+
123
+ if attributes.has_key?(:'item_ipn_oid')
124
+ self.item_ipn_oid = attributes[:'item_ipn_oid']
125
+ end
126
+
127
+ if attributes.has_key?(:'log_dts')
128
+ self.log_dts = attributes[:'log_dts']
129
+ end
130
+
131
+ if attributes.has_key?(:'log_type')
132
+ self.log_type = attributes[:'log_type']
133
+ end
134
+
135
+ if attributes.has_key?(:'logger_id')
136
+ self.logger_id = attributes[:'logger_id']
137
+ end
138
+
139
+ if attributes.has_key?(:'logs')
140
+ if (value = attributes[:'logs']).is_a?(Array)
141
+ self.logs = value
142
+ end
143
+ end
144
+
145
+ if attributes.has_key?(:'order_ids')
146
+ if (value = attributes[:'order_ids']).is_a?(Array)
147
+ self.order_ids = value
148
+ end
149
+ end
150
+
151
+ if attributes.has_key?(:'pk')
152
+ self.pk = attributes[:'pk']
153
+ end
154
+
155
+ if attributes.has_key?(:'sk')
156
+ self.sk = attributes[:'sk']
157
+ end
158
+
159
+ if attributes.has_key?(:'status')
160
+ self.status = attributes[:'status']
161
+ end
162
+ end
163
+
164
+ # Show invalid properties with the reasons. Usually used together with valid?
165
+ # @return Array for valid properties with the reasons
166
+ def list_invalid_properties
167
+ invalid_properties = Array.new
168
+ invalid_properties
169
+ end
170
+
171
+ # Check to see if the all the properties in the model are valid
172
+ # @return true if the model is valid
173
+ def valid?
174
+ true
175
+ end
176
+
177
+ # Checks equality by comparing each attribute.
178
+ # @param [Object] Object to be compared
179
+ def ==(o)
180
+ return true if self.equal?(o)
181
+ self.class == o.class &&
182
+ action == o.action &&
183
+ direction == o.direction &&
184
+ email == o.email &&
185
+ files == o.files &&
186
+ integration_log_oid == o.integration_log_oid &&
187
+ item_id == o.item_id &&
188
+ item_ipn_oid == o.item_ipn_oid &&
189
+ log_dts == o.log_dts &&
190
+ log_type == o.log_type &&
191
+ logger_id == o.logger_id &&
192
+ logs == o.logs &&
193
+ order_ids == o.order_ids &&
194
+ pk == o.pk &&
195
+ sk == o.sk &&
196
+ status == o.status
197
+ end
198
+
199
+ # @see the `==` method
200
+ # @param [Object] Object to be compared
201
+ def eql?(o)
202
+ self == o
203
+ end
204
+
205
+ # Calculates hash code according to all attributes.
206
+ # @return [Fixnum] Hash code
207
+ def hash
208
+ [action, direction, email, files, integration_log_oid, item_id, item_ipn_oid, log_dts, log_type, logger_id, logs, order_ids, pk, sk, status].hash
209
+ end
210
+
211
+ # Builds the object from hash
212
+ # @param [Hash] attributes Model attributes in the form of hash
213
+ # @return [Object] Returns the model itself
214
+ def build_from_hash(attributes)
215
+ return nil unless attributes.is_a?(Hash)
216
+ self.class.swagger_types.each_pair do |key, type|
217
+ if type =~ /\AArray<(.*)>/i
218
+ # check to ensure the input is an array given that the attribute
219
+ # is documented as an array but the input is not
220
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
221
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
222
+ end
223
+ elsif !attributes[self.class.attribute_map[key]].nil?
224
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
225
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
226
+ end
227
+
228
+ self
229
+ end
230
+
231
+ # Deserializes the data based on type
232
+ # @param string type Data type
233
+ # @param string value Value to be deserialized
234
+ # @return [Object] Deserialized data
235
+ def _deserialize(type, value)
236
+ case type.to_sym
237
+ when :DateTime
238
+ DateTime.parse(value)
239
+ when :Date
240
+ Date.parse(value)
241
+ when :String
242
+ value.to_s
243
+ when :Integer
244
+ value.to_i
245
+ when :Float
246
+ value.to_f
247
+ when :BOOLEAN
248
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
249
+ true
250
+ else
251
+ false
252
+ end
253
+ when :Object
254
+ # generic object (usually a Hash), return directly
255
+ value
256
+ when /\AArray<(?<inner_type>.+)>\z/
257
+ inner_type = Regexp.last_match[:inner_type]
258
+ value.map { |v| _deserialize(inner_type, v) }
259
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
260
+ k_type = Regexp.last_match[:k_type]
261
+ v_type = Regexp.last_match[:v_type]
262
+ {}.tap do |hash|
263
+ value.each do |k, v|
264
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
265
+ end
266
+ end
267
+ else # model
268
+ temp_model = UltracartClient.const_get(type).new
269
+ temp_model.build_from_hash(value)
270
+ end
271
+ end
272
+
273
+ # Returns the string representation of the object
274
+ # @return [String] String presentation of the object
275
+ def to_s
276
+ to_hash.to_s
277
+ end
278
+
279
+ # to_body is an alias to to_hash (backward compatibility)
280
+ # @return [Hash] Returns the object in the form of hash
281
+ def to_body
282
+ to_hash
283
+ end
284
+
285
+ # Returns the object in the form of hash
286
+ # @return [Hash] Returns the object in the form of hash
287
+ def to_hash
288
+ hash = {}
289
+ self.class.attribute_map.each_pair do |attr, param|
290
+ value = self.send(attr)
291
+ next if value.nil?
292
+ hash[param] = _to_hash(value)
293
+ end
294
+ hash
295
+ end
296
+
297
+ # Outputs non-array value in the form of hash
298
+ # For object, use to_hash. Otherwise, just return the value
299
+ # @param [Object] value Any valid value
300
+ # @return [Hash] Returns the value in the form of hash
301
+ def _to_hash(value)
302
+ if value.is_a?(Array)
303
+ value.compact.map { |v| _to_hash(v) }
304
+ elsif value.is_a?(Hash)
305
+ {}.tap do |hash|
306
+ value.each { |k, v| hash[k] = _to_hash(v) }
307
+ end
308
+ elsif value.respond_to? :to_hash
309
+ value.to_hash
310
+ else
311
+ value
312
+ end
313
+ end
314
+
315
+ end
316
+ end
@@ -0,0 +1,202 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ OpenAPI spec version: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.15-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module UltracartClient
16
+ class IntegrationLogFile
17
+ attr_accessor :name
18
+
19
+ attr_accessor :size
20
+
21
+ attr_accessor :uuid
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'name' => :'name',
27
+ :'size' => :'size',
28
+ :'uuid' => :'uuid'
29
+ }
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.swagger_types
34
+ {
35
+ :'name' => :'String',
36
+ :'size' => :'Integer',
37
+ :'uuid' => :'String'
38
+ }
39
+ end
40
+
41
+ # Initializes the object
42
+ # @param [Hash] attributes Model attributes in the form of hash
43
+ def initialize(attributes = {})
44
+ return unless attributes.is_a?(Hash)
45
+
46
+ # convert string to symbol for hash key
47
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
48
+
49
+ if attributes.has_key?(:'name')
50
+ self.name = attributes[:'name']
51
+ end
52
+
53
+ if attributes.has_key?(:'size')
54
+ self.size = attributes[:'size']
55
+ end
56
+
57
+ if attributes.has_key?(:'uuid')
58
+ self.uuid = attributes[:'uuid']
59
+ end
60
+ end
61
+
62
+ # Show invalid properties with the reasons. Usually used together with valid?
63
+ # @return Array for valid properties with the reasons
64
+ def list_invalid_properties
65
+ invalid_properties = Array.new
66
+ invalid_properties
67
+ end
68
+
69
+ # Check to see if the all the properties in the model are valid
70
+ # @return true if the model is valid
71
+ def valid?
72
+ true
73
+ end
74
+
75
+ # Checks equality by comparing each attribute.
76
+ # @param [Object] Object to be compared
77
+ def ==(o)
78
+ return true if self.equal?(o)
79
+ self.class == o.class &&
80
+ name == o.name &&
81
+ size == o.size &&
82
+ uuid == o.uuid
83
+ end
84
+
85
+ # @see the `==` method
86
+ # @param [Object] Object to be compared
87
+ def eql?(o)
88
+ self == o
89
+ end
90
+
91
+ # Calculates hash code according to all attributes.
92
+ # @return [Fixnum] Hash code
93
+ def hash
94
+ [name, size, uuid].hash
95
+ end
96
+
97
+ # Builds the object from hash
98
+ # @param [Hash] attributes Model attributes in the form of hash
99
+ # @return [Object] Returns the model itself
100
+ def build_from_hash(attributes)
101
+ return nil unless attributes.is_a?(Hash)
102
+ self.class.swagger_types.each_pair do |key, type|
103
+ if type =~ /\AArray<(.*)>/i
104
+ # check to ensure the input is an array given that the attribute
105
+ # is documented as an array but the input is not
106
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
107
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
108
+ end
109
+ elsif !attributes[self.class.attribute_map[key]].nil?
110
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
111
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
112
+ end
113
+
114
+ self
115
+ end
116
+
117
+ # Deserializes the data based on type
118
+ # @param string type Data type
119
+ # @param string value Value to be deserialized
120
+ # @return [Object] Deserialized data
121
+ def _deserialize(type, value)
122
+ case type.to_sym
123
+ when :DateTime
124
+ DateTime.parse(value)
125
+ when :Date
126
+ Date.parse(value)
127
+ when :String
128
+ value.to_s
129
+ when :Integer
130
+ value.to_i
131
+ when :Float
132
+ value.to_f
133
+ when :BOOLEAN
134
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
135
+ true
136
+ else
137
+ false
138
+ end
139
+ when :Object
140
+ # generic object (usually a Hash), return directly
141
+ value
142
+ when /\AArray<(?<inner_type>.+)>\z/
143
+ inner_type = Regexp.last_match[:inner_type]
144
+ value.map { |v| _deserialize(inner_type, v) }
145
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
146
+ k_type = Regexp.last_match[:k_type]
147
+ v_type = Regexp.last_match[:v_type]
148
+ {}.tap do |hash|
149
+ value.each do |k, v|
150
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
151
+ end
152
+ end
153
+ else # model
154
+ temp_model = UltracartClient.const_get(type).new
155
+ temp_model.build_from_hash(value)
156
+ end
157
+ end
158
+
159
+ # Returns the string representation of the object
160
+ # @return [String] String presentation of the object
161
+ def to_s
162
+ to_hash.to_s
163
+ end
164
+
165
+ # to_body is an alias to to_hash (backward compatibility)
166
+ # @return [Hash] Returns the object in the form of hash
167
+ def to_body
168
+ to_hash
169
+ end
170
+
171
+ # Returns the object in the form of hash
172
+ # @return [Hash] Returns the object in the form of hash
173
+ def to_hash
174
+ hash = {}
175
+ self.class.attribute_map.each_pair do |attr, param|
176
+ value = self.send(attr)
177
+ next if value.nil?
178
+ hash[param] = _to_hash(value)
179
+ end
180
+ hash
181
+ end
182
+
183
+ # Outputs non-array value in the form of hash
184
+ # For object, use to_hash. Otherwise, just return the value
185
+ # @param [Object] value Any valid value
186
+ # @return [Hash] Returns the value in the form of hash
187
+ def _to_hash(value)
188
+ if value.is_a?(Array)
189
+ value.compact.map { |v| _to_hash(v) }
190
+ elsif value.is_a?(Hash)
191
+ {}.tap do |hash|
192
+ value.each { |k, v| hash[k] = _to_hash(v) }
193
+ end
194
+ elsif value.respond_to? :to_hash
195
+ value.to_hash
196
+ else
197
+ value
198
+ end
199
+ end
200
+
201
+ end
202
+ end