ultracart_api 4.1.198 → 4.1.200

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 (45) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +30 -2
  3. data/docs/SfvbApi.md +582 -15
  4. data/docs/SfvbApproval.md +3 -1
  5. data/docs/SfvbApprovalCreateRequest.md +11 -1
  6. data/docs/SfvbApprovalParams.md +30 -2
  7. data/docs/SfvbApprovalReview.md +36 -0
  8. data/docs/SfvbApprovalReviewFinding.md +24 -0
  9. data/docs/SfvbItemAttributeBatchRequest.md +20 -0
  10. data/docs/SfvbItemAttributeBatchResponse.md +40 -0
  11. data/docs/SfvbItemAttributeBatchRow.md +30 -0
  12. data/docs/SfvbItemAttributeBatchRowResult.md +36 -0
  13. data/docs/SfvbItemPricing.md +38 -0
  14. data/docs/SfvbItemPricingRequest.md +32 -0
  15. data/docs/SfvbItemRelated.md +28 -0
  16. data/docs/SfvbItemRelatedItem.md +22 -0
  17. data/docs/SfvbItemRelatedRequest.md +22 -0
  18. data/docs/SfvbItemVolumeDiscount.md +20 -0
  19. data/docs/SfvbRedirectDeleteRequest.md +20 -0
  20. data/docs/SfvbRedirectDeleteResponse.md +36 -0
  21. data/docs/SfvbRedirectDeleteRow.md +20 -0
  22. data/docs/SfvbRedirectDeleteRowResult.md +32 -0
  23. data/lib/ultracart_api/api/sfvb_api.rb +852 -69
  24. data/lib/ultracart_api/models/sfvb_approval.rb +13 -4
  25. data/lib/ultracart_api/models/sfvb_approval_create_request.rb +58 -6
  26. data/lib/ultracart_api/models/sfvb_approval_params.rb +181 -5
  27. data/lib/ultracart_api/models/sfvb_approval_review.rb +354 -0
  28. data/lib/ultracart_api/models/sfvb_approval_review_finding.rb +250 -0
  29. data/lib/ultracart_api/models/sfvb_item_attribute_batch_request.rb +232 -0
  30. data/lib/ultracart_api/models/sfvb_item_attribute_batch_response.rb +332 -0
  31. data/lib/ultracart_api/models/sfvb_item_attribute_batch_row.rb +280 -0
  32. data/lib/ultracart_api/models/sfvb_item_attribute_batch_row_result.rb +344 -0
  33. data/lib/ultracart_api/models/sfvb_item_pricing.rb +322 -0
  34. data/lib/ultracart_api/models/sfvb_item_pricing_request.rb +292 -0
  35. data/lib/ultracart_api/models/sfvb_item_related.rb +272 -0
  36. data/lib/ultracart_api/models/sfvb_item_related_item.rb +274 -0
  37. data/lib/ultracart_api/models/sfvb_item_related_request.rb +242 -0
  38. data/lib/ultracart_api/models/sfvb_item_volume_discount.rb +230 -0
  39. data/lib/ultracart_api/models/sfvb_redirect_delete_request.rb +232 -0
  40. data/lib/ultracart_api/models/sfvb_redirect_delete_response.rb +312 -0
  41. data/lib/ultracart_api/models/sfvb_redirect_delete_row.rb +230 -0
  42. data/lib/ultracart_api/models/sfvb_redirect_delete_row_result.rb +324 -0
  43. data/lib/ultracart_api/version.rb +1 -1
  44. data/lib/ultracart_api.rb +16 -0
  45. metadata +34 -2
@@ -56,10 +56,12 @@ module UltracartClient
56
56
  # The reason the agent sent, as stored and shown (cleaned and capped).
57
57
  attr_accessor :reason
58
58
 
59
+ attr_accessor :review
60
+
59
61
  # Where the action applies. The storefront host name, or account for account-wide actions.
60
62
  attr_accessor :scope
61
63
 
62
- # pending, approved, denied, cancelled, expired or used. Only approved may be sent with the gated call.
64
+ # reviewing, pending, approved, denied, cancelled, expired, used or refused. Only approved may be sent with the gated call. A script write starts as reviewing while UltraCart reviews it; keep polling, and show approval_url only once it is pending. refused means the review refused the script; outcome_code and review say why.
63
65
  attr_accessor :status
64
66
 
65
67
  # The storefront the action runs on. Absent for account-wide actions.
@@ -110,6 +112,7 @@ module UltracartClient
110
112
  :'outcome_http_status' => :'outcome_http_status',
111
113
  :'params' => :'params',
112
114
  :'reason' => :'reason',
115
+ :'review' => :'review',
113
116
  :'scope' => :'scope',
114
117
  :'status' => :'status',
115
118
  :'storefront_oid' => :'storefront_oid',
@@ -140,6 +143,7 @@ module UltracartClient
140
143
  :'outcome_http_status' => :'Integer',
141
144
  :'params' => :'SfvbApprovalParams',
142
145
  :'reason' => :'String',
146
+ :'review' => :'SfvbApprovalReview',
143
147
  :'scope' => :'String',
144
148
  :'status' => :'String',
145
149
  :'storefront_oid' => :'Integer',
@@ -225,6 +229,10 @@ module UltracartClient
225
229
  self.reason = attributes[:'reason']
226
230
  end
227
231
 
232
+ if attributes.key?(:'review')
233
+ self.review = attributes[:'review']
234
+ end
235
+
228
236
  if attributes.key?(:'scope')
229
237
  self.scope = attributes[:'scope']
230
238
  end
@@ -258,7 +266,7 @@ module UltracartClient
258
266
  def valid?
259
267
  outcome_validator = EnumAttributeValidator.new('String', ["succeeded", "failed"])
260
268
  return false unless outcome_validator.valid?(@outcome)
261
- status_validator = EnumAttributeValidator.new('String', ["pending", "approved", "denied", "cancelled", "expired", "used"])
269
+ status_validator = EnumAttributeValidator.new('String', ["reviewing", "pending", "approved", "denied", "cancelled", "expired", "used", "refused"])
262
270
  return false unless status_validator.valid?(@status)
263
271
  true
264
272
  end
@@ -276,7 +284,7 @@ module UltracartClient
276
284
  # Custom attribute writer method checking allowed values (enum).
277
285
  # @param [Object] status Object to be assigned
278
286
  def status=(status)
279
- validator = EnumAttributeValidator.new('String', ["pending", "approved", "denied", "cancelled", "expired", "used"])
287
+ validator = EnumAttributeValidator.new('String', ["reviewing", "pending", "approved", "denied", "cancelled", "expired", "used", "refused"])
280
288
  unless validator.valid?(status)
281
289
  fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
282
290
  end
@@ -302,6 +310,7 @@ module UltracartClient
302
310
  outcome_http_status == o.outcome_http_status &&
303
311
  params == o.params &&
304
312
  reason == o.reason &&
313
+ review == o.review &&
305
314
  scope == o.scope &&
306
315
  status == o.status &&
307
316
  storefront_oid == o.storefront_oid &&
@@ -318,7 +327,7 @@ module UltracartClient
318
327
  # Calculates hash code according to all attributes.
319
328
  # @return [Integer] Hash code
320
329
  def hash
321
- [action, approval_id, approval_url, created_at, description, expires_at, expires_in_seconds, fresh_code_required, interval_seconds, outcome, outcome_code, outcome_http_status, params, reason, scope, status, storefront_oid, used_at, user_code].hash
330
+ [action, approval_id, approval_url, created_at, description, expires_at, expires_in_seconds, fresh_code_required, interval_seconds, outcome, outcome_code, outcome_http_status, params, reason, review, scope, status, storefront_oid, used_at, user_code].hash
322
331
  end
323
332
 
324
333
  # Builds the object from hash
@@ -18,11 +18,24 @@ module UltracartClient
18
18
  # The gated action to approve.
19
19
  attr_accessor :action
20
20
 
21
+ # For a file.put_script write, the exact script to be written, at most 256 KB. UltraCart reviews it and keeps only its hash, so send the same bytes again on the write. Leave it out for a revert, which names params.version.
22
+ attr_accessor :content
23
+
24
+ attr_accessor :experiment_start
25
+
26
+ # For item.attribute_batch, exactly the rows the batch will send - the dry run's change rows, each with merchant_item_oid and current_sha256. UltraCart keeps only their hash.
27
+ attr_accessor :item_attribute_rows
28
+
29
+ attr_accessor :item_pricing
30
+
21
31
  attr_accessor :params
22
32
 
23
33
  # Why the agent wants to do this, in a sentence. Shown to the person as unverified text, capped at 500 characters.
24
34
  attr_accessor :reason
25
35
 
36
+ # For redirect.delete_batch, exactly the rows the batch delete will send, up to 5,000, each with its hash_sha256. UltraCart keeps only their hash.
37
+ attr_accessor :redirect_rows
38
+
26
39
  class EnumAttributeValidator
27
40
  attr_reader :datatype
28
41
  attr_reader :allowable_values
@@ -49,8 +62,13 @@ module UltracartClient
49
62
  def self.attribute_map
50
63
  {
51
64
  :'action' => :'action',
65
+ :'content' => :'content',
66
+ :'experiment_start' => :'experiment_start',
67
+ :'item_attribute_rows' => :'item_attribute_rows',
68
+ :'item_pricing' => :'item_pricing',
52
69
  :'params' => :'params',
53
- :'reason' => :'reason'
70
+ :'reason' => :'reason',
71
+ :'redirect_rows' => :'redirect_rows'
54
72
  }
55
73
  end
56
74
 
@@ -63,8 +81,13 @@ module UltracartClient
63
81
  def self.openapi_types
64
82
  {
65
83
  :'action' => :'String',
84
+ :'content' => :'String',
85
+ :'experiment_start' => :'SfvbExperimentStartRequest',
86
+ :'item_attribute_rows' => :'Array<SfvbItemAttributeBatchRow>',
87
+ :'item_pricing' => :'SfvbItemPricingRequest',
66
88
  :'params' => :'SfvbApprovalParams',
67
- :'reason' => :'String'
89
+ :'reason' => :'String',
90
+ :'redirect_rows' => :'Array<SfvbRedirectDeleteRow>'
68
91
  }
69
92
  end
70
93
 
@@ -93,6 +116,24 @@ module UltracartClient
93
116
  self.action = attributes[:'action']
94
117
  end
95
118
 
119
+ if attributes.key?(:'content')
120
+ self.content = attributes[:'content']
121
+ end
122
+
123
+ if attributes.key?(:'experiment_start')
124
+ self.experiment_start = attributes[:'experiment_start']
125
+ end
126
+
127
+ if attributes.key?(:'item_attribute_rows')
128
+ if (value = attributes[:'item_attribute_rows']).is_a?(Array)
129
+ self.item_attribute_rows = value
130
+ end
131
+ end
132
+
133
+ if attributes.key?(:'item_pricing')
134
+ self.item_pricing = attributes[:'item_pricing']
135
+ end
136
+
96
137
  if attributes.key?(:'params')
97
138
  self.params = attributes[:'params']
98
139
  end
@@ -100,6 +141,12 @@ module UltracartClient
100
141
  if attributes.key?(:'reason')
101
142
  self.reason = attributes[:'reason']
102
143
  end
144
+
145
+ if attributes.key?(:'redirect_rows')
146
+ if (value = attributes[:'redirect_rows']).is_a?(Array)
147
+ self.redirect_rows = value
148
+ end
149
+ end
103
150
  end
104
151
 
105
152
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -112,7 +159,7 @@ module UltracartClient
112
159
  # Check to see if the all the properties in the model are valid
113
160
  # @return true if the model is valid
114
161
  def valid?
115
- action_validator = EnumAttributeValidator.new('String', ["file.delete", "blog_post.delete"])
162
+ action_validator = EnumAttributeValidator.new('String', ["file.delete", "blog_post.delete", "file.put_script", "redirect.delete_batch", "experiment.start", "experiment.end", "upsell.enable", "item.attribute_batch", "item.pricing"])
116
163
  return false unless action_validator.valid?(@action)
117
164
  true
118
165
  end
@@ -120,7 +167,7 @@ module UltracartClient
120
167
  # Custom attribute writer method checking allowed values (enum).
121
168
  # @param [Object] action Object to be assigned
122
169
  def action=(action)
123
- validator = EnumAttributeValidator.new('String', ["file.delete", "blog_post.delete"])
170
+ validator = EnumAttributeValidator.new('String', ["file.delete", "blog_post.delete", "file.put_script", "redirect.delete_batch", "experiment.start", "experiment.end", "upsell.enable", "item.attribute_batch", "item.pricing"])
124
171
  unless validator.valid?(action)
125
172
  fail ArgumentError, "invalid value for \"action\", must be one of #{validator.allowable_values}."
126
173
  end
@@ -133,8 +180,13 @@ module UltracartClient
133
180
  return true if self.equal?(o)
134
181
  self.class == o.class &&
135
182
  action == o.action &&
183
+ content == o.content &&
184
+ experiment_start == o.experiment_start &&
185
+ item_attribute_rows == o.item_attribute_rows &&
186
+ item_pricing == o.item_pricing &&
136
187
  params == o.params &&
137
- reason == o.reason
188
+ reason == o.reason &&
189
+ redirect_rows == o.redirect_rows
138
190
  end
139
191
 
140
192
  # @see the `==` method
@@ -146,7 +198,7 @@ module UltracartClient
146
198
  # Calculates hash code according to all attributes.
147
199
  # @return [Integer] Hash code
148
200
  def hash
149
- [action, params, reason].hash
201
+ [action, content, experiment_start, item_attribute_rows, item_pricing, params, reason, redirect_rows].hash
150
202
  end
151
203
 
152
204
  # Builds the object from hash
@@ -15,17 +15,95 @@ require 'time'
15
15
 
16
16
  module UltracartClient
17
17
  class SfvbApprovalParams
18
+ # For item.attribute_batch, the attributes the batch would change. Set by the server.
19
+ attr_accessor :attribute_names
20
+
18
21
  # The blog post, for blog_post.delete.
19
22
  attr_accessor :blog_post_oid
20
23
 
21
- # The file path, for file.delete. Exactly as the delete call will send it.
24
+ # For file.put_script, the SHA-256 of the exact bytes approved. Set by the server, never by the caller. The write must send bytes with this hash.
25
+ attr_accessor :content_sha256
26
+
27
+ # For experiment.end, the experiment to end.
28
+ attr_accessor :experiment_oid
29
+
30
+ # For item.attribute_batch, how many items the batch would change when it was requested. Set by the server.
31
+ attr_accessor :item_count
32
+
33
+ # For item.pricing, the item whose pricing changes.
34
+ attr_accessor :merchant_item_oid
35
+
36
+ # The file path, for file.delete and file.put_script, or the page path for experiment.start of a page experiment. Exactly as the gated call will send it.
22
37
  attr_accessor :path
23
38
 
39
+ # For experiment.start of a url experiment, the hash of the checked experiment approved, and for item.pricing the hash of the change. Set by the server. The gated call must send the same.
40
+ attr_accessor :request_sha256
41
+
42
+ # For redirect.delete_batch and item.attribute_batch, the plan_hash of the exact rows approved. Set by the server. The batch must send rows with this hash.
43
+ attr_accessor :rows_sha256
44
+
45
+ # For redirect.delete_batch, how many rules the batch would delete when it was requested. Set by the server.
46
+ attr_accessor :rule_count
47
+
48
+ # For experiment.start of a page experiment, the page body name. Defaults to body.
49
+ attr_accessor :slot
50
+
51
+ # For upsell.enable, what to switch on.
52
+ attr_accessor :upsell_kind
53
+
54
+ # For upsell.enable, the oid of the offer or path to switch on.
55
+ attr_accessor :upsell_oid
56
+
57
+ # For file.put_script, the history version a revert restores. Leave it out, and send content instead, for a write.
58
+ attr_accessor :version
59
+
60
+ # For experiment.start of a page experiment, the id of the experiment element.
61
+ attr_accessor :widget_id
62
+
63
+ # For experiment.end, the winning variation. Leave it out to end without a winner, and leave it out of the end call too.
64
+ attr_accessor :winner_variation_number
65
+
66
+ class EnumAttributeValidator
67
+ attr_reader :datatype
68
+ attr_reader :allowable_values
69
+
70
+ def initialize(datatype, allowable_values)
71
+ @allowable_values = allowable_values.map do |value|
72
+ case datatype.to_s
73
+ when /Integer/i
74
+ value.to_i
75
+ when /Float/i
76
+ value.to_f
77
+ else
78
+ value
79
+ end
80
+ end
81
+ end
82
+
83
+ def valid?(value)
84
+ !value || allowable_values.include?(value)
85
+ end
86
+ end
87
+
24
88
  # Attribute mapping from ruby-style variable name to JSON key.
25
89
  def self.attribute_map
26
90
  {
91
+ :'attribute_names' => :'attribute_names',
27
92
  :'blog_post_oid' => :'blog_post_oid',
28
- :'path' => :'path'
93
+ :'content_sha256' => :'content_sha256',
94
+ :'experiment_oid' => :'experiment_oid',
95
+ :'item_count' => :'item_count',
96
+ :'merchant_item_oid' => :'merchant_item_oid',
97
+ :'path' => :'path',
98
+ :'request_sha256' => :'request_sha256',
99
+ :'rows_sha256' => :'rows_sha256',
100
+ :'rule_count' => :'rule_count',
101
+ :'slot' => :'slot',
102
+ :'upsell_kind' => :'upsell_kind',
103
+ :'upsell_oid' => :'upsell_oid',
104
+ :'version' => :'version',
105
+ :'widget_id' => :'widget_id',
106
+ :'winner_variation_number' => :'winner_variation_number'
29
107
  }
30
108
  end
31
109
 
@@ -37,8 +115,22 @@ module UltracartClient
37
115
  # Attribute type mapping.
38
116
  def self.openapi_types
39
117
  {
118
+ :'attribute_names' => :'Array<String>',
40
119
  :'blog_post_oid' => :'Integer',
41
- :'path' => :'String'
120
+ :'content_sha256' => :'String',
121
+ :'experiment_oid' => :'Integer',
122
+ :'item_count' => :'Integer',
123
+ :'merchant_item_oid' => :'Integer',
124
+ :'path' => :'String',
125
+ :'request_sha256' => :'String',
126
+ :'rows_sha256' => :'String',
127
+ :'rule_count' => :'Integer',
128
+ :'slot' => :'String',
129
+ :'upsell_kind' => :'String',
130
+ :'upsell_oid' => :'Integer',
131
+ :'version' => :'Integer',
132
+ :'widget_id' => :'String',
133
+ :'winner_variation_number' => :'Integer'
42
134
  }
43
135
  end
44
136
 
@@ -63,13 +155,71 @@ module UltracartClient
63
155
  h[k.to_sym] = v
64
156
  }
65
157
 
158
+ if attributes.key?(:'attribute_names')
159
+ if (value = attributes[:'attribute_names']).is_a?(Array)
160
+ self.attribute_names = value
161
+ end
162
+ end
163
+
66
164
  if attributes.key?(:'blog_post_oid')
67
165
  self.blog_post_oid = attributes[:'blog_post_oid']
68
166
  end
69
167
 
168
+ if attributes.key?(:'content_sha256')
169
+ self.content_sha256 = attributes[:'content_sha256']
170
+ end
171
+
172
+ if attributes.key?(:'experiment_oid')
173
+ self.experiment_oid = attributes[:'experiment_oid']
174
+ end
175
+
176
+ if attributes.key?(:'item_count')
177
+ self.item_count = attributes[:'item_count']
178
+ end
179
+
180
+ if attributes.key?(:'merchant_item_oid')
181
+ self.merchant_item_oid = attributes[:'merchant_item_oid']
182
+ end
183
+
70
184
  if attributes.key?(:'path')
71
185
  self.path = attributes[:'path']
72
186
  end
187
+
188
+ if attributes.key?(:'request_sha256')
189
+ self.request_sha256 = attributes[:'request_sha256']
190
+ end
191
+
192
+ if attributes.key?(:'rows_sha256')
193
+ self.rows_sha256 = attributes[:'rows_sha256']
194
+ end
195
+
196
+ if attributes.key?(:'rule_count')
197
+ self.rule_count = attributes[:'rule_count']
198
+ end
199
+
200
+ if attributes.key?(:'slot')
201
+ self.slot = attributes[:'slot']
202
+ end
203
+
204
+ if attributes.key?(:'upsell_kind')
205
+ self.upsell_kind = attributes[:'upsell_kind']
206
+ end
207
+
208
+ if attributes.key?(:'upsell_oid')
209
+ self.upsell_oid = attributes[:'upsell_oid']
210
+ end
211
+
212
+ if attributes.key?(:'version')
213
+ self.version = attributes[:'version']
214
+ end
215
+
216
+ if attributes.key?(:'widget_id')
217
+ self.widget_id = attributes[:'widget_id']
218
+ end
219
+
220
+ if attributes.key?(:'winner_variation_number')
221
+ self.winner_variation_number = attributes[:'winner_variation_number']
222
+ end
73
223
  end
74
224
 
75
225
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -82,16 +232,42 @@ module UltracartClient
82
232
  # Check to see if the all the properties in the model are valid
83
233
  # @return true if the model is valid
84
234
  def valid?
235
+ upsell_kind_validator = EnumAttributeValidator.new('String', ["offer", "path"])
236
+ return false unless upsell_kind_validator.valid?(@upsell_kind)
85
237
  true
86
238
  end
87
239
 
240
+ # Custom attribute writer method checking allowed values (enum).
241
+ # @param [Object] upsell_kind Object to be assigned
242
+ def upsell_kind=(upsell_kind)
243
+ validator = EnumAttributeValidator.new('String', ["offer", "path"])
244
+ unless validator.valid?(upsell_kind)
245
+ fail ArgumentError, "invalid value for \"upsell_kind\", must be one of #{validator.allowable_values}."
246
+ end
247
+ @upsell_kind = upsell_kind
248
+ end
249
+
88
250
  # Checks equality by comparing each attribute.
89
251
  # @param [Object] Object to be compared
90
252
  def ==(o)
91
253
  return true if self.equal?(o)
92
254
  self.class == o.class &&
255
+ attribute_names == o.attribute_names &&
93
256
  blog_post_oid == o.blog_post_oid &&
94
- path == o.path
257
+ content_sha256 == o.content_sha256 &&
258
+ experiment_oid == o.experiment_oid &&
259
+ item_count == o.item_count &&
260
+ merchant_item_oid == o.merchant_item_oid &&
261
+ path == o.path &&
262
+ request_sha256 == o.request_sha256 &&
263
+ rows_sha256 == o.rows_sha256 &&
264
+ rule_count == o.rule_count &&
265
+ slot == o.slot &&
266
+ upsell_kind == o.upsell_kind &&
267
+ upsell_oid == o.upsell_oid &&
268
+ version == o.version &&
269
+ widget_id == o.widget_id &&
270
+ winner_variation_number == o.winner_variation_number
95
271
  end
96
272
 
97
273
  # @see the `==` method
@@ -103,7 +279,7 @@ module UltracartClient
103
279
  # Calculates hash code according to all attributes.
104
280
  # @return [Integer] Hash code
105
281
  def hash
106
- [blog_post_oid, path].hash
282
+ [attribute_names, blog_post_oid, content_sha256, experiment_oid, item_count, merchant_item_oid, path, request_sha256, rows_sha256, rule_count, slot, upsell_kind, upsell_oid, version, widget_id, winner_variation_number].hash
107
283
  end
108
284
 
109
285
  # Builds the object from hash