ultracart_api 4.1.239 → 4.1.241

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 (47) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +28 -2
  3. data/docs/SfvbApi.md +337 -0
  4. data/docs/SfvbApprovalCreateRequest.md +4 -0
  5. data/docs/SfvbItemChildCreateRequest.md +26 -0
  6. data/docs/SfvbItemChildCreateResponse.md +36 -0
  7. data/docs/SfvbItemDefaultPageRequest.md +20 -0
  8. data/docs/SfvbItemDefaultPageResponse.md +36 -0
  9. data/docs/SfvbItemDefaultPageResult.md +40 -0
  10. data/docs/SfvbItemDefaultPageRow.md +28 -0
  11. data/docs/SfvbItemPageAssignment.md +28 -0
  12. data/docs/SfvbItemPages.md +28 -0
  13. data/docs/SfvbItemVariationAxis.md +22 -0
  14. data/docs/SfvbItemVariationChange.md +40 -0
  15. data/docs/SfvbItemVariationChangeResult.md +24 -0
  16. data/docs/SfvbItemVariationChild.md +22 -0
  17. data/docs/SfvbItemVariationCombination.md +24 -0
  18. data/docs/SfvbItemVariationOption.md +22 -0
  19. data/docs/SfvbItemVariationValue.md +20 -0
  20. data/docs/SfvbItemVariations.md +30 -0
  21. data/docs/SfvbItemVariationsRequest.md +20 -0
  22. data/docs/SfvbItemVariationsResponse.md +38 -0
  23. data/docs/SfvbTrackingCheckPlanGate.md +2 -0
  24. data/lib/ultracart_api/api/sfvb_api.rb +459 -0
  25. data/lib/ultracart_api/models/sfvb_approval_create_request.rb +24 -3
  26. data/lib/ultracart_api/models/sfvb_item_child_create_request.rb +260 -0
  27. data/lib/ultracart_api/models/sfvb_item_child_create_response.rb +309 -0
  28. data/lib/ultracart_api/models/sfvb_item_default_page_request.rb +232 -0
  29. data/lib/ultracart_api/models/sfvb_item_default_page_response.rb +312 -0
  30. data/lib/ultracart_api/models/sfvb_item_default_page_result.rb +330 -0
  31. data/lib/ultracart_api/models/sfvb_item_default_page_row.rb +270 -0
  32. data/lib/ultracart_api/models/sfvb_item_page_assignment.rb +270 -0
  33. data/lib/ultracart_api/models/sfvb_item_pages.rb +274 -0
  34. data/lib/ultracart_api/models/sfvb_item_variation_axis.rb +242 -0
  35. data/lib/ultracart_api/models/sfvb_item_variation_change.rb +334 -0
  36. data/lib/ultracart_api/models/sfvb_item_variation_change_result.rb +250 -0
  37. data/lib/ultracart_api/models/sfvb_item_variation_child.rb +240 -0
  38. data/lib/ultracart_api/models/sfvb_item_variation_combination.rb +251 -0
  39. data/lib/ultracart_api/models/sfvb_item_variation_option.rb +240 -0
  40. data/lib/ultracart_api/models/sfvb_item_variation_value.rb +230 -0
  41. data/lib/ultracart_api/models/sfvb_item_variations.rb +284 -0
  42. data/lib/ultracart_api/models/sfvb_item_variations_request.rb +232 -0
  43. data/lib/ultracart_api/models/sfvb_item_variations_response.rb +328 -0
  44. data/lib/ultracart_api/models/sfvb_tracking_check_plan_gate.rb +11 -1
  45. data/lib/ultracart_api/version.rb +1 -1
  46. data/lib/ultracart_api.rb +18 -0
  47. metadata +37 -1
@@ -0,0 +1,270 @@
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 SfvbItemPageAssignment
18
+ # True for the item's default page on this storefront, the one its canonical link uses.
19
+ attr_accessor :default_assignment
20
+
21
+ # The page's oid.
22
+ attr_accessor :page_oid
23
+
24
+ # The page's path.
25
+ attr_accessor :path
26
+
27
+ # The item's place on the page, or null.
28
+ attr_accessor :sort_order
29
+
30
+ # The item's URL part on the page, or null when the item id is used.
31
+ attr_accessor :url_part
32
+
33
+ # False for a hidden page, which shoppers aren't served.
34
+ attr_accessor :visible
35
+
36
+ # Attribute mapping from ruby-style variable name to JSON key.
37
+ def self.attribute_map
38
+ {
39
+ :'default_assignment' => :'default_assignment',
40
+ :'page_oid' => :'page_oid',
41
+ :'path' => :'path',
42
+ :'sort_order' => :'sort_order',
43
+ :'url_part' => :'url_part',
44
+ :'visible' => :'visible'
45
+ }
46
+ end
47
+
48
+ # Returns all the JSON keys this model knows about
49
+ def self.acceptable_attributes
50
+ attribute_map.values
51
+ end
52
+
53
+ # Attribute type mapping.
54
+ def self.openapi_types
55
+ {
56
+ :'default_assignment' => :'Boolean',
57
+ :'page_oid' => :'Integer',
58
+ :'path' => :'String',
59
+ :'sort_order' => :'Integer',
60
+ :'url_part' => :'String',
61
+ :'visible' => :'Boolean'
62
+ }
63
+ end
64
+
65
+ # List of attributes with nullable: true
66
+ def self.openapi_nullable
67
+ Set.new([
68
+ ])
69
+ end
70
+
71
+ # Initializes the object
72
+ # @param [Hash] attributes Model attributes in the form of hash
73
+ def initialize(attributes = {})
74
+ if (!attributes.is_a?(Hash))
75
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbItemPageAssignment` initialize method"
76
+ end
77
+
78
+ # check to see if the attribute exists and convert string to symbol for hash key
79
+ attributes = attributes.each_with_object({}) { |(k, v), h|
80
+ if (!self.class.attribute_map.key?(k.to_sym))
81
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbItemPageAssignment`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
82
+ end
83
+ h[k.to_sym] = v
84
+ }
85
+
86
+ if attributes.key?(:'default_assignment')
87
+ self.default_assignment = attributes[:'default_assignment']
88
+ end
89
+
90
+ if attributes.key?(:'page_oid')
91
+ self.page_oid = attributes[:'page_oid']
92
+ end
93
+
94
+ if attributes.key?(:'path')
95
+ self.path = attributes[:'path']
96
+ end
97
+
98
+ if attributes.key?(:'sort_order')
99
+ self.sort_order = attributes[:'sort_order']
100
+ end
101
+
102
+ if attributes.key?(:'url_part')
103
+ self.url_part = attributes[:'url_part']
104
+ end
105
+
106
+ if attributes.key?(:'visible')
107
+ self.visible = attributes[:'visible']
108
+ end
109
+ end
110
+
111
+ # Show invalid properties with the reasons. Usually used together with valid?
112
+ # @return Array for valid properties with the reasons
113
+ def list_invalid_properties
114
+ invalid_properties = Array.new
115
+ invalid_properties
116
+ end
117
+
118
+ # Check to see if the all the properties in the model are valid
119
+ # @return true if the model is valid
120
+ def valid?
121
+ true
122
+ end
123
+
124
+ # Checks equality by comparing each attribute.
125
+ # @param [Object] Object to be compared
126
+ def ==(o)
127
+ return true if self.equal?(o)
128
+ self.class == o.class &&
129
+ default_assignment == o.default_assignment &&
130
+ page_oid == o.page_oid &&
131
+ path == o.path &&
132
+ sort_order == o.sort_order &&
133
+ url_part == o.url_part &&
134
+ visible == o.visible
135
+ end
136
+
137
+ # @see the `==` method
138
+ # @param [Object] Object to be compared
139
+ def eql?(o)
140
+ self == o
141
+ end
142
+
143
+ # Calculates hash code according to all attributes.
144
+ # @return [Integer] Hash code
145
+ def hash
146
+ [default_assignment, page_oid, path, sort_order, url_part, visible].hash
147
+ end
148
+
149
+ # Builds the object from hash
150
+ # @param [Hash] attributes Model attributes in the form of hash
151
+ # @return [Object] Returns the model itself
152
+ def self.build_from_hash(attributes)
153
+ new.build_from_hash(attributes)
154
+ end
155
+
156
+ # Builds the object from hash
157
+ # @param [Hash] attributes Model attributes in the form of hash
158
+ # @return [Object] Returns the model itself
159
+ def build_from_hash(attributes)
160
+ return nil unless attributes.is_a?(Hash)
161
+ attributes = attributes.transform_keys(&:to_sym)
162
+ self.class.openapi_types.each_pair do |key, type|
163
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
164
+ self.send("#{key}=", nil)
165
+ elsif type =~ /\AArray<(.*)>/i
166
+ # check to ensure the input is an array given that the attribute
167
+ # is documented as an array but the input is not
168
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
169
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
170
+ end
171
+ elsif !attributes[self.class.attribute_map[key]].nil?
172
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
173
+ end
174
+ end
175
+
176
+ self
177
+ end
178
+
179
+ # Deserializes the data based on type
180
+ # @param string type Data type
181
+ # @param string value Value to be deserialized
182
+ # @return [Object] Deserialized data
183
+ def _deserialize(type, value)
184
+ case type.to_sym
185
+ when :Time
186
+ Time.parse(value)
187
+ when :Date
188
+ Date.parse(value)
189
+ when :String
190
+ value.to_s
191
+ when :Integer
192
+ value.to_i
193
+ when :Float
194
+ value.to_f
195
+ when :Boolean
196
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
197
+ true
198
+ else
199
+ false
200
+ end
201
+ when :Object
202
+ # generic object (usually a Hash), return directly
203
+ value
204
+ when /\AArray<(?<inner_type>.+)>\z/
205
+ inner_type = Regexp.last_match[:inner_type]
206
+ value.map { |v| _deserialize(inner_type, v) }
207
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
208
+ k_type = Regexp.last_match[:k_type]
209
+ v_type = Regexp.last_match[:v_type]
210
+ {}.tap do |hash|
211
+ value.each do |k, v|
212
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
213
+ end
214
+ end
215
+ else # model
216
+ # models (e.g. Pet) or oneOf
217
+ klass = UltracartClient.const_get(type)
218
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
219
+ end
220
+ end
221
+
222
+ # Returns the string representation of the object
223
+ # @return [String] String presentation of the object
224
+ def to_s
225
+ to_hash.to_s
226
+ end
227
+
228
+ # to_body is an alias to to_hash (backward compatibility)
229
+ # @return [Hash] Returns the object in the form of hash
230
+ def to_body
231
+ to_hash
232
+ end
233
+
234
+ # Returns the object in the form of hash
235
+ # @return [Hash] Returns the object in the form of hash
236
+ def to_hash
237
+ hash = {}
238
+ self.class.attribute_map.each_pair do |attr, param|
239
+ value = self.send(attr)
240
+ if value.nil?
241
+ is_nullable = self.class.openapi_nullable.include?(attr)
242
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
243
+ end
244
+
245
+ hash[param] = _to_hash(value)
246
+ end
247
+ hash
248
+ end
249
+
250
+ # Outputs non-array value in the form of hash
251
+ # For object, use to_hash. Otherwise, just return the value
252
+ # @param [Object] value Any valid value
253
+ # @return [Hash] Returns the value in the form of hash
254
+ def _to_hash(value)
255
+ if value.is_a?(Array)
256
+ value.compact.map { |v| _to_hash(v) }
257
+ elsif value.is_a?(Hash)
258
+ {}.tap do |hash|
259
+ value.each { |k, v| hash[k] = _to_hash(v) }
260
+ end
261
+ elsif value.respond_to? :to_hash
262
+ value.to_hash
263
+ else
264
+ value
265
+ end
266
+ end
267
+
268
+ end
269
+
270
+ end
@@ -0,0 +1,274 @@
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 SfvbItemPages
18
+ # The default page's path, or null when none is marked.
19
+ attr_accessor :default_page_path
20
+
21
+ # Hash of the item's pages and default on this storefront. The dry run reports the same value as current_sha256.
22
+ attr_accessor :hash_sha256
23
+
24
+ # The item's id.
25
+ attr_accessor :merchant_item_id
26
+
27
+ # The item's oid.
28
+ attr_accessor :merchant_item_oid
29
+
30
+ # Things worth knowing, such as no default being marked.
31
+ attr_accessor :notes
32
+
33
+ # Every page the item is on, on this storefront only.
34
+ attr_accessor :pages
35
+
36
+ # Attribute mapping from ruby-style variable name to JSON key.
37
+ def self.attribute_map
38
+ {
39
+ :'default_page_path' => :'default_page_path',
40
+ :'hash_sha256' => :'hash_sha256',
41
+ :'merchant_item_id' => :'merchant_item_id',
42
+ :'merchant_item_oid' => :'merchant_item_oid',
43
+ :'notes' => :'notes',
44
+ :'pages' => :'pages'
45
+ }
46
+ end
47
+
48
+ # Returns all the JSON keys this model knows about
49
+ def self.acceptable_attributes
50
+ attribute_map.values
51
+ end
52
+
53
+ # Attribute type mapping.
54
+ def self.openapi_types
55
+ {
56
+ :'default_page_path' => :'String',
57
+ :'hash_sha256' => :'String',
58
+ :'merchant_item_id' => :'String',
59
+ :'merchant_item_oid' => :'Integer',
60
+ :'notes' => :'Array<String>',
61
+ :'pages' => :'Array<SfvbItemPageAssignment>'
62
+ }
63
+ end
64
+
65
+ # List of attributes with nullable: true
66
+ def self.openapi_nullable
67
+ Set.new([
68
+ ])
69
+ end
70
+
71
+ # Initializes the object
72
+ # @param [Hash] attributes Model attributes in the form of hash
73
+ def initialize(attributes = {})
74
+ if (!attributes.is_a?(Hash))
75
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbItemPages` initialize method"
76
+ end
77
+
78
+ # check to see if the attribute exists and convert string to symbol for hash key
79
+ attributes = attributes.each_with_object({}) { |(k, v), h|
80
+ if (!self.class.attribute_map.key?(k.to_sym))
81
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbItemPages`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
82
+ end
83
+ h[k.to_sym] = v
84
+ }
85
+
86
+ if attributes.key?(:'default_page_path')
87
+ self.default_page_path = attributes[:'default_page_path']
88
+ end
89
+
90
+ if attributes.key?(:'hash_sha256')
91
+ self.hash_sha256 = attributes[:'hash_sha256']
92
+ end
93
+
94
+ if attributes.key?(:'merchant_item_id')
95
+ self.merchant_item_id = attributes[:'merchant_item_id']
96
+ end
97
+
98
+ if attributes.key?(:'merchant_item_oid')
99
+ self.merchant_item_oid = attributes[:'merchant_item_oid']
100
+ end
101
+
102
+ if attributes.key?(:'notes')
103
+ if (value = attributes[:'notes']).is_a?(Array)
104
+ self.notes = value
105
+ end
106
+ end
107
+
108
+ if attributes.key?(:'pages')
109
+ if (value = attributes[:'pages']).is_a?(Array)
110
+ self.pages = value
111
+ end
112
+ end
113
+ end
114
+
115
+ # Show invalid properties with the reasons. Usually used together with valid?
116
+ # @return Array for valid properties with the reasons
117
+ def list_invalid_properties
118
+ invalid_properties = Array.new
119
+ invalid_properties
120
+ end
121
+
122
+ # Check to see if the all the properties in the model are valid
123
+ # @return true if the model is valid
124
+ def valid?
125
+ true
126
+ end
127
+
128
+ # Checks equality by comparing each attribute.
129
+ # @param [Object] Object to be compared
130
+ def ==(o)
131
+ return true if self.equal?(o)
132
+ self.class == o.class &&
133
+ default_page_path == o.default_page_path &&
134
+ hash_sha256 == o.hash_sha256 &&
135
+ merchant_item_id == o.merchant_item_id &&
136
+ merchant_item_oid == o.merchant_item_oid &&
137
+ notes == o.notes &&
138
+ pages == o.pages
139
+ end
140
+
141
+ # @see the `==` method
142
+ # @param [Object] Object to be compared
143
+ def eql?(o)
144
+ self == o
145
+ end
146
+
147
+ # Calculates hash code according to all attributes.
148
+ # @return [Integer] Hash code
149
+ def hash
150
+ [default_page_path, hash_sha256, merchant_item_id, merchant_item_oid, notes, pages].hash
151
+ end
152
+
153
+ # Builds the object from hash
154
+ # @param [Hash] attributes Model attributes in the form of hash
155
+ # @return [Object] Returns the model itself
156
+ def self.build_from_hash(attributes)
157
+ new.build_from_hash(attributes)
158
+ end
159
+
160
+ # Builds the object from hash
161
+ # @param [Hash] attributes Model attributes in the form of hash
162
+ # @return [Object] Returns the model itself
163
+ def build_from_hash(attributes)
164
+ return nil unless attributes.is_a?(Hash)
165
+ attributes = attributes.transform_keys(&:to_sym)
166
+ self.class.openapi_types.each_pair do |key, type|
167
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
168
+ self.send("#{key}=", nil)
169
+ elsif type =~ /\AArray<(.*)>/i
170
+ # check to ensure the input is an array given that the attribute
171
+ # is documented as an array but the input is not
172
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
173
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
174
+ end
175
+ elsif !attributes[self.class.attribute_map[key]].nil?
176
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
177
+ end
178
+ end
179
+
180
+ self
181
+ end
182
+
183
+ # Deserializes the data based on type
184
+ # @param string type Data type
185
+ # @param string value Value to be deserialized
186
+ # @return [Object] Deserialized data
187
+ def _deserialize(type, value)
188
+ case type.to_sym
189
+ when :Time
190
+ Time.parse(value)
191
+ when :Date
192
+ Date.parse(value)
193
+ when :String
194
+ value.to_s
195
+ when :Integer
196
+ value.to_i
197
+ when :Float
198
+ value.to_f
199
+ when :Boolean
200
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
201
+ true
202
+ else
203
+ false
204
+ end
205
+ when :Object
206
+ # generic object (usually a Hash), return directly
207
+ value
208
+ when /\AArray<(?<inner_type>.+)>\z/
209
+ inner_type = Regexp.last_match[:inner_type]
210
+ value.map { |v| _deserialize(inner_type, v) }
211
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
212
+ k_type = Regexp.last_match[:k_type]
213
+ v_type = Regexp.last_match[:v_type]
214
+ {}.tap do |hash|
215
+ value.each do |k, v|
216
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
217
+ end
218
+ end
219
+ else # model
220
+ # models (e.g. Pet) or oneOf
221
+ klass = UltracartClient.const_get(type)
222
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
223
+ end
224
+ end
225
+
226
+ # Returns the string representation of the object
227
+ # @return [String] String presentation of the object
228
+ def to_s
229
+ to_hash.to_s
230
+ end
231
+
232
+ # to_body is an alias to to_hash (backward compatibility)
233
+ # @return [Hash] Returns the object in the form of hash
234
+ def to_body
235
+ to_hash
236
+ end
237
+
238
+ # Returns the object in the form of hash
239
+ # @return [Hash] Returns the object in the form of hash
240
+ def to_hash
241
+ hash = {}
242
+ self.class.attribute_map.each_pair do |attr, param|
243
+ value = self.send(attr)
244
+ if value.nil?
245
+ is_nullable = self.class.openapi_nullable.include?(attr)
246
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
247
+ end
248
+
249
+ hash[param] = _to_hash(value)
250
+ end
251
+ hash
252
+ end
253
+
254
+ # Outputs non-array value in the form of hash
255
+ # For object, use to_hash. Otherwise, just return the value
256
+ # @param [Object] value Any valid value
257
+ # @return [Hash] Returns the value in the form of hash
258
+ def _to_hash(value)
259
+ if value.is_a?(Array)
260
+ value.compact.map { |v| _to_hash(v) }
261
+ elsif value.is_a?(Hash)
262
+ {}.tap do |hash|
263
+ value.each { |k, v| hash[k] = _to_hash(v) }
264
+ end
265
+ elsif value.respond_to? :to_hash
266
+ value.to_hash
267
+ else
268
+ value
269
+ end
270
+ end
271
+
272
+ end
273
+
274
+ end