tremendous_ruby 5.1.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.
Files changed (101) hide show
  1. checksums.yaml +4 -4
  2. data/lib/tremendous/api/tremendous_api.rb +1125 -38
  3. data/lib/tremendous/models/allow_email.rb +225 -0
  4. data/lib/tremendous/models/allow_email1.rb +225 -0
  5. data/lib/tremendous/models/allow_ip.rb +225 -0
  6. data/lib/tremendous/models/allow_ip1.rb +225 -0
  7. data/lib/tremendous/models/base_order_for_create.rb +232 -0
  8. data/lib/tremendous/models/campaign_base.rb +287 -0
  9. data/lib/tremendous/models/create_member.rb +1 -35
  10. data/lib/tremendous/models/create_member_request.rb +1 -35
  11. data/lib/tremendous/models/create_order200_response.rb +1 -1
  12. data/lib/tremendous/models/create_order_request.rb +73 -217
  13. data/lib/tremendous/models/create_organization_request_copy_settings.rb +14 -2
  14. data/lib/tremendous/models/create_public_key.rb +222 -0
  15. data/lib/tremendous/models/create_public_key200_response.rb +221 -0
  16. data/lib/tremendous/models/create_public_key_request.rb +222 -0
  17. data/lib/tremendous/models/delete_fraud_rule200_response.rb +222 -0
  18. data/lib/tremendous/models/fraud_config_allow_email.rb +224 -0
  19. data/lib/tremendous/models/fraud_config_country.rb +275 -0
  20. data/lib/tremendous/models/fraud_config_country_update_list.rb +224 -0
  21. data/lib/tremendous/models/fraud_config_ip.rb +224 -0
  22. data/lib/tremendous/models/fraud_config_redeemed_rewards_amount.rb +292 -0
  23. data/lib/tremendous/models/fraud_config_redeemed_rewards_count.rb +292 -0
  24. data/lib/tremendous/models/fraud_config_review_email.rb +229 -0
  25. data/lib/tremendous/models/fraud_generic_response.rb +222 -0
  26. data/lib/tremendous/models/fraud_review.rb +351 -0
  27. data/lib/tremendous/models/fraud_review_geo.rb +235 -0
  28. data/lib/tremendous/models/{reward_with_link_delivery.rb → fraud_review_list_item.rb} +26 -51
  29. data/lib/tremendous/models/fraud_review_reason.rb +58 -0
  30. data/lib/tremendous/models/fraud_review_redemption_method.rb +44 -0
  31. data/lib/tremendous/models/fraud_review_related_rewards.rb +304 -0
  32. data/lib/tremendous/models/fraud_review_status.rb +41 -0
  33. data/lib/tremendous/models/fraud_rule200_response.rb +222 -0
  34. data/lib/tremendous/models/fraud_rule400_response.rb +221 -0
  35. data/lib/tremendous/models/fraud_rule422_response.rb +221 -0
  36. data/lib/tremendous/models/fraud_rule_request.rb +214 -0
  37. data/lib/tremendous/models/fraud_rule_request_config.rb +110 -0
  38. data/lib/tremendous/models/fraud_rule_type.rb +49 -0
  39. data/lib/tremendous/models/fraud_rules_list_item.rb +261 -0
  40. data/lib/tremendous/models/get_fraud_review200_response.rb +221 -0
  41. data/lib/tremendous/models/get_fraud_review200_response_fraud_review.rb +351 -0
  42. data/lib/tremendous/models/get_fraud_review200_response_fraud_review_geo.rb +236 -0
  43. data/lib/tremendous/models/get_fraud_review200_response_fraud_review_related_rewards.rb +305 -0
  44. data/lib/tremendous/models/get_member200_response_member.rb +2 -20
  45. data/lib/tremendous/models/list_campaigns200_response_campaigns_inner_email_style.rb +2 -0
  46. data/lib/tremendous/models/list_campaigns200_response_campaigns_inner_webpage_style.rb +1 -0
  47. data/lib/tremendous/models/list_forex_response.rb +223 -0
  48. data/lib/tremendous/models/list_fraud_reviews200_response.rb +223 -0
  49. data/lib/tremendous/models/{delivery_details_with_link.rb → list_fraud_reviews200_response_fraud_reviews_inner.rb} +26 -51
  50. data/lib/tremendous/models/list_fraud_rules200_response.rb +223 -0
  51. data/lib/tremendous/models/{create_order200_response_order_rewards_inner_delivery.rb → list_fraud_rules200_response_fraud_rules_inner.rb} +28 -63
  52. data/lib/tremendous/models/list_members200_response_members_inner.rb +2 -20
  53. data/lib/tremendous/models/list_rewards200_response_rewards_inner.rb +0 -21
  54. data/lib/tremendous/models/list_rewards200_response_rewards_inner_value.rb +1 -6
  55. data/lib/tremendous/models/list_roles200_response.rb +223 -0
  56. data/lib/tremendous/models/list_roles200_response_roles_inner.rb +275 -0
  57. data/lib/tremendous/models/member.rb +2 -20
  58. data/lib/tremendous/models/member_base.rb +2 -20
  59. data/lib/tremendous/models/member_with_events.rb +2 -20
  60. data/lib/tremendous/models/member_without_events.rb +2 -20
  61. data/lib/tremendous/models/order_without_link_reward.rb +0 -21
  62. data/lib/tremendous/models/public_key.rb +257 -0
  63. data/lib/tremendous/models/public_keys_response.rb +223 -0
  64. data/lib/tremendous/models/public_keys_response_public_keys_inner.rb +257 -0
  65. data/lib/tremendous/models/review_country.rb +276 -0
  66. data/lib/tremendous/models/review_country1.rb +225 -0
  67. data/lib/tremendous/models/review_email.rb +230 -0
  68. data/lib/tremendous/models/review_email1.rb +230 -0
  69. data/lib/tremendous/models/review_ip.rb +225 -0
  70. data/lib/tremendous/models/review_ip1.rb +225 -0
  71. data/lib/tremendous/models/review_redeemed_rewards_amount.rb +293 -0
  72. data/lib/tremendous/models/review_redeemed_rewards_count.rb +293 -0
  73. data/lib/tremendous/models/reward.rb +0 -21
  74. data/lib/tremendous/models/reward_base.rb +0 -21
  75. data/lib/tremendous/models/reward_for_order_create.rb +1 -22
  76. data/lib/tremendous/models/reward_value.rb +1 -6
  77. data/lib/tremendous/models/reward_without_link.rb +0 -21
  78. data/lib/tremendous/models/role.rb +275 -0
  79. data/lib/tremendous/models/{order_for_create.rb → single_reward_order.rb} +6 -12
  80. data/lib/tremendous/models/single_reward_order1.rb +242 -0
  81. data/lib/tremendous/models/{create_order_request_payment.rb → single_reward_order1_payment.rb} +3 -3
  82. data/lib/tremendous/models/{create_order_request_reward.rb → single_reward_order1_reward.rb} +5 -26
  83. data/lib/tremendous/models/{create_order_request_reward_custom_fields_inner.rb → single_reward_order1_reward_custom_fields_inner.rb} +3 -3
  84. data/lib/tremendous/models/{create_order_request_reward_delivery.rb → single_reward_order1_reward_delivery.rb} +3 -3
  85. data/lib/tremendous/models/{order_for_create_reward.rb → single_reward_order_reward.rb} +4 -25
  86. data/lib/tremendous/models/{create_order201_response.rb → single_reward_order_without_link.rb} +4 -4
  87. data/lib/tremendous/models/{order_with_link.rb → single_reward_order_without_link_order.rb} +10 -31
  88. data/lib/tremendous/models/test_public_key.rb +222 -0
  89. data/lib/tremendous/models/test_public_key_request.rb +222 -0
  90. data/lib/tremendous/models/update_campaign.rb +287 -0
  91. data/lib/tremendous/models/update_campaign_request.rb +257 -0
  92. data/lib/tremendous/models/update_fraud_rule_list200_response.rb +222 -0
  93. data/lib/tremendous/models/update_fraud_rule_list_request.rb +272 -0
  94. data/lib/tremendous/models/update_fraud_rule_list_request_config.rb +108 -0
  95. data/lib/tremendous/version.rb +1 -1
  96. data/lib/tremendous.rb +71 -15
  97. metadata +74 -18
  98. data/lib/tremendous/models/create_order200_response_order.rb +0 -400
  99. data/lib/tremendous/models/create_order200_response_order_rewards_inner.rb +0 -347
  100. data/lib/tremendous/models/order_with_link_rewards_inner.rb +0 -406
  101. 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 [CreateOrder201Response]
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<(CreateOrder201Response, Integer, Hash)>] CreateOrder201Response data, response status code and response headers
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] || 'CreateOrder201Response'
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 &#x60;id&#x60; 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
@@ -279,7 +342,7 @@ module Tremendous
279
342
  end
280
343
 
281
344
  # Create member
282
- # Each organization has one or more users that can access and manage that organization. These users are called members. Members can take actions via the Tremendous web dashboard directly. These actions include adding funding sources to the organization, creating Campaigns, and more. ### Permissions Members can have one of two roles that determine their permissions within the organization: 1. `MEMBER`: Limited permissions. Can view their own reward and order histories only. 2. `ADMIN`: Update organization settings, invite other members to the organization, and view all member order and reward histories within their organization. To create members of a sub-organizations [create an API key for that organization](/reference/post_organizations-id-create-api-key) first, then use the new API key in the create member request. ### Inviting new members After creating a member, an automatic invite is sent to the email address. If the user is not registered yet, that person will then need to sign up for a Tremendous account. > ❗️ Automatic invitations are not available in the sandbox > > You must manually use the returned `invite_url` field in the payload instead.
345
+ # Each organization has one or more users that can access and manage that organization. These users are called members. Members can take actions via the Tremendous web dashboard directly. These actions include adding funding sources to the organization, creating Campaigns, and more. ### Permissions Members can have a role that determine their permissions within the organization. Check the Roles API for the available roles. To create members of a sub-organizations [create an API key for that organization](/reference/post_organizations-id-create-api-key) first, then use the new API key in the create member request. ### Inviting new members After creating a member, an automatic invite is sent to the email address. If the user is not registered yet, that person will then need to sign up for a Tremendous account. > ❗️ Automatic invitations are not available in the sandbox > > You must manually use the returned `invite_url` field in the payload instead.
283
346
  # @param create_member_request [CreateMemberRequest] Member details
284
347
  # @param [Hash] opts the optional parameters
285
348
  # @return [CreateMember200Response]
@@ -289,7 +352,7 @@ module Tremendous
289
352
  end
290
353
 
291
354
  # Create member
292
- # Each organization has one or more users that can access and manage that organization. These users are called members. Members can take actions via the Tremendous web dashboard directly. These actions include adding funding sources to the organization, creating Campaigns, and more. ### Permissions Members can have one of two roles that determine their permissions within the organization: 1. &#x60;MEMBER&#x60;: Limited permissions. Can view their own reward and order histories only. 2. &#x60;ADMIN&#x60;: Update organization settings, invite other members to the organization, and view all member order and reward histories within their organization. To create members of a sub-organizations [create an API key for that organization](/reference/post_organizations-id-create-api-key) first, then use the new API key in the create member request. ### Inviting new members After creating a member, an automatic invite is sent to the email address. If the user is not registered yet, that person will then need to sign up for a Tremendous account. &gt; ❗️ Automatic invitations are not available in the sandbox &gt; &gt; You must manually use the returned &#x60;invite_url&#x60; field in the payload instead.
355
+ # Each organization has one or more users that can access and manage that organization. These users are called members. Members can take actions via the Tremendous web dashboard directly. These actions include adding funding sources to the organization, creating Campaigns, and more. ### Permissions Members can have a role that determine their permissions within the organization. Check the Roles API for the available roles. To create members of a sub-organizations [create an API key for that organization](/reference/post_organizations-id-create-api-key) first, then use the new API key in the create member request. ### Inviting new members After creating a member, an automatic invite is sent to the email address. If the user is not registered yet, that person will then need to sign up for a Tremendous account. &gt; ❗️ Automatic invitations are not available in the sandbox &gt; &gt; You must manually use the returned &#x60;invite_url&#x60; field in the payload instead.
293
356
  # @param create_member_request [CreateMemberRequest] Member details
294
357
  # @param [Hash] opts the optional parameters
295
358
  # @return [Array<(CreateMember200Response, Integer, Hash)>] CreateMember200Response data, response status code and response headers
@@ -482,6 +545,74 @@ module Tremendous
482
545
  return data, status_code, headers
483
546
  end
484
547
 
548
+ # Create public key
549
+ # Creating a public key is the way for your organization to share it with Tremendous. > 🔒 Generating asymmetric keys > > **We recommend using [OpenSSL](https://www.openssl.org/).** > > 1. Generate a private key and a public key in PEM: > `openssl genrsa -out tremendous_key.pem 4096` > > 2. Extract the public key in PEM format: > `openssl rsa -in tremendous_key.pem -outform PEM -pubout -out tremendous_key.pem.pub` > > 3. And, before making your request, encode it as a `base64` string: > `base64 -i tremendous_key.pem.pub` <div class=\"object-schema-request-schema\"> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">public_key</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Base64 encoded (public) PEM file</p> </td></tr> </tbody> </table> </div>
550
+ # @param create_public_key_request [CreatePublicKeyRequest] Public key details
551
+ # @param [Hash] opts the optional parameters
552
+ # @return [CreatePublicKey200Response]
553
+ def create_public_key(create_public_key_request, opts = {})
554
+ data, _status_code, _headers = create_public_key_with_http_info(create_public_key_request, opts)
555
+ data
556
+ end
557
+
558
+ # Create public key
559
+ # Creating a public key is the way for your organization to share it with Tremendous. &gt; 🔒 Generating asymmetric keys &gt; &gt; **We recommend using [OpenSSL](https://www.openssl.org/).** &gt; &gt; 1. Generate a private key and a public key in PEM: &gt; &#x60;openssl genrsa -out tremendous_key.pem 4096&#x60; &gt; &gt; 2. Extract the public key in PEM format: &gt; &#x60;openssl rsa -in tremendous_key.pem -outform PEM -pubout -out tremendous_key.pem.pub&#x60; &gt; &gt; 3. And, before making your request, encode it as a &#x60;base64&#x60; string: &gt; &#x60;base64 -i tremendous_key.pem.pub&#x60; &lt;div class&#x3D;\&quot;object-schema-request-schema\&quot;&gt; &lt;table&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Property&lt;/th&gt; &lt;th&gt;Type&lt;/th&gt; &lt;th&gt;Description&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody class&#x3D;\&quot;object-schema-table-body\&quot;&gt; &lt;tr class&#x3D;\&quot;\&quot;&gt;&lt;td&gt;&lt;div class&#x3D;\&quot;property-name\&quot;&gt; &lt;code class&#x3D;\&quot;property-name\&quot;&gt;public_key&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;\&quot;property-type\&quot;&gt;string&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Base64 encoded (public) PEM file&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/div&gt;
560
+ # @param create_public_key_request [CreatePublicKeyRequest] Public key details
561
+ # @param [Hash] opts the optional parameters
562
+ # @return [Array<(CreatePublicKey200Response, Integer, Hash)>] CreatePublicKey200Response data, response status code and response headers
563
+ def create_public_key_with_http_info(create_public_key_request, opts = {})
564
+ if @api_client.config.debugging
565
+ @api_client.config.logger.debug 'Calling API: TremendousApi.create_public_key ...'
566
+ end
567
+ # verify the required parameter 'create_public_key_request' is set
568
+ if @api_client.config.client_side_validation && create_public_key_request.nil?
569
+ fail ArgumentError, "Missing the required parameter 'create_public_key_request' when calling TremendousApi.create_public_key"
570
+ end
571
+ # resource path
572
+ local_var_path = '/public_keys'
573
+
574
+ # query parameters
575
+ query_params = opts[:query_params] || {}
576
+
577
+ # header parameters
578
+ header_params = opts[:header_params] || {}
579
+ # HTTP header 'Accept' (if needed)
580
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
581
+ # HTTP header 'Content-Type'
582
+ content_type = @api_client.select_header_content_type(['application/json'])
583
+ if !content_type.nil?
584
+ header_params['Content-Type'] = content_type
585
+ end
586
+
587
+ # form parameters
588
+ form_params = opts[:form_params] || {}
589
+
590
+ # http body (model)
591
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_public_key_request)
592
+
593
+ # return_type
594
+ return_type = opts[:debug_return_type] || 'CreatePublicKey200Response'
595
+
596
+ # auth_names
597
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
598
+
599
+ new_options = opts.merge(
600
+ :operation => :"TremendousApi.create_public_key",
601
+ :header_params => header_params,
602
+ :query_params => query_params,
603
+ :form_params => form_params,
604
+ :body => post_body,
605
+ :auth_names => auth_names,
606
+ :return_type => return_type
607
+ )
608
+
609
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
610
+ if @api_client.config.debugging
611
+ @api_client.config.logger.debug "API called: TremendousApi#create_public_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
612
+ end
613
+ return data, status_code, headers
614
+ end
615
+
485
616
  # Create webhook
486
617
  # Tremendous uses webhooks as a notification system for various events that happen in your account. > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > [Read it here](/docs/webhooks-1) Every organization can define a single webhook endpoint where we send requests to, whenever an event happens. This endpoint allows you to setup that endpoint. The URL of the endpoint can be changed by making a request to this endpoint again with the new URL. ## Request body <div class=\"object-schema-request-schema\"> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">url</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">uri</span></td><td><p>URL the webhook will make requests to</p> </td></tr> </tbody> </table> </div>
487
618
  # @param create_webhook_request [CreateWebhookRequest] Webhook details
@@ -550,9 +681,77 @@ module Tremendous
550
681
  return data, status_code, headers
551
682
  end
552
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
+
553
752
  # Delete invoice
554
753
  # Removes an invoice. This has no further consequences but is a rather cosmetic operation.
555
- # @param id [String] ID of the invoice that should be retrieved
754
+ # @param id [String] ID of the invoice that should be removed
556
755
  # @param [Hash] opts the optional parameters
557
756
  # @return [CreateInvoice200Response]
558
757
  def delete_invoices(id, opts = {})
@@ -562,7 +761,7 @@ module Tremendous
562
761
 
563
762
  # Delete invoice
564
763
  # Removes an invoice. This has no further consequences but is a rather cosmetic operation.
565
- # @param id [String] ID of the invoice that should be retrieved
764
+ # @param id [String] ID of the invoice that should be removed
566
765
  # @param [Hash] opts the optional parameters
567
766
  # @return [Array<(CreateInvoice200Response, Integer, Hash)>] CreateInvoice200Response data, response status code and response headers
568
767
  def delete_invoices_with_http_info(id, opts = {})
@@ -613,6 +812,142 @@ module Tremendous
613
812
  return data, status_code, headers
614
813
  end
615
814
 
815
+ # Delete public key
816
+ # Deactivates a public key. Any further attempt to verify a request signature with this key will fail.
817
+ # @param id [String] ID of the public key that should be deactivated
818
+ # @param [Hash] opts the optional parameters
819
+ # @return [nil]
820
+ def delete_public_key(id, opts = {})
821
+ delete_public_key_with_http_info(id, opts)
822
+ nil
823
+ end
824
+
825
+ # Delete public key
826
+ # Deactivates a public key. Any further attempt to verify a request signature with this key will fail.
827
+ # @param id [String] ID of the public key that should be deactivated
828
+ # @param [Hash] opts the optional parameters
829
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
830
+ def delete_public_key_with_http_info(id, opts = {})
831
+ if @api_client.config.debugging
832
+ @api_client.config.logger.debug 'Calling API: TremendousApi.delete_public_key ...'
833
+ end
834
+ # verify the required parameter 'id' is set
835
+ if @api_client.config.client_side_validation && id.nil?
836
+ fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.delete_public_key"
837
+ end
838
+ pattern = Regexp.new(/[A-Z0-9]{4,20}/)
839
+ if @api_client.config.client_side_validation && id !~ pattern
840
+ fail ArgumentError, "invalid value for 'id' when calling TremendousApi.delete_public_key, must conform to the pattern #{pattern}."
841
+ end
842
+
843
+ # resource path
844
+ local_var_path = '/public_keys/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
845
+
846
+ # query parameters
847
+ query_params = opts[:query_params] || {}
848
+
849
+ # header parameters
850
+ header_params = opts[:header_params] || {}
851
+ # HTTP header 'Accept' (if needed)
852
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
853
+
854
+ # form parameters
855
+ form_params = opts[:form_params] || {}
856
+
857
+ # http body (model)
858
+ post_body = opts[:debug_body]
859
+
860
+ # return_type
861
+ return_type = opts[:debug_return_type]
862
+
863
+ # auth_names
864
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
865
+
866
+ new_options = opts.merge(
867
+ :operation => :"TremendousApi.delete_public_key",
868
+ :header_params => header_params,
869
+ :query_params => query_params,
870
+ :form_params => form_params,
871
+ :body => post_body,
872
+ :auth_names => auth_names,
873
+ :return_type => return_type
874
+ )
875
+
876
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
877
+ if @api_client.config.debugging
878
+ @api_client.config.logger.debug "API called: TremendousApi#delete_public_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
879
+ end
880
+ return data, status_code, headers
881
+ end
882
+
883
+ # Delete webhook
884
+ # > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > [Read it here](/docs/webhooks-1)
885
+ # @param id [String] ID of the webhook to delete
886
+ # @param [Hash] opts the optional parameters
887
+ # @return [nil]
888
+ def delete_webhook(id, opts = {})
889
+ delete_webhook_with_http_info(id, opts)
890
+ nil
891
+ end
892
+
893
+ # Delete webhook
894
+ # &gt; 📘 Learn more about Webhooks &gt; &gt; Our guide explains everything you need to know about the Tremendous webhooks: &gt; [Read it here](/docs/webhooks-1)
895
+ # @param id [String] ID of the webhook to delete
896
+ # @param [Hash] opts the optional parameters
897
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
898
+ def delete_webhook_with_http_info(id, opts = {})
899
+ if @api_client.config.debugging
900
+ @api_client.config.logger.debug 'Calling API: TremendousApi.delete_webhook ...'
901
+ end
902
+ # verify the required parameter 'id' is set
903
+ if @api_client.config.client_side_validation && id.nil?
904
+ fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.delete_webhook"
905
+ end
906
+ pattern = Regexp.new(/[A-Z0-9]{4,20}/)
907
+ if @api_client.config.client_side_validation && id !~ pattern
908
+ fail ArgumentError, "invalid value for 'id' when calling TremendousApi.delete_webhook, must conform to the pattern #{pattern}."
909
+ end
910
+
911
+ # resource path
912
+ local_var_path = '/webhooks/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
913
+
914
+ # query parameters
915
+ query_params = opts[:query_params] || {}
916
+
917
+ # header parameters
918
+ header_params = opts[:header_params] || {}
919
+ # HTTP header 'Accept' (if needed)
920
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
921
+
922
+ # form parameters
923
+ form_params = opts[:form_params] || {}
924
+
925
+ # http body (model)
926
+ post_body = opts[:debug_body]
927
+
928
+ # return_type
929
+ return_type = opts[:debug_return_type]
930
+
931
+ # auth_names
932
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
933
+
934
+ new_options = opts.merge(
935
+ :operation => :"TremendousApi.delete_webhook",
936
+ :header_params => header_params,
937
+ :query_params => query_params,
938
+ :form_params => form_params,
939
+ :body => post_body,
940
+ :auth_names => auth_names,
941
+ :return_type => return_type
942
+ )
943
+
944
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
945
+ if @api_client.config.debugging
946
+ @api_client.config.logger.debug "API called: TremendousApi#delete_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
947
+ end
948
+ return data, status_code, headers
949
+ end
950
+
616
951
  # Retrieve invoice as CSV
617
952
  # Generates a CSV version for an invoice listing the associated rewards and orders
618
953
  # @param id [String] ID of the Invoice for that the CSV should be generated
@@ -717,13 +1052,88 @@ module Tremendous
717
1052
  post_body = opts[:debug_body]
718
1053
 
719
1054
  # return_type
720
- return_type = opts[:debug_return_type] || 'File'
1055
+ return_type = opts[:debug_return_type] || 'File'
1056
+
1057
+ # auth_names
1058
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
1059
+
1060
+ new_options = opts.merge(
1061
+ :operation => :"TremendousApi.download_invoice_pdf",
1062
+ :header_params => header_params,
1063
+ :query_params => query_params,
1064
+ :form_params => form_params,
1065
+ :body => post_body,
1066
+ :auth_names => auth_names,
1067
+ :return_type => return_type
1068
+ )
1069
+
1070
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1071
+ if @api_client.config.debugging
1072
+ @api_client.config.logger.debug "API called: TremendousApi#download_invoice_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1073
+ end
1074
+ return data, status_code, headers
1075
+ end
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 &#x60;review_multiple_emails&#x60;, &#x60;review_vpn&#x60;, &#x60;review_tremendous_flaglist&#x60;, and &#x60;review_previously_blocked_recipients&#x60; 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 &#x60;review_multiple_emails&#x60;, &#x60;review_vpn&#x60;, &#x60;review_tremendous_flaglist&#x60;, and &#x60;review_previously_blocked_recipients&#x60; 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'
721
1131
 
722
1132
  # auth_names
723
1133
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']
724
1134
 
725
1135
  new_options = opts.merge(
726
- :operation => :"TremendousApi.download_invoice_pdf",
1136
+ :operation => :"TremendousApi.fraud_rule",
727
1137
  :header_params => header_params,
728
1138
  :query_params => query_params,
729
1139
  :form_params => form_params,
@@ -732,9 +1142,9 @@ module Tremendous
732
1142
  :return_type => return_type
733
1143
  )
734
1144
 
735
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1145
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
736
1146
  if @api_client.config.debugging
737
- @api_client.config.logger.debug "API called: TremendousApi#download_invoice_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1147
+ @api_client.config.logger.debug "API called: TremendousApi#fraud_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
738
1148
  end
739
1149
  return data, status_code, headers
740
1150
  end
@@ -943,6 +1353,69 @@ module Tremendous
943
1353
  return data, status_code, headers
944
1354
  end
945
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 &#x60;id&#x60; in the URL. Returns additional details regarding the fraud review beyond what&#39;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
+
946
1419
  # Retrieve funding source
947
1420
  # Retrieve a funding source, identified by the given `id` in the URL
948
1421
  # @param id [String] ID of the funding source that should be retrieved
@@ -1144,7 +1617,7 @@ module Tremendous
1144
1617
  # Retrieve the order, identified by the given `id` in the URL
1145
1618
  # @param id [String] ID of the order that should be retrieved. In case the order has an &#x60;external_id&#x60; reference supplied by the customer on creation, it&#39;s possible to use it instead.
1146
1619
  # @param [Hash] opts the optional parameters
1147
- # @return [CreateOrder201Response]
1620
+ # @return [CreateOrder200Response]
1148
1621
  def get_order(id, opts = {})
1149
1622
  data, _status_code, _headers = get_order_with_http_info(id, opts)
1150
1623
  data
@@ -1154,7 +1627,7 @@ module Tremendous
1154
1627
  # Retrieve the order, identified by the given &#x60;id&#x60; in the URL
1155
1628
  # @param id [String] ID of the order that should be retrieved. In case the order has an &#x60;external_id&#x60; reference supplied by the customer on creation, it&#39;s possible to use it instead.
1156
1629
  # @param [Hash] opts the optional parameters
1157
- # @return [Array<(CreateOrder201Response, Integer, Hash)>] CreateOrder201Response data, response status code and response headers
1630
+ # @return [Array<(CreateOrder200Response, Integer, Hash)>] CreateOrder200Response data, response status code and response headers
1158
1631
  def get_order_with_http_info(id, opts = {})
1159
1632
  if @api_client.config.debugging
1160
1633
  @api_client.config.logger.debug 'Calling API: TremendousApi.get_order ...'
@@ -1181,7 +1654,7 @@ module Tremendous
1181
1654
  post_body = opts[:debug_body]
1182
1655
 
1183
1656
  # return_type
1184
- return_type = opts[:debug_return_type] || 'CreateOrder201Response'
1657
+ return_type = opts[:debug_return_type] || 'CreateOrder200Response'
1185
1658
 
1186
1659
  # auth_names
1187
1660
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']
@@ -1337,6 +1810,74 @@ module Tremendous
1337
1810
  return data, status_code, headers
1338
1811
  end
1339
1812
 
1813
+ # Retrieve public key
1814
+ # Retrieve an active public key, identified by the given `id` in the URL.
1815
+ # @param id [String] ID of the public key that should be retrieved
1816
+ # @param [Hash] opts the optional parameters
1817
+ # @return [CreatePublicKey200Response]
1818
+ def get_public_key(id, opts = {})
1819
+ data, _status_code, _headers = get_public_key_with_http_info(id, opts)
1820
+ data
1821
+ end
1822
+
1823
+ # Retrieve public key
1824
+ # Retrieve an active public key, identified by the given &#x60;id&#x60; in the URL.
1825
+ # @param id [String] ID of the public key that should be retrieved
1826
+ # @param [Hash] opts the optional parameters
1827
+ # @return [Array<(CreatePublicKey200Response, Integer, Hash)>] CreatePublicKey200Response data, response status code and response headers
1828
+ def get_public_key_with_http_info(id, opts = {})
1829
+ if @api_client.config.debugging
1830
+ @api_client.config.logger.debug 'Calling API: TremendousApi.get_public_key ...'
1831
+ end
1832
+ # verify the required parameter 'id' is set
1833
+ if @api_client.config.client_side_validation && id.nil?
1834
+ fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.get_public_key"
1835
+ end
1836
+ pattern = Regexp.new(/[A-Z0-9]{4,20}/)
1837
+ if @api_client.config.client_side_validation && id !~ pattern
1838
+ fail ArgumentError, "invalid value for 'id' when calling TremendousApi.get_public_key, must conform to the pattern #{pattern}."
1839
+ end
1840
+
1841
+ # resource path
1842
+ local_var_path = '/public_keys/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
1843
+
1844
+ # query parameters
1845
+ query_params = opts[:query_params] || {}
1846
+
1847
+ # header parameters
1848
+ header_params = opts[:header_params] || {}
1849
+ # HTTP header 'Accept' (if needed)
1850
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1851
+
1852
+ # form parameters
1853
+ form_params = opts[:form_params] || {}
1854
+
1855
+ # http body (model)
1856
+ post_body = opts[:debug_body]
1857
+
1858
+ # return_type
1859
+ return_type = opts[:debug_return_type] || 'CreatePublicKey200Response'
1860
+
1861
+ # auth_names
1862
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
1863
+
1864
+ new_options = opts.merge(
1865
+ :operation => :"TremendousApi.get_public_key",
1866
+ :header_params => header_params,
1867
+ :query_params => query_params,
1868
+ :form_params => form_params,
1869
+ :body => post_body,
1870
+ :auth_names => auth_names,
1871
+ :return_type => return_type
1872
+ )
1873
+
1874
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1875
+ if @api_client.config.debugging
1876
+ @api_client.config.logger.debug "API called: TremendousApi#get_public_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1877
+ end
1878
+ return data, status_code, headers
1879
+ end
1880
+
1340
1881
  # Retrieve single reward
1341
1882
  # Retrieve the reward, identified by the given `id` in the URL
1342
1883
  # @param id [String] ID of the reward that should be retrieved
@@ -1602,22 +2143,233 @@ module Tremendous
1602
2143
  # List fields
1603
2144
  # For reporting and analytics purposes, custom fields can be associated with rewards generated through the API. Custom fields must be first added by members of your admin team through the Tremendous Dashboard.
1604
2145
  # @param [Hash] opts the optional parameters
1605
- # @return [ListFields200Response]
1606
- def list_fields(opts = {})
1607
- data, _status_code, _headers = list_fields_with_http_info(opts)
2146
+ # @return [ListFields200Response]
2147
+ def list_fields(opts = {})
2148
+ data, _status_code, _headers = list_fields_with_http_info(opts)
2149
+ data
2150
+ end
2151
+
2152
+ # List fields
2153
+ # For reporting and analytics purposes, custom fields can be associated with rewards generated through the API. Custom fields must be first added by members of your admin team through the Tremendous Dashboard.
2154
+ # @param [Hash] opts the optional parameters
2155
+ # @return [Array<(ListFields200Response, Integer, Hash)>] ListFields200Response data, response status code and response headers
2156
+ def list_fields_with_http_info(opts = {})
2157
+ if @api_client.config.debugging
2158
+ @api_client.config.logger.debug 'Calling API: TremendousApi.list_fields ...'
2159
+ end
2160
+ # resource path
2161
+ local_var_path = '/fields'
2162
+
2163
+ # query parameters
2164
+ query_params = opts[:query_params] || {}
2165
+
2166
+ # header parameters
2167
+ header_params = opts[:header_params] || {}
2168
+ # HTTP header 'Accept' (if needed)
2169
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
2170
+
2171
+ # form parameters
2172
+ form_params = opts[:form_params] || {}
2173
+
2174
+ # http body (model)
2175
+ post_body = opts[:debug_body]
2176
+
2177
+ # return_type
2178
+ return_type = opts[:debug_return_type] || 'ListFields200Response'
2179
+
2180
+ # auth_names
2181
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
2182
+
2183
+ new_options = opts.merge(
2184
+ :operation => :"TremendousApi.list_fields",
2185
+ :header_params => header_params,
2186
+ :query_params => query_params,
2187
+ :form_params => form_params,
2188
+ :body => post_body,
2189
+ :auth_names => auth_names,
2190
+ :return_type => return_type
2191
+ )
2192
+
2193
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2194
+ if @api_client.config.debugging
2195
+ @api_client.config.logger.debug "API called: TremendousApi#list_fields\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2196
+ end
2197
+ return data, status_code, headers
2198
+ end
2199
+
2200
+ # List exchange rates
2201
+ # Retrieve a list of exchange rates
2202
+ # @param [Hash] opts the optional parameters
2203
+ # @option opts [String] :base Base currency code, default is USD.
2204
+ # @return [ListForexResponse]
2205
+ def list_forex(opts = {})
2206
+ data, _status_code, _headers = list_forex_with_http_info(opts)
2207
+ data
2208
+ end
2209
+
2210
+ # List exchange rates
2211
+ # Retrieve a list of exchange rates
2212
+ # @param [Hash] opts the optional parameters
2213
+ # @option opts [String] :base Base currency code, default is USD.
2214
+ # @return [Array<(ListForexResponse, Integer, Hash)>] ListForexResponse data, response status code and response headers
2215
+ def list_forex_with_http_info(opts = {})
2216
+ if @api_client.config.debugging
2217
+ @api_client.config.logger.debug 'Calling API: TremendousApi.list_forex ...'
2218
+ end
2219
+ # resource path
2220
+ local_var_path = '/forex'
2221
+
2222
+ # query parameters
2223
+ query_params = opts[:query_params] || {}
2224
+ query_params[:'base'] = opts[:'base'] if !opts[:'base'].nil?
2225
+
2226
+ # header parameters
2227
+ header_params = opts[:header_params] || {}
2228
+ # HTTP header 'Accept' (if needed)
2229
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
2230
+
2231
+ # form parameters
2232
+ form_params = opts[:form_params] || {}
2233
+
2234
+ # http body (model)
2235
+ post_body = opts[:debug_body]
2236
+
2237
+ # return_type
2238
+ return_type = opts[:debug_return_type] || 'ListForexResponse'
2239
+
2240
+ # auth_names
2241
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
2242
+
2243
+ new_options = opts.merge(
2244
+ :operation => :"TremendousApi.list_forex",
2245
+ :header_params => header_params,
2246
+ :query_params => query_params,
2247
+ :form_params => form_params,
2248
+ :body => post_body,
2249
+ :auth_names => auth_names,
2250
+ :return_type => return_type
2251
+ )
2252
+
2253
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2254
+ if @api_client.config.debugging
2255
+ @api_client.config.logger.debug "API called: TremendousApi#list_forex\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2256
+ end
2257
+ return data, status_code, headers
2258
+ end
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 &#x60;flagged&#x60;, &#x60;blocked&#x60; or &#x60;released&#x60;.
2266
+ # @option opts [String] :created_at_gte Return results where the created_at field is &gt;&#x3D; to the supplied value. Expects an ISO 8601 datetime.
2267
+ # @option opts [String] :created_at_lte Return results where the created_at field is &lt;&#x3D; to the supplied value. Expects an ISO 8601 datetime.
2268
+ # @option opts [String] :redeemed_at_gte Return results where the redeemed_at field is &gt;&#x3D; the supplied value. Expects an ISO 8601 datetime.
2269
+ # @option opts [String] :redeemed_at_lte Return results where the redeemed_at field is &lt;&#x3D; 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 &#x60;flagged&#x60;, &#x60;blocked&#x60; or &#x60;released&#x60;.
2282
+ # @option opts [String] :created_at_gte Return results where the created_at field is &gt;&#x3D; to the supplied value. Expects an ISO 8601 datetime.
2283
+ # @option opts [String] :created_at_lte Return results where the created_at field is &lt;&#x3D; to the supplied value. Expects an ISO 8601 datetime.
2284
+ # @option opts [String] :redeemed_at_gte Return results where the redeemed_at field is &gt;&#x3D; the supplied value. Expects an ISO 8601 datetime.
2285
+ # @option opts [String] :redeemed_at_lte Return results where the redeemed_at field is &lt;&#x3D; 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)
1608
2360
  data
1609
2361
  end
1610
2362
 
1611
- # List fields
1612
- # For reporting and analytics purposes, custom fields can be associated with rewards generated through the API. Custom fields must be first added by members of your admin team through the Tremendous Dashboard.
2363
+ # List fraud rules
2364
+ # List active fraud rules associated with the organization tied to your API key.
1613
2365
  # @param [Hash] opts the optional parameters
1614
- # @return [Array<(ListFields200Response, Integer, Hash)>] ListFields200Response data, response status code and response headers
1615
- def list_fields_with_http_info(opts = {})
2366
+ # @return [Array<(ListFraudRules200Response, Integer, Hash)>] ListFraudRules200Response data, response status code and response headers
2367
+ def list_fraud_rules_with_http_info(opts = {})
1616
2368
  if @api_client.config.debugging
1617
- @api_client.config.logger.debug 'Calling API: TremendousApi.list_fields ...'
2369
+ @api_client.config.logger.debug 'Calling API: TremendousApi.list_fraud_rules ...'
1618
2370
  end
1619
2371
  # resource path
1620
- local_var_path = '/fields'
2372
+ local_var_path = '/fraud_rules'
1621
2373
 
1622
2374
  # query parameters
1623
2375
  query_params = opts[:query_params] || {}
@@ -1634,13 +2386,13 @@ module Tremendous
1634
2386
  post_body = opts[:debug_body]
1635
2387
 
1636
2388
  # return_type
1637
- return_type = opts[:debug_return_type] || 'ListFields200Response'
2389
+ return_type = opts[:debug_return_type] || 'ListFraudRules200Response'
1638
2390
 
1639
2391
  # auth_names
1640
2392
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']
1641
2393
 
1642
2394
  new_options = opts.merge(
1643
- :operation => :"TremendousApi.list_fields",
2395
+ :operation => :"TremendousApi.list_fraud_rules",
1644
2396
  :header_params => header_params,
1645
2397
  :query_params => query_params,
1646
2398
  :form_params => form_params,
@@ -1651,7 +2403,7 @@ module Tremendous
1651
2403
 
1652
2404
  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1653
2405
  if @api_client.config.debugging
1654
- @api_client.config.logger.debug "API called: TremendousApi#list_fields\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2406
+ @api_client.config.logger.debug "API called: TremendousApi#list_fraud_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1655
2407
  end
1656
2408
  return data, status_code, headers
1657
2409
  end
@@ -2028,6 +2780,63 @@ module Tremendous
2028
2780
  return data, status_code, headers
2029
2781
  end
2030
2782
 
2783
+ # List public keys
2784
+ # Fetch a list of active public keys on your account. > 🚧 Inactive public keys are omitted > > The response does not include inactive public keys.
2785
+ # @param [Hash] opts the optional parameters
2786
+ # @return [PublicKeysResponse]
2787
+ def list_public_keys(opts = {})
2788
+ data, _status_code, _headers = list_public_keys_with_http_info(opts)
2789
+ data
2790
+ end
2791
+
2792
+ # List public keys
2793
+ # Fetch a list of active public keys on your account. &gt; 🚧 Inactive public keys are omitted &gt; &gt; The response does not include inactive public keys.
2794
+ # @param [Hash] opts the optional parameters
2795
+ # @return [Array<(PublicKeysResponse, Integer, Hash)>] PublicKeysResponse data, response status code and response headers
2796
+ def list_public_keys_with_http_info(opts = {})
2797
+ if @api_client.config.debugging
2798
+ @api_client.config.logger.debug 'Calling API: TremendousApi.list_public_keys ...'
2799
+ end
2800
+ # resource path
2801
+ local_var_path = '/public_keys'
2802
+
2803
+ # query parameters
2804
+ query_params = opts[:query_params] || {}
2805
+
2806
+ # header parameters
2807
+ header_params = opts[:header_params] || {}
2808
+ # HTTP header 'Accept' (if needed)
2809
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
2810
+
2811
+ # form parameters
2812
+ form_params = opts[:form_params] || {}
2813
+
2814
+ # http body (model)
2815
+ post_body = opts[:debug_body]
2816
+
2817
+ # return_type
2818
+ return_type = opts[:debug_return_type] || 'PublicKeysResponse'
2819
+
2820
+ # auth_names
2821
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
2822
+
2823
+ new_options = opts.merge(
2824
+ :operation => :"TremendousApi.list_public_keys",
2825
+ :header_params => header_params,
2826
+ :query_params => query_params,
2827
+ :form_params => form_params,
2828
+ :body => post_body,
2829
+ :auth_names => auth_names,
2830
+ :return_type => return_type
2831
+ )
2832
+
2833
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2834
+ if @api_client.config.debugging
2835
+ @api_client.config.logger.debug "API called: TremendousApi#list_public_keys\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2836
+ end
2837
+ return data, status_code, headers
2838
+ end
2839
+
2031
2840
  # List rewards
2032
2841
  # Retrieve a list of all created rewards
2033
2842
  # @param [Hash] opts the optional parameters
@@ -2088,6 +2897,63 @@ module Tremendous
2088
2897
  return data, status_code, headers
2089
2898
  end
2090
2899
 
2900
+ # List roles
2901
+ # List all available roles in the organization.
2902
+ # @param [Hash] opts the optional parameters
2903
+ # @return [ListRoles200Response]
2904
+ def list_roles(opts = {})
2905
+ data, _status_code, _headers = list_roles_with_http_info(opts)
2906
+ data
2907
+ end
2908
+
2909
+ # List roles
2910
+ # List all available roles in the organization.
2911
+ # @param [Hash] opts the optional parameters
2912
+ # @return [Array<(ListRoles200Response, Integer, Hash)>] ListRoles200Response data, response status code and response headers
2913
+ def list_roles_with_http_info(opts = {})
2914
+ if @api_client.config.debugging
2915
+ @api_client.config.logger.debug 'Calling API: TremendousApi.list_roles ...'
2916
+ end
2917
+ # resource path
2918
+ local_var_path = '/roles'
2919
+
2920
+ # query parameters
2921
+ query_params = opts[:query_params] || {}
2922
+
2923
+ # header parameters
2924
+ header_params = opts[:header_params] || {}
2925
+ # HTTP header 'Accept' (if needed)
2926
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
2927
+
2928
+ # form parameters
2929
+ form_params = opts[:form_params] || {}
2930
+
2931
+ # http body (model)
2932
+ post_body = opts[:debug_body]
2933
+
2934
+ # return_type
2935
+ return_type = opts[:debug_return_type] || 'ListRoles200Response'
2936
+
2937
+ # auth_names
2938
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
2939
+
2940
+ new_options = opts.merge(
2941
+ :operation => :"TremendousApi.list_roles",
2942
+ :header_params => header_params,
2943
+ :query_params => query_params,
2944
+ :form_params => form_params,
2945
+ :body => post_body,
2946
+ :auth_names => auth_names,
2947
+ :return_type => return_type
2948
+ )
2949
+
2950
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2951
+ if @api_client.config.debugging
2952
+ @api_client.config.logger.debug "API called: TremendousApi#list_roles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2953
+ end
2954
+ return data, status_code, headers
2955
+ end
2956
+
2091
2957
  # List events
2092
2958
  # Lists all event types that can be sent to the configured webhook endpoint. > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > [Read it here](/docs/webhooks-1)
2093
2959
  # @param id [String] ID of the webhook to list the events for
@@ -2217,7 +3083,7 @@ module Tremendous
2217
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.
2218
3084
  # @param id [String] ID of the order that should be rejected. In case the order has an &#x60;external_id&#x60; reference supplied by the customer on creation, it&#39;s possible to use it instead.
2219
3085
  # @param [Hash] opts the optional parameters
2220
- # @return [CreateOrder201Response]
3086
+ # @return [CreateOrder200Response]
2221
3087
  def reject_order(id, opts = {})
2222
3088
  data, _status_code, _headers = reject_order_with_http_info(id, opts)
2223
3089
  data
@@ -2227,7 +3093,7 @@ module Tremendous
2227
3093
  # Rejects an order that is pending review, identified by the given &#x60;id&#x60; 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 &#39;Allow approvals via API&#39; via the organization&#39;&#39;s &#39;Order Approvals&#39; settings from the Tremendous dashboard.
2228
3094
  # @param id [String] ID of the order that should be rejected. In case the order has an &#x60;external_id&#x60; reference supplied by the customer on creation, it&#39;s possible to use it instead.
2229
3095
  # @param [Hash] opts the optional parameters
2230
- # @return [Array<(CreateOrder201Response, Integer, Hash)>] CreateOrder201Response data, response status code and response headers
3096
+ # @return [Array<(CreateOrder200Response, Integer, Hash)>] CreateOrder200Response data, response status code and response headers
2231
3097
  def reject_order_with_http_info(id, opts = {})
2232
3098
  if @api_client.config.debugging
2233
3099
  @api_client.config.logger.debug 'Calling API: TremendousApi.reject_order ...'
@@ -2259,7 +3125,7 @@ module Tremendous
2259
3125
  post_body = opts[:debug_body]
2260
3126
 
2261
3127
  # return_type
2262
- return_type = opts[:debug_return_type] || 'CreateOrder201Response'
3128
+ return_type = opts[:debug_return_type] || 'CreateOrder200Response'
2263
3129
 
2264
3130
  # auth_names
2265
3131
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']
@@ -2281,6 +3147,69 @@ module Tremendous
2281
3147
  return data, status_code, headers
2282
3148
  end
2283
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 &#x60;id&#x60; 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
+
2284
3213
  # Resend reward
2285
3214
  # Resends a reward, identified by the given `id` in the URL, to its recipient.
2286
3215
  # @param id [String] ID of the reward that should be resent
@@ -2428,22 +3357,101 @@ module Tremendous
2428
3357
  return data, status_code, headers
2429
3358
  end
2430
3359
 
3360
+ # Test public key
3361
+ # Making a request to this endpoint with a JWT signed with your private key will return a 200 response if the public key is active and the signature is valid. > 💡 Testing your integration > > **You can use [JWT.io](https://jwt.io/) to generate a signed token:** > > > 1. Select “RS256” in their algorithm dropdown; > 3. Define a JSON payload such as `{ \"foo\": \"bar\" }`; > 4. Fill the “Verify signature” fields with your public and private keys and copy the “Encoded” token.
3362
+ # @param id [String] ID of the public key to test
3363
+ # @param test_public_key_request [TestPublicKeyRequest]
3364
+ # @param [Hash] opts the optional parameters
3365
+ # @return [nil]
3366
+ def test_public_key(id, test_public_key_request, opts = {})
3367
+ test_public_key_with_http_info(id, test_public_key_request, opts)
3368
+ nil
3369
+ end
3370
+
3371
+ # Test public key
3372
+ # Making a request to this endpoint with a JWT signed with your private key will return a 200 response if the public key is active and the signature is valid. &gt; 💡 Testing your integration &gt; &gt; **You can use [JWT.io](https://jwt.io/) to generate a signed token:** &gt; &gt; &gt; 1. Select “RS256” in their algorithm dropdown; &gt; 3. Define a JSON payload such as &#x60;{ \&quot;foo\&quot;: \&quot;bar\&quot; }&#x60;; &gt; 4. Fill the “Verify signature” fields with your public and private keys and copy the “Encoded” token.
3373
+ # @param id [String] ID of the public key to test
3374
+ # @param test_public_key_request [TestPublicKeyRequest]
3375
+ # @param [Hash] opts the optional parameters
3376
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
3377
+ def test_public_key_with_http_info(id, test_public_key_request, opts = {})
3378
+ if @api_client.config.debugging
3379
+ @api_client.config.logger.debug 'Calling API: TremendousApi.test_public_key ...'
3380
+ end
3381
+ # verify the required parameter 'id' is set
3382
+ if @api_client.config.client_side_validation && id.nil?
3383
+ fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.test_public_key"
3384
+ end
3385
+ pattern = Regexp.new(/[A-Z0-9]{4,20}/)
3386
+ if @api_client.config.client_side_validation && id !~ pattern
3387
+ fail ArgumentError, "invalid value for 'id' when calling TremendousApi.test_public_key, must conform to the pattern #{pattern}."
3388
+ end
3389
+
3390
+ # verify the required parameter 'test_public_key_request' is set
3391
+ if @api_client.config.client_side_validation && test_public_key_request.nil?
3392
+ fail ArgumentError, "Missing the required parameter 'test_public_key_request' when calling TremendousApi.test_public_key"
3393
+ end
3394
+ # resource path
3395
+ local_var_path = '/public_keys/{id}/decode_jwt'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
3396
+
3397
+ # query parameters
3398
+ query_params = opts[:query_params] || {}
3399
+
3400
+ # header parameters
3401
+ header_params = opts[:header_params] || {}
3402
+ # HTTP header 'Accept' (if needed)
3403
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
3404
+ # HTTP header 'Content-Type'
3405
+ content_type = @api_client.select_header_content_type(['application/json'])
3406
+ if !content_type.nil?
3407
+ header_params['Content-Type'] = content_type
3408
+ end
3409
+
3410
+ # form parameters
3411
+ form_params = opts[:form_params] || {}
3412
+
3413
+ # http body (model)
3414
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(test_public_key_request)
3415
+
3416
+ # return_type
3417
+ return_type = opts[:debug_return_type]
3418
+
3419
+ # auth_names
3420
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
3421
+
3422
+ new_options = opts.merge(
3423
+ :operation => :"TremendousApi.test_public_key",
3424
+ :header_params => header_params,
3425
+ :query_params => query_params,
3426
+ :form_params => form_params,
3427
+ :body => post_body,
3428
+ :auth_names => auth_names,
3429
+ :return_type => return_type
3430
+ )
3431
+
3432
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
3433
+ if @api_client.config.debugging
3434
+ @api_client.config.logger.debug "API called: TremendousApi#test_public_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
3435
+ end
3436
+ return data, status_code, headers
3437
+ end
3438
+
2431
3439
  # Update campaign
2432
3440
  # @param id [String] ID of the campaign that should be updated
2433
- # @param create_campaign_request [CreateCampaignRequest] Campaign details
3441
+ # @param update_campaign_request [UpdateCampaignRequest] Campaign details
2434
3442
  # @param [Hash] opts the optional parameters
2435
3443
  # @return [CreateCampaign201Response]
2436
- def update_campaign(id, create_campaign_request, opts = {})
2437
- data, _status_code, _headers = update_campaign_with_http_info(id, create_campaign_request, opts)
3444
+ def update_campaign(id, update_campaign_request, opts = {})
3445
+ data, _status_code, _headers = update_campaign_with_http_info(id, update_campaign_request, opts)
2438
3446
  data
2439
3447
  end
2440
3448
 
2441
3449
  # Update campaign
2442
3450
  # @param id [String] ID of the campaign that should be updated
2443
- # @param create_campaign_request [CreateCampaignRequest] Campaign details
3451
+ # @param update_campaign_request [UpdateCampaignRequest] Campaign details
2444
3452
  # @param [Hash] opts the optional parameters
2445
3453
  # @return [Array<(CreateCampaign201Response, Integer, Hash)>] CreateCampaign201Response data, response status code and response headers
2446
- def update_campaign_with_http_info(id, create_campaign_request, opts = {})
3454
+ def update_campaign_with_http_info(id, update_campaign_request, opts = {})
2447
3455
  if @api_client.config.debugging
2448
3456
  @api_client.config.logger.debug 'Calling API: TremendousApi.update_campaign ...'
2449
3457
  end
@@ -2456,9 +3464,9 @@ module Tremendous
2456
3464
  fail ArgumentError, "invalid value for 'id' when calling TremendousApi.update_campaign, must conform to the pattern #{pattern}."
2457
3465
  end
2458
3466
 
2459
- # verify the required parameter 'create_campaign_request' is set
2460
- if @api_client.config.client_side_validation && create_campaign_request.nil?
2461
- fail ArgumentError, "Missing the required parameter 'create_campaign_request' when calling TremendousApi.update_campaign"
3467
+ # verify the required parameter 'update_campaign_request' is set
3468
+ if @api_client.config.client_side_validation && update_campaign_request.nil?
3469
+ fail ArgumentError, "Missing the required parameter 'update_campaign_request' when calling TremendousApi.update_campaign"
2462
3470
  end
2463
3471
  # resource path
2464
3472
  local_var_path = '/campaigns/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
@@ -2480,7 +3488,7 @@ module Tremendous
2480
3488
  form_params = opts[:form_params] || {}
2481
3489
 
2482
3490
  # http body (model)
2483
- post_body = opts[:debug_body] || @api_client.object_to_http_body(create_campaign_request)
3491
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(update_campaign_request)
2484
3492
 
2485
3493
  # return_type
2486
3494
  return_type = opts[:debug_return_type] || 'CreateCampaign201Response'
@@ -2504,5 +3512,84 @@ module Tremendous
2504
3512
  end
2505
3513
  return data, status_code, headers
2506
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 &#x60;review_ip&#x60; rule, a valid JSON body would be: &#x60;&#x60;&#x60;json { \&quot;operation\&quot;: \&quot;add\&quot;, \&quot;config\&quot;: { \&quot;ips\&quot;: [\&quot;123.123.123.123\&quot;] } } &#x60;&#x60;&#x60;
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
2507
3594
  end
2508
3595
  end