ultracart_api 4.1.207 → 4.1.209

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 (36) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +28 -2
  3. data/docs/SfvbApi.md +773 -48
  4. data/docs/SfvbArchiveRequest.md +18 -0
  5. data/docs/SfvbCampaign.md +16 -0
  6. data/docs/SfvbCampaignMembership.md +24 -0
  7. data/docs/SfvbCampaignWriteRequest.md +32 -0
  8. data/docs/SfvbCommsEmail.md +6 -0
  9. data/docs/SfvbCommsList.md +24 -0
  10. data/docs/SfvbCommsListsResponse.md +18 -0
  11. data/docs/SfvbCommsSegment.md +26 -0
  12. data/docs/SfvbCommsSegmentsResponse.md +18 -0
  13. data/docs/SfvbEmail.md +40 -0
  14. data/docs/SfvbEmailUpdateRequest.md +20 -0
  15. data/docs/SfvbFlow.md +22 -0
  16. data/docs/SfvbFlowStatusRequest.md +18 -0
  17. data/docs/SfvbFlowWriteRequest.md +38 -0
  18. data/lib/ultracart_api/api/sfvb_api.rb +5346 -4330
  19. data/lib/ultracart_api/models/item_third_party_email_marketing.rb +2 -2
  20. data/lib/ultracart_api/models/sfvb_archive_request.rb +220 -0
  21. data/lib/ultracart_api/models/sfvb_campaign.rb +85 -1
  22. data/lib/ultracart_api/models/sfvb_campaign_membership.rb +250 -0
  23. data/lib/ultracart_api/models/sfvb_campaign_write_request.rb +292 -0
  24. data/lib/ultracart_api/models/sfvb_comms_email.rb +31 -1
  25. data/lib/ultracart_api/models/sfvb_comms_list.rb +250 -0
  26. data/lib/ultracart_api/models/sfvb_comms_lists_response.rb +222 -0
  27. data/lib/ultracart_api/models/sfvb_comms_segment.rb +260 -0
  28. data/lib/ultracart_api/models/sfvb_comms_segments_response.rb +222 -0
  29. data/lib/ultracart_api/models/sfvb_email.rb +330 -0
  30. data/lib/ultracart_api/models/sfvb_email_update_request.rb +230 -0
  31. data/lib/ultracart_api/models/sfvb_flow.rb +113 -1
  32. data/lib/ultracart_api/models/sfvb_flow_status_request.rb +254 -0
  33. data/lib/ultracart_api/models/sfvb_flow_write_request.rb +354 -0
  34. data/lib/ultracart_api/version.rb +1 -1
  35. data/lib/ultracart_api.rb +11 -0
  36. metadata +24 -2
@@ -15,6 +15,9 @@ require 'time'
15
15
 
16
16
  module UltracartClient
17
17
  class SfvbFlow
18
+ # True when a customer may be in this flow more than once at a time.
19
+ attr_accessor :allow_multiple_concurrent_enrollments
20
+
18
21
  # The communication sequence the steps belong to.
19
22
  attr_accessor :communication_sequence_uuid
20
23
 
@@ -27,24 +30,54 @@ module UltracartClient
27
30
  # Its emails, in step order.
28
31
  attr_accessor :emails
29
32
 
33
+ # True when a customer leaves the flow once they buy from one of its emails.
34
+ attr_accessor :end_once_customer_purchases
35
+
36
+ # True when a customer leaves the flow once they buy from any source.
37
+ attr_accessor :end_once_customer_purchases_anywhere
38
+
30
39
  # The flow uuid.
31
40
  attr_accessor :flow_uuid
32
41
 
42
+ # Send this as If-Match when changing, archiving or turning the flow on or off.
43
+ attr_accessor :hash_sha256
44
+
33
45
  # True when the emails and postcards reach customers now, so a change to one shows at once. False only in a status that sends nothing.
34
46
  attr_accessor :live
35
47
 
36
48
  # The flow name.
37
49
  attr_accessor :name
38
50
 
51
+ # What a write did beyond the fields it was asked to change, such as putting emails back to needing review or setting a scheduled campaign back to draft. Only on a write.
52
+ attr_accessor :notes
53
+
39
54
  # Its postcards, in step order.
40
55
  attr_accessor :postcards
41
56
 
57
+ # Days before a customer may enter again, with after_days.
58
+ attr_accessor :reentry_delay_days
59
+
60
+ # Whether a customer may enter again, anytime, after_days or never.
61
+ attr_accessor :reentry_policy
62
+
63
+ # The sending domain uuid. Defaults to the storefront's marketing sending domain.
64
+ attr_accessor :sending_domain_uuid
65
+
66
+ # The from name. Defaults to the storefront's marketing setting.
67
+ attr_accessor :sending_name
68
+
69
+ # The part of the from address before the at sign. Defaults to the storefront's marketing setting.
70
+ attr_accessor :sending_user
71
+
42
72
  # The status, such as draft, active, paused, draining or inactive.
43
73
  attr_accessor :status
44
74
 
45
75
  # When the status last changed (ISO 8601, UTC).
46
76
  attr_accessor :status_dts
47
77
 
78
+ # The list or segment uuid, or other value, the trigger is limited to.
79
+ attr_accessor :trigger_parameter
80
+
48
81
  # The name of the trigger parameter, when the trigger takes one.
49
82
  attr_accessor :trigger_parameter_name
50
83
 
@@ -54,16 +87,27 @@ module UltracartClient
54
87
  # Attribute mapping from ruby-style variable name to JSON key.
55
88
  def self.attribute_map
56
89
  {
90
+ :'allow_multiple_concurrent_enrollments' => :'allow_multiple_concurrent_enrollments',
57
91
  :'communication_sequence_uuid' => :'communication_sequence_uuid',
58
92
  :'created_dts' => :'created_dts',
59
93
  :'deleted' => :'deleted',
60
94
  :'emails' => :'emails',
95
+ :'end_once_customer_purchases' => :'end_once_customer_purchases',
96
+ :'end_once_customer_purchases_anywhere' => :'end_once_customer_purchases_anywhere',
61
97
  :'flow_uuid' => :'flow_uuid',
98
+ :'hash_sha256' => :'hash_sha256',
62
99
  :'live' => :'live',
63
100
  :'name' => :'name',
101
+ :'notes' => :'notes',
64
102
  :'postcards' => :'postcards',
103
+ :'reentry_delay_days' => :'reentry_delay_days',
104
+ :'reentry_policy' => :'reentry_policy',
105
+ :'sending_domain_uuid' => :'sending_domain_uuid',
106
+ :'sending_name' => :'sending_name',
107
+ :'sending_user' => :'sending_user',
65
108
  :'status' => :'status',
66
109
  :'status_dts' => :'status_dts',
110
+ :'trigger_parameter' => :'trigger_parameter',
67
111
  :'trigger_parameter_name' => :'trigger_parameter_name',
68
112
  :'trigger_type' => :'trigger_type'
69
113
  }
@@ -77,16 +121,27 @@ module UltracartClient
77
121
  # Attribute type mapping.
78
122
  def self.openapi_types
79
123
  {
124
+ :'allow_multiple_concurrent_enrollments' => :'Boolean',
80
125
  :'communication_sequence_uuid' => :'String',
81
126
  :'created_dts' => :'String',
82
127
  :'deleted' => :'Boolean',
83
128
  :'emails' => :'Array<SfvbCommsEmail>',
129
+ :'end_once_customer_purchases' => :'Boolean',
130
+ :'end_once_customer_purchases_anywhere' => :'Boolean',
84
131
  :'flow_uuid' => :'String',
132
+ :'hash_sha256' => :'String',
85
133
  :'live' => :'Boolean',
86
134
  :'name' => :'String',
135
+ :'notes' => :'Array<String>',
87
136
  :'postcards' => :'Array<SfvbCommsPostcard>',
137
+ :'reentry_delay_days' => :'Integer',
138
+ :'reentry_policy' => :'String',
139
+ :'sending_domain_uuid' => :'String',
140
+ :'sending_name' => :'String',
141
+ :'sending_user' => :'String',
88
142
  :'status' => :'String',
89
143
  :'status_dts' => :'String',
144
+ :'trigger_parameter' => :'String',
90
145
  :'trigger_parameter_name' => :'String',
91
146
  :'trigger_type' => :'String'
92
147
  }
@@ -113,6 +168,10 @@ module UltracartClient
113
168
  h[k.to_sym] = v
114
169
  }
115
170
 
171
+ if attributes.key?(:'allow_multiple_concurrent_enrollments')
172
+ self.allow_multiple_concurrent_enrollments = attributes[:'allow_multiple_concurrent_enrollments']
173
+ end
174
+
116
175
  if attributes.key?(:'communication_sequence_uuid')
117
176
  self.communication_sequence_uuid = attributes[:'communication_sequence_uuid']
118
177
  end
@@ -131,10 +190,22 @@ module UltracartClient
131
190
  end
132
191
  end
133
192
 
193
+ if attributes.key?(:'end_once_customer_purchases')
194
+ self.end_once_customer_purchases = attributes[:'end_once_customer_purchases']
195
+ end
196
+
197
+ if attributes.key?(:'end_once_customer_purchases_anywhere')
198
+ self.end_once_customer_purchases_anywhere = attributes[:'end_once_customer_purchases_anywhere']
199
+ end
200
+
134
201
  if attributes.key?(:'flow_uuid')
135
202
  self.flow_uuid = attributes[:'flow_uuid']
136
203
  end
137
204
 
205
+ if attributes.key?(:'hash_sha256')
206
+ self.hash_sha256 = attributes[:'hash_sha256']
207
+ end
208
+
138
209
  if attributes.key?(:'live')
139
210
  self.live = attributes[:'live']
140
211
  end
@@ -143,12 +214,38 @@ module UltracartClient
143
214
  self.name = attributes[:'name']
144
215
  end
145
216
 
217
+ if attributes.key?(:'notes')
218
+ if (value = attributes[:'notes']).is_a?(Array)
219
+ self.notes = value
220
+ end
221
+ end
222
+
146
223
  if attributes.key?(:'postcards')
147
224
  if (value = attributes[:'postcards']).is_a?(Array)
148
225
  self.postcards = value
149
226
  end
150
227
  end
151
228
 
229
+ if attributes.key?(:'reentry_delay_days')
230
+ self.reentry_delay_days = attributes[:'reentry_delay_days']
231
+ end
232
+
233
+ if attributes.key?(:'reentry_policy')
234
+ self.reentry_policy = attributes[:'reentry_policy']
235
+ end
236
+
237
+ if attributes.key?(:'sending_domain_uuid')
238
+ self.sending_domain_uuid = attributes[:'sending_domain_uuid']
239
+ end
240
+
241
+ if attributes.key?(:'sending_name')
242
+ self.sending_name = attributes[:'sending_name']
243
+ end
244
+
245
+ if attributes.key?(:'sending_user')
246
+ self.sending_user = attributes[:'sending_user']
247
+ end
248
+
152
249
  if attributes.key?(:'status')
153
250
  self.status = attributes[:'status']
154
251
  end
@@ -157,6 +254,10 @@ module UltracartClient
157
254
  self.status_dts = attributes[:'status_dts']
158
255
  end
159
256
 
257
+ if attributes.key?(:'trigger_parameter')
258
+ self.trigger_parameter = attributes[:'trigger_parameter']
259
+ end
260
+
160
261
  if attributes.key?(:'trigger_parameter_name')
161
262
  self.trigger_parameter_name = attributes[:'trigger_parameter_name']
162
263
  end
@@ -184,16 +285,27 @@ module UltracartClient
184
285
  def ==(o)
185
286
  return true if self.equal?(o)
186
287
  self.class == o.class &&
288
+ allow_multiple_concurrent_enrollments == o.allow_multiple_concurrent_enrollments &&
187
289
  communication_sequence_uuid == o.communication_sequence_uuid &&
188
290
  created_dts == o.created_dts &&
189
291
  deleted == o.deleted &&
190
292
  emails == o.emails &&
293
+ end_once_customer_purchases == o.end_once_customer_purchases &&
294
+ end_once_customer_purchases_anywhere == o.end_once_customer_purchases_anywhere &&
191
295
  flow_uuid == o.flow_uuid &&
296
+ hash_sha256 == o.hash_sha256 &&
192
297
  live == o.live &&
193
298
  name == o.name &&
299
+ notes == o.notes &&
194
300
  postcards == o.postcards &&
301
+ reentry_delay_days == o.reentry_delay_days &&
302
+ reentry_policy == o.reentry_policy &&
303
+ sending_domain_uuid == o.sending_domain_uuid &&
304
+ sending_name == o.sending_name &&
305
+ sending_user == o.sending_user &&
195
306
  status == o.status &&
196
307
  status_dts == o.status_dts &&
308
+ trigger_parameter == o.trigger_parameter &&
197
309
  trigger_parameter_name == o.trigger_parameter_name &&
198
310
  trigger_type == o.trigger_type
199
311
  end
@@ -207,7 +319,7 @@ module UltracartClient
207
319
  # Calculates hash code according to all attributes.
208
320
  # @return [Integer] Hash code
209
321
  def hash
210
- [communication_sequence_uuid, created_dts, deleted, emails, flow_uuid, live, name, postcards, status, status_dts, trigger_parameter_name, trigger_type].hash
322
+ [allow_multiple_concurrent_enrollments, communication_sequence_uuid, created_dts, deleted, emails, end_once_customer_purchases, end_once_customer_purchases_anywhere, flow_uuid, hash_sha256, live, name, notes, postcards, reentry_delay_days, reentry_policy, sending_domain_uuid, sending_name, sending_user, status, status_dts, trigger_parameter, trigger_parameter_name, trigger_type].hash
211
323
  end
212
324
 
213
325
  # Builds the object from hash
@@ -0,0 +1,254 @@
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 SfvbFlowStatusRequest
18
+ # active to enroll customers as they trigger it, inactive to stop.
19
+ attr_accessor :status
20
+
21
+ class EnumAttributeValidator
22
+ attr_reader :datatype
23
+ attr_reader :allowable_values
24
+
25
+ def initialize(datatype, allowable_values)
26
+ @allowable_values = allowable_values.map do |value|
27
+ case datatype.to_s
28
+ when /Integer/i
29
+ value.to_i
30
+ when /Float/i
31
+ value.to_f
32
+ else
33
+ value
34
+ end
35
+ end
36
+ end
37
+
38
+ def valid?(value)
39
+ !value || allowable_values.include?(value)
40
+ end
41
+ end
42
+
43
+ # Attribute mapping from ruby-style variable name to JSON key.
44
+ def self.attribute_map
45
+ {
46
+ :'status' => :'status'
47
+ }
48
+ end
49
+
50
+ # Returns all the JSON keys this model knows about
51
+ def self.acceptable_attributes
52
+ attribute_map.values
53
+ end
54
+
55
+ # Attribute type mapping.
56
+ def self.openapi_types
57
+ {
58
+ :'status' => :'String'
59
+ }
60
+ end
61
+
62
+ # List of attributes with nullable: true
63
+ def self.openapi_nullable
64
+ Set.new([
65
+ ])
66
+ end
67
+
68
+ # Initializes the object
69
+ # @param [Hash] attributes Model attributes in the form of hash
70
+ def initialize(attributes = {})
71
+ if (!attributes.is_a?(Hash))
72
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbFlowStatusRequest` initialize method"
73
+ end
74
+
75
+ # check to see if the attribute exists and convert string to symbol for hash key
76
+ attributes = attributes.each_with_object({}) { |(k, v), h|
77
+ if (!self.class.attribute_map.key?(k.to_sym))
78
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbFlowStatusRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
79
+ end
80
+ h[k.to_sym] = v
81
+ }
82
+
83
+ if attributes.key?(:'status')
84
+ self.status = attributes[:'status']
85
+ end
86
+ end
87
+
88
+ # Show invalid properties with the reasons. Usually used together with valid?
89
+ # @return Array for valid properties with the reasons
90
+ def list_invalid_properties
91
+ invalid_properties = Array.new
92
+ invalid_properties
93
+ end
94
+
95
+ # Check to see if the all the properties in the model are valid
96
+ # @return true if the model is valid
97
+ def valid?
98
+ status_validator = EnumAttributeValidator.new('String', ["active", "inactive"])
99
+ return false unless status_validator.valid?(@status)
100
+ true
101
+ end
102
+
103
+ # Custom attribute writer method checking allowed values (enum).
104
+ # @param [Object] status Object to be assigned
105
+ def status=(status)
106
+ validator = EnumAttributeValidator.new('String', ["active", "inactive"])
107
+ unless validator.valid?(status)
108
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
109
+ end
110
+ @status = status
111
+ end
112
+
113
+ # Checks equality by comparing each attribute.
114
+ # @param [Object] Object to be compared
115
+ def ==(o)
116
+ return true if self.equal?(o)
117
+ self.class == o.class &&
118
+ status == o.status
119
+ end
120
+
121
+ # @see the `==` method
122
+ # @param [Object] Object to be compared
123
+ def eql?(o)
124
+ self == o
125
+ end
126
+
127
+ # Calculates hash code according to all attributes.
128
+ # @return [Integer] Hash code
129
+ def hash
130
+ [status].hash
131
+ end
132
+
133
+ # Builds the object from hash
134
+ # @param [Hash] attributes Model attributes in the form of hash
135
+ # @return [Object] Returns the model itself
136
+ def self.build_from_hash(attributes)
137
+ new.build_from_hash(attributes)
138
+ end
139
+
140
+ # Builds the object from hash
141
+ # @param [Hash] attributes Model attributes in the form of hash
142
+ # @return [Object] Returns the model itself
143
+ def build_from_hash(attributes)
144
+ return nil unless attributes.is_a?(Hash)
145
+ attributes = attributes.transform_keys(&:to_sym)
146
+ self.class.openapi_types.each_pair do |key, type|
147
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
148
+ self.send("#{key}=", nil)
149
+ elsif type =~ /\AArray<(.*)>/i
150
+ # check to ensure the input is an array given that the attribute
151
+ # is documented as an array but the input is not
152
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
153
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
154
+ end
155
+ elsif !attributes[self.class.attribute_map[key]].nil?
156
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
157
+ end
158
+ end
159
+
160
+ self
161
+ end
162
+
163
+ # Deserializes the data based on type
164
+ # @param string type Data type
165
+ # @param string value Value to be deserialized
166
+ # @return [Object] Deserialized data
167
+ def _deserialize(type, value)
168
+ case type.to_sym
169
+ when :Time
170
+ Time.parse(value)
171
+ when :Date
172
+ Date.parse(value)
173
+ when :String
174
+ value.to_s
175
+ when :Integer
176
+ value.to_i
177
+ when :Float
178
+ value.to_f
179
+ when :Boolean
180
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
181
+ true
182
+ else
183
+ false
184
+ end
185
+ when :Object
186
+ # generic object (usually a Hash), return directly
187
+ value
188
+ when /\AArray<(?<inner_type>.+)>\z/
189
+ inner_type = Regexp.last_match[:inner_type]
190
+ value.map { |v| _deserialize(inner_type, v) }
191
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
192
+ k_type = Regexp.last_match[:k_type]
193
+ v_type = Regexp.last_match[:v_type]
194
+ {}.tap do |hash|
195
+ value.each do |k, v|
196
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
197
+ end
198
+ end
199
+ else # model
200
+ # models (e.g. Pet) or oneOf
201
+ klass = UltracartClient.const_get(type)
202
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
203
+ end
204
+ end
205
+
206
+ # Returns the string representation of the object
207
+ # @return [String] String presentation of the object
208
+ def to_s
209
+ to_hash.to_s
210
+ end
211
+
212
+ # to_body is an alias to to_hash (backward compatibility)
213
+ # @return [Hash] Returns the object in the form of hash
214
+ def to_body
215
+ to_hash
216
+ end
217
+
218
+ # Returns the object in the form of hash
219
+ # @return [Hash] Returns the object in the form of hash
220
+ def to_hash
221
+ hash = {}
222
+ self.class.attribute_map.each_pair do |attr, param|
223
+ value = self.send(attr)
224
+ if value.nil?
225
+ is_nullable = self.class.openapi_nullable.include?(attr)
226
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
227
+ end
228
+
229
+ hash[param] = _to_hash(value)
230
+ end
231
+ hash
232
+ end
233
+
234
+ # Outputs non-array value in the form of hash
235
+ # For object, use to_hash. Otherwise, just return the value
236
+ # @param [Object] value Any valid value
237
+ # @return [Hash] Returns the value in the form of hash
238
+ def _to_hash(value)
239
+ if value.is_a?(Array)
240
+ value.compact.map { |v| _to_hash(v) }
241
+ elsif value.is_a?(Hash)
242
+ {}.tap do |hash|
243
+ value.each { |k, v| hash[k] = _to_hash(v) }
244
+ end
245
+ elsif value.respond_to? :to_hash
246
+ value.to_hash
247
+ else
248
+ value
249
+ end
250
+ end
251
+
252
+ end
253
+
254
+ end