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,272 @@
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 SfvbItemRelated
18
+ # The hash of the above. Send it as If-Match to change them.
19
+ attr_accessor :hash_sha256
20
+
21
+ # The item's merchant item id.
22
+ attr_accessor :merchant_item_id
23
+
24
+ # The item.
25
+ attr_accessor :merchant_item_oid
26
+
27
+ # True when UltraCart does not calculate related items for this item.
28
+ attr_accessor :no_system_calculated_related_items
29
+
30
+ # True when this item is never shown as related to another.
31
+ attr_accessor :not_relatable
32
+
33
+ # In stored order - the merchant's own (user, addon, complementary) and UltraCart's calculated ones (system).
34
+ attr_accessor :related_items
35
+
36
+ # Attribute mapping from ruby-style variable name to JSON key.
37
+ def self.attribute_map
38
+ {
39
+ :'hash_sha256' => :'hash_sha256',
40
+ :'merchant_item_id' => :'merchant_item_id',
41
+ :'merchant_item_oid' => :'merchant_item_oid',
42
+ :'no_system_calculated_related_items' => :'no_system_calculated_related_items',
43
+ :'not_relatable' => :'not_relatable',
44
+ :'related_items' => :'related_items'
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
+ :'hash_sha256' => :'String',
57
+ :'merchant_item_id' => :'String',
58
+ :'merchant_item_oid' => :'Integer',
59
+ :'no_system_calculated_related_items' => :'Boolean',
60
+ :'not_relatable' => :'Boolean',
61
+ :'related_items' => :'Array<SfvbItemRelatedItem>'
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::SfvbItemRelated` 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::SfvbItemRelated`. 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?(:'hash_sha256')
87
+ self.hash_sha256 = attributes[:'hash_sha256']
88
+ end
89
+
90
+ if attributes.key?(:'merchant_item_id')
91
+ self.merchant_item_id = attributes[:'merchant_item_id']
92
+ end
93
+
94
+ if attributes.key?(:'merchant_item_oid')
95
+ self.merchant_item_oid = attributes[:'merchant_item_oid']
96
+ end
97
+
98
+ if attributes.key?(:'no_system_calculated_related_items')
99
+ self.no_system_calculated_related_items = attributes[:'no_system_calculated_related_items']
100
+ end
101
+
102
+ if attributes.key?(:'not_relatable')
103
+ self.not_relatable = attributes[:'not_relatable']
104
+ end
105
+
106
+ if attributes.key?(:'related_items')
107
+ if (value = attributes[:'related_items']).is_a?(Array)
108
+ self.related_items = value
109
+ end
110
+ end
111
+ end
112
+
113
+ # Show invalid properties with the reasons. Usually used together with valid?
114
+ # @return Array for valid properties with the reasons
115
+ def list_invalid_properties
116
+ invalid_properties = Array.new
117
+ invalid_properties
118
+ end
119
+
120
+ # Check to see if the all the properties in the model are valid
121
+ # @return true if the model is valid
122
+ def valid?
123
+ true
124
+ end
125
+
126
+ # Checks equality by comparing each attribute.
127
+ # @param [Object] Object to be compared
128
+ def ==(o)
129
+ return true if self.equal?(o)
130
+ self.class == o.class &&
131
+ hash_sha256 == o.hash_sha256 &&
132
+ merchant_item_id == o.merchant_item_id &&
133
+ merchant_item_oid == o.merchant_item_oid &&
134
+ no_system_calculated_related_items == o.no_system_calculated_related_items &&
135
+ not_relatable == o.not_relatable &&
136
+ related_items == o.related_items
137
+ end
138
+
139
+ # @see the `==` method
140
+ # @param [Object] Object to be compared
141
+ def eql?(o)
142
+ self == o
143
+ end
144
+
145
+ # Calculates hash code according to all attributes.
146
+ # @return [Integer] Hash code
147
+ def hash
148
+ [hash_sha256, merchant_item_id, merchant_item_oid, no_system_calculated_related_items, not_relatable, related_items].hash
149
+ end
150
+
151
+ # Builds the object from hash
152
+ # @param [Hash] attributes Model attributes in the form of hash
153
+ # @return [Object] Returns the model itself
154
+ def self.build_from_hash(attributes)
155
+ new.build_from_hash(attributes)
156
+ end
157
+
158
+ # Builds the object from hash
159
+ # @param [Hash] attributes Model attributes in the form of hash
160
+ # @return [Object] Returns the model itself
161
+ def build_from_hash(attributes)
162
+ return nil unless attributes.is_a?(Hash)
163
+ attributes = attributes.transform_keys(&:to_sym)
164
+ self.class.openapi_types.each_pair do |key, type|
165
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
166
+ self.send("#{key}=", nil)
167
+ elsif type =~ /\AArray<(.*)>/i
168
+ # check to ensure the input is an array given that the attribute
169
+ # is documented as an array but the input is not
170
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
171
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
172
+ end
173
+ elsif !attributes[self.class.attribute_map[key]].nil?
174
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
175
+ end
176
+ end
177
+
178
+ self
179
+ end
180
+
181
+ # Deserializes the data based on type
182
+ # @param string type Data type
183
+ # @param string value Value to be deserialized
184
+ # @return [Object] Deserialized data
185
+ def _deserialize(type, value)
186
+ case type.to_sym
187
+ when :Time
188
+ Time.parse(value)
189
+ when :Date
190
+ Date.parse(value)
191
+ when :String
192
+ value.to_s
193
+ when :Integer
194
+ value.to_i
195
+ when :Float
196
+ value.to_f
197
+ when :Boolean
198
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
199
+ true
200
+ else
201
+ false
202
+ end
203
+ when :Object
204
+ # generic object (usually a Hash), return directly
205
+ value
206
+ when /\AArray<(?<inner_type>.+)>\z/
207
+ inner_type = Regexp.last_match[:inner_type]
208
+ value.map { |v| _deserialize(inner_type, v) }
209
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
210
+ k_type = Regexp.last_match[:k_type]
211
+ v_type = Regexp.last_match[:v_type]
212
+ {}.tap do |hash|
213
+ value.each do |k, v|
214
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
215
+ end
216
+ end
217
+ else # model
218
+ # models (e.g. Pet) or oneOf
219
+ klass = UltracartClient.const_get(type)
220
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
221
+ end
222
+ end
223
+
224
+ # Returns the string representation of the object
225
+ # @return [String] String presentation of the object
226
+ def to_s
227
+ to_hash.to_s
228
+ end
229
+
230
+ # to_body is an alias to to_hash (backward compatibility)
231
+ # @return [Hash] Returns the object in the form of hash
232
+ def to_body
233
+ to_hash
234
+ end
235
+
236
+ # Returns the object in the form of hash
237
+ # @return [Hash] Returns the object in the form of hash
238
+ def to_hash
239
+ hash = {}
240
+ self.class.attribute_map.each_pair do |attr, param|
241
+ value = self.send(attr)
242
+ if value.nil?
243
+ is_nullable = self.class.openapi_nullable.include?(attr)
244
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
245
+ end
246
+
247
+ hash[param] = _to_hash(value)
248
+ end
249
+ hash
250
+ end
251
+
252
+ # Outputs non-array value in the form of hash
253
+ # For object, use to_hash. Otherwise, just return the value
254
+ # @param [Object] value Any valid value
255
+ # @return [Hash] Returns the value in the form of hash
256
+ def _to_hash(value)
257
+ if value.is_a?(Array)
258
+ value.compact.map { |v| _to_hash(v) }
259
+ elsif value.is_a?(Hash)
260
+ {}.tap do |hash|
261
+ value.each { |k, v| hash[k] = _to_hash(v) }
262
+ end
263
+ elsif value.respond_to? :to_hash
264
+ value.to_hash
265
+ else
266
+ value
267
+ end
268
+ end
269
+
270
+ end
271
+
272
+ 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 SfvbItemRelatedItem
18
+ # The related item. On a write, send this or merchant_item_oid.
19
+ attr_accessor :merchant_item_id
20
+
21
+ # The related item's oid.
22
+ attr_accessor :merchant_item_oid
23
+
24
+ # user (the default on a write), addon or complementary. system marks one UltraCart calculated and other a kind this API does not change. Both are read only and kept by a write.
25
+ attr_accessor :type
26
+
27
+ class EnumAttributeValidator
28
+ attr_reader :datatype
29
+ attr_reader :allowable_values
30
+
31
+ def initialize(datatype, allowable_values)
32
+ @allowable_values = allowable_values.map do |value|
33
+ case datatype.to_s
34
+ when /Integer/i
35
+ value.to_i
36
+ when /Float/i
37
+ value.to_f
38
+ else
39
+ value
40
+ end
41
+ end
42
+ end
43
+
44
+ def valid?(value)
45
+ !value || allowable_values.include?(value)
46
+ end
47
+ end
48
+
49
+ # Attribute mapping from ruby-style variable name to JSON key.
50
+ def self.attribute_map
51
+ {
52
+ :'merchant_item_id' => :'merchant_item_id',
53
+ :'merchant_item_oid' => :'merchant_item_oid',
54
+ :'type' => :'type'
55
+ }
56
+ end
57
+
58
+ # Returns all the JSON keys this model knows about
59
+ def self.acceptable_attributes
60
+ attribute_map.values
61
+ end
62
+
63
+ # Attribute type mapping.
64
+ def self.openapi_types
65
+ {
66
+ :'merchant_item_id' => :'String',
67
+ :'merchant_item_oid' => :'Integer',
68
+ :'type' => :'String'
69
+ }
70
+ end
71
+
72
+ # List of attributes with nullable: true
73
+ def self.openapi_nullable
74
+ Set.new([
75
+ ])
76
+ end
77
+
78
+ # Initializes the object
79
+ # @param [Hash] attributes Model attributes in the form of hash
80
+ def initialize(attributes = {})
81
+ if (!attributes.is_a?(Hash))
82
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbItemRelatedItem` initialize method"
83
+ end
84
+
85
+ # check to see if the attribute exists and convert string to symbol for hash key
86
+ attributes = attributes.each_with_object({}) { |(k, v), h|
87
+ if (!self.class.attribute_map.key?(k.to_sym))
88
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbItemRelatedItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
89
+ end
90
+ h[k.to_sym] = v
91
+ }
92
+
93
+ if attributes.key?(:'merchant_item_id')
94
+ self.merchant_item_id = attributes[:'merchant_item_id']
95
+ end
96
+
97
+ if attributes.key?(:'merchant_item_oid')
98
+ self.merchant_item_oid = attributes[:'merchant_item_oid']
99
+ end
100
+
101
+ if attributes.key?(:'type')
102
+ self.type = attributes[:'type']
103
+ end
104
+ end
105
+
106
+ # Show invalid properties with the reasons. Usually used together with valid?
107
+ # @return Array for valid properties with the reasons
108
+ def list_invalid_properties
109
+ invalid_properties = Array.new
110
+ invalid_properties
111
+ end
112
+
113
+ # Check to see if the all the properties in the model are valid
114
+ # @return true if the model is valid
115
+ def valid?
116
+ type_validator = EnumAttributeValidator.new('String', ["user", "addon", "complementary", "system", "other"])
117
+ return false unless type_validator.valid?(@type)
118
+ true
119
+ end
120
+
121
+ # Custom attribute writer method checking allowed values (enum).
122
+ # @param [Object] type Object to be assigned
123
+ def type=(type)
124
+ validator = EnumAttributeValidator.new('String', ["user", "addon", "complementary", "system", "other"])
125
+ unless validator.valid?(type)
126
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
127
+ end
128
+ @type = type
129
+ end
130
+
131
+ # Checks equality by comparing each attribute.
132
+ # @param [Object] Object to be compared
133
+ def ==(o)
134
+ return true if self.equal?(o)
135
+ self.class == o.class &&
136
+ merchant_item_id == o.merchant_item_id &&
137
+ merchant_item_oid == o.merchant_item_oid &&
138
+ type == o.type
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
+ [merchant_item_id, merchant_item_oid, type].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