ultracart_api 4.0.199 → 4.0.201

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