ultracart_api 3.10.183 → 3.10.184

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.
@@ -0,0 +1,476 @@
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 EmailSmsStat
17
+ # Count of clicked emails
18
+ attr_accessor :click_count
19
+
20
+ # Count of clicked emails, formatted
21
+ attr_accessor :click_count_formatted
22
+
23
+ # Count of conversions
24
+ attr_accessor :conversion_count
25
+
26
+ # Count of conversions, formatted
27
+ attr_accessor :conversion_count_formatted
28
+
29
+ # True if campaign/flow has been archived
30
+ attr_accessor :deleted
31
+
32
+ # Count of delivered emails
33
+ attr_accessor :delivered_count
34
+
35
+ # Count of delivered emails, formatted
36
+ attr_accessor :delivered_count_formatted
37
+
38
+ # Merchant ID
39
+ attr_accessor :merchant_id
40
+
41
+ # List or segment name
42
+ attr_accessor :name
43
+
44
+ # Count of orders
45
+ attr_accessor :order_count
46
+
47
+ # Count of orders, formatted
48
+ attr_accessor :order_count_formatted
49
+
50
+ # Profit
51
+ attr_accessor :profit
52
+
53
+ # Profit, formatted
54
+ attr_accessor :profit_formatted
55
+
56
+ # Revenue
57
+ attr_accessor :revenue
58
+
59
+ # Revenue, formatted
60
+ attr_accessor :revenue_formatted
61
+
62
+ # Count of emails sent
63
+ attr_accessor :send_count
64
+
65
+ # Count of emails sent, formatted
66
+ attr_accessor :send_count_formatted
67
+
68
+ # Count of skipped emails
69
+ attr_accessor :skipped_count
70
+
71
+ # Count of skipped emails, formatted
72
+ attr_accessor :skipped_count_formatted
73
+
74
+ # Campaign, Flow or None (for anything else)
75
+ attr_accessor :stat_type
76
+
77
+ # Status of campaign or flow
78
+ attr_accessor :status
79
+
80
+ # Status dts of campaign or flow
81
+ attr_accessor :status_dts
82
+
83
+ # Step UUID if the statistics are at the step/email level
84
+ attr_accessor :step_uuid
85
+
86
+ attr_accessor :steps
87
+
88
+ # Storefront oid
89
+ attr_accessor :storefront_oid
90
+
91
+ # Count of emails classified as unsubscribe
92
+ attr_accessor :unsubscribe_count
93
+
94
+ # Count of emails classified as unsubscribe, formatted
95
+ attr_accessor :unsubscribe_count_formatted
96
+
97
+ # List/Segment uuid, or Flow/Campaign uuid depending on level of stat aggregation.
98
+ attr_accessor :uuid
99
+
100
+ # Count of views
101
+ attr_accessor :view_count
102
+
103
+ # Count of views, formatted
104
+ attr_accessor :view_count_formatted
105
+
106
+ # Attribute mapping from ruby-style variable name to JSON key.
107
+ def self.attribute_map
108
+ {
109
+ :'click_count' => :'click_count',
110
+ :'click_count_formatted' => :'click_count_formatted',
111
+ :'conversion_count' => :'conversion_count',
112
+ :'conversion_count_formatted' => :'conversion_count_formatted',
113
+ :'deleted' => :'deleted',
114
+ :'delivered_count' => :'delivered_count',
115
+ :'delivered_count_formatted' => :'delivered_count_formatted',
116
+ :'merchant_id' => :'merchant_id',
117
+ :'name' => :'name',
118
+ :'order_count' => :'order_count',
119
+ :'order_count_formatted' => :'order_count_formatted',
120
+ :'profit' => :'profit',
121
+ :'profit_formatted' => :'profit_formatted',
122
+ :'revenue' => :'revenue',
123
+ :'revenue_formatted' => :'revenue_formatted',
124
+ :'send_count' => :'send_count',
125
+ :'send_count_formatted' => :'send_count_formatted',
126
+ :'skipped_count' => :'skipped_count',
127
+ :'skipped_count_formatted' => :'skipped_count_formatted',
128
+ :'stat_type' => :'stat_type',
129
+ :'status' => :'status',
130
+ :'status_dts' => :'status_dts',
131
+ :'step_uuid' => :'step_uuid',
132
+ :'steps' => :'steps',
133
+ :'storefront_oid' => :'storefront_oid',
134
+ :'unsubscribe_count' => :'unsubscribe_count',
135
+ :'unsubscribe_count_formatted' => :'unsubscribe_count_formatted',
136
+ :'uuid' => :'uuid',
137
+ :'view_count' => :'view_count',
138
+ :'view_count_formatted' => :'view_count_formatted'
139
+ }
140
+ end
141
+
142
+ # Attribute type mapping.
143
+ def self.swagger_types
144
+ {
145
+ :'click_count' => :'Integer',
146
+ :'click_count_formatted' => :'String',
147
+ :'conversion_count' => :'Integer',
148
+ :'conversion_count_formatted' => :'String',
149
+ :'deleted' => :'BOOLEAN',
150
+ :'delivered_count' => :'Integer',
151
+ :'delivered_count_formatted' => :'String',
152
+ :'merchant_id' => :'String',
153
+ :'name' => :'String',
154
+ :'order_count' => :'Integer',
155
+ :'order_count_formatted' => :'String',
156
+ :'profit' => :'Float',
157
+ :'profit_formatted' => :'String',
158
+ :'revenue' => :'Float',
159
+ :'revenue_formatted' => :'String',
160
+ :'send_count' => :'Integer',
161
+ :'send_count_formatted' => :'String',
162
+ :'skipped_count' => :'Integer',
163
+ :'skipped_count_formatted' => :'String',
164
+ :'stat_type' => :'String',
165
+ :'status' => :'String',
166
+ :'status_dts' => :'String',
167
+ :'step_uuid' => :'String',
168
+ :'steps' => :'Array<EmailSmsStat>',
169
+ :'storefront_oid' => :'Integer',
170
+ :'unsubscribe_count' => :'Integer',
171
+ :'unsubscribe_count_formatted' => :'String',
172
+ :'uuid' => :'String',
173
+ :'view_count' => :'Integer',
174
+ :'view_count_formatted' => :'String'
175
+ }
176
+ end
177
+
178
+ # Initializes the object
179
+ # @param [Hash] attributes Model attributes in the form of hash
180
+ def initialize(attributes = {})
181
+ return unless attributes.is_a?(Hash)
182
+
183
+ # convert string to symbol for hash key
184
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
185
+
186
+ if attributes.has_key?(:'click_count')
187
+ self.click_count = attributes[:'click_count']
188
+ end
189
+
190
+ if attributes.has_key?(:'click_count_formatted')
191
+ self.click_count_formatted = attributes[:'click_count_formatted']
192
+ end
193
+
194
+ if attributes.has_key?(:'conversion_count')
195
+ self.conversion_count = attributes[:'conversion_count']
196
+ end
197
+
198
+ if attributes.has_key?(:'conversion_count_formatted')
199
+ self.conversion_count_formatted = attributes[:'conversion_count_formatted']
200
+ end
201
+
202
+ if attributes.has_key?(:'deleted')
203
+ self.deleted = attributes[:'deleted']
204
+ end
205
+
206
+ if attributes.has_key?(:'delivered_count')
207
+ self.delivered_count = attributes[:'delivered_count']
208
+ end
209
+
210
+ if attributes.has_key?(:'delivered_count_formatted')
211
+ self.delivered_count_formatted = attributes[:'delivered_count_formatted']
212
+ end
213
+
214
+ if attributes.has_key?(:'merchant_id')
215
+ self.merchant_id = attributes[:'merchant_id']
216
+ end
217
+
218
+ if attributes.has_key?(:'name')
219
+ self.name = attributes[:'name']
220
+ end
221
+
222
+ if attributes.has_key?(:'order_count')
223
+ self.order_count = attributes[:'order_count']
224
+ end
225
+
226
+ if attributes.has_key?(:'order_count_formatted')
227
+ self.order_count_formatted = attributes[:'order_count_formatted']
228
+ end
229
+
230
+ if attributes.has_key?(:'profit')
231
+ self.profit = attributes[:'profit']
232
+ end
233
+
234
+ if attributes.has_key?(:'profit_formatted')
235
+ self.profit_formatted = attributes[:'profit_formatted']
236
+ end
237
+
238
+ if attributes.has_key?(:'revenue')
239
+ self.revenue = attributes[:'revenue']
240
+ end
241
+
242
+ if attributes.has_key?(:'revenue_formatted')
243
+ self.revenue_formatted = attributes[:'revenue_formatted']
244
+ end
245
+
246
+ if attributes.has_key?(:'send_count')
247
+ self.send_count = attributes[:'send_count']
248
+ end
249
+
250
+ if attributes.has_key?(:'send_count_formatted')
251
+ self.send_count_formatted = attributes[:'send_count_formatted']
252
+ end
253
+
254
+ if attributes.has_key?(:'skipped_count')
255
+ self.skipped_count = attributes[:'skipped_count']
256
+ end
257
+
258
+ if attributes.has_key?(:'skipped_count_formatted')
259
+ self.skipped_count_formatted = attributes[:'skipped_count_formatted']
260
+ end
261
+
262
+ if attributes.has_key?(:'stat_type')
263
+ self.stat_type = attributes[:'stat_type']
264
+ end
265
+
266
+ if attributes.has_key?(:'status')
267
+ self.status = attributes[:'status']
268
+ end
269
+
270
+ if attributes.has_key?(:'status_dts')
271
+ self.status_dts = attributes[:'status_dts']
272
+ end
273
+
274
+ if attributes.has_key?(:'step_uuid')
275
+ self.step_uuid = attributes[:'step_uuid']
276
+ end
277
+
278
+ if attributes.has_key?(:'steps')
279
+ if (value = attributes[:'steps']).is_a?(Array)
280
+ self.steps = value
281
+ end
282
+ end
283
+
284
+ if attributes.has_key?(:'storefront_oid')
285
+ self.storefront_oid = attributes[:'storefront_oid']
286
+ end
287
+
288
+ if attributes.has_key?(:'unsubscribe_count')
289
+ self.unsubscribe_count = attributes[:'unsubscribe_count']
290
+ end
291
+
292
+ if attributes.has_key?(:'unsubscribe_count_formatted')
293
+ self.unsubscribe_count_formatted = attributes[:'unsubscribe_count_formatted']
294
+ end
295
+
296
+ if attributes.has_key?(:'uuid')
297
+ self.uuid = attributes[:'uuid']
298
+ end
299
+
300
+ if attributes.has_key?(:'view_count')
301
+ self.view_count = attributes[:'view_count']
302
+ end
303
+
304
+ if attributes.has_key?(:'view_count_formatted')
305
+ self.view_count_formatted = attributes[:'view_count_formatted']
306
+ end
307
+ end
308
+
309
+ # Show invalid properties with the reasons. Usually used together with valid?
310
+ # @return Array for valid properties with the reasons
311
+ def list_invalid_properties
312
+ invalid_properties = Array.new
313
+ invalid_properties
314
+ end
315
+
316
+ # Check to see if the all the properties in the model are valid
317
+ # @return true if the model is valid
318
+ def valid?
319
+ true
320
+ end
321
+
322
+ # Checks equality by comparing each attribute.
323
+ # @param [Object] Object to be compared
324
+ def ==(o)
325
+ return true if self.equal?(o)
326
+ self.class == o.class &&
327
+ click_count == o.click_count &&
328
+ click_count_formatted == o.click_count_formatted &&
329
+ conversion_count == o.conversion_count &&
330
+ conversion_count_formatted == o.conversion_count_formatted &&
331
+ deleted == o.deleted &&
332
+ delivered_count == o.delivered_count &&
333
+ delivered_count_formatted == o.delivered_count_formatted &&
334
+ merchant_id == o.merchant_id &&
335
+ name == o.name &&
336
+ order_count == o.order_count &&
337
+ order_count_formatted == o.order_count_formatted &&
338
+ profit == o.profit &&
339
+ profit_formatted == o.profit_formatted &&
340
+ revenue == o.revenue &&
341
+ revenue_formatted == o.revenue_formatted &&
342
+ send_count == o.send_count &&
343
+ send_count_formatted == o.send_count_formatted &&
344
+ skipped_count == o.skipped_count &&
345
+ skipped_count_formatted == o.skipped_count_formatted &&
346
+ stat_type == o.stat_type &&
347
+ status == o.status &&
348
+ status_dts == o.status_dts &&
349
+ step_uuid == o.step_uuid &&
350
+ steps == o.steps &&
351
+ storefront_oid == o.storefront_oid &&
352
+ unsubscribe_count == o.unsubscribe_count &&
353
+ unsubscribe_count_formatted == o.unsubscribe_count_formatted &&
354
+ uuid == o.uuid &&
355
+ view_count == o.view_count &&
356
+ view_count_formatted == o.view_count_formatted
357
+ end
358
+
359
+ # @see the `==` method
360
+ # @param [Object] Object to be compared
361
+ def eql?(o)
362
+ self == o
363
+ end
364
+
365
+ # Calculates hash code according to all attributes.
366
+ # @return [Fixnum] Hash code
367
+ def hash
368
+ [click_count, click_count_formatted, conversion_count, conversion_count_formatted, deleted, delivered_count, delivered_count_formatted, merchant_id, name, order_count, order_count_formatted, profit, profit_formatted, revenue, revenue_formatted, send_count, send_count_formatted, skipped_count, skipped_count_formatted, stat_type, status, status_dts, step_uuid, steps, storefront_oid, unsubscribe_count, unsubscribe_count_formatted, uuid, view_count, view_count_formatted].hash
369
+ end
370
+
371
+ # Builds the object from hash
372
+ # @param [Hash] attributes Model attributes in the form of hash
373
+ # @return [Object] Returns the model itself
374
+ def build_from_hash(attributes)
375
+ return nil unless attributes.is_a?(Hash)
376
+ self.class.swagger_types.each_pair do |key, type|
377
+ if type =~ /\AArray<(.*)>/i
378
+ # check to ensure the input is an array given that the attribute
379
+ # is documented as an array but the input is not
380
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
381
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
382
+ end
383
+ elsif !attributes[self.class.attribute_map[key]].nil?
384
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
385
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
386
+ end
387
+
388
+ self
389
+ end
390
+
391
+ # Deserializes the data based on type
392
+ # @param string type Data type
393
+ # @param string value Value to be deserialized
394
+ # @return [Object] Deserialized data
395
+ def _deserialize(type, value)
396
+ case type.to_sym
397
+ when :DateTime
398
+ DateTime.parse(value)
399
+ when :Date
400
+ Date.parse(value)
401
+ when :String
402
+ value.to_s
403
+ when :Integer
404
+ value.to_i
405
+ when :Float
406
+ value.to_f
407
+ when :BOOLEAN
408
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
409
+ true
410
+ else
411
+ false
412
+ end
413
+ when :Object
414
+ # generic object (usually a Hash), return directly
415
+ value
416
+ when /\AArray<(?<inner_type>.+)>\z/
417
+ inner_type = Regexp.last_match[:inner_type]
418
+ value.map { |v| _deserialize(inner_type, v) }
419
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
420
+ k_type = Regexp.last_match[:k_type]
421
+ v_type = Regexp.last_match[:v_type]
422
+ {}.tap do |hash|
423
+ value.each do |k, v|
424
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
425
+ end
426
+ end
427
+ else # model
428
+ temp_model = UltracartClient.const_get(type).new
429
+ temp_model.build_from_hash(value)
430
+ end
431
+ end
432
+
433
+ # Returns the string representation of the object
434
+ # @return [String] String presentation of the object
435
+ def to_s
436
+ to_hash.to_s
437
+ end
438
+
439
+ # to_body is an alias to to_hash (backward compatibility)
440
+ # @return [Hash] Returns the object in the form of hash
441
+ def to_body
442
+ to_hash
443
+ end
444
+
445
+ # Returns the object in the form of hash
446
+ # @return [Hash] Returns the object in the form of hash
447
+ def to_hash
448
+ hash = {}
449
+ self.class.attribute_map.each_pair do |attr, param|
450
+ value = self.send(attr)
451
+ next if value.nil?
452
+ hash[param] = _to_hash(value)
453
+ end
454
+ hash
455
+ end
456
+
457
+ # Outputs non-array value in the form of hash
458
+ # For object, use to_hash. Otherwise, just return the value
459
+ # @param [Object] value Any valid value
460
+ # @return [Hash] Returns the value in the form of hash
461
+ def _to_hash(value)
462
+ if value.is_a?(Array)
463
+ value.compact.map { |v| _to_hash(v) }
464
+ elsif value.is_a?(Hash)
465
+ {}.tap do |hash|
466
+ value.each { |k, v| hash[k] = _to_hash(v) }
467
+ end
468
+ elsif value.respond_to? :to_hash
469
+ value.to_hash
470
+ else
471
+ value
472
+ end
473
+ end
474
+
475
+ end
476
+ end
@@ -0,0 +1,195 @@
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 EmailStatSmsSummaryRequest
17
+ attr_accessor :commseq_step_uuids
18
+
19
+ attr_accessor :days
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'commseq_step_uuids' => :'commseq_step_uuids',
25
+ :'days' => :'days'
26
+ }
27
+ end
28
+
29
+ # Attribute type mapping.
30
+ def self.swagger_types
31
+ {
32
+ :'commseq_step_uuids' => :'Array<String>',
33
+ :'days' => :'Integer'
34
+ }
35
+ end
36
+
37
+ # Initializes the object
38
+ # @param [Hash] attributes Model attributes in the form of hash
39
+ def initialize(attributes = {})
40
+ return unless attributes.is_a?(Hash)
41
+
42
+ # convert string to symbol for hash key
43
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
44
+
45
+ if attributes.has_key?(:'commseq_step_uuids')
46
+ if (value = attributes[:'commseq_step_uuids']).is_a?(Array)
47
+ self.commseq_step_uuids = value
48
+ end
49
+ end
50
+
51
+ if attributes.has_key?(:'days')
52
+ self.days = attributes[:'days']
53
+ end
54
+ end
55
+
56
+ # Show invalid properties with the reasons. Usually used together with valid?
57
+ # @return Array for valid properties with the reasons
58
+ def list_invalid_properties
59
+ invalid_properties = Array.new
60
+ invalid_properties
61
+ end
62
+
63
+ # Check to see if the all the properties in the model are valid
64
+ # @return true if the model is valid
65
+ def valid?
66
+ true
67
+ end
68
+
69
+ # Checks equality by comparing each attribute.
70
+ # @param [Object] Object to be compared
71
+ def ==(o)
72
+ return true if self.equal?(o)
73
+ self.class == o.class &&
74
+ commseq_step_uuids == o.commseq_step_uuids &&
75
+ days == o.days
76
+ end
77
+
78
+ # @see the `==` method
79
+ # @param [Object] Object to be compared
80
+ def eql?(o)
81
+ self == o
82
+ end
83
+
84
+ # Calculates hash code according to all attributes.
85
+ # @return [Fixnum] Hash code
86
+ def hash
87
+ [commseq_step_uuids, days].hash
88
+ end
89
+
90
+ # Builds the object from hash
91
+ # @param [Hash] attributes Model attributes in the form of hash
92
+ # @return [Object] Returns the model itself
93
+ def build_from_hash(attributes)
94
+ return nil unless attributes.is_a?(Hash)
95
+ self.class.swagger_types.each_pair do |key, type|
96
+ if type =~ /\AArray<(.*)>/i
97
+ # check to ensure the input is an array given that the attribute
98
+ # is documented as an array but the input is not
99
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
100
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
101
+ end
102
+ elsif !attributes[self.class.attribute_map[key]].nil?
103
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
104
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
105
+ end
106
+
107
+ self
108
+ end
109
+
110
+ # Deserializes the data based on type
111
+ # @param string type Data type
112
+ # @param string value Value to be deserialized
113
+ # @return [Object] Deserialized data
114
+ def _deserialize(type, value)
115
+ case type.to_sym
116
+ when :DateTime
117
+ DateTime.parse(value)
118
+ when :Date
119
+ Date.parse(value)
120
+ when :String
121
+ value.to_s
122
+ when :Integer
123
+ value.to_i
124
+ when :Float
125
+ value.to_f
126
+ when :BOOLEAN
127
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
128
+ true
129
+ else
130
+ false
131
+ end
132
+ when :Object
133
+ # generic object (usually a Hash), return directly
134
+ value
135
+ when /\AArray<(?<inner_type>.+)>\z/
136
+ inner_type = Regexp.last_match[:inner_type]
137
+ value.map { |v| _deserialize(inner_type, v) }
138
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
139
+ k_type = Regexp.last_match[:k_type]
140
+ v_type = Regexp.last_match[:v_type]
141
+ {}.tap do |hash|
142
+ value.each do |k, v|
143
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
144
+ end
145
+ end
146
+ else # model
147
+ temp_model = UltracartClient.const_get(type).new
148
+ temp_model.build_from_hash(value)
149
+ end
150
+ end
151
+
152
+ # Returns the string representation of the object
153
+ # @return [String] String presentation of the object
154
+ def to_s
155
+ to_hash.to_s
156
+ end
157
+
158
+ # to_body is an alias to to_hash (backward compatibility)
159
+ # @return [Hash] Returns the object in the form of hash
160
+ def to_body
161
+ to_hash
162
+ end
163
+
164
+ # Returns the object in the form of hash
165
+ # @return [Hash] Returns the object in the form of hash
166
+ def to_hash
167
+ hash = {}
168
+ self.class.attribute_map.each_pair do |attr, param|
169
+ value = self.send(attr)
170
+ next if value.nil?
171
+ hash[param] = _to_hash(value)
172
+ end
173
+ hash
174
+ end
175
+
176
+ # Outputs non-array value in the form of hash
177
+ # For object, use to_hash. Otherwise, just return the value
178
+ # @param [Object] value Any valid value
179
+ # @return [Hash] Returns the value in the form of hash
180
+ def _to_hash(value)
181
+ if value.is_a?(Array)
182
+ value.compact.map { |v| _to_hash(v) }
183
+ elsif value.is_a?(Hash)
184
+ {}.tap do |hash|
185
+ value.each { |k, v| hash[k] = _to_hash(v) }
186
+ end
187
+ elsif value.respond_to? :to_hash
188
+ value.to_hash
189
+ else
190
+ value
191
+ end
192
+ end
193
+
194
+ end
195
+ end