ultracart_api 4.1.259 → 4.1.261

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