ultracart_api 4.1.199 → 4.1.201

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 (45) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +28 -2
  3. data/docs/SfvbApi.md +578 -13
  4. data/docs/SfvbApprovalCreateRequest.md +6 -0
  5. data/docs/SfvbApprovalParams.md +23 -3
  6. data/docs/SfvbContainerVersion.md +1 -1
  7. data/docs/SfvbEvent.md +28 -0
  8. data/docs/SfvbEventsAuthRequest.md +18 -0
  9. data/docs/SfvbEventsAuthResponse.md +22 -0
  10. data/docs/SfvbEventsResponse.md +22 -0
  11. data/docs/SfvbI18nMessageValue.md +1 -1
  12. data/docs/SfvbItemAttributeBatchRequest.md +20 -0
  13. data/docs/SfvbItemAttributeBatchResponse.md +40 -0
  14. data/docs/SfvbItemAttributeBatchRow.md +30 -0
  15. data/docs/SfvbItemAttributeBatchRowResult.md +36 -0
  16. data/docs/SfvbItemPricing.md +38 -0
  17. data/docs/SfvbItemPricingRequest.md +32 -0
  18. data/docs/SfvbItemRelated.md +28 -0
  19. data/docs/SfvbItemRelatedItem.md +22 -0
  20. data/docs/SfvbItemRelatedRequest.md +22 -0
  21. data/docs/SfvbItemVolumeDiscount.md +20 -0
  22. data/docs/SfvbThemeJobResponse.md +3 -3
  23. data/lib/ultracart_api/api/sfvb_api.rb +831 -72
  24. data/lib/ultracart_api/models/sfvb_approval_create_request.rb +33 -3
  25. data/lib/ultracart_api/models/sfvb_approval_params.rb +142 -6
  26. data/lib/ultracart_api/models/sfvb_container_version.rb +1 -1
  27. data/lib/ultracart_api/models/sfvb_event.rb +270 -0
  28. data/lib/ultracart_api/models/sfvb_events_auth_request.rb +222 -0
  29. data/lib/ultracart_api/models/sfvb_events_auth_response.rb +240 -0
  30. data/lib/ultracart_api/models/sfvb_events_response.rb +242 -0
  31. data/lib/ultracart_api/models/sfvb_i18n_message_value.rb +1 -1
  32. data/lib/ultracart_api/models/sfvb_item_attribute_batch_request.rb +232 -0
  33. data/lib/ultracart_api/models/sfvb_item_attribute_batch_response.rb +332 -0
  34. data/lib/ultracart_api/models/sfvb_item_attribute_batch_row.rb +280 -0
  35. data/lib/ultracart_api/models/sfvb_item_attribute_batch_row_result.rb +344 -0
  36. data/lib/ultracart_api/models/sfvb_item_pricing.rb +322 -0
  37. data/lib/ultracart_api/models/sfvb_item_pricing_request.rb +292 -0
  38. data/lib/ultracart_api/models/sfvb_item_related.rb +272 -0
  39. data/lib/ultracart_api/models/sfvb_item_related_item.rb +274 -0
  40. data/lib/ultracart_api/models/sfvb_item_related_request.rb +242 -0
  41. data/lib/ultracart_api/models/sfvb_item_volume_discount.rb +230 -0
  42. data/lib/ultracart_api/models/sfvb_theme_job_response.rb +3 -3
  43. data/lib/ultracart_api/version.rb +1 -1
  44. data/lib/ultracart_api.rb +14 -0
  45. metadata +30 -2
@@ -0,0 +1,232 @@
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 SfvbItemAttributeBatchRequest
18
+ # From the dry run. Required to apply, with exactly the rows the dry run answered as change.
19
+ attr_accessor :plan_hash
20
+
21
+ # The changes, up to 5,000 rows on up to 500 items. Each item and name at most once.
22
+ attr_accessor :rows
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'plan_hash' => :'plan_hash',
28
+ :'rows' => :'rows'
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
+ :'plan_hash' => :'String',
41
+ :'rows' => :'Array<SfvbItemAttributeBatchRow>'
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::SfvbItemAttributeBatchRequest` 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::SfvbItemAttributeBatchRequest`. 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?(:'plan_hash')
67
+ self.plan_hash = attributes[:'plan_hash']
68
+ end
69
+
70
+ if attributes.key?(:'rows')
71
+ if (value = attributes[:'rows']).is_a?(Array)
72
+ self.rows = value
73
+ end
74
+ end
75
+ end
76
+
77
+ # Show invalid properties with the reasons. Usually used together with valid?
78
+ # @return Array for valid properties with the reasons
79
+ def list_invalid_properties
80
+ invalid_properties = Array.new
81
+ invalid_properties
82
+ end
83
+
84
+ # Check to see if the all the properties in the model are valid
85
+ # @return true if the model is valid
86
+ def valid?
87
+ true
88
+ end
89
+
90
+ # Checks equality by comparing each attribute.
91
+ # @param [Object] Object to be compared
92
+ def ==(o)
93
+ return true if self.equal?(o)
94
+ self.class == o.class &&
95
+ plan_hash == o.plan_hash &&
96
+ rows == o.rows
97
+ end
98
+
99
+ # @see the `==` method
100
+ # @param [Object] Object to be compared
101
+ def eql?(o)
102
+ self == o
103
+ end
104
+
105
+ # Calculates hash code according to all attributes.
106
+ # @return [Integer] Hash code
107
+ def hash
108
+ [plan_hash, rows].hash
109
+ end
110
+
111
+ # Builds the object from hash
112
+ # @param [Hash] attributes Model attributes in the form of hash
113
+ # @return [Object] Returns the model itself
114
+ def self.build_from_hash(attributes)
115
+ new.build_from_hash(attributes)
116
+ end
117
+
118
+ # Builds the object from hash
119
+ # @param [Hash] attributes Model attributes in the form of hash
120
+ # @return [Object] Returns the model itself
121
+ def build_from_hash(attributes)
122
+ return nil unless attributes.is_a?(Hash)
123
+ attributes = attributes.transform_keys(&:to_sym)
124
+ self.class.openapi_types.each_pair do |key, type|
125
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
126
+ self.send("#{key}=", nil)
127
+ elsif type =~ /\AArray<(.*)>/i
128
+ # check to ensure the input is an array given that the attribute
129
+ # is documented as an array but the input is not
130
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
131
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
132
+ end
133
+ elsif !attributes[self.class.attribute_map[key]].nil?
134
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
135
+ end
136
+ end
137
+
138
+ self
139
+ end
140
+
141
+ # Deserializes the data based on type
142
+ # @param string type Data type
143
+ # @param string value Value to be deserialized
144
+ # @return [Object] Deserialized data
145
+ def _deserialize(type, value)
146
+ case type.to_sym
147
+ when :Time
148
+ Time.parse(value)
149
+ when :Date
150
+ Date.parse(value)
151
+ when :String
152
+ value.to_s
153
+ when :Integer
154
+ value.to_i
155
+ when :Float
156
+ value.to_f
157
+ when :Boolean
158
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
159
+ true
160
+ else
161
+ false
162
+ end
163
+ when :Object
164
+ # generic object (usually a Hash), return directly
165
+ value
166
+ when /\AArray<(?<inner_type>.+)>\z/
167
+ inner_type = Regexp.last_match[:inner_type]
168
+ value.map { |v| _deserialize(inner_type, v) }
169
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
170
+ k_type = Regexp.last_match[:k_type]
171
+ v_type = Regexp.last_match[:v_type]
172
+ {}.tap do |hash|
173
+ value.each do |k, v|
174
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
175
+ end
176
+ end
177
+ else # model
178
+ # models (e.g. Pet) or oneOf
179
+ klass = UltracartClient.const_get(type)
180
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
181
+ end
182
+ end
183
+
184
+ # Returns the string representation of the object
185
+ # @return [String] String presentation of the object
186
+ def to_s
187
+ to_hash.to_s
188
+ end
189
+
190
+ # to_body is an alias to to_hash (backward compatibility)
191
+ # @return [Hash] Returns the object in the form of hash
192
+ def to_body
193
+ to_hash
194
+ end
195
+
196
+ # Returns the object in the form of hash
197
+ # @return [Hash] Returns the object in the form of hash
198
+ def to_hash
199
+ hash = {}
200
+ self.class.attribute_map.each_pair do |attr, param|
201
+ value = self.send(attr)
202
+ if value.nil?
203
+ is_nullable = self.class.openapi_nullable.include?(attr)
204
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
205
+ end
206
+
207
+ hash[param] = _to_hash(value)
208
+ end
209
+ hash
210
+ end
211
+
212
+ # Outputs non-array value in the form of hash
213
+ # For object, use to_hash. Otherwise, just return the value
214
+ # @param [Object] value Any valid value
215
+ # @return [Hash] Returns the value in the form of hash
216
+ def _to_hash(value)
217
+ if value.is_a?(Array)
218
+ value.compact.map { |v| _to_hash(v) }
219
+ elsif value.is_a?(Hash)
220
+ {}.tap do |hash|
221
+ value.each { |k, v| hash[k] = _to_hash(v) }
222
+ end
223
+ elsif value.respond_to? :to_hash
224
+ value.to_hash
225
+ else
226
+ value
227
+ end
228
+ end
229
+
230
+ end
231
+
232
+ end
@@ -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