ultracart_api 4.1.159 → 4.1.161
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 +50 -2
- data/docs/SfvbApi.md +1123 -10
- data/docs/SfvbBlogPost.md +30 -0
- data/docs/SfvbBlogPostsResponse.md +24 -0
- data/docs/SfvbExperiment.md +36 -0
- data/docs/SfvbExperimentEndRequest.md +18 -0
- data/docs/SfvbExperimentObjective.md +24 -0
- data/docs/SfvbExperimentObjectivesResponse.md +18 -0
- data/docs/SfvbExperimentStartRequest.md +40 -0
- data/docs/SfvbExperimentStartVariation.md +22 -0
- data/docs/SfvbExperimentVariationUpdateRequest.md +18 -0
- data/docs/SfvbExperimentsResponse.md +18 -0
- data/docs/SfvbPageBlogPostSelector.md +26 -0
- data/docs/SfvbPageBlogPostsRequest.md +18 -0
- data/docs/SfvbPageBlogPostsResponse.md +22 -0
- data/docs/SfvbPageCreateRequest.md +34 -0
- data/docs/SfvbPageDuplicateRequest.md +22 -0
- data/docs/SfvbPageItem.md +26 -0
- data/docs/SfvbPageItemSelector.md +42 -0
- data/docs/SfvbPageItemsAddRequest.md +18 -0
- data/docs/SfvbPageItemsRemoveRequest.md +18 -0
- data/docs/SfvbPageItemsResponse.md +24 -0
- data/docs/SfvbPageListResponse.md +18 -0
- data/docs/SfvbPageResponse.md +13 -1
- data/docs/SfvbPageSelectors.md +26 -0
- data/docs/SfvbPageSettingsRequest.md +44 -0
- data/docs/SfvbPageSummary.md +44 -0
- data/docs/SfvbTemplate.md +36 -0
- data/docs/SfvbTemplatesResponse.md +20 -0
- data/lib/ultracart_api/api/sfvb_api.rb +1722 -211
- data/lib/ultracart_api/models/sfvb_blog_post.rb +280 -0
- data/lib/ultracart_api/models/sfvb_blog_posts_response.rb +252 -0
- data/lib/ultracart_api/models/sfvb_experiment.rb +309 -0
- data/lib/ultracart_api/models/sfvb_experiment_end_request.rb +220 -0
- data/lib/ultracart_api/models/sfvb_experiment_objective.rb +250 -0
- data/lib/ultracart_api/models/sfvb_experiment_objectives_response.rb +222 -0
- data/lib/ultracart_api/models/sfvb_experiment_start_request.rb +332 -0
- data/lib/ultracart_api/models/sfvb_experiment_start_variation.rb +240 -0
- data/lib/ultracart_api/models/sfvb_experiment_variation_update_request.rb +220 -0
- data/lib/ultracart_api/models/sfvb_experiments_response.rb +222 -0
- data/lib/ultracart_api/models/sfvb_page_blog_post_selector.rb +260 -0
- data/lib/ultracart_api/models/sfvb_page_blog_posts_request.rb +222 -0
- data/lib/ultracart_api/models/sfvb_page_blog_posts_response.rb +242 -0
- data/lib/ultracart_api/models/sfvb_page_create_request.rb +300 -0
- data/lib/ultracart_api/models/sfvb_page_duplicate_request.rb +240 -0
- data/lib/ultracart_api/models/sfvb_page_item.rb +260 -0
- data/lib/ultracart_api/models/sfvb_page_item_selector.rb +340 -0
- data/lib/ultracart_api/models/sfvb_page_items_add_request.rb +222 -0
- data/lib/ultracart_api/models/sfvb_page_items_remove_request.rb +222 -0
- data/lib/ultracart_api/models/sfvb_page_items_response.rb +252 -0
- data/lib/ultracart_api/models/sfvb_page_list_response.rb +222 -0
- data/lib/ultracart_api/models/sfvb_page_response.rb +64 -4
- data/lib/ultracart_api/models/sfvb_page_selectors.rb +264 -0
- data/lib/ultracart_api/models/sfvb_page_settings_request.rb +350 -0
- data/lib/ultracart_api/models/sfvb_page_summary.rb +350 -0
- data/lib/ultracart_api/models/sfvb_template.rb +310 -0
- data/lib/ultracart_api/models/sfvb_templates_response.rb +232 -0
- data/lib/ultracart_api/version.rb +1 -1
- data/lib/ultracart_api.rb +26 -0
- metadata +53 -1
|
@@ -0,0 +1,310 @@
|
|
|
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 SfvbTemplate
|
|
18
|
+
# True when the template shows the page's blog posts.
|
|
19
|
+
attr_accessor :display_blog_posts
|
|
20
|
+
|
|
21
|
+
# True when the template shows the page's items.
|
|
22
|
+
attr_accessor :display_items
|
|
23
|
+
|
|
24
|
+
# True when the template shows the pages under this one.
|
|
25
|
+
attr_accessor :display_subgroups
|
|
26
|
+
|
|
27
|
+
# False when the template has no metadata, so the capability flags below are unknown.
|
|
28
|
+
attr_accessor :metadata_available
|
|
29
|
+
|
|
30
|
+
# The bare file name. This is the value a page's group_template or item_template holds.
|
|
31
|
+
attr_accessor :name
|
|
32
|
+
|
|
33
|
+
# The page type the template declares, such as group, item or static. system for the fixed templates the storefront itself uses, such as checkout and my account. Null when the template has no metadata.
|
|
34
|
+
attr_accessor :page_type
|
|
35
|
+
|
|
36
|
+
# True when the template pages through a long list of items.
|
|
37
|
+
attr_accessor :pagination
|
|
38
|
+
|
|
39
|
+
# True for the fixed templates the storefront itself uses. Never assign one to a page.
|
|
40
|
+
attr_accessor :system
|
|
41
|
+
|
|
42
|
+
# Where the file sits inside the theme.
|
|
43
|
+
attr_accessor :theme_relative_path
|
|
44
|
+
|
|
45
|
+
# True when the template renders visual builder containers.
|
|
46
|
+
attr_accessor :visual_builder
|
|
47
|
+
|
|
48
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
49
|
+
def self.attribute_map
|
|
50
|
+
{
|
|
51
|
+
:'display_blog_posts' => :'display_blog_posts',
|
|
52
|
+
:'display_items' => :'display_items',
|
|
53
|
+
:'display_subgroups' => :'display_subgroups',
|
|
54
|
+
:'metadata_available' => :'metadata_available',
|
|
55
|
+
:'name' => :'name',
|
|
56
|
+
:'page_type' => :'page_type',
|
|
57
|
+
:'pagination' => :'pagination',
|
|
58
|
+
:'system' => :'system',
|
|
59
|
+
:'theme_relative_path' => :'theme_relative_path',
|
|
60
|
+
:'visual_builder' => :'visual_builder'
|
|
61
|
+
}
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Returns all the JSON keys this model knows about
|
|
65
|
+
def self.acceptable_attributes
|
|
66
|
+
attribute_map.values
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# Attribute type mapping.
|
|
70
|
+
def self.openapi_types
|
|
71
|
+
{
|
|
72
|
+
:'display_blog_posts' => :'Boolean',
|
|
73
|
+
:'display_items' => :'Boolean',
|
|
74
|
+
:'display_subgroups' => :'Boolean',
|
|
75
|
+
:'metadata_available' => :'Boolean',
|
|
76
|
+
:'name' => :'String',
|
|
77
|
+
:'page_type' => :'String',
|
|
78
|
+
:'pagination' => :'Boolean',
|
|
79
|
+
:'system' => :'Boolean',
|
|
80
|
+
:'theme_relative_path' => :'String',
|
|
81
|
+
:'visual_builder' => :'Boolean'
|
|
82
|
+
}
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# List of attributes with nullable: true
|
|
86
|
+
def self.openapi_nullable
|
|
87
|
+
Set.new([
|
|
88
|
+
])
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# Initializes the object
|
|
92
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
93
|
+
def initialize(attributes = {})
|
|
94
|
+
if (!attributes.is_a?(Hash))
|
|
95
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbTemplate` initialize method"
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
99
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
100
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
101
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbTemplate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
102
|
+
end
|
|
103
|
+
h[k.to_sym] = v
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
if attributes.key?(:'display_blog_posts')
|
|
107
|
+
self.display_blog_posts = attributes[:'display_blog_posts']
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
if attributes.key?(:'display_items')
|
|
111
|
+
self.display_items = attributes[:'display_items']
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
if attributes.key?(:'display_subgroups')
|
|
115
|
+
self.display_subgroups = attributes[:'display_subgroups']
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
if attributes.key?(:'metadata_available')
|
|
119
|
+
self.metadata_available = attributes[:'metadata_available']
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
if attributes.key?(:'name')
|
|
123
|
+
self.name = attributes[:'name']
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
if attributes.key?(:'page_type')
|
|
127
|
+
self.page_type = attributes[:'page_type']
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
if attributes.key?(:'pagination')
|
|
131
|
+
self.pagination = attributes[:'pagination']
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
if attributes.key?(:'system')
|
|
135
|
+
self.system = attributes[:'system']
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
if attributes.key?(:'theme_relative_path')
|
|
139
|
+
self.theme_relative_path = attributes[:'theme_relative_path']
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
if attributes.key?(:'visual_builder')
|
|
143
|
+
self.visual_builder = attributes[:'visual_builder']
|
|
144
|
+
end
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
148
|
+
# @return Array for valid properties with the reasons
|
|
149
|
+
def list_invalid_properties
|
|
150
|
+
invalid_properties = Array.new
|
|
151
|
+
invalid_properties
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
# Check to see if the all the properties in the model are valid
|
|
155
|
+
# @return true if the model is valid
|
|
156
|
+
def valid?
|
|
157
|
+
true
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
# Checks equality by comparing each attribute.
|
|
161
|
+
# @param [Object] Object to be compared
|
|
162
|
+
def ==(o)
|
|
163
|
+
return true if self.equal?(o)
|
|
164
|
+
self.class == o.class &&
|
|
165
|
+
display_blog_posts == o.display_blog_posts &&
|
|
166
|
+
display_items == o.display_items &&
|
|
167
|
+
display_subgroups == o.display_subgroups &&
|
|
168
|
+
metadata_available == o.metadata_available &&
|
|
169
|
+
name == o.name &&
|
|
170
|
+
page_type == o.page_type &&
|
|
171
|
+
pagination == o.pagination &&
|
|
172
|
+
system == o.system &&
|
|
173
|
+
theme_relative_path == o.theme_relative_path &&
|
|
174
|
+
visual_builder == o.visual_builder
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
# @see the `==` method
|
|
178
|
+
# @param [Object] Object to be compared
|
|
179
|
+
def eql?(o)
|
|
180
|
+
self == o
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
# Calculates hash code according to all attributes.
|
|
184
|
+
# @return [Integer] Hash code
|
|
185
|
+
def hash
|
|
186
|
+
[display_blog_posts, display_items, display_subgroups, metadata_available, name, page_type, pagination, system, theme_relative_path, visual_builder].hash
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
# Builds the object from hash
|
|
190
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
191
|
+
# @return [Object] Returns the model itself
|
|
192
|
+
def self.build_from_hash(attributes)
|
|
193
|
+
new.build_from_hash(attributes)
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
# Builds the object from hash
|
|
197
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
198
|
+
# @return [Object] Returns the model itself
|
|
199
|
+
def build_from_hash(attributes)
|
|
200
|
+
return nil unless attributes.is_a?(Hash)
|
|
201
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
202
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
203
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
204
|
+
self.send("#{key}=", nil)
|
|
205
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
206
|
+
# check to ensure the input is an array given that the attribute
|
|
207
|
+
# is documented as an array but the input is not
|
|
208
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
209
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
210
|
+
end
|
|
211
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
212
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
213
|
+
end
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
self
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
# Deserializes the data based on type
|
|
220
|
+
# @param string type Data type
|
|
221
|
+
# @param string value Value to be deserialized
|
|
222
|
+
# @return [Object] Deserialized data
|
|
223
|
+
def _deserialize(type, value)
|
|
224
|
+
case type.to_sym
|
|
225
|
+
when :Time
|
|
226
|
+
Time.parse(value)
|
|
227
|
+
when :Date
|
|
228
|
+
Date.parse(value)
|
|
229
|
+
when :String
|
|
230
|
+
value.to_s
|
|
231
|
+
when :Integer
|
|
232
|
+
value.to_i
|
|
233
|
+
when :Float
|
|
234
|
+
value.to_f
|
|
235
|
+
when :Boolean
|
|
236
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
237
|
+
true
|
|
238
|
+
else
|
|
239
|
+
false
|
|
240
|
+
end
|
|
241
|
+
when :Object
|
|
242
|
+
# generic object (usually a Hash), return directly
|
|
243
|
+
value
|
|
244
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
245
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
246
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
247
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
248
|
+
k_type = Regexp.last_match[:k_type]
|
|
249
|
+
v_type = Regexp.last_match[:v_type]
|
|
250
|
+
{}.tap do |hash|
|
|
251
|
+
value.each do |k, v|
|
|
252
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
253
|
+
end
|
|
254
|
+
end
|
|
255
|
+
else # model
|
|
256
|
+
# models (e.g. Pet) or oneOf
|
|
257
|
+
klass = UltracartClient.const_get(type)
|
|
258
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
259
|
+
end
|
|
260
|
+
end
|
|
261
|
+
|
|
262
|
+
# Returns the string representation of the object
|
|
263
|
+
# @return [String] String presentation of the object
|
|
264
|
+
def to_s
|
|
265
|
+
to_hash.to_s
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
269
|
+
# @return [Hash] Returns the object in the form of hash
|
|
270
|
+
def to_body
|
|
271
|
+
to_hash
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
# Returns the object in the form of hash
|
|
275
|
+
# @return [Hash] Returns the object in the form of hash
|
|
276
|
+
def to_hash
|
|
277
|
+
hash = {}
|
|
278
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
279
|
+
value = self.send(attr)
|
|
280
|
+
if value.nil?
|
|
281
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
282
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
hash[param] = _to_hash(value)
|
|
286
|
+
end
|
|
287
|
+
hash
|
|
288
|
+
end
|
|
289
|
+
|
|
290
|
+
# Outputs non-array value in the form of hash
|
|
291
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
292
|
+
# @param [Object] value Any valid value
|
|
293
|
+
# @return [Hash] Returns the value in the form of hash
|
|
294
|
+
def _to_hash(value)
|
|
295
|
+
if value.is_a?(Array)
|
|
296
|
+
value.compact.map { |v| _to_hash(v) }
|
|
297
|
+
elsif value.is_a?(Hash)
|
|
298
|
+
{}.tap do |hash|
|
|
299
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
300
|
+
end
|
|
301
|
+
elsif value.respond_to? :to_hash
|
|
302
|
+
value.to_hash
|
|
303
|
+
else
|
|
304
|
+
value
|
|
305
|
+
end
|
|
306
|
+
end
|
|
307
|
+
|
|
308
|
+
end
|
|
309
|
+
|
|
310
|
+
end
|
|
@@ -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 SfvbTemplatesResponse
|
|
18
|
+
# Templates sorted by name.
|
|
19
|
+
attr_accessor :templates
|
|
20
|
+
|
|
21
|
+
# The active theme the templates were read from.
|
|
22
|
+
attr_accessor :theme_oid
|
|
23
|
+
|
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
25
|
+
def self.attribute_map
|
|
26
|
+
{
|
|
27
|
+
:'templates' => :'templates',
|
|
28
|
+
:'theme_oid' => :'theme_oid'
|
|
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
|
+
:'templates' => :'Array<SfvbTemplate>',
|
|
41
|
+
:'theme_oid' => :'Integer'
|
|
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::SfvbTemplatesResponse` 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::SfvbTemplatesResponse`. 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?(:'templates')
|
|
67
|
+
if (value = attributes[:'templates']).is_a?(Array)
|
|
68
|
+
self.templates = value
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
if attributes.key?(:'theme_oid')
|
|
73
|
+
self.theme_oid = attributes[:'theme_oid']
|
|
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
|
+
templates == o.templates &&
|
|
96
|
+
theme_oid == o.theme_oid
|
|
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
|
+
[templates, theme_oid].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
|
data/lib/ultracart_api.rb
CHANGED
|
@@ -978,6 +978,8 @@ require 'ultracart_api/models/screen_recording_user_agent_os'
|
|
|
978
978
|
require 'ultracart_api/models/screen_recording_user_property'
|
|
979
979
|
require 'ultracart_api/models/screenshots_response'
|
|
980
980
|
require 'ultracart_api/models/self_config'
|
|
981
|
+
require 'ultracart_api/models/sfvb_blog_post'
|
|
982
|
+
require 'ultracart_api/models/sfvb_blog_posts_response'
|
|
981
983
|
require 'ultracart_api/models/sfvb_compile_request'
|
|
982
984
|
require 'ultracart_api/models/sfvb_compile_response'
|
|
983
985
|
require 'ultracart_api/models/sfvb_container_response'
|
|
@@ -989,6 +991,14 @@ require 'ultracart_api/models/sfvb_element'
|
|
|
989
991
|
require 'ultracart_api/models/sfvb_element_schema_response'
|
|
990
992
|
require 'ultracart_api/models/sfvb_elements_response'
|
|
991
993
|
require 'ultracart_api/models/sfvb_error_detail'
|
|
994
|
+
require 'ultracart_api/models/sfvb_experiment'
|
|
995
|
+
require 'ultracart_api/models/sfvb_experiment_end_request'
|
|
996
|
+
require 'ultracart_api/models/sfvb_experiment_objective'
|
|
997
|
+
require 'ultracart_api/models/sfvb_experiment_objectives_response'
|
|
998
|
+
require 'ultracart_api/models/sfvb_experiment_start_request'
|
|
999
|
+
require 'ultracart_api/models/sfvb_experiment_start_variation'
|
|
1000
|
+
require 'ultracart_api/models/sfvb_experiment_variation_update_request'
|
|
1001
|
+
require 'ultracart_api/models/sfvb_experiments_response'
|
|
992
1002
|
require 'ultracart_api/models/sfvb_file_content_response'
|
|
993
1003
|
require 'ultracart_api/models/sfvb_file_entry'
|
|
994
1004
|
require 'ultracart_api/models/sfvb_file_revert_request'
|
|
@@ -1011,9 +1021,23 @@ require 'ultracart_api/models/sfvb_menus_response'
|
|
|
1011
1021
|
require 'ultracart_api/models/sfvb_page_attribute'
|
|
1012
1022
|
require 'ultracart_api/models/sfvb_page_attribute_update'
|
|
1013
1023
|
require 'ultracart_api/models/sfvb_page_attribute_update_request'
|
|
1024
|
+
require 'ultracart_api/models/sfvb_page_blog_post_selector'
|
|
1025
|
+
require 'ultracart_api/models/sfvb_page_blog_posts_request'
|
|
1026
|
+
require 'ultracart_api/models/sfvb_page_blog_posts_response'
|
|
1027
|
+
require 'ultracart_api/models/sfvb_page_create_request'
|
|
1028
|
+
require 'ultracart_api/models/sfvb_page_duplicate_request'
|
|
1029
|
+
require 'ultracart_api/models/sfvb_page_item'
|
|
1030
|
+
require 'ultracart_api/models/sfvb_page_item_selector'
|
|
1031
|
+
require 'ultracart_api/models/sfvb_page_items_add_request'
|
|
1032
|
+
require 'ultracart_api/models/sfvb_page_items_remove_request'
|
|
1033
|
+
require 'ultracart_api/models/sfvb_page_items_response'
|
|
1034
|
+
require 'ultracart_api/models/sfvb_page_list_response'
|
|
1014
1035
|
require 'ultracart_api/models/sfvb_page_multimedia'
|
|
1015
1036
|
require 'ultracart_api/models/sfvb_page_multimedia_request'
|
|
1016
1037
|
require 'ultracart_api/models/sfvb_page_response'
|
|
1038
|
+
require 'ultracart_api/models/sfvb_page_selectors'
|
|
1039
|
+
require 'ultracart_api/models/sfvb_page_settings_request'
|
|
1040
|
+
require 'ultracart_api/models/sfvb_page_summary'
|
|
1017
1041
|
require 'ultracart_api/models/sfvb_preview_access_request'
|
|
1018
1042
|
require 'ultracart_api/models/sfvb_preview_access_response'
|
|
1019
1043
|
require 'ultracart_api/models/sfvb_preview_session_request'
|
|
@@ -1027,6 +1051,8 @@ require 'ultracart_api/models/sfvb_site_attribute_update_request'
|
|
|
1027
1051
|
require 'ultracart_api/models/sfvb_site_attributes_response'
|
|
1028
1052
|
require 'ultracart_api/models/sfvb_storefront'
|
|
1029
1053
|
require 'ultracart_api/models/sfvb_storefronts_response'
|
|
1054
|
+
require 'ultracart_api/models/sfvb_template'
|
|
1055
|
+
require 'ultracart_api/models/sfvb_templates_response'
|
|
1030
1056
|
require 'ultracart_api/models/sfvb_theme'
|
|
1031
1057
|
require 'ultracart_api/models/sfvb_theme_attribute'
|
|
1032
1058
|
require 'ultracart_api/models/sfvb_theme_attribute_update'
|