ultracart_api 4.1.208 → 4.1.210
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.
- checksums.yaml +4 -4
- data/README.md +26 -2
- data/docs/SfvbApi.md +717 -48
- data/docs/SfvbArchiveRequest.md +18 -0
- data/docs/SfvbCampaign.md +16 -0
- data/docs/SfvbCampaignMembership.md +24 -0
- data/docs/SfvbCampaignWriteRequest.md +32 -0
- data/docs/SfvbCommsEmail.md +6 -0
- data/docs/SfvbCommsList.md +24 -0
- data/docs/SfvbCommsListsResponse.md +18 -0
- data/docs/SfvbCommsSegment.md +26 -0
- data/docs/SfvbCommsSegmentsResponse.md +18 -0
- data/docs/SfvbEmail.md +2 -0
- data/docs/SfvbEmailReviewRequest.md +18 -0
- data/docs/SfvbFlow.md +22 -0
- data/docs/SfvbFlowStatusRequest.md +18 -0
- data/docs/SfvbFlowWriteRequest.md +38 -0
- data/lib/ultracart_api/api/sfvb_api.rb +1027 -88
- data/lib/ultracart_api/models/sfvb_archive_request.rb +220 -0
- data/lib/ultracart_api/models/sfvb_campaign.rb +85 -1
- data/lib/ultracart_api/models/sfvb_campaign_membership.rb +250 -0
- data/lib/ultracart_api/models/sfvb_campaign_write_request.rb +292 -0
- data/lib/ultracart_api/models/sfvb_comms_email.rb +31 -1
- data/lib/ultracart_api/models/sfvb_comms_list.rb +250 -0
- data/lib/ultracart_api/models/sfvb_comms_lists_response.rb +222 -0
- data/lib/ultracart_api/models/sfvb_comms_segment.rb +260 -0
- data/lib/ultracart_api/models/sfvb_comms_segments_response.rb +222 -0
- data/lib/ultracart_api/models/sfvb_email.rb +13 -1
- data/lib/ultracart_api/models/sfvb_email_review_request.rb +220 -0
- data/lib/ultracart_api/models/sfvb_flow.rb +113 -1
- data/lib/ultracart_api/models/sfvb_flow_status_request.rb +254 -0
- data/lib/ultracart_api/models/sfvb_flow_write_request.rb +354 -0
- data/lib/ultracart_api/version.rb +1 -1
- data/lib/ultracart_api.rb +10 -0
- metadata +22 -2
|
@@ -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
|
|
@@ -0,0 +1,354 @@
|
|
|
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 SfvbFlowWriteRequest
|
|
18
|
+
# True when a customer may be in this flow more than once at a time.
|
|
19
|
+
attr_accessor :allow_multiple_concurrent_enrollments
|
|
20
|
+
|
|
21
|
+
# True to end the flow for a customer once they buy from one of its emails.
|
|
22
|
+
attr_accessor :end_once_customer_purchases
|
|
23
|
+
|
|
24
|
+
# True to end the flow for a customer once they buy from any source.
|
|
25
|
+
attr_accessor :end_once_customer_purchases_anywhere
|
|
26
|
+
|
|
27
|
+
# The flow name, 1 to 250 characters. Required to create.
|
|
28
|
+
attr_accessor :name
|
|
29
|
+
|
|
30
|
+
# Days before a customer may enter again, 1 to 1095. Only with after_days.
|
|
31
|
+
attr_accessor :reentry_delay_days
|
|
32
|
+
|
|
33
|
+
# Whether a customer may enter again, anytime, after_days or never.
|
|
34
|
+
attr_accessor :reentry_policy
|
|
35
|
+
|
|
36
|
+
# The sending domain uuid. Defaults to the storefront's marketing sending domain.
|
|
37
|
+
attr_accessor :sending_domain_uuid
|
|
38
|
+
|
|
39
|
+
# The from name. Defaults to the storefront's marketing setting.
|
|
40
|
+
attr_accessor :sending_name
|
|
41
|
+
|
|
42
|
+
# The part of the from address before the at sign. Defaults to the storefront's marketing setting.
|
|
43
|
+
attr_accessor :sending_user
|
|
44
|
+
|
|
45
|
+
# The list or segment uuid for a list or segment trigger. Create only.
|
|
46
|
+
attr_accessor :trigger_parameter
|
|
47
|
+
|
|
48
|
+
# What enrolls a customer, such as cart abandoned. Create only.
|
|
49
|
+
attr_accessor :trigger_type
|
|
50
|
+
|
|
51
|
+
class EnumAttributeValidator
|
|
52
|
+
attr_reader :datatype
|
|
53
|
+
attr_reader :allowable_values
|
|
54
|
+
|
|
55
|
+
def initialize(datatype, allowable_values)
|
|
56
|
+
@allowable_values = allowable_values.map do |value|
|
|
57
|
+
case datatype.to_s
|
|
58
|
+
when /Integer/i
|
|
59
|
+
value.to_i
|
|
60
|
+
when /Float/i
|
|
61
|
+
value.to_f
|
|
62
|
+
else
|
|
63
|
+
value
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
def valid?(value)
|
|
69
|
+
!value || allowable_values.include?(value)
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
74
|
+
def self.attribute_map
|
|
75
|
+
{
|
|
76
|
+
:'allow_multiple_concurrent_enrollments' => :'allow_multiple_concurrent_enrollments',
|
|
77
|
+
:'end_once_customer_purchases' => :'end_once_customer_purchases',
|
|
78
|
+
:'end_once_customer_purchases_anywhere' => :'end_once_customer_purchases_anywhere',
|
|
79
|
+
:'name' => :'name',
|
|
80
|
+
:'reentry_delay_days' => :'reentry_delay_days',
|
|
81
|
+
:'reentry_policy' => :'reentry_policy',
|
|
82
|
+
:'sending_domain_uuid' => :'sending_domain_uuid',
|
|
83
|
+
:'sending_name' => :'sending_name',
|
|
84
|
+
:'sending_user' => :'sending_user',
|
|
85
|
+
:'trigger_parameter' => :'trigger_parameter',
|
|
86
|
+
:'trigger_type' => :'trigger_type'
|
|
87
|
+
}
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Returns all the JSON keys this model knows about
|
|
91
|
+
def self.acceptable_attributes
|
|
92
|
+
attribute_map.values
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# Attribute type mapping.
|
|
96
|
+
def self.openapi_types
|
|
97
|
+
{
|
|
98
|
+
:'allow_multiple_concurrent_enrollments' => :'Boolean',
|
|
99
|
+
:'end_once_customer_purchases' => :'Boolean',
|
|
100
|
+
:'end_once_customer_purchases_anywhere' => :'Boolean',
|
|
101
|
+
:'name' => :'String',
|
|
102
|
+
:'reentry_delay_days' => :'Integer',
|
|
103
|
+
:'reentry_policy' => :'String',
|
|
104
|
+
:'sending_domain_uuid' => :'String',
|
|
105
|
+
:'sending_name' => :'String',
|
|
106
|
+
:'sending_user' => :'String',
|
|
107
|
+
:'trigger_parameter' => :'String',
|
|
108
|
+
:'trigger_type' => :'String'
|
|
109
|
+
}
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
# List of attributes with nullable: true
|
|
113
|
+
def self.openapi_nullable
|
|
114
|
+
Set.new([
|
|
115
|
+
])
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Initializes the object
|
|
119
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
120
|
+
def initialize(attributes = {})
|
|
121
|
+
if (!attributes.is_a?(Hash))
|
|
122
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbFlowWriteRequest` initialize method"
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
126
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
127
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
128
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbFlowWriteRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
129
|
+
end
|
|
130
|
+
h[k.to_sym] = v
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
if attributes.key?(:'allow_multiple_concurrent_enrollments')
|
|
134
|
+
self.allow_multiple_concurrent_enrollments = attributes[:'allow_multiple_concurrent_enrollments']
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
if attributes.key?(:'end_once_customer_purchases')
|
|
138
|
+
self.end_once_customer_purchases = attributes[:'end_once_customer_purchases']
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
if attributes.key?(:'end_once_customer_purchases_anywhere')
|
|
142
|
+
self.end_once_customer_purchases_anywhere = attributes[:'end_once_customer_purchases_anywhere']
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
if attributes.key?(:'name')
|
|
146
|
+
self.name = attributes[:'name']
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
if attributes.key?(:'reentry_delay_days')
|
|
150
|
+
self.reentry_delay_days = attributes[:'reentry_delay_days']
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
if attributes.key?(:'reentry_policy')
|
|
154
|
+
self.reentry_policy = attributes[:'reentry_policy']
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
if attributes.key?(:'sending_domain_uuid')
|
|
158
|
+
self.sending_domain_uuid = attributes[:'sending_domain_uuid']
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
if attributes.key?(:'sending_name')
|
|
162
|
+
self.sending_name = attributes[:'sending_name']
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
if attributes.key?(:'sending_user')
|
|
166
|
+
self.sending_user = attributes[:'sending_user']
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
if attributes.key?(:'trigger_parameter')
|
|
170
|
+
self.trigger_parameter = attributes[:'trigger_parameter']
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
if attributes.key?(:'trigger_type')
|
|
174
|
+
self.trigger_type = attributes[:'trigger_type']
|
|
175
|
+
end
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
179
|
+
# @return Array for valid properties with the reasons
|
|
180
|
+
def list_invalid_properties
|
|
181
|
+
invalid_properties = Array.new
|
|
182
|
+
invalid_properties
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
# Check to see if the all the properties in the model are valid
|
|
186
|
+
# @return true if the model is valid
|
|
187
|
+
def valid?
|
|
188
|
+
reentry_policy_validator = EnumAttributeValidator.new('String', ["anytime", "after_days", "never"])
|
|
189
|
+
return false unless reentry_policy_validator.valid?(@reentry_policy)
|
|
190
|
+
true
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
194
|
+
# @param [Object] reentry_policy Object to be assigned
|
|
195
|
+
def reentry_policy=(reentry_policy)
|
|
196
|
+
validator = EnumAttributeValidator.new('String', ["anytime", "after_days", "never"])
|
|
197
|
+
unless validator.valid?(reentry_policy)
|
|
198
|
+
fail ArgumentError, "invalid value for \"reentry_policy\", must be one of #{validator.allowable_values}."
|
|
199
|
+
end
|
|
200
|
+
@reentry_policy = reentry_policy
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
# Checks equality by comparing each attribute.
|
|
204
|
+
# @param [Object] Object to be compared
|
|
205
|
+
def ==(o)
|
|
206
|
+
return true if self.equal?(o)
|
|
207
|
+
self.class == o.class &&
|
|
208
|
+
allow_multiple_concurrent_enrollments == o.allow_multiple_concurrent_enrollments &&
|
|
209
|
+
end_once_customer_purchases == o.end_once_customer_purchases &&
|
|
210
|
+
end_once_customer_purchases_anywhere == o.end_once_customer_purchases_anywhere &&
|
|
211
|
+
name == o.name &&
|
|
212
|
+
reentry_delay_days == o.reentry_delay_days &&
|
|
213
|
+
reentry_policy == o.reentry_policy &&
|
|
214
|
+
sending_domain_uuid == o.sending_domain_uuid &&
|
|
215
|
+
sending_name == o.sending_name &&
|
|
216
|
+
sending_user == o.sending_user &&
|
|
217
|
+
trigger_parameter == o.trigger_parameter &&
|
|
218
|
+
trigger_type == o.trigger_type
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
# @see the `==` method
|
|
222
|
+
# @param [Object] Object to be compared
|
|
223
|
+
def eql?(o)
|
|
224
|
+
self == o
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
# Calculates hash code according to all attributes.
|
|
228
|
+
# @return [Integer] Hash code
|
|
229
|
+
def hash
|
|
230
|
+
[allow_multiple_concurrent_enrollments, end_once_customer_purchases, end_once_customer_purchases_anywhere, name, reentry_delay_days, reentry_policy, sending_domain_uuid, sending_name, sending_user, trigger_parameter, trigger_type].hash
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
# Builds the object from hash
|
|
234
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
235
|
+
# @return [Object] Returns the model itself
|
|
236
|
+
def self.build_from_hash(attributes)
|
|
237
|
+
new.build_from_hash(attributes)
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
# Builds the object from hash
|
|
241
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
242
|
+
# @return [Object] Returns the model itself
|
|
243
|
+
def build_from_hash(attributes)
|
|
244
|
+
return nil unless attributes.is_a?(Hash)
|
|
245
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
246
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
247
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
248
|
+
self.send("#{key}=", nil)
|
|
249
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
250
|
+
# check to ensure the input is an array given that the attribute
|
|
251
|
+
# is documented as an array but the input is not
|
|
252
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
253
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
254
|
+
end
|
|
255
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
256
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
257
|
+
end
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
self
|
|
261
|
+
end
|
|
262
|
+
|
|
263
|
+
# Deserializes the data based on type
|
|
264
|
+
# @param string type Data type
|
|
265
|
+
# @param string value Value to be deserialized
|
|
266
|
+
# @return [Object] Deserialized data
|
|
267
|
+
def _deserialize(type, value)
|
|
268
|
+
case type.to_sym
|
|
269
|
+
when :Time
|
|
270
|
+
Time.parse(value)
|
|
271
|
+
when :Date
|
|
272
|
+
Date.parse(value)
|
|
273
|
+
when :String
|
|
274
|
+
value.to_s
|
|
275
|
+
when :Integer
|
|
276
|
+
value.to_i
|
|
277
|
+
when :Float
|
|
278
|
+
value.to_f
|
|
279
|
+
when :Boolean
|
|
280
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
281
|
+
true
|
|
282
|
+
else
|
|
283
|
+
false
|
|
284
|
+
end
|
|
285
|
+
when :Object
|
|
286
|
+
# generic object (usually a Hash), return directly
|
|
287
|
+
value
|
|
288
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
289
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
290
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
291
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
292
|
+
k_type = Regexp.last_match[:k_type]
|
|
293
|
+
v_type = Regexp.last_match[:v_type]
|
|
294
|
+
{}.tap do |hash|
|
|
295
|
+
value.each do |k, v|
|
|
296
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
297
|
+
end
|
|
298
|
+
end
|
|
299
|
+
else # model
|
|
300
|
+
# models (e.g. Pet) or oneOf
|
|
301
|
+
klass = UltracartClient.const_get(type)
|
|
302
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
303
|
+
end
|
|
304
|
+
end
|
|
305
|
+
|
|
306
|
+
# Returns the string representation of the object
|
|
307
|
+
# @return [String] String presentation of the object
|
|
308
|
+
def to_s
|
|
309
|
+
to_hash.to_s
|
|
310
|
+
end
|
|
311
|
+
|
|
312
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
313
|
+
# @return [Hash] Returns the object in the form of hash
|
|
314
|
+
def to_body
|
|
315
|
+
to_hash
|
|
316
|
+
end
|
|
317
|
+
|
|
318
|
+
# Returns the object in the form of hash
|
|
319
|
+
# @return [Hash] Returns the object in the form of hash
|
|
320
|
+
def to_hash
|
|
321
|
+
hash = {}
|
|
322
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
323
|
+
value = self.send(attr)
|
|
324
|
+
if value.nil?
|
|
325
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
326
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
327
|
+
end
|
|
328
|
+
|
|
329
|
+
hash[param] = _to_hash(value)
|
|
330
|
+
end
|
|
331
|
+
hash
|
|
332
|
+
end
|
|
333
|
+
|
|
334
|
+
# Outputs non-array value in the form of hash
|
|
335
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
336
|
+
# @param [Object] value Any valid value
|
|
337
|
+
# @return [Hash] Returns the value in the form of hash
|
|
338
|
+
def _to_hash(value)
|
|
339
|
+
if value.is_a?(Array)
|
|
340
|
+
value.compact.map { |v| _to_hash(v) }
|
|
341
|
+
elsif value.is_a?(Hash)
|
|
342
|
+
{}.tap do |hash|
|
|
343
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
344
|
+
end
|
|
345
|
+
elsif value.respond_to? :to_hash
|
|
346
|
+
value.to_hash
|
|
347
|
+
else
|
|
348
|
+
value
|
|
349
|
+
end
|
|
350
|
+
end
|
|
351
|
+
|
|
352
|
+
end
|
|
353
|
+
|
|
354
|
+
end
|
data/lib/ultracart_api.rb
CHANGED
|
@@ -990,6 +990,7 @@ require 'ultracart_api/models/sfvb_approval_params'
|
|
|
990
990
|
require 'ultracart_api/models/sfvb_approval_review'
|
|
991
991
|
require 'ultracart_api/models/sfvb_approval_review_finding'
|
|
992
992
|
require 'ultracart_api/models/sfvb_approvals_response'
|
|
993
|
+
require 'ultracart_api/models/sfvb_archive_request'
|
|
993
994
|
require 'ultracart_api/models/sfvb_blog_post'
|
|
994
995
|
require 'ultracart_api/models/sfvb_blog_post_detail'
|
|
995
996
|
require 'ultracart_api/models/sfvb_blog_post_image'
|
|
@@ -997,10 +998,16 @@ require 'ultracart_api/models/sfvb_blog_post_image_request'
|
|
|
997
998
|
require 'ultracart_api/models/sfvb_blog_post_request'
|
|
998
999
|
require 'ultracart_api/models/sfvb_blog_posts_response'
|
|
999
1000
|
require 'ultracart_api/models/sfvb_campaign'
|
|
1001
|
+
require 'ultracart_api/models/sfvb_campaign_membership'
|
|
1002
|
+
require 'ultracart_api/models/sfvb_campaign_write_request'
|
|
1000
1003
|
require 'ultracart_api/models/sfvb_campaigns_response'
|
|
1001
1004
|
require 'ultracart_api/models/sfvb_comms_dns_record'
|
|
1002
1005
|
require 'ultracart_api/models/sfvb_comms_email'
|
|
1006
|
+
require 'ultracart_api/models/sfvb_comms_list'
|
|
1007
|
+
require 'ultracart_api/models/sfvb_comms_lists_response'
|
|
1003
1008
|
require 'ultracart_api/models/sfvb_comms_postcard'
|
|
1009
|
+
require 'ultracart_api/models/sfvb_comms_segment'
|
|
1010
|
+
require 'ultracart_api/models/sfvb_comms_segments_response'
|
|
1004
1011
|
require 'ultracart_api/models/sfvb_comms_sending_domain'
|
|
1005
1012
|
require 'ultracart_api/models/sfvb_comms_sending_domains_response'
|
|
1006
1013
|
require 'ultracart_api/models/sfvb_comms_twilio_account'
|
|
@@ -1018,6 +1025,7 @@ require 'ultracart_api/models/sfvb_elements_response'
|
|
|
1018
1025
|
require 'ultracart_api/models/sfvb_email'
|
|
1019
1026
|
require 'ultracart_api/models/sfvb_email_render_request'
|
|
1020
1027
|
require 'ultracart_api/models/sfvb_email_render_response'
|
|
1028
|
+
require 'ultracart_api/models/sfvb_email_review_request'
|
|
1021
1029
|
require 'ultracart_api/models/sfvb_email_update_request'
|
|
1022
1030
|
require 'ultracart_api/models/sfvb_error_detail'
|
|
1023
1031
|
require 'ultracart_api/models/sfvb_event'
|
|
@@ -1045,6 +1053,8 @@ require 'ultracart_api/models/sfvb_file_write_request'
|
|
|
1045
1053
|
require 'ultracart_api/models/sfvb_file_write_response'
|
|
1046
1054
|
require 'ultracart_api/models/sfvb_files_response'
|
|
1047
1055
|
require 'ultracart_api/models/sfvb_flow'
|
|
1056
|
+
require 'ultracart_api/models/sfvb_flow_status_request'
|
|
1057
|
+
require 'ultracart_api/models/sfvb_flow_write_request'
|
|
1048
1058
|
require 'ultracart_api/models/sfvb_flows_response'
|
|
1049
1059
|
require 'ultracart_api/models/sfvb_i18n_glossary'
|
|
1050
1060
|
require 'ultracart_api/models/sfvb_i18n_glossary_request'
|