ultracart_api 4.1.155 → 4.1.157

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.
@@ -0,0 +1,222 @@
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 SfvbMenusResponse
18
+ # The storefront's menus, sorted by code. Entries are omitted here - read a single menu to get its tree.
19
+ attr_accessor :menus
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'menus' => :'menus'
25
+ }
26
+ end
27
+
28
+ # Returns all the JSON keys this model knows about
29
+ def self.acceptable_attributes
30
+ attribute_map.values
31
+ end
32
+
33
+ # Attribute type mapping.
34
+ def self.openapi_types
35
+ {
36
+ :'menus' => :'Array<SfvbMenu>'
37
+ }
38
+ end
39
+
40
+ # List of attributes with nullable: true
41
+ def self.openapi_nullable
42
+ Set.new([
43
+ ])
44
+ end
45
+
46
+ # Initializes the object
47
+ # @param [Hash] attributes Model attributes in the form of hash
48
+ def initialize(attributes = {})
49
+ if (!attributes.is_a?(Hash))
50
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbMenusResponse` initialize method"
51
+ end
52
+
53
+ # check to see if the attribute exists and convert string to symbol for hash key
54
+ attributes = attributes.each_with_object({}) { |(k, v), h|
55
+ if (!self.class.attribute_map.key?(k.to_sym))
56
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbMenusResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
+ end
58
+ h[k.to_sym] = v
59
+ }
60
+
61
+ if attributes.key?(:'menus')
62
+ if (value = attributes[:'menus']).is_a?(Array)
63
+ self.menus = value
64
+ end
65
+ end
66
+ end
67
+
68
+ # Show invalid properties with the reasons. Usually used together with valid?
69
+ # @return Array for valid properties with the reasons
70
+ def list_invalid_properties
71
+ invalid_properties = Array.new
72
+ invalid_properties
73
+ end
74
+
75
+ # Check to see if the all the properties in the model are valid
76
+ # @return true if the model is valid
77
+ def valid?
78
+ true
79
+ end
80
+
81
+ # Checks equality by comparing each attribute.
82
+ # @param [Object] Object to be compared
83
+ def ==(o)
84
+ return true if self.equal?(o)
85
+ self.class == o.class &&
86
+ menus == o.menus
87
+ end
88
+
89
+ # @see the `==` method
90
+ # @param [Object] Object to be compared
91
+ def eql?(o)
92
+ self == o
93
+ end
94
+
95
+ # Calculates hash code according to all attributes.
96
+ # @return [Integer] Hash code
97
+ def hash
98
+ [menus].hash
99
+ end
100
+
101
+ # Builds the object from hash
102
+ # @param [Hash] attributes Model attributes in the form of hash
103
+ # @return [Object] Returns the model itself
104
+ def self.build_from_hash(attributes)
105
+ new.build_from_hash(attributes)
106
+ end
107
+
108
+ # Builds the object from hash
109
+ # @param [Hash] attributes Model attributes in the form of hash
110
+ # @return [Object] Returns the model itself
111
+ def build_from_hash(attributes)
112
+ return nil unless attributes.is_a?(Hash)
113
+ attributes = attributes.transform_keys(&:to_sym)
114
+ self.class.openapi_types.each_pair do |key, type|
115
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
116
+ self.send("#{key}=", nil)
117
+ elsif type =~ /\AArray<(.*)>/i
118
+ # check to ensure the input is an array given that the attribute
119
+ # is documented as an array but the input is not
120
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
121
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
122
+ end
123
+ elsif !attributes[self.class.attribute_map[key]].nil?
124
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
125
+ end
126
+ end
127
+
128
+ self
129
+ end
130
+
131
+ # Deserializes the data based on type
132
+ # @param string type Data type
133
+ # @param string value Value to be deserialized
134
+ # @return [Object] Deserialized data
135
+ def _deserialize(type, value)
136
+ case type.to_sym
137
+ when :Time
138
+ Time.parse(value)
139
+ when :Date
140
+ Date.parse(value)
141
+ when :String
142
+ value.to_s
143
+ when :Integer
144
+ value.to_i
145
+ when :Float
146
+ value.to_f
147
+ when :Boolean
148
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
149
+ true
150
+ else
151
+ false
152
+ end
153
+ when :Object
154
+ # generic object (usually a Hash), return directly
155
+ value
156
+ when /\AArray<(?<inner_type>.+)>\z/
157
+ inner_type = Regexp.last_match[:inner_type]
158
+ value.map { |v| _deserialize(inner_type, v) }
159
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
160
+ k_type = Regexp.last_match[:k_type]
161
+ v_type = Regexp.last_match[:v_type]
162
+ {}.tap do |hash|
163
+ value.each do |k, v|
164
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
165
+ end
166
+ end
167
+ else # model
168
+ # models (e.g. Pet) or oneOf
169
+ klass = UltracartClient.const_get(type)
170
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
171
+ end
172
+ end
173
+
174
+ # Returns the string representation of the object
175
+ # @return [String] String presentation of the object
176
+ def to_s
177
+ to_hash.to_s
178
+ end
179
+
180
+ # to_body is an alias to to_hash (backward compatibility)
181
+ # @return [Hash] Returns the object in the form of hash
182
+ def to_body
183
+ to_hash
184
+ end
185
+
186
+ # Returns the object in the form of hash
187
+ # @return [Hash] Returns the object in the form of hash
188
+ def to_hash
189
+ hash = {}
190
+ self.class.attribute_map.each_pair do |attr, param|
191
+ value = self.send(attr)
192
+ if value.nil?
193
+ is_nullable = self.class.openapi_nullable.include?(attr)
194
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
195
+ end
196
+
197
+ hash[param] = _to_hash(value)
198
+ end
199
+ hash
200
+ end
201
+
202
+ # Outputs non-array value in the form of hash
203
+ # For object, use to_hash. Otherwise, just return the value
204
+ # @param [Object] value Any valid value
205
+ # @return [Hash] Returns the value in the form of hash
206
+ def _to_hash(value)
207
+ if value.is_a?(Array)
208
+ value.compact.map { |v| _to_hash(v) }
209
+ elsif value.is_a?(Hash)
210
+ {}.tap do |hash|
211
+ value.each { |k, v| hash[k] = _to_hash(v) }
212
+ end
213
+ elsif value.respond_to? :to_hash
214
+ value.to_hash
215
+ else
216
+ value
217
+ end
218
+ end
219
+
220
+ end
221
+
222
+ end
@@ -27,7 +27,7 @@ module UltracartClient
27
27
  # The preview session applied, when one was requested.
28
28
  attr_accessor :preview_session_id
29
29
 
30
- # How long the browser stays in preview once access_url is opened. The remaining life of the preview session, or eight hours when none was given. The user and their storefront permission are checked again on every page, so removing either ends it sooner.
30
+ # How long the browser stays in preview once access_url is opened. The remaining life of the preview session, or eight hours when none was given. Ending the preview session ends preview in that browser at its next page. The user and their storefront permission are checked again on every page, so removing either ends it sooner.
31
31
  attr_accessor :session_lifetime_seconds
32
32
 
33
33
  # Always true. A second open of access_url returns 410.
@@ -36,6 +36,12 @@ module UltracartClient
36
36
  # Most element library results one page returns. Asking for more is silently reduced to this, and unlike the directory listing there is no truncation flag on the response, so this number is the only way to know a larger request was cut.
37
37
  attr_accessor :max_library_results_per_page
38
38
 
39
+ # How deeply store menu entries can nest.
40
+ attr_accessor :max_menu_depth
41
+
42
+ # Most entries one store menu can hold, counting every level of the tree. A menu is navigation that renders on every page, so this is deliberately far below what the storage would physically accept.
43
+ attr_accessor :max_menu_items
44
+
39
45
  # Largest payload one preview session may hold, in bytes.
40
46
  attr_accessor :max_preview_session_bytes
41
47
 
@@ -95,6 +101,8 @@ module UltracartClient
95
101
  :'max_cjson_bytes' => :'max_cjson_bytes',
96
102
  :'max_directory_entries' => :'max_directory_entries',
97
103
  :'max_library_results_per_page' => :'max_library_results_per_page',
104
+ :'max_menu_depth' => :'max_menu_depth',
105
+ :'max_menu_items' => :'max_menu_items',
98
106
  :'max_preview_session_bytes' => :'max_preview_session_bytes',
99
107
  :'max_revertable_bytes' => :'max_revertable_bytes',
100
108
  :'max_search_results' => :'max_search_results',
@@ -122,6 +130,8 @@ module UltracartClient
122
130
  :'max_cjson_bytes' => :'Integer',
123
131
  :'max_directory_entries' => :'Integer',
124
132
  :'max_library_results_per_page' => :'Integer',
133
+ :'max_menu_depth' => :'Integer',
134
+ :'max_menu_items' => :'Integer',
125
135
  :'max_preview_session_bytes' => :'Integer',
126
136
  :'max_revertable_bytes' => :'Integer',
127
137
  :'max_search_results' => :'Integer',
@@ -183,6 +193,14 @@ module UltracartClient
183
193
  self.max_library_results_per_page = attributes[:'max_library_results_per_page']
184
194
  end
185
195
 
196
+ if attributes.key?(:'max_menu_depth')
197
+ self.max_menu_depth = attributes[:'max_menu_depth']
198
+ end
199
+
200
+ if attributes.key?(:'max_menu_items')
201
+ self.max_menu_items = attributes[:'max_menu_items']
202
+ end
203
+
186
204
  if attributes.key?(:'max_preview_session_bytes')
187
205
  self.max_preview_session_bytes = attributes[:'max_preview_session_bytes']
188
206
  end
@@ -257,6 +275,8 @@ module UltracartClient
257
275
  max_cjson_bytes == o.max_cjson_bytes &&
258
276
  max_directory_entries == o.max_directory_entries &&
259
277
  max_library_results_per_page == o.max_library_results_per_page &&
278
+ max_menu_depth == o.max_menu_depth &&
279
+ max_menu_items == o.max_menu_items &&
260
280
  max_preview_session_bytes == o.max_preview_session_bytes &&
261
281
  max_revertable_bytes == o.max_revertable_bytes &&
262
282
  max_search_results == o.max_search_results &&
@@ -277,7 +297,7 @@ module UltracartClient
277
297
  # Calculates hash code according to all attributes.
278
298
  # @return [Integer] Hash code
279
299
  def hash
280
- [container_manager_version, container_versions_retained, element_count, max_asset_bytes, max_cjson_bytes, max_directory_entries, max_library_results_per_page, max_preview_session_bytes, max_revertable_bytes, max_search_results, max_template_bytes, max_text_read_bytes, max_video_bytes, max_widget_ids_per_request, preview_session_ttl_seconds, release].hash
300
+ [container_manager_version, container_versions_retained, element_count, max_asset_bytes, max_cjson_bytes, max_directory_entries, max_library_results_per_page, max_menu_depth, max_menu_items, max_preview_session_bytes, max_revertable_bytes, max_search_results, max_template_bytes, max_text_read_bytes, max_video_bytes, max_widget_ids_per_request, preview_session_ttl_seconds, release].hash
281
301
  end
282
302
 
283
303
  # Builds the object from hash
@@ -11,5 +11,5 @@ OpenAPI Generator version: 6.0.1-SNAPSHOT
11
11
  =end
12
12
 
13
13
  module UltracartClient
14
- VERSION = '4.1.155'
14
+ VERSION = '4.1.157'
15
15
  end
data/lib/ultracart_api.rb CHANGED
@@ -1004,6 +1004,10 @@ require 'ultracart_api/models/sfvb_files_response'
1004
1004
  require 'ultracart_api/models/sfvb_library_entry'
1005
1005
  require 'ultracart_api/models/sfvb_library_facet'
1006
1006
  require 'ultracart_api/models/sfvb_library_response'
1007
+ require 'ultracart_api/models/sfvb_menu'
1008
+ require 'ultracart_api/models/sfvb_menu_item'
1009
+ require 'ultracart_api/models/sfvb_menu_write_request'
1010
+ require 'ultracart_api/models/sfvb_menus_response'
1007
1011
  require 'ultracart_api/models/sfvb_page_attribute'
1008
1012
  require 'ultracart_api/models/sfvb_page_attribute_update'
1009
1013
  require 'ultracart_api/models/sfvb_page_attribute_update_request'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ultracart_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.155
4
+ version: 4.1.157
5
5
  platform: ruby
6
6
  authors:
7
7
  - UltraCart
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-09-15 00:00:00.000000000 Z
11
+ date: 2026-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -1066,6 +1066,10 @@ files:
1066
1066
  - docs/SfvbLibraryEntry.md
1067
1067
  - docs/SfvbLibraryFacet.md
1068
1068
  - docs/SfvbLibraryResponse.md
1069
+ - docs/SfvbMenu.md
1070
+ - docs/SfvbMenuItem.md
1071
+ - docs/SfvbMenuWriteRequest.md
1072
+ - docs/SfvbMenusResponse.md
1069
1073
  - docs/SfvbPageAttribute.md
1070
1074
  - docs/SfvbPageAttributeUpdate.md
1071
1075
  - docs/SfvbPageAttributeUpdateRequest.md
@@ -2209,6 +2213,10 @@ files:
2209
2213
  - lib/ultracart_api/models/sfvb_library_entry.rb
2210
2214
  - lib/ultracart_api/models/sfvb_library_facet.rb
2211
2215
  - lib/ultracart_api/models/sfvb_library_response.rb
2216
+ - lib/ultracart_api/models/sfvb_menu.rb
2217
+ - lib/ultracart_api/models/sfvb_menu_item.rb
2218
+ - lib/ultracart_api/models/sfvb_menu_write_request.rb
2219
+ - lib/ultracart_api/models/sfvb_menus_response.rb
2212
2220
  - lib/ultracart_api/models/sfvb_page_attribute.rb
2213
2221
  - lib/ultracart_api/models/sfvb_page_attribute_update.rb
2214
2222
  - lib/ultracart_api/models/sfvb_page_attribute_update_request.rb