ultracart_api 4.1.222 → 4.1.224
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 +55 -2
- data/docs/OauthTokenResponse.md +2 -0
- data/docs/SfvbAffiliateNetwork.md +60 -0
- data/docs/SfvbAffiliateNetworkRequest.md +50 -0
- data/docs/SfvbAffiliateNetworksResponse.md +20 -0
- data/docs/SfvbApi.md +1456 -120
- data/docs/SfvbApprovalCreateRequest.md +8 -2
- data/docs/SfvbApprovalParams.md +7 -3
- data/docs/SfvbContainerResponse.md +3 -1
- data/docs/SfvbSmartAttribution.md +38 -0
- data/docs/SfvbSmartAttributionPlatform.md +34 -0
- data/docs/SfvbSmartAttributionRequest.md +30 -0
- data/docs/SfvbTrackingAdvanced.md +34 -0
- data/docs/SfvbTrackingAdvancedRequest.md +34 -0
- data/docs/SfvbTrackingChange.md +24 -0
- data/docs/SfvbTrackingHtml.md +36 -0
- data/docs/SfvbTrackingHtmlRequest.md +20 -0
- data/docs/SfvbTrackingHtmlResponse.md +22 -0
- data/docs/SfvbTrackingPrivacy.md +28 -0
- data/docs/SfvbTrackingPrivacyRequest.md +28 -0
- data/docs/SfvbTrackingProvider.md +48 -0
- data/docs/SfvbTrackingProviderConsent.md +22 -0
- data/docs/SfvbTrackingProviderEvent.md +20 -0
- data/docs/SfvbTrackingProviderField.md +42 -0
- data/docs/SfvbTrackingProviderOauth.md +28 -0
- data/docs/SfvbTrackingProviderRequest.md +32 -0
- data/docs/SfvbTrackingProviderSecrets.md +46 -0
- data/docs/SfvbTrackingProvidersResponse.md +22 -0
- data/docs/SfvbTrackingSettingsResponse.md +28 -0
- data/docs/SfvbTrackingWholesaleTier.md +22 -0
- data/docs/SfvbUtmShortcode.md +56 -0
- data/docs/SfvbUtmShortcodeRequest.md +44 -0
- data/docs/SfvbUtmShortcodesResponse.md +24 -0
- data/lib/ultracart_api/api/sfvb_api.rb +4602 -2793
- data/lib/ultracart_api/models/oauth_token_response.rb +11 -1
- data/lib/ultracart_api/models/sfvb_affiliate_network.rb +478 -0
- data/lib/ultracart_api/models/sfvb_affiliate_network_request.rb +428 -0
- data/lib/ultracart_api/models/sfvb_affiliate_networks_response.rb +232 -0
- data/lib/ultracart_api/models/sfvb_approval_create_request.rb +34 -7
- data/lib/ultracart_api/models/sfvb_approval_params.rb +24 -4
- data/lib/ultracart_api/models/sfvb_container_response.rb +16 -4
- data/lib/ultracart_api/models/sfvb_smart_attribution.rb +324 -0
- data/lib/ultracart_api/models/sfvb_smart_attribution_platform.rb +300 -0
- data/lib/ultracart_api/models/sfvb_smart_attribution_request.rb +282 -0
- data/lib/ultracart_api/models/sfvb_tracking_advanced.rb +300 -0
- data/lib/ultracart_api/models/sfvb_tracking_advanced_request.rb +302 -0
- data/lib/ultracart_api/models/sfvb_tracking_change.rb +250 -0
- data/lib/ultracart_api/models/sfvb_tracking_html.rb +344 -0
- data/lib/ultracart_api/models/sfvb_tracking_html_request.rb +230 -0
- data/lib/ultracart_api/models/sfvb_tracking_html_response.rb +242 -0
- data/lib/ultracart_api/models/sfvb_tracking_privacy.rb +352 -0
- data/lib/ultracart_api/models/sfvb_tracking_privacy_request.rb +352 -0
- data/lib/ultracart_api/models/sfvb_tracking_provider.rb +378 -0
- data/lib/ultracart_api/models/sfvb_tracking_provider_consent.rb +240 -0
- data/lib/ultracart_api/models/sfvb_tracking_provider_event.rb +230 -0
- data/lib/ultracart_api/models/sfvb_tracking_provider_field.rb +342 -0
- data/lib/ultracart_api/models/sfvb_tracking_provider_oauth.rb +270 -0
- data/lib/ultracart_api/models/sfvb_tracking_provider_request.rb +292 -0
- data/lib/ultracart_api/models/sfvb_tracking_provider_secrets.rb +360 -0
- data/lib/ultracart_api/models/sfvb_tracking_providers_response.rb +242 -0
- data/lib/ultracart_api/models/sfvb_tracking_settings_response.rb +272 -0
- data/lib/ultracart_api/models/sfvb_tracking_wholesale_tier.rb +240 -0
- data/lib/ultracart_api/models/sfvb_utm_shortcode.rb +410 -0
- data/lib/ultracart_api/models/sfvb_utm_shortcode_request.rb +350 -0
- data/lib/ultracart_api/models/sfvb_utm_shortcodes_response.rb +252 -0
- data/lib/ultracart_api/version.rb +1 -1
- data/lib/ultracart_api.rb +27 -0
- metadata +55 -1
|
@@ -0,0 +1,352 @@
|
|
|
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 SfvbTrackingPrivacy
|
|
18
|
+
# Which shoppers have their IP address anonymized on the cart and order. all, eea, non_us, or null for nobody.
|
|
19
|
+
attr_accessor :anonymize_ip
|
|
20
|
+
|
|
21
|
+
# Which shoppers start checkout with the mailing list sign-up unchecked. all, eea, non_us, or null for nobody.
|
|
22
|
+
attr_accessor :default_mailing_list_off
|
|
23
|
+
|
|
24
|
+
# Which shoppers are left out of the return email (the admin's Disable Return Email rule). all, eea, non_us, or null for nobody.
|
|
25
|
+
attr_accessor :disable_return_email
|
|
26
|
+
|
|
27
|
+
# Which shoppers' purchases are left out of the purchase bubble history. all, eea, non_us, or null for nobody.
|
|
28
|
+
attr_accessor :exclude_purchase_bubble_history
|
|
29
|
+
|
|
30
|
+
# The hash of these five rules. Send it as If-Match when changing them.
|
|
31
|
+
attr_accessor :hash_sha256
|
|
32
|
+
|
|
33
|
+
# Which shoppers see the privacy and cookie notice. all, eea (shoppers in the European Economic Area), non_us, or null for nobody.
|
|
34
|
+
attr_accessor :show_cookie_notice
|
|
35
|
+
|
|
36
|
+
class EnumAttributeValidator
|
|
37
|
+
attr_reader :datatype
|
|
38
|
+
attr_reader :allowable_values
|
|
39
|
+
|
|
40
|
+
def initialize(datatype, allowable_values)
|
|
41
|
+
@allowable_values = allowable_values.map do |value|
|
|
42
|
+
case datatype.to_s
|
|
43
|
+
when /Integer/i
|
|
44
|
+
value.to_i
|
|
45
|
+
when /Float/i
|
|
46
|
+
value.to_f
|
|
47
|
+
else
|
|
48
|
+
value
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def valid?(value)
|
|
54
|
+
!value || allowable_values.include?(value)
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
59
|
+
def self.attribute_map
|
|
60
|
+
{
|
|
61
|
+
:'anonymize_ip' => :'anonymize_ip',
|
|
62
|
+
:'default_mailing_list_off' => :'default_mailing_list_off',
|
|
63
|
+
:'disable_return_email' => :'disable_return_email',
|
|
64
|
+
:'exclude_purchase_bubble_history' => :'exclude_purchase_bubble_history',
|
|
65
|
+
:'hash_sha256' => :'hash_sha256',
|
|
66
|
+
:'show_cookie_notice' => :'show_cookie_notice'
|
|
67
|
+
}
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Returns all the JSON keys this model knows about
|
|
71
|
+
def self.acceptable_attributes
|
|
72
|
+
attribute_map.values
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# Attribute type mapping.
|
|
76
|
+
def self.openapi_types
|
|
77
|
+
{
|
|
78
|
+
:'anonymize_ip' => :'String',
|
|
79
|
+
:'default_mailing_list_off' => :'String',
|
|
80
|
+
:'disable_return_email' => :'String',
|
|
81
|
+
:'exclude_purchase_bubble_history' => :'String',
|
|
82
|
+
:'hash_sha256' => :'String',
|
|
83
|
+
:'show_cookie_notice' => :'String'
|
|
84
|
+
}
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# List of attributes with nullable: true
|
|
88
|
+
def self.openapi_nullable
|
|
89
|
+
Set.new([
|
|
90
|
+
])
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Initializes the object
|
|
94
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
95
|
+
def initialize(attributes = {})
|
|
96
|
+
if (!attributes.is_a?(Hash))
|
|
97
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbTrackingPrivacy` initialize method"
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
101
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
102
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
103
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbTrackingPrivacy`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
104
|
+
end
|
|
105
|
+
h[k.to_sym] = v
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if attributes.key?(:'anonymize_ip')
|
|
109
|
+
self.anonymize_ip = attributes[:'anonymize_ip']
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
if attributes.key?(:'default_mailing_list_off')
|
|
113
|
+
self.default_mailing_list_off = attributes[:'default_mailing_list_off']
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
if attributes.key?(:'disable_return_email')
|
|
117
|
+
self.disable_return_email = attributes[:'disable_return_email']
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
if attributes.key?(:'exclude_purchase_bubble_history')
|
|
121
|
+
self.exclude_purchase_bubble_history = attributes[:'exclude_purchase_bubble_history']
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
if attributes.key?(:'hash_sha256')
|
|
125
|
+
self.hash_sha256 = attributes[:'hash_sha256']
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
if attributes.key?(:'show_cookie_notice')
|
|
129
|
+
self.show_cookie_notice = attributes[:'show_cookie_notice']
|
|
130
|
+
end
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
134
|
+
# @return Array for valid properties with the reasons
|
|
135
|
+
def list_invalid_properties
|
|
136
|
+
invalid_properties = Array.new
|
|
137
|
+
invalid_properties
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
# Check to see if the all the properties in the model are valid
|
|
141
|
+
# @return true if the model is valid
|
|
142
|
+
def valid?
|
|
143
|
+
anonymize_ip_validator = EnumAttributeValidator.new('String', ["all", "eea", "non_us"])
|
|
144
|
+
return false unless anonymize_ip_validator.valid?(@anonymize_ip)
|
|
145
|
+
default_mailing_list_off_validator = EnumAttributeValidator.new('String', ["all", "eea", "non_us"])
|
|
146
|
+
return false unless default_mailing_list_off_validator.valid?(@default_mailing_list_off)
|
|
147
|
+
disable_return_email_validator = EnumAttributeValidator.new('String', ["all", "eea", "non_us"])
|
|
148
|
+
return false unless disable_return_email_validator.valid?(@disable_return_email)
|
|
149
|
+
exclude_purchase_bubble_history_validator = EnumAttributeValidator.new('String', ["all", "eea", "non_us"])
|
|
150
|
+
return false unless exclude_purchase_bubble_history_validator.valid?(@exclude_purchase_bubble_history)
|
|
151
|
+
show_cookie_notice_validator = EnumAttributeValidator.new('String', ["all", "eea", "non_us"])
|
|
152
|
+
return false unless show_cookie_notice_validator.valid?(@show_cookie_notice)
|
|
153
|
+
true
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
157
|
+
# @param [Object] anonymize_ip Object to be assigned
|
|
158
|
+
def anonymize_ip=(anonymize_ip)
|
|
159
|
+
validator = EnumAttributeValidator.new('String', ["all", "eea", "non_us"])
|
|
160
|
+
unless validator.valid?(anonymize_ip)
|
|
161
|
+
fail ArgumentError, "invalid value for \"anonymize_ip\", must be one of #{validator.allowable_values}."
|
|
162
|
+
end
|
|
163
|
+
@anonymize_ip = anonymize_ip
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
167
|
+
# @param [Object] default_mailing_list_off Object to be assigned
|
|
168
|
+
def default_mailing_list_off=(default_mailing_list_off)
|
|
169
|
+
validator = EnumAttributeValidator.new('String', ["all", "eea", "non_us"])
|
|
170
|
+
unless validator.valid?(default_mailing_list_off)
|
|
171
|
+
fail ArgumentError, "invalid value for \"default_mailing_list_off\", must be one of #{validator.allowable_values}."
|
|
172
|
+
end
|
|
173
|
+
@default_mailing_list_off = default_mailing_list_off
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
177
|
+
# @param [Object] disable_return_email Object to be assigned
|
|
178
|
+
def disable_return_email=(disable_return_email)
|
|
179
|
+
validator = EnumAttributeValidator.new('String', ["all", "eea", "non_us"])
|
|
180
|
+
unless validator.valid?(disable_return_email)
|
|
181
|
+
fail ArgumentError, "invalid value for \"disable_return_email\", must be one of #{validator.allowable_values}."
|
|
182
|
+
end
|
|
183
|
+
@disable_return_email = disable_return_email
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
187
|
+
# @param [Object] exclude_purchase_bubble_history Object to be assigned
|
|
188
|
+
def exclude_purchase_bubble_history=(exclude_purchase_bubble_history)
|
|
189
|
+
validator = EnumAttributeValidator.new('String', ["all", "eea", "non_us"])
|
|
190
|
+
unless validator.valid?(exclude_purchase_bubble_history)
|
|
191
|
+
fail ArgumentError, "invalid value for \"exclude_purchase_bubble_history\", must be one of #{validator.allowable_values}."
|
|
192
|
+
end
|
|
193
|
+
@exclude_purchase_bubble_history = exclude_purchase_bubble_history
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
197
|
+
# @param [Object] show_cookie_notice Object to be assigned
|
|
198
|
+
def show_cookie_notice=(show_cookie_notice)
|
|
199
|
+
validator = EnumAttributeValidator.new('String', ["all", "eea", "non_us"])
|
|
200
|
+
unless validator.valid?(show_cookie_notice)
|
|
201
|
+
fail ArgumentError, "invalid value for \"show_cookie_notice\", must be one of #{validator.allowable_values}."
|
|
202
|
+
end
|
|
203
|
+
@show_cookie_notice = show_cookie_notice
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
# Checks equality by comparing each attribute.
|
|
207
|
+
# @param [Object] Object to be compared
|
|
208
|
+
def ==(o)
|
|
209
|
+
return true if self.equal?(o)
|
|
210
|
+
self.class == o.class &&
|
|
211
|
+
anonymize_ip == o.anonymize_ip &&
|
|
212
|
+
default_mailing_list_off == o.default_mailing_list_off &&
|
|
213
|
+
disable_return_email == o.disable_return_email &&
|
|
214
|
+
exclude_purchase_bubble_history == o.exclude_purchase_bubble_history &&
|
|
215
|
+
hash_sha256 == o.hash_sha256 &&
|
|
216
|
+
show_cookie_notice == o.show_cookie_notice
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
# @see the `==` method
|
|
220
|
+
# @param [Object] Object to be compared
|
|
221
|
+
def eql?(o)
|
|
222
|
+
self == o
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
# Calculates hash code according to all attributes.
|
|
226
|
+
# @return [Integer] Hash code
|
|
227
|
+
def hash
|
|
228
|
+
[anonymize_ip, default_mailing_list_off, disable_return_email, exclude_purchase_bubble_history, hash_sha256, show_cookie_notice].hash
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
# Builds the object from hash
|
|
232
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
233
|
+
# @return [Object] Returns the model itself
|
|
234
|
+
def self.build_from_hash(attributes)
|
|
235
|
+
new.build_from_hash(attributes)
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
# Builds the object from hash
|
|
239
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
240
|
+
# @return [Object] Returns the model itself
|
|
241
|
+
def build_from_hash(attributes)
|
|
242
|
+
return nil unless attributes.is_a?(Hash)
|
|
243
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
244
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
245
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
246
|
+
self.send("#{key}=", nil)
|
|
247
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
248
|
+
# check to ensure the input is an array given that the attribute
|
|
249
|
+
# is documented as an array but the input is not
|
|
250
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
251
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
252
|
+
end
|
|
253
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
254
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
255
|
+
end
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
self
|
|
259
|
+
end
|
|
260
|
+
|
|
261
|
+
# Deserializes the data based on type
|
|
262
|
+
# @param string type Data type
|
|
263
|
+
# @param string value Value to be deserialized
|
|
264
|
+
# @return [Object] Deserialized data
|
|
265
|
+
def _deserialize(type, value)
|
|
266
|
+
case type.to_sym
|
|
267
|
+
when :Time
|
|
268
|
+
Time.parse(value)
|
|
269
|
+
when :Date
|
|
270
|
+
Date.parse(value)
|
|
271
|
+
when :String
|
|
272
|
+
value.to_s
|
|
273
|
+
when :Integer
|
|
274
|
+
value.to_i
|
|
275
|
+
when :Float
|
|
276
|
+
value.to_f
|
|
277
|
+
when :Boolean
|
|
278
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
279
|
+
true
|
|
280
|
+
else
|
|
281
|
+
false
|
|
282
|
+
end
|
|
283
|
+
when :Object
|
|
284
|
+
# generic object (usually a Hash), return directly
|
|
285
|
+
value
|
|
286
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
287
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
288
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
289
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
290
|
+
k_type = Regexp.last_match[:k_type]
|
|
291
|
+
v_type = Regexp.last_match[:v_type]
|
|
292
|
+
{}.tap do |hash|
|
|
293
|
+
value.each do |k, v|
|
|
294
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
295
|
+
end
|
|
296
|
+
end
|
|
297
|
+
else # model
|
|
298
|
+
# models (e.g. Pet) or oneOf
|
|
299
|
+
klass = UltracartClient.const_get(type)
|
|
300
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
301
|
+
end
|
|
302
|
+
end
|
|
303
|
+
|
|
304
|
+
# Returns the string representation of the object
|
|
305
|
+
# @return [String] String presentation of the object
|
|
306
|
+
def to_s
|
|
307
|
+
to_hash.to_s
|
|
308
|
+
end
|
|
309
|
+
|
|
310
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
311
|
+
# @return [Hash] Returns the object in the form of hash
|
|
312
|
+
def to_body
|
|
313
|
+
to_hash
|
|
314
|
+
end
|
|
315
|
+
|
|
316
|
+
# Returns the object in the form of hash
|
|
317
|
+
# @return [Hash] Returns the object in the form of hash
|
|
318
|
+
def to_hash
|
|
319
|
+
hash = {}
|
|
320
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
321
|
+
value = self.send(attr)
|
|
322
|
+
if value.nil?
|
|
323
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
324
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
325
|
+
end
|
|
326
|
+
|
|
327
|
+
hash[param] = _to_hash(value)
|
|
328
|
+
end
|
|
329
|
+
hash
|
|
330
|
+
end
|
|
331
|
+
|
|
332
|
+
# Outputs non-array value in the form of hash
|
|
333
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
334
|
+
# @param [Object] value Any valid value
|
|
335
|
+
# @return [Hash] Returns the value in the form of hash
|
|
336
|
+
def _to_hash(value)
|
|
337
|
+
if value.is_a?(Array)
|
|
338
|
+
value.compact.map { |v| _to_hash(v) }
|
|
339
|
+
elsif value.is_a?(Hash)
|
|
340
|
+
{}.tap do |hash|
|
|
341
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
342
|
+
end
|
|
343
|
+
elsif value.respond_to? :to_hash
|
|
344
|
+
value.to_hash
|
|
345
|
+
else
|
|
346
|
+
value
|
|
347
|
+
end
|
|
348
|
+
end
|
|
349
|
+
|
|
350
|
+
end
|
|
351
|
+
|
|
352
|
+
end
|
|
@@ -0,0 +1,352 @@
|
|
|
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 SfvbTrackingPrivacyRequest
|
|
18
|
+
# all, eea, non_us, or off.
|
|
19
|
+
attr_accessor :anonymize_ip
|
|
20
|
+
|
|
21
|
+
# all, eea, non_us, or off.
|
|
22
|
+
attr_accessor :default_mailing_list_off
|
|
23
|
+
|
|
24
|
+
# all, eea, non_us, or off.
|
|
25
|
+
attr_accessor :disable_return_email
|
|
26
|
+
|
|
27
|
+
# True to check the change and report it without saving.
|
|
28
|
+
attr_accessor :dry_run
|
|
29
|
+
|
|
30
|
+
# all, eea, non_us, or off.
|
|
31
|
+
attr_accessor :exclude_purchase_bubble_history
|
|
32
|
+
|
|
33
|
+
# all, eea, non_us, or off.
|
|
34
|
+
attr_accessor :show_cookie_notice
|
|
35
|
+
|
|
36
|
+
class EnumAttributeValidator
|
|
37
|
+
attr_reader :datatype
|
|
38
|
+
attr_reader :allowable_values
|
|
39
|
+
|
|
40
|
+
def initialize(datatype, allowable_values)
|
|
41
|
+
@allowable_values = allowable_values.map do |value|
|
|
42
|
+
case datatype.to_s
|
|
43
|
+
when /Integer/i
|
|
44
|
+
value.to_i
|
|
45
|
+
when /Float/i
|
|
46
|
+
value.to_f
|
|
47
|
+
else
|
|
48
|
+
value
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def valid?(value)
|
|
54
|
+
!value || allowable_values.include?(value)
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
59
|
+
def self.attribute_map
|
|
60
|
+
{
|
|
61
|
+
:'anonymize_ip' => :'anonymize_ip',
|
|
62
|
+
:'default_mailing_list_off' => :'default_mailing_list_off',
|
|
63
|
+
:'disable_return_email' => :'disable_return_email',
|
|
64
|
+
:'dry_run' => :'dry_run',
|
|
65
|
+
:'exclude_purchase_bubble_history' => :'exclude_purchase_bubble_history',
|
|
66
|
+
:'show_cookie_notice' => :'show_cookie_notice'
|
|
67
|
+
}
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Returns all the JSON keys this model knows about
|
|
71
|
+
def self.acceptable_attributes
|
|
72
|
+
attribute_map.values
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# Attribute type mapping.
|
|
76
|
+
def self.openapi_types
|
|
77
|
+
{
|
|
78
|
+
:'anonymize_ip' => :'String',
|
|
79
|
+
:'default_mailing_list_off' => :'String',
|
|
80
|
+
:'disable_return_email' => :'String',
|
|
81
|
+
:'dry_run' => :'Boolean',
|
|
82
|
+
:'exclude_purchase_bubble_history' => :'String',
|
|
83
|
+
:'show_cookie_notice' => :'String'
|
|
84
|
+
}
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# List of attributes with nullable: true
|
|
88
|
+
def self.openapi_nullable
|
|
89
|
+
Set.new([
|
|
90
|
+
])
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Initializes the object
|
|
94
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
95
|
+
def initialize(attributes = {})
|
|
96
|
+
if (!attributes.is_a?(Hash))
|
|
97
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbTrackingPrivacyRequest` initialize method"
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
101
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
102
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
103
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbTrackingPrivacyRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
104
|
+
end
|
|
105
|
+
h[k.to_sym] = v
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if attributes.key?(:'anonymize_ip')
|
|
109
|
+
self.anonymize_ip = attributes[:'anonymize_ip']
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
if attributes.key?(:'default_mailing_list_off')
|
|
113
|
+
self.default_mailing_list_off = attributes[:'default_mailing_list_off']
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
if attributes.key?(:'disable_return_email')
|
|
117
|
+
self.disable_return_email = attributes[:'disable_return_email']
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
if attributes.key?(:'dry_run')
|
|
121
|
+
self.dry_run = attributes[:'dry_run']
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
if attributes.key?(:'exclude_purchase_bubble_history')
|
|
125
|
+
self.exclude_purchase_bubble_history = attributes[:'exclude_purchase_bubble_history']
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
if attributes.key?(:'show_cookie_notice')
|
|
129
|
+
self.show_cookie_notice = attributes[:'show_cookie_notice']
|
|
130
|
+
end
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
134
|
+
# @return Array for valid properties with the reasons
|
|
135
|
+
def list_invalid_properties
|
|
136
|
+
invalid_properties = Array.new
|
|
137
|
+
invalid_properties
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
# Check to see if the all the properties in the model are valid
|
|
141
|
+
# @return true if the model is valid
|
|
142
|
+
def valid?
|
|
143
|
+
anonymize_ip_validator = EnumAttributeValidator.new('String', ["all", "eea", "non_us", "off"])
|
|
144
|
+
return false unless anonymize_ip_validator.valid?(@anonymize_ip)
|
|
145
|
+
default_mailing_list_off_validator = EnumAttributeValidator.new('String', ["all", "eea", "non_us", "off"])
|
|
146
|
+
return false unless default_mailing_list_off_validator.valid?(@default_mailing_list_off)
|
|
147
|
+
disable_return_email_validator = EnumAttributeValidator.new('String', ["all", "eea", "non_us", "off"])
|
|
148
|
+
return false unless disable_return_email_validator.valid?(@disable_return_email)
|
|
149
|
+
exclude_purchase_bubble_history_validator = EnumAttributeValidator.new('String', ["all", "eea", "non_us", "off"])
|
|
150
|
+
return false unless exclude_purchase_bubble_history_validator.valid?(@exclude_purchase_bubble_history)
|
|
151
|
+
show_cookie_notice_validator = EnumAttributeValidator.new('String', ["all", "eea", "non_us", "off"])
|
|
152
|
+
return false unless show_cookie_notice_validator.valid?(@show_cookie_notice)
|
|
153
|
+
true
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
157
|
+
# @param [Object] anonymize_ip Object to be assigned
|
|
158
|
+
def anonymize_ip=(anonymize_ip)
|
|
159
|
+
validator = EnumAttributeValidator.new('String', ["all", "eea", "non_us", "off"])
|
|
160
|
+
unless validator.valid?(anonymize_ip)
|
|
161
|
+
fail ArgumentError, "invalid value for \"anonymize_ip\", must be one of #{validator.allowable_values}."
|
|
162
|
+
end
|
|
163
|
+
@anonymize_ip = anonymize_ip
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
167
|
+
# @param [Object] default_mailing_list_off Object to be assigned
|
|
168
|
+
def default_mailing_list_off=(default_mailing_list_off)
|
|
169
|
+
validator = EnumAttributeValidator.new('String', ["all", "eea", "non_us", "off"])
|
|
170
|
+
unless validator.valid?(default_mailing_list_off)
|
|
171
|
+
fail ArgumentError, "invalid value for \"default_mailing_list_off\", must be one of #{validator.allowable_values}."
|
|
172
|
+
end
|
|
173
|
+
@default_mailing_list_off = default_mailing_list_off
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
177
|
+
# @param [Object] disable_return_email Object to be assigned
|
|
178
|
+
def disable_return_email=(disable_return_email)
|
|
179
|
+
validator = EnumAttributeValidator.new('String', ["all", "eea", "non_us", "off"])
|
|
180
|
+
unless validator.valid?(disable_return_email)
|
|
181
|
+
fail ArgumentError, "invalid value for \"disable_return_email\", must be one of #{validator.allowable_values}."
|
|
182
|
+
end
|
|
183
|
+
@disable_return_email = disable_return_email
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
187
|
+
# @param [Object] exclude_purchase_bubble_history Object to be assigned
|
|
188
|
+
def exclude_purchase_bubble_history=(exclude_purchase_bubble_history)
|
|
189
|
+
validator = EnumAttributeValidator.new('String', ["all", "eea", "non_us", "off"])
|
|
190
|
+
unless validator.valid?(exclude_purchase_bubble_history)
|
|
191
|
+
fail ArgumentError, "invalid value for \"exclude_purchase_bubble_history\", must be one of #{validator.allowable_values}."
|
|
192
|
+
end
|
|
193
|
+
@exclude_purchase_bubble_history = exclude_purchase_bubble_history
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
197
|
+
# @param [Object] show_cookie_notice Object to be assigned
|
|
198
|
+
def show_cookie_notice=(show_cookie_notice)
|
|
199
|
+
validator = EnumAttributeValidator.new('String', ["all", "eea", "non_us", "off"])
|
|
200
|
+
unless validator.valid?(show_cookie_notice)
|
|
201
|
+
fail ArgumentError, "invalid value for \"show_cookie_notice\", must be one of #{validator.allowable_values}."
|
|
202
|
+
end
|
|
203
|
+
@show_cookie_notice = show_cookie_notice
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
# Checks equality by comparing each attribute.
|
|
207
|
+
# @param [Object] Object to be compared
|
|
208
|
+
def ==(o)
|
|
209
|
+
return true if self.equal?(o)
|
|
210
|
+
self.class == o.class &&
|
|
211
|
+
anonymize_ip == o.anonymize_ip &&
|
|
212
|
+
default_mailing_list_off == o.default_mailing_list_off &&
|
|
213
|
+
disable_return_email == o.disable_return_email &&
|
|
214
|
+
dry_run == o.dry_run &&
|
|
215
|
+
exclude_purchase_bubble_history == o.exclude_purchase_bubble_history &&
|
|
216
|
+
show_cookie_notice == o.show_cookie_notice
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
# @see the `==` method
|
|
220
|
+
# @param [Object] Object to be compared
|
|
221
|
+
def eql?(o)
|
|
222
|
+
self == o
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
# Calculates hash code according to all attributes.
|
|
226
|
+
# @return [Integer] Hash code
|
|
227
|
+
def hash
|
|
228
|
+
[anonymize_ip, default_mailing_list_off, disable_return_email, dry_run, exclude_purchase_bubble_history, show_cookie_notice].hash
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
# Builds the object from hash
|
|
232
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
233
|
+
# @return [Object] Returns the model itself
|
|
234
|
+
def self.build_from_hash(attributes)
|
|
235
|
+
new.build_from_hash(attributes)
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
# Builds the object from hash
|
|
239
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
240
|
+
# @return [Object] Returns the model itself
|
|
241
|
+
def build_from_hash(attributes)
|
|
242
|
+
return nil unless attributes.is_a?(Hash)
|
|
243
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
244
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
245
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
246
|
+
self.send("#{key}=", nil)
|
|
247
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
248
|
+
# check to ensure the input is an array given that the attribute
|
|
249
|
+
# is documented as an array but the input is not
|
|
250
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
251
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
252
|
+
end
|
|
253
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
254
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
255
|
+
end
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
self
|
|
259
|
+
end
|
|
260
|
+
|
|
261
|
+
# Deserializes the data based on type
|
|
262
|
+
# @param string type Data type
|
|
263
|
+
# @param string value Value to be deserialized
|
|
264
|
+
# @return [Object] Deserialized data
|
|
265
|
+
def _deserialize(type, value)
|
|
266
|
+
case type.to_sym
|
|
267
|
+
when :Time
|
|
268
|
+
Time.parse(value)
|
|
269
|
+
when :Date
|
|
270
|
+
Date.parse(value)
|
|
271
|
+
when :String
|
|
272
|
+
value.to_s
|
|
273
|
+
when :Integer
|
|
274
|
+
value.to_i
|
|
275
|
+
when :Float
|
|
276
|
+
value.to_f
|
|
277
|
+
when :Boolean
|
|
278
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
279
|
+
true
|
|
280
|
+
else
|
|
281
|
+
false
|
|
282
|
+
end
|
|
283
|
+
when :Object
|
|
284
|
+
# generic object (usually a Hash), return directly
|
|
285
|
+
value
|
|
286
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
287
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
288
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
289
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
290
|
+
k_type = Regexp.last_match[:k_type]
|
|
291
|
+
v_type = Regexp.last_match[:v_type]
|
|
292
|
+
{}.tap do |hash|
|
|
293
|
+
value.each do |k, v|
|
|
294
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
295
|
+
end
|
|
296
|
+
end
|
|
297
|
+
else # model
|
|
298
|
+
# models (e.g. Pet) or oneOf
|
|
299
|
+
klass = UltracartClient.const_get(type)
|
|
300
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
301
|
+
end
|
|
302
|
+
end
|
|
303
|
+
|
|
304
|
+
# Returns the string representation of the object
|
|
305
|
+
# @return [String] String presentation of the object
|
|
306
|
+
def to_s
|
|
307
|
+
to_hash.to_s
|
|
308
|
+
end
|
|
309
|
+
|
|
310
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
311
|
+
# @return [Hash] Returns the object in the form of hash
|
|
312
|
+
def to_body
|
|
313
|
+
to_hash
|
|
314
|
+
end
|
|
315
|
+
|
|
316
|
+
# Returns the object in the form of hash
|
|
317
|
+
# @return [Hash] Returns the object in the form of hash
|
|
318
|
+
def to_hash
|
|
319
|
+
hash = {}
|
|
320
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
321
|
+
value = self.send(attr)
|
|
322
|
+
if value.nil?
|
|
323
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
324
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
325
|
+
end
|
|
326
|
+
|
|
327
|
+
hash[param] = _to_hash(value)
|
|
328
|
+
end
|
|
329
|
+
hash
|
|
330
|
+
end
|
|
331
|
+
|
|
332
|
+
# Outputs non-array value in the form of hash
|
|
333
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
334
|
+
# @param [Object] value Any valid value
|
|
335
|
+
# @return [Hash] Returns the value in the form of hash
|
|
336
|
+
def _to_hash(value)
|
|
337
|
+
if value.is_a?(Array)
|
|
338
|
+
value.compact.map { |v| _to_hash(v) }
|
|
339
|
+
elsif value.is_a?(Hash)
|
|
340
|
+
{}.tap do |hash|
|
|
341
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
342
|
+
end
|
|
343
|
+
elsif value.respond_to? :to_hash
|
|
344
|
+
value.to_hash
|
|
345
|
+
else
|
|
346
|
+
value
|
|
347
|
+
end
|
|
348
|
+
end
|
|
349
|
+
|
|
350
|
+
end
|
|
351
|
+
|
|
352
|
+
end
|