ultracart_api 4.1.198 → 4.1.199

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.
@@ -1446,6 +1446,84 @@ module UltracartClient
1446
1446
  return data, status_code, headers
1447
1447
  end
1448
1448
 
1449
+ # Delete up to 5,000 redirect rules in one call
1450
+ # Deletes exactly the rows of a dry run, given its plan_hash, in one transaction. Every row needs its hash_sha256. A rule changed since its hash was read is skipped and reported as stale, and a missing one as not_found; the other rows still go through. Needs the approval of the person who signed in the CLI, as an approved redirect.delete_batch request for exactly these rows in the Approval-Id header, and sfvb_publish. Deleting rules lets add and import work again once the storefront is back under 5,000 rules.
1451
+ # @param storefront_oid [Integer]
1452
+ # @param redirect_delete_request [SfvbRedirectDeleteRequest] The request
1453
+ # @param [Hash] opts the optional parameters
1454
+ # @option opts [String] :approval_id The approval_id of an approved redirect.delete_batch request for exactly these rows. Required. See POST /sfvb/approvals.
1455
+ # @return [SfvbRedirectDeleteResponse]
1456
+ def delete_sfvb_redirects(storefront_oid, redirect_delete_request, opts = {})
1457
+ data, _status_code, _headers = delete_sfvb_redirects_with_http_info(storefront_oid, redirect_delete_request, opts)
1458
+ data
1459
+ end
1460
+
1461
+ # Delete up to 5,000 redirect rules in one call
1462
+ # Deletes exactly the rows of a dry run, given its plan_hash, in one transaction. Every row needs its hash_sha256. A rule changed since its hash was read is skipped and reported as stale, and a missing one as not_found; the other rows still go through. Needs the approval of the person who signed in the CLI, as an approved redirect.delete_batch request for exactly these rows in the Approval-Id header, and sfvb_publish. Deleting rules lets add and import work again once the storefront is back under 5,000 rules.
1463
+ # @param storefront_oid [Integer]
1464
+ # @param redirect_delete_request [SfvbRedirectDeleteRequest] The request
1465
+ # @param [Hash] opts the optional parameters
1466
+ # @option opts [String] :approval_id The approval_id of an approved redirect.delete_batch request for exactly these rows. Required. See POST /sfvb/approvals.
1467
+ # @return [Array<(SfvbRedirectDeleteResponse, Integer, Hash)>] SfvbRedirectDeleteResponse data, response status code and response headers
1468
+ def delete_sfvb_redirects_with_http_info(storefront_oid, redirect_delete_request, opts = {})
1469
+ if @api_client.config.debugging
1470
+ @api_client.config.logger.debug 'Calling API: SfvbApi.delete_sfvb_redirects ...'
1471
+ end
1472
+ # verify the required parameter 'storefront_oid' is set
1473
+ if @api_client.config.client_side_validation && storefront_oid.nil?
1474
+ fail ArgumentError, "Missing the required parameter 'storefront_oid' when calling SfvbApi.delete_sfvb_redirects"
1475
+ end
1476
+ # verify the required parameter 'redirect_delete_request' is set
1477
+ if @api_client.config.client_side_validation && redirect_delete_request.nil?
1478
+ fail ArgumentError, "Missing the required parameter 'redirect_delete_request' when calling SfvbApi.delete_sfvb_redirects"
1479
+ end
1480
+ # resource path
1481
+ local_var_path = '/sfvb/storefronts/{storefront_oid}/redirects/delete'.sub('{' + 'storefront_oid' + '}', CGI.escape(storefront_oid.to_s))
1482
+
1483
+ # query parameters
1484
+ query_params = opts[:query_params] || {}
1485
+
1486
+ # header parameters
1487
+ header_params = opts[:header_params] || {}
1488
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
1489
+ # HTTP header 'Accept' (if needed)
1490
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1491
+ # HTTP header 'Content-Type'
1492
+ content_type = @api_client.select_header_content_type(['application/json; charset=UTF-8'])
1493
+ if !content_type.nil?
1494
+ header_params['Content-Type'] = content_type
1495
+ end
1496
+ header_params[:'Approval-Id'] = opts[:'approval_id'] if !opts[:'approval_id'].nil?
1497
+
1498
+ # form parameters
1499
+ form_params = opts[:form_params] || {}
1500
+
1501
+ # http body (model)
1502
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(redirect_delete_request)
1503
+
1504
+ # return_type
1505
+ return_type = opts[:debug_return_type] || 'SfvbRedirectDeleteResponse'
1506
+
1507
+ # auth_names
1508
+ auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
1509
+
1510
+ new_options = opts.merge(
1511
+ :operation => :"SfvbApi.delete_sfvb_redirects",
1512
+ :header_params => header_params,
1513
+ :query_params => query_params,
1514
+ :form_params => form_params,
1515
+ :body => post_body,
1516
+ :auth_names => auth_names,
1517
+ :return_type => return_type
1518
+ )
1519
+
1520
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
1521
+ if @api_client.config.debugging
1522
+ @api_client.config.logger.debug "API called: SfvbApi#delete_sfvb_redirects\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1523
+ end
1524
+ return data, status_code, headers
1525
+ end
1526
+
1449
1527
  # Detach an image from a blog post
1450
1528
  # Name exactly one of default_image, code or blog_post_multimedia_oid. Removes the image from the post and deletes its stored copy. Take it out of the body too, or the body keeps a broken image. A post that is not a draft needs sfvb_publish.
1451
1529
  # @param storefront_oid [Integer]
@@ -1811,6 +1889,81 @@ module UltracartClient
1811
1889
  return data, status_code, headers
1812
1890
  end
1813
1891
 
1892
+ # Check a batch delete of redirect rules without writing it
1893
+ # Checks up to 5,000 rules by redirect_id and returns each one as deletable, stale (its hash_sha256 differs from the one sent) or not_found, with its current hash, source, target, status, type and note, and a plan_hash. Writes nothing. Rows may leave out hash_sha256; the result carries the current one to send when deleting.
1894
+ # @param storefront_oid [Integer]
1895
+ # @param redirect_delete_request [SfvbRedirectDeleteRequest] The request
1896
+ # @param [Hash] opts the optional parameters
1897
+ # @return [SfvbRedirectDeleteResponse]
1898
+ def dry_run_sfvb_redirect_delete(storefront_oid, redirect_delete_request, opts = {})
1899
+ data, _status_code, _headers = dry_run_sfvb_redirect_delete_with_http_info(storefront_oid, redirect_delete_request, opts)
1900
+ data
1901
+ end
1902
+
1903
+ # Check a batch delete of redirect rules without writing it
1904
+ # Checks up to 5,000 rules by redirect_id and returns each one as deletable, stale (its hash_sha256 differs from the one sent) or not_found, with its current hash, source, target, status, type and note, and a plan_hash. Writes nothing. Rows may leave out hash_sha256; the result carries the current one to send when deleting.
1905
+ # @param storefront_oid [Integer]
1906
+ # @param redirect_delete_request [SfvbRedirectDeleteRequest] The request
1907
+ # @param [Hash] opts the optional parameters
1908
+ # @return [Array<(SfvbRedirectDeleteResponse, Integer, Hash)>] SfvbRedirectDeleteResponse data, response status code and response headers
1909
+ def dry_run_sfvb_redirect_delete_with_http_info(storefront_oid, redirect_delete_request, opts = {})
1910
+ if @api_client.config.debugging
1911
+ @api_client.config.logger.debug 'Calling API: SfvbApi.dry_run_sfvb_redirect_delete ...'
1912
+ end
1913
+ # verify the required parameter 'storefront_oid' is set
1914
+ if @api_client.config.client_side_validation && storefront_oid.nil?
1915
+ fail ArgumentError, "Missing the required parameter 'storefront_oid' when calling SfvbApi.dry_run_sfvb_redirect_delete"
1916
+ end
1917
+ # verify the required parameter 'redirect_delete_request' is set
1918
+ if @api_client.config.client_side_validation && redirect_delete_request.nil?
1919
+ fail ArgumentError, "Missing the required parameter 'redirect_delete_request' when calling SfvbApi.dry_run_sfvb_redirect_delete"
1920
+ end
1921
+ # resource path
1922
+ local_var_path = '/sfvb/storefronts/{storefront_oid}/redirects/delete/dry_run'.sub('{' + 'storefront_oid' + '}', CGI.escape(storefront_oid.to_s))
1923
+
1924
+ # query parameters
1925
+ query_params = opts[:query_params] || {}
1926
+
1927
+ # header parameters
1928
+ header_params = opts[:header_params] || {}
1929
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
1930
+ # HTTP header 'Accept' (if needed)
1931
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1932
+ # HTTP header 'Content-Type'
1933
+ content_type = @api_client.select_header_content_type(['application/json; charset=UTF-8'])
1934
+ if !content_type.nil?
1935
+ header_params['Content-Type'] = content_type
1936
+ end
1937
+
1938
+ # form parameters
1939
+ form_params = opts[:form_params] || {}
1940
+
1941
+ # http body (model)
1942
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(redirect_delete_request)
1943
+
1944
+ # return_type
1945
+ return_type = opts[:debug_return_type] || 'SfvbRedirectDeleteResponse'
1946
+
1947
+ # auth_names
1948
+ auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
1949
+
1950
+ new_options = opts.merge(
1951
+ :operation => :"SfvbApi.dry_run_sfvb_redirect_delete",
1952
+ :header_params => header_params,
1953
+ :query_params => query_params,
1954
+ :form_params => form_params,
1955
+ :body => post_body,
1956
+ :auth_names => auth_names,
1957
+ :return_type => return_type
1958
+ )
1959
+
1960
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
1961
+ if @api_client.config.debugging
1962
+ @api_client.config.logger.debug "API called: SfvbApi#dry_run_sfvb_redirect_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1963
+ end
1964
+ return data, status_code, headers
1965
+ end
1966
+
1814
1967
  # Check a redirect import without writing it
1815
1968
  # Checks up to 5,000 rows against the existing rules and each other, and returns the findings per row with a plan_hash. Writes nothing. Rows are merged with the existing rules; nothing is ever deleted.
1816
1969
  # @param storefront_oid [Integer]
@@ -5850,7 +6003,7 @@ module UltracartClient
5850
6003
  end
5851
6004
 
5852
6005
  # Request a human approval
5853
- # Asks the person who signed in the CLI to approve one gated action on one exact target. Name the storefront with the storefront_oid query parameter. The target is checked the way the action will check it, so nobody is asked to approve a call that would fail. Show the person approval_url and user_code, poll GET approvals/{approval_id} every interval_seconds, and once it is approved repeat the gated call with the approval_id in the Approval-Id header. Asking again for the same thing returns the pending request (200) rather than a new one (201). A request lapses after 10 minutes. Requires a token that resolves to a user, so use the device authorization flow.
6006
+ # Asks the person who signed in the CLI to approve one gated action on one exact target. Name the storefront with the storefront_oid query parameter. The target is checked the way the action will check it, so nobody is asked to approve a call that would fail. Show the person approval_url and user_code, poll GET approvals/{approval_id} every interval_seconds, and once it is approved repeat the gated call with the approval_id in the Approval-Id header. Asking again for the same thing returns the pending request (200) rather than a new one (201). A request lapses after 10 minutes. Requires a token that resolves to a user, so use the device authorization flow. For file.put_script send the script as content, or params.version for a revert. The request starts as reviewing while UltraCart's scanner and two AI models read it, then becomes pending with the review attached, or refused. Keep polling, and show approval_url only once it is pending. Only the hash is kept, so the write must send the same bytes.
5854
6007
  # @param approval_request [SfvbApprovalCreateRequest] The request
5855
6008
  # @param [Hash] opts the optional parameters
5856
6009
  # @option opts [Integer] :storefront_oid The storefront the action runs on. Required for storefront actions, left out for account-wide ones.
@@ -5861,7 +6014,7 @@ module UltracartClient
5861
6014
  end
5862
6015
 
5863
6016
  # Request a human approval
5864
- # Asks the person who signed in the CLI to approve one gated action on one exact target. Name the storefront with the storefront_oid query parameter. The target is checked the way the action will check it, so nobody is asked to approve a call that would fail. Show the person approval_url and user_code, poll GET approvals/{approval_id} every interval_seconds, and once it is approved repeat the gated call with the approval_id in the Approval-Id header. Asking again for the same thing returns the pending request (200) rather than a new one (201). A request lapses after 10 minutes. Requires a token that resolves to a user, so use the device authorization flow.
6017
+ # Asks the person who signed in the CLI to approve one gated action on one exact target. Name the storefront with the storefront_oid query parameter. The target is checked the way the action will check it, so nobody is asked to approve a call that would fail. Show the person approval_url and user_code, poll GET approvals/{approval_id} every interval_seconds, and once it is approved repeat the gated call with the approval_id in the Approval-Id header. Asking again for the same thing returns the pending request (200) rather than a new one (201). A request lapses after 10 minutes. Requires a token that resolves to a user, so use the device authorization flow. For file.put_script send the script as content, or params.version for a revert. The request starts as reviewing while UltraCart&#39;s scanner and two AI models read it, then becomes pending with the review attached, or refused. Keep polling, and show approval_url only once it is pending. Only the hash is kept, so the write must send the same bytes.
5865
6018
  # @param approval_request [SfvbApprovalCreateRequest] The request
5866
6019
  # @param [Hash] opts the optional parameters
5867
6020
  # @option opts [Integer] :storefront_oid The storefront the action runs on. Required for storefront actions, left out for account-wide ones.
@@ -7875,6 +8028,7 @@ module UltracartClient
7875
8028
  # @param file_write_request [SfvbFileWriteRequest] File content to write
7876
8029
  # @param [Hash] opts the optional parameters
7877
8030
  # @option opts [String] :path
8031
+ # @option opts [String] :approval_id For a .js or .mjs file, the approval_id of an approved file.put_script request for exactly these bytes. Required for scripts. See POST /sfvb/approvals.
7878
8032
  # @return [SfvbFileWriteResponse]
7879
8033
  def put_sfvb_file_content(storefront_oid, if_match, file_write_request, opts = {})
7880
8034
  data, _status_code, _headers = put_sfvb_file_content_with_http_info(storefront_oid, if_match, file_write_request, opts)
@@ -7888,6 +8042,7 @@ module UltracartClient
7888
8042
  # @param file_write_request [SfvbFileWriteRequest] File content to write
7889
8043
  # @param [Hash] opts the optional parameters
7890
8044
  # @option opts [String] :path
8045
+ # @option opts [String] :approval_id For a .js or .mjs file, the approval_id of an approved file.put_script request for exactly these bytes. Required for scripts. See POST /sfvb/approvals.
7891
8046
  # @return [Array<(SfvbFileWriteResponse, Integer, Hash)>] SfvbFileWriteResponse data, response status code and response headers
7892
8047
  def put_sfvb_file_content_with_http_info(storefront_oid, if_match, file_write_request, opts = {})
7893
8048
  if @api_client.config.debugging
@@ -7923,6 +8078,7 @@ module UltracartClient
7923
8078
  header_params['Content-Type'] = content_type
7924
8079
  end
7925
8080
  header_params[:'If-Match'] = if_match
8081
+ header_params[:'Approval-Id'] = opts[:'approval_id'] if !opts[:'approval_id'].nil?
7926
8082
 
7927
8083
  # form parameters
7928
8084
  form_params = opts[:form_params] || {}
@@ -9884,6 +10040,7 @@ module UltracartClient
9884
10040
  # @param if_match [String] Content hash of the file being reverted. Required; 428 when absent, 412 when stale.
9885
10041
  # @param file_revert_request [SfvbFileRevertRequest] Version to revert the file to
9886
10042
  # @param [Hash] opts the optional parameters
10043
+ # @option opts [String] :approval_id For a .js or .mjs file, the approval_id of an approved file.put_script request naming this version. Required for scripts. See POST /sfvb/approvals.
9887
10044
  # @return [SfvbFileWriteResponse]
9888
10045
  def revert_sfvb_file(storefront_oid, if_match, file_revert_request, opts = {})
9889
10046
  data, _status_code, _headers = revert_sfvb_file_with_http_info(storefront_oid, if_match, file_revert_request, opts)
@@ -9896,6 +10053,7 @@ module UltracartClient
9896
10053
  # @param if_match [String] Content hash of the file being reverted. Required; 428 when absent, 412 when stale.
9897
10054
  # @param file_revert_request [SfvbFileRevertRequest] Version to revert the file to
9898
10055
  # @param [Hash] opts the optional parameters
10056
+ # @option opts [String] :approval_id For a .js or .mjs file, the approval_id of an approved file.put_script request naming this version. Required for scripts. See POST /sfvb/approvals.
9899
10057
  # @return [Array<(SfvbFileWriteResponse, Integer, Hash)>] SfvbFileWriteResponse data, response status code and response headers
9900
10058
  def revert_sfvb_file_with_http_info(storefront_oid, if_match, file_revert_request, opts = {})
9901
10059
  if @api_client.config.debugging
@@ -9930,6 +10088,7 @@ module UltracartClient
9930
10088
  header_params['Content-Type'] = content_type
9931
10089
  end
9932
10090
  header_params[:'If-Match'] = if_match
10091
+ header_params[:'Approval-Id'] = opts[:'approval_id'] if !opts[:'approval_id'].nil?
9933
10092
 
9934
10093
  # form parameters
9935
10094
  form_params = opts[:form_params] || {}
@@ -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,17 @@ 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
+
21
24
  attr_accessor :params
22
25
 
23
26
  # Why the agent wants to do this, in a sentence. Shown to the person as unverified text, capped at 500 characters.
24
27
  attr_accessor :reason
25
28
 
29
+ # 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.
30
+ attr_accessor :redirect_rows
31
+
26
32
  class EnumAttributeValidator
27
33
  attr_reader :datatype
28
34
  attr_reader :allowable_values
@@ -49,8 +55,10 @@ module UltracartClient
49
55
  def self.attribute_map
50
56
  {
51
57
  :'action' => :'action',
58
+ :'content' => :'content',
52
59
  :'params' => :'params',
53
- :'reason' => :'reason'
60
+ :'reason' => :'reason',
61
+ :'redirect_rows' => :'redirect_rows'
54
62
  }
55
63
  end
56
64
 
@@ -63,8 +71,10 @@ module UltracartClient
63
71
  def self.openapi_types
64
72
  {
65
73
  :'action' => :'String',
74
+ :'content' => :'String',
66
75
  :'params' => :'SfvbApprovalParams',
67
- :'reason' => :'String'
76
+ :'reason' => :'String',
77
+ :'redirect_rows' => :'Array<SfvbRedirectDeleteRow>'
68
78
  }
69
79
  end
70
80
 
@@ -93,6 +103,10 @@ module UltracartClient
93
103
  self.action = attributes[:'action']
94
104
  end
95
105
 
106
+ if attributes.key?(:'content')
107
+ self.content = attributes[:'content']
108
+ end
109
+
96
110
  if attributes.key?(:'params')
97
111
  self.params = attributes[:'params']
98
112
  end
@@ -100,6 +114,12 @@ module UltracartClient
100
114
  if attributes.key?(:'reason')
101
115
  self.reason = attributes[:'reason']
102
116
  end
117
+
118
+ if attributes.key?(:'redirect_rows')
119
+ if (value = attributes[:'redirect_rows']).is_a?(Array)
120
+ self.redirect_rows = value
121
+ end
122
+ end
103
123
  end
104
124
 
105
125
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -112,7 +132,7 @@ module UltracartClient
112
132
  # Check to see if the all the properties in the model are valid
113
133
  # @return true if the model is valid
114
134
  def valid?
115
- action_validator = EnumAttributeValidator.new('String', ["file.delete", "blog_post.delete"])
135
+ action_validator = EnumAttributeValidator.new('String', ["file.delete", "blog_post.delete", "file.put_script", "redirect.delete_batch"])
116
136
  return false unless action_validator.valid?(@action)
117
137
  true
118
138
  end
@@ -120,7 +140,7 @@ module UltracartClient
120
140
  # Custom attribute writer method checking allowed values (enum).
121
141
  # @param [Object] action Object to be assigned
122
142
  def action=(action)
123
- validator = EnumAttributeValidator.new('String', ["file.delete", "blog_post.delete"])
143
+ validator = EnumAttributeValidator.new('String', ["file.delete", "blog_post.delete", "file.put_script", "redirect.delete_batch"])
124
144
  unless validator.valid?(action)
125
145
  fail ArgumentError, "invalid value for \"action\", must be one of #{validator.allowable_values}."
126
146
  end
@@ -133,8 +153,10 @@ module UltracartClient
133
153
  return true if self.equal?(o)
134
154
  self.class == o.class &&
135
155
  action == o.action &&
156
+ content == o.content &&
136
157
  params == o.params &&
137
- reason == o.reason
158
+ reason == o.reason &&
159
+ redirect_rows == o.redirect_rows
138
160
  end
139
161
 
140
162
  # @see the `==` method
@@ -146,7 +168,7 @@ module UltracartClient
146
168
  # Calculates hash code according to all attributes.
147
169
  # @return [Integer] Hash code
148
170
  def hash
149
- [action, params, reason].hash
171
+ [action, content, params, reason, redirect_rows].hash
150
172
  end
151
173
 
152
174
  # Builds the object from hash
@@ -18,14 +18,30 @@ module UltracartClient
18
18
  # The blog post, for blog_post.delete.
19
19
  attr_accessor :blog_post_oid
20
20
 
21
- # The file path, for file.delete. Exactly as the delete call will send it.
21
+ # 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.
22
+ attr_accessor :content_sha256
23
+
24
+ # The file path, for file.delete and file.put_script. Exactly as the gated call will send it.
22
25
  attr_accessor :path
23
26
 
27
+ # For redirect.delete_batch, the plan_hash of the exact rows approved. Set by the server. The batch delete must send rows with this hash.
28
+ attr_accessor :rows_sha256
29
+
30
+ # For redirect.delete_batch, how many rules the batch would delete when it was requested. Set by the server.
31
+ attr_accessor :rule_count
32
+
33
+ # For file.put_script, the history version a revert restores. Leave it out, and send content instead, for a write.
34
+ attr_accessor :version
35
+
24
36
  # Attribute mapping from ruby-style variable name to JSON key.
25
37
  def self.attribute_map
26
38
  {
27
39
  :'blog_post_oid' => :'blog_post_oid',
28
- :'path' => :'path'
40
+ :'content_sha256' => :'content_sha256',
41
+ :'path' => :'path',
42
+ :'rows_sha256' => :'rows_sha256',
43
+ :'rule_count' => :'rule_count',
44
+ :'version' => :'version'
29
45
  }
30
46
  end
31
47
 
@@ -38,7 +54,11 @@ module UltracartClient
38
54
  def self.openapi_types
39
55
  {
40
56
  :'blog_post_oid' => :'Integer',
41
- :'path' => :'String'
57
+ :'content_sha256' => :'String',
58
+ :'path' => :'String',
59
+ :'rows_sha256' => :'String',
60
+ :'rule_count' => :'Integer',
61
+ :'version' => :'Integer'
42
62
  }
43
63
  end
44
64
 
@@ -67,9 +87,25 @@ module UltracartClient
67
87
  self.blog_post_oid = attributes[:'blog_post_oid']
68
88
  end
69
89
 
90
+ if attributes.key?(:'content_sha256')
91
+ self.content_sha256 = attributes[:'content_sha256']
92
+ end
93
+
70
94
  if attributes.key?(:'path')
71
95
  self.path = attributes[:'path']
72
96
  end
97
+
98
+ if attributes.key?(:'rows_sha256')
99
+ self.rows_sha256 = attributes[:'rows_sha256']
100
+ end
101
+
102
+ if attributes.key?(:'rule_count')
103
+ self.rule_count = attributes[:'rule_count']
104
+ end
105
+
106
+ if attributes.key?(:'version')
107
+ self.version = attributes[:'version']
108
+ end
73
109
  end
74
110
 
75
111
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -91,7 +127,11 @@ module UltracartClient
91
127
  return true if self.equal?(o)
92
128
  self.class == o.class &&
93
129
  blog_post_oid == o.blog_post_oid &&
94
- path == o.path
130
+ content_sha256 == o.content_sha256 &&
131
+ path == o.path &&
132
+ rows_sha256 == o.rows_sha256 &&
133
+ rule_count == o.rule_count &&
134
+ version == o.version
95
135
  end
96
136
 
97
137
  # @see the `==` method
@@ -103,7 +143,7 @@ module UltracartClient
103
143
  # Calculates hash code according to all attributes.
104
144
  # @return [Integer] Hash code
105
145
  def hash
106
- [blog_post_oid, path].hash
146
+ [blog_post_oid, content_sha256, path, rows_sha256, rule_count, version].hash
107
147
  end
108
148
 
109
149
  # Builds the object from hash