ultracart_api 4.1.252 → 4.1.253
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 +12 -2
- data/docs/SfvbApi.md +168 -2
- data/docs/SfvbApprovalParams.md +6 -0
- data/docs/SfvbPageMoveRequest.md +26 -0
- data/docs/SfvbPageMoveResponse.md +32 -0
- data/docs/SfvbPageResponse.md +4 -0
- data/docs/SfvbPageSettingsRequest.md +6 -0
- data/docs/SfvbSearchFacet.md +26 -0
- data/docs/SfvbSearchFacetUpdate.md +24 -0
- data/docs/SfvbSearchFacetsRequest.md +22 -0
- data/docs/SfvbSearchFacetsResponse.md +30 -0
- data/lib/ultracart_api/api/sfvb_api.rb +224 -4
- data/lib/ultracart_api/models/sfvb_approval_create_request.rb +2 -2
- data/lib/ultracart_api/models/sfvb_approval_params.rb +31 -1
- data/lib/ultracart_api/models/sfvb_page_move_request.rb +294 -0
- data/lib/ultracart_api/models/sfvb_page_move_response.rb +290 -0
- data/lib/ultracart_api/models/sfvb_page_response.rb +22 -1
- data/lib/ultracart_api/models/sfvb_page_settings_request.rb +65 -1
- data/lib/ultracart_api/models/sfvb_search_facet.rb +260 -0
- data/lib/ultracart_api/models/sfvb_search_facet_update.rb +250 -0
- data/lib/ultracart_api/models/sfvb_search_facets_request.rb +244 -0
- data/lib/ultracart_api/models/sfvb_search_facets_response.rb +286 -0
- data/lib/ultracart_api/version.rb +1 -1
- data/lib/ultracart_api.rb +6 -0
- metadata +14 -2
|
@@ -36,6 +36,15 @@ module UltracartClient
|
|
|
36
36
|
# S for a static page, D for a dynamic one.
|
|
37
37
|
attr_accessor :page_type
|
|
38
38
|
|
|
39
|
+
# The note on that redirect rule. Up to 500 characters. A note naming the page is used when left out.
|
|
40
|
+
attr_accessor :redirect_note
|
|
41
|
+
|
|
42
|
+
# 301 to redirect the page's address to redirect_target in the same call (#1102). Only with visible false, on a page that is visible now. The page is hidden and the rule added together, or neither.
|
|
43
|
+
attr_accessor :redirect_old_url
|
|
44
|
+
|
|
45
|
+
# Where the hidden page's address redirects to, for example /lp/summer-sale/. Required with redirect_old_url, and checked like any redirect rule.
|
|
46
|
+
attr_accessor :redirect_target
|
|
47
|
+
|
|
39
48
|
# Template that renders the item review pages under this page.
|
|
40
49
|
attr_accessor :review_template
|
|
41
50
|
|
|
@@ -57,6 +66,28 @@ module UltracartClient
|
|
|
57
66
|
# Keep the page hidden until this time (ISO 8601). Null or empty clears it.
|
|
58
67
|
attr_accessor :visible_dts
|
|
59
68
|
|
|
69
|
+
class EnumAttributeValidator
|
|
70
|
+
attr_reader :datatype
|
|
71
|
+
attr_reader :allowable_values
|
|
72
|
+
|
|
73
|
+
def initialize(datatype, allowable_values)
|
|
74
|
+
@allowable_values = allowable_values.map do |value|
|
|
75
|
+
case datatype.to_s
|
|
76
|
+
when /Integer/i
|
|
77
|
+
value.to_i
|
|
78
|
+
when /Float/i
|
|
79
|
+
value.to_f
|
|
80
|
+
else
|
|
81
|
+
value
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
def valid?(value)
|
|
87
|
+
!value || allowable_values.include?(value)
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
|
|
60
91
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
61
92
|
def self.attribute_map
|
|
62
93
|
{
|
|
@@ -67,6 +98,9 @@ module UltracartClient
|
|
|
67
98
|
:'item_template' => :'item_template',
|
|
68
99
|
:'items_per_page' => :'items_per_page',
|
|
69
100
|
:'page_type' => :'page_type',
|
|
101
|
+
:'redirect_note' => :'redirect_note',
|
|
102
|
+
:'redirect_old_url' => :'redirect_old_url',
|
|
103
|
+
:'redirect_target' => :'redirect_target',
|
|
70
104
|
:'review_template' => :'review_template',
|
|
71
105
|
:'sort_order' => :'sort_order',
|
|
72
106
|
:'sort_order_child_groups' => :'sort_order_child_groups',
|
|
@@ -92,6 +126,9 @@ module UltracartClient
|
|
|
92
126
|
:'item_template' => :'String',
|
|
93
127
|
:'items_per_page' => :'Integer',
|
|
94
128
|
:'page_type' => :'String',
|
|
129
|
+
:'redirect_note' => :'String',
|
|
130
|
+
:'redirect_old_url' => :'String',
|
|
131
|
+
:'redirect_target' => :'String',
|
|
95
132
|
:'review_template' => :'String',
|
|
96
133
|
:'sort_order' => :'Integer',
|
|
97
134
|
:'sort_order_child_groups' => :'String',
|
|
@@ -151,6 +188,18 @@ module UltracartClient
|
|
|
151
188
|
self.page_type = attributes[:'page_type']
|
|
152
189
|
end
|
|
153
190
|
|
|
191
|
+
if attributes.key?(:'redirect_note')
|
|
192
|
+
self.redirect_note = attributes[:'redirect_note']
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
if attributes.key?(:'redirect_old_url')
|
|
196
|
+
self.redirect_old_url = attributes[:'redirect_old_url']
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
if attributes.key?(:'redirect_target')
|
|
200
|
+
self.redirect_target = attributes[:'redirect_target']
|
|
201
|
+
end
|
|
202
|
+
|
|
154
203
|
if attributes.key?(:'review_template')
|
|
155
204
|
self.review_template = attributes[:'review_template']
|
|
156
205
|
end
|
|
@@ -190,9 +239,21 @@ module UltracartClient
|
|
|
190
239
|
# Check to see if the all the properties in the model are valid
|
|
191
240
|
# @return true if the model is valid
|
|
192
241
|
def valid?
|
|
242
|
+
redirect_old_url_validator = EnumAttributeValidator.new('String', ["301"])
|
|
243
|
+
return false unless redirect_old_url_validator.valid?(@redirect_old_url)
|
|
193
244
|
true
|
|
194
245
|
end
|
|
195
246
|
|
|
247
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
248
|
+
# @param [Object] redirect_old_url Object to be assigned
|
|
249
|
+
def redirect_old_url=(redirect_old_url)
|
|
250
|
+
validator = EnumAttributeValidator.new('String', ["301"])
|
|
251
|
+
unless validator.valid?(redirect_old_url)
|
|
252
|
+
fail ArgumentError, "invalid value for \"redirect_old_url\", must be one of #{validator.allowable_values}."
|
|
253
|
+
end
|
|
254
|
+
@redirect_old_url = redirect_old_url
|
|
255
|
+
end
|
|
256
|
+
|
|
196
257
|
# Checks equality by comparing each attribute.
|
|
197
258
|
# @param [Object] Object to be compared
|
|
198
259
|
def ==(o)
|
|
@@ -205,6 +266,9 @@ module UltracartClient
|
|
|
205
266
|
item_template == o.item_template &&
|
|
206
267
|
items_per_page == o.items_per_page &&
|
|
207
268
|
page_type == o.page_type &&
|
|
269
|
+
redirect_note == o.redirect_note &&
|
|
270
|
+
redirect_old_url == o.redirect_old_url &&
|
|
271
|
+
redirect_target == o.redirect_target &&
|
|
208
272
|
review_template == o.review_template &&
|
|
209
273
|
sort_order == o.sort_order &&
|
|
210
274
|
sort_order_child_groups == o.sort_order_child_groups &&
|
|
@@ -223,7 +287,7 @@ module UltracartClient
|
|
|
223
287
|
# Calculates hash code according to all attributes.
|
|
224
288
|
# @return [Integer] Hash code
|
|
225
289
|
def hash
|
|
226
|
-
[blog_post_template, description, exclude_from_sitemap, group_template, item_template, items_per_page, page_type, review_template, sort_order, sort_order_child_groups, sort_order_child_items, title, visible, visible_dts].hash
|
|
290
|
+
[blog_post_template, description, exclude_from_sitemap, group_template, item_template, items_per_page, page_type, redirect_note, redirect_old_url, redirect_target, review_template, sort_order, sort_order_child_groups, sort_order_child_items, title, visible, visible_dts].hash
|
|
227
291
|
end
|
|
228
292
|
|
|
229
293
|
# Builds the object from hash
|
|
@@ -0,0 +1,260 @@
|
|
|
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 SfvbSearchFacet
|
|
18
|
+
# True when the attribute values are comma separated lists, each value its own choice.
|
|
19
|
+
attr_accessor :csv
|
|
20
|
+
|
|
21
|
+
# The heading shoppers see for the facet.
|
|
22
|
+
attr_accessor :display_name
|
|
23
|
+
|
|
24
|
+
# True when the facet is offered to shoppers.
|
|
25
|
+
attr_accessor :enabled
|
|
26
|
+
|
|
27
|
+
# What the facet is, such as Cost or Attribute color. Fixed.
|
|
28
|
+
attr_accessor :label
|
|
29
|
+
|
|
30
|
+
# The facet key, such as facet_cost or facet_attrcolor. Fixed; this is how a change names the facet.
|
|
31
|
+
attr_accessor :name
|
|
32
|
+
|
|
33
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
34
|
+
def self.attribute_map
|
|
35
|
+
{
|
|
36
|
+
:'csv' => :'csv',
|
|
37
|
+
:'display_name' => :'display_name',
|
|
38
|
+
:'enabled' => :'enabled',
|
|
39
|
+
:'label' => :'label',
|
|
40
|
+
:'name' => :'name'
|
|
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
|
+
:'csv' => :'Boolean',
|
|
53
|
+
:'display_name' => :'String',
|
|
54
|
+
:'enabled' => :'Boolean',
|
|
55
|
+
:'label' => :'String',
|
|
56
|
+
:'name' => :'String'
|
|
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::SfvbSearchFacet` 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::SfvbSearchFacet`. 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?(:'csv')
|
|
82
|
+
self.csv = attributes[:'csv']
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
if attributes.key?(:'display_name')
|
|
86
|
+
self.display_name = attributes[:'display_name']
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
if attributes.key?(:'enabled')
|
|
90
|
+
self.enabled = attributes[:'enabled']
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
if attributes.key?(:'label')
|
|
94
|
+
self.label = attributes[:'label']
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
if attributes.key?(:'name')
|
|
98
|
+
self.name = attributes[:'name']
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
103
|
+
# @return Array for valid properties with the reasons
|
|
104
|
+
def list_invalid_properties
|
|
105
|
+
invalid_properties = Array.new
|
|
106
|
+
invalid_properties
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Check to see if the all the properties in the model are valid
|
|
110
|
+
# @return true if the model is valid
|
|
111
|
+
def valid?
|
|
112
|
+
true
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# Checks equality by comparing each attribute.
|
|
116
|
+
# @param [Object] Object to be compared
|
|
117
|
+
def ==(o)
|
|
118
|
+
return true if self.equal?(o)
|
|
119
|
+
self.class == o.class &&
|
|
120
|
+
csv == o.csv &&
|
|
121
|
+
display_name == o.display_name &&
|
|
122
|
+
enabled == o.enabled &&
|
|
123
|
+
label == o.label &&
|
|
124
|
+
name == o.name
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# @see the `==` method
|
|
128
|
+
# @param [Object] Object to be compared
|
|
129
|
+
def eql?(o)
|
|
130
|
+
self == o
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
# Calculates hash code according to all attributes.
|
|
134
|
+
# @return [Integer] Hash code
|
|
135
|
+
def hash
|
|
136
|
+
[csv, display_name, enabled, label, name].hash
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
# Builds the object from hash
|
|
140
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
141
|
+
# @return [Object] Returns the model itself
|
|
142
|
+
def self.build_from_hash(attributes)
|
|
143
|
+
new.build_from_hash(attributes)
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# Builds the object from hash
|
|
147
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
148
|
+
# @return [Object] Returns the model itself
|
|
149
|
+
def build_from_hash(attributes)
|
|
150
|
+
return nil unless attributes.is_a?(Hash)
|
|
151
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
152
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
153
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
154
|
+
self.send("#{key}=", nil)
|
|
155
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
156
|
+
# check to ensure the input is an array given that the attribute
|
|
157
|
+
# is documented as an array but the input is not
|
|
158
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
159
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
160
|
+
end
|
|
161
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
162
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
163
|
+
end
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
self
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
# Deserializes the data based on type
|
|
170
|
+
# @param string type Data type
|
|
171
|
+
# @param string value Value to be deserialized
|
|
172
|
+
# @return [Object] Deserialized data
|
|
173
|
+
def _deserialize(type, value)
|
|
174
|
+
case type.to_sym
|
|
175
|
+
when :Time
|
|
176
|
+
Time.parse(value)
|
|
177
|
+
when :Date
|
|
178
|
+
Date.parse(value)
|
|
179
|
+
when :String
|
|
180
|
+
value.to_s
|
|
181
|
+
when :Integer
|
|
182
|
+
value.to_i
|
|
183
|
+
when :Float
|
|
184
|
+
value.to_f
|
|
185
|
+
when :Boolean
|
|
186
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
187
|
+
true
|
|
188
|
+
else
|
|
189
|
+
false
|
|
190
|
+
end
|
|
191
|
+
when :Object
|
|
192
|
+
# generic object (usually a Hash), return directly
|
|
193
|
+
value
|
|
194
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
195
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
196
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
197
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
198
|
+
k_type = Regexp.last_match[:k_type]
|
|
199
|
+
v_type = Regexp.last_match[:v_type]
|
|
200
|
+
{}.tap do |hash|
|
|
201
|
+
value.each do |k, v|
|
|
202
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
203
|
+
end
|
|
204
|
+
end
|
|
205
|
+
else # model
|
|
206
|
+
# models (e.g. Pet) or oneOf
|
|
207
|
+
klass = UltracartClient.const_get(type)
|
|
208
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
209
|
+
end
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
# Returns the string representation of the object
|
|
213
|
+
# @return [String] String presentation of the object
|
|
214
|
+
def to_s
|
|
215
|
+
to_hash.to_s
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
219
|
+
# @return [Hash] Returns the object in the form of hash
|
|
220
|
+
def to_body
|
|
221
|
+
to_hash
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
# Returns the object in the form of hash
|
|
225
|
+
# @return [Hash] Returns the object in the form of hash
|
|
226
|
+
def to_hash
|
|
227
|
+
hash = {}
|
|
228
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
229
|
+
value = self.send(attr)
|
|
230
|
+
if value.nil?
|
|
231
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
232
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
hash[param] = _to_hash(value)
|
|
236
|
+
end
|
|
237
|
+
hash
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
# Outputs non-array value in the form of hash
|
|
241
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
242
|
+
# @param [Object] value Any valid value
|
|
243
|
+
# @return [Hash] Returns the value in the form of hash
|
|
244
|
+
def _to_hash(value)
|
|
245
|
+
if value.is_a?(Array)
|
|
246
|
+
value.compact.map { |v| _to_hash(v) }
|
|
247
|
+
elsif value.is_a?(Hash)
|
|
248
|
+
{}.tap do |hash|
|
|
249
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
250
|
+
end
|
|
251
|
+
elsif value.respond_to? :to_hash
|
|
252
|
+
value.to_hash
|
|
253
|
+
else
|
|
254
|
+
value
|
|
255
|
+
end
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
end
|
|
@@ -0,0 +1,250 @@
|
|
|
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 SfvbSearchFacetUpdate
|
|
18
|
+
# True when the attribute values are comma separated lists.
|
|
19
|
+
attr_accessor :csv
|
|
20
|
+
|
|
21
|
+
# The heading shoppers see, 1 to 100 characters, without angle brackets.
|
|
22
|
+
attr_accessor :display_name
|
|
23
|
+
|
|
24
|
+
# True to offer the facet to shoppers, false to stop.
|
|
25
|
+
attr_accessor :enabled
|
|
26
|
+
|
|
27
|
+
# The facet to change, a name from GET search/facets. Required.
|
|
28
|
+
attr_accessor :name
|
|
29
|
+
|
|
30
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
31
|
+
def self.attribute_map
|
|
32
|
+
{
|
|
33
|
+
:'csv' => :'csv',
|
|
34
|
+
:'display_name' => :'display_name',
|
|
35
|
+
:'enabled' => :'enabled',
|
|
36
|
+
:'name' => :'name'
|
|
37
|
+
}
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Returns all the JSON keys this model knows about
|
|
41
|
+
def self.acceptable_attributes
|
|
42
|
+
attribute_map.values
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Attribute type mapping.
|
|
46
|
+
def self.openapi_types
|
|
47
|
+
{
|
|
48
|
+
:'csv' => :'Boolean',
|
|
49
|
+
:'display_name' => :'String',
|
|
50
|
+
:'enabled' => :'Boolean',
|
|
51
|
+
:'name' => :'String'
|
|
52
|
+
}
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# List of attributes with nullable: true
|
|
56
|
+
def self.openapi_nullable
|
|
57
|
+
Set.new([
|
|
58
|
+
])
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Initializes the object
|
|
62
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
63
|
+
def initialize(attributes = {})
|
|
64
|
+
if (!attributes.is_a?(Hash))
|
|
65
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbSearchFacetUpdate` initialize method"
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
69
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
70
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
71
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbSearchFacetUpdate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
72
|
+
end
|
|
73
|
+
h[k.to_sym] = v
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if attributes.key?(:'csv')
|
|
77
|
+
self.csv = attributes[:'csv']
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
if attributes.key?(:'display_name')
|
|
81
|
+
self.display_name = attributes[:'display_name']
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
if attributes.key?(:'enabled')
|
|
85
|
+
self.enabled = attributes[:'enabled']
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
if attributes.key?(:'name')
|
|
89
|
+
self.name = attributes[:'name']
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
94
|
+
# @return Array for valid properties with the reasons
|
|
95
|
+
def list_invalid_properties
|
|
96
|
+
invalid_properties = Array.new
|
|
97
|
+
invalid_properties
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Check to see if the all the properties in the model are valid
|
|
101
|
+
# @return true if the model is valid
|
|
102
|
+
def valid?
|
|
103
|
+
true
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Checks equality by comparing each attribute.
|
|
107
|
+
# @param [Object] Object to be compared
|
|
108
|
+
def ==(o)
|
|
109
|
+
return true if self.equal?(o)
|
|
110
|
+
self.class == o.class &&
|
|
111
|
+
csv == o.csv &&
|
|
112
|
+
display_name == o.display_name &&
|
|
113
|
+
enabled == o.enabled &&
|
|
114
|
+
name == o.name
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# @see the `==` method
|
|
118
|
+
# @param [Object] Object to be compared
|
|
119
|
+
def eql?(o)
|
|
120
|
+
self == o
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
# Calculates hash code according to all attributes.
|
|
124
|
+
# @return [Integer] Hash code
|
|
125
|
+
def hash
|
|
126
|
+
[csv, display_name, enabled, name].hash
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
# Builds the object from hash
|
|
130
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
131
|
+
# @return [Object] Returns the model itself
|
|
132
|
+
def self.build_from_hash(attributes)
|
|
133
|
+
new.build_from_hash(attributes)
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
# Builds the object from hash
|
|
137
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
138
|
+
# @return [Object] Returns the model itself
|
|
139
|
+
def build_from_hash(attributes)
|
|
140
|
+
return nil unless attributes.is_a?(Hash)
|
|
141
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
142
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
143
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
144
|
+
self.send("#{key}=", nil)
|
|
145
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
146
|
+
# check to ensure the input is an array given that the attribute
|
|
147
|
+
# is documented as an array but the input is not
|
|
148
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
149
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
150
|
+
end
|
|
151
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
152
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
153
|
+
end
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
self
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
# Deserializes the data based on type
|
|
160
|
+
# @param string type Data type
|
|
161
|
+
# @param string value Value to be deserialized
|
|
162
|
+
# @return [Object] Deserialized data
|
|
163
|
+
def _deserialize(type, value)
|
|
164
|
+
case type.to_sym
|
|
165
|
+
when :Time
|
|
166
|
+
Time.parse(value)
|
|
167
|
+
when :Date
|
|
168
|
+
Date.parse(value)
|
|
169
|
+
when :String
|
|
170
|
+
value.to_s
|
|
171
|
+
when :Integer
|
|
172
|
+
value.to_i
|
|
173
|
+
when :Float
|
|
174
|
+
value.to_f
|
|
175
|
+
when :Boolean
|
|
176
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
177
|
+
true
|
|
178
|
+
else
|
|
179
|
+
false
|
|
180
|
+
end
|
|
181
|
+
when :Object
|
|
182
|
+
# generic object (usually a Hash), return directly
|
|
183
|
+
value
|
|
184
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
185
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
186
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
187
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
188
|
+
k_type = Regexp.last_match[:k_type]
|
|
189
|
+
v_type = Regexp.last_match[:v_type]
|
|
190
|
+
{}.tap do |hash|
|
|
191
|
+
value.each do |k, v|
|
|
192
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
193
|
+
end
|
|
194
|
+
end
|
|
195
|
+
else # model
|
|
196
|
+
# models (e.g. Pet) or oneOf
|
|
197
|
+
klass = UltracartClient.const_get(type)
|
|
198
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
199
|
+
end
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
# Returns the string representation of the object
|
|
203
|
+
# @return [String] String presentation of the object
|
|
204
|
+
def to_s
|
|
205
|
+
to_hash.to_s
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
209
|
+
# @return [Hash] Returns the object in the form of hash
|
|
210
|
+
def to_body
|
|
211
|
+
to_hash
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
# Returns the object in the form of hash
|
|
215
|
+
# @return [Hash] Returns the object in the form of hash
|
|
216
|
+
def to_hash
|
|
217
|
+
hash = {}
|
|
218
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
219
|
+
value = self.send(attr)
|
|
220
|
+
if value.nil?
|
|
221
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
222
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
hash[param] = _to_hash(value)
|
|
226
|
+
end
|
|
227
|
+
hash
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
# Outputs non-array value in the form of hash
|
|
231
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
232
|
+
# @param [Object] value Any valid value
|
|
233
|
+
# @return [Hash] Returns the value in the form of hash
|
|
234
|
+
def _to_hash(value)
|
|
235
|
+
if value.is_a?(Array)
|
|
236
|
+
value.compact.map { |v| _to_hash(v) }
|
|
237
|
+
elsif value.is_a?(Hash)
|
|
238
|
+
{}.tap do |hash|
|
|
239
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
240
|
+
end
|
|
241
|
+
elsif value.respond_to? :to_hash
|
|
242
|
+
value.to_hash
|
|
243
|
+
else
|
|
244
|
+
value
|
|
245
|
+
end
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
end
|