ultracart_api 4.1.260 → 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.
- checksums.yaml +4 -4
- data/README.md +15 -2
- data/docs/FraudApi.md +2 -2
- data/docs/OrderApi.md +84 -2
- data/docs/SfvbApi.md +224 -0
- data/docs/SfvbApprovalCreateRequest.md +2 -0
- data/docs/SfvbItemTranslation.md +28 -0
- data/docs/SfvbItemTranslationBatchRequest.md +20 -0
- data/docs/SfvbItemTranslationBatchResponse.md +46 -0
- data/docs/SfvbItemTranslationBatchRow.md +28 -0
- data/docs/SfvbItemTranslationBatchRowResult.md +34 -0
- data/docs/SfvbItemTranslationField.md +22 -0
- data/docs/SfvbItemTranslationWriteRequest.md +26 -0
- data/docs/SfvbItemTranslationsResponse.md +26 -0
- data/lib/ultracart_api/api/fraud_api.rb +4 -4
- data/lib/ultracart_api/api/sfvb_api.rb +308 -0
- data/lib/ultracart_api/models/sfvb_approval_create_request.rb +15 -3
- data/lib/ultracart_api/models/sfvb_item_translation.rb +316 -0
- data/lib/ultracart_api/models/sfvb_item_translation_batch_request.rb +232 -0
- data/lib/ultracart_api/models/sfvb_item_translation_batch_response.rb +366 -0
- data/lib/ultracart_api/models/sfvb_item_translation_batch_row.rb +304 -0
- data/lib/ultracart_api/models/sfvb_item_translation_batch_row_result.rb +346 -0
- data/lib/ultracart_api/models/sfvb_item_translation_field.rb +276 -0
- data/lib/ultracart_api/models/sfvb_item_translation_write_request.rb +294 -0
- data/lib/ultracart_api/models/sfvb_item_translations_response.rb +264 -0
- data/lib/ultracart_api/version.rb +1 -1
- data/lib/ultracart_api.rb +8 -0
- metadata +18 -2
|
@@ -0,0 +1,294 @@
|
|
|
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 SfvbItemTranslationWriteRequest
|
|
18
|
+
# title or extended_description.
|
|
19
|
+
attr_accessor :field
|
|
20
|
+
|
|
21
|
+
# The language code, such as CHI, or its two-letter code. Must be enabled on the storefront.
|
|
22
|
+
attr_accessor :language
|
|
23
|
+
|
|
24
|
+
# The item by its merchant item id.
|
|
25
|
+
attr_accessor :merchant_item_id
|
|
26
|
+
|
|
27
|
+
# The item. Send this or merchant_item_id, not both.
|
|
28
|
+
attr_accessor :merchant_item_oid
|
|
29
|
+
|
|
30
|
+
# The hand translation. An empty string removes the translation in both stores so machine translation fills it again.
|
|
31
|
+
attr_accessor :text
|
|
32
|
+
|
|
33
|
+
class EnumAttributeValidator
|
|
34
|
+
attr_reader :datatype
|
|
35
|
+
attr_reader :allowable_values
|
|
36
|
+
|
|
37
|
+
def initialize(datatype, allowable_values)
|
|
38
|
+
@allowable_values = allowable_values.map do |value|
|
|
39
|
+
case datatype.to_s
|
|
40
|
+
when /Integer/i
|
|
41
|
+
value.to_i
|
|
42
|
+
when /Float/i
|
|
43
|
+
value.to_f
|
|
44
|
+
else
|
|
45
|
+
value
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def valid?(value)
|
|
51
|
+
!value || allowable_values.include?(value)
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
56
|
+
def self.attribute_map
|
|
57
|
+
{
|
|
58
|
+
:'field' => :'field',
|
|
59
|
+
:'language' => :'language',
|
|
60
|
+
:'merchant_item_id' => :'merchant_item_id',
|
|
61
|
+
:'merchant_item_oid' => :'merchant_item_oid',
|
|
62
|
+
:'text' => :'text'
|
|
63
|
+
}
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Returns all the JSON keys this model knows about
|
|
67
|
+
def self.acceptable_attributes
|
|
68
|
+
attribute_map.values
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Attribute type mapping.
|
|
72
|
+
def self.openapi_types
|
|
73
|
+
{
|
|
74
|
+
:'field' => :'String',
|
|
75
|
+
:'language' => :'String',
|
|
76
|
+
:'merchant_item_id' => :'String',
|
|
77
|
+
:'merchant_item_oid' => :'Integer',
|
|
78
|
+
:'text' => :'String'
|
|
79
|
+
}
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# List of attributes with nullable: true
|
|
83
|
+
def self.openapi_nullable
|
|
84
|
+
Set.new([
|
|
85
|
+
])
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Initializes the object
|
|
89
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
90
|
+
def initialize(attributes = {})
|
|
91
|
+
if (!attributes.is_a?(Hash))
|
|
92
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbItemTranslationWriteRequest` initialize method"
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
96
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
97
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
98
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbItemTranslationWriteRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
99
|
+
end
|
|
100
|
+
h[k.to_sym] = v
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
if attributes.key?(:'field')
|
|
104
|
+
self.field = attributes[:'field']
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
if attributes.key?(:'language')
|
|
108
|
+
self.language = attributes[:'language']
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
if attributes.key?(:'merchant_item_id')
|
|
112
|
+
self.merchant_item_id = attributes[:'merchant_item_id']
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
if attributes.key?(:'merchant_item_oid')
|
|
116
|
+
self.merchant_item_oid = attributes[:'merchant_item_oid']
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
if attributes.key?(:'text')
|
|
120
|
+
self.text = attributes[:'text']
|
|
121
|
+
end
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
125
|
+
# @return Array for valid properties with the reasons
|
|
126
|
+
def list_invalid_properties
|
|
127
|
+
invalid_properties = Array.new
|
|
128
|
+
invalid_properties
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# Check to see if the all the properties in the model are valid
|
|
132
|
+
# @return true if the model is valid
|
|
133
|
+
def valid?
|
|
134
|
+
field_validator = EnumAttributeValidator.new('String', ["title", "extended_description"])
|
|
135
|
+
return false unless field_validator.valid?(@field)
|
|
136
|
+
true
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
140
|
+
# @param [Object] field Object to be assigned
|
|
141
|
+
def field=(field)
|
|
142
|
+
validator = EnumAttributeValidator.new('String', ["title", "extended_description"])
|
|
143
|
+
unless validator.valid?(field)
|
|
144
|
+
fail ArgumentError, "invalid value for \"field\", must be one of #{validator.allowable_values}."
|
|
145
|
+
end
|
|
146
|
+
@field = field
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# Checks equality by comparing each attribute.
|
|
150
|
+
# @param [Object] Object to be compared
|
|
151
|
+
def ==(o)
|
|
152
|
+
return true if self.equal?(o)
|
|
153
|
+
self.class == o.class &&
|
|
154
|
+
field == o.field &&
|
|
155
|
+
language == o.language &&
|
|
156
|
+
merchant_item_id == o.merchant_item_id &&
|
|
157
|
+
merchant_item_oid == o.merchant_item_oid &&
|
|
158
|
+
text == o.text
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
# @see the `==` method
|
|
162
|
+
# @param [Object] Object to be compared
|
|
163
|
+
def eql?(o)
|
|
164
|
+
self == o
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
# Calculates hash code according to all attributes.
|
|
168
|
+
# @return [Integer] Hash code
|
|
169
|
+
def hash
|
|
170
|
+
[field, language, merchant_item_id, merchant_item_oid, text].hash
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
# Builds the object from hash
|
|
174
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
175
|
+
# @return [Object] Returns the model itself
|
|
176
|
+
def self.build_from_hash(attributes)
|
|
177
|
+
new.build_from_hash(attributes)
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
# Builds the object from hash
|
|
181
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
182
|
+
# @return [Object] Returns the model itself
|
|
183
|
+
def build_from_hash(attributes)
|
|
184
|
+
return nil unless attributes.is_a?(Hash)
|
|
185
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
186
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
187
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
188
|
+
self.send("#{key}=", nil)
|
|
189
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
190
|
+
# check to ensure the input is an array given that the attribute
|
|
191
|
+
# is documented as an array but the input is not
|
|
192
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
193
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
194
|
+
end
|
|
195
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
196
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
197
|
+
end
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
self
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
# Deserializes the data based on type
|
|
204
|
+
# @param string type Data type
|
|
205
|
+
# @param string value Value to be deserialized
|
|
206
|
+
# @return [Object] Deserialized data
|
|
207
|
+
def _deserialize(type, value)
|
|
208
|
+
case type.to_sym
|
|
209
|
+
when :Time
|
|
210
|
+
Time.parse(value)
|
|
211
|
+
when :Date
|
|
212
|
+
Date.parse(value)
|
|
213
|
+
when :String
|
|
214
|
+
value.to_s
|
|
215
|
+
when :Integer
|
|
216
|
+
value.to_i
|
|
217
|
+
when :Float
|
|
218
|
+
value.to_f
|
|
219
|
+
when :Boolean
|
|
220
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
221
|
+
true
|
|
222
|
+
else
|
|
223
|
+
false
|
|
224
|
+
end
|
|
225
|
+
when :Object
|
|
226
|
+
# generic object (usually a Hash), return directly
|
|
227
|
+
value
|
|
228
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
229
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
230
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
231
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
232
|
+
k_type = Regexp.last_match[:k_type]
|
|
233
|
+
v_type = Regexp.last_match[:v_type]
|
|
234
|
+
{}.tap do |hash|
|
|
235
|
+
value.each do |k, v|
|
|
236
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
237
|
+
end
|
|
238
|
+
end
|
|
239
|
+
else # model
|
|
240
|
+
# models (e.g. Pet) or oneOf
|
|
241
|
+
klass = UltracartClient.const_get(type)
|
|
242
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
243
|
+
end
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
# Returns the string representation of the object
|
|
247
|
+
# @return [String] String presentation of the object
|
|
248
|
+
def to_s
|
|
249
|
+
to_hash.to_s
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
253
|
+
# @return [Hash] Returns the object in the form of hash
|
|
254
|
+
def to_body
|
|
255
|
+
to_hash
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
# Returns the object in the form of hash
|
|
259
|
+
# @return [Hash] Returns the object in the form of hash
|
|
260
|
+
def to_hash
|
|
261
|
+
hash = {}
|
|
262
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
263
|
+
value = self.send(attr)
|
|
264
|
+
if value.nil?
|
|
265
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
266
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
267
|
+
end
|
|
268
|
+
|
|
269
|
+
hash[param] = _to_hash(value)
|
|
270
|
+
end
|
|
271
|
+
hash
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
# Outputs non-array value in the form of hash
|
|
275
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
276
|
+
# @param [Object] value Any valid value
|
|
277
|
+
# @return [Hash] Returns the value in the form of hash
|
|
278
|
+
def _to_hash(value)
|
|
279
|
+
if value.is_a?(Array)
|
|
280
|
+
value.compact.map { |v| _to_hash(v) }
|
|
281
|
+
elsif value.is_a?(Hash)
|
|
282
|
+
{}.tap do |hash|
|
|
283
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
284
|
+
end
|
|
285
|
+
elsif value.respond_to? :to_hash
|
|
286
|
+
value.to_hash
|
|
287
|
+
else
|
|
288
|
+
value
|
|
289
|
+
end
|
|
290
|
+
end
|
|
291
|
+
|
|
292
|
+
end
|
|
293
|
+
|
|
294
|
+
end
|
|
@@ -0,0 +1,264 @@
|
|
|
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 SfvbItemTranslationsResponse
|
|
18
|
+
# title, then extended_description.
|
|
19
|
+
attr_accessor :fields
|
|
20
|
+
|
|
21
|
+
# Over the English and every reported language of both fields. Send it as If-Match to change a translation.
|
|
22
|
+
attr_accessor :hash_sha256
|
|
23
|
+
|
|
24
|
+
# The languages reported - the storefront's enabled languages other than English, or the one asked for.
|
|
25
|
+
attr_accessor :languages
|
|
26
|
+
|
|
27
|
+
# The item's merchant item id.
|
|
28
|
+
attr_accessor :merchant_item_id
|
|
29
|
+
|
|
30
|
+
# The item.
|
|
31
|
+
attr_accessor :merchant_item_oid
|
|
32
|
+
|
|
33
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
34
|
+
def self.attribute_map
|
|
35
|
+
{
|
|
36
|
+
:'fields' => :'fields',
|
|
37
|
+
:'hash_sha256' => :'hash_sha256',
|
|
38
|
+
:'languages' => :'languages',
|
|
39
|
+
:'merchant_item_id' => :'merchant_item_id',
|
|
40
|
+
:'merchant_item_oid' => :'merchant_item_oid'
|
|
41
|
+
}
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# Returns all the JSON keys this model knows about
|
|
45
|
+
def self.acceptable_attributes
|
|
46
|
+
attribute_map.values
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# Attribute type mapping.
|
|
50
|
+
def self.openapi_types
|
|
51
|
+
{
|
|
52
|
+
:'fields' => :'Array<SfvbItemTranslationField>',
|
|
53
|
+
:'hash_sha256' => :'String',
|
|
54
|
+
:'languages' => :'Array<String>',
|
|
55
|
+
:'merchant_item_id' => :'String',
|
|
56
|
+
:'merchant_item_oid' => :'Integer'
|
|
57
|
+
}
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# List of attributes with nullable: true
|
|
61
|
+
def self.openapi_nullable
|
|
62
|
+
Set.new([
|
|
63
|
+
])
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Initializes the object
|
|
67
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
68
|
+
def initialize(attributes = {})
|
|
69
|
+
if (!attributes.is_a?(Hash))
|
|
70
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbItemTranslationsResponse` initialize method"
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
74
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
75
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
76
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbItemTranslationsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
77
|
+
end
|
|
78
|
+
h[k.to_sym] = v
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if attributes.key?(:'fields')
|
|
82
|
+
if (value = attributes[:'fields']).is_a?(Array)
|
|
83
|
+
self.fields = value
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
if attributes.key?(:'hash_sha256')
|
|
88
|
+
self.hash_sha256 = attributes[:'hash_sha256']
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
if attributes.key?(:'languages')
|
|
92
|
+
if (value = attributes[:'languages']).is_a?(Array)
|
|
93
|
+
self.languages = value
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
if attributes.key?(:'merchant_item_id')
|
|
98
|
+
self.merchant_item_id = attributes[:'merchant_item_id']
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
if attributes.key?(:'merchant_item_oid')
|
|
102
|
+
self.merchant_item_oid = attributes[:'merchant_item_oid']
|
|
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
|
+
true
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# Checks equality by comparing each attribute.
|
|
120
|
+
# @param [Object] Object to be compared
|
|
121
|
+
def ==(o)
|
|
122
|
+
return true if self.equal?(o)
|
|
123
|
+
self.class == o.class &&
|
|
124
|
+
fields == o.fields &&
|
|
125
|
+
hash_sha256 == o.hash_sha256 &&
|
|
126
|
+
languages == o.languages &&
|
|
127
|
+
merchant_item_id == o.merchant_item_id &&
|
|
128
|
+
merchant_item_oid == o.merchant_item_oid
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# @see the `==` method
|
|
132
|
+
# @param [Object] Object to be compared
|
|
133
|
+
def eql?(o)
|
|
134
|
+
self == o
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# Calculates hash code according to all attributes.
|
|
138
|
+
# @return [Integer] Hash code
|
|
139
|
+
def hash
|
|
140
|
+
[fields, hash_sha256, languages, merchant_item_id, merchant_item_oid].hash
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# Builds the object from hash
|
|
144
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
145
|
+
# @return [Object] Returns the model itself
|
|
146
|
+
def self.build_from_hash(attributes)
|
|
147
|
+
new.build_from_hash(attributes)
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
# Builds the object from hash
|
|
151
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
152
|
+
# @return [Object] Returns the model itself
|
|
153
|
+
def build_from_hash(attributes)
|
|
154
|
+
return nil unless attributes.is_a?(Hash)
|
|
155
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
156
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
157
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
158
|
+
self.send("#{key}=", nil)
|
|
159
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
160
|
+
# check to ensure the input is an array given that the attribute
|
|
161
|
+
# is documented as an array but the input is not
|
|
162
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
163
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
164
|
+
end
|
|
165
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
166
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
167
|
+
end
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
self
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
# Deserializes the data based on type
|
|
174
|
+
# @param string type Data type
|
|
175
|
+
# @param string value Value to be deserialized
|
|
176
|
+
# @return [Object] Deserialized data
|
|
177
|
+
def _deserialize(type, value)
|
|
178
|
+
case type.to_sym
|
|
179
|
+
when :Time
|
|
180
|
+
Time.parse(value)
|
|
181
|
+
when :Date
|
|
182
|
+
Date.parse(value)
|
|
183
|
+
when :String
|
|
184
|
+
value.to_s
|
|
185
|
+
when :Integer
|
|
186
|
+
value.to_i
|
|
187
|
+
when :Float
|
|
188
|
+
value.to_f
|
|
189
|
+
when :Boolean
|
|
190
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
191
|
+
true
|
|
192
|
+
else
|
|
193
|
+
false
|
|
194
|
+
end
|
|
195
|
+
when :Object
|
|
196
|
+
# generic object (usually a Hash), return directly
|
|
197
|
+
value
|
|
198
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
199
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
200
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
201
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
202
|
+
k_type = Regexp.last_match[:k_type]
|
|
203
|
+
v_type = Regexp.last_match[:v_type]
|
|
204
|
+
{}.tap do |hash|
|
|
205
|
+
value.each do |k, v|
|
|
206
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
207
|
+
end
|
|
208
|
+
end
|
|
209
|
+
else # model
|
|
210
|
+
# models (e.g. Pet) or oneOf
|
|
211
|
+
klass = UltracartClient.const_get(type)
|
|
212
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
213
|
+
end
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
# Returns the string representation of the object
|
|
217
|
+
# @return [String] String presentation of the object
|
|
218
|
+
def to_s
|
|
219
|
+
to_hash.to_s
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
223
|
+
# @return [Hash] Returns the object in the form of hash
|
|
224
|
+
def to_body
|
|
225
|
+
to_hash
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
# Returns the object in the form of hash
|
|
229
|
+
# @return [Hash] Returns the object in the form of hash
|
|
230
|
+
def to_hash
|
|
231
|
+
hash = {}
|
|
232
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
233
|
+
value = self.send(attr)
|
|
234
|
+
if value.nil?
|
|
235
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
236
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
hash[param] = _to_hash(value)
|
|
240
|
+
end
|
|
241
|
+
hash
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
# Outputs non-array value in the form of hash
|
|
245
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
246
|
+
# @param [Object] value Any valid value
|
|
247
|
+
# @return [Hash] Returns the value in the form of hash
|
|
248
|
+
def _to_hash(value)
|
|
249
|
+
if value.is_a?(Array)
|
|
250
|
+
value.compact.map { |v| _to_hash(v) }
|
|
251
|
+
elsif value.is_a?(Hash)
|
|
252
|
+
{}.tap do |hash|
|
|
253
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
254
|
+
end
|
|
255
|
+
elsif value.respond_to? :to_hash
|
|
256
|
+
value.to_hash
|
|
257
|
+
else
|
|
258
|
+
value
|
|
259
|
+
end
|
|
260
|
+
end
|
|
261
|
+
|
|
262
|
+
end
|
|
263
|
+
|
|
264
|
+
end
|
data/lib/ultracart_api.rb
CHANGED
|
@@ -1180,6 +1180,14 @@ require 'ultracart_api/models/sfvb_item_response'
|
|
|
1180
1180
|
require 'ultracart_api/models/sfvb_item_seo'
|
|
1181
1181
|
require 'ultracart_api/models/sfvb_item_seo_request'
|
|
1182
1182
|
require 'ultracart_api/models/sfvb_item_tags'
|
|
1183
|
+
require 'ultracart_api/models/sfvb_item_translation'
|
|
1184
|
+
require 'ultracart_api/models/sfvb_item_translation_batch_request'
|
|
1185
|
+
require 'ultracart_api/models/sfvb_item_translation_batch_response'
|
|
1186
|
+
require 'ultracart_api/models/sfvb_item_translation_batch_row'
|
|
1187
|
+
require 'ultracart_api/models/sfvb_item_translation_batch_row_result'
|
|
1188
|
+
require 'ultracart_api/models/sfvb_item_translation_field'
|
|
1189
|
+
require 'ultracart_api/models/sfvb_item_translation_write_request'
|
|
1190
|
+
require 'ultracart_api/models/sfvb_item_translations_response'
|
|
1183
1191
|
require 'ultracart_api/models/sfvb_item_variation_axis'
|
|
1184
1192
|
require 'ultracart_api/models/sfvb_item_variation_change'
|
|
1185
1193
|
require 'ultracart_api/models/sfvb_item_variation_change_result'
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ultracart_api
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.1.
|
|
4
|
+
version: 4.1.261
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- UltraCart
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-11-
|
|
11
|
+
date: 2026-11-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: typhoeus
|
|
@@ -1242,6 +1242,14 @@ files:
|
|
|
1242
1242
|
- docs/SfvbItemSeo.md
|
|
1243
1243
|
- docs/SfvbItemSeoRequest.md
|
|
1244
1244
|
- docs/SfvbItemTags.md
|
|
1245
|
+
- docs/SfvbItemTranslation.md
|
|
1246
|
+
- docs/SfvbItemTranslationBatchRequest.md
|
|
1247
|
+
- docs/SfvbItemTranslationBatchResponse.md
|
|
1248
|
+
- docs/SfvbItemTranslationBatchRow.md
|
|
1249
|
+
- docs/SfvbItemTranslationBatchRowResult.md
|
|
1250
|
+
- docs/SfvbItemTranslationField.md
|
|
1251
|
+
- docs/SfvbItemTranslationWriteRequest.md
|
|
1252
|
+
- docs/SfvbItemTranslationsResponse.md
|
|
1245
1253
|
- docs/SfvbItemVariationAxis.md
|
|
1246
1254
|
- docs/SfvbItemVariationChange.md
|
|
1247
1255
|
- docs/SfvbItemVariationChangeResult.md
|
|
@@ -2762,6 +2770,14 @@ files:
|
|
|
2762
2770
|
- lib/ultracart_api/models/sfvb_item_seo.rb
|
|
2763
2771
|
- lib/ultracart_api/models/sfvb_item_seo_request.rb
|
|
2764
2772
|
- lib/ultracart_api/models/sfvb_item_tags.rb
|
|
2773
|
+
- lib/ultracart_api/models/sfvb_item_translation.rb
|
|
2774
|
+
- lib/ultracart_api/models/sfvb_item_translation_batch_request.rb
|
|
2775
|
+
- lib/ultracart_api/models/sfvb_item_translation_batch_response.rb
|
|
2776
|
+
- lib/ultracart_api/models/sfvb_item_translation_batch_row.rb
|
|
2777
|
+
- lib/ultracart_api/models/sfvb_item_translation_batch_row_result.rb
|
|
2778
|
+
- lib/ultracart_api/models/sfvb_item_translation_field.rb
|
|
2779
|
+
- lib/ultracart_api/models/sfvb_item_translation_write_request.rb
|
|
2780
|
+
- lib/ultracart_api/models/sfvb_item_translations_response.rb
|
|
2765
2781
|
- lib/ultracart_api/models/sfvb_item_variation_axis.rb
|
|
2766
2782
|
- lib/ultracart_api/models/sfvb_item_variation_change.rb
|
|
2767
2783
|
- lib/ultracart_api/models/sfvb_item_variation_change_result.rb
|