ultracart_api 4.1.239 → 4.1.240
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 +27 -2
- data/docs/SfvbApi.md +337 -0
- data/docs/SfvbApprovalCreateRequest.md +4 -0
- data/docs/SfvbItemChildCreateRequest.md +26 -0
- data/docs/SfvbItemChildCreateResponse.md +36 -0
- data/docs/SfvbItemDefaultPageRequest.md +20 -0
- data/docs/SfvbItemDefaultPageResponse.md +36 -0
- data/docs/SfvbItemDefaultPageResult.md +40 -0
- data/docs/SfvbItemDefaultPageRow.md +28 -0
- data/docs/SfvbItemPageAssignment.md +28 -0
- data/docs/SfvbItemPages.md +28 -0
- data/docs/SfvbItemVariationAxis.md +22 -0
- data/docs/SfvbItemVariationChange.md +40 -0
- data/docs/SfvbItemVariationChangeResult.md +24 -0
- data/docs/SfvbItemVariationChild.md +22 -0
- data/docs/SfvbItemVariationCombination.md +24 -0
- data/docs/SfvbItemVariationOption.md +22 -0
- data/docs/SfvbItemVariationValue.md +20 -0
- data/docs/SfvbItemVariations.md +30 -0
- data/docs/SfvbItemVariationsRequest.md +20 -0
- data/docs/SfvbItemVariationsResponse.md +38 -0
- data/lib/ultracart_api/api/sfvb_api.rb +459 -0
- data/lib/ultracart_api/models/sfvb_approval_create_request.rb +24 -3
- data/lib/ultracart_api/models/sfvb_item_child_create_request.rb +260 -0
- data/lib/ultracart_api/models/sfvb_item_child_create_response.rb +309 -0
- data/lib/ultracart_api/models/sfvb_item_default_page_request.rb +232 -0
- data/lib/ultracart_api/models/sfvb_item_default_page_response.rb +312 -0
- data/lib/ultracart_api/models/sfvb_item_default_page_result.rb +330 -0
- data/lib/ultracart_api/models/sfvb_item_default_page_row.rb +270 -0
- data/lib/ultracart_api/models/sfvb_item_page_assignment.rb +270 -0
- data/lib/ultracart_api/models/sfvb_item_pages.rb +274 -0
- data/lib/ultracart_api/models/sfvb_item_variation_axis.rb +242 -0
- data/lib/ultracart_api/models/sfvb_item_variation_change.rb +334 -0
- data/lib/ultracart_api/models/sfvb_item_variation_change_result.rb +250 -0
- data/lib/ultracart_api/models/sfvb_item_variation_child.rb +240 -0
- data/lib/ultracart_api/models/sfvb_item_variation_combination.rb +251 -0
- data/lib/ultracart_api/models/sfvb_item_variation_option.rb +240 -0
- data/lib/ultracart_api/models/sfvb_item_variation_value.rb +230 -0
- data/lib/ultracart_api/models/sfvb_item_variations.rb +284 -0
- data/lib/ultracart_api/models/sfvb_item_variations_request.rb +232 -0
- data/lib/ultracart_api/models/sfvb_item_variations_response.rb +328 -0
- data/lib/ultracart_api/version.rb +1 -1
- data/lib/ultracart_api.rb +18 -0
- metadata +37 -1
|
@@ -0,0 +1,242 @@
|
|
|
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 SfvbItemVariationAxis
|
|
18
|
+
# The prompt shown before a choice, such as Choose a size, or null.
|
|
19
|
+
attr_accessor :default_text
|
|
20
|
+
|
|
21
|
+
# The axis name, such as Size.
|
|
22
|
+
attr_accessor :name
|
|
23
|
+
|
|
24
|
+
# The options, in the order shoppers see them.
|
|
25
|
+
attr_accessor :options
|
|
26
|
+
|
|
27
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
28
|
+
def self.attribute_map
|
|
29
|
+
{
|
|
30
|
+
:'default_text' => :'default_text',
|
|
31
|
+
:'name' => :'name',
|
|
32
|
+
:'options' => :'options'
|
|
33
|
+
}
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Returns all the JSON keys this model knows about
|
|
37
|
+
def self.acceptable_attributes
|
|
38
|
+
attribute_map.values
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Attribute type mapping.
|
|
42
|
+
def self.openapi_types
|
|
43
|
+
{
|
|
44
|
+
:'default_text' => :'String',
|
|
45
|
+
:'name' => :'String',
|
|
46
|
+
:'options' => :'Array<SfvbItemVariationOption>'
|
|
47
|
+
}
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# List of attributes with nullable: true
|
|
51
|
+
def self.openapi_nullable
|
|
52
|
+
Set.new([
|
|
53
|
+
])
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Initializes the object
|
|
57
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
58
|
+
def initialize(attributes = {})
|
|
59
|
+
if (!attributes.is_a?(Hash))
|
|
60
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbItemVariationAxis` initialize method"
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
64
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
65
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
66
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbItemVariationAxis`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
67
|
+
end
|
|
68
|
+
h[k.to_sym] = v
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if attributes.key?(:'default_text')
|
|
72
|
+
self.default_text = attributes[:'default_text']
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
if attributes.key?(:'name')
|
|
76
|
+
self.name = attributes[:'name']
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
if attributes.key?(:'options')
|
|
80
|
+
if (value = attributes[:'options']).is_a?(Array)
|
|
81
|
+
self.options = value
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
87
|
+
# @return Array for valid properties with the reasons
|
|
88
|
+
def list_invalid_properties
|
|
89
|
+
invalid_properties = Array.new
|
|
90
|
+
invalid_properties
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Check to see if the all the properties in the model are valid
|
|
94
|
+
# @return true if the model is valid
|
|
95
|
+
def valid?
|
|
96
|
+
true
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Checks equality by comparing each attribute.
|
|
100
|
+
# @param [Object] Object to be compared
|
|
101
|
+
def ==(o)
|
|
102
|
+
return true if self.equal?(o)
|
|
103
|
+
self.class == o.class &&
|
|
104
|
+
default_text == o.default_text &&
|
|
105
|
+
name == o.name &&
|
|
106
|
+
options == o.options
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# @see the `==` method
|
|
110
|
+
# @param [Object] Object to be compared
|
|
111
|
+
def eql?(o)
|
|
112
|
+
self == o
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# Calculates hash code according to all attributes.
|
|
116
|
+
# @return [Integer] Hash code
|
|
117
|
+
def hash
|
|
118
|
+
[default_text, name, options].hash
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# Builds the object from hash
|
|
122
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
123
|
+
# @return [Object] Returns the model itself
|
|
124
|
+
def self.build_from_hash(attributes)
|
|
125
|
+
new.build_from_hash(attributes)
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# Builds the object from hash
|
|
129
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
130
|
+
# @return [Object] Returns the model itself
|
|
131
|
+
def build_from_hash(attributes)
|
|
132
|
+
return nil unless attributes.is_a?(Hash)
|
|
133
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
134
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
135
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
136
|
+
self.send("#{key}=", nil)
|
|
137
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
138
|
+
# check to ensure the input is an array given that the attribute
|
|
139
|
+
# is documented as an array but the input is not
|
|
140
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
141
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
142
|
+
end
|
|
143
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
144
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
145
|
+
end
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
self
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
# Deserializes the data based on type
|
|
152
|
+
# @param string type Data type
|
|
153
|
+
# @param string value Value to be deserialized
|
|
154
|
+
# @return [Object] Deserialized data
|
|
155
|
+
def _deserialize(type, value)
|
|
156
|
+
case type.to_sym
|
|
157
|
+
when :Time
|
|
158
|
+
Time.parse(value)
|
|
159
|
+
when :Date
|
|
160
|
+
Date.parse(value)
|
|
161
|
+
when :String
|
|
162
|
+
value.to_s
|
|
163
|
+
when :Integer
|
|
164
|
+
value.to_i
|
|
165
|
+
when :Float
|
|
166
|
+
value.to_f
|
|
167
|
+
when :Boolean
|
|
168
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
169
|
+
true
|
|
170
|
+
else
|
|
171
|
+
false
|
|
172
|
+
end
|
|
173
|
+
when :Object
|
|
174
|
+
# generic object (usually a Hash), return directly
|
|
175
|
+
value
|
|
176
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
177
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
178
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
179
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
180
|
+
k_type = Regexp.last_match[:k_type]
|
|
181
|
+
v_type = Regexp.last_match[:v_type]
|
|
182
|
+
{}.tap do |hash|
|
|
183
|
+
value.each do |k, v|
|
|
184
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
185
|
+
end
|
|
186
|
+
end
|
|
187
|
+
else # model
|
|
188
|
+
# models (e.g. Pet) or oneOf
|
|
189
|
+
klass = UltracartClient.const_get(type)
|
|
190
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
191
|
+
end
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
# Returns the string representation of the object
|
|
195
|
+
# @return [String] String presentation of the object
|
|
196
|
+
def to_s
|
|
197
|
+
to_hash.to_s
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
201
|
+
# @return [Hash] Returns the object in the form of hash
|
|
202
|
+
def to_body
|
|
203
|
+
to_hash
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
# Returns the object in the form of hash
|
|
207
|
+
# @return [Hash] Returns the object in the form of hash
|
|
208
|
+
def to_hash
|
|
209
|
+
hash = {}
|
|
210
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
211
|
+
value = self.send(attr)
|
|
212
|
+
if value.nil?
|
|
213
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
214
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
hash[param] = _to_hash(value)
|
|
218
|
+
end
|
|
219
|
+
hash
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
# Outputs non-array value in the form of hash
|
|
223
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
224
|
+
# @param [Object] value Any valid value
|
|
225
|
+
# @return [Hash] Returns the value in the form of hash
|
|
226
|
+
def _to_hash(value)
|
|
227
|
+
if value.is_a?(Array)
|
|
228
|
+
value.compact.map { |v| _to_hash(v) }
|
|
229
|
+
elsif value.is_a?(Hash)
|
|
230
|
+
{}.tap do |hash|
|
|
231
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
232
|
+
end
|
|
233
|
+
elsif value.respond_to? :to_hash
|
|
234
|
+
value.to_hash
|
|
235
|
+
else
|
|
236
|
+
value
|
|
237
|
+
end
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
end
|
|
@@ -0,0 +1,334 @@
|
|
|
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 SfvbItemVariationChange
|
|
18
|
+
# The axis the change is about.
|
|
19
|
+
attr_accessor :axis
|
|
20
|
+
|
|
21
|
+
# add_option puts the new option before this one. Otherwise it goes last.
|
|
22
|
+
attr_accessor :before
|
|
23
|
+
|
|
24
|
+
# set_combination - the child item id, or null to clear the combination.
|
|
25
|
+
attr_accessor :child
|
|
26
|
+
|
|
27
|
+
# add_option and add_axis make the option the default.
|
|
28
|
+
attr_accessor :default
|
|
29
|
+
|
|
30
|
+
# The prompt, for add_axis and set_default_text. Null clears it.
|
|
31
|
+
attr_accessor :default_text
|
|
32
|
+
|
|
33
|
+
# An image of the parent item. For set_option_multimedia null clears it; for set_combination null keeps the current one.
|
|
34
|
+
attr_accessor :multimedia_oid
|
|
35
|
+
|
|
36
|
+
# add_axis, remove_axis, rename_axis, add_option, remove_option, rename_option, reorder_options, set_default, set_default_text, set_option_multimedia or set_combination.
|
|
37
|
+
attr_accessor :op
|
|
38
|
+
|
|
39
|
+
# set_combination - how many of the child the combination adds. Defaults to 1.
|
|
40
|
+
attr_accessor :quantity
|
|
41
|
+
|
|
42
|
+
# The new name, for rename_axis and rename_option.
|
|
43
|
+
attr_accessor :to
|
|
44
|
+
|
|
45
|
+
# The option the change is about.
|
|
46
|
+
attr_accessor :value
|
|
47
|
+
|
|
48
|
+
# add_axis options in order, or every option in its new order for reorder_options.
|
|
49
|
+
attr_accessor :values
|
|
50
|
+
|
|
51
|
+
# set_combination - one axis and option per axis.
|
|
52
|
+
attr_accessor :variation_values
|
|
53
|
+
|
|
54
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
55
|
+
def self.attribute_map
|
|
56
|
+
{
|
|
57
|
+
:'axis' => :'axis',
|
|
58
|
+
:'before' => :'before',
|
|
59
|
+
:'child' => :'child',
|
|
60
|
+
:'default' => :'default',
|
|
61
|
+
:'default_text' => :'default_text',
|
|
62
|
+
:'multimedia_oid' => :'multimedia_oid',
|
|
63
|
+
:'op' => :'op',
|
|
64
|
+
:'quantity' => :'quantity',
|
|
65
|
+
:'to' => :'to',
|
|
66
|
+
:'value' => :'value',
|
|
67
|
+
:'values' => :'values',
|
|
68
|
+
:'variation_values' => :'variation_values'
|
|
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
|
+
:'axis' => :'String',
|
|
81
|
+
:'before' => :'String',
|
|
82
|
+
:'child' => :'String',
|
|
83
|
+
:'default' => :'Boolean',
|
|
84
|
+
:'default_text' => :'String',
|
|
85
|
+
:'multimedia_oid' => :'Integer',
|
|
86
|
+
:'op' => :'String',
|
|
87
|
+
:'quantity' => :'Integer',
|
|
88
|
+
:'to' => :'String',
|
|
89
|
+
:'value' => :'String',
|
|
90
|
+
:'values' => :'Array<String>',
|
|
91
|
+
:'variation_values' => :'Array<SfvbItemVariationValue>'
|
|
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::SfvbItemVariationChange` 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::SfvbItemVariationChange`. 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?(:'axis')
|
|
117
|
+
self.axis = attributes[:'axis']
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
if attributes.key?(:'before')
|
|
121
|
+
self.before = attributes[:'before']
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
if attributes.key?(:'child')
|
|
125
|
+
self.child = attributes[:'child']
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
if attributes.key?(:'default')
|
|
129
|
+
self.default = attributes[:'default']
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
if attributes.key?(:'default_text')
|
|
133
|
+
self.default_text = attributes[:'default_text']
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
if attributes.key?(:'multimedia_oid')
|
|
137
|
+
self.multimedia_oid = attributes[:'multimedia_oid']
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
if attributes.key?(:'op')
|
|
141
|
+
self.op = attributes[:'op']
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
if attributes.key?(:'quantity')
|
|
145
|
+
self.quantity = attributes[:'quantity']
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
if attributes.key?(:'to')
|
|
149
|
+
self.to = attributes[:'to']
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
if attributes.key?(:'value')
|
|
153
|
+
self.value = attributes[:'value']
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
if attributes.key?(:'values')
|
|
157
|
+
if (value = attributes[:'values']).is_a?(Array)
|
|
158
|
+
self.values = value
|
|
159
|
+
end
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
if attributes.key?(:'variation_values')
|
|
163
|
+
if (value = attributes[:'variation_values']).is_a?(Array)
|
|
164
|
+
self.variation_values = value
|
|
165
|
+
end
|
|
166
|
+
end
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
170
|
+
# @return Array for valid properties with the reasons
|
|
171
|
+
def list_invalid_properties
|
|
172
|
+
invalid_properties = Array.new
|
|
173
|
+
invalid_properties
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
# Check to see if the all the properties in the model are valid
|
|
177
|
+
# @return true if the model is valid
|
|
178
|
+
def valid?
|
|
179
|
+
true
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
# Checks equality by comparing each attribute.
|
|
183
|
+
# @param [Object] Object to be compared
|
|
184
|
+
def ==(o)
|
|
185
|
+
return true if self.equal?(o)
|
|
186
|
+
self.class == o.class &&
|
|
187
|
+
axis == o.axis &&
|
|
188
|
+
before == o.before &&
|
|
189
|
+
child == o.child &&
|
|
190
|
+
default == o.default &&
|
|
191
|
+
default_text == o.default_text &&
|
|
192
|
+
multimedia_oid == o.multimedia_oid &&
|
|
193
|
+
op == o.op &&
|
|
194
|
+
quantity == o.quantity &&
|
|
195
|
+
to == o.to &&
|
|
196
|
+
value == o.value &&
|
|
197
|
+
values == o.values &&
|
|
198
|
+
variation_values == o.variation_values
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
# @see the `==` method
|
|
202
|
+
# @param [Object] Object to be compared
|
|
203
|
+
def eql?(o)
|
|
204
|
+
self == o
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
# Calculates hash code according to all attributes.
|
|
208
|
+
# @return [Integer] Hash code
|
|
209
|
+
def hash
|
|
210
|
+
[axis, before, child, default, default_text, multimedia_oid, op, quantity, to, value, values, variation_values].hash
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
# Builds the object from hash
|
|
214
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
215
|
+
# @return [Object] Returns the model itself
|
|
216
|
+
def self.build_from_hash(attributes)
|
|
217
|
+
new.build_from_hash(attributes)
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
# Builds the object from hash
|
|
221
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
222
|
+
# @return [Object] Returns the model itself
|
|
223
|
+
def build_from_hash(attributes)
|
|
224
|
+
return nil unless attributes.is_a?(Hash)
|
|
225
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
226
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
227
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
228
|
+
self.send("#{key}=", nil)
|
|
229
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
230
|
+
# check to ensure the input is an array given that the attribute
|
|
231
|
+
# is documented as an array but the input is not
|
|
232
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
233
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
234
|
+
end
|
|
235
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
236
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
237
|
+
end
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
self
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
# Deserializes the data based on type
|
|
244
|
+
# @param string type Data type
|
|
245
|
+
# @param string value Value to be deserialized
|
|
246
|
+
# @return [Object] Deserialized data
|
|
247
|
+
def _deserialize(type, value)
|
|
248
|
+
case type.to_sym
|
|
249
|
+
when :Time
|
|
250
|
+
Time.parse(value)
|
|
251
|
+
when :Date
|
|
252
|
+
Date.parse(value)
|
|
253
|
+
when :String
|
|
254
|
+
value.to_s
|
|
255
|
+
when :Integer
|
|
256
|
+
value.to_i
|
|
257
|
+
when :Float
|
|
258
|
+
value.to_f
|
|
259
|
+
when :Boolean
|
|
260
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
261
|
+
true
|
|
262
|
+
else
|
|
263
|
+
false
|
|
264
|
+
end
|
|
265
|
+
when :Object
|
|
266
|
+
# generic object (usually a Hash), return directly
|
|
267
|
+
value
|
|
268
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
269
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
270
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
271
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
272
|
+
k_type = Regexp.last_match[:k_type]
|
|
273
|
+
v_type = Regexp.last_match[:v_type]
|
|
274
|
+
{}.tap do |hash|
|
|
275
|
+
value.each do |k, v|
|
|
276
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
277
|
+
end
|
|
278
|
+
end
|
|
279
|
+
else # model
|
|
280
|
+
# models (e.g. Pet) or oneOf
|
|
281
|
+
klass = UltracartClient.const_get(type)
|
|
282
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
283
|
+
end
|
|
284
|
+
end
|
|
285
|
+
|
|
286
|
+
# Returns the string representation of the object
|
|
287
|
+
# @return [String] String presentation of the object
|
|
288
|
+
def to_s
|
|
289
|
+
to_hash.to_s
|
|
290
|
+
end
|
|
291
|
+
|
|
292
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
293
|
+
# @return [Hash] Returns the object in the form of hash
|
|
294
|
+
def to_body
|
|
295
|
+
to_hash
|
|
296
|
+
end
|
|
297
|
+
|
|
298
|
+
# Returns the object in the form of hash
|
|
299
|
+
# @return [Hash] Returns the object in the form of hash
|
|
300
|
+
def to_hash
|
|
301
|
+
hash = {}
|
|
302
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
303
|
+
value = self.send(attr)
|
|
304
|
+
if value.nil?
|
|
305
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
306
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
307
|
+
end
|
|
308
|
+
|
|
309
|
+
hash[param] = _to_hash(value)
|
|
310
|
+
end
|
|
311
|
+
hash
|
|
312
|
+
end
|
|
313
|
+
|
|
314
|
+
# Outputs non-array value in the form of hash
|
|
315
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
316
|
+
# @param [Object] value Any valid value
|
|
317
|
+
# @return [Hash] Returns the value in the form of hash
|
|
318
|
+
def _to_hash(value)
|
|
319
|
+
if value.is_a?(Array)
|
|
320
|
+
value.compact.map { |v| _to_hash(v) }
|
|
321
|
+
elsif value.is_a?(Hash)
|
|
322
|
+
{}.tap do |hash|
|
|
323
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
324
|
+
end
|
|
325
|
+
elsif value.respond_to? :to_hash
|
|
326
|
+
value.to_hash
|
|
327
|
+
else
|
|
328
|
+
value
|
|
329
|
+
end
|
|
330
|
+
end
|
|
331
|
+
|
|
332
|
+
end
|
|
333
|
+
|
|
334
|
+
end
|