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,292 @@
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 SfvbRedirectImportResponse
18
+ # True when the rows were written.
19
+ attr_accessor :applied
20
+
21
+ # How many rows have a blocking finding. Any blocked row means nothing is applied.
22
+ attr_accessor :blocked
23
+
24
+ # How many rows have only warnings.
25
+ attr_accessor :flagged
26
+
27
+ # The most rules a storefront may have through SFVB.
28
+ attr_accessor :limit
29
+
30
+ # Send back with the same rows to apply exactly this plan.
31
+ attr_accessor :plan_hash
32
+
33
+ # The rows with findings.
34
+ attr_accessor :rows
35
+
36
+ # How many rules the storefront has, or would have after applying.
37
+ attr_accessor :rule_count
38
+
39
+ # How many rows were sent.
40
+ attr_accessor :total
41
+
42
+ # Attribute mapping from ruby-style variable name to JSON key.
43
+ def self.attribute_map
44
+ {
45
+ :'applied' => :'applied',
46
+ :'blocked' => :'blocked',
47
+ :'flagged' => :'flagged',
48
+ :'limit' => :'limit',
49
+ :'plan_hash' => :'plan_hash',
50
+ :'rows' => :'rows',
51
+ :'rule_count' => :'rule_count',
52
+ :'total' => :'total'
53
+ }
54
+ end
55
+
56
+ # Returns all the JSON keys this model knows about
57
+ def self.acceptable_attributes
58
+ attribute_map.values
59
+ end
60
+
61
+ # Attribute type mapping.
62
+ def self.openapi_types
63
+ {
64
+ :'applied' => :'Boolean',
65
+ :'blocked' => :'Integer',
66
+ :'flagged' => :'Integer',
67
+ :'limit' => :'Integer',
68
+ :'plan_hash' => :'String',
69
+ :'rows' => :'Array<SfvbRedirectImportRowResult>',
70
+ :'rule_count' => :'Integer',
71
+ :'total' => :'Integer'
72
+ }
73
+ end
74
+
75
+ # List of attributes with nullable: true
76
+ def self.openapi_nullable
77
+ Set.new([
78
+ ])
79
+ end
80
+
81
+ # Initializes the object
82
+ # @param [Hash] attributes Model attributes in the form of hash
83
+ def initialize(attributes = {})
84
+ if (!attributes.is_a?(Hash))
85
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbRedirectImportResponse` initialize method"
86
+ end
87
+
88
+ # check to see if the attribute exists and convert string to symbol for hash key
89
+ attributes = attributes.each_with_object({}) { |(k, v), h|
90
+ if (!self.class.attribute_map.key?(k.to_sym))
91
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbRedirectImportResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
92
+ end
93
+ h[k.to_sym] = v
94
+ }
95
+
96
+ if attributes.key?(:'applied')
97
+ self.applied = attributes[:'applied']
98
+ end
99
+
100
+ if attributes.key?(:'blocked')
101
+ self.blocked = attributes[:'blocked']
102
+ end
103
+
104
+ if attributes.key?(:'flagged')
105
+ self.flagged = attributes[:'flagged']
106
+ end
107
+
108
+ if attributes.key?(:'limit')
109
+ self.limit = attributes[:'limit']
110
+ end
111
+
112
+ if attributes.key?(:'plan_hash')
113
+ self.plan_hash = attributes[:'plan_hash']
114
+ end
115
+
116
+ if attributes.key?(:'rows')
117
+ if (value = attributes[:'rows']).is_a?(Array)
118
+ self.rows = value
119
+ end
120
+ end
121
+
122
+ if attributes.key?(:'rule_count')
123
+ self.rule_count = attributes[:'rule_count']
124
+ end
125
+
126
+ if attributes.key?(:'total')
127
+ self.total = attributes[:'total']
128
+ end
129
+ end
130
+
131
+ # Show invalid properties with the reasons. Usually used together with valid?
132
+ # @return Array for valid properties with the reasons
133
+ def list_invalid_properties
134
+ invalid_properties = Array.new
135
+ invalid_properties
136
+ end
137
+
138
+ # Check to see if the all the properties in the model are valid
139
+ # @return true if the model is valid
140
+ def valid?
141
+ true
142
+ end
143
+
144
+ # Checks equality by comparing each attribute.
145
+ # @param [Object] Object to be compared
146
+ def ==(o)
147
+ return true if self.equal?(o)
148
+ self.class == o.class &&
149
+ applied == o.applied &&
150
+ blocked == o.blocked &&
151
+ flagged == o.flagged &&
152
+ limit == o.limit &&
153
+ plan_hash == o.plan_hash &&
154
+ rows == o.rows &&
155
+ rule_count == o.rule_count &&
156
+ total == o.total
157
+ end
158
+
159
+ # @see the `==` method
160
+ # @param [Object] Object to be compared
161
+ def eql?(o)
162
+ self == o
163
+ end
164
+
165
+ # Calculates hash code according to all attributes.
166
+ # @return [Integer] Hash code
167
+ def hash
168
+ [applied, blocked, flagged, limit, plan_hash, rows, rule_count, total].hash
169
+ end
170
+
171
+ # Builds the object from hash
172
+ # @param [Hash] attributes Model attributes in the form of hash
173
+ # @return [Object] Returns the model itself
174
+ def self.build_from_hash(attributes)
175
+ new.build_from_hash(attributes)
176
+ end
177
+
178
+ # Builds the object from hash
179
+ # @param [Hash] attributes Model attributes in the form of hash
180
+ # @return [Object] Returns the model itself
181
+ def build_from_hash(attributes)
182
+ return nil unless attributes.is_a?(Hash)
183
+ attributes = attributes.transform_keys(&:to_sym)
184
+ self.class.openapi_types.each_pair do |key, type|
185
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
186
+ self.send("#{key}=", nil)
187
+ elsif type =~ /\AArray<(.*)>/i
188
+ # check to ensure the input is an array given that the attribute
189
+ # is documented as an array but the input is not
190
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
191
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
192
+ end
193
+ elsif !attributes[self.class.attribute_map[key]].nil?
194
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
195
+ end
196
+ end
197
+
198
+ self
199
+ end
200
+
201
+ # Deserializes the data based on type
202
+ # @param string type Data type
203
+ # @param string value Value to be deserialized
204
+ # @return [Object] Deserialized data
205
+ def _deserialize(type, value)
206
+ case type.to_sym
207
+ when :Time
208
+ Time.parse(value)
209
+ when :Date
210
+ Date.parse(value)
211
+ when :String
212
+ value.to_s
213
+ when :Integer
214
+ value.to_i
215
+ when :Float
216
+ value.to_f
217
+ when :Boolean
218
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
219
+ true
220
+ else
221
+ false
222
+ end
223
+ when :Object
224
+ # generic object (usually a Hash), return directly
225
+ value
226
+ when /\AArray<(?<inner_type>.+)>\z/
227
+ inner_type = Regexp.last_match[:inner_type]
228
+ value.map { |v| _deserialize(inner_type, v) }
229
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
230
+ k_type = Regexp.last_match[:k_type]
231
+ v_type = Regexp.last_match[:v_type]
232
+ {}.tap do |hash|
233
+ value.each do |k, v|
234
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
235
+ end
236
+ end
237
+ else # model
238
+ # models (e.g. Pet) or oneOf
239
+ klass = UltracartClient.const_get(type)
240
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
241
+ end
242
+ end
243
+
244
+ # Returns the string representation of the object
245
+ # @return [String] String presentation of the object
246
+ def to_s
247
+ to_hash.to_s
248
+ end
249
+
250
+ # to_body is an alias to to_hash (backward compatibility)
251
+ # @return [Hash] Returns the object in the form of hash
252
+ def to_body
253
+ to_hash
254
+ end
255
+
256
+ # Returns the object in the form of hash
257
+ # @return [Hash] Returns the object in the form of hash
258
+ def to_hash
259
+ hash = {}
260
+ self.class.attribute_map.each_pair do |attr, param|
261
+ value = self.send(attr)
262
+ if value.nil?
263
+ is_nullable = self.class.openapi_nullable.include?(attr)
264
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
265
+ end
266
+
267
+ hash[param] = _to_hash(value)
268
+ end
269
+ hash
270
+ end
271
+
272
+ # Outputs non-array value in the form of hash
273
+ # For object, use to_hash. Otherwise, just return the value
274
+ # @param [Object] value Any valid value
275
+ # @return [Hash] Returns the value in the form of hash
276
+ def _to_hash(value)
277
+ if value.is_a?(Array)
278
+ value.compact.map { |v| _to_hash(v) }
279
+ elsif value.is_a?(Hash)
280
+ {}.tap do |hash|
281
+ value.each { |k, v| hash[k] = _to_hash(v) }
282
+ end
283
+ elsif value.respond_to? :to_hash
284
+ value.to_hash
285
+ else
286
+ value
287
+ end
288
+ end
289
+
290
+ end
291
+
292
+ end
@@ -0,0 +1,240 @@
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 SfvbRedirectImportRow
18
+ # Why the rule exists.
19
+ attr_accessor :note
20
+
21
+ # The path to catch.
22
+ attr_accessor :source
23
+
24
+ # Where to send it.
25
+ attr_accessor :target
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'note' => :'note',
31
+ :'source' => :'source',
32
+ :'target' => :'target'
33
+ }
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'note' => :'String',
45
+ :'source' => :'String',
46
+ :'target' => :'String'
47
+ }
48
+ end
49
+
50
+ # List of attributes with nullable: true
51
+ def self.openapi_nullable
52
+ Set.new([
53
+ ])
54
+ end
55
+
56
+ # Initializes the object
57
+ # @param [Hash] attributes Model attributes in the form of hash
58
+ def initialize(attributes = {})
59
+ if (!attributes.is_a?(Hash))
60
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbRedirectImportRow` initialize method"
61
+ end
62
+
63
+ # check to see if the attribute exists and convert string to symbol for hash key
64
+ attributes = attributes.each_with_object({}) { |(k, v), h|
65
+ if (!self.class.attribute_map.key?(k.to_sym))
66
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbRedirectImportRow`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
67
+ end
68
+ h[k.to_sym] = v
69
+ }
70
+
71
+ if attributes.key?(:'note')
72
+ self.note = attributes[:'note']
73
+ end
74
+
75
+ if attributes.key?(:'source')
76
+ self.source = attributes[:'source']
77
+ end
78
+
79
+ if attributes.key?(:'target')
80
+ self.target = attributes[:'target']
81
+ end
82
+ end
83
+
84
+ # Show invalid properties with the reasons. Usually used together with valid?
85
+ # @return Array for valid properties with the reasons
86
+ def list_invalid_properties
87
+ invalid_properties = Array.new
88
+ invalid_properties
89
+ end
90
+
91
+ # Check to see if the all the properties in the model are valid
92
+ # @return true if the model is valid
93
+ def valid?
94
+ true
95
+ end
96
+
97
+ # Checks equality by comparing each attribute.
98
+ # @param [Object] Object to be compared
99
+ def ==(o)
100
+ return true if self.equal?(o)
101
+ self.class == o.class &&
102
+ note == o.note &&
103
+ source == o.source &&
104
+ target == o.target
105
+ end
106
+
107
+ # @see the `==` method
108
+ # @param [Object] Object to be compared
109
+ def eql?(o)
110
+ self == o
111
+ end
112
+
113
+ # Calculates hash code according to all attributes.
114
+ # @return [Integer] Hash code
115
+ def hash
116
+ [note, source, target].hash
117
+ end
118
+
119
+ # Builds the object from hash
120
+ # @param [Hash] attributes Model attributes in the form of hash
121
+ # @return [Object] Returns the model itself
122
+ def self.build_from_hash(attributes)
123
+ new.build_from_hash(attributes)
124
+ end
125
+
126
+ # Builds the object from hash
127
+ # @param [Hash] attributes Model attributes in the form of hash
128
+ # @return [Object] Returns the model itself
129
+ def build_from_hash(attributes)
130
+ return nil unless attributes.is_a?(Hash)
131
+ attributes = attributes.transform_keys(&:to_sym)
132
+ self.class.openapi_types.each_pair do |key, type|
133
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
134
+ self.send("#{key}=", nil)
135
+ elsif type =~ /\AArray<(.*)>/i
136
+ # check to ensure the input is an array given that the attribute
137
+ # is documented as an array but the input is not
138
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
139
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
140
+ end
141
+ elsif !attributes[self.class.attribute_map[key]].nil?
142
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
143
+ end
144
+ end
145
+
146
+ self
147
+ end
148
+
149
+ # Deserializes the data based on type
150
+ # @param string type Data type
151
+ # @param string value Value to be deserialized
152
+ # @return [Object] Deserialized data
153
+ def _deserialize(type, value)
154
+ case type.to_sym
155
+ when :Time
156
+ Time.parse(value)
157
+ when :Date
158
+ Date.parse(value)
159
+ when :String
160
+ value.to_s
161
+ when :Integer
162
+ value.to_i
163
+ when :Float
164
+ value.to_f
165
+ when :Boolean
166
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
167
+ true
168
+ else
169
+ false
170
+ end
171
+ when :Object
172
+ # generic object (usually a Hash), return directly
173
+ value
174
+ when /\AArray<(?<inner_type>.+)>\z/
175
+ inner_type = Regexp.last_match[:inner_type]
176
+ value.map { |v| _deserialize(inner_type, v) }
177
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
178
+ k_type = Regexp.last_match[:k_type]
179
+ v_type = Regexp.last_match[:v_type]
180
+ {}.tap do |hash|
181
+ value.each do |k, v|
182
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
183
+ end
184
+ end
185
+ else # model
186
+ # models (e.g. Pet) or oneOf
187
+ klass = UltracartClient.const_get(type)
188
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
189
+ end
190
+ end
191
+
192
+ # Returns the string representation of the object
193
+ # @return [String] String presentation of the object
194
+ def to_s
195
+ to_hash.to_s
196
+ end
197
+
198
+ # to_body is an alias to to_hash (backward compatibility)
199
+ # @return [Hash] Returns the object in the form of hash
200
+ def to_body
201
+ to_hash
202
+ end
203
+
204
+ # Returns the object in the form of hash
205
+ # @return [Hash] Returns the object in the form of hash
206
+ def to_hash
207
+ hash = {}
208
+ self.class.attribute_map.each_pair do |attr, param|
209
+ value = self.send(attr)
210
+ if value.nil?
211
+ is_nullable = self.class.openapi_nullable.include?(attr)
212
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
213
+ end
214
+
215
+ hash[param] = _to_hash(value)
216
+ end
217
+ hash
218
+ end
219
+
220
+ # Outputs non-array value in the form of hash
221
+ # For object, use to_hash. Otherwise, just return the value
222
+ # @param [Object] value Any valid value
223
+ # @return [Hash] Returns the value in the form of hash
224
+ def _to_hash(value)
225
+ if value.is_a?(Array)
226
+ value.compact.map { |v| _to_hash(v) }
227
+ elsif value.is_a?(Hash)
228
+ {}.tap do |hash|
229
+ value.each { |k, v| hash[k] = _to_hash(v) }
230
+ end
231
+ elsif value.respond_to? :to_hash
232
+ value.to_hash
233
+ else
234
+ value
235
+ end
236
+ end
237
+
238
+ end
239
+
240
+ end