ultracart_api 4.1.194 → 4.1.196
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.
- checksums.yaml +4 -4
- data/README.md +12 -2
- data/docs/SfvbApi.md +220 -3
- data/docs/SfvbApproval.md +54 -0
- data/docs/SfvbApprovalCreateRequest.md +22 -0
- data/docs/SfvbApprovalParams.md +20 -0
- data/docs/SfvbApprovalsResponse.md +18 -0
- data/docs/SfvbTestOrdersResponse.md +1 -3
- data/lib/ultracart_api/api/sfvb_api.rb +264 -0
- data/lib/ultracart_api/models/sfvb_approval.rb +445 -0
- data/lib/ultracart_api/models/sfvb_approval_create_request.rb +273 -0
- data/lib/ultracart_api/models/sfvb_approval_params.rb +230 -0
- data/lib/ultracart_api/models/sfvb_approvals_response.rb +222 -0
- data/lib/ultracart_api/models/sfvb_test_orders_response.rb +2 -12
- data/lib/ultracart_api/version.rb +1 -1
- data/lib/ultracart_api.rb +4 -0
- metadata +10 -2
|
@@ -778,11 +778,76 @@ module UltracartClient
|
|
|
778
778
|
return data, status_code, headers
|
|
779
779
|
end
|
|
780
780
|
|
|
781
|
+
# Cancel a pending approval request
|
|
782
|
+
# Withdraws a request nobody has decided yet, which frees one of the five pending slots a sign-in has. A request that was already decided, used or expired cannot be cancelled.
|
|
783
|
+
# @param approval_id [String]
|
|
784
|
+
# @param [Hash] opts the optional parameters
|
|
785
|
+
# @return [nil]
|
|
786
|
+
def delete_sfvb_approval(approval_id, opts = {})
|
|
787
|
+
delete_sfvb_approval_with_http_info(approval_id, opts)
|
|
788
|
+
nil
|
|
789
|
+
end
|
|
790
|
+
|
|
791
|
+
# Cancel a pending approval request
|
|
792
|
+
# Withdraws a request nobody has decided yet, which frees one of the five pending slots a sign-in has. A request that was already decided, used or expired cannot be cancelled.
|
|
793
|
+
# @param approval_id [String]
|
|
794
|
+
# @param [Hash] opts the optional parameters
|
|
795
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
796
|
+
def delete_sfvb_approval_with_http_info(approval_id, opts = {})
|
|
797
|
+
if @api_client.config.debugging
|
|
798
|
+
@api_client.config.logger.debug 'Calling API: SfvbApi.delete_sfvb_approval ...'
|
|
799
|
+
end
|
|
800
|
+
# verify the required parameter 'approval_id' is set
|
|
801
|
+
if @api_client.config.client_side_validation && approval_id.nil?
|
|
802
|
+
fail ArgumentError, "Missing the required parameter 'approval_id' when calling SfvbApi.delete_sfvb_approval"
|
|
803
|
+
end
|
|
804
|
+
# resource path
|
|
805
|
+
local_var_path = '/sfvb/approvals/{approval_id}'.sub('{' + 'approval_id' + '}', CGI.escape(approval_id.to_s))
|
|
806
|
+
|
|
807
|
+
# query parameters
|
|
808
|
+
query_params = opts[:query_params] || {}
|
|
809
|
+
|
|
810
|
+
# header parameters
|
|
811
|
+
header_params = opts[:header_params] || {}
|
|
812
|
+
header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
|
|
813
|
+
# HTTP header 'Accept' (if needed)
|
|
814
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
815
|
+
|
|
816
|
+
# form parameters
|
|
817
|
+
form_params = opts[:form_params] || {}
|
|
818
|
+
|
|
819
|
+
# http body (model)
|
|
820
|
+
post_body = opts[:debug_body]
|
|
821
|
+
|
|
822
|
+
# return_type
|
|
823
|
+
return_type = opts[:debug_return_type]
|
|
824
|
+
|
|
825
|
+
# auth_names
|
|
826
|
+
auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
|
|
827
|
+
|
|
828
|
+
new_options = opts.merge(
|
|
829
|
+
:operation => :"SfvbApi.delete_sfvb_approval",
|
|
830
|
+
:header_params => header_params,
|
|
831
|
+
:query_params => query_params,
|
|
832
|
+
:form_params => form_params,
|
|
833
|
+
:body => post_body,
|
|
834
|
+
:auth_names => auth_names,
|
|
835
|
+
:return_type => return_type
|
|
836
|
+
)
|
|
837
|
+
|
|
838
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
839
|
+
if @api_client.config.debugging
|
|
840
|
+
@api_client.config.logger.debug "API called: SfvbApi#delete_sfvb_approval\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
841
|
+
end
|
|
842
|
+
return data, status_code, headers
|
|
843
|
+
end
|
|
844
|
+
|
|
781
845
|
# Delete a blog post
|
|
782
846
|
# Takes the post off every page and deletes it. There is no undo. A post that is not a draft needs sfvb_publish.
|
|
783
847
|
# @param storefront_oid [Integer]
|
|
784
848
|
# @param blog_post_oid [Integer]
|
|
785
849
|
# @param [Hash] opts the optional parameters
|
|
850
|
+
# @option opts [String] :approval_id The approval_id of an approved blog_post.delete request for this post. See POST /sfvb/approvals.
|
|
786
851
|
# @return [nil]
|
|
787
852
|
def delete_sfvb_blog_post(storefront_oid, blog_post_oid, opts = {})
|
|
788
853
|
delete_sfvb_blog_post_with_http_info(storefront_oid, blog_post_oid, opts)
|
|
@@ -794,6 +859,7 @@ module UltracartClient
|
|
|
794
859
|
# @param storefront_oid [Integer]
|
|
795
860
|
# @param blog_post_oid [Integer]
|
|
796
861
|
# @param [Hash] opts the optional parameters
|
|
862
|
+
# @option opts [String] :approval_id The approval_id of an approved blog_post.delete request for this post. See POST /sfvb/approvals.
|
|
797
863
|
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
798
864
|
def delete_sfvb_blog_post_with_http_info(storefront_oid, blog_post_oid, opts = {})
|
|
799
865
|
if @api_client.config.debugging
|
|
@@ -818,6 +884,7 @@ module UltracartClient
|
|
|
818
884
|
header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
|
|
819
885
|
# HTTP header 'Accept' (if needed)
|
|
820
886
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
887
|
+
header_params[:'Approval-Id'] = opts[:'approval_id'] if !opts[:'approval_id'].nil?
|
|
821
888
|
|
|
822
889
|
# form parameters
|
|
823
890
|
form_params = opts[:form_params] || {}
|
|
@@ -854,6 +921,7 @@ module UltracartClient
|
|
|
854
921
|
# @param if_match [String] Content hash of the file being deleted. Required; 428 when absent, 412 when stale.
|
|
855
922
|
# @param [Hash] opts the optional parameters
|
|
856
923
|
# @option opts [String] :path
|
|
924
|
+
# @option opts [String] :approval_id The approval_id of an approved file.delete request for this exact path. See POST /sfvb/approvals.
|
|
857
925
|
# @return [nil]
|
|
858
926
|
def delete_sfvb_file(storefront_oid, if_match, opts = {})
|
|
859
927
|
delete_sfvb_file_with_http_info(storefront_oid, if_match, opts)
|
|
@@ -866,6 +934,7 @@ module UltracartClient
|
|
|
866
934
|
# @param if_match [String] Content hash of the file being deleted. Required; 428 when absent, 412 when stale.
|
|
867
935
|
# @param [Hash] opts the optional parameters
|
|
868
936
|
# @option opts [String] :path
|
|
937
|
+
# @option opts [String] :approval_id The approval_id of an approved file.delete request for this exact path. See POST /sfvb/approvals.
|
|
869
938
|
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
870
939
|
def delete_sfvb_file_with_http_info(storefront_oid, if_match, opts = {})
|
|
871
940
|
if @api_client.config.debugging
|
|
@@ -892,6 +961,7 @@ module UltracartClient
|
|
|
892
961
|
# HTTP header 'Accept' (if needed)
|
|
893
962
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
894
963
|
header_params[:'If-Match'] = if_match
|
|
964
|
+
header_params[:'Approval-Id'] = opts[:'approval_id'] if !opts[:'approval_id'].nil?
|
|
895
965
|
|
|
896
966
|
# form parameters
|
|
897
967
|
form_params = opts[:form_params] || {}
|
|
@@ -2427,6 +2497,128 @@ module UltracartClient
|
|
|
2427
2497
|
return data, status_code, headers
|
|
2428
2498
|
end
|
|
2429
2499
|
|
|
2500
|
+
# Read one approval request
|
|
2501
|
+
# Poll this every interval_seconds after requesting an approval. status is pending until the person decides, then approved or denied, and expired if nobody acts in 10 minutes. Once the gated call has used it, status is used and outcome says whether the call succeeded. Used with no outcome means the result is unknown, so check the target - never repeat the call.
|
|
2502
|
+
# @param approval_id [String]
|
|
2503
|
+
# @param [Hash] opts the optional parameters
|
|
2504
|
+
# @return [SfvbApproval]
|
|
2505
|
+
def get_sfvb_approval(approval_id, opts = {})
|
|
2506
|
+
data, _status_code, _headers = get_sfvb_approval_with_http_info(approval_id, opts)
|
|
2507
|
+
data
|
|
2508
|
+
end
|
|
2509
|
+
|
|
2510
|
+
# Read one approval request
|
|
2511
|
+
# Poll this every interval_seconds after requesting an approval. status is pending until the person decides, then approved or denied, and expired if nobody acts in 10 minutes. Once the gated call has used it, status is used and outcome says whether the call succeeded. Used with no outcome means the result is unknown, so check the target - never repeat the call.
|
|
2512
|
+
# @param approval_id [String]
|
|
2513
|
+
# @param [Hash] opts the optional parameters
|
|
2514
|
+
# @return [Array<(SfvbApproval, Integer, Hash)>] SfvbApproval data, response status code and response headers
|
|
2515
|
+
def get_sfvb_approval_with_http_info(approval_id, opts = {})
|
|
2516
|
+
if @api_client.config.debugging
|
|
2517
|
+
@api_client.config.logger.debug 'Calling API: SfvbApi.get_sfvb_approval ...'
|
|
2518
|
+
end
|
|
2519
|
+
# verify the required parameter 'approval_id' is set
|
|
2520
|
+
if @api_client.config.client_side_validation && approval_id.nil?
|
|
2521
|
+
fail ArgumentError, "Missing the required parameter 'approval_id' when calling SfvbApi.get_sfvb_approval"
|
|
2522
|
+
end
|
|
2523
|
+
# resource path
|
|
2524
|
+
local_var_path = '/sfvb/approvals/{approval_id}'.sub('{' + 'approval_id' + '}', CGI.escape(approval_id.to_s))
|
|
2525
|
+
|
|
2526
|
+
# query parameters
|
|
2527
|
+
query_params = opts[:query_params] || {}
|
|
2528
|
+
|
|
2529
|
+
# header parameters
|
|
2530
|
+
header_params = opts[:header_params] || {}
|
|
2531
|
+
header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
|
|
2532
|
+
# HTTP header 'Accept' (if needed)
|
|
2533
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
2534
|
+
|
|
2535
|
+
# form parameters
|
|
2536
|
+
form_params = opts[:form_params] || {}
|
|
2537
|
+
|
|
2538
|
+
# http body (model)
|
|
2539
|
+
post_body = opts[:debug_body]
|
|
2540
|
+
|
|
2541
|
+
# return_type
|
|
2542
|
+
return_type = opts[:debug_return_type] || 'SfvbApproval'
|
|
2543
|
+
|
|
2544
|
+
# auth_names
|
|
2545
|
+
auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
|
|
2546
|
+
|
|
2547
|
+
new_options = opts.merge(
|
|
2548
|
+
:operation => :"SfvbApi.get_sfvb_approval",
|
|
2549
|
+
:header_params => header_params,
|
|
2550
|
+
:query_params => query_params,
|
|
2551
|
+
:form_params => form_params,
|
|
2552
|
+
:body => post_body,
|
|
2553
|
+
:auth_names => auth_names,
|
|
2554
|
+
:return_type => return_type
|
|
2555
|
+
)
|
|
2556
|
+
|
|
2557
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
2558
|
+
if @api_client.config.debugging
|
|
2559
|
+
@api_client.config.logger.debug "API called: SfvbApi#get_sfvb_approval\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
2560
|
+
end
|
|
2561
|
+
return data, status_code, headers
|
|
2562
|
+
end
|
|
2563
|
+
|
|
2564
|
+
# List this sign-in's approval requests
|
|
2565
|
+
# Requests made with this sign-in in the last 24 hours, newest first, at most 50, with their status and outcome. Use it to find a request whose id was lost, or to see what an earlier run did.
|
|
2566
|
+
# @param [Hash] opts the optional parameters
|
|
2567
|
+
# @return [SfvbApprovalsResponse]
|
|
2568
|
+
def get_sfvb_approvals(opts = {})
|
|
2569
|
+
data, _status_code, _headers = get_sfvb_approvals_with_http_info(opts)
|
|
2570
|
+
data
|
|
2571
|
+
end
|
|
2572
|
+
|
|
2573
|
+
# List this sign-in's approval requests
|
|
2574
|
+
# Requests made with this sign-in in the last 24 hours, newest first, at most 50, with their status and outcome. Use it to find a request whose id was lost, or to see what an earlier run did.
|
|
2575
|
+
# @param [Hash] opts the optional parameters
|
|
2576
|
+
# @return [Array<(SfvbApprovalsResponse, Integer, Hash)>] SfvbApprovalsResponse data, response status code and response headers
|
|
2577
|
+
def get_sfvb_approvals_with_http_info(opts = {})
|
|
2578
|
+
if @api_client.config.debugging
|
|
2579
|
+
@api_client.config.logger.debug 'Calling API: SfvbApi.get_sfvb_approvals ...'
|
|
2580
|
+
end
|
|
2581
|
+
# resource path
|
|
2582
|
+
local_var_path = '/sfvb/approvals'
|
|
2583
|
+
|
|
2584
|
+
# query parameters
|
|
2585
|
+
query_params = opts[:query_params] || {}
|
|
2586
|
+
|
|
2587
|
+
# header parameters
|
|
2588
|
+
header_params = opts[:header_params] || {}
|
|
2589
|
+
header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
|
|
2590
|
+
# HTTP header 'Accept' (if needed)
|
|
2591
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
2592
|
+
|
|
2593
|
+
# form parameters
|
|
2594
|
+
form_params = opts[:form_params] || {}
|
|
2595
|
+
|
|
2596
|
+
# http body (model)
|
|
2597
|
+
post_body = opts[:debug_body]
|
|
2598
|
+
|
|
2599
|
+
# return_type
|
|
2600
|
+
return_type = opts[:debug_return_type] || 'SfvbApprovalsResponse'
|
|
2601
|
+
|
|
2602
|
+
# auth_names
|
|
2603
|
+
auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
|
|
2604
|
+
|
|
2605
|
+
new_options = opts.merge(
|
|
2606
|
+
:operation => :"SfvbApi.get_sfvb_approvals",
|
|
2607
|
+
:header_params => header_params,
|
|
2608
|
+
:query_params => query_params,
|
|
2609
|
+
:form_params => form_params,
|
|
2610
|
+
:body => post_body,
|
|
2611
|
+
:auth_names => auth_names,
|
|
2612
|
+
:return_type => return_type
|
|
2613
|
+
)
|
|
2614
|
+
|
|
2615
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
2616
|
+
if @api_client.config.debugging
|
|
2617
|
+
@api_client.config.logger.debug "API called: SfvbApi#get_sfvb_approvals\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
2618
|
+
end
|
|
2619
|
+
return data, status_code, headers
|
|
2620
|
+
end
|
|
2621
|
+
|
|
2430
2622
|
# Read a blog post
|
|
2431
2623
|
# The whole post - body, excerpt, tags, images and where it is shown. An image's url is the address to use for it in the body.
|
|
2432
2624
|
# @param storefront_oid [Integer]
|
|
@@ -5657,6 +5849,78 @@ module UltracartClient
|
|
|
5657
5849
|
return data, status_code, headers
|
|
5658
5850
|
end
|
|
5659
5851
|
|
|
5852
|
+
# 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.
|
|
5854
|
+
# @param approval_request [SfvbApprovalCreateRequest] The request
|
|
5855
|
+
# @param [Hash] opts the optional parameters
|
|
5856
|
+
# @option opts [Integer] :storefront_oid The storefront the action runs on. Required for storefront actions, left out for account-wide ones.
|
|
5857
|
+
# @return [nil]
|
|
5858
|
+
def insert_sfvb_approval(approval_request, opts = {})
|
|
5859
|
+
insert_sfvb_approval_with_http_info(approval_request, opts)
|
|
5860
|
+
nil
|
|
5861
|
+
end
|
|
5862
|
+
|
|
5863
|
+
# 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.
|
|
5865
|
+
# @param approval_request [SfvbApprovalCreateRequest] The request
|
|
5866
|
+
# @param [Hash] opts the optional parameters
|
|
5867
|
+
# @option opts [Integer] :storefront_oid The storefront the action runs on. Required for storefront actions, left out for account-wide ones.
|
|
5868
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
5869
|
+
def insert_sfvb_approval_with_http_info(approval_request, opts = {})
|
|
5870
|
+
if @api_client.config.debugging
|
|
5871
|
+
@api_client.config.logger.debug 'Calling API: SfvbApi.insert_sfvb_approval ...'
|
|
5872
|
+
end
|
|
5873
|
+
# verify the required parameter 'approval_request' is set
|
|
5874
|
+
if @api_client.config.client_side_validation && approval_request.nil?
|
|
5875
|
+
fail ArgumentError, "Missing the required parameter 'approval_request' when calling SfvbApi.insert_sfvb_approval"
|
|
5876
|
+
end
|
|
5877
|
+
# resource path
|
|
5878
|
+
local_var_path = '/sfvb/approvals'
|
|
5879
|
+
|
|
5880
|
+
# query parameters
|
|
5881
|
+
query_params = opts[:query_params] || {}
|
|
5882
|
+
query_params[:'storefront_oid'] = opts[:'storefront_oid'] if !opts[:'storefront_oid'].nil?
|
|
5883
|
+
|
|
5884
|
+
# header parameters
|
|
5885
|
+
header_params = opts[:header_params] || {}
|
|
5886
|
+
header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
|
|
5887
|
+
# HTTP header 'Accept' (if needed)
|
|
5888
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
5889
|
+
# HTTP header 'Content-Type'
|
|
5890
|
+
content_type = @api_client.select_header_content_type(['application/json; charset=UTF-8'])
|
|
5891
|
+
if !content_type.nil?
|
|
5892
|
+
header_params['Content-Type'] = content_type
|
|
5893
|
+
end
|
|
5894
|
+
|
|
5895
|
+
# form parameters
|
|
5896
|
+
form_params = opts[:form_params] || {}
|
|
5897
|
+
|
|
5898
|
+
# http body (model)
|
|
5899
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(approval_request)
|
|
5900
|
+
|
|
5901
|
+
# return_type
|
|
5902
|
+
return_type = opts[:debug_return_type]
|
|
5903
|
+
|
|
5904
|
+
# auth_names
|
|
5905
|
+
auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
|
|
5906
|
+
|
|
5907
|
+
new_options = opts.merge(
|
|
5908
|
+
:operation => :"SfvbApi.insert_sfvb_approval",
|
|
5909
|
+
:header_params => header_params,
|
|
5910
|
+
:query_params => query_params,
|
|
5911
|
+
:form_params => form_params,
|
|
5912
|
+
:body => post_body,
|
|
5913
|
+
:auth_names => auth_names,
|
|
5914
|
+
:return_type => return_type
|
|
5915
|
+
)
|
|
5916
|
+
|
|
5917
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
5918
|
+
if @api_client.config.debugging
|
|
5919
|
+
@api_client.config.logger.debug "API called: SfvbApi#insert_sfvb_approval\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
5920
|
+
end
|
|
5921
|
+
return data, status_code, headers
|
|
5922
|
+
end
|
|
5923
|
+
|
|
5660
5924
|
# Create a blog post
|
|
5661
5925
|
# title and url_part are required. The post is a draft unless visibility says otherwise, and anything but a draft needs sfvb_publish. The body and excerpt are refused with sfvb.unsafe_html if they could run script, and a url_part another post uses is refused with a 409 and sfvb.blog_post_exists. Assign the post to a page with pages/blog_posts/add, or let the page's selectors choose it.
|
|
5662
5926
|
# @param storefront_oid [Integer]
|