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.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +50 -2
  3. data/docs/SfvbApi.md +1123 -10
  4. data/docs/SfvbBlogPost.md +30 -0
  5. data/docs/SfvbBlogPostsResponse.md +24 -0
  6. data/docs/SfvbExperiment.md +36 -0
  7. data/docs/SfvbExperimentEndRequest.md +18 -0
  8. data/docs/SfvbExperimentObjective.md +24 -0
  9. data/docs/SfvbExperimentObjectivesResponse.md +18 -0
  10. data/docs/SfvbExperimentStartRequest.md +40 -0
  11. data/docs/SfvbExperimentStartVariation.md +22 -0
  12. data/docs/SfvbExperimentVariationUpdateRequest.md +18 -0
  13. data/docs/SfvbExperimentsResponse.md +18 -0
  14. data/docs/SfvbPageBlogPostSelector.md +26 -0
  15. data/docs/SfvbPageBlogPostsRequest.md +18 -0
  16. data/docs/SfvbPageBlogPostsResponse.md +22 -0
  17. data/docs/SfvbPageCreateRequest.md +34 -0
  18. data/docs/SfvbPageDuplicateRequest.md +22 -0
  19. data/docs/SfvbPageItem.md +26 -0
  20. data/docs/SfvbPageItemSelector.md +42 -0
  21. data/docs/SfvbPageItemsAddRequest.md +18 -0
  22. data/docs/SfvbPageItemsRemoveRequest.md +18 -0
  23. data/docs/SfvbPageItemsResponse.md +24 -0
  24. data/docs/SfvbPageListResponse.md +18 -0
  25. data/docs/SfvbPageResponse.md +13 -1
  26. data/docs/SfvbPageSelectors.md +26 -0
  27. data/docs/SfvbPageSettingsRequest.md +44 -0
  28. data/docs/SfvbPageSummary.md +44 -0
  29. data/docs/SfvbTemplate.md +36 -0
  30. data/docs/SfvbTemplatesResponse.md +20 -0
  31. data/lib/ultracart_api/api/sfvb_api.rb +1722 -211
  32. data/lib/ultracart_api/models/sfvb_blog_post.rb +280 -0
  33. data/lib/ultracart_api/models/sfvb_blog_posts_response.rb +252 -0
  34. data/lib/ultracart_api/models/sfvb_experiment.rb +309 -0
  35. data/lib/ultracart_api/models/sfvb_experiment_end_request.rb +220 -0
  36. data/lib/ultracart_api/models/sfvb_experiment_objective.rb +250 -0
  37. data/lib/ultracart_api/models/sfvb_experiment_objectives_response.rb +222 -0
  38. data/lib/ultracart_api/models/sfvb_experiment_start_request.rb +332 -0
  39. data/lib/ultracart_api/models/sfvb_experiment_start_variation.rb +240 -0
  40. data/lib/ultracart_api/models/sfvb_experiment_variation_update_request.rb +220 -0
  41. data/lib/ultracart_api/models/sfvb_experiments_response.rb +222 -0
  42. data/lib/ultracart_api/models/sfvb_page_blog_post_selector.rb +260 -0
  43. data/lib/ultracart_api/models/sfvb_page_blog_posts_request.rb +222 -0
  44. data/lib/ultracart_api/models/sfvb_page_blog_posts_response.rb +242 -0
  45. data/lib/ultracart_api/models/sfvb_page_create_request.rb +300 -0
  46. data/lib/ultracart_api/models/sfvb_page_duplicate_request.rb +240 -0
  47. data/lib/ultracart_api/models/sfvb_page_item.rb +260 -0
  48. data/lib/ultracart_api/models/sfvb_page_item_selector.rb +340 -0
  49. data/lib/ultracart_api/models/sfvb_page_items_add_request.rb +222 -0
  50. data/lib/ultracart_api/models/sfvb_page_items_remove_request.rb +222 -0
  51. data/lib/ultracart_api/models/sfvb_page_items_response.rb +252 -0
  52. data/lib/ultracart_api/models/sfvb_page_list_response.rb +222 -0
  53. data/lib/ultracart_api/models/sfvb_page_response.rb +64 -4
  54. data/lib/ultracart_api/models/sfvb_page_selectors.rb +264 -0
  55. data/lib/ultracart_api/models/sfvb_page_settings_request.rb +350 -0
  56. data/lib/ultracart_api/models/sfvb_page_summary.rb +350 -0
  57. data/lib/ultracart_api/models/sfvb_template.rb +310 -0
  58. data/lib/ultracart_api/models/sfvb_templates_response.rb +232 -0
  59. data/lib/ultracart_api/version.rb +1 -1
  60. data/lib/ultracart_api.rb +26 -0
  61. metadata +53 -1
@@ -0,0 +1,350 @@
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 SfvbPageSettingsRequest
18
+ # Template that renders the blog posts under this page.
19
+ attr_accessor :blog_post_template
20
+
21
+ # The page description. Null or empty clears it.
22
+ attr_accessor :description
23
+
24
+ # Leave the page out of the sitemap and mark it noindex.
25
+ attr_accessor :exclude_from_sitemap
26
+
27
+ # Template that renders the page, a name from the template list.
28
+ attr_accessor :group_template
29
+
30
+ # Template that renders the item pages under this page.
31
+ attr_accessor :item_template
32
+
33
+ # Items per page on a template that paginates. Null returns to the template's default.
34
+ attr_accessor :items_per_page
35
+
36
+ # S for a static page, D for a dynamic one.
37
+ attr_accessor :page_type
38
+
39
+ # Template that renders the item review pages under this page.
40
+ attr_accessor :review_template
41
+
42
+ # Position among its siblings when the parent sorts child pages by a custom order. Null clears it.
43
+ attr_accessor :sort_order
44
+
45
+ # How the pages under this one are ordered. TA or TD by title, DA or DD by description, C custom.
46
+ attr_accessor :sort_order_child_groups
47
+
48
+ # How the page's items are ordered. IA or ID by item id, DA or DD by description, SA or SD by manufacturer SKU, PA or PD by price, RA or RD by review, NA or ND by inventory, C custom.
49
+ attr_accessor :sort_order_child_items
50
+
51
+ # The page title.
52
+ attr_accessor :title
53
+
54
+ # False hides the page, so it answers 404 to shoppers. The root page cannot be hidden.
55
+ attr_accessor :visible
56
+
57
+ # Keep the page hidden until this time (ISO 8601). Null or empty clears it.
58
+ attr_accessor :visible_dts
59
+
60
+ # Attribute mapping from ruby-style variable name to JSON key.
61
+ def self.attribute_map
62
+ {
63
+ :'blog_post_template' => :'blog_post_template',
64
+ :'description' => :'description',
65
+ :'exclude_from_sitemap' => :'exclude_from_sitemap',
66
+ :'group_template' => :'group_template',
67
+ :'item_template' => :'item_template',
68
+ :'items_per_page' => :'items_per_page',
69
+ :'page_type' => :'page_type',
70
+ :'review_template' => :'review_template',
71
+ :'sort_order' => :'sort_order',
72
+ :'sort_order_child_groups' => :'sort_order_child_groups',
73
+ :'sort_order_child_items' => :'sort_order_child_items',
74
+ :'title' => :'title',
75
+ :'visible' => :'visible',
76
+ :'visible_dts' => :'visible_dts'
77
+ }
78
+ end
79
+
80
+ # Returns all the JSON keys this model knows about
81
+ def self.acceptable_attributes
82
+ attribute_map.values
83
+ end
84
+
85
+ # Attribute type mapping.
86
+ def self.openapi_types
87
+ {
88
+ :'blog_post_template' => :'String',
89
+ :'description' => :'String',
90
+ :'exclude_from_sitemap' => :'Boolean',
91
+ :'group_template' => :'String',
92
+ :'item_template' => :'String',
93
+ :'items_per_page' => :'Integer',
94
+ :'page_type' => :'String',
95
+ :'review_template' => :'String',
96
+ :'sort_order' => :'Integer',
97
+ :'sort_order_child_groups' => :'String',
98
+ :'sort_order_child_items' => :'String',
99
+ :'title' => :'String',
100
+ :'visible' => :'Boolean',
101
+ :'visible_dts' => :'String'
102
+ }
103
+ end
104
+
105
+ # List of attributes with nullable: true
106
+ def self.openapi_nullable
107
+ Set.new([
108
+ ])
109
+ end
110
+
111
+ # Initializes the object
112
+ # @param [Hash] attributes Model attributes in the form of hash
113
+ def initialize(attributes = {})
114
+ if (!attributes.is_a?(Hash))
115
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbPageSettingsRequest` initialize method"
116
+ end
117
+
118
+ # check to see if the attribute exists and convert string to symbol for hash key
119
+ attributes = attributes.each_with_object({}) { |(k, v), h|
120
+ if (!self.class.attribute_map.key?(k.to_sym))
121
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbPageSettingsRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
122
+ end
123
+ h[k.to_sym] = v
124
+ }
125
+
126
+ if attributes.key?(:'blog_post_template')
127
+ self.blog_post_template = attributes[:'blog_post_template']
128
+ end
129
+
130
+ if attributes.key?(:'description')
131
+ self.description = attributes[:'description']
132
+ end
133
+
134
+ if attributes.key?(:'exclude_from_sitemap')
135
+ self.exclude_from_sitemap = attributes[:'exclude_from_sitemap']
136
+ end
137
+
138
+ if attributes.key?(:'group_template')
139
+ self.group_template = attributes[:'group_template']
140
+ end
141
+
142
+ if attributes.key?(:'item_template')
143
+ self.item_template = attributes[:'item_template']
144
+ end
145
+
146
+ if attributes.key?(:'items_per_page')
147
+ self.items_per_page = attributes[:'items_per_page']
148
+ end
149
+
150
+ if attributes.key?(:'page_type')
151
+ self.page_type = attributes[:'page_type']
152
+ end
153
+
154
+ if attributes.key?(:'review_template')
155
+ self.review_template = attributes[:'review_template']
156
+ end
157
+
158
+ if attributes.key?(:'sort_order')
159
+ self.sort_order = attributes[:'sort_order']
160
+ end
161
+
162
+ if attributes.key?(:'sort_order_child_groups')
163
+ self.sort_order_child_groups = attributes[:'sort_order_child_groups']
164
+ end
165
+
166
+ if attributes.key?(:'sort_order_child_items')
167
+ self.sort_order_child_items = attributes[:'sort_order_child_items']
168
+ end
169
+
170
+ if attributes.key?(:'title')
171
+ self.title = attributes[:'title']
172
+ end
173
+
174
+ if attributes.key?(:'visible')
175
+ self.visible = attributes[:'visible']
176
+ end
177
+
178
+ if attributes.key?(:'visible_dts')
179
+ self.visible_dts = attributes[:'visible_dts']
180
+ end
181
+ end
182
+
183
+ # Show invalid properties with the reasons. Usually used together with valid?
184
+ # @return Array for valid properties with the reasons
185
+ def list_invalid_properties
186
+ invalid_properties = Array.new
187
+ invalid_properties
188
+ end
189
+
190
+ # Check to see if the all the properties in the model are valid
191
+ # @return true if the model is valid
192
+ def valid?
193
+ true
194
+ end
195
+
196
+ # Checks equality by comparing each attribute.
197
+ # @param [Object] Object to be compared
198
+ def ==(o)
199
+ return true if self.equal?(o)
200
+ self.class == o.class &&
201
+ blog_post_template == o.blog_post_template &&
202
+ description == o.description &&
203
+ exclude_from_sitemap == o.exclude_from_sitemap &&
204
+ group_template == o.group_template &&
205
+ item_template == o.item_template &&
206
+ items_per_page == o.items_per_page &&
207
+ page_type == o.page_type &&
208
+ review_template == o.review_template &&
209
+ sort_order == o.sort_order &&
210
+ sort_order_child_groups == o.sort_order_child_groups &&
211
+ sort_order_child_items == o.sort_order_child_items &&
212
+ title == o.title &&
213
+ visible == o.visible &&
214
+ visible_dts == o.visible_dts
215
+ end
216
+
217
+ # @see the `==` method
218
+ # @param [Object] Object to be compared
219
+ def eql?(o)
220
+ self == o
221
+ end
222
+
223
+ # Calculates hash code according to all attributes.
224
+ # @return [Integer] Hash code
225
+ 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
227
+ end
228
+
229
+ # Builds the object from hash
230
+ # @param [Hash] attributes Model attributes in the form of hash
231
+ # @return [Object] Returns the model itself
232
+ def self.build_from_hash(attributes)
233
+ new.build_from_hash(attributes)
234
+ end
235
+
236
+ # Builds the object from hash
237
+ # @param [Hash] attributes Model attributes in the form of hash
238
+ # @return [Object] Returns the model itself
239
+ def build_from_hash(attributes)
240
+ return nil unless attributes.is_a?(Hash)
241
+ attributes = attributes.transform_keys(&:to_sym)
242
+ self.class.openapi_types.each_pair do |key, type|
243
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
244
+ self.send("#{key}=", nil)
245
+ elsif type =~ /\AArray<(.*)>/i
246
+ # check to ensure the input is an array given that the attribute
247
+ # is documented as an array but the input is not
248
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
249
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
250
+ end
251
+ elsif !attributes[self.class.attribute_map[key]].nil?
252
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
253
+ end
254
+ end
255
+
256
+ self
257
+ end
258
+
259
+ # Deserializes the data based on type
260
+ # @param string type Data type
261
+ # @param string value Value to be deserialized
262
+ # @return [Object] Deserialized data
263
+ def _deserialize(type, value)
264
+ case type.to_sym
265
+ when :Time
266
+ Time.parse(value)
267
+ when :Date
268
+ Date.parse(value)
269
+ when :String
270
+ value.to_s
271
+ when :Integer
272
+ value.to_i
273
+ when :Float
274
+ value.to_f
275
+ when :Boolean
276
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
277
+ true
278
+ else
279
+ false
280
+ end
281
+ when :Object
282
+ # generic object (usually a Hash), return directly
283
+ value
284
+ when /\AArray<(?<inner_type>.+)>\z/
285
+ inner_type = Regexp.last_match[:inner_type]
286
+ value.map { |v| _deserialize(inner_type, v) }
287
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
288
+ k_type = Regexp.last_match[:k_type]
289
+ v_type = Regexp.last_match[:v_type]
290
+ {}.tap do |hash|
291
+ value.each do |k, v|
292
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
293
+ end
294
+ end
295
+ else # model
296
+ # models (e.g. Pet) or oneOf
297
+ klass = UltracartClient.const_get(type)
298
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
299
+ end
300
+ end
301
+
302
+ # Returns the string representation of the object
303
+ # @return [String] String presentation of the object
304
+ def to_s
305
+ to_hash.to_s
306
+ end
307
+
308
+ # to_body is an alias to to_hash (backward compatibility)
309
+ # @return [Hash] Returns the object in the form of hash
310
+ def to_body
311
+ to_hash
312
+ end
313
+
314
+ # Returns the object in the form of hash
315
+ # @return [Hash] Returns the object in the form of hash
316
+ def to_hash
317
+ hash = {}
318
+ self.class.attribute_map.each_pair do |attr, param|
319
+ value = self.send(attr)
320
+ if value.nil?
321
+ is_nullable = self.class.openapi_nullable.include?(attr)
322
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
323
+ end
324
+
325
+ hash[param] = _to_hash(value)
326
+ end
327
+ hash
328
+ end
329
+
330
+ # Outputs non-array value in the form of hash
331
+ # For object, use to_hash. Otherwise, just return the value
332
+ # @param [Object] value Any valid value
333
+ # @return [Hash] Returns the value in the form of hash
334
+ def _to_hash(value)
335
+ if value.is_a?(Array)
336
+ value.compact.map { |v| _to_hash(v) }
337
+ elsif value.is_a?(Hash)
338
+ {}.tap do |hash|
339
+ value.each { |k, v| hash[k] = _to_hash(v) }
340
+ end
341
+ elsif value.respond_to? :to_hash
342
+ value.to_hash
343
+ else
344
+ value
345
+ end
346
+ end
347
+
348
+ end
349
+
350
+ end
@@ -0,0 +1,350 @@
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 SfvbPageSummary
18
+ # Number of pages directly under this one.
19
+ attr_accessor :child_count
20
+
21
+ # True when the page is left out of the sitemap and marked noindex.
22
+ attr_accessor :exclude_from_sitemap
23
+
24
+ # Template file that renders the page itself, a bare .vm name found anywhere in the active theme.
25
+ attr_accessor :group_template
26
+
27
+ # Number of items assigned to the page. The catalog stops counting at its per-page item ceiling.
28
+ attr_accessor :item_count
29
+
30
+ # Template file that renders the item pages under this page.
31
+ attr_accessor :item_template
32
+
33
+ # S for a static page, D for a dynamic one.
34
+ attr_accessor :page_type
35
+
36
+ # Path of the page this one sits under. Empty for the root page.
37
+ attr_accessor :parent_path
38
+
39
+ # The page path, beginning and ending with a slash. The root page is /.
40
+ attr_accessor :path
41
+
42
+ # True for the storefront's home page.
43
+ attr_accessor :root
44
+
45
+ # Position among its siblings when the parent sorts child pages by a custom order.
46
+ attr_accessor :sort_order
47
+
48
+ # The page title.
49
+ attr_accessor :title
50
+
51
+ # True when the page's items or blog posts are chosen by selectors rather than assigned by hand.
52
+ attr_accessor :uses_selectors
53
+
54
+ # False when the page is hidden. A hidden page answers 404 to shoppers.
55
+ attr_accessor :visible
56
+
57
+ # When set, the page stays hidden until this time (ISO 8601, UTC).
58
+ attr_accessor :visible_dts
59
+
60
+ # Attribute mapping from ruby-style variable name to JSON key.
61
+ def self.attribute_map
62
+ {
63
+ :'child_count' => :'child_count',
64
+ :'exclude_from_sitemap' => :'exclude_from_sitemap',
65
+ :'group_template' => :'group_template',
66
+ :'item_count' => :'item_count',
67
+ :'item_template' => :'item_template',
68
+ :'page_type' => :'page_type',
69
+ :'parent_path' => :'parent_path',
70
+ :'path' => :'path',
71
+ :'root' => :'root',
72
+ :'sort_order' => :'sort_order',
73
+ :'title' => :'title',
74
+ :'uses_selectors' => :'uses_selectors',
75
+ :'visible' => :'visible',
76
+ :'visible_dts' => :'visible_dts'
77
+ }
78
+ end
79
+
80
+ # Returns all the JSON keys this model knows about
81
+ def self.acceptable_attributes
82
+ attribute_map.values
83
+ end
84
+
85
+ # Attribute type mapping.
86
+ def self.openapi_types
87
+ {
88
+ :'child_count' => :'Integer',
89
+ :'exclude_from_sitemap' => :'Boolean',
90
+ :'group_template' => :'String',
91
+ :'item_count' => :'Integer',
92
+ :'item_template' => :'String',
93
+ :'page_type' => :'String',
94
+ :'parent_path' => :'String',
95
+ :'path' => :'String',
96
+ :'root' => :'Boolean',
97
+ :'sort_order' => :'Integer',
98
+ :'title' => :'String',
99
+ :'uses_selectors' => :'Boolean',
100
+ :'visible' => :'Boolean',
101
+ :'visible_dts' => :'String'
102
+ }
103
+ end
104
+
105
+ # List of attributes with nullable: true
106
+ def self.openapi_nullable
107
+ Set.new([
108
+ ])
109
+ end
110
+
111
+ # Initializes the object
112
+ # @param [Hash] attributes Model attributes in the form of hash
113
+ def initialize(attributes = {})
114
+ if (!attributes.is_a?(Hash))
115
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbPageSummary` initialize method"
116
+ end
117
+
118
+ # check to see if the attribute exists and convert string to symbol for hash key
119
+ attributes = attributes.each_with_object({}) { |(k, v), h|
120
+ if (!self.class.attribute_map.key?(k.to_sym))
121
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbPageSummary`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
122
+ end
123
+ h[k.to_sym] = v
124
+ }
125
+
126
+ if attributes.key?(:'child_count')
127
+ self.child_count = attributes[:'child_count']
128
+ end
129
+
130
+ if attributes.key?(:'exclude_from_sitemap')
131
+ self.exclude_from_sitemap = attributes[:'exclude_from_sitemap']
132
+ end
133
+
134
+ if attributes.key?(:'group_template')
135
+ self.group_template = attributes[:'group_template']
136
+ end
137
+
138
+ if attributes.key?(:'item_count')
139
+ self.item_count = attributes[:'item_count']
140
+ end
141
+
142
+ if attributes.key?(:'item_template')
143
+ self.item_template = attributes[:'item_template']
144
+ end
145
+
146
+ if attributes.key?(:'page_type')
147
+ self.page_type = attributes[:'page_type']
148
+ end
149
+
150
+ if attributes.key?(:'parent_path')
151
+ self.parent_path = attributes[:'parent_path']
152
+ end
153
+
154
+ if attributes.key?(:'path')
155
+ self.path = attributes[:'path']
156
+ end
157
+
158
+ if attributes.key?(:'root')
159
+ self.root = attributes[:'root']
160
+ end
161
+
162
+ if attributes.key?(:'sort_order')
163
+ self.sort_order = attributes[:'sort_order']
164
+ end
165
+
166
+ if attributes.key?(:'title')
167
+ self.title = attributes[:'title']
168
+ end
169
+
170
+ if attributes.key?(:'uses_selectors')
171
+ self.uses_selectors = attributes[:'uses_selectors']
172
+ end
173
+
174
+ if attributes.key?(:'visible')
175
+ self.visible = attributes[:'visible']
176
+ end
177
+
178
+ if attributes.key?(:'visible_dts')
179
+ self.visible_dts = attributes[:'visible_dts']
180
+ end
181
+ end
182
+
183
+ # Show invalid properties with the reasons. Usually used together with valid?
184
+ # @return Array for valid properties with the reasons
185
+ def list_invalid_properties
186
+ invalid_properties = Array.new
187
+ invalid_properties
188
+ end
189
+
190
+ # Check to see if the all the properties in the model are valid
191
+ # @return true if the model is valid
192
+ def valid?
193
+ true
194
+ end
195
+
196
+ # Checks equality by comparing each attribute.
197
+ # @param [Object] Object to be compared
198
+ def ==(o)
199
+ return true if self.equal?(o)
200
+ self.class == o.class &&
201
+ child_count == o.child_count &&
202
+ exclude_from_sitemap == o.exclude_from_sitemap &&
203
+ group_template == o.group_template &&
204
+ item_count == o.item_count &&
205
+ item_template == o.item_template &&
206
+ page_type == o.page_type &&
207
+ parent_path == o.parent_path &&
208
+ path == o.path &&
209
+ root == o.root &&
210
+ sort_order == o.sort_order &&
211
+ title == o.title &&
212
+ uses_selectors == o.uses_selectors &&
213
+ visible == o.visible &&
214
+ visible_dts == o.visible_dts
215
+ end
216
+
217
+ # @see the `==` method
218
+ # @param [Object] Object to be compared
219
+ def eql?(o)
220
+ self == o
221
+ end
222
+
223
+ # Calculates hash code according to all attributes.
224
+ # @return [Integer] Hash code
225
+ def hash
226
+ [child_count, exclude_from_sitemap, group_template, item_count, item_template, page_type, parent_path, path, root, sort_order, title, uses_selectors, visible, visible_dts].hash
227
+ end
228
+
229
+ # Builds the object from hash
230
+ # @param [Hash] attributes Model attributes in the form of hash
231
+ # @return [Object] Returns the model itself
232
+ def self.build_from_hash(attributes)
233
+ new.build_from_hash(attributes)
234
+ end
235
+
236
+ # Builds the object from hash
237
+ # @param [Hash] attributes Model attributes in the form of hash
238
+ # @return [Object] Returns the model itself
239
+ def build_from_hash(attributes)
240
+ return nil unless attributes.is_a?(Hash)
241
+ attributes = attributes.transform_keys(&:to_sym)
242
+ self.class.openapi_types.each_pair do |key, type|
243
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
244
+ self.send("#{key}=", nil)
245
+ elsif type =~ /\AArray<(.*)>/i
246
+ # check to ensure the input is an array given that the attribute
247
+ # is documented as an array but the input is not
248
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
249
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
250
+ end
251
+ elsif !attributes[self.class.attribute_map[key]].nil?
252
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
253
+ end
254
+ end
255
+
256
+ self
257
+ end
258
+
259
+ # Deserializes the data based on type
260
+ # @param string type Data type
261
+ # @param string value Value to be deserialized
262
+ # @return [Object] Deserialized data
263
+ def _deserialize(type, value)
264
+ case type.to_sym
265
+ when :Time
266
+ Time.parse(value)
267
+ when :Date
268
+ Date.parse(value)
269
+ when :String
270
+ value.to_s
271
+ when :Integer
272
+ value.to_i
273
+ when :Float
274
+ value.to_f
275
+ when :Boolean
276
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
277
+ true
278
+ else
279
+ false
280
+ end
281
+ when :Object
282
+ # generic object (usually a Hash), return directly
283
+ value
284
+ when /\AArray<(?<inner_type>.+)>\z/
285
+ inner_type = Regexp.last_match[:inner_type]
286
+ value.map { |v| _deserialize(inner_type, v) }
287
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
288
+ k_type = Regexp.last_match[:k_type]
289
+ v_type = Regexp.last_match[:v_type]
290
+ {}.tap do |hash|
291
+ value.each do |k, v|
292
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
293
+ end
294
+ end
295
+ else # model
296
+ # models (e.g. Pet) or oneOf
297
+ klass = UltracartClient.const_get(type)
298
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
299
+ end
300
+ end
301
+
302
+ # Returns the string representation of the object
303
+ # @return [String] String presentation of the object
304
+ def to_s
305
+ to_hash.to_s
306
+ end
307
+
308
+ # to_body is an alias to to_hash (backward compatibility)
309
+ # @return [Hash] Returns the object in the form of hash
310
+ def to_body
311
+ to_hash
312
+ end
313
+
314
+ # Returns the object in the form of hash
315
+ # @return [Hash] Returns the object in the form of hash
316
+ def to_hash
317
+ hash = {}
318
+ self.class.attribute_map.each_pair do |attr, param|
319
+ value = self.send(attr)
320
+ if value.nil?
321
+ is_nullable = self.class.openapi_nullable.include?(attr)
322
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
323
+ end
324
+
325
+ hash[param] = _to_hash(value)
326
+ end
327
+ hash
328
+ end
329
+
330
+ # Outputs non-array value in the form of hash
331
+ # For object, use to_hash. Otherwise, just return the value
332
+ # @param [Object] value Any valid value
333
+ # @return [Hash] Returns the value in the form of hash
334
+ def _to_hash(value)
335
+ if value.is_a?(Array)
336
+ value.compact.map { |v| _to_hash(v) }
337
+ elsif value.is_a?(Hash)
338
+ {}.tap do |hash|
339
+ value.each { |k, v| hash[k] = _to_hash(v) }
340
+ end
341
+ elsif value.respond_to? :to_hash
342
+ value.to_hash
343
+ else
344
+ value
345
+ end
346
+ end
347
+
348
+ end
349
+
350
+ end