ultracart_api 4.1.170 → 4.1.172

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 (33) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +30 -2
  3. data/docs/SfvbApi.md +890 -37
  4. data/docs/SfvbPageResponse.md +2 -0
  5. data/docs/SfvbUpsellItemLogic.md +24 -0
  6. data/docs/SfvbUpsellItemLogicItem.md +22 -0
  7. data/docs/SfvbUpsellOffer.md +118 -8
  8. data/docs/SfvbUpsellPath.md +48 -0
  9. data/docs/SfvbUpsellPathDuplicateRequest.md +18 -0
  10. data/docs/SfvbUpsellPathMoveRequest.md +18 -0
  11. data/docs/SfvbUpsellPathsResponse.md +28 -0
  12. data/docs/SfvbUpsellStats.md +54 -0
  13. data/docs/SfvbUpsellStep.md +22 -0
  14. data/docs/SfvbUpsellStepOffer.md +32 -0
  15. data/docs/SfvbUpsellTowerData.md +20 -0
  16. data/docs/SfvbUpsellVariation.md +22 -0
  17. data/lib/ultracart_api/api/sfvb_api.rb +1256 -78
  18. data/lib/ultracart_api/models/sfvb_page_response.rb +11 -1
  19. data/lib/ultracart_api/models/sfvb_upsell_item_logic.rb +252 -0
  20. data/lib/ultracart_api/models/sfvb_upsell_item_logic_item.rb +240 -0
  21. data/lib/ultracart_api/models/sfvb_upsell_offer.rb +598 -9
  22. data/lib/ultracart_api/models/sfvb_upsell_path.rb +373 -0
  23. data/lib/ultracart_api/models/sfvb_upsell_path_duplicate_request.rb +220 -0
  24. data/lib/ultracart_api/models/sfvb_upsell_path_move_request.rb +220 -0
  25. data/lib/ultracart_api/models/sfvb_upsell_paths_response.rb +272 -0
  26. data/lib/ultracart_api/models/sfvb_upsell_stats.rb +400 -0
  27. data/lib/ultracart_api/models/sfvb_upsell_step.rb +241 -0
  28. data/lib/ultracart_api/models/sfvb_upsell_step_offer.rb +288 -0
  29. data/lib/ultracart_api/models/sfvb_upsell_tower_data.rb +234 -0
  30. data/lib/ultracart_api/models/sfvb_upsell_variation.rb +241 -0
  31. data/lib/ultracart_api/version.rb +1 -1
  32. data/lib/ultracart_api.rb +11 -0
  33. metadata +24 -2
@@ -0,0 +1,288 @@
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 SfvbUpsellStepOffer
18
+ # Read only. Whether the downsell offer is switched on.
19
+ attr_accessor :downsell_offer_active
20
+
21
+ # Read only. The downsell offer's name.
22
+ attr_accessor :downsell_offer_name
23
+
24
+ # The offer shown when the shopper declines offer_oid. Omitted or null for no downsell. Must be an offer of this storefront.
25
+ attr_accessor :downsell_offer_oid
26
+
27
+ attr_accessor :downsell_offer_stats
28
+
29
+ # Read only. Whether the offer is switched on.
30
+ attr_accessor :offer_active
31
+
32
+ # Read only. The offer's name.
33
+ attr_accessor :offer_name
34
+
35
+ # The offer shown at this step. Must be an offer of this storefront.
36
+ attr_accessor :offer_oid
37
+
38
+ attr_accessor :offer_stats
39
+
40
+ # Attribute mapping from ruby-style variable name to JSON key.
41
+ def self.attribute_map
42
+ {
43
+ :'downsell_offer_active' => :'downsell_offer_active',
44
+ :'downsell_offer_name' => :'downsell_offer_name',
45
+ :'downsell_offer_oid' => :'downsell_offer_oid',
46
+ :'downsell_offer_stats' => :'downsell_offer_stats',
47
+ :'offer_active' => :'offer_active',
48
+ :'offer_name' => :'offer_name',
49
+ :'offer_oid' => :'offer_oid',
50
+ :'offer_stats' => :'offer_stats'
51
+ }
52
+ end
53
+
54
+ # Returns all the JSON keys this model knows about
55
+ def self.acceptable_attributes
56
+ attribute_map.values
57
+ end
58
+
59
+ # Attribute type mapping.
60
+ def self.openapi_types
61
+ {
62
+ :'downsell_offer_active' => :'Boolean',
63
+ :'downsell_offer_name' => :'String',
64
+ :'downsell_offer_oid' => :'Integer',
65
+ :'downsell_offer_stats' => :'SfvbUpsellStats',
66
+ :'offer_active' => :'Boolean',
67
+ :'offer_name' => :'String',
68
+ :'offer_oid' => :'Integer',
69
+ :'offer_stats' => :'SfvbUpsellStats'
70
+ }
71
+ end
72
+
73
+ # List of attributes with nullable: true
74
+ def self.openapi_nullable
75
+ Set.new([
76
+ ])
77
+ end
78
+
79
+ # Initializes the object
80
+ # @param [Hash] attributes Model attributes in the form of hash
81
+ def initialize(attributes = {})
82
+ if (!attributes.is_a?(Hash))
83
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbUpsellStepOffer` initialize method"
84
+ end
85
+
86
+ # check to see if the attribute exists and convert string to symbol for hash key
87
+ attributes = attributes.each_with_object({}) { |(k, v), h|
88
+ if (!self.class.attribute_map.key?(k.to_sym))
89
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbUpsellStepOffer`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
90
+ end
91
+ h[k.to_sym] = v
92
+ }
93
+
94
+ if attributes.key?(:'downsell_offer_active')
95
+ self.downsell_offer_active = attributes[:'downsell_offer_active']
96
+ end
97
+
98
+ if attributes.key?(:'downsell_offer_name')
99
+ self.downsell_offer_name = attributes[:'downsell_offer_name']
100
+ end
101
+
102
+ if attributes.key?(:'downsell_offer_oid')
103
+ self.downsell_offer_oid = attributes[:'downsell_offer_oid']
104
+ end
105
+
106
+ if attributes.key?(:'downsell_offer_stats')
107
+ self.downsell_offer_stats = attributes[:'downsell_offer_stats']
108
+ end
109
+
110
+ if attributes.key?(:'offer_active')
111
+ self.offer_active = attributes[:'offer_active']
112
+ end
113
+
114
+ if attributes.key?(:'offer_name')
115
+ self.offer_name = attributes[:'offer_name']
116
+ end
117
+
118
+ if attributes.key?(:'offer_oid')
119
+ self.offer_oid = attributes[:'offer_oid']
120
+ end
121
+
122
+ if attributes.key?(:'offer_stats')
123
+ self.offer_stats = attributes[:'offer_stats']
124
+ end
125
+ end
126
+
127
+ # Show invalid properties with the reasons. Usually used together with valid?
128
+ # @return Array for valid properties with the reasons
129
+ def list_invalid_properties
130
+ invalid_properties = Array.new
131
+ invalid_properties
132
+ end
133
+
134
+ # Check to see if the all the properties in the model are valid
135
+ # @return true if the model is valid
136
+ def valid?
137
+ true
138
+ end
139
+
140
+ # Checks equality by comparing each attribute.
141
+ # @param [Object] Object to be compared
142
+ def ==(o)
143
+ return true if self.equal?(o)
144
+ self.class == o.class &&
145
+ downsell_offer_active == o.downsell_offer_active &&
146
+ downsell_offer_name == o.downsell_offer_name &&
147
+ downsell_offer_oid == o.downsell_offer_oid &&
148
+ downsell_offer_stats == o.downsell_offer_stats &&
149
+ offer_active == o.offer_active &&
150
+ offer_name == o.offer_name &&
151
+ offer_oid == o.offer_oid &&
152
+ offer_stats == o.offer_stats
153
+ end
154
+
155
+ # @see the `==` method
156
+ # @param [Object] Object to be compared
157
+ def eql?(o)
158
+ self == o
159
+ end
160
+
161
+ # Calculates hash code according to all attributes.
162
+ # @return [Integer] Hash code
163
+ def hash
164
+ [downsell_offer_active, downsell_offer_name, downsell_offer_oid, downsell_offer_stats, offer_active, offer_name, offer_oid, offer_stats].hash
165
+ end
166
+
167
+ # Builds the object from hash
168
+ # @param [Hash] attributes Model attributes in the form of hash
169
+ # @return [Object] Returns the model itself
170
+ def self.build_from_hash(attributes)
171
+ new.build_from_hash(attributes)
172
+ end
173
+
174
+ # Builds the object from hash
175
+ # @param [Hash] attributes Model attributes in the form of hash
176
+ # @return [Object] Returns the model itself
177
+ def build_from_hash(attributes)
178
+ return nil unless attributes.is_a?(Hash)
179
+ attributes = attributes.transform_keys(&:to_sym)
180
+ self.class.openapi_types.each_pair do |key, type|
181
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
182
+ self.send("#{key}=", nil)
183
+ elsif type =~ /\AArray<(.*)>/i
184
+ # check to ensure the input is an array given that the attribute
185
+ # is documented as an array but the input is not
186
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
187
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
188
+ end
189
+ elsif !attributes[self.class.attribute_map[key]].nil?
190
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
191
+ end
192
+ end
193
+
194
+ self
195
+ end
196
+
197
+ # Deserializes the data based on type
198
+ # @param string type Data type
199
+ # @param string value Value to be deserialized
200
+ # @return [Object] Deserialized data
201
+ def _deserialize(type, value)
202
+ case type.to_sym
203
+ when :Time
204
+ Time.parse(value)
205
+ when :Date
206
+ Date.parse(value)
207
+ when :String
208
+ value.to_s
209
+ when :Integer
210
+ value.to_i
211
+ when :Float
212
+ value.to_f
213
+ when :Boolean
214
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
215
+ true
216
+ else
217
+ false
218
+ end
219
+ when :Object
220
+ # generic object (usually a Hash), return directly
221
+ value
222
+ when /\AArray<(?<inner_type>.+)>\z/
223
+ inner_type = Regexp.last_match[:inner_type]
224
+ value.map { |v| _deserialize(inner_type, v) }
225
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
226
+ k_type = Regexp.last_match[:k_type]
227
+ v_type = Regexp.last_match[:v_type]
228
+ {}.tap do |hash|
229
+ value.each do |k, v|
230
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
231
+ end
232
+ end
233
+ else # model
234
+ # models (e.g. Pet) or oneOf
235
+ klass = UltracartClient.const_get(type)
236
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
237
+ end
238
+ end
239
+
240
+ # Returns the string representation of the object
241
+ # @return [String] String presentation of the object
242
+ def to_s
243
+ to_hash.to_s
244
+ end
245
+
246
+ # to_body is an alias to to_hash (backward compatibility)
247
+ # @return [Hash] Returns the object in the form of hash
248
+ def to_body
249
+ to_hash
250
+ end
251
+
252
+ # Returns the object in the form of hash
253
+ # @return [Hash] Returns the object in the form of hash
254
+ def to_hash
255
+ hash = {}
256
+ self.class.attribute_map.each_pair do |attr, param|
257
+ value = self.send(attr)
258
+ if value.nil?
259
+ is_nullable = self.class.openapi_nullable.include?(attr)
260
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
261
+ end
262
+
263
+ hash[param] = _to_hash(value)
264
+ end
265
+ hash
266
+ end
267
+
268
+ # Outputs non-array value in the form of hash
269
+ # For object, use to_hash. Otherwise, just return the value
270
+ # @param [Object] value Any valid value
271
+ # @return [Hash] Returns the value in the form of hash
272
+ def _to_hash(value)
273
+ if value.is_a?(Array)
274
+ value.compact.map { |v| _to_hash(v) }
275
+ elsif value.is_a?(Hash)
276
+ {}.tap do |hash|
277
+ value.each { |k, v| hash[k] = _to_hash(v) }
278
+ end
279
+ elsif value.respond_to? :to_hash
280
+ value.to_hash
281
+ else
282
+ value
283
+ end
284
+ end
285
+
286
+ end
287
+
288
+ end
@@ -0,0 +1,234 @@
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 SfvbUpsellTowerData
18
+ # Age bands the path is shown to. 18-20, 21-24, 25-34, 35-44, 45-54, 55-64, 65+ or Unknown.
19
+ attr_accessor :ages
20
+
21
+ # Genders the path is shown to. Male, Female or Unknown.
22
+ attr_accessor :genders
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'ages' => :'ages',
28
+ :'genders' => :'genders'
29
+ }
30
+ end
31
+
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ attribute_map.values
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'ages' => :'Array<String>',
41
+ :'genders' => :'Array<String>'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbUpsellTowerData` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!self.class.attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbUpsellTowerData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'ages')
67
+ if (value = attributes[:'ages']).is_a?(Array)
68
+ self.ages = value
69
+ end
70
+ end
71
+
72
+ if attributes.key?(:'genders')
73
+ if (value = attributes[:'genders']).is_a?(Array)
74
+ self.genders = value
75
+ end
76
+ end
77
+ end
78
+
79
+ # Show invalid properties with the reasons. Usually used together with valid?
80
+ # @return Array for valid properties with the reasons
81
+ def list_invalid_properties
82
+ invalid_properties = Array.new
83
+ invalid_properties
84
+ end
85
+
86
+ # Check to see if the all the properties in the model are valid
87
+ # @return true if the model is valid
88
+ def valid?
89
+ true
90
+ end
91
+
92
+ # Checks equality by comparing each attribute.
93
+ # @param [Object] Object to be compared
94
+ def ==(o)
95
+ return true if self.equal?(o)
96
+ self.class == o.class &&
97
+ ages == o.ages &&
98
+ genders == o.genders
99
+ end
100
+
101
+ # @see the `==` method
102
+ # @param [Object] Object to be compared
103
+ def eql?(o)
104
+ self == o
105
+ end
106
+
107
+ # Calculates hash code according to all attributes.
108
+ # @return [Integer] Hash code
109
+ def hash
110
+ [ages, genders].hash
111
+ end
112
+
113
+ # Builds the object from hash
114
+ # @param [Hash] attributes Model attributes in the form of hash
115
+ # @return [Object] Returns the model itself
116
+ def self.build_from_hash(attributes)
117
+ new.build_from_hash(attributes)
118
+ end
119
+
120
+ # Builds the object from hash
121
+ # @param [Hash] attributes Model attributes in the form of hash
122
+ # @return [Object] Returns the model itself
123
+ def build_from_hash(attributes)
124
+ return nil unless attributes.is_a?(Hash)
125
+ attributes = attributes.transform_keys(&:to_sym)
126
+ self.class.openapi_types.each_pair do |key, type|
127
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
128
+ self.send("#{key}=", nil)
129
+ elsif type =~ /\AArray<(.*)>/i
130
+ # check to ensure the input is an array given that the attribute
131
+ # is documented as an array but the input is not
132
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
133
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
134
+ end
135
+ elsif !attributes[self.class.attribute_map[key]].nil?
136
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
137
+ end
138
+ end
139
+
140
+ self
141
+ end
142
+
143
+ # Deserializes the data based on type
144
+ # @param string type Data type
145
+ # @param string value Value to be deserialized
146
+ # @return [Object] Deserialized data
147
+ def _deserialize(type, value)
148
+ case type.to_sym
149
+ when :Time
150
+ Time.parse(value)
151
+ when :Date
152
+ Date.parse(value)
153
+ when :String
154
+ value.to_s
155
+ when :Integer
156
+ value.to_i
157
+ when :Float
158
+ value.to_f
159
+ when :Boolean
160
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
161
+ true
162
+ else
163
+ false
164
+ end
165
+ when :Object
166
+ # generic object (usually a Hash), return directly
167
+ value
168
+ when /\AArray<(?<inner_type>.+)>\z/
169
+ inner_type = Regexp.last_match[:inner_type]
170
+ value.map { |v| _deserialize(inner_type, v) }
171
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
172
+ k_type = Regexp.last_match[:k_type]
173
+ v_type = Regexp.last_match[:v_type]
174
+ {}.tap do |hash|
175
+ value.each do |k, v|
176
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
177
+ end
178
+ end
179
+ else # model
180
+ # models (e.g. Pet) or oneOf
181
+ klass = UltracartClient.const_get(type)
182
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
183
+ end
184
+ end
185
+
186
+ # Returns the string representation of the object
187
+ # @return [String] String presentation of the object
188
+ def to_s
189
+ to_hash.to_s
190
+ end
191
+
192
+ # to_body is an alias to to_hash (backward compatibility)
193
+ # @return [Hash] Returns the object in the form of hash
194
+ def to_body
195
+ to_hash
196
+ end
197
+
198
+ # Returns the object in the form of hash
199
+ # @return [Hash] Returns the object in the form of hash
200
+ def to_hash
201
+ hash = {}
202
+ self.class.attribute_map.each_pair do |attr, param|
203
+ value = self.send(attr)
204
+ if value.nil?
205
+ is_nullable = self.class.openapi_nullable.include?(attr)
206
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
207
+ end
208
+
209
+ hash[param] = _to_hash(value)
210
+ end
211
+ hash
212
+ end
213
+
214
+ # Outputs non-array value in the form of hash
215
+ # For object, use to_hash. Otherwise, just return the value
216
+ # @param [Object] value Any valid value
217
+ # @return [Hash] Returns the value in the form of hash
218
+ def _to_hash(value)
219
+ if value.is_a?(Array)
220
+ value.compact.map { |v| _to_hash(v) }
221
+ elsif value.is_a?(Hash)
222
+ {}.tap do |hash|
223
+ value.each { |k, v| hash[k] = _to_hash(v) }
224
+ end
225
+ elsif value.respond_to? :to_hash
226
+ value.to_hash
227
+ else
228
+ value
229
+ end
230
+ end
231
+
232
+ end
233
+
234
+ end