ultracart_api 4.1.170 → 4.1.171

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 +29 -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
@@ -18,6 +18,9 @@ module UltracartClient
18
18
  # Every attribute this page has, including ones a template declares but nothing has set yet. These are what the pageattribute element renders. Sorted by name.
19
19
  attr_accessor :attributes
20
20
 
21
+ # The page description, the text a page template renders as the page's description. Omitted when empty.
22
+ attr_accessor :description
23
+
21
24
  # True when the page is left out of the sitemap and marked noindex.
22
25
  attr_accessor :exclude_from_sitemap
23
26
 
@@ -46,6 +49,7 @@ module UltracartClient
46
49
  def self.attribute_map
47
50
  {
48
51
  :'attributes' => :'attributes',
52
+ :'description' => :'description',
49
53
  :'exclude_from_sitemap' => :'exclude_from_sitemap',
50
54
  :'group_template' => :'group_template',
51
55
  :'item_template' => :'item_template',
@@ -66,6 +70,7 @@ module UltracartClient
66
70
  def self.openapi_types
67
71
  {
68
72
  :'attributes' => :'Array<SfvbPageAttribute>',
73
+ :'description' => :'String',
69
74
  :'exclude_from_sitemap' => :'Boolean',
70
75
  :'group_template' => :'String',
71
76
  :'item_template' => :'String',
@@ -104,6 +109,10 @@ module UltracartClient
104
109
  end
105
110
  end
106
111
 
112
+ if attributes.key?(:'description')
113
+ self.description = attributes[:'description']
114
+ end
115
+
107
116
  if attributes.key?(:'exclude_from_sitemap')
108
117
  self.exclude_from_sitemap = attributes[:'exclude_from_sitemap']
109
118
  end
@@ -158,6 +167,7 @@ module UltracartClient
158
167
  return true if self.equal?(o)
159
168
  self.class == o.class &&
160
169
  attributes == o.attributes &&
170
+ description == o.description &&
161
171
  exclude_from_sitemap == o.exclude_from_sitemap &&
162
172
  group_template == o.group_template &&
163
173
  item_template == o.item_template &&
@@ -177,7 +187,7 @@ module UltracartClient
177
187
  # Calculates hash code according to all attributes.
178
188
  # @return [Integer] Hash code
179
189
  def hash
180
- [attributes, exclude_from_sitemap, group_template, item_template, multimedia, path, title, visible, visible_dts].hash
190
+ [attributes, description, exclude_from_sitemap, group_template, item_template, multimedia, path, title, visible, visible_dts].hash
181
191
  end
182
192
 
183
193
  # Builds the object from hash
@@ -0,0 +1,252 @@
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 SfvbUpsellItemLogic
18
+ # The items this logic looks at. Every item id must exist on the merchant account.
19
+ attr_accessor :items
20
+
21
+ # How items is read. contains_any, contains_all, all, any or total. Omitted or null means no item logic.
22
+ attr_accessor :logic
23
+
24
+ # For total only. The quantity the summed quantity is compared with.
25
+ attr_accessor :total_quantity_comparison
26
+
27
+ # For total only. The comparison applied to the summed quantity. One of <, <=, =, >=, >.
28
+ attr_accessor :total_quantity_operator
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'items' => :'items',
34
+ :'logic' => :'logic',
35
+ :'total_quantity_comparison' => :'total_quantity_comparison',
36
+ :'total_quantity_operator' => :'total_quantity_operator'
37
+ }
38
+ end
39
+
40
+ # Returns all the JSON keys this model knows about
41
+ def self.acceptable_attributes
42
+ attribute_map.values
43
+ end
44
+
45
+ # Attribute type mapping.
46
+ def self.openapi_types
47
+ {
48
+ :'items' => :'Array<SfvbUpsellItemLogicItem>',
49
+ :'logic' => :'String',
50
+ :'total_quantity_comparison' => :'Integer',
51
+ :'total_quantity_operator' => :'String'
52
+ }
53
+ end
54
+
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ ])
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ if (!attributes.is_a?(Hash))
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbUpsellItemLogic` initialize method"
66
+ end
67
+
68
+ # check to see if the attribute exists and convert string to symbol for hash key
69
+ attributes = attributes.each_with_object({}) { |(k, v), h|
70
+ if (!self.class.attribute_map.key?(k.to_sym))
71
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbUpsellItemLogic`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
72
+ end
73
+ h[k.to_sym] = v
74
+ }
75
+
76
+ if attributes.key?(:'items')
77
+ if (value = attributes[:'items']).is_a?(Array)
78
+ self.items = value
79
+ end
80
+ end
81
+
82
+ if attributes.key?(:'logic')
83
+ self.logic = attributes[:'logic']
84
+ end
85
+
86
+ if attributes.key?(:'total_quantity_comparison')
87
+ self.total_quantity_comparison = attributes[:'total_quantity_comparison']
88
+ end
89
+
90
+ if attributes.key?(:'total_quantity_operator')
91
+ self.total_quantity_operator = attributes[:'total_quantity_operator']
92
+ end
93
+ end
94
+
95
+ # Show invalid properties with the reasons. Usually used together with valid?
96
+ # @return Array for valid properties with the reasons
97
+ def list_invalid_properties
98
+ invalid_properties = Array.new
99
+ invalid_properties
100
+ end
101
+
102
+ # Check to see if the all the properties in the model are valid
103
+ # @return true if the model is valid
104
+ def valid?
105
+ true
106
+ end
107
+
108
+ # Checks equality by comparing each attribute.
109
+ # @param [Object] Object to be compared
110
+ def ==(o)
111
+ return true if self.equal?(o)
112
+ self.class == o.class &&
113
+ items == o.items &&
114
+ logic == o.logic &&
115
+ total_quantity_comparison == o.total_quantity_comparison &&
116
+ total_quantity_operator == o.total_quantity_operator
117
+ end
118
+
119
+ # @see the `==` method
120
+ # @param [Object] Object to be compared
121
+ def eql?(o)
122
+ self == o
123
+ end
124
+
125
+ # Calculates hash code according to all attributes.
126
+ # @return [Integer] Hash code
127
+ def hash
128
+ [items, logic, total_quantity_comparison, total_quantity_operator].hash
129
+ end
130
+
131
+ # Builds the object from hash
132
+ # @param [Hash] attributes Model attributes in the form of hash
133
+ # @return [Object] Returns the model itself
134
+ def self.build_from_hash(attributes)
135
+ new.build_from_hash(attributes)
136
+ end
137
+
138
+ # Builds the object from hash
139
+ # @param [Hash] attributes Model attributes in the form of hash
140
+ # @return [Object] Returns the model itself
141
+ def build_from_hash(attributes)
142
+ return nil unless attributes.is_a?(Hash)
143
+ attributes = attributes.transform_keys(&:to_sym)
144
+ self.class.openapi_types.each_pair do |key, type|
145
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
146
+ self.send("#{key}=", nil)
147
+ elsif type =~ /\AArray<(.*)>/i
148
+ # check to ensure the input is an array given that the attribute
149
+ # is documented as an array but the input is not
150
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
151
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
152
+ end
153
+ elsif !attributes[self.class.attribute_map[key]].nil?
154
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
155
+ end
156
+ end
157
+
158
+ self
159
+ end
160
+
161
+ # Deserializes the data based on type
162
+ # @param string type Data type
163
+ # @param string value Value to be deserialized
164
+ # @return [Object] Deserialized data
165
+ def _deserialize(type, value)
166
+ case type.to_sym
167
+ when :Time
168
+ Time.parse(value)
169
+ when :Date
170
+ Date.parse(value)
171
+ when :String
172
+ value.to_s
173
+ when :Integer
174
+ value.to_i
175
+ when :Float
176
+ value.to_f
177
+ when :Boolean
178
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
179
+ true
180
+ else
181
+ false
182
+ end
183
+ when :Object
184
+ # generic object (usually a Hash), return directly
185
+ value
186
+ when /\AArray<(?<inner_type>.+)>\z/
187
+ inner_type = Regexp.last_match[:inner_type]
188
+ value.map { |v| _deserialize(inner_type, v) }
189
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
190
+ k_type = Regexp.last_match[:k_type]
191
+ v_type = Regexp.last_match[:v_type]
192
+ {}.tap do |hash|
193
+ value.each do |k, v|
194
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
195
+ end
196
+ end
197
+ else # model
198
+ # models (e.g. Pet) or oneOf
199
+ klass = UltracartClient.const_get(type)
200
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
201
+ end
202
+ end
203
+
204
+ # Returns the string representation of the object
205
+ # @return [String] String presentation of the object
206
+ def to_s
207
+ to_hash.to_s
208
+ end
209
+
210
+ # to_body is an alias to to_hash (backward compatibility)
211
+ # @return [Hash] Returns the object in the form of hash
212
+ def to_body
213
+ to_hash
214
+ end
215
+
216
+ # Returns the object in the form of hash
217
+ # @return [Hash] Returns the object in the form of hash
218
+ def to_hash
219
+ hash = {}
220
+ self.class.attribute_map.each_pair do |attr, param|
221
+ value = self.send(attr)
222
+ if value.nil?
223
+ is_nullable = self.class.openapi_nullable.include?(attr)
224
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
225
+ end
226
+
227
+ hash[param] = _to_hash(value)
228
+ end
229
+ hash
230
+ end
231
+
232
+ # Outputs non-array value in the form of hash
233
+ # For object, use to_hash. Otherwise, just return the value
234
+ # @param [Object] value Any valid value
235
+ # @return [Hash] Returns the value in the form of hash
236
+ def _to_hash(value)
237
+ if value.is_a?(Array)
238
+ value.compact.map { |v| _to_hash(v) }
239
+ elsif value.is_a?(Hash)
240
+ {}.tap do |hash|
241
+ value.each { |k, v| hash[k] = _to_hash(v) }
242
+ end
243
+ elsif value.respond_to? :to_hash
244
+ value.to_hash
245
+ else
246
+ value
247
+ end
248
+ end
249
+
250
+ end
251
+
252
+ end
@@ -0,0 +1,240 @@
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 SfvbUpsellItemLogicItem
18
+ # For logic all or any. The quantity this item's quantity is compared with.
19
+ attr_accessor :comparison
20
+
21
+ # Merchant item id. Must exist on the merchant account.
22
+ attr_accessor :item_id
23
+
24
+ # For logic all or any. The comparison applied to this item's quantity. One of <, <=, =, >=, >.
25
+ attr_accessor :operator
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'comparison' => :'comparison',
31
+ :'item_id' => :'item_id',
32
+ :'operator' => :'operator'
33
+ }
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'comparison' => :'Integer',
45
+ :'item_id' => :'String',
46
+ :'operator' => :'String'
47
+ }
48
+ end
49
+
50
+ # List of attributes with nullable: true
51
+ def self.openapi_nullable
52
+ Set.new([
53
+ ])
54
+ end
55
+
56
+ # Initializes the object
57
+ # @param [Hash] attributes Model attributes in the form of hash
58
+ def initialize(attributes = {})
59
+ if (!attributes.is_a?(Hash))
60
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbUpsellItemLogicItem` initialize method"
61
+ end
62
+
63
+ # check to see if the attribute exists and convert string to symbol for hash key
64
+ attributes = attributes.each_with_object({}) { |(k, v), h|
65
+ if (!self.class.attribute_map.key?(k.to_sym))
66
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbUpsellItemLogicItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
67
+ end
68
+ h[k.to_sym] = v
69
+ }
70
+
71
+ if attributes.key?(:'comparison')
72
+ self.comparison = attributes[:'comparison']
73
+ end
74
+
75
+ if attributes.key?(:'item_id')
76
+ self.item_id = attributes[:'item_id']
77
+ end
78
+
79
+ if attributes.key?(:'operator')
80
+ self.operator = attributes[:'operator']
81
+ end
82
+ end
83
+
84
+ # Show invalid properties with the reasons. Usually used together with valid?
85
+ # @return Array for valid properties with the reasons
86
+ def list_invalid_properties
87
+ invalid_properties = Array.new
88
+ invalid_properties
89
+ end
90
+
91
+ # Check to see if the all the properties in the model are valid
92
+ # @return true if the model is valid
93
+ def valid?
94
+ true
95
+ end
96
+
97
+ # Checks equality by comparing each attribute.
98
+ # @param [Object] Object to be compared
99
+ def ==(o)
100
+ return true if self.equal?(o)
101
+ self.class == o.class &&
102
+ comparison == o.comparison &&
103
+ item_id == o.item_id &&
104
+ operator == o.operator
105
+ end
106
+
107
+ # @see the `==` method
108
+ # @param [Object] Object to be compared
109
+ def eql?(o)
110
+ self == o
111
+ end
112
+
113
+ # Calculates hash code according to all attributes.
114
+ # @return [Integer] Hash code
115
+ def hash
116
+ [comparison, item_id, operator].hash
117
+ end
118
+
119
+ # Builds the object from hash
120
+ # @param [Hash] attributes Model attributes in the form of hash
121
+ # @return [Object] Returns the model itself
122
+ def self.build_from_hash(attributes)
123
+ new.build_from_hash(attributes)
124
+ end
125
+
126
+ # Builds the object from hash
127
+ # @param [Hash] attributes Model attributes in the form of hash
128
+ # @return [Object] Returns the model itself
129
+ def build_from_hash(attributes)
130
+ return nil unless attributes.is_a?(Hash)
131
+ attributes = attributes.transform_keys(&:to_sym)
132
+ self.class.openapi_types.each_pair do |key, type|
133
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
134
+ self.send("#{key}=", nil)
135
+ elsif type =~ /\AArray<(.*)>/i
136
+ # check to ensure the input is an array given that the attribute
137
+ # is documented as an array but the input is not
138
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
139
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
140
+ end
141
+ elsif !attributes[self.class.attribute_map[key]].nil?
142
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
143
+ end
144
+ end
145
+
146
+ self
147
+ end
148
+
149
+ # Deserializes the data based on type
150
+ # @param string type Data type
151
+ # @param string value Value to be deserialized
152
+ # @return [Object] Deserialized data
153
+ def _deserialize(type, value)
154
+ case type.to_sym
155
+ when :Time
156
+ Time.parse(value)
157
+ when :Date
158
+ Date.parse(value)
159
+ when :String
160
+ value.to_s
161
+ when :Integer
162
+ value.to_i
163
+ when :Float
164
+ value.to_f
165
+ when :Boolean
166
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
167
+ true
168
+ else
169
+ false
170
+ end
171
+ when :Object
172
+ # generic object (usually a Hash), return directly
173
+ value
174
+ when /\AArray<(?<inner_type>.+)>\z/
175
+ inner_type = Regexp.last_match[:inner_type]
176
+ value.map { |v| _deserialize(inner_type, v) }
177
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
178
+ k_type = Regexp.last_match[:k_type]
179
+ v_type = Regexp.last_match[:v_type]
180
+ {}.tap do |hash|
181
+ value.each do |k, v|
182
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
183
+ end
184
+ end
185
+ else # model
186
+ # models (e.g. Pet) or oneOf
187
+ klass = UltracartClient.const_get(type)
188
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
189
+ end
190
+ end
191
+
192
+ # Returns the string representation of the object
193
+ # @return [String] String presentation of the object
194
+ def to_s
195
+ to_hash.to_s
196
+ end
197
+
198
+ # to_body is an alias to to_hash (backward compatibility)
199
+ # @return [Hash] Returns the object in the form of hash
200
+ def to_body
201
+ to_hash
202
+ end
203
+
204
+ # Returns the object in the form of hash
205
+ # @return [Hash] Returns the object in the form of hash
206
+ def to_hash
207
+ hash = {}
208
+ self.class.attribute_map.each_pair do |attr, param|
209
+ value = self.send(attr)
210
+ if value.nil?
211
+ is_nullable = self.class.openapi_nullable.include?(attr)
212
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
213
+ end
214
+
215
+ hash[param] = _to_hash(value)
216
+ end
217
+ hash
218
+ end
219
+
220
+ # Outputs non-array value in the form of hash
221
+ # For object, use to_hash. Otherwise, just return the value
222
+ # @param [Object] value Any valid value
223
+ # @return [Hash] Returns the value in the form of hash
224
+ def _to_hash(value)
225
+ if value.is_a?(Array)
226
+ value.compact.map { |v| _to_hash(v) }
227
+ elsif value.is_a?(Hash)
228
+ {}.tap do |hash|
229
+ value.each { |k, v| hash[k] = _to_hash(v) }
230
+ end
231
+ elsif value.respond_to? :to_hash
232
+ value.to_hash
233
+ else
234
+ value
235
+ end
236
+ end
237
+
238
+ end
239
+
240
+ end