ultracart_api 4.1.190 → 4.1.192

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 (41) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +34 -2
  3. data/docs/SfvbApi.md +782 -2
  4. data/docs/SfvbNotFoundEntry.md +38 -0
  5. data/docs/SfvbNotFoundEntryResponse.md +20 -0
  6. data/docs/SfvbNotFoundHit.md +24 -0
  7. data/docs/SfvbNotFoundPage.md +28 -0
  8. data/docs/SfvbNotFoundResponse.md +20 -0
  9. data/docs/SfvbRedirect.md +42 -0
  10. data/docs/SfvbRedirectCheckResponse.md +26 -0
  11. data/docs/SfvbRedirectImportRequest.md +20 -0
  12. data/docs/SfvbRedirectImportResponse.md +32 -0
  13. data/docs/SfvbRedirectImportRow.md +22 -0
  14. data/docs/SfvbRedirectImportRowResult.md +26 -0
  15. data/docs/SfvbRedirectRequest.md +26 -0
  16. data/docs/SfvbRedirectResolveResponse.md +28 -0
  17. data/docs/SfvbRedirectResolveStep.md +22 -0
  18. data/docs/SfvbRedirectResponse.md +20 -0
  19. data/docs/SfvbRedirectsResponse.md +22 -0
  20. data/docs/SfvbRenderRequest.md +1 -1
  21. data/lib/ultracart_api/api/sfvb_api.rb +1132 -98
  22. data/lib/ultracart_api/models/sfvb_not_found_entry.rb +322 -0
  23. data/lib/ultracart_api/models/sfvb_not_found_entry_response.rb +231 -0
  24. data/lib/ultracart_api/models/sfvb_not_found_hit.rb +250 -0
  25. data/lib/ultracart_api/models/sfvb_not_found_page.rb +270 -0
  26. data/lib/ultracart_api/models/sfvb_not_found_response.rb +232 -0
  27. data/lib/ultracart_api/models/sfvb_redirect.rb +340 -0
  28. data/lib/ultracart_api/models/sfvb_redirect_check_response.rb +264 -0
  29. data/lib/ultracart_api/models/sfvb_redirect_import_request.rb +232 -0
  30. data/lib/ultracart_api/models/sfvb_redirect_import_response.rb +292 -0
  31. data/lib/ultracart_api/models/sfvb_redirect_import_row.rb +240 -0
  32. data/lib/ultracart_api/models/sfvb_redirect_import_row_result.rb +264 -0
  33. data/lib/ultracart_api/models/sfvb_redirect_request.rb +260 -0
  34. data/lib/ultracart_api/models/sfvb_redirect_resolve_response.rb +272 -0
  35. data/lib/ultracart_api/models/sfvb_redirect_resolve_step.rb +240 -0
  36. data/lib/ultracart_api/models/sfvb_redirect_response.rb +231 -0
  37. data/lib/ultracart_api/models/sfvb_redirects_response.rb +242 -0
  38. data/lib/ultracart_api/models/sfvb_render_request.rb +1 -1
  39. data/lib/ultracart_api/version.rb +1 -1
  40. data/lib/ultracart_api.rb +16 -0
  41. metadata +33 -1
@@ -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 SfvbNotFoundResponse
18
+ # The entries, most hits first unless sorted otherwise.
19
+ attr_accessor :entries
20
+
21
+ # How many entries were read to build the list. Filters apply within them.
22
+ attr_accessor :scanned
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'entries' => :'entries',
28
+ :'scanned' => :'scanned'
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
+ :'entries' => :'Array<SfvbNotFoundEntry>',
41
+ :'scanned' => :'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::SfvbNotFoundResponse` 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::SfvbNotFoundResponse`. 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?(:'entries')
67
+ if (value = attributes[:'entries']).is_a?(Array)
68
+ self.entries = value
69
+ end
70
+ end
71
+
72
+ if attributes.key?(:'scanned')
73
+ self.scanned = attributes[:'scanned']
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
+ entries == o.entries &&
96
+ scanned == o.scanned
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
+ [entries, scanned].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
@@ -0,0 +1,340 @@
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 SfvbRedirect
18
+ # When SFVB created the rule, ISO 8601. Empty for rules created in the admin.
19
+ attr_accessor :created_dts
20
+
21
+ # Whether the source is left out of the generated sitemap.
22
+ attr_accessor :exclude_from_sitemap
23
+
24
+ # Send back as If-Match to update or delete the rule.
25
+ attr_accessor :hash_sha256
26
+
27
+ # When SFVB last changed the rule, ISO 8601.
28
+ attr_accessor :modified_dts
29
+
30
+ # Why the rule exists.
31
+ attr_accessor :note
32
+
33
+ # When the rule is pinned to a page, that page's current path. The target follows the page.
34
+ attr_accessor :pinned_page_path
35
+
36
+ # The rule's id.
37
+ attr_accessor :redirect_id
38
+
39
+ # The path the rule catches, as stored. A trailing /* catches everything below it.
40
+ attr_accessor :source
41
+
42
+ # 301, 302 (to another site, admin rules only) or rewrite (an admin rule serving the target at the source with a 200). Rules written through SFVB are always 301.
43
+ attr_accessor :status
44
+
45
+ # Where the rule sends the shopper.
46
+ attr_accessor :target
47
+
48
+ # True when the target is a page or item that does not exist.
49
+ attr_accessor :target_invalid
50
+
51
+ # Why the target is invalid.
52
+ attr_accessor :target_invalid_message
53
+
54
+ # exact or pattern.
55
+ attr_accessor :type
56
+
57
+ # Attribute mapping from ruby-style variable name to JSON key.
58
+ def self.attribute_map
59
+ {
60
+ :'created_dts' => :'created_dts',
61
+ :'exclude_from_sitemap' => :'exclude_from_sitemap',
62
+ :'hash_sha256' => :'hash_sha256',
63
+ :'modified_dts' => :'modified_dts',
64
+ :'note' => :'note',
65
+ :'pinned_page_path' => :'pinned_page_path',
66
+ :'redirect_id' => :'redirect_id',
67
+ :'source' => :'source',
68
+ :'status' => :'status',
69
+ :'target' => :'target',
70
+ :'target_invalid' => :'target_invalid',
71
+ :'target_invalid_message' => :'target_invalid_message',
72
+ :'type' => :'type'
73
+ }
74
+ end
75
+
76
+ # Returns all the JSON keys this model knows about
77
+ def self.acceptable_attributes
78
+ attribute_map.values
79
+ end
80
+
81
+ # Attribute type mapping.
82
+ def self.openapi_types
83
+ {
84
+ :'created_dts' => :'String',
85
+ :'exclude_from_sitemap' => :'Boolean',
86
+ :'hash_sha256' => :'String',
87
+ :'modified_dts' => :'String',
88
+ :'note' => :'String',
89
+ :'pinned_page_path' => :'String',
90
+ :'redirect_id' => :'Integer',
91
+ :'source' => :'String',
92
+ :'status' => :'String',
93
+ :'target' => :'String',
94
+ :'target_invalid' => :'Boolean',
95
+ :'target_invalid_message' => :'String',
96
+ :'type' => :'String'
97
+ }
98
+ end
99
+
100
+ # List of attributes with nullable: true
101
+ def self.openapi_nullable
102
+ Set.new([
103
+ ])
104
+ end
105
+
106
+ # Initializes the object
107
+ # @param [Hash] attributes Model attributes in the form of hash
108
+ def initialize(attributes = {})
109
+ if (!attributes.is_a?(Hash))
110
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbRedirect` initialize method"
111
+ end
112
+
113
+ # check to see if the attribute exists and convert string to symbol for hash key
114
+ attributes = attributes.each_with_object({}) { |(k, v), h|
115
+ if (!self.class.attribute_map.key?(k.to_sym))
116
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbRedirect`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
117
+ end
118
+ h[k.to_sym] = v
119
+ }
120
+
121
+ if attributes.key?(:'created_dts')
122
+ self.created_dts = attributes[:'created_dts']
123
+ end
124
+
125
+ if attributes.key?(:'exclude_from_sitemap')
126
+ self.exclude_from_sitemap = attributes[:'exclude_from_sitemap']
127
+ end
128
+
129
+ if attributes.key?(:'hash_sha256')
130
+ self.hash_sha256 = attributes[:'hash_sha256']
131
+ end
132
+
133
+ if attributes.key?(:'modified_dts')
134
+ self.modified_dts = attributes[:'modified_dts']
135
+ end
136
+
137
+ if attributes.key?(:'note')
138
+ self.note = attributes[:'note']
139
+ end
140
+
141
+ if attributes.key?(:'pinned_page_path')
142
+ self.pinned_page_path = attributes[:'pinned_page_path']
143
+ end
144
+
145
+ if attributes.key?(:'redirect_id')
146
+ self.redirect_id = attributes[:'redirect_id']
147
+ end
148
+
149
+ if attributes.key?(:'source')
150
+ self.source = attributes[:'source']
151
+ end
152
+
153
+ if attributes.key?(:'status')
154
+ self.status = attributes[:'status']
155
+ end
156
+
157
+ if attributes.key?(:'target')
158
+ self.target = attributes[:'target']
159
+ end
160
+
161
+ if attributes.key?(:'target_invalid')
162
+ self.target_invalid = attributes[:'target_invalid']
163
+ end
164
+
165
+ if attributes.key?(:'target_invalid_message')
166
+ self.target_invalid_message = attributes[:'target_invalid_message']
167
+ end
168
+
169
+ if attributes.key?(:'type')
170
+ self.type = attributes[:'type']
171
+ end
172
+ end
173
+
174
+ # Show invalid properties with the reasons. Usually used together with valid?
175
+ # @return Array for valid properties with the reasons
176
+ def list_invalid_properties
177
+ invalid_properties = Array.new
178
+ invalid_properties
179
+ end
180
+
181
+ # Check to see if the all the properties in the model are valid
182
+ # @return true if the model is valid
183
+ def valid?
184
+ true
185
+ end
186
+
187
+ # Checks equality by comparing each attribute.
188
+ # @param [Object] Object to be compared
189
+ def ==(o)
190
+ return true if self.equal?(o)
191
+ self.class == o.class &&
192
+ created_dts == o.created_dts &&
193
+ exclude_from_sitemap == o.exclude_from_sitemap &&
194
+ hash_sha256 == o.hash_sha256 &&
195
+ modified_dts == o.modified_dts &&
196
+ note == o.note &&
197
+ pinned_page_path == o.pinned_page_path &&
198
+ redirect_id == o.redirect_id &&
199
+ source == o.source &&
200
+ status == o.status &&
201
+ target == o.target &&
202
+ target_invalid == o.target_invalid &&
203
+ target_invalid_message == o.target_invalid_message &&
204
+ type == o.type
205
+ end
206
+
207
+ # @see the `==` method
208
+ # @param [Object] Object to be compared
209
+ def eql?(o)
210
+ self == o
211
+ end
212
+
213
+ # Calculates hash code according to all attributes.
214
+ # @return [Integer] Hash code
215
+ def hash
216
+ [created_dts, exclude_from_sitemap, hash_sha256, modified_dts, note, pinned_page_path, redirect_id, source, status, target, target_invalid, target_invalid_message, type].hash
217
+ end
218
+
219
+ # Builds the object from hash
220
+ # @param [Hash] attributes Model attributes in the form of hash
221
+ # @return [Object] Returns the model itself
222
+ def self.build_from_hash(attributes)
223
+ new.build_from_hash(attributes)
224
+ end
225
+
226
+ # Builds the object from hash
227
+ # @param [Hash] attributes Model attributes in the form of hash
228
+ # @return [Object] Returns the model itself
229
+ def build_from_hash(attributes)
230
+ return nil unless attributes.is_a?(Hash)
231
+ attributes = attributes.transform_keys(&:to_sym)
232
+ self.class.openapi_types.each_pair do |key, type|
233
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
234
+ self.send("#{key}=", nil)
235
+ elsif type =~ /\AArray<(.*)>/i
236
+ # check to ensure the input is an array given that the attribute
237
+ # is documented as an array but the input is not
238
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
239
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
240
+ end
241
+ elsif !attributes[self.class.attribute_map[key]].nil?
242
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
243
+ end
244
+ end
245
+
246
+ self
247
+ end
248
+
249
+ # Deserializes the data based on type
250
+ # @param string type Data type
251
+ # @param string value Value to be deserialized
252
+ # @return [Object] Deserialized data
253
+ def _deserialize(type, value)
254
+ case type.to_sym
255
+ when :Time
256
+ Time.parse(value)
257
+ when :Date
258
+ Date.parse(value)
259
+ when :String
260
+ value.to_s
261
+ when :Integer
262
+ value.to_i
263
+ when :Float
264
+ value.to_f
265
+ when :Boolean
266
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
267
+ true
268
+ else
269
+ false
270
+ end
271
+ when :Object
272
+ # generic object (usually a Hash), return directly
273
+ value
274
+ when /\AArray<(?<inner_type>.+)>\z/
275
+ inner_type = Regexp.last_match[:inner_type]
276
+ value.map { |v| _deserialize(inner_type, v) }
277
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
278
+ k_type = Regexp.last_match[:k_type]
279
+ v_type = Regexp.last_match[:v_type]
280
+ {}.tap do |hash|
281
+ value.each do |k, v|
282
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
283
+ end
284
+ end
285
+ else # model
286
+ # models (e.g. Pet) or oneOf
287
+ klass = UltracartClient.const_get(type)
288
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
289
+ end
290
+ end
291
+
292
+ # Returns the string representation of the object
293
+ # @return [String] String presentation of the object
294
+ def to_s
295
+ to_hash.to_s
296
+ end
297
+
298
+ # to_body is an alias to to_hash (backward compatibility)
299
+ # @return [Hash] Returns the object in the form of hash
300
+ def to_body
301
+ to_hash
302
+ end
303
+
304
+ # Returns the object in the form of hash
305
+ # @return [Hash] Returns the object in the form of hash
306
+ def to_hash
307
+ hash = {}
308
+ self.class.attribute_map.each_pair do |attr, param|
309
+ value = self.send(attr)
310
+ if value.nil?
311
+ is_nullable = self.class.openapi_nullable.include?(attr)
312
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
313
+ end
314
+
315
+ hash[param] = _to_hash(value)
316
+ end
317
+ hash
318
+ end
319
+
320
+ # Outputs non-array value in the form of hash
321
+ # For object, use to_hash. Otherwise, just return the value
322
+ # @param [Object] value Any valid value
323
+ # @return [Hash] Returns the value in the form of hash
324
+ def _to_hash(value)
325
+ if value.is_a?(Array)
326
+ value.compact.map { |v| _to_hash(v) }
327
+ elsif value.is_a?(Hash)
328
+ {}.tap do |hash|
329
+ value.each { |k, v| hash[k] = _to_hash(v) }
330
+ end
331
+ elsif value.respond_to? :to_hash
332
+ value.to_hash
333
+ else
334
+ value
335
+ end
336
+ end
337
+
338
+ end
339
+
340
+ end