ultracart_api 4.1.199 → 4.1.200

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 (31) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +21 -2
  3. data/docs/SfvbApi.md +465 -11
  4. data/docs/SfvbApprovalCreateRequest.md +6 -0
  5. data/docs/SfvbApprovalParams.md +23 -3
  6. data/docs/SfvbItemAttributeBatchRequest.md +20 -0
  7. data/docs/SfvbItemAttributeBatchResponse.md +40 -0
  8. data/docs/SfvbItemAttributeBatchRow.md +30 -0
  9. data/docs/SfvbItemAttributeBatchRowResult.md +36 -0
  10. data/docs/SfvbItemPricing.md +38 -0
  11. data/docs/SfvbItemPricingRequest.md +32 -0
  12. data/docs/SfvbItemRelated.md +28 -0
  13. data/docs/SfvbItemRelatedItem.md +22 -0
  14. data/docs/SfvbItemRelatedRequest.md +22 -0
  15. data/docs/SfvbItemVolumeDiscount.md +20 -0
  16. data/lib/ultracart_api/api/sfvb_api.rb +640 -16
  17. data/lib/ultracart_api/models/sfvb_approval_create_request.rb +33 -3
  18. data/lib/ultracart_api/models/sfvb_approval_params.rb +142 -6
  19. data/lib/ultracart_api/models/sfvb_item_attribute_batch_request.rb +232 -0
  20. data/lib/ultracart_api/models/sfvb_item_attribute_batch_response.rb +332 -0
  21. data/lib/ultracart_api/models/sfvb_item_attribute_batch_row.rb +280 -0
  22. data/lib/ultracart_api/models/sfvb_item_attribute_batch_row_result.rb +344 -0
  23. data/lib/ultracart_api/models/sfvb_item_pricing.rb +322 -0
  24. data/lib/ultracart_api/models/sfvb_item_pricing_request.rb +292 -0
  25. data/lib/ultracart_api/models/sfvb_item_related.rb +272 -0
  26. data/lib/ultracart_api/models/sfvb_item_related_item.rb +274 -0
  27. data/lib/ultracart_api/models/sfvb_item_related_request.rb +242 -0
  28. data/lib/ultracart_api/models/sfvb_item_volume_discount.rb +230 -0
  29. data/lib/ultracart_api/version.rb +1 -1
  30. data/lib/ultracart_api.rb +10 -0
  31. metadata +22 -2
@@ -0,0 +1,332 @@
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 SfvbItemAttributeBatchResponse
18
+ # True after an apply.
19
+ attr_accessor :applied
20
+
21
+ # Rows that would change, from a dry run.
22
+ attr_accessor :change
23
+
24
+ # Rows on an item that could not be saved, after an apply.
25
+ attr_accessor :error
26
+
27
+ # Rows refused by the attribute checks.
28
+ attr_accessor :invalid
29
+
30
+ # Distinct items with at least one row that would change, or did.
31
+ attr_accessor :item_count
32
+
33
+ # Rows naming an item that does not exist.
34
+ attr_accessor :not_found
35
+
36
+ # The hash of the rows answered as change, with their current_sha256. Apply exactly those rows with this hash.
37
+ attr_accessor :plan_hash
38
+
39
+ # One result per row, in request order.
40
+ attr_accessor :rows
41
+
42
+ # Rows skipped because the value is not the one expected.
43
+ attr_accessor :stale
44
+
45
+ # Rows checked.
46
+ attr_accessor :total
47
+
48
+ # Rows whose value is already the new one.
49
+ attr_accessor :unchanged
50
+
51
+ # Rows written, after an apply.
52
+ attr_accessor :updated
53
+
54
+ # Attribute mapping from ruby-style variable name to JSON key.
55
+ def self.attribute_map
56
+ {
57
+ :'applied' => :'applied',
58
+ :'change' => :'change',
59
+ :'error' => :'error',
60
+ :'invalid' => :'invalid',
61
+ :'item_count' => :'item_count',
62
+ :'not_found' => :'not_found',
63
+ :'plan_hash' => :'plan_hash',
64
+ :'rows' => :'rows',
65
+ :'stale' => :'stale',
66
+ :'total' => :'total',
67
+ :'unchanged' => :'unchanged',
68
+ :'updated' => :'updated'
69
+ }
70
+ end
71
+
72
+ # Returns all the JSON keys this model knows about
73
+ def self.acceptable_attributes
74
+ attribute_map.values
75
+ end
76
+
77
+ # Attribute type mapping.
78
+ def self.openapi_types
79
+ {
80
+ :'applied' => :'Boolean',
81
+ :'change' => :'Integer',
82
+ :'error' => :'Integer',
83
+ :'invalid' => :'Integer',
84
+ :'item_count' => :'Integer',
85
+ :'not_found' => :'Integer',
86
+ :'plan_hash' => :'String',
87
+ :'rows' => :'Array<SfvbItemAttributeBatchRowResult>',
88
+ :'stale' => :'Integer',
89
+ :'total' => :'Integer',
90
+ :'unchanged' => :'Integer',
91
+ :'updated' => :'Integer'
92
+ }
93
+ end
94
+
95
+ # List of attributes with nullable: true
96
+ def self.openapi_nullable
97
+ Set.new([
98
+ ])
99
+ end
100
+
101
+ # Initializes the object
102
+ # @param [Hash] attributes Model attributes in the form of hash
103
+ def initialize(attributes = {})
104
+ if (!attributes.is_a?(Hash))
105
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbItemAttributeBatchResponse` initialize method"
106
+ end
107
+
108
+ # check to see if the attribute exists and convert string to symbol for hash key
109
+ attributes = attributes.each_with_object({}) { |(k, v), h|
110
+ if (!self.class.attribute_map.key?(k.to_sym))
111
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbItemAttributeBatchResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
112
+ end
113
+ h[k.to_sym] = v
114
+ }
115
+
116
+ if attributes.key?(:'applied')
117
+ self.applied = attributes[:'applied']
118
+ end
119
+
120
+ if attributes.key?(:'change')
121
+ self.change = attributes[:'change']
122
+ end
123
+
124
+ if attributes.key?(:'error')
125
+ self.error = attributes[:'error']
126
+ end
127
+
128
+ if attributes.key?(:'invalid')
129
+ self.invalid = attributes[:'invalid']
130
+ end
131
+
132
+ if attributes.key?(:'item_count')
133
+ self.item_count = attributes[:'item_count']
134
+ end
135
+
136
+ if attributes.key?(:'not_found')
137
+ self.not_found = attributes[:'not_found']
138
+ end
139
+
140
+ if attributes.key?(:'plan_hash')
141
+ self.plan_hash = attributes[:'plan_hash']
142
+ end
143
+
144
+ if attributes.key?(:'rows')
145
+ if (value = attributes[:'rows']).is_a?(Array)
146
+ self.rows = value
147
+ end
148
+ end
149
+
150
+ if attributes.key?(:'stale')
151
+ self.stale = attributes[:'stale']
152
+ end
153
+
154
+ if attributes.key?(:'total')
155
+ self.total = attributes[:'total']
156
+ end
157
+
158
+ if attributes.key?(:'unchanged')
159
+ self.unchanged = attributes[:'unchanged']
160
+ end
161
+
162
+ if attributes.key?(:'updated')
163
+ self.updated = attributes[:'updated']
164
+ end
165
+ end
166
+
167
+ # Show invalid properties with the reasons. Usually used together with valid?
168
+ # @return Array for valid properties with the reasons
169
+ def list_invalid_properties
170
+ invalid_properties = Array.new
171
+ invalid_properties
172
+ end
173
+
174
+ # Check to see if the all the properties in the model are valid
175
+ # @return true if the model is valid
176
+ def valid?
177
+ true
178
+ end
179
+
180
+ # Checks equality by comparing each attribute.
181
+ # @param [Object] Object to be compared
182
+ def ==(o)
183
+ return true if self.equal?(o)
184
+ self.class == o.class &&
185
+ applied == o.applied &&
186
+ change == o.change &&
187
+ error == o.error &&
188
+ invalid == o.invalid &&
189
+ item_count == o.item_count &&
190
+ not_found == o.not_found &&
191
+ plan_hash == o.plan_hash &&
192
+ rows == o.rows &&
193
+ stale == o.stale &&
194
+ total == o.total &&
195
+ unchanged == o.unchanged &&
196
+ updated == o.updated
197
+ end
198
+
199
+ # @see the `==` method
200
+ # @param [Object] Object to be compared
201
+ def eql?(o)
202
+ self == o
203
+ end
204
+
205
+ # Calculates hash code according to all attributes.
206
+ # @return [Integer] Hash code
207
+ def hash
208
+ [applied, change, error, invalid, item_count, not_found, plan_hash, rows, stale, total, unchanged, updated].hash
209
+ end
210
+
211
+ # Builds the object from hash
212
+ # @param [Hash] attributes Model attributes in the form of hash
213
+ # @return [Object] Returns the model itself
214
+ def self.build_from_hash(attributes)
215
+ new.build_from_hash(attributes)
216
+ end
217
+
218
+ # Builds the object from hash
219
+ # @param [Hash] attributes Model attributes in the form of hash
220
+ # @return [Object] Returns the model itself
221
+ def build_from_hash(attributes)
222
+ return nil unless attributes.is_a?(Hash)
223
+ attributes = attributes.transform_keys(&:to_sym)
224
+ self.class.openapi_types.each_pair do |key, type|
225
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
226
+ self.send("#{key}=", nil)
227
+ elsif type =~ /\AArray<(.*)>/i
228
+ # check to ensure the input is an array given that the attribute
229
+ # is documented as an array but the input is not
230
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
231
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
232
+ end
233
+ elsif !attributes[self.class.attribute_map[key]].nil?
234
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
235
+ end
236
+ end
237
+
238
+ self
239
+ end
240
+
241
+ # Deserializes the data based on type
242
+ # @param string type Data type
243
+ # @param string value Value to be deserialized
244
+ # @return [Object] Deserialized data
245
+ def _deserialize(type, value)
246
+ case type.to_sym
247
+ when :Time
248
+ Time.parse(value)
249
+ when :Date
250
+ Date.parse(value)
251
+ when :String
252
+ value.to_s
253
+ when :Integer
254
+ value.to_i
255
+ when :Float
256
+ value.to_f
257
+ when :Boolean
258
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
259
+ true
260
+ else
261
+ false
262
+ end
263
+ when :Object
264
+ # generic object (usually a Hash), return directly
265
+ value
266
+ when /\AArray<(?<inner_type>.+)>\z/
267
+ inner_type = Regexp.last_match[:inner_type]
268
+ value.map { |v| _deserialize(inner_type, v) }
269
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
270
+ k_type = Regexp.last_match[:k_type]
271
+ v_type = Regexp.last_match[:v_type]
272
+ {}.tap do |hash|
273
+ value.each do |k, v|
274
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
275
+ end
276
+ end
277
+ else # model
278
+ # models (e.g. Pet) or oneOf
279
+ klass = UltracartClient.const_get(type)
280
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
281
+ end
282
+ end
283
+
284
+ # Returns the string representation of the object
285
+ # @return [String] String presentation of the object
286
+ def to_s
287
+ to_hash.to_s
288
+ end
289
+
290
+ # to_body is an alias to to_hash (backward compatibility)
291
+ # @return [Hash] Returns the object in the form of hash
292
+ def to_body
293
+ to_hash
294
+ end
295
+
296
+ # Returns the object in the form of hash
297
+ # @return [Hash] Returns the object in the form of hash
298
+ def to_hash
299
+ hash = {}
300
+ self.class.attribute_map.each_pair do |attr, param|
301
+ value = self.send(attr)
302
+ if value.nil?
303
+ is_nullable = self.class.openapi_nullable.include?(attr)
304
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
305
+ end
306
+
307
+ hash[param] = _to_hash(value)
308
+ end
309
+ hash
310
+ end
311
+
312
+ # Outputs non-array value in the form of hash
313
+ # For object, use to_hash. Otherwise, just return the value
314
+ # @param [Object] value Any valid value
315
+ # @return [Hash] Returns the value in the form of hash
316
+ def _to_hash(value)
317
+ if value.is_a?(Array)
318
+ value.compact.map { |v| _to_hash(v) }
319
+ elsif value.is_a?(Hash)
320
+ {}.tap do |hash|
321
+ value.each { |k, v| hash[k] = _to_hash(v) }
322
+ end
323
+ elsif value.respond_to? :to_hash
324
+ value.to_hash
325
+ else
326
+ value
327
+ end
328
+ end
329
+
330
+ end
331
+
332
+ end
@@ -0,0 +1,280 @@
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 SfvbItemAttributeBatchRow
18
+ # The current_sha256 the dry run answered for this row. Required to apply; a row whose value changed since is skipped as stale.
19
+ attr_accessor :current_sha256
20
+
21
+ # For a dry run, the value the caller believes the item holds now. A different current value makes the row stale.
22
+ attr_accessor :expected_value
23
+
24
+ # The item by its merchant item id, for a dry run. Send this or merchant_item_oid, not both.
25
+ attr_accessor :merchant_item_id
26
+
27
+ # The item. Required to apply; the dry run answers it for a row that named merchant_item_id.
28
+ attr_accessor :merchant_item_oid
29
+
30
+ # The attribute name, matched without regard to case.
31
+ attr_accessor :name
32
+
33
+ # The attribute type, used only when no template on the item's pages declares the name.
34
+ attr_accessor :type
35
+
36
+ # The new value. An empty string clears the attribute.
37
+ attr_accessor :value
38
+
39
+ # Attribute mapping from ruby-style variable name to JSON key.
40
+ def self.attribute_map
41
+ {
42
+ :'current_sha256' => :'current_sha256',
43
+ :'expected_value' => :'expected_value',
44
+ :'merchant_item_id' => :'merchant_item_id',
45
+ :'merchant_item_oid' => :'merchant_item_oid',
46
+ :'name' => :'name',
47
+ :'type' => :'type',
48
+ :'value' => :'value'
49
+ }
50
+ end
51
+
52
+ # Returns all the JSON keys this model knows about
53
+ def self.acceptable_attributes
54
+ attribute_map.values
55
+ end
56
+
57
+ # Attribute type mapping.
58
+ def self.openapi_types
59
+ {
60
+ :'current_sha256' => :'String',
61
+ :'expected_value' => :'String',
62
+ :'merchant_item_id' => :'String',
63
+ :'merchant_item_oid' => :'Integer',
64
+ :'name' => :'String',
65
+ :'type' => :'String',
66
+ :'value' => :'String'
67
+ }
68
+ end
69
+
70
+ # List of attributes with nullable: true
71
+ def self.openapi_nullable
72
+ Set.new([
73
+ ])
74
+ end
75
+
76
+ # Initializes the object
77
+ # @param [Hash] attributes Model attributes in the form of hash
78
+ def initialize(attributes = {})
79
+ if (!attributes.is_a?(Hash))
80
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbItemAttributeBatchRow` initialize method"
81
+ end
82
+
83
+ # check to see if the attribute exists and convert string to symbol for hash key
84
+ attributes = attributes.each_with_object({}) { |(k, v), h|
85
+ if (!self.class.attribute_map.key?(k.to_sym))
86
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbItemAttributeBatchRow`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
87
+ end
88
+ h[k.to_sym] = v
89
+ }
90
+
91
+ if attributes.key?(:'current_sha256')
92
+ self.current_sha256 = attributes[:'current_sha256']
93
+ end
94
+
95
+ if attributes.key?(:'expected_value')
96
+ self.expected_value = attributes[:'expected_value']
97
+ end
98
+
99
+ if attributes.key?(:'merchant_item_id')
100
+ self.merchant_item_id = attributes[:'merchant_item_id']
101
+ end
102
+
103
+ if attributes.key?(:'merchant_item_oid')
104
+ self.merchant_item_oid = attributes[:'merchant_item_oid']
105
+ end
106
+
107
+ if attributes.key?(:'name')
108
+ self.name = attributes[:'name']
109
+ end
110
+
111
+ if attributes.key?(:'type')
112
+ self.type = attributes[:'type']
113
+ end
114
+
115
+ if attributes.key?(:'value')
116
+ self.value = attributes[:'value']
117
+ end
118
+ end
119
+
120
+ # Show invalid properties with the reasons. Usually used together with valid?
121
+ # @return Array for valid properties with the reasons
122
+ def list_invalid_properties
123
+ invalid_properties = Array.new
124
+ invalid_properties
125
+ end
126
+
127
+ # Check to see if the all the properties in the model are valid
128
+ # @return true if the model is valid
129
+ def valid?
130
+ true
131
+ end
132
+
133
+ # Checks equality by comparing each attribute.
134
+ # @param [Object] Object to be compared
135
+ def ==(o)
136
+ return true if self.equal?(o)
137
+ self.class == o.class &&
138
+ current_sha256 == o.current_sha256 &&
139
+ expected_value == o.expected_value &&
140
+ merchant_item_id == o.merchant_item_id &&
141
+ merchant_item_oid == o.merchant_item_oid &&
142
+ name == o.name &&
143
+ type == o.type &&
144
+ value == o.value
145
+ end
146
+
147
+ # @see the `==` method
148
+ # @param [Object] Object to be compared
149
+ def eql?(o)
150
+ self == o
151
+ end
152
+
153
+ # Calculates hash code according to all attributes.
154
+ # @return [Integer] Hash code
155
+ def hash
156
+ [current_sha256, expected_value, merchant_item_id, merchant_item_oid, name, type, value].hash
157
+ end
158
+
159
+ # Builds the object from hash
160
+ # @param [Hash] attributes Model attributes in the form of hash
161
+ # @return [Object] Returns the model itself
162
+ def self.build_from_hash(attributes)
163
+ new.build_from_hash(attributes)
164
+ end
165
+
166
+ # Builds the object from hash
167
+ # @param [Hash] attributes Model attributes in the form of hash
168
+ # @return [Object] Returns the model itself
169
+ def build_from_hash(attributes)
170
+ return nil unless attributes.is_a?(Hash)
171
+ attributes = attributes.transform_keys(&:to_sym)
172
+ self.class.openapi_types.each_pair do |key, type|
173
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
174
+ self.send("#{key}=", nil)
175
+ elsif type =~ /\AArray<(.*)>/i
176
+ # check to ensure the input is an array given that the attribute
177
+ # is documented as an array but the input is not
178
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
179
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
180
+ end
181
+ elsif !attributes[self.class.attribute_map[key]].nil?
182
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
183
+ end
184
+ end
185
+
186
+ self
187
+ end
188
+
189
+ # Deserializes the data based on type
190
+ # @param string type Data type
191
+ # @param string value Value to be deserialized
192
+ # @return [Object] Deserialized data
193
+ def _deserialize(type, value)
194
+ case type.to_sym
195
+ when :Time
196
+ Time.parse(value)
197
+ when :Date
198
+ Date.parse(value)
199
+ when :String
200
+ value.to_s
201
+ when :Integer
202
+ value.to_i
203
+ when :Float
204
+ value.to_f
205
+ when :Boolean
206
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
207
+ true
208
+ else
209
+ false
210
+ end
211
+ when :Object
212
+ # generic object (usually a Hash), return directly
213
+ value
214
+ when /\AArray<(?<inner_type>.+)>\z/
215
+ inner_type = Regexp.last_match[:inner_type]
216
+ value.map { |v| _deserialize(inner_type, v) }
217
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
218
+ k_type = Regexp.last_match[:k_type]
219
+ v_type = Regexp.last_match[:v_type]
220
+ {}.tap do |hash|
221
+ value.each do |k, v|
222
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
223
+ end
224
+ end
225
+ else # model
226
+ # models (e.g. Pet) or oneOf
227
+ klass = UltracartClient.const_get(type)
228
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
229
+ end
230
+ end
231
+
232
+ # Returns the string representation of the object
233
+ # @return [String] String presentation of the object
234
+ def to_s
235
+ to_hash.to_s
236
+ end
237
+
238
+ # to_body is an alias to to_hash (backward compatibility)
239
+ # @return [Hash] Returns the object in the form of hash
240
+ def to_body
241
+ to_hash
242
+ end
243
+
244
+ # Returns the object in the form of hash
245
+ # @return [Hash] Returns the object in the form of hash
246
+ def to_hash
247
+ hash = {}
248
+ self.class.attribute_map.each_pair do |attr, param|
249
+ value = self.send(attr)
250
+ if value.nil?
251
+ is_nullable = self.class.openapi_nullable.include?(attr)
252
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
253
+ end
254
+
255
+ hash[param] = _to_hash(value)
256
+ end
257
+ hash
258
+ end
259
+
260
+ # Outputs non-array value in the form of hash
261
+ # For object, use to_hash. Otherwise, just return the value
262
+ # @param [Object] value Any valid value
263
+ # @return [Hash] Returns the value in the form of hash
264
+ def _to_hash(value)
265
+ if value.is_a?(Array)
266
+ value.compact.map { |v| _to_hash(v) }
267
+ elsif value.is_a?(Hash)
268
+ {}.tap do |hash|
269
+ value.each { |k, v| hash[k] = _to_hash(v) }
270
+ end
271
+ elsif value.respond_to? :to_hash
272
+ value.to_hash
273
+ else
274
+ value
275
+ end
276
+ end
277
+
278
+ end
279
+
280
+ end