tremendous_ruby 5.3.0 → 5.4.0
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/lib/tremendous/api/tremendous_api.rb +571 -9
- data/lib/tremendous/models/allow_email.rb +225 -0
- data/lib/tremendous/models/allow_email1.rb +225 -0
- data/lib/tremendous/models/allow_ip.rb +225 -0
- data/lib/tremendous/models/allow_ip1.rb +225 -0
- data/lib/tremendous/models/base_order_for_create.rb +232 -0
- data/lib/tremendous/models/create_order200_response.rb +1 -1
- data/lib/tremendous/models/create_order_request.rb +73 -217
- data/lib/tremendous/models/delete_fraud_rule200_response.rb +222 -0
- data/lib/tremendous/models/fraud_config_allow_email.rb +224 -0
- data/lib/tremendous/models/fraud_config_country.rb +275 -0
- data/lib/tremendous/models/fraud_config_country_update_list.rb +224 -0
- data/lib/tremendous/models/fraud_config_ip.rb +224 -0
- data/lib/tremendous/models/fraud_config_redeemed_rewards_amount.rb +292 -0
- data/lib/tremendous/models/fraud_config_redeemed_rewards_count.rb +292 -0
- data/lib/tremendous/models/fraud_config_review_email.rb +229 -0
- data/lib/tremendous/models/fraud_generic_response.rb +222 -0
- data/lib/tremendous/models/fraud_review.rb +351 -0
- data/lib/tremendous/models/fraud_review_geo.rb +235 -0
- data/lib/tremendous/models/{reward_with_link_delivery.rb → fraud_review_list_item.rb} +26 -51
- data/lib/tremendous/models/fraud_review_reason.rb +58 -0
- data/lib/tremendous/models/fraud_review_redemption_method.rb +44 -0
- data/lib/tremendous/models/fraud_review_related_rewards.rb +304 -0
- data/lib/tremendous/models/fraud_review_status.rb +41 -0
- data/lib/tremendous/models/fraud_rule200_response.rb +222 -0
- data/lib/tremendous/models/fraud_rule400_response.rb +221 -0
- data/lib/tremendous/models/fraud_rule422_response.rb +221 -0
- data/lib/tremendous/models/fraud_rule_request.rb +214 -0
- data/lib/tremendous/models/fraud_rule_request_config.rb +110 -0
- data/lib/tremendous/models/fraud_rule_type.rb +49 -0
- data/lib/tremendous/models/fraud_rules_list_item.rb +261 -0
- data/lib/tremendous/models/get_fraud_review200_response.rb +221 -0
- data/lib/tremendous/models/get_fraud_review200_response_fraud_review.rb +351 -0
- data/lib/tremendous/models/get_fraud_review200_response_fraud_review_geo.rb +236 -0
- data/lib/tremendous/models/get_fraud_review200_response_fraud_review_related_rewards.rb +305 -0
- data/lib/tremendous/models/list_campaigns200_response_campaigns_inner_email_style.rb +2 -0
- data/lib/tremendous/models/list_campaigns200_response_campaigns_inner_webpage_style.rb +1 -0
- data/lib/tremendous/models/list_fraud_reviews200_response.rb +223 -0
- data/lib/tremendous/models/{delivery_details_with_link.rb → list_fraud_reviews200_response_fraud_reviews_inner.rb} +26 -51
- data/lib/tremendous/models/list_fraud_rules200_response.rb +223 -0
- data/lib/tremendous/models/{create_order200_response_order_rewards_inner_delivery.rb → list_fraud_rules200_response_fraud_rules_inner.rb} +28 -63
- data/lib/tremendous/models/list_rewards200_response_rewards_inner.rb +0 -21
- data/lib/tremendous/models/list_rewards200_response_rewards_inner_value.rb +1 -6
- data/lib/tremendous/models/order_without_link_reward.rb +0 -21
- data/lib/tremendous/models/public_key.rb +1 -1
- data/lib/tremendous/models/public_keys_response_public_keys_inner.rb +1 -1
- data/lib/tremendous/models/review_country.rb +276 -0
- data/lib/tremendous/models/review_country1.rb +225 -0
- data/lib/tremendous/models/review_email.rb +230 -0
- data/lib/tremendous/models/review_email1.rb +230 -0
- data/lib/tremendous/models/review_ip.rb +225 -0
- data/lib/tremendous/models/review_ip1.rb +225 -0
- data/lib/tremendous/models/review_redeemed_rewards_amount.rb +293 -0
- data/lib/tremendous/models/review_redeemed_rewards_count.rb +293 -0
- data/lib/tremendous/models/reward.rb +0 -21
- data/lib/tremendous/models/reward_base.rb +0 -21
- data/lib/tremendous/models/reward_for_order_create.rb +1 -22
- data/lib/tremendous/models/reward_value.rb +1 -6
- data/lib/tremendous/models/reward_without_link.rb +0 -21
- data/lib/tremendous/models/{order_for_create.rb → single_reward_order.rb} +6 -12
- data/lib/tremendous/models/single_reward_order1.rb +242 -0
- data/lib/tremendous/models/{create_order_request_payment.rb → single_reward_order1_payment.rb} +3 -3
- data/lib/tremendous/models/{create_order_request_reward.rb → single_reward_order1_reward.rb} +5 -26
- data/lib/tremendous/models/{create_order_request_reward_custom_fields_inner.rb → single_reward_order1_reward_custom_fields_inner.rb} +3 -3
- data/lib/tremendous/models/{create_order_request_reward_delivery.rb → single_reward_order1_reward_delivery.rb} +3 -3
- data/lib/tremendous/models/{order_for_create_reward.rb → single_reward_order_reward.rb} +4 -25
- data/lib/tremendous/models/{create_order201_response.rb → single_reward_order_without_link.rb} +4 -4
- data/lib/tremendous/models/{order_with_link.rb → single_reward_order_without_link_order.rb} +10 -31
- data/lib/tremendous/models/update_fraud_rule_list200_response.rb +222 -0
- data/lib/tremendous/models/update_fraud_rule_list_request.rb +272 -0
- data/lib/tremendous/models/update_fraud_rule_list_request_config.rb +108 -0
- data/lib/tremendous/version.rb +1 -1
- data/lib/tremendous.rb +56 -15
- metadata +59 -18
- data/lib/tremendous/models/create_order200_response_order.rb +0 -400
- data/lib/tremendous/models/create_order200_response_order_rewards_inner.rb +0 -347
- data/lib/tremendous/models/order_with_link_rewards_inner.rb +0 -406
- data/lib/tremendous/models/reward_with_link.rb +0 -406
|
@@ -23,7 +23,7 @@ module Tremendous
|
|
|
23
23
|
# Approves an order that is pending review, identified by the given `id` in the URL. Approvals is a feature that requires orders to be approved by an organization admin before they are sent out. To enable approvals for your organization, please enable 'Allow approvals via API' via the organization''s 'Order Approvals' settings from the Tremendous dashboard.
|
|
24
24
|
# @param id [String] ID of the order that should be approved. In case the order has an `external_id` reference supplied by the customer on creation, it's possible to use it instead.
|
|
25
25
|
# @param [Hash] opts the optional parameters
|
|
26
|
-
# @return [
|
|
26
|
+
# @return [CreateOrder200Response]
|
|
27
27
|
def approve_order(id, opts = {})
|
|
28
28
|
data, _status_code, _headers = approve_order_with_http_info(id, opts)
|
|
29
29
|
data
|
|
@@ -33,7 +33,7 @@ module Tremendous
|
|
|
33
33
|
# Approves an order that is pending review, identified by the given `id` in the URL. Approvals is a feature that requires orders to be approved by an organization admin before they are sent out. To enable approvals for your organization, please enable 'Allow approvals via API' via the organization''s 'Order Approvals' settings from the Tremendous dashboard.
|
|
34
34
|
# @param id [String] ID of the order that should be approved. In case the order has an `external_id` reference supplied by the customer on creation, it's possible to use it instead.
|
|
35
35
|
# @param [Hash] opts the optional parameters
|
|
36
|
-
# @return [Array<(
|
|
36
|
+
# @return [Array<(CreateOrder200Response, Integer, Hash)>] CreateOrder200Response data, response status code and response headers
|
|
37
37
|
def approve_order_with_http_info(id, opts = {})
|
|
38
38
|
if @api_client.config.debugging
|
|
39
39
|
@api_client.config.logger.debug 'Calling API: TremendousApi.approve_order ...'
|
|
@@ -65,7 +65,7 @@ module Tremendous
|
|
|
65
65
|
post_body = opts[:debug_body]
|
|
66
66
|
|
|
67
67
|
# return_type
|
|
68
|
-
return_type = opts[:debug_return_type] || '
|
|
68
|
+
return_type = opts[:debug_return_type] || 'CreateOrder200Response'
|
|
69
69
|
|
|
70
70
|
# auth_names
|
|
71
71
|
auth_names = opts[:debug_auth_names] || ['BearerApiKey']
|
|
@@ -87,6 +87,69 @@ module Tremendous
|
|
|
87
87
|
return data, status_code, headers
|
|
88
88
|
end
|
|
89
89
|
|
|
90
|
+
# Block fraud review
|
|
91
|
+
# Completes the fraud review identified by the given `id` in the URL, and blocks the reward. The reward is canceled and the amount refunded.
|
|
92
|
+
# @param id [String] The ID of the reward that should be blocked.
|
|
93
|
+
# @param [Hash] opts the optional parameters
|
|
94
|
+
# @return [GetFraudReview200Response]
|
|
95
|
+
def block_fraud_review(id, opts = {})
|
|
96
|
+
data, _status_code, _headers = block_fraud_review_with_http_info(id, opts)
|
|
97
|
+
data
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Block fraud review
|
|
101
|
+
# Completes the fraud review identified by the given `id` in the URL, and blocks the reward. The reward is canceled and the amount refunded.
|
|
102
|
+
# @param id [String] The ID of the reward that should be blocked.
|
|
103
|
+
# @param [Hash] opts the optional parameters
|
|
104
|
+
# @return [Array<(GetFraudReview200Response, Integer, Hash)>] GetFraudReview200Response data, response status code and response headers
|
|
105
|
+
def block_fraud_review_with_http_info(id, opts = {})
|
|
106
|
+
if @api_client.config.debugging
|
|
107
|
+
@api_client.config.logger.debug 'Calling API: TremendousApi.block_fraud_review ...'
|
|
108
|
+
end
|
|
109
|
+
# verify the required parameter 'id' is set
|
|
110
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
111
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.block_fraud_review"
|
|
112
|
+
end
|
|
113
|
+
# resource path
|
|
114
|
+
local_var_path = '/fraud_reviews/{id}/block'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
115
|
+
|
|
116
|
+
# query parameters
|
|
117
|
+
query_params = opts[:query_params] || {}
|
|
118
|
+
|
|
119
|
+
# header parameters
|
|
120
|
+
header_params = opts[:header_params] || {}
|
|
121
|
+
# HTTP header 'Accept' (if needed)
|
|
122
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
123
|
+
|
|
124
|
+
# form parameters
|
|
125
|
+
form_params = opts[:form_params] || {}
|
|
126
|
+
|
|
127
|
+
# http body (model)
|
|
128
|
+
post_body = opts[:debug_body]
|
|
129
|
+
|
|
130
|
+
# return_type
|
|
131
|
+
return_type = opts[:debug_return_type] || 'GetFraudReview200Response'
|
|
132
|
+
|
|
133
|
+
# auth_names
|
|
134
|
+
auth_names = opts[:debug_auth_names] || ['BearerApiKey']
|
|
135
|
+
|
|
136
|
+
new_options = opts.merge(
|
|
137
|
+
:operation => :"TremendousApi.block_fraud_review",
|
|
138
|
+
:header_params => header_params,
|
|
139
|
+
:query_params => query_params,
|
|
140
|
+
:form_params => form_params,
|
|
141
|
+
:body => post_body,
|
|
142
|
+
:auth_names => auth_names,
|
|
143
|
+
:return_type => return_type
|
|
144
|
+
)
|
|
145
|
+
|
|
146
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
|
147
|
+
if @api_client.config.debugging
|
|
148
|
+
@api_client.config.logger.debug "API called: TremendousApi#block_fraud_review\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
149
|
+
end
|
|
150
|
+
return data, status_code, headers
|
|
151
|
+
end
|
|
152
|
+
|
|
90
153
|
# Create API key
|
|
91
154
|
# Creates a new API key. The API key used to make the request will remain active. Created API keys are generated randomly and returned in the response. **You cannot retrieve them again.**
|
|
92
155
|
# @param [Hash] opts the optional parameters
|
|
@@ -618,6 +681,74 @@ module Tremendous
|
|
|
618
681
|
return data, status_code, headers
|
|
619
682
|
end
|
|
620
683
|
|
|
684
|
+
# Delete fraud rule
|
|
685
|
+
# Deletes the rule of the type passed in the URL.
|
|
686
|
+
# @param rule_type [String] The rule type to create or update.
|
|
687
|
+
# @param [Hash] opts the optional parameters
|
|
688
|
+
# @return [DeleteFraudRule200Response]
|
|
689
|
+
def delete_fraud_rule(rule_type, opts = {})
|
|
690
|
+
data, _status_code, _headers = delete_fraud_rule_with_http_info(rule_type, opts)
|
|
691
|
+
data
|
|
692
|
+
end
|
|
693
|
+
|
|
694
|
+
# Delete fraud rule
|
|
695
|
+
# Deletes the rule of the type passed in the URL.
|
|
696
|
+
# @param rule_type [String] The rule type to create or update.
|
|
697
|
+
# @param [Hash] opts the optional parameters
|
|
698
|
+
# @return [Array<(DeleteFraudRule200Response, Integer, Hash)>] DeleteFraudRule200Response data, response status code and response headers
|
|
699
|
+
def delete_fraud_rule_with_http_info(rule_type, opts = {})
|
|
700
|
+
if @api_client.config.debugging
|
|
701
|
+
@api_client.config.logger.debug 'Calling API: TremendousApi.delete_fraud_rule ...'
|
|
702
|
+
end
|
|
703
|
+
# verify the required parameter 'rule_type' is set
|
|
704
|
+
if @api_client.config.client_side_validation && rule_type.nil?
|
|
705
|
+
fail ArgumentError, "Missing the required parameter 'rule_type' when calling TremendousApi.delete_fraud_rule"
|
|
706
|
+
end
|
|
707
|
+
# verify enum value
|
|
708
|
+
allowable_values = ["review_country", "review_ip", "review_email", "review_redeemed_rewards_count", "review_redeemed_rewards_amount", "review_multiple_emails", "review_vpn", "review_tremendous_flag_list", "review_previously_blocked_recipients", "allow_ip", "allow_email"]
|
|
709
|
+
if @api_client.config.client_side_validation && !allowable_values.include?(rule_type)
|
|
710
|
+
fail ArgumentError, "invalid value for \"rule_type\", must be one of #{allowable_values}"
|
|
711
|
+
end
|
|
712
|
+
# resource path
|
|
713
|
+
local_var_path = '/fraud_rules/{rule_type}'.sub('{' + 'rule_type' + '}', CGI.escape(rule_type.to_s))
|
|
714
|
+
|
|
715
|
+
# query parameters
|
|
716
|
+
query_params = opts[:query_params] || {}
|
|
717
|
+
|
|
718
|
+
# header parameters
|
|
719
|
+
header_params = opts[:header_params] || {}
|
|
720
|
+
# HTTP header 'Accept' (if needed)
|
|
721
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
722
|
+
|
|
723
|
+
# form parameters
|
|
724
|
+
form_params = opts[:form_params] || {}
|
|
725
|
+
|
|
726
|
+
# http body (model)
|
|
727
|
+
post_body = opts[:debug_body]
|
|
728
|
+
|
|
729
|
+
# return_type
|
|
730
|
+
return_type = opts[:debug_return_type] || 'DeleteFraudRule200Response'
|
|
731
|
+
|
|
732
|
+
# auth_names
|
|
733
|
+
auth_names = opts[:debug_auth_names] || ['BearerApiKey']
|
|
734
|
+
|
|
735
|
+
new_options = opts.merge(
|
|
736
|
+
:operation => :"TremendousApi.delete_fraud_rule",
|
|
737
|
+
:header_params => header_params,
|
|
738
|
+
:query_params => query_params,
|
|
739
|
+
:form_params => form_params,
|
|
740
|
+
:body => post_body,
|
|
741
|
+
:auth_names => auth_names,
|
|
742
|
+
:return_type => return_type
|
|
743
|
+
)
|
|
744
|
+
|
|
745
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
746
|
+
if @api_client.config.debugging
|
|
747
|
+
@api_client.config.logger.debug "API called: TremendousApi#delete_fraud_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
748
|
+
end
|
|
749
|
+
return data, status_code, headers
|
|
750
|
+
end
|
|
751
|
+
|
|
621
752
|
# Delete invoice
|
|
622
753
|
# Removes an invoice. This has no further consequences but is a rather cosmetic operation.
|
|
623
754
|
# @param id [String] ID of the invoice that should be removed
|
|
@@ -943,6 +1074,81 @@ module Tremendous
|
|
|
943
1074
|
return data, status_code, headers
|
|
944
1075
|
end
|
|
945
1076
|
|
|
1077
|
+
# Configure fraud rule
|
|
1078
|
+
# Configure a fraud rule of the type passed in the URL. If a rule of the same type already exists, it will be overwritten.
|
|
1079
|
+
# @param rule_type [String] The rule type to create or update.
|
|
1080
|
+
# @param [Hash] opts the optional parameters
|
|
1081
|
+
# @option opts [FraudRuleRequest] :fraud_rule_request Rules `review_multiple_emails`, `review_vpn`, `review_tremendous_flaglist`, and `review_previously_blocked_recipients` require no body.
|
|
1082
|
+
# @return [FraudRule200Response]
|
|
1083
|
+
def fraud_rule(rule_type, opts = {})
|
|
1084
|
+
data, _status_code, _headers = fraud_rule_with_http_info(rule_type, opts)
|
|
1085
|
+
data
|
|
1086
|
+
end
|
|
1087
|
+
|
|
1088
|
+
# Configure fraud rule
|
|
1089
|
+
# Configure a fraud rule of the type passed in the URL. If a rule of the same type already exists, it will be overwritten.
|
|
1090
|
+
# @param rule_type [String] The rule type to create or update.
|
|
1091
|
+
# @param [Hash] opts the optional parameters
|
|
1092
|
+
# @option opts [FraudRuleRequest] :fraud_rule_request Rules `review_multiple_emails`, `review_vpn`, `review_tremendous_flaglist`, and `review_previously_blocked_recipients` require no body.
|
|
1093
|
+
# @return [Array<(FraudRule200Response, Integer, Hash)>] FraudRule200Response data, response status code and response headers
|
|
1094
|
+
def fraud_rule_with_http_info(rule_type, opts = {})
|
|
1095
|
+
if @api_client.config.debugging
|
|
1096
|
+
@api_client.config.logger.debug 'Calling API: TremendousApi.fraud_rule ...'
|
|
1097
|
+
end
|
|
1098
|
+
# verify the required parameter 'rule_type' is set
|
|
1099
|
+
if @api_client.config.client_side_validation && rule_type.nil?
|
|
1100
|
+
fail ArgumentError, "Missing the required parameter 'rule_type' when calling TremendousApi.fraud_rule"
|
|
1101
|
+
end
|
|
1102
|
+
# verify enum value
|
|
1103
|
+
allowable_values = ["review_country", "review_ip", "review_email", "review_redeemed_rewards_count", "review_redeemed_rewards_amount", "review_multiple_emails", "review_vpn", "review_tremendous_flag_list", "review_previously_blocked_recipients", "allow_ip", "allow_email"]
|
|
1104
|
+
if @api_client.config.client_side_validation && !allowable_values.include?(rule_type)
|
|
1105
|
+
fail ArgumentError, "invalid value for \"rule_type\", must be one of #{allowable_values}"
|
|
1106
|
+
end
|
|
1107
|
+
# resource path
|
|
1108
|
+
local_var_path = '/fraud_rules/{rule_type}'.sub('{' + 'rule_type' + '}', CGI.escape(rule_type.to_s))
|
|
1109
|
+
|
|
1110
|
+
# query parameters
|
|
1111
|
+
query_params = opts[:query_params] || {}
|
|
1112
|
+
|
|
1113
|
+
# header parameters
|
|
1114
|
+
header_params = opts[:header_params] || {}
|
|
1115
|
+
# HTTP header 'Accept' (if needed)
|
|
1116
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
1117
|
+
# HTTP header 'Content-Type'
|
|
1118
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
1119
|
+
if !content_type.nil?
|
|
1120
|
+
header_params['Content-Type'] = content_type
|
|
1121
|
+
end
|
|
1122
|
+
|
|
1123
|
+
# form parameters
|
|
1124
|
+
form_params = opts[:form_params] || {}
|
|
1125
|
+
|
|
1126
|
+
# http body (model)
|
|
1127
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'fraud_rule_request'])
|
|
1128
|
+
|
|
1129
|
+
# return_type
|
|
1130
|
+
return_type = opts[:debug_return_type] || 'FraudRule200Response'
|
|
1131
|
+
|
|
1132
|
+
# auth_names
|
|
1133
|
+
auth_names = opts[:debug_auth_names] || ['BearerApiKey']
|
|
1134
|
+
|
|
1135
|
+
new_options = opts.merge(
|
|
1136
|
+
:operation => :"TremendousApi.fraud_rule",
|
|
1137
|
+
:header_params => header_params,
|
|
1138
|
+
:query_params => query_params,
|
|
1139
|
+
:form_params => form_params,
|
|
1140
|
+
:body => post_body,
|
|
1141
|
+
:auth_names => auth_names,
|
|
1142
|
+
:return_type => return_type
|
|
1143
|
+
)
|
|
1144
|
+
|
|
1145
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
1146
|
+
if @api_client.config.debugging
|
|
1147
|
+
@api_client.config.logger.debug "API called: TremendousApi#fraud_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1148
|
+
end
|
|
1149
|
+
return data, status_code, headers
|
|
1150
|
+
end
|
|
1151
|
+
|
|
946
1152
|
# Generate a reward URL
|
|
947
1153
|
# Generate a redemption link for the reward identified by the `id` in the URL
|
|
948
1154
|
# @param id [String] ID of the reward
|
|
@@ -1147,6 +1353,69 @@ module Tremendous
|
|
|
1147
1353
|
return data, status_code, headers
|
|
1148
1354
|
end
|
|
1149
1355
|
|
|
1356
|
+
# Retrieve single fraud review
|
|
1357
|
+
# Retrieve the details of a fraud review, identified by the given `id` in the URL. Returns additional details regarding the fraud review beyond what's provided in the List fraud reviews endpoint, including reward details, recipient geolocation, etc.
|
|
1358
|
+
# @param id [String] The ID of the reward that should be retrieved.
|
|
1359
|
+
# @param [Hash] opts the optional parameters
|
|
1360
|
+
# @return [GetFraudReview200Response]
|
|
1361
|
+
def get_fraud_review(id, opts = {})
|
|
1362
|
+
data, _status_code, _headers = get_fraud_review_with_http_info(id, opts)
|
|
1363
|
+
data
|
|
1364
|
+
end
|
|
1365
|
+
|
|
1366
|
+
# Retrieve single fraud review
|
|
1367
|
+
# Retrieve the details of a fraud review, identified by the given `id` in the URL. Returns additional details regarding the fraud review beyond what's provided in the List fraud reviews endpoint, including reward details, recipient geolocation, etc.
|
|
1368
|
+
# @param id [String] The ID of the reward that should be retrieved.
|
|
1369
|
+
# @param [Hash] opts the optional parameters
|
|
1370
|
+
# @return [Array<(GetFraudReview200Response, Integer, Hash)>] GetFraudReview200Response data, response status code and response headers
|
|
1371
|
+
def get_fraud_review_with_http_info(id, opts = {})
|
|
1372
|
+
if @api_client.config.debugging
|
|
1373
|
+
@api_client.config.logger.debug 'Calling API: TremendousApi.get_fraud_review ...'
|
|
1374
|
+
end
|
|
1375
|
+
# verify the required parameter 'id' is set
|
|
1376
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
1377
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.get_fraud_review"
|
|
1378
|
+
end
|
|
1379
|
+
# resource path
|
|
1380
|
+
local_var_path = '/fraud_reviews/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
1381
|
+
|
|
1382
|
+
# query parameters
|
|
1383
|
+
query_params = opts[:query_params] || {}
|
|
1384
|
+
|
|
1385
|
+
# header parameters
|
|
1386
|
+
header_params = opts[:header_params] || {}
|
|
1387
|
+
# HTTP header 'Accept' (if needed)
|
|
1388
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
1389
|
+
|
|
1390
|
+
# form parameters
|
|
1391
|
+
form_params = opts[:form_params] || {}
|
|
1392
|
+
|
|
1393
|
+
# http body (model)
|
|
1394
|
+
post_body = opts[:debug_body]
|
|
1395
|
+
|
|
1396
|
+
# return_type
|
|
1397
|
+
return_type = opts[:debug_return_type] || 'GetFraudReview200Response'
|
|
1398
|
+
|
|
1399
|
+
# auth_names
|
|
1400
|
+
auth_names = opts[:debug_auth_names] || ['BearerApiKey']
|
|
1401
|
+
|
|
1402
|
+
new_options = opts.merge(
|
|
1403
|
+
:operation => :"TremendousApi.get_fraud_review",
|
|
1404
|
+
:header_params => header_params,
|
|
1405
|
+
:query_params => query_params,
|
|
1406
|
+
:form_params => form_params,
|
|
1407
|
+
:body => post_body,
|
|
1408
|
+
:auth_names => auth_names,
|
|
1409
|
+
:return_type => return_type
|
|
1410
|
+
)
|
|
1411
|
+
|
|
1412
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
1413
|
+
if @api_client.config.debugging
|
|
1414
|
+
@api_client.config.logger.debug "API called: TremendousApi#get_fraud_review\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1415
|
+
end
|
|
1416
|
+
return data, status_code, headers
|
|
1417
|
+
end
|
|
1418
|
+
|
|
1150
1419
|
# Retrieve funding source
|
|
1151
1420
|
# Retrieve a funding source, identified by the given `id` in the URL
|
|
1152
1421
|
# @param id [String] ID of the funding source that should be retrieved
|
|
@@ -1348,7 +1617,7 @@ module Tremendous
|
|
|
1348
1617
|
# Retrieve the order, identified by the given `id` in the URL
|
|
1349
1618
|
# @param id [String] ID of the order that should be retrieved. In case the order has an `external_id` reference supplied by the customer on creation, it's possible to use it instead.
|
|
1350
1619
|
# @param [Hash] opts the optional parameters
|
|
1351
|
-
# @return [
|
|
1620
|
+
# @return [CreateOrder200Response]
|
|
1352
1621
|
def get_order(id, opts = {})
|
|
1353
1622
|
data, _status_code, _headers = get_order_with_http_info(id, opts)
|
|
1354
1623
|
data
|
|
@@ -1358,7 +1627,7 @@ module Tremendous
|
|
|
1358
1627
|
# Retrieve the order, identified by the given `id` in the URL
|
|
1359
1628
|
# @param id [String] ID of the order that should be retrieved. In case the order has an `external_id` reference supplied by the customer on creation, it's possible to use it instead.
|
|
1360
1629
|
# @param [Hash] opts the optional parameters
|
|
1361
|
-
# @return [Array<(
|
|
1630
|
+
# @return [Array<(CreateOrder200Response, Integer, Hash)>] CreateOrder200Response data, response status code and response headers
|
|
1362
1631
|
def get_order_with_http_info(id, opts = {})
|
|
1363
1632
|
if @api_client.config.debugging
|
|
1364
1633
|
@api_client.config.logger.debug 'Calling API: TremendousApi.get_order ...'
|
|
@@ -1385,7 +1654,7 @@ module Tremendous
|
|
|
1385
1654
|
post_body = opts[:debug_body]
|
|
1386
1655
|
|
|
1387
1656
|
# return_type
|
|
1388
|
-
return_type = opts[:debug_return_type] || '
|
|
1657
|
+
return_type = opts[:debug_return_type] || 'CreateOrder200Response'
|
|
1389
1658
|
|
|
1390
1659
|
# auth_names
|
|
1391
1660
|
auth_names = opts[:debug_auth_names] || ['BearerApiKey']
|
|
@@ -1988,6 +2257,157 @@ module Tremendous
|
|
|
1988
2257
|
return data, status_code, headers
|
|
1989
2258
|
end
|
|
1990
2259
|
|
|
2260
|
+
# List fraud reviews
|
|
2261
|
+
# Retrieve a paginated list of all fraud reviews. List can be filtered by status, created or redeemed at dates.
|
|
2262
|
+
# @param [Hash] opts the optional parameters
|
|
2263
|
+
# @option opts [Integer] :offset Offsets the returned list by the given number of records. The returned fraud reviews are ordered (and offsetted) by their redemption date (DESC).
|
|
2264
|
+
# @option opts [Integer] :limit Limits the number of fraud reviews listed. The default value is 10.
|
|
2265
|
+
# @option opts [String] :status Filters fraud reviews by status. Can be `flagged`, `blocked` or `released`.
|
|
2266
|
+
# @option opts [String] :created_at_gte Return results where the created_at field is >= to the supplied value. Expects an ISO 8601 datetime.
|
|
2267
|
+
# @option opts [String] :created_at_lte Return results where the created_at field is <= to the supplied value. Expects an ISO 8601 datetime.
|
|
2268
|
+
# @option opts [String] :redeemed_at_gte Return results where the redeemed_at field is >= the supplied value. Expects an ISO 8601 datetime.
|
|
2269
|
+
# @option opts [String] :redeemed_at_lte Return results where the redeemed_at field is <= the supplied value. Expects an ISO 8601 datetime.
|
|
2270
|
+
# @return [ListFraudReviews200Response]
|
|
2271
|
+
def list_fraud_reviews(opts = {})
|
|
2272
|
+
data, _status_code, _headers = list_fraud_reviews_with_http_info(opts)
|
|
2273
|
+
data
|
|
2274
|
+
end
|
|
2275
|
+
|
|
2276
|
+
# List fraud reviews
|
|
2277
|
+
# Retrieve a paginated list of all fraud reviews. List can be filtered by status, created or redeemed at dates.
|
|
2278
|
+
# @param [Hash] opts the optional parameters
|
|
2279
|
+
# @option opts [Integer] :offset Offsets the returned list by the given number of records. The returned fraud reviews are ordered (and offsetted) by their redemption date (DESC).
|
|
2280
|
+
# @option opts [Integer] :limit Limits the number of fraud reviews listed. The default value is 10.
|
|
2281
|
+
# @option opts [String] :status Filters fraud reviews by status. Can be `flagged`, `blocked` or `released`.
|
|
2282
|
+
# @option opts [String] :created_at_gte Return results where the created_at field is >= to the supplied value. Expects an ISO 8601 datetime.
|
|
2283
|
+
# @option opts [String] :created_at_lte Return results where the created_at field is <= to the supplied value. Expects an ISO 8601 datetime.
|
|
2284
|
+
# @option opts [String] :redeemed_at_gte Return results where the redeemed_at field is >= the supplied value. Expects an ISO 8601 datetime.
|
|
2285
|
+
# @option opts [String] :redeemed_at_lte Return results where the redeemed_at field is <= the supplied value. Expects an ISO 8601 datetime.
|
|
2286
|
+
# @return [Array<(ListFraudReviews200Response, Integer, Hash)>] ListFraudReviews200Response data, response status code and response headers
|
|
2287
|
+
def list_fraud_reviews_with_http_info(opts = {})
|
|
2288
|
+
if @api_client.config.debugging
|
|
2289
|
+
@api_client.config.logger.debug 'Calling API: TremendousApi.list_fraud_reviews ...'
|
|
2290
|
+
end
|
|
2291
|
+
if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
|
|
2292
|
+
fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling TremendousApi.list_fraud_reviews, must be greater than or equal to 0.'
|
|
2293
|
+
end
|
|
2294
|
+
|
|
2295
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
|
|
2296
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling TremendousApi.list_fraud_reviews, must be smaller than or equal to 100.'
|
|
2297
|
+
end
|
|
2298
|
+
|
|
2299
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
|
2300
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling TremendousApi.list_fraud_reviews, must be greater than or equal to 1.'
|
|
2301
|
+
end
|
|
2302
|
+
|
|
2303
|
+
allowable_values = ["flagged", "blocked", "released"]
|
|
2304
|
+
if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
|
|
2305
|
+
fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
|
|
2306
|
+
end
|
|
2307
|
+
# resource path
|
|
2308
|
+
local_var_path = '/fraud_reviews'
|
|
2309
|
+
|
|
2310
|
+
# query parameters
|
|
2311
|
+
query_params = opts[:query_params] || {}
|
|
2312
|
+
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
|
|
2313
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
2314
|
+
query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
|
|
2315
|
+
query_params[:'created_at[gte]'] = opts[:'created_at_gte'] if !opts[:'created_at_gte'].nil?
|
|
2316
|
+
query_params[:'created_at[lte]'] = opts[:'created_at_lte'] if !opts[:'created_at_lte'].nil?
|
|
2317
|
+
query_params[:'redeemed_at[gte]'] = opts[:'redeemed_at_gte'] if !opts[:'redeemed_at_gte'].nil?
|
|
2318
|
+
query_params[:'redeemed_at[lte]'] = opts[:'redeemed_at_lte'] if !opts[:'redeemed_at_lte'].nil?
|
|
2319
|
+
|
|
2320
|
+
# header parameters
|
|
2321
|
+
header_params = opts[:header_params] || {}
|
|
2322
|
+
# HTTP header 'Accept' (if needed)
|
|
2323
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
2324
|
+
|
|
2325
|
+
# form parameters
|
|
2326
|
+
form_params = opts[:form_params] || {}
|
|
2327
|
+
|
|
2328
|
+
# http body (model)
|
|
2329
|
+
post_body = opts[:debug_body]
|
|
2330
|
+
|
|
2331
|
+
# return_type
|
|
2332
|
+
return_type = opts[:debug_return_type] || 'ListFraudReviews200Response'
|
|
2333
|
+
|
|
2334
|
+
# auth_names
|
|
2335
|
+
auth_names = opts[:debug_auth_names] || ['BearerApiKey']
|
|
2336
|
+
|
|
2337
|
+
new_options = opts.merge(
|
|
2338
|
+
:operation => :"TremendousApi.list_fraud_reviews",
|
|
2339
|
+
:header_params => header_params,
|
|
2340
|
+
:query_params => query_params,
|
|
2341
|
+
:form_params => form_params,
|
|
2342
|
+
:body => post_body,
|
|
2343
|
+
:auth_names => auth_names,
|
|
2344
|
+
:return_type => return_type
|
|
2345
|
+
)
|
|
2346
|
+
|
|
2347
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
2348
|
+
if @api_client.config.debugging
|
|
2349
|
+
@api_client.config.logger.debug "API called: TremendousApi#list_fraud_reviews\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
2350
|
+
end
|
|
2351
|
+
return data, status_code, headers
|
|
2352
|
+
end
|
|
2353
|
+
|
|
2354
|
+
# List fraud rules
|
|
2355
|
+
# List active fraud rules associated with the organization tied to your API key.
|
|
2356
|
+
# @param [Hash] opts the optional parameters
|
|
2357
|
+
# @return [ListFraudRules200Response]
|
|
2358
|
+
def list_fraud_rules(opts = {})
|
|
2359
|
+
data, _status_code, _headers = list_fraud_rules_with_http_info(opts)
|
|
2360
|
+
data
|
|
2361
|
+
end
|
|
2362
|
+
|
|
2363
|
+
# List fraud rules
|
|
2364
|
+
# List active fraud rules associated with the organization tied to your API key.
|
|
2365
|
+
# @param [Hash] opts the optional parameters
|
|
2366
|
+
# @return [Array<(ListFraudRules200Response, Integer, Hash)>] ListFraudRules200Response data, response status code and response headers
|
|
2367
|
+
def list_fraud_rules_with_http_info(opts = {})
|
|
2368
|
+
if @api_client.config.debugging
|
|
2369
|
+
@api_client.config.logger.debug 'Calling API: TremendousApi.list_fraud_rules ...'
|
|
2370
|
+
end
|
|
2371
|
+
# resource path
|
|
2372
|
+
local_var_path = '/fraud_rules'
|
|
2373
|
+
|
|
2374
|
+
# query parameters
|
|
2375
|
+
query_params = opts[:query_params] || {}
|
|
2376
|
+
|
|
2377
|
+
# header parameters
|
|
2378
|
+
header_params = opts[:header_params] || {}
|
|
2379
|
+
# HTTP header 'Accept' (if needed)
|
|
2380
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
2381
|
+
|
|
2382
|
+
# form parameters
|
|
2383
|
+
form_params = opts[:form_params] || {}
|
|
2384
|
+
|
|
2385
|
+
# http body (model)
|
|
2386
|
+
post_body = opts[:debug_body]
|
|
2387
|
+
|
|
2388
|
+
# return_type
|
|
2389
|
+
return_type = opts[:debug_return_type] || 'ListFraudRules200Response'
|
|
2390
|
+
|
|
2391
|
+
# auth_names
|
|
2392
|
+
auth_names = opts[:debug_auth_names] || ['BearerApiKey']
|
|
2393
|
+
|
|
2394
|
+
new_options = opts.merge(
|
|
2395
|
+
:operation => :"TremendousApi.list_fraud_rules",
|
|
2396
|
+
:header_params => header_params,
|
|
2397
|
+
:query_params => query_params,
|
|
2398
|
+
:form_params => form_params,
|
|
2399
|
+
:body => post_body,
|
|
2400
|
+
:auth_names => auth_names,
|
|
2401
|
+
:return_type => return_type
|
|
2402
|
+
)
|
|
2403
|
+
|
|
2404
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
2405
|
+
if @api_client.config.debugging
|
|
2406
|
+
@api_client.config.logger.debug "API called: TremendousApi#list_fraud_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
2407
|
+
end
|
|
2408
|
+
return data, status_code, headers
|
|
2409
|
+
end
|
|
2410
|
+
|
|
1991
2411
|
# List funding sources
|
|
1992
2412
|
# Retrieve a list of all funding sources available for ordering through the API in your organization's account.
|
|
1993
2413
|
# @param [Hash] opts the optional parameters
|
|
@@ -2663,7 +3083,7 @@ module Tremendous
|
|
|
2663
3083
|
# Rejects an order that is pending review, identified by the given `id` in the URL. Approvals is a feature that requires orders to be approved by an organization admin before they are sent out. To enable approvals for your organization, please enable 'Allow approvals via API' via the organization''s 'Order Approvals' settings from the Tremendous dashboard.
|
|
2664
3084
|
# @param id [String] ID of the order that should be rejected. In case the order has an `external_id` reference supplied by the customer on creation, it's possible to use it instead.
|
|
2665
3085
|
# @param [Hash] opts the optional parameters
|
|
2666
|
-
# @return [
|
|
3086
|
+
# @return [CreateOrder200Response]
|
|
2667
3087
|
def reject_order(id, opts = {})
|
|
2668
3088
|
data, _status_code, _headers = reject_order_with_http_info(id, opts)
|
|
2669
3089
|
data
|
|
@@ -2673,7 +3093,7 @@ module Tremendous
|
|
|
2673
3093
|
# Rejects an order that is pending review, identified by the given `id` in the URL. Approvals is a feature that requires orders to be approved by an organization admin before they are sent out. To enable approvals for your organization, please enable 'Allow approvals via API' via the organization''s 'Order Approvals' settings from the Tremendous dashboard.
|
|
2674
3094
|
# @param id [String] ID of the order that should be rejected. In case the order has an `external_id` reference supplied by the customer on creation, it's possible to use it instead.
|
|
2675
3095
|
# @param [Hash] opts the optional parameters
|
|
2676
|
-
# @return [Array<(
|
|
3096
|
+
# @return [Array<(CreateOrder200Response, Integer, Hash)>] CreateOrder200Response data, response status code and response headers
|
|
2677
3097
|
def reject_order_with_http_info(id, opts = {})
|
|
2678
3098
|
if @api_client.config.debugging
|
|
2679
3099
|
@api_client.config.logger.debug 'Calling API: TremendousApi.reject_order ...'
|
|
@@ -2705,7 +3125,7 @@ module Tremendous
|
|
|
2705
3125
|
post_body = opts[:debug_body]
|
|
2706
3126
|
|
|
2707
3127
|
# return_type
|
|
2708
|
-
return_type = opts[:debug_return_type] || '
|
|
3128
|
+
return_type = opts[:debug_return_type] || 'CreateOrder200Response'
|
|
2709
3129
|
|
|
2710
3130
|
# auth_names
|
|
2711
3131
|
auth_names = opts[:debug_auth_names] || ['BearerApiKey']
|
|
@@ -2727,6 +3147,69 @@ module Tremendous
|
|
|
2727
3147
|
return data, status_code, headers
|
|
2728
3148
|
end
|
|
2729
3149
|
|
|
3150
|
+
# Release fraud review
|
|
3151
|
+
# Completes the fraud review identified by the given `id` in the URL, and releases the associated reward to the recipient.
|
|
3152
|
+
# @param id [String] The ID of the reward that should be released.
|
|
3153
|
+
# @param [Hash] opts the optional parameters
|
|
3154
|
+
# @return [GetFraudReview200Response]
|
|
3155
|
+
def release_fraud_review(id, opts = {})
|
|
3156
|
+
data, _status_code, _headers = release_fraud_review_with_http_info(id, opts)
|
|
3157
|
+
data
|
|
3158
|
+
end
|
|
3159
|
+
|
|
3160
|
+
# Release fraud review
|
|
3161
|
+
# Completes the fraud review identified by the given `id` in the URL, and releases the associated reward to the recipient.
|
|
3162
|
+
# @param id [String] The ID of the reward that should be released.
|
|
3163
|
+
# @param [Hash] opts the optional parameters
|
|
3164
|
+
# @return [Array<(GetFraudReview200Response, Integer, Hash)>] GetFraudReview200Response data, response status code and response headers
|
|
3165
|
+
def release_fraud_review_with_http_info(id, opts = {})
|
|
3166
|
+
if @api_client.config.debugging
|
|
3167
|
+
@api_client.config.logger.debug 'Calling API: TremendousApi.release_fraud_review ...'
|
|
3168
|
+
end
|
|
3169
|
+
# verify the required parameter 'id' is set
|
|
3170
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
3171
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.release_fraud_review"
|
|
3172
|
+
end
|
|
3173
|
+
# resource path
|
|
3174
|
+
local_var_path = '/fraud_reviews/{id}/release'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
3175
|
+
|
|
3176
|
+
# query parameters
|
|
3177
|
+
query_params = opts[:query_params] || {}
|
|
3178
|
+
|
|
3179
|
+
# header parameters
|
|
3180
|
+
header_params = opts[:header_params] || {}
|
|
3181
|
+
# HTTP header 'Accept' (if needed)
|
|
3182
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
3183
|
+
|
|
3184
|
+
# form parameters
|
|
3185
|
+
form_params = opts[:form_params] || {}
|
|
3186
|
+
|
|
3187
|
+
# http body (model)
|
|
3188
|
+
post_body = opts[:debug_body]
|
|
3189
|
+
|
|
3190
|
+
# return_type
|
|
3191
|
+
return_type = opts[:debug_return_type] || 'GetFraudReview200Response'
|
|
3192
|
+
|
|
3193
|
+
# auth_names
|
|
3194
|
+
auth_names = opts[:debug_auth_names] || ['BearerApiKey']
|
|
3195
|
+
|
|
3196
|
+
new_options = opts.merge(
|
|
3197
|
+
:operation => :"TremendousApi.release_fraud_review",
|
|
3198
|
+
:header_params => header_params,
|
|
3199
|
+
:query_params => query_params,
|
|
3200
|
+
:form_params => form_params,
|
|
3201
|
+
:body => post_body,
|
|
3202
|
+
:auth_names => auth_names,
|
|
3203
|
+
:return_type => return_type
|
|
3204
|
+
)
|
|
3205
|
+
|
|
3206
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
|
3207
|
+
if @api_client.config.debugging
|
|
3208
|
+
@api_client.config.logger.debug "API called: TremendousApi#release_fraud_review\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
3209
|
+
end
|
|
3210
|
+
return data, status_code, headers
|
|
3211
|
+
end
|
|
3212
|
+
|
|
2730
3213
|
# Resend reward
|
|
2731
3214
|
# Resends a reward, identified by the given `id` in the URL, to its recipient.
|
|
2732
3215
|
# @param id [String] ID of the reward that should be resent
|
|
@@ -3029,5 +3512,84 @@ module Tremendous
|
|
|
3029
3512
|
end
|
|
3030
3513
|
return data, status_code, headers
|
|
3031
3514
|
end
|
|
3515
|
+
|
|
3516
|
+
# Update fraud rule list
|
|
3517
|
+
# Use this endpoint to modify a list associated with an already-configured rule. Add and remove operations supported. For example, to append new IPs to the `review_ip` rule, a valid JSON body would be: ```json { \"operation\": \"add\", \"config\": { \"ips\": [\"123.123.123.123\"] } } ```
|
|
3518
|
+
# @param rule_type [String] The rule type to create or update.
|
|
3519
|
+
# @param update_fraud_rule_list_request [UpdateFraudRuleListRequest] The lists to add or remove from the current configuration
|
|
3520
|
+
# @param [Hash] opts the optional parameters
|
|
3521
|
+
# @return [UpdateFraudRuleList200Response]
|
|
3522
|
+
def update_fraud_rule_list(rule_type, update_fraud_rule_list_request, opts = {})
|
|
3523
|
+
data, _status_code, _headers = update_fraud_rule_list_with_http_info(rule_type, update_fraud_rule_list_request, opts)
|
|
3524
|
+
data
|
|
3525
|
+
end
|
|
3526
|
+
|
|
3527
|
+
# Update fraud rule list
|
|
3528
|
+
# Use this endpoint to modify a list associated with an already-configured rule. Add and remove operations supported. For example, to append new IPs to the `review_ip` rule, a valid JSON body would be: ```json { \"operation\": \"add\", \"config\": { \"ips\": [\"123.123.123.123\"] } } ```
|
|
3529
|
+
# @param rule_type [String] The rule type to create or update.
|
|
3530
|
+
# @param update_fraud_rule_list_request [UpdateFraudRuleListRequest] The lists to add or remove from the current configuration
|
|
3531
|
+
# @param [Hash] opts the optional parameters
|
|
3532
|
+
# @return [Array<(UpdateFraudRuleList200Response, Integer, Hash)>] UpdateFraudRuleList200Response data, response status code and response headers
|
|
3533
|
+
def update_fraud_rule_list_with_http_info(rule_type, update_fraud_rule_list_request, opts = {})
|
|
3534
|
+
if @api_client.config.debugging
|
|
3535
|
+
@api_client.config.logger.debug 'Calling API: TremendousApi.update_fraud_rule_list ...'
|
|
3536
|
+
end
|
|
3537
|
+
# verify the required parameter 'rule_type' is set
|
|
3538
|
+
if @api_client.config.client_side_validation && rule_type.nil?
|
|
3539
|
+
fail ArgumentError, "Missing the required parameter 'rule_type' when calling TremendousApi.update_fraud_rule_list"
|
|
3540
|
+
end
|
|
3541
|
+
# verify enum value
|
|
3542
|
+
allowable_values = ["review_country", "review_ip", "review_email", "allow_ip", "allow_email"]
|
|
3543
|
+
if @api_client.config.client_side_validation && !allowable_values.include?(rule_type)
|
|
3544
|
+
fail ArgumentError, "invalid value for \"rule_type\", must be one of #{allowable_values}"
|
|
3545
|
+
end
|
|
3546
|
+
# verify the required parameter 'update_fraud_rule_list_request' is set
|
|
3547
|
+
if @api_client.config.client_side_validation && update_fraud_rule_list_request.nil?
|
|
3548
|
+
fail ArgumentError, "Missing the required parameter 'update_fraud_rule_list_request' when calling TremendousApi.update_fraud_rule_list"
|
|
3549
|
+
end
|
|
3550
|
+
# resource path
|
|
3551
|
+
local_var_path = '/fraud_rules/{rule_type}/update_list'.sub('{' + 'rule_type' + '}', CGI.escape(rule_type.to_s))
|
|
3552
|
+
|
|
3553
|
+
# query parameters
|
|
3554
|
+
query_params = opts[:query_params] || {}
|
|
3555
|
+
|
|
3556
|
+
# header parameters
|
|
3557
|
+
header_params = opts[:header_params] || {}
|
|
3558
|
+
# HTTP header 'Accept' (if needed)
|
|
3559
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
3560
|
+
# HTTP header 'Content-Type'
|
|
3561
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
3562
|
+
if !content_type.nil?
|
|
3563
|
+
header_params['Content-Type'] = content_type
|
|
3564
|
+
end
|
|
3565
|
+
|
|
3566
|
+
# form parameters
|
|
3567
|
+
form_params = opts[:form_params] || {}
|
|
3568
|
+
|
|
3569
|
+
# http body (model)
|
|
3570
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(update_fraud_rule_list_request)
|
|
3571
|
+
|
|
3572
|
+
# return_type
|
|
3573
|
+
return_type = opts[:debug_return_type] || 'UpdateFraudRuleList200Response'
|
|
3574
|
+
|
|
3575
|
+
# auth_names
|
|
3576
|
+
auth_names = opts[:debug_auth_names] || ['BearerApiKey']
|
|
3577
|
+
|
|
3578
|
+
new_options = opts.merge(
|
|
3579
|
+
:operation => :"TremendousApi.update_fraud_rule_list",
|
|
3580
|
+
:header_params => header_params,
|
|
3581
|
+
:query_params => query_params,
|
|
3582
|
+
:form_params => form_params,
|
|
3583
|
+
:body => post_body,
|
|
3584
|
+
:auth_names => auth_names,
|
|
3585
|
+
:return_type => return_type
|
|
3586
|
+
)
|
|
3587
|
+
|
|
3588
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
3589
|
+
if @api_client.config.debugging
|
|
3590
|
+
@api_client.config.logger.debug "API called: TremendousApi#update_fraud_rule_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
3591
|
+
end
|
|
3592
|
+
return data, status_code, headers
|
|
3593
|
+
end
|
|
3032
3594
|
end
|
|
3033
3595
|
end
|