tremendous_ruby 5.0.0 → 5.1.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 (139) hide show
  1. checksums.yaml +4 -4
  2. data/lib/tremendous/api/tremendous_api.rb +2508 -0
  3. data/lib/tremendous/api_client.rb +431 -0
  4. data/lib/tremendous/api_error.rb +58 -0
  5. data/lib/tremendous/configuration.rb +389 -0
  6. data/lib/tremendous/models/balance_transaction.rb +256 -0
  7. data/lib/tremendous/models/campaign.rb +303 -0
  8. data/lib/tremendous/models/create_api_key200_response.rb +215 -0
  9. data/lib/tremendous/models/create_campaign201_response.rb +221 -0
  10. data/lib/tremendous/models/create_campaign_request.rb +273 -0
  11. data/lib/tremendous/models/create_invoice.rb +244 -0
  12. data/lib/tremendous/models/create_invoice200_response.rb +221 -0
  13. data/lib/tremendous/models/create_invoice_request.rb +244 -0
  14. data/lib/tremendous/models/create_member.rb +273 -0
  15. data/lib/tremendous/models/create_member200_response.rb +221 -0
  16. data/lib/tremendous/models/create_member_request.rb +273 -0
  17. data/lib/tremendous/models/create_order200_response.rb +221 -0
  18. data/lib/tremendous/models/create_order200_response_order.rb +400 -0
  19. data/lib/tremendous/models/create_order200_response_order_rewards_inner.rb +347 -0
  20. data/lib/tremendous/models/create_order200_response_order_rewards_inner_delivery.rb +296 -0
  21. data/lib/tremendous/models/create_order201_response.rb +221 -0
  22. data/lib/tremendous/models/create_order_request.rb +248 -0
  23. data/lib/tremendous/models/create_order_request_payment.rb +222 -0
  24. data/lib/tremendous/models/create_order_request_reward.rb +344 -0
  25. data/lib/tremendous/models/create_order_request_reward_custom_fields_inner.rb +248 -0
  26. data/lib/tremendous/models/create_order_request_reward_delivery.rb +250 -0
  27. data/lib/tremendous/models/create_organization.rb +268 -0
  28. data/lib/tremendous/models/create_organization200_response.rb +214 -0
  29. data/lib/tremendous/models/create_organization200_response_organization.rb +334 -0
  30. data/lib/tremendous/models/create_organization_request.rb +268 -0
  31. data/lib/tremendous/models/create_organization_request_copy_settings.rb +290 -0
  32. data/lib/tremendous/models/create_webhook200_response.rb +214 -0
  33. data/lib/tremendous/models/create_webhook_request.rb +222 -0
  34. data/lib/tremendous/models/currency_codes.rb +154 -0
  35. data/lib/tremendous/models/custom_field.rb +258 -0
  36. data/lib/tremendous/models/delivery_details.rb +286 -0
  37. data/lib/tremendous/models/delivery_details_with_link.rb +296 -0
  38. data/lib/tremendous/models/delivery_method.rb +41 -0
  39. data/lib/tremendous/models/delivery_status.rb +42 -0
  40. data/lib/tremendous/models/error_model.rb +221 -0
  41. data/lib/tremendous/models/field.rb +286 -0
  42. data/lib/tremendous/models/funding_source.rb +332 -0
  43. data/lib/tremendous/models/generate_reward_link200_response.rb +221 -0
  44. data/lib/tremendous/models/generate_reward_link200_response_reward.rb +247 -0
  45. data/lib/tremendous/models/generate_reward_link403_response.rb +221 -0
  46. data/lib/tremendous/models/generate_reward_token200_response.rb +221 -0
  47. data/lib/tremendous/models/generate_reward_token200_response_reward.rb +257 -0
  48. data/lib/tremendous/models/get_funding_source200_response.rb +221 -0
  49. data/lib/tremendous/models/get_member200_response.rb +221 -0
  50. data/lib/tremendous/models/get_member200_response_member.rb +375 -0
  51. data/lib/tremendous/models/get_member200_response_member_events_inner.rb +260 -0
  52. data/lib/tremendous/models/get_organization200_response.rb +214 -0
  53. data/lib/tremendous/models/get_product_response.rb +221 -0
  54. data/lib/tremendous/models/get_reward200_response.rb +221 -0
  55. data/lib/tremendous/models/invoice.rb +356 -0
  56. data/lib/tremendous/models/list_balance_transactions200_response.rb +216 -0
  57. data/lib/tremendous/models/list_balance_transactions200_response_invoices_inner.rb +256 -0
  58. data/lib/tremendous/models/list_campaigns200_response.rb +223 -0
  59. data/lib/tremendous/models/list_campaigns200_response_campaigns_inner.rb +303 -0
  60. data/lib/tremendous/models/list_campaigns200_response_campaigns_inner_email_style.rb +270 -0
  61. data/lib/tremendous/models/list_campaigns200_response_campaigns_inner_webpage_style.rb +270 -0
  62. data/lib/tremendous/models/list_fields200_response.rb +216 -0
  63. data/lib/tremendous/models/list_fields200_response_fields_inner.rb +286 -0
  64. data/lib/tremendous/models/list_funding_sources200_response.rb +223 -0
  65. data/lib/tremendous/models/list_funding_sources200_response_funding_sources_inner.rb +332 -0
  66. data/lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb +436 -0
  67. data/lib/tremendous/models/list_invoices200_response.rb +240 -0
  68. data/lib/tremendous/models/list_invoices200_response_invoices_inner.rb +356 -0
  69. data/lib/tremendous/models/list_members200_response.rb +223 -0
  70. data/lib/tremendous/models/list_members200_response_members_inner.rb +384 -0
  71. data/lib/tremendous/models/list_orders200_response.rb +240 -0
  72. data/lib/tremendous/models/list_orders200_response_orders_inner.rb +379 -0
  73. data/lib/tremendous/models/list_orders200_response_orders_inner_payment.rb +346 -0
  74. data/lib/tremendous/models/list_orders200_response_orders_inner_payment_refund.rb +242 -0
  75. data/lib/tremendous/models/list_organizations200_response.rb +216 -0
  76. data/lib/tremendous/models/list_organizations200_response_organizations_inner.rb +324 -0
  77. data/lib/tremendous/models/list_products_response.rb +223 -0
  78. data/lib/tremendous/models/list_products_response_products_inner.rb +457 -0
  79. data/lib/tremendous/models/list_products_response_products_inner_countries_inner.rb +222 -0
  80. data/lib/tremendous/models/list_products_response_products_inner_images_inner.rb +273 -0
  81. data/lib/tremendous/models/list_products_response_products_inner_skus_inner.rb +277 -0
  82. data/lib/tremendous/models/list_rewards200_response.rb +226 -0
  83. data/lib/tremendous/models/list_rewards200_response_rewards_inner.rb +347 -0
  84. data/lib/tremendous/models/list_rewards200_response_rewards_inner_custom_fields_inner.rb +258 -0
  85. data/lib/tremendous/models/list_rewards200_response_rewards_inner_delivery.rb +286 -0
  86. data/lib/tremendous/models/list_rewards200_response_rewards_inner_recipient.rb +236 -0
  87. data/lib/tremendous/models/list_rewards200_response_rewards_inner_value.rb +273 -0
  88. data/lib/tremendous/models/list_rewards401_response.rb +221 -0
  89. data/lib/tremendous/models/list_rewards401_response_errors.rb +225 -0
  90. data/lib/tremendous/models/list_rewards429_response.rb +221 -0
  91. data/lib/tremendous/models/list_webhook_events200_response.rb +216 -0
  92. data/lib/tremendous/models/list_webhooks200_response.rb +216 -0
  93. data/lib/tremendous/models/list_webhooks200_response_webhooks_inner.rb +258 -0
  94. data/lib/tremendous/models/member.rb +384 -0
  95. data/lib/tremendous/models/member_base.rb +363 -0
  96. data/lib/tremendous/models/member_with_events.rb +375 -0
  97. data/lib/tremendous/models/member_without_events.rb +384 -0
  98. data/lib/tremendous/models/order.rb +379 -0
  99. data/lib/tremendous/models/order_base.rb +370 -0
  100. data/lib/tremendous/models/order_base_payment.rb +346 -0
  101. data/lib/tremendous/models/order_for_create.rb +248 -0
  102. data/lib/tremendous/models/order_for_create_reward.rb +416 -0
  103. data/lib/tremendous/models/order_status.rb +44 -0
  104. data/lib/tremendous/models/order_with_link.rb +400 -0
  105. data/lib/tremendous/models/order_with_link_rewards_inner.rb +406 -0
  106. data/lib/tremendous/models/order_without_link.rb +379 -0
  107. data/lib/tremendous/models/order_without_link_reward.rb +406 -0
  108. data/lib/tremendous/models/organization.rb +324 -0
  109. data/lib/tremendous/models/payment_details.rb +345 -0
  110. data/lib/tremendous/models/payment_details_refund.rb +242 -0
  111. data/lib/tremendous/models/product.rb +457 -0
  112. data/lib/tremendous/models/recipient.rb +236 -0
  113. data/lib/tremendous/models/refund_details.rb +241 -0
  114. data/lib/tremendous/models/resend_reward422_response.rb +221 -0
  115. data/lib/tremendous/models/reward.rb +406 -0
  116. data/lib/tremendous/models/reward_base.rb +397 -0
  117. data/lib/tremendous/models/reward_base_custom_fields_inner.rb +258 -0
  118. data/lib/tremendous/models/reward_for_order_create.rb +416 -0
  119. data/lib/tremendous/models/reward_link.rb +247 -0
  120. data/lib/tremendous/models/reward_token.rb +257 -0
  121. data/lib/tremendous/models/reward_value.rb +273 -0
  122. data/lib/tremendous/models/reward_with_link.rb +406 -0
  123. data/lib/tremendous/models/reward_with_link_delivery.rb +296 -0
  124. data/lib/tremendous/models/reward_without_link.rb +406 -0
  125. data/lib/tremendous/models/reward_without_link_delivery.rb +286 -0
  126. data/lib/tremendous/models/simulate_webhook_request.rb +222 -0
  127. data/lib/tremendous/models/webhook.rb +258 -0
  128. data/lib/tremendous/models/webhook_post.rb +222 -0
  129. data/lib/tremendous/version.rb +3 -0
  130. data/lib/tremendous.rb +163 -0
  131. metadata +132 -11
  132. data/spec/integration/campaigns_spec.rb +0 -27
  133. data/spec/integration/funding_sources_spec.rb +0 -18
  134. data/spec/integration/invoices_spec.rb +0 -19
  135. data/spec/integration/members_spec.rb +0 -19
  136. data/spec/integration/orders_spec.rb +0 -53
  137. data/spec/integration/products_spec.rb +0 -26
  138. data/spec/spec_helper.rb +0 -111
  139. data/spec/support/setup.rb +0 -10
@@ -0,0 +1,2508 @@
1
+ =begin
2
+ #API Endpoints
3
+
4
+ #Deliver monetary rewards and incentives to employees, customers, survey participants, and more through the Tremendous API. For organizational tasks, like managing your organization and it's members within Tremendous, please see the Tremendous Organizational API.
5
+
6
+ The version of the OpenAPI document: 2
7
+ Contact: developers@tremendous.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 7.3.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module Tremendous
16
+ class TremendousApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Approve order
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
+ # @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
+ # @param [Hash] opts the optional parameters
26
+ # @return [CreateOrder201Response]
27
+ def approve_order(id, opts = {})
28
+ data, _status_code, _headers = approve_order_with_http_info(id, opts)
29
+ data
30
+ end
31
+
32
+ # Approve order
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
+ # @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
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(CreateOrder201Response, Integer, Hash)>] CreateOrder201Response data, response status code and response headers
37
+ def approve_order_with_http_info(id, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: TremendousApi.approve_order ...'
40
+ end
41
+ # verify the required parameter 'id' is set
42
+ if @api_client.config.client_side_validation && id.nil?
43
+ fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.approve_order"
44
+ end
45
+ pattern = Regexp.new(/[A-Z0-9]{4,20}/)
46
+ if @api_client.config.client_side_validation && id !~ pattern
47
+ fail ArgumentError, "invalid value for 'id' when calling TremendousApi.approve_order, must conform to the pattern #{pattern}."
48
+ end
49
+
50
+ # resource path
51
+ local_var_path = '/order_approvals/{id}/approve'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
52
+
53
+ # query parameters
54
+ query_params = opts[:query_params] || {}
55
+
56
+ # header parameters
57
+ header_params = opts[:header_params] || {}
58
+ # HTTP header 'Accept' (if needed)
59
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
60
+
61
+ # form parameters
62
+ form_params = opts[:form_params] || {}
63
+
64
+ # http body (model)
65
+ post_body = opts[:debug_body]
66
+
67
+ # return_type
68
+ return_type = opts[:debug_return_type] || 'CreateOrder201Response'
69
+
70
+ # auth_names
71
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
72
+
73
+ new_options = opts.merge(
74
+ :operation => :"TremendousApi.approve_order",
75
+ :header_params => header_params,
76
+ :query_params => query_params,
77
+ :form_params => form_params,
78
+ :body => post_body,
79
+ :auth_names => auth_names,
80
+ :return_type => return_type
81
+ )
82
+
83
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
84
+ if @api_client.config.debugging
85
+ @api_client.config.logger.debug "API called: TremendousApi#approve_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
86
+ end
87
+ return data, status_code, headers
88
+ end
89
+
90
+ # Create API key
91
+ # 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
+ # @param [Hash] opts the optional parameters
93
+ # @return [CreateApiKey200Response]
94
+ def create_api_key(opts = {})
95
+ data, _status_code, _headers = create_api_key_with_http_info(opts)
96
+ data
97
+ end
98
+
99
+ # Create API key
100
+ # 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.**
101
+ # @param [Hash] opts the optional parameters
102
+ # @return [Array<(CreateApiKey200Response, Integer, Hash)>] CreateApiKey200Response data, response status code and response headers
103
+ def create_api_key_with_http_info(opts = {})
104
+ if @api_client.config.debugging
105
+ @api_client.config.logger.debug 'Calling API: TremendousApi.create_api_key ...'
106
+ end
107
+ # resource path
108
+ local_var_path = '/organizations/create_api_key'
109
+
110
+ # query parameters
111
+ query_params = opts[:query_params] || {}
112
+
113
+ # header parameters
114
+ header_params = opts[:header_params] || {}
115
+ # HTTP header 'Accept' (if needed)
116
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
117
+
118
+ # form parameters
119
+ form_params = opts[:form_params] || {}
120
+
121
+ # http body (model)
122
+ post_body = opts[:debug_body]
123
+
124
+ # return_type
125
+ return_type = opts[:debug_return_type] || 'CreateApiKey200Response'
126
+
127
+ # auth_names
128
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
129
+
130
+ new_options = opts.merge(
131
+ :operation => :"TremendousApi.create_api_key",
132
+ :header_params => header_params,
133
+ :query_params => query_params,
134
+ :form_params => form_params,
135
+ :body => post_body,
136
+ :auth_names => auth_names,
137
+ :return_type => return_type
138
+ )
139
+
140
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
141
+ if @api_client.config.debugging
142
+ @api_client.config.logger.debug "API called: TremendousApi#create_api_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
143
+ end
144
+ return data, status_code, headers
145
+ end
146
+
147
+ # Create campaign
148
+ # @param create_campaign_request [CreateCampaignRequest] Campaign details
149
+ # @param [Hash] opts the optional parameters
150
+ # @return [CreateCampaign201Response]
151
+ def create_campaign(create_campaign_request, opts = {})
152
+ data, _status_code, _headers = create_campaign_with_http_info(create_campaign_request, opts)
153
+ data
154
+ end
155
+
156
+ # Create campaign
157
+ # @param create_campaign_request [CreateCampaignRequest] Campaign details
158
+ # @param [Hash] opts the optional parameters
159
+ # @return [Array<(CreateCampaign201Response, Integer, Hash)>] CreateCampaign201Response data, response status code and response headers
160
+ def create_campaign_with_http_info(create_campaign_request, opts = {})
161
+ if @api_client.config.debugging
162
+ @api_client.config.logger.debug 'Calling API: TremendousApi.create_campaign ...'
163
+ end
164
+ # verify the required parameter 'create_campaign_request' is set
165
+ if @api_client.config.client_side_validation && create_campaign_request.nil?
166
+ fail ArgumentError, "Missing the required parameter 'create_campaign_request' when calling TremendousApi.create_campaign"
167
+ end
168
+ # resource path
169
+ local_var_path = '/campaigns'
170
+
171
+ # query parameters
172
+ query_params = opts[:query_params] || {}
173
+
174
+ # header parameters
175
+ header_params = opts[:header_params] || {}
176
+ # HTTP header 'Accept' (if needed)
177
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
178
+ # HTTP header 'Content-Type'
179
+ content_type = @api_client.select_header_content_type(['application/json'])
180
+ if !content_type.nil?
181
+ header_params['Content-Type'] = content_type
182
+ end
183
+
184
+ # form parameters
185
+ form_params = opts[:form_params] || {}
186
+
187
+ # http body (model)
188
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_campaign_request)
189
+
190
+ # return_type
191
+ return_type = opts[:debug_return_type] || 'CreateCampaign201Response'
192
+
193
+ # auth_names
194
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
195
+
196
+ new_options = opts.merge(
197
+ :operation => :"TremendousApi.create_campaign",
198
+ :header_params => header_params,
199
+ :query_params => query_params,
200
+ :form_params => form_params,
201
+ :body => post_body,
202
+ :auth_names => auth_names,
203
+ :return_type => return_type
204
+ )
205
+
206
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
207
+ if @api_client.config.debugging
208
+ @api_client.config.logger.debug "API called: TremendousApi#create_campaign\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
209
+ end
210
+ return data, status_code, headers
211
+ end
212
+
213
+ # Create invoice
214
+ # Creating an invoice is the way for your organization to fund your account's balance. 1. Create an invoice 2. Pay the invoice 3. Funds get added to your account's balance ## 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\">po_number</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Reference to the purchase order number within your organization</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">amount</code> </div> </td><td><span class=\"property-type\">number</span> <span class=\"property-format\">double</span></td><td><p>Amount of the invoice in USD</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">memo</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>A note to be included in the invoice. This is for your internal use and will not be visible to the recipient.</p> </td></tr> </tbody> </table> </div>
215
+ # @param create_invoice_request [CreateInvoiceRequest] Invoice details
216
+ # @param [Hash] opts the optional parameters
217
+ # @return [CreateInvoice200Response]
218
+ def create_invoice(create_invoice_request, opts = {})
219
+ data, _status_code, _headers = create_invoice_with_http_info(create_invoice_request, opts)
220
+ data
221
+ end
222
+
223
+ # Create invoice
224
+ # Creating an invoice is the way for your organization to fund your account&#39;s balance. 1. Create an invoice 2. Pay the invoice 3. Funds get added to your account&#39;s balance ## Request body &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;po_number&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;Reference to the purchase order number within your organization&lt;/p&gt; &lt;/td&gt;&lt;/tr&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;amount&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;\&quot;property-type\&quot;&gt;number&lt;/span&gt; &lt;span class&#x3D;\&quot;property-format\&quot;&gt;double&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Amount of the invoice in USD&lt;/p&gt; &lt;/td&gt;&lt;/tr&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;memo&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;A note to be included in the invoice. This is for your internal use and will not be visible to the recipient.&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/div&gt;
225
+ # @param create_invoice_request [CreateInvoiceRequest] Invoice details
226
+ # @param [Hash] opts the optional parameters
227
+ # @return [Array<(CreateInvoice200Response, Integer, Hash)>] CreateInvoice200Response data, response status code and response headers
228
+ def create_invoice_with_http_info(create_invoice_request, opts = {})
229
+ if @api_client.config.debugging
230
+ @api_client.config.logger.debug 'Calling API: TremendousApi.create_invoice ...'
231
+ end
232
+ # verify the required parameter 'create_invoice_request' is set
233
+ if @api_client.config.client_side_validation && create_invoice_request.nil?
234
+ fail ArgumentError, "Missing the required parameter 'create_invoice_request' when calling TremendousApi.create_invoice"
235
+ end
236
+ # resource path
237
+ local_var_path = '/invoices'
238
+
239
+ # query parameters
240
+ query_params = opts[:query_params] || {}
241
+
242
+ # header parameters
243
+ header_params = opts[:header_params] || {}
244
+ # HTTP header 'Accept' (if needed)
245
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
246
+ # HTTP header 'Content-Type'
247
+ content_type = @api_client.select_header_content_type(['application/json'])
248
+ if !content_type.nil?
249
+ header_params['Content-Type'] = content_type
250
+ end
251
+
252
+ # form parameters
253
+ form_params = opts[:form_params] || {}
254
+
255
+ # http body (model)
256
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_invoice_request)
257
+
258
+ # return_type
259
+ return_type = opts[:debug_return_type] || 'CreateInvoice200Response'
260
+
261
+ # auth_names
262
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
263
+
264
+ new_options = opts.merge(
265
+ :operation => :"TremendousApi.create_invoice",
266
+ :header_params => header_params,
267
+ :query_params => query_params,
268
+ :form_params => form_params,
269
+ :body => post_body,
270
+ :auth_names => auth_names,
271
+ :return_type => return_type
272
+ )
273
+
274
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
275
+ if @api_client.config.debugging
276
+ @api_client.config.logger.debug "API called: TremendousApi#create_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
277
+ end
278
+ return data, status_code, headers
279
+ end
280
+
281
+ # 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.
283
+ # @param create_member_request [CreateMemberRequest] Member details
284
+ # @param [Hash] opts the optional parameters
285
+ # @return [CreateMember200Response]
286
+ def create_member(create_member_request, opts = {})
287
+ data, _status_code, _headers = create_member_with_http_info(create_member_request, opts)
288
+ data
289
+ end
290
+
291
+ # 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.
293
+ # @param create_member_request [CreateMemberRequest] Member details
294
+ # @param [Hash] opts the optional parameters
295
+ # @return [Array<(CreateMember200Response, Integer, Hash)>] CreateMember200Response data, response status code and response headers
296
+ def create_member_with_http_info(create_member_request, opts = {})
297
+ if @api_client.config.debugging
298
+ @api_client.config.logger.debug 'Calling API: TremendousApi.create_member ...'
299
+ end
300
+ # verify the required parameter 'create_member_request' is set
301
+ if @api_client.config.client_side_validation && create_member_request.nil?
302
+ fail ArgumentError, "Missing the required parameter 'create_member_request' when calling TremendousApi.create_member"
303
+ end
304
+ # resource path
305
+ local_var_path = '/members'
306
+
307
+ # query parameters
308
+ query_params = opts[:query_params] || {}
309
+
310
+ # header parameters
311
+ header_params = opts[:header_params] || {}
312
+ # HTTP header 'Accept' (if needed)
313
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
314
+ # HTTP header 'Content-Type'
315
+ content_type = @api_client.select_header_content_type(['application/json'])
316
+ if !content_type.nil?
317
+ header_params['Content-Type'] = content_type
318
+ end
319
+
320
+ # form parameters
321
+ form_params = opts[:form_params] || {}
322
+
323
+ # http body (model)
324
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_member_request)
325
+
326
+ # return_type
327
+ return_type = opts[:debug_return_type] || 'CreateMember200Response'
328
+
329
+ # auth_names
330
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
331
+
332
+ new_options = opts.merge(
333
+ :operation => :"TremendousApi.create_member",
334
+ :header_params => header_params,
335
+ :query_params => query_params,
336
+ :form_params => form_params,
337
+ :body => post_body,
338
+ :auth_names => auth_names,
339
+ :return_type => return_type
340
+ )
341
+
342
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
343
+ if @api_client.config.debugging
344
+ @api_client.config.logger.debug "API called: TremendousApi#create_member\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
345
+ end
346
+ return data, status_code, headers
347
+ end
348
+
349
+ # Create order
350
+ # Every time you want to send out a reward through Tremendous you need to create an order for it. > 📘 Getting started with your first order > > Our step-by-step guide walks you through everything you need > to send your first gift card through the Tremendous API: > > <strong><a style=\"display: block; margin-top: 20px;\" href=\"/docs/sending-rewards-intro\">Check it out!</a></strong> ## 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\">external_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Reference for this order, supplied by the customer.</p> <p>When set, <code>external_id</code> makes order idempotent. All requests that use the same <code>external_id</code> after the initial order creation, will result in a response that returns the data of the initially created order. The response will have a <code>201</code> response code. These responses <strong>fail</strong> to create any further orders.</p> <p>It also allows for retrieving by <code>external_id</code> instead of <code>id</code> only.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">payment</code> </div> </td><td><span class=\"property-type\">object</span></td><td></td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <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\">funding_source_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the funding source that will be used to pay for the order. Use <code>balance</code> to use your Tremendous&#39;s balance.</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">reward</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>A single reward, sent to a recipient. A reward is always part of an order.</p> <p>Either <code>products</code> or <code>campaign_id</code> must be specified.</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the reward</p> </td></tr> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">order_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the order this reward is part of.</p> </td></tr> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">created_at</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">date-time</span></td><td><p>Date the reward was created</p> </td></tr> <tr class=\"property-conditional-hint-request-only\"><td><div class=\"property-name\"> <code class=\"property-name\">campaign_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>ID of the campaign in your account, that defines the available products (different gift cards, charity, etc.) that the recipient can choose from.</p> </td></tr> <tr class=\"property-conditional-hint-request-only\"><td><div class=\"property-name\"> <code class=\"property-name\">products</code> </div> </td><td><span class=\"property-type\">array</span> <span class=\"property-format\">string</span></td><td><p>List of IDs of product (different gift cards, charity, etc.) that will be available to the recipient to choose from.</p> <p>Providing a <code>products</code> array will override the products made available by the campaign specified using the <code>campaign_id</code> property unless the <code>products</code> array is empty. It will <em>not</em> override other campaign attributes, like the message and customization of the look and feel.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">value</code> </div> </td><td><span class=\"property-type\">object</span></td><td></td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <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\">denomination</code> </div> </td><td><span class=\"property-type\">number</span> <span class=\"property-format\">double</span></td><td><p>Amount of the reward</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">currency_code</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Currency of the reward</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">recipient</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Details of the recipient of the reward</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <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\">name</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Name of the recipient</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">email</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Email address of the recipient</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">phone</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Phone number of the recipient. For non-US phone numbers, specify the country code (prefixed with +).</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">deliver_at</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">date</span></td><td><p>Timestamp of reward delivery within the next year. Note that if date-time is provided, the time values will be ignored.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">custom_fields</code> </div> </td><td><span class=\"property-type\">array</span></td><td></td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show array item type</summary> <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\">id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the custom field</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">value</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Value of the custom field</p> </td></tr> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">label</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Label of the custom field</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">language</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Set this to translate the redemption experience for this reward. Pass a 2-letter <a href=\"https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes\">ISO-639-1 code</a> for the desired language. Defaults to <code>en</code>.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">delivery</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Details on how the reward is delivered to the recipient.</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <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\">method</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>How to deliver the reward to the recipient.</p> <table> <thead> <tr> <th>Delivery Method</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>EMAIL</code></td> <td>Deliver the reward to the recipient by email</td> </tr> <tr> <td><code>LINK</code></td> <td> <p>Deliver the reward to the recipient via a link.</p> <p>The link can be retrieved on a successfully ordered reward via the <code>/rewards</code> or <code>/rewards/{id}</code> endpoint. That link must then be delivered to the recipient out-of-band.</p> </td> </tr> <tr> <td><code>PHONE</code></td> <td>Deliver the reward to the recipient by SMS</td> </tr> </tbody> </table> </td></tr> </tbody> </table> </tr> </tbody> </table> </tr> </tbody> </table> </div> ### Funding sources There are different ways to pay for gift cards and rewards on Tremendous. Every payment mechanism is called a \"funding source\". You can retrieve a list of all available funding sources by using the [Funding sources API endpoint](https://tremendous.readme.io/reference/core-funding-source-index). The Tremendous API sandbox environment comes with a single funding source that allows you to spend up to $5,000 in *fake money* to test the API. [Learn more about the sandbox environment](https://tremendous.readme.io/reference/sandbox). The HTTP status code `200` on the response will be used to indicate success. After processing successfully the reward gets queued to be delivered to it's recipient (for delivery method `EMAIL` and `PHONE`). Delivery will happen asynchronously, after the response has been sent. ### Idempotence Requests issued with the same external_id are idempotent. Submitting an order with an already existing `external_id`, will result in a `201` response code. In this case the response will return a representation of the already existing order in the response body.
351
+ # @param create_order_request [CreateOrderRequest] Order to create
352
+ # @param [Hash] opts the optional parameters
353
+ # @return [CreateOrder200Response]
354
+ def create_order(create_order_request, opts = {})
355
+ data, _status_code, _headers = create_order_with_http_info(create_order_request, opts)
356
+ data
357
+ end
358
+
359
+ # Create order
360
+ # Every time you want to send out a reward through Tremendous you need to create an order for it. &gt; 📘 Getting started with your first order &gt; &gt; Our step-by-step guide walks you through everything you need &gt; to send your first gift card through the Tremendous API: &gt; &gt; &lt;strong&gt;&lt;a style&#x3D;\&quot;display: block; margin-top: 20px;\&quot; href&#x3D;\&quot;/docs/sending-rewards-intro\&quot;&gt;Check it out!&lt;/a&gt;&lt;/strong&gt; ## Request body &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;external_id&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;Reference for this order, supplied by the customer.&lt;/p&gt; &lt;p&gt;When set, &lt;code&gt;external_id&lt;/code&gt; makes order idempotent. All requests that use the same &lt;code&gt;external_id&lt;/code&gt; after the initial order creation, will result in a response that returns the data of the initially created order. The response will have a &lt;code&gt;201&lt;/code&gt; response code. These responses &lt;strong&gt;fail&lt;/strong&gt; to create any further orders.&lt;/p&gt; &lt;p&gt;It also allows for retrieving by &lt;code&gt;external_id&lt;/code&gt; instead of &lt;code&gt;id&lt;/code&gt; only.&lt;/p&gt; &lt;/td&gt;&lt;/tr&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;payment&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;\&quot;property-type\&quot;&gt;object&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td colspan&#x3D;\&quot;3\&quot;&gt; &lt;details&gt; &lt;summary&gt;Show object properties&lt;/summary&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;funding_source_id&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;Tremendous ID of the funding source that will be used to pay for the order. Use &lt;code&gt;balance&lt;/code&gt; to use your Tremendous&amp;#39;s balance.&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/tr&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;reward&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;\&quot;property-type\&quot;&gt;object&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;A single reward, sent to a recipient. A reward is always part of an order.&lt;/p&gt; &lt;p&gt;Either &lt;code&gt;products&lt;/code&gt; or &lt;code&gt;campaign_id&lt;/code&gt; must be specified.&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td colspan&#x3D;\&quot;3\&quot;&gt; &lt;details&gt; &lt;summary&gt;Show object properties&lt;/summary&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;property-conditional-hint-response-only\&quot;&gt;&lt;td&gt;&lt;div class&#x3D;\&quot;property-name\&quot;&gt; &lt;code class&#x3D;\&quot;property-name\&quot;&gt;id&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;Tremendous ID of the reward&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr class&#x3D;\&quot;property-conditional-hint-response-only\&quot;&gt;&lt;td&gt;&lt;div class&#x3D;\&quot;property-name\&quot;&gt; &lt;code class&#x3D;\&quot;property-name\&quot;&gt;order_id&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;Tremendous ID of the order this reward is part of.&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr class&#x3D;\&quot;property-conditional-hint-response-only\&quot;&gt;&lt;td&gt;&lt;div class&#x3D;\&quot;property-name\&quot;&gt; &lt;code class&#x3D;\&quot;property-name\&quot;&gt;created_at&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;span class&#x3D;\&quot;property-format\&quot;&gt;date-time&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Date the reward was created&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr class&#x3D;\&quot;property-conditional-hint-request-only\&quot;&gt;&lt;td&gt;&lt;div class&#x3D;\&quot;property-name\&quot;&gt; &lt;code class&#x3D;\&quot;property-name\&quot;&gt;campaign_id&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;ID of the campaign in your account, that defines the available products (different gift cards, charity, etc.) that the recipient can choose from.&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr class&#x3D;\&quot;property-conditional-hint-request-only\&quot;&gt;&lt;td&gt;&lt;div class&#x3D;\&quot;property-name\&quot;&gt; &lt;code class&#x3D;\&quot;property-name\&quot;&gt;products&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;\&quot;property-type\&quot;&gt;array&lt;/span&gt; &lt;span class&#x3D;\&quot;property-format\&quot;&gt;string&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;List of IDs of product (different gift cards, charity, etc.) that will be available to the recipient to choose from.&lt;/p&gt; &lt;p&gt;Providing a &lt;code&gt;products&lt;/code&gt; array will override the products made available by the campaign specified using the &lt;code&gt;campaign_id&lt;/code&gt; property unless the &lt;code&gt;products&lt;/code&gt; array is empty. It will &lt;em&gt;not&lt;/em&gt; override other campaign attributes, like the message and customization of the look and feel.&lt;/p&gt; &lt;/td&gt;&lt;/tr&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;value&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;\&quot;property-type\&quot;&gt;object&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td colspan&#x3D;\&quot;3\&quot;&gt; &lt;details&gt; &lt;summary&gt;Show object properties&lt;/summary&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;denomination&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;\&quot;property-type\&quot;&gt;number&lt;/span&gt; &lt;span class&#x3D;\&quot;property-format\&quot;&gt;double&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Amount of the reward&lt;/p&gt; &lt;/td&gt;&lt;/tr&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;currency_code&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;Currency of the reward&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/tr&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;recipient&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;\&quot;property-type\&quot;&gt;object&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Details of the recipient of the reward&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td colspan&#x3D;\&quot;3\&quot;&gt; &lt;details&gt; &lt;summary&gt;Show object properties&lt;/summary&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;name&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;Name of the recipient&lt;/p&gt; &lt;/td&gt;&lt;/tr&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;email&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;Email address of the recipient&lt;/p&gt; &lt;/td&gt;&lt;/tr&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;phone&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;Phone number of the recipient. For non-US phone numbers, specify the country code (prefixed with +).&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/tr&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;deliver_at&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;span class&#x3D;\&quot;property-format\&quot;&gt;date&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Timestamp of reward delivery within the next year. Note that if date-time is provided, the time values will be ignored.&lt;/p&gt; &lt;/td&gt;&lt;/tr&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;custom_fields&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;\&quot;property-type\&quot;&gt;array&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td colspan&#x3D;\&quot;3\&quot;&gt; &lt;details&gt; &lt;summary&gt;Show array item type&lt;/summary&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;id&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;Tremendous ID of the custom field&lt;/p&gt; &lt;/td&gt;&lt;/tr&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;value&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;Value of the custom field&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr class&#x3D;\&quot;property-conditional-hint-response-only\&quot;&gt;&lt;td&gt;&lt;div class&#x3D;\&quot;property-name\&quot;&gt; &lt;code class&#x3D;\&quot;property-name\&quot;&gt;label&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;Label of the custom field&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/tr&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;language&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;Set this to translate the redemption experience for this reward. Pass a 2-letter &lt;a href&#x3D;\&quot;https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes\&quot;&gt;ISO-639-1 code&lt;/a&gt; for the desired language. Defaults to &lt;code&gt;en&lt;/code&gt;.&lt;/p&gt; &lt;/td&gt;&lt;/tr&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;delivery&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;\&quot;property-type\&quot;&gt;object&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Details on how the reward is delivered to the recipient.&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td colspan&#x3D;\&quot;3\&quot;&gt; &lt;details&gt; &lt;summary&gt;Show object properties&lt;/summary&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;method&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;How to deliver the reward to the recipient.&lt;/p&gt; &lt;table&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Delivery Method&lt;/th&gt; &lt;th&gt;Description&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt;&lt;code&gt;EMAIL&lt;/code&gt;&lt;/td&gt; &lt;td&gt;Deliver the reward to the recipient by email&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;code&gt;LINK&lt;/code&gt;&lt;/td&gt; &lt;td&gt; &lt;p&gt;Deliver the reward to the recipient via a link.&lt;/p&gt; &lt;p&gt;The link can be retrieved on a successfully ordered reward via the &lt;code&gt;/rewards&lt;/code&gt; or &lt;code&gt;/rewards/{id}&lt;/code&gt; endpoint. That link must then be delivered to the recipient out-of-band.&lt;/p&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;code&gt;PHONE&lt;/code&gt;&lt;/td&gt; &lt;td&gt;Deliver the reward to the recipient by SMS&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/div&gt; ### Funding sources There are different ways to pay for gift cards and rewards on Tremendous. Every payment mechanism is called a \&quot;funding source\&quot;. You can retrieve a list of all available funding sources by using the [Funding sources API endpoint](https://tremendous.readme.io/reference/core-funding-source-index). The Tremendous API sandbox environment comes with a single funding source that allows you to spend up to $5,000 in *fake money* to test the API. [Learn more about the sandbox environment](https://tremendous.readme.io/reference/sandbox). The HTTP status code &#x60;200&#x60; on the response will be used to indicate success. After processing successfully the reward gets queued to be delivered to it&#39;s recipient (for delivery method &#x60;EMAIL&#x60; and &#x60;PHONE&#x60;). Delivery will happen asynchronously, after the response has been sent. ### Idempotence Requests issued with the same external_id are idempotent. Submitting an order with an already existing &#x60;external_id&#x60;, will result in a &#x60;201&#x60; response code. In this case the response will return a representation of the already existing order in the response body.
361
+ # @param create_order_request [CreateOrderRequest] Order to create
362
+ # @param [Hash] opts the optional parameters
363
+ # @return [Array<(CreateOrder200Response, Integer, Hash)>] CreateOrder200Response data, response status code and response headers
364
+ def create_order_with_http_info(create_order_request, opts = {})
365
+ if @api_client.config.debugging
366
+ @api_client.config.logger.debug 'Calling API: TremendousApi.create_order ...'
367
+ end
368
+ # verify the required parameter 'create_order_request' is set
369
+ if @api_client.config.client_side_validation && create_order_request.nil?
370
+ fail ArgumentError, "Missing the required parameter 'create_order_request' when calling TremendousApi.create_order"
371
+ end
372
+ # resource path
373
+ local_var_path = '/orders'
374
+
375
+ # query parameters
376
+ query_params = opts[:query_params] || {}
377
+
378
+ # header parameters
379
+ header_params = opts[:header_params] || {}
380
+ # HTTP header 'Accept' (if needed)
381
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
382
+ # HTTP header 'Content-Type'
383
+ content_type = @api_client.select_header_content_type(['application/json'])
384
+ if !content_type.nil?
385
+ header_params['Content-Type'] = content_type
386
+ end
387
+
388
+ # form parameters
389
+ form_params = opts[:form_params] || {}
390
+
391
+ # http body (model)
392
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_order_request)
393
+
394
+ # return_type
395
+ return_type = opts[:debug_return_type] || 'CreateOrder200Response'
396
+
397
+ # auth_names
398
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
399
+
400
+ new_options = opts.merge(
401
+ :operation => :"TremendousApi.create_order",
402
+ :header_params => header_params,
403
+ :query_params => query_params,
404
+ :form_params => form_params,
405
+ :body => post_body,
406
+ :auth_names => auth_names,
407
+ :return_type => return_type
408
+ )
409
+
410
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
411
+ if @api_client.config.debugging
412
+ @api_client.config.logger.debug "API called: TremendousApi#create_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
413
+ end
414
+ return data, status_code, headers
415
+ end
416
+
417
+ # Create organization
418
+ # Organizations are a way to separate different parts of your business within the same Tremendous account. You can assign users in your Tremendous team as members to any organization. Users can be members of multiple organizations at once. API keys belong to a single organization. The API key used in a request determines on behalf of which organization the request is carried out. **Important note:** When creating an organization, you are required to either pass `with_api_key` or `copy_settings[user]` in the request body as `true`. This ensures that your new Organization can either be accessed via the API or the Dashboard.
419
+ # @param create_organization_request [CreateOrganizationRequest] Organization details
420
+ # @param [Hash] opts the optional parameters
421
+ # @return [CreateOrganization200Response]
422
+ def create_organization(create_organization_request, opts = {})
423
+ data, _status_code, _headers = create_organization_with_http_info(create_organization_request, opts)
424
+ data
425
+ end
426
+
427
+ # Create organization
428
+ # Organizations are a way to separate different parts of your business within the same Tremendous account. You can assign users in your Tremendous team as members to any organization. Users can be members of multiple organizations at once. API keys belong to a single organization. The API key used in a request determines on behalf of which organization the request is carried out. **Important note:** When creating an organization, you are required to either pass &#x60;with_api_key&#x60; or &#x60;copy_settings[user]&#x60; in the request body as &#x60;true&#x60;. This ensures that your new Organization can either be accessed via the API or the Dashboard.
429
+ # @param create_organization_request [CreateOrganizationRequest] Organization details
430
+ # @param [Hash] opts the optional parameters
431
+ # @return [Array<(CreateOrganization200Response, Integer, Hash)>] CreateOrganization200Response data, response status code and response headers
432
+ def create_organization_with_http_info(create_organization_request, opts = {})
433
+ if @api_client.config.debugging
434
+ @api_client.config.logger.debug 'Calling API: TremendousApi.create_organization ...'
435
+ end
436
+ # verify the required parameter 'create_organization_request' is set
437
+ if @api_client.config.client_side_validation && create_organization_request.nil?
438
+ fail ArgumentError, "Missing the required parameter 'create_organization_request' when calling TremendousApi.create_organization"
439
+ end
440
+ # resource path
441
+ local_var_path = '/organizations'
442
+
443
+ # query parameters
444
+ query_params = opts[:query_params] || {}
445
+
446
+ # header parameters
447
+ header_params = opts[:header_params] || {}
448
+ # HTTP header 'Accept' (if needed)
449
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
450
+ # HTTP header 'Content-Type'
451
+ content_type = @api_client.select_header_content_type(['application/json'])
452
+ if !content_type.nil?
453
+ header_params['Content-Type'] = content_type
454
+ end
455
+
456
+ # form parameters
457
+ form_params = opts[:form_params] || {}
458
+
459
+ # http body (model)
460
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_organization_request)
461
+
462
+ # return_type
463
+ return_type = opts[:debug_return_type] || 'CreateOrganization200Response'
464
+
465
+ # auth_names
466
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
467
+
468
+ new_options = opts.merge(
469
+ :operation => :"TremendousApi.create_organization",
470
+ :header_params => header_params,
471
+ :query_params => query_params,
472
+ :form_params => form_params,
473
+ :body => post_body,
474
+ :auth_names => auth_names,
475
+ :return_type => return_type
476
+ )
477
+
478
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
479
+ if @api_client.config.debugging
480
+ @api_client.config.logger.debug "API called: TremendousApi#create_organization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
481
+ end
482
+ return data, status_code, headers
483
+ end
484
+
485
+ # Create webhook
486
+ # 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
+ # @param create_webhook_request [CreateWebhookRequest] Webhook details
488
+ # @param [Hash] opts the optional parameters
489
+ # @return [CreateWebhook200Response]
490
+ def create_webhook(create_webhook_request, opts = {})
491
+ data, _status_code, _headers = create_webhook_with_http_info(create_webhook_request, opts)
492
+ data
493
+ end
494
+
495
+ # Create webhook
496
+ # Tremendous uses webhooks as a notification system for various events that happen in your account. &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) 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 &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;url&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;span class&#x3D;\&quot;property-format\&quot;&gt;uri&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;URL the webhook will make requests to&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/div&gt;
497
+ # @param create_webhook_request [CreateWebhookRequest] Webhook details
498
+ # @param [Hash] opts the optional parameters
499
+ # @return [Array<(CreateWebhook200Response, Integer, Hash)>] CreateWebhook200Response data, response status code and response headers
500
+ def create_webhook_with_http_info(create_webhook_request, opts = {})
501
+ if @api_client.config.debugging
502
+ @api_client.config.logger.debug 'Calling API: TremendousApi.create_webhook ...'
503
+ end
504
+ # verify the required parameter 'create_webhook_request' is set
505
+ if @api_client.config.client_side_validation && create_webhook_request.nil?
506
+ fail ArgumentError, "Missing the required parameter 'create_webhook_request' when calling TremendousApi.create_webhook"
507
+ end
508
+ # resource path
509
+ local_var_path = '/webhooks'
510
+
511
+ # query parameters
512
+ query_params = opts[:query_params] || {}
513
+
514
+ # header parameters
515
+ header_params = opts[:header_params] || {}
516
+ # HTTP header 'Accept' (if needed)
517
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
518
+ # HTTP header 'Content-Type'
519
+ content_type = @api_client.select_header_content_type(['application/json'])
520
+ if !content_type.nil?
521
+ header_params['Content-Type'] = content_type
522
+ end
523
+
524
+ # form parameters
525
+ form_params = opts[:form_params] || {}
526
+
527
+ # http body (model)
528
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_webhook_request)
529
+
530
+ # return_type
531
+ return_type = opts[:debug_return_type] || 'CreateWebhook200Response'
532
+
533
+ # auth_names
534
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
535
+
536
+ new_options = opts.merge(
537
+ :operation => :"TremendousApi.create_webhook",
538
+ :header_params => header_params,
539
+ :query_params => query_params,
540
+ :form_params => form_params,
541
+ :body => post_body,
542
+ :auth_names => auth_names,
543
+ :return_type => return_type
544
+ )
545
+
546
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
547
+ if @api_client.config.debugging
548
+ @api_client.config.logger.debug "API called: TremendousApi#create_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
549
+ end
550
+ return data, status_code, headers
551
+ end
552
+
553
+ # Delete invoice
554
+ # 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
556
+ # @param [Hash] opts the optional parameters
557
+ # @return [CreateInvoice200Response]
558
+ def delete_invoices(id, opts = {})
559
+ data, _status_code, _headers = delete_invoices_with_http_info(id, opts)
560
+ data
561
+ end
562
+
563
+ # Delete invoice
564
+ # 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
566
+ # @param [Hash] opts the optional parameters
567
+ # @return [Array<(CreateInvoice200Response, Integer, Hash)>] CreateInvoice200Response data, response status code and response headers
568
+ def delete_invoices_with_http_info(id, opts = {})
569
+ if @api_client.config.debugging
570
+ @api_client.config.logger.debug 'Calling API: TremendousApi.delete_invoices ...'
571
+ end
572
+ # verify the required parameter 'id' is set
573
+ if @api_client.config.client_side_validation && id.nil?
574
+ fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.delete_invoices"
575
+ end
576
+ # resource path
577
+ local_var_path = '/invoices/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
578
+
579
+ # query parameters
580
+ query_params = opts[:query_params] || {}
581
+
582
+ # header parameters
583
+ header_params = opts[:header_params] || {}
584
+ # HTTP header 'Accept' (if needed)
585
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
586
+
587
+ # form parameters
588
+ form_params = opts[:form_params] || {}
589
+
590
+ # http body (model)
591
+ post_body = opts[:debug_body]
592
+
593
+ # return_type
594
+ return_type = opts[:debug_return_type] || 'CreateInvoice200Response'
595
+
596
+ # auth_names
597
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
598
+
599
+ new_options = opts.merge(
600
+ :operation => :"TremendousApi.delete_invoices",
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(:DELETE, local_var_path, new_options)
610
+ if @api_client.config.debugging
611
+ @api_client.config.logger.debug "API called: TremendousApi#delete_invoices\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
612
+ end
613
+ return data, status_code, headers
614
+ end
615
+
616
+ # Retrieve invoice as CSV
617
+ # Generates a CSV version for an invoice listing the associated rewards and orders
618
+ # @param id [String] ID of the Invoice for that the CSV should be generated
619
+ # @param [Hash] opts the optional parameters
620
+ # @return [String]
621
+ def download_invoice_csv(id, opts = {})
622
+ data, _status_code, _headers = download_invoice_csv_with_http_info(id, opts)
623
+ data
624
+ end
625
+
626
+ # Retrieve invoice as CSV
627
+ # Generates a CSV version for an invoice listing the associated rewards and orders
628
+ # @param id [String] ID of the Invoice for that the CSV should be generated
629
+ # @param [Hash] opts the optional parameters
630
+ # @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
631
+ def download_invoice_csv_with_http_info(id, opts = {})
632
+ if @api_client.config.debugging
633
+ @api_client.config.logger.debug 'Calling API: TremendousApi.download_invoice_csv ...'
634
+ end
635
+ # verify the required parameter 'id' is set
636
+ if @api_client.config.client_side_validation && id.nil?
637
+ fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.download_invoice_csv"
638
+ end
639
+ # resource path
640
+ local_var_path = '/invoices/{id}/csv'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
641
+
642
+ # query parameters
643
+ query_params = opts[:query_params] || {}
644
+
645
+ # header parameters
646
+ header_params = opts[:header_params] || {}
647
+ # HTTP header 'Accept' (if needed)
648
+ header_params['Accept'] = @api_client.select_header_accept(['text/csv', 'application/json'])
649
+
650
+ # form parameters
651
+ form_params = opts[:form_params] || {}
652
+
653
+ # http body (model)
654
+ post_body = opts[:debug_body]
655
+
656
+ # return_type
657
+ return_type = opts[:debug_return_type] || 'String'
658
+
659
+ # auth_names
660
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
661
+
662
+ new_options = opts.merge(
663
+ :operation => :"TremendousApi.download_invoice_csv",
664
+ :header_params => header_params,
665
+ :query_params => query_params,
666
+ :form_params => form_params,
667
+ :body => post_body,
668
+ :auth_names => auth_names,
669
+ :return_type => return_type
670
+ )
671
+
672
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
673
+ if @api_client.config.debugging
674
+ @api_client.config.logger.debug "API called: TremendousApi#download_invoice_csv\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
675
+ end
676
+ return data, status_code, headers
677
+ end
678
+
679
+ # Retrieve invoice as PDF
680
+ # Generates a PDF version for an invoice
681
+ # @param id [String] ID of the Invoice for that the PDF should be generated
682
+ # @param [Hash] opts the optional parameters
683
+ # @return [File]
684
+ def download_invoice_pdf(id, opts = {})
685
+ data, _status_code, _headers = download_invoice_pdf_with_http_info(id, opts)
686
+ data
687
+ end
688
+
689
+ # Retrieve invoice as PDF
690
+ # Generates a PDF version for an invoice
691
+ # @param id [String] ID of the Invoice for that the PDF should be generated
692
+ # @param [Hash] opts the optional parameters
693
+ # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers
694
+ def download_invoice_pdf_with_http_info(id, opts = {})
695
+ if @api_client.config.debugging
696
+ @api_client.config.logger.debug 'Calling API: TremendousApi.download_invoice_pdf ...'
697
+ end
698
+ # verify the required parameter 'id' is set
699
+ if @api_client.config.client_side_validation && id.nil?
700
+ fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.download_invoice_pdf"
701
+ end
702
+ # resource path
703
+ local_var_path = '/invoices/{id}/pdf'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
704
+
705
+ # query parameters
706
+ query_params = opts[:query_params] || {}
707
+
708
+ # header parameters
709
+ header_params = opts[:header_params] || {}
710
+ # HTTP header 'Accept' (if needed)
711
+ header_params['Accept'] = @api_client.select_header_accept(['application/pdf', 'application/json'])
712
+
713
+ # form parameters
714
+ form_params = opts[:form_params] || {}
715
+
716
+ # http body (model)
717
+ post_body = opts[:debug_body]
718
+
719
+ # return_type
720
+ return_type = opts[:debug_return_type] || 'File'
721
+
722
+ # auth_names
723
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
724
+
725
+ new_options = opts.merge(
726
+ :operation => :"TremendousApi.download_invoice_pdf",
727
+ :header_params => header_params,
728
+ :query_params => query_params,
729
+ :form_params => form_params,
730
+ :body => post_body,
731
+ :auth_names => auth_names,
732
+ :return_type => return_type
733
+ )
734
+
735
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
736
+ 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}"
738
+ end
739
+ return data, status_code, headers
740
+ end
741
+
742
+ # Generate a reward URL
743
+ # Generate a redemption link for the reward identified by the `id` in the URL
744
+ # @param id [String] ID of the reward
745
+ # @param [Hash] opts the optional parameters
746
+ # @return [GenerateRewardLink200Response]
747
+ def generate_reward_link(id, opts = {})
748
+ data, _status_code, _headers = generate_reward_link_with_http_info(id, opts)
749
+ data
750
+ end
751
+
752
+ # Generate a reward URL
753
+ # Generate a redemption link for the reward identified by the &#x60;id&#x60; in the URL
754
+ # @param id [String] ID of the reward
755
+ # @param [Hash] opts the optional parameters
756
+ # @return [Array<(GenerateRewardLink200Response, Integer, Hash)>] GenerateRewardLink200Response data, response status code and response headers
757
+ def generate_reward_link_with_http_info(id, opts = {})
758
+ if @api_client.config.debugging
759
+ @api_client.config.logger.debug 'Calling API: TremendousApi.generate_reward_link ...'
760
+ end
761
+ # verify the required parameter 'id' is set
762
+ if @api_client.config.client_side_validation && id.nil?
763
+ fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.generate_reward_link"
764
+ end
765
+ pattern = Regexp.new(/[A-Z0-9]{4,20}/)
766
+ if @api_client.config.client_side_validation && id !~ pattern
767
+ fail ArgumentError, "invalid value for 'id' when calling TremendousApi.generate_reward_link, must conform to the pattern #{pattern}."
768
+ end
769
+
770
+ # resource path
771
+ local_var_path = '/rewards/{id}/generate_link'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
772
+
773
+ # query parameters
774
+ query_params = opts[:query_params] || {}
775
+
776
+ # header parameters
777
+ header_params = opts[:header_params] || {}
778
+ # HTTP header 'Accept' (if needed)
779
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
780
+
781
+ # form parameters
782
+ form_params = opts[:form_params] || {}
783
+
784
+ # http body (model)
785
+ post_body = opts[:debug_body]
786
+
787
+ # return_type
788
+ return_type = opts[:debug_return_type] || 'GenerateRewardLink200Response'
789
+
790
+ # auth_names
791
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
792
+
793
+ new_options = opts.merge(
794
+ :operation => :"TremendousApi.generate_reward_link",
795
+ :header_params => header_params,
796
+ :query_params => query_params,
797
+ :form_params => form_params,
798
+ :body => post_body,
799
+ :auth_names => auth_names,
800
+ :return_type => return_type
801
+ )
802
+
803
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
804
+ if @api_client.config.debugging
805
+ @api_client.config.logger.debug "API called: TremendousApi#generate_reward_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
806
+ end
807
+ return data, status_code, headers
808
+ end
809
+
810
+ # Generate a reward token
811
+ # Generate a temporary reward token identified by the `id` in the URL. These tokens are needed to render a reward when using [Tremendous Embed](https://github.com/tremendous-rewards/embed/blob/master/docs/documentation.md). The token is valid for 24 hours.
812
+ # @param id [String] ID of the reward
813
+ # @param [Hash] opts the optional parameters
814
+ # @return [GenerateRewardToken200Response]
815
+ def generate_reward_token(id, opts = {})
816
+ data, _status_code, _headers = generate_reward_token_with_http_info(id, opts)
817
+ data
818
+ end
819
+
820
+ # Generate a reward token
821
+ # Generate a temporary reward token identified by the &#x60;id&#x60; in the URL. These tokens are needed to render a reward when using [Tremendous Embed](https://github.com/tremendous-rewards/embed/blob/master/docs/documentation.md). The token is valid for 24 hours.
822
+ # @param id [String] ID of the reward
823
+ # @param [Hash] opts the optional parameters
824
+ # @return [Array<(GenerateRewardToken200Response, Integer, Hash)>] GenerateRewardToken200Response data, response status code and response headers
825
+ def generate_reward_token_with_http_info(id, opts = {})
826
+ if @api_client.config.debugging
827
+ @api_client.config.logger.debug 'Calling API: TremendousApi.generate_reward_token ...'
828
+ end
829
+ # verify the required parameter 'id' is set
830
+ if @api_client.config.client_side_validation && id.nil?
831
+ fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.generate_reward_token"
832
+ end
833
+ pattern = Regexp.new(/[A-Z0-9]{4,20}/)
834
+ if @api_client.config.client_side_validation && id !~ pattern
835
+ fail ArgumentError, "invalid value for 'id' when calling TremendousApi.generate_reward_token, must conform to the pattern #{pattern}."
836
+ end
837
+
838
+ # resource path
839
+ local_var_path = '/rewards/{id}/generate_embed_token'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
840
+
841
+ # query parameters
842
+ query_params = opts[:query_params] || {}
843
+
844
+ # header parameters
845
+ header_params = opts[:header_params] || {}
846
+ # HTTP header 'Accept' (if needed)
847
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
848
+
849
+ # form parameters
850
+ form_params = opts[:form_params] || {}
851
+
852
+ # http body (model)
853
+ post_body = opts[:debug_body]
854
+
855
+ # return_type
856
+ return_type = opts[:debug_return_type] || 'GenerateRewardToken200Response'
857
+
858
+ # auth_names
859
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
860
+
861
+ new_options = opts.merge(
862
+ :operation => :"TremendousApi.generate_reward_token",
863
+ :header_params => header_params,
864
+ :query_params => query_params,
865
+ :form_params => form_params,
866
+ :body => post_body,
867
+ :auth_names => auth_names,
868
+ :return_type => return_type
869
+ )
870
+
871
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
872
+ if @api_client.config.debugging
873
+ @api_client.config.logger.debug "API called: TremendousApi#generate_reward_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
874
+ end
875
+ return data, status_code, headers
876
+ end
877
+
878
+ # Retrieve campaign
879
+ # Retrieve a campaign, identified by the given `id` in the URL
880
+ # @param id [String] ID of the campaign that should be retrieved
881
+ # @param [Hash] opts the optional parameters
882
+ # @return [CreateCampaign201Response]
883
+ def get_campaign(id, opts = {})
884
+ data, _status_code, _headers = get_campaign_with_http_info(id, opts)
885
+ data
886
+ end
887
+
888
+ # Retrieve campaign
889
+ # Retrieve a campaign, identified by the given &#x60;id&#x60; in the URL
890
+ # @param id [String] ID of the campaign that should be retrieved
891
+ # @param [Hash] opts the optional parameters
892
+ # @return [Array<(CreateCampaign201Response, Integer, Hash)>] CreateCampaign201Response data, response status code and response headers
893
+ def get_campaign_with_http_info(id, opts = {})
894
+ if @api_client.config.debugging
895
+ @api_client.config.logger.debug 'Calling API: TremendousApi.get_campaign ...'
896
+ end
897
+ # verify the required parameter 'id' is set
898
+ if @api_client.config.client_side_validation && id.nil?
899
+ fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.get_campaign"
900
+ end
901
+ pattern = Regexp.new(/[A-Z0-9]{4,20}/)
902
+ if @api_client.config.client_side_validation && id !~ pattern
903
+ fail ArgumentError, "invalid value for 'id' when calling TremendousApi.get_campaign, must conform to the pattern #{pattern}."
904
+ end
905
+
906
+ # resource path
907
+ local_var_path = '/campaigns/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
908
+
909
+ # query parameters
910
+ query_params = opts[:query_params] || {}
911
+
912
+ # header parameters
913
+ header_params = opts[:header_params] || {}
914
+ # HTTP header 'Accept' (if needed)
915
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
916
+
917
+ # form parameters
918
+ form_params = opts[:form_params] || {}
919
+
920
+ # http body (model)
921
+ post_body = opts[:debug_body]
922
+
923
+ # return_type
924
+ return_type = opts[:debug_return_type] || 'CreateCampaign201Response'
925
+
926
+ # auth_names
927
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
928
+
929
+ new_options = opts.merge(
930
+ :operation => :"TremendousApi.get_campaign",
931
+ :header_params => header_params,
932
+ :query_params => query_params,
933
+ :form_params => form_params,
934
+ :body => post_body,
935
+ :auth_names => auth_names,
936
+ :return_type => return_type
937
+ )
938
+
939
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
940
+ if @api_client.config.debugging
941
+ @api_client.config.logger.debug "API called: TremendousApi#get_campaign\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
942
+ end
943
+ return data, status_code, headers
944
+ end
945
+
946
+ # Retrieve funding source
947
+ # Retrieve a funding source, identified by the given `id` in the URL
948
+ # @param id [String] ID of the funding source that should be retrieved
949
+ # @param [Hash] opts the optional parameters
950
+ # @return [GetFundingSource200Response]
951
+ def get_funding_source(id, opts = {})
952
+ data, _status_code, _headers = get_funding_source_with_http_info(id, opts)
953
+ data
954
+ end
955
+
956
+ # Retrieve funding source
957
+ # Retrieve a funding source, identified by the given &#x60;id&#x60; in the URL
958
+ # @param id [String] ID of the funding source that should be retrieved
959
+ # @param [Hash] opts the optional parameters
960
+ # @return [Array<(GetFundingSource200Response, Integer, Hash)>] GetFundingSource200Response data, response status code and response headers
961
+ def get_funding_source_with_http_info(id, opts = {})
962
+ if @api_client.config.debugging
963
+ @api_client.config.logger.debug 'Calling API: TremendousApi.get_funding_source ...'
964
+ end
965
+ # verify the required parameter 'id' is set
966
+ if @api_client.config.client_side_validation && id.nil?
967
+ fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.get_funding_source"
968
+ end
969
+ pattern = Regexp.new(/[A-Z0-9]{4,20}/)
970
+ if @api_client.config.client_side_validation && id !~ pattern
971
+ fail ArgumentError, "invalid value for 'id' when calling TremendousApi.get_funding_source, must conform to the pattern #{pattern}."
972
+ end
973
+
974
+ # resource path
975
+ local_var_path = '/funding_sources/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
976
+
977
+ # query parameters
978
+ query_params = opts[:query_params] || {}
979
+
980
+ # header parameters
981
+ header_params = opts[:header_params] || {}
982
+ # HTTP header 'Accept' (if needed)
983
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
984
+
985
+ # form parameters
986
+ form_params = opts[:form_params] || {}
987
+
988
+ # http body (model)
989
+ post_body = opts[:debug_body]
990
+
991
+ # return_type
992
+ return_type = opts[:debug_return_type] || 'GetFundingSource200Response'
993
+
994
+ # auth_names
995
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
996
+
997
+ new_options = opts.merge(
998
+ :operation => :"TremendousApi.get_funding_source",
999
+ :header_params => header_params,
1000
+ :query_params => query_params,
1001
+ :form_params => form_params,
1002
+ :body => post_body,
1003
+ :auth_names => auth_names,
1004
+ :return_type => return_type
1005
+ )
1006
+
1007
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1008
+ if @api_client.config.debugging
1009
+ @api_client.config.logger.debug "API called: TremendousApi#get_funding_source\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1010
+ end
1011
+ return data, status_code, headers
1012
+ end
1013
+
1014
+ # Retrieve invoice
1015
+ # Retrieve an invoice, identified by the given `id` in the URL > 📘 Deleted Invoices > > This endpoint can be used to retrieve details on deleted invoices > that the list of invoices omits.
1016
+ # @param id [String] ID of the invoice that should be retrieved
1017
+ # @param [Hash] opts the optional parameters
1018
+ # @return [CreateInvoice200Response]
1019
+ def get_invoice(id, opts = {})
1020
+ data, _status_code, _headers = get_invoice_with_http_info(id, opts)
1021
+ data
1022
+ end
1023
+
1024
+ # Retrieve invoice
1025
+ # Retrieve an invoice, identified by the given &#x60;id&#x60; in the URL &gt; 📘 Deleted Invoices &gt; &gt; This endpoint can be used to retrieve details on deleted invoices &gt; that the list of invoices omits.
1026
+ # @param id [String] ID of the invoice that should be retrieved
1027
+ # @param [Hash] opts the optional parameters
1028
+ # @return [Array<(CreateInvoice200Response, Integer, Hash)>] CreateInvoice200Response data, response status code and response headers
1029
+ def get_invoice_with_http_info(id, opts = {})
1030
+ if @api_client.config.debugging
1031
+ @api_client.config.logger.debug 'Calling API: TremendousApi.get_invoice ...'
1032
+ end
1033
+ # verify the required parameter 'id' is set
1034
+ if @api_client.config.client_side_validation && id.nil?
1035
+ fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.get_invoice"
1036
+ end
1037
+ # resource path
1038
+ local_var_path = '/invoices/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
1039
+
1040
+ # query parameters
1041
+ query_params = opts[:query_params] || {}
1042
+
1043
+ # header parameters
1044
+ header_params = opts[:header_params] || {}
1045
+ # HTTP header 'Accept' (if needed)
1046
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1047
+
1048
+ # form parameters
1049
+ form_params = opts[:form_params] || {}
1050
+
1051
+ # http body (model)
1052
+ post_body = opts[:debug_body]
1053
+
1054
+ # return_type
1055
+ return_type = opts[:debug_return_type] || 'CreateInvoice200Response'
1056
+
1057
+ # auth_names
1058
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
1059
+
1060
+ new_options = opts.merge(
1061
+ :operation => :"TremendousApi.get_invoice",
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#get_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1073
+ end
1074
+ return data, status_code, headers
1075
+ end
1076
+
1077
+ # Retrieve member
1078
+ # @param id [String] ID of the member to retrieve
1079
+ # @param [Hash] opts the optional parameters
1080
+ # @return [GetMember200Response]
1081
+ def get_member(id, opts = {})
1082
+ data, _status_code, _headers = get_member_with_http_info(id, opts)
1083
+ data
1084
+ end
1085
+
1086
+ # Retrieve member
1087
+ # @param id [String] ID of the member to retrieve
1088
+ # @param [Hash] opts the optional parameters
1089
+ # @return [Array<(GetMember200Response, Integer, Hash)>] GetMember200Response data, response status code and response headers
1090
+ def get_member_with_http_info(id, opts = {})
1091
+ if @api_client.config.debugging
1092
+ @api_client.config.logger.debug 'Calling API: TremendousApi.get_member ...'
1093
+ end
1094
+ # verify the required parameter 'id' is set
1095
+ if @api_client.config.client_side_validation && id.nil?
1096
+ fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.get_member"
1097
+ end
1098
+ pattern = Regexp.new(/[A-Z0-9]{4,20}/)
1099
+ if @api_client.config.client_side_validation && id !~ pattern
1100
+ fail ArgumentError, "invalid value for 'id' when calling TremendousApi.get_member, must conform to the pattern #{pattern}."
1101
+ end
1102
+
1103
+ # resource path
1104
+ local_var_path = '/members/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
1105
+
1106
+ # query parameters
1107
+ query_params = opts[:query_params] || {}
1108
+
1109
+ # header parameters
1110
+ header_params = opts[:header_params] || {}
1111
+ # HTTP header 'Accept' (if needed)
1112
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1113
+
1114
+ # form parameters
1115
+ form_params = opts[:form_params] || {}
1116
+
1117
+ # http body (model)
1118
+ post_body = opts[:debug_body]
1119
+
1120
+ # return_type
1121
+ return_type = opts[:debug_return_type] || 'GetMember200Response'
1122
+
1123
+ # auth_names
1124
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
1125
+
1126
+ new_options = opts.merge(
1127
+ :operation => :"TremendousApi.get_member",
1128
+ :header_params => header_params,
1129
+ :query_params => query_params,
1130
+ :form_params => form_params,
1131
+ :body => post_body,
1132
+ :auth_names => auth_names,
1133
+ :return_type => return_type
1134
+ )
1135
+
1136
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1137
+ if @api_client.config.debugging
1138
+ @api_client.config.logger.debug "API called: TremendousApi#get_member\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1139
+ end
1140
+ return data, status_code, headers
1141
+ end
1142
+
1143
+ # Retrieve order
1144
+ # Retrieve the order, identified by the given `id` in the URL
1145
+ # @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
+ # @param [Hash] opts the optional parameters
1147
+ # @return [CreateOrder201Response]
1148
+ def get_order(id, opts = {})
1149
+ data, _status_code, _headers = get_order_with_http_info(id, opts)
1150
+ data
1151
+ end
1152
+
1153
+ # Retrieve order
1154
+ # Retrieve the order, identified by the given &#x60;id&#x60; in the URL
1155
+ # @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
+ # @param [Hash] opts the optional parameters
1157
+ # @return [Array<(CreateOrder201Response, Integer, Hash)>] CreateOrder201Response data, response status code and response headers
1158
+ def get_order_with_http_info(id, opts = {})
1159
+ if @api_client.config.debugging
1160
+ @api_client.config.logger.debug 'Calling API: TremendousApi.get_order ...'
1161
+ end
1162
+ # verify the required parameter 'id' is set
1163
+ if @api_client.config.client_side_validation && id.nil?
1164
+ fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.get_order"
1165
+ end
1166
+ # resource path
1167
+ local_var_path = '/orders/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
1168
+
1169
+ # query parameters
1170
+ query_params = opts[:query_params] || {}
1171
+
1172
+ # header parameters
1173
+ header_params = opts[:header_params] || {}
1174
+ # HTTP header 'Accept' (if needed)
1175
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1176
+
1177
+ # form parameters
1178
+ form_params = opts[:form_params] || {}
1179
+
1180
+ # http body (model)
1181
+ post_body = opts[:debug_body]
1182
+
1183
+ # return_type
1184
+ return_type = opts[:debug_return_type] || 'CreateOrder201Response'
1185
+
1186
+ # auth_names
1187
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
1188
+
1189
+ new_options = opts.merge(
1190
+ :operation => :"TremendousApi.get_order",
1191
+ :header_params => header_params,
1192
+ :query_params => query_params,
1193
+ :form_params => form_params,
1194
+ :body => post_body,
1195
+ :auth_names => auth_names,
1196
+ :return_type => return_type
1197
+ )
1198
+
1199
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1200
+ if @api_client.config.debugging
1201
+ @api_client.config.logger.debug "API called: TremendousApi#get_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1202
+ end
1203
+ return data, status_code, headers
1204
+ end
1205
+
1206
+ # Retrieve organization
1207
+ # @param id [String] ID of the organization to retrieve
1208
+ # @param [Hash] opts the optional parameters
1209
+ # @return [GetOrganization200Response]
1210
+ def get_organization(id, opts = {})
1211
+ data, _status_code, _headers = get_organization_with_http_info(id, opts)
1212
+ data
1213
+ end
1214
+
1215
+ # Retrieve organization
1216
+ # @param id [String] ID of the organization to retrieve
1217
+ # @param [Hash] opts the optional parameters
1218
+ # @return [Array<(GetOrganization200Response, Integer, Hash)>] GetOrganization200Response data, response status code and response headers
1219
+ def get_organization_with_http_info(id, opts = {})
1220
+ if @api_client.config.debugging
1221
+ @api_client.config.logger.debug 'Calling API: TremendousApi.get_organization ...'
1222
+ end
1223
+ # verify the required parameter 'id' is set
1224
+ if @api_client.config.client_side_validation && id.nil?
1225
+ fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.get_organization"
1226
+ end
1227
+ pattern = Regexp.new(/[A-Z0-9]{4,20}/)
1228
+ if @api_client.config.client_side_validation && id !~ pattern
1229
+ fail ArgumentError, "invalid value for 'id' when calling TremendousApi.get_organization, must conform to the pattern #{pattern}."
1230
+ end
1231
+
1232
+ # resource path
1233
+ local_var_path = '/organizations/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
1234
+
1235
+ # query parameters
1236
+ query_params = opts[:query_params] || {}
1237
+
1238
+ # header parameters
1239
+ header_params = opts[:header_params] || {}
1240
+ # HTTP header 'Accept' (if needed)
1241
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1242
+
1243
+ # form parameters
1244
+ form_params = opts[:form_params] || {}
1245
+
1246
+ # http body (model)
1247
+ post_body = opts[:debug_body]
1248
+
1249
+ # return_type
1250
+ return_type = opts[:debug_return_type] || 'GetOrganization200Response'
1251
+
1252
+ # auth_names
1253
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
1254
+
1255
+ new_options = opts.merge(
1256
+ :operation => :"TremendousApi.get_organization",
1257
+ :header_params => header_params,
1258
+ :query_params => query_params,
1259
+ :form_params => form_params,
1260
+ :body => post_body,
1261
+ :auth_names => auth_names,
1262
+ :return_type => return_type
1263
+ )
1264
+
1265
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1266
+ if @api_client.config.debugging
1267
+ @api_client.config.logger.debug "API called: TremendousApi#get_organization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1268
+ end
1269
+ return data, status_code, headers
1270
+ end
1271
+
1272
+ # Retrieve product
1273
+ # Retrieve a product, identified by the given `id` in the URL
1274
+ # @param id [String] ID of the product that should be retrieved
1275
+ # @param [Hash] opts the optional parameters
1276
+ # @return [GetProductResponse]
1277
+ def get_product(id, opts = {})
1278
+ data, _status_code, _headers = get_product_with_http_info(id, opts)
1279
+ data
1280
+ end
1281
+
1282
+ # Retrieve product
1283
+ # Retrieve a product, identified by the given &#x60;id&#x60; in the URL
1284
+ # @param id [String] ID of the product that should be retrieved
1285
+ # @param [Hash] opts the optional parameters
1286
+ # @return [Array<(GetProductResponse, Integer, Hash)>] GetProductResponse data, response status code and response headers
1287
+ def get_product_with_http_info(id, opts = {})
1288
+ if @api_client.config.debugging
1289
+ @api_client.config.logger.debug 'Calling API: TremendousApi.get_product ...'
1290
+ end
1291
+ # verify the required parameter 'id' is set
1292
+ if @api_client.config.client_side_validation && id.nil?
1293
+ fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.get_product"
1294
+ end
1295
+ pattern = Regexp.new(/[A-Z0-9]{4,20}/)
1296
+ if @api_client.config.client_side_validation && id !~ pattern
1297
+ fail ArgumentError, "invalid value for 'id' when calling TremendousApi.get_product, must conform to the pattern #{pattern}."
1298
+ end
1299
+
1300
+ # resource path
1301
+ local_var_path = '/products/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
1302
+
1303
+ # query parameters
1304
+ query_params = opts[:query_params] || {}
1305
+
1306
+ # header parameters
1307
+ header_params = opts[:header_params] || {}
1308
+ # HTTP header 'Accept' (if needed)
1309
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1310
+
1311
+ # form parameters
1312
+ form_params = opts[:form_params] || {}
1313
+
1314
+ # http body (model)
1315
+ post_body = opts[:debug_body]
1316
+
1317
+ # return_type
1318
+ return_type = opts[:debug_return_type] || 'GetProductResponse'
1319
+
1320
+ # auth_names
1321
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
1322
+
1323
+ new_options = opts.merge(
1324
+ :operation => :"TremendousApi.get_product",
1325
+ :header_params => header_params,
1326
+ :query_params => query_params,
1327
+ :form_params => form_params,
1328
+ :body => post_body,
1329
+ :auth_names => auth_names,
1330
+ :return_type => return_type
1331
+ )
1332
+
1333
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1334
+ if @api_client.config.debugging
1335
+ @api_client.config.logger.debug "API called: TremendousApi#get_product\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1336
+ end
1337
+ return data, status_code, headers
1338
+ end
1339
+
1340
+ # Retrieve single reward
1341
+ # Retrieve the reward, identified by the given `id` in the URL
1342
+ # @param id [String] ID of the reward that should be retrieved
1343
+ # @param [Hash] opts the optional parameters
1344
+ # @return [GetReward200Response]
1345
+ def get_reward(id, opts = {})
1346
+ data, _status_code, _headers = get_reward_with_http_info(id, opts)
1347
+ data
1348
+ end
1349
+
1350
+ # Retrieve single reward
1351
+ # Retrieve the reward, identified by the given &#x60;id&#x60; in the URL
1352
+ # @param id [String] ID of the reward that should be retrieved
1353
+ # @param [Hash] opts the optional parameters
1354
+ # @return [Array<(GetReward200Response, Integer, Hash)>] GetReward200Response data, response status code and response headers
1355
+ def get_reward_with_http_info(id, opts = {})
1356
+ if @api_client.config.debugging
1357
+ @api_client.config.logger.debug 'Calling API: TremendousApi.get_reward ...'
1358
+ end
1359
+ # verify the required parameter 'id' is set
1360
+ if @api_client.config.client_side_validation && id.nil?
1361
+ fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.get_reward"
1362
+ end
1363
+ pattern = Regexp.new(/[A-Z0-9]{4,20}/)
1364
+ if @api_client.config.client_side_validation && id !~ pattern
1365
+ fail ArgumentError, "invalid value for 'id' when calling TremendousApi.get_reward, must conform to the pattern #{pattern}."
1366
+ end
1367
+
1368
+ # resource path
1369
+ local_var_path = '/rewards/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
1370
+
1371
+ # query parameters
1372
+ query_params = opts[:query_params] || {}
1373
+
1374
+ # header parameters
1375
+ header_params = opts[:header_params] || {}
1376
+ # HTTP header 'Accept' (if needed)
1377
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1378
+
1379
+ # form parameters
1380
+ form_params = opts[:form_params] || {}
1381
+
1382
+ # http body (model)
1383
+ post_body = opts[:debug_body]
1384
+
1385
+ # return_type
1386
+ return_type = opts[:debug_return_type] || 'GetReward200Response'
1387
+
1388
+ # auth_names
1389
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
1390
+
1391
+ new_options = opts.merge(
1392
+ :operation => :"TremendousApi.get_reward",
1393
+ :header_params => header_params,
1394
+ :query_params => query_params,
1395
+ :form_params => form_params,
1396
+ :body => post_body,
1397
+ :auth_names => auth_names,
1398
+ :return_type => return_type
1399
+ )
1400
+
1401
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1402
+ if @api_client.config.debugging
1403
+ @api_client.config.logger.debug "API called: TremendousApi#get_reward\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1404
+ end
1405
+ return data, status_code, headers
1406
+ end
1407
+
1408
+ # Retrieve webhook
1409
+ # > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > [Read it here](/docs/webhooks-1)
1410
+ # @param id [String] ID of the webhook to retrieve
1411
+ # @param [Hash] opts the optional parameters
1412
+ # @return [CreateWebhook200Response]
1413
+ def get_webhook(id, opts = {})
1414
+ data, _status_code, _headers = get_webhook_with_http_info(id, opts)
1415
+ data
1416
+ end
1417
+
1418
+ # Retrieve webhook
1419
+ # &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)
1420
+ # @param id [String] ID of the webhook to retrieve
1421
+ # @param [Hash] opts the optional parameters
1422
+ # @return [Array<(CreateWebhook200Response, Integer, Hash)>] CreateWebhook200Response data, response status code and response headers
1423
+ def get_webhook_with_http_info(id, opts = {})
1424
+ if @api_client.config.debugging
1425
+ @api_client.config.logger.debug 'Calling API: TremendousApi.get_webhook ...'
1426
+ end
1427
+ # verify the required parameter 'id' is set
1428
+ if @api_client.config.client_side_validation && id.nil?
1429
+ fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.get_webhook"
1430
+ end
1431
+ pattern = Regexp.new(/[A-Z0-9]{4,20}/)
1432
+ if @api_client.config.client_side_validation && id !~ pattern
1433
+ fail ArgumentError, "invalid value for 'id' when calling TremendousApi.get_webhook, must conform to the pattern #{pattern}."
1434
+ end
1435
+
1436
+ # resource path
1437
+ local_var_path = '/webhooks/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
1438
+
1439
+ # query parameters
1440
+ query_params = opts[:query_params] || {}
1441
+
1442
+ # header parameters
1443
+ header_params = opts[:header_params] || {}
1444
+ # HTTP header 'Accept' (if needed)
1445
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1446
+
1447
+ # form parameters
1448
+ form_params = opts[:form_params] || {}
1449
+
1450
+ # http body (model)
1451
+ post_body = opts[:debug_body]
1452
+
1453
+ # return_type
1454
+ return_type = opts[:debug_return_type] || 'CreateWebhook200Response'
1455
+
1456
+ # auth_names
1457
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
1458
+
1459
+ new_options = opts.merge(
1460
+ :operation => :"TremendousApi.get_webhook",
1461
+ :header_params => header_params,
1462
+ :query_params => query_params,
1463
+ :form_params => form_params,
1464
+ :body => post_body,
1465
+ :auth_names => auth_names,
1466
+ :return_type => return_type
1467
+ )
1468
+
1469
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1470
+ if @api_client.config.debugging
1471
+ @api_client.config.logger.debug "API called: TremendousApi#get_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1472
+ end
1473
+ return data, status_code, headers
1474
+ end
1475
+
1476
+ # List balance transactions
1477
+ # Fetch a list of all balance transactions on your account.
1478
+ # @param [Hash] opts the optional parameters
1479
+ # @option opts [Integer] :offset Offsets the returned list by the given number of transactions. The returned transactions are ordered (and offsetted) by their creation date (DESC).
1480
+ # @option opts [Integer] :limit Limits the number of transactions listed. The default value is 10.
1481
+ # @option opts [String] :created_at_gte Only return results where the created_at field is greater than or equal to the supplied value. The string needs to be an ISO 8601 datetime.
1482
+ # @option opts [String] :created_at_lte Only return results where the created_at field is less than or equal to the supplied value. The string needs to be an ISO 8601 datetime.
1483
+ # @return [ListBalanceTransactions200Response]
1484
+ def list_balance_transactions(opts = {})
1485
+ data, _status_code, _headers = list_balance_transactions_with_http_info(opts)
1486
+ data
1487
+ end
1488
+
1489
+ # List balance transactions
1490
+ # Fetch a list of all balance transactions on your account.
1491
+ # @param [Hash] opts the optional parameters
1492
+ # @option opts [Integer] :offset Offsets the returned list by the given number of transactions. The returned transactions are ordered (and offsetted) by their creation date (DESC).
1493
+ # @option opts [Integer] :limit Limits the number of transactions listed. The default value is 10.
1494
+ # @option opts [String] :created_at_gte Only return results where the created_at field is greater than or equal to the supplied value. The string needs to be an ISO 8601 datetime.
1495
+ # @option opts [String] :created_at_lte Only return results where the created_at field is less than or equal to the supplied value. The string needs to be an ISO 8601 datetime.
1496
+ # @return [Array<(ListBalanceTransactions200Response, Integer, Hash)>] ListBalanceTransactions200Response data, response status code and response headers
1497
+ def list_balance_transactions_with_http_info(opts = {})
1498
+ if @api_client.config.debugging
1499
+ @api_client.config.logger.debug 'Calling API: TremendousApi.list_balance_transactions ...'
1500
+ end
1501
+ # resource path
1502
+ local_var_path = '/balance_transactions'
1503
+
1504
+ # query parameters
1505
+ query_params = opts[:query_params] || {}
1506
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
1507
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
1508
+ query_params[:'created_at[gte]'] = opts[:'created_at_gte'] if !opts[:'created_at_gte'].nil?
1509
+ query_params[:'created_at[lte]'] = opts[:'created_at_lte'] if !opts[:'created_at_lte'].nil?
1510
+
1511
+ # header parameters
1512
+ header_params = opts[:header_params] || {}
1513
+ # HTTP header 'Accept' (if needed)
1514
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1515
+
1516
+ # form parameters
1517
+ form_params = opts[:form_params] || {}
1518
+
1519
+ # http body (model)
1520
+ post_body = opts[:debug_body]
1521
+
1522
+ # return_type
1523
+ return_type = opts[:debug_return_type] || 'ListBalanceTransactions200Response'
1524
+
1525
+ # auth_names
1526
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
1527
+
1528
+ new_options = opts.merge(
1529
+ :operation => :"TremendousApi.list_balance_transactions",
1530
+ :header_params => header_params,
1531
+ :query_params => query_params,
1532
+ :form_params => form_params,
1533
+ :body => post_body,
1534
+ :auth_names => auth_names,
1535
+ :return_type => return_type
1536
+ )
1537
+
1538
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1539
+ if @api_client.config.debugging
1540
+ @api_client.config.logger.debug "API called: TremendousApi#list_balance_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1541
+ end
1542
+ return data, status_code, headers
1543
+ end
1544
+
1545
+ # List campaigns
1546
+ # Retrieve a list of all campaigns created in your account
1547
+ # @param [Hash] opts the optional parameters
1548
+ # @return [ListCampaigns200Response]
1549
+ def list_campaigns(opts = {})
1550
+ data, _status_code, _headers = list_campaigns_with_http_info(opts)
1551
+ data
1552
+ end
1553
+
1554
+ # List campaigns
1555
+ # Retrieve a list of all campaigns created in your account
1556
+ # @param [Hash] opts the optional parameters
1557
+ # @return [Array<(ListCampaigns200Response, Integer, Hash)>] ListCampaigns200Response data, response status code and response headers
1558
+ def list_campaigns_with_http_info(opts = {})
1559
+ if @api_client.config.debugging
1560
+ @api_client.config.logger.debug 'Calling API: TremendousApi.list_campaigns ...'
1561
+ end
1562
+ # resource path
1563
+ local_var_path = '/campaigns'
1564
+
1565
+ # query parameters
1566
+ query_params = opts[:query_params] || {}
1567
+
1568
+ # header parameters
1569
+ header_params = opts[:header_params] || {}
1570
+ # HTTP header 'Accept' (if needed)
1571
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1572
+
1573
+ # form parameters
1574
+ form_params = opts[:form_params] || {}
1575
+
1576
+ # http body (model)
1577
+ post_body = opts[:debug_body]
1578
+
1579
+ # return_type
1580
+ return_type = opts[:debug_return_type] || 'ListCampaigns200Response'
1581
+
1582
+ # auth_names
1583
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
1584
+
1585
+ new_options = opts.merge(
1586
+ :operation => :"TremendousApi.list_campaigns",
1587
+ :header_params => header_params,
1588
+ :query_params => query_params,
1589
+ :form_params => form_params,
1590
+ :body => post_body,
1591
+ :auth_names => auth_names,
1592
+ :return_type => return_type
1593
+ )
1594
+
1595
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1596
+ if @api_client.config.debugging
1597
+ @api_client.config.logger.debug "API called: TremendousApi#list_campaigns\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1598
+ end
1599
+ return data, status_code, headers
1600
+ end
1601
+
1602
+ # List fields
1603
+ # 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
+ # @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)
1608
+ data
1609
+ end
1610
+
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.
1613
+ # @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 = {})
1616
+ if @api_client.config.debugging
1617
+ @api_client.config.logger.debug 'Calling API: TremendousApi.list_fields ...'
1618
+ end
1619
+ # resource path
1620
+ local_var_path = '/fields'
1621
+
1622
+ # query parameters
1623
+ query_params = opts[:query_params] || {}
1624
+
1625
+ # header parameters
1626
+ header_params = opts[:header_params] || {}
1627
+ # HTTP header 'Accept' (if needed)
1628
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1629
+
1630
+ # form parameters
1631
+ form_params = opts[:form_params] || {}
1632
+
1633
+ # http body (model)
1634
+ post_body = opts[:debug_body]
1635
+
1636
+ # return_type
1637
+ return_type = opts[:debug_return_type] || 'ListFields200Response'
1638
+
1639
+ # auth_names
1640
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
1641
+
1642
+ new_options = opts.merge(
1643
+ :operation => :"TremendousApi.list_fields",
1644
+ :header_params => header_params,
1645
+ :query_params => query_params,
1646
+ :form_params => form_params,
1647
+ :body => post_body,
1648
+ :auth_names => auth_names,
1649
+ :return_type => return_type
1650
+ )
1651
+
1652
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1653
+ 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}"
1655
+ end
1656
+ return data, status_code, headers
1657
+ end
1658
+
1659
+ # List funding sources
1660
+ # Retrieve a list of all funding sources available for ordering through the API in your organization's account.
1661
+ # @param [Hash] opts the optional parameters
1662
+ # @return [ListFundingSources200Response]
1663
+ def list_funding_sources(opts = {})
1664
+ data, _status_code, _headers = list_funding_sources_with_http_info(opts)
1665
+ data
1666
+ end
1667
+
1668
+ # List funding sources
1669
+ # Retrieve a list of all funding sources available for ordering through the API in your organization&#39;s account.
1670
+ # @param [Hash] opts the optional parameters
1671
+ # @return [Array<(ListFundingSources200Response, Integer, Hash)>] ListFundingSources200Response data, response status code and response headers
1672
+ def list_funding_sources_with_http_info(opts = {})
1673
+ if @api_client.config.debugging
1674
+ @api_client.config.logger.debug 'Calling API: TremendousApi.list_funding_sources ...'
1675
+ end
1676
+ # resource path
1677
+ local_var_path = '/funding_sources'
1678
+
1679
+ # query parameters
1680
+ query_params = opts[:query_params] || {}
1681
+
1682
+ # header parameters
1683
+ header_params = opts[:header_params] || {}
1684
+ # HTTP header 'Accept' (if needed)
1685
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1686
+
1687
+ # form parameters
1688
+ form_params = opts[:form_params] || {}
1689
+
1690
+ # http body (model)
1691
+ post_body = opts[:debug_body]
1692
+
1693
+ # return_type
1694
+ return_type = opts[:debug_return_type] || 'ListFundingSources200Response'
1695
+
1696
+ # auth_names
1697
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
1698
+
1699
+ new_options = opts.merge(
1700
+ :operation => :"TremendousApi.list_funding_sources",
1701
+ :header_params => header_params,
1702
+ :query_params => query_params,
1703
+ :form_params => form_params,
1704
+ :body => post_body,
1705
+ :auth_names => auth_names,
1706
+ :return_type => return_type
1707
+ )
1708
+
1709
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1710
+ if @api_client.config.debugging
1711
+ @api_client.config.logger.debug "API called: TremendousApi#list_funding_sources\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1712
+ end
1713
+ return data, status_code, headers
1714
+ end
1715
+
1716
+ # List invoices
1717
+ # Fetch a list of all invoices on your account. > 🚧 Deleted invoices are omitted > > The response does not include any previously deleted invoices.
1718
+ # @param [Hash] opts the optional parameters
1719
+ # @option opts [Integer] :offset Offsets the returned list by the given number of invoices. The returned invoices are ordered (and offsetted) by their creation date (DESC).
1720
+ # @option opts [Integer] :limit Limits the number of invoices listed. The maximum and default value is 10.
1721
+ # @return [ListInvoices200Response]
1722
+ def list_invoices(opts = {})
1723
+ data, _status_code, _headers = list_invoices_with_http_info(opts)
1724
+ data
1725
+ end
1726
+
1727
+ # List invoices
1728
+ # Fetch a list of all invoices on your account. &gt; 🚧 Deleted invoices are omitted &gt; &gt; The response does not include any previously deleted invoices.
1729
+ # @param [Hash] opts the optional parameters
1730
+ # @option opts [Integer] :offset Offsets the returned list by the given number of invoices. The returned invoices are ordered (and offsetted) by their creation date (DESC).
1731
+ # @option opts [Integer] :limit Limits the number of invoices listed. The maximum and default value is 10.
1732
+ # @return [Array<(ListInvoices200Response, Integer, Hash)>] ListInvoices200Response data, response status code and response headers
1733
+ def list_invoices_with_http_info(opts = {})
1734
+ if @api_client.config.debugging
1735
+ @api_client.config.logger.debug 'Calling API: TremendousApi.list_invoices ...'
1736
+ end
1737
+ # resource path
1738
+ local_var_path = '/invoices'
1739
+
1740
+ # query parameters
1741
+ query_params = opts[:query_params] || {}
1742
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
1743
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
1744
+
1745
+ # header parameters
1746
+ header_params = opts[:header_params] || {}
1747
+ # HTTP header 'Accept' (if needed)
1748
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1749
+
1750
+ # form parameters
1751
+ form_params = opts[:form_params] || {}
1752
+
1753
+ # http body (model)
1754
+ post_body = opts[:debug_body]
1755
+
1756
+ # return_type
1757
+ return_type = opts[:debug_return_type] || 'ListInvoices200Response'
1758
+
1759
+ # auth_names
1760
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
1761
+
1762
+ new_options = opts.merge(
1763
+ :operation => :"TremendousApi.list_invoices",
1764
+ :header_params => header_params,
1765
+ :query_params => query_params,
1766
+ :form_params => form_params,
1767
+ :body => post_body,
1768
+ :auth_names => auth_names,
1769
+ :return_type => return_type
1770
+ )
1771
+
1772
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1773
+ if @api_client.config.debugging
1774
+ @api_client.config.logger.debug "API called: TremendousApi#list_invoices\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1775
+ end
1776
+ return data, status_code, headers
1777
+ end
1778
+
1779
+ # List members
1780
+ # To list members of a sub-organization [create an API key for that organization](/reference/post_organizations-id-create-api-key) first, then use the new API key in the list members request.
1781
+ # @param [Hash] opts the optional parameters
1782
+ # @return [ListMembers200Response]
1783
+ def list_members(opts = {})
1784
+ data, _status_code, _headers = list_members_with_http_info(opts)
1785
+ data
1786
+ end
1787
+
1788
+ # List members
1789
+ # To list members of a sub-organization [create an API key for that organization](/reference/post_organizations-id-create-api-key) first, then use the new API key in the list members request.
1790
+ # @param [Hash] opts the optional parameters
1791
+ # @return [Array<(ListMembers200Response, Integer, Hash)>] ListMembers200Response data, response status code and response headers
1792
+ def list_members_with_http_info(opts = {})
1793
+ if @api_client.config.debugging
1794
+ @api_client.config.logger.debug 'Calling API: TremendousApi.list_members ...'
1795
+ end
1796
+ # resource path
1797
+ local_var_path = '/members'
1798
+
1799
+ # query parameters
1800
+ query_params = opts[:query_params] || {}
1801
+
1802
+ # header parameters
1803
+ header_params = opts[:header_params] || {}
1804
+ # HTTP header 'Accept' (if needed)
1805
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1806
+
1807
+ # form parameters
1808
+ form_params = opts[:form_params] || {}
1809
+
1810
+ # http body (model)
1811
+ post_body = opts[:debug_body]
1812
+
1813
+ # return_type
1814
+ return_type = opts[:debug_return_type] || 'ListMembers200Response'
1815
+
1816
+ # auth_names
1817
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
1818
+
1819
+ new_options = opts.merge(
1820
+ :operation => :"TremendousApi.list_members",
1821
+ :header_params => header_params,
1822
+ :query_params => query_params,
1823
+ :form_params => form_params,
1824
+ :body => post_body,
1825
+ :auth_names => auth_names,
1826
+ :return_type => return_type
1827
+ )
1828
+
1829
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1830
+ if @api_client.config.debugging
1831
+ @api_client.config.logger.debug "API called: TremendousApi#list_members\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1832
+ end
1833
+ return data, status_code, headers
1834
+ end
1835
+
1836
+ # List orders
1837
+ # Retrieve a list of orders
1838
+ # @param [Hash] opts the optional parameters
1839
+ # @option opts [Integer] :offset Offsets the returned list by the given number of orders. The returned orders are ordered (and offsetted) by their creation date (DESC).
1840
+ # @option opts [String] :campaign_id Only return results with a matching campaign_id.
1841
+ # @option opts [String] :external_id Only return results with a matching external_id.
1842
+ # @option opts [String] :created_at_gte Only return results where the created_at field is greater than or equal to the supplied value. The string needs to be an ISO 8601 datetime.
1843
+ # @option opts [String] :created_at_lte Only return results where the created_at field is less than or equal to the supplied value. The string needs to be an ISO 8601 datetime.
1844
+ # @option opts [Integer] :limit Limits the number of orders listed. The maximum value is 100 and the default is 10.
1845
+ # @return [ListOrders200Response]
1846
+ def list_orders(opts = {})
1847
+ data, _status_code, _headers = list_orders_with_http_info(opts)
1848
+ data
1849
+ end
1850
+
1851
+ # List orders
1852
+ # Retrieve a list of orders
1853
+ # @param [Hash] opts the optional parameters
1854
+ # @option opts [Integer] :offset Offsets the returned list by the given number of orders. The returned orders are ordered (and offsetted) by their creation date (DESC).
1855
+ # @option opts [String] :campaign_id Only return results with a matching campaign_id.
1856
+ # @option opts [String] :external_id Only return results with a matching external_id.
1857
+ # @option opts [String] :created_at_gte Only return results where the created_at field is greater than or equal to the supplied value. The string needs to be an ISO 8601 datetime.
1858
+ # @option opts [String] :created_at_lte Only return results where the created_at field is less than or equal to the supplied value. The string needs to be an ISO 8601 datetime.
1859
+ # @option opts [Integer] :limit Limits the number of orders listed. The maximum value is 100 and the default is 10.
1860
+ # @return [Array<(ListOrders200Response, Integer, Hash)>] ListOrders200Response data, response status code and response headers
1861
+ def list_orders_with_http_info(opts = {})
1862
+ if @api_client.config.debugging
1863
+ @api_client.config.logger.debug 'Calling API: TremendousApi.list_orders ...'
1864
+ end
1865
+ # resource path
1866
+ local_var_path = '/orders'
1867
+
1868
+ # query parameters
1869
+ query_params = opts[:query_params] || {}
1870
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
1871
+ query_params[:'campaign_id'] = opts[:'campaign_id'] if !opts[:'campaign_id'].nil?
1872
+ query_params[:'external_id'] = opts[:'external_id'] if !opts[:'external_id'].nil?
1873
+ query_params[:'created_at[gte]'] = opts[:'created_at_gte'] if !opts[:'created_at_gte'].nil?
1874
+ query_params[:'created_at[lte]'] = opts[:'created_at_lte'] if !opts[:'created_at_lte'].nil?
1875
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
1876
+
1877
+ # header parameters
1878
+ header_params = opts[:header_params] || {}
1879
+ # HTTP header 'Accept' (if needed)
1880
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1881
+
1882
+ # form parameters
1883
+ form_params = opts[:form_params] || {}
1884
+
1885
+ # http body (model)
1886
+ post_body = opts[:debug_body]
1887
+
1888
+ # return_type
1889
+ return_type = opts[:debug_return_type] || 'ListOrders200Response'
1890
+
1891
+ # auth_names
1892
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
1893
+
1894
+ new_options = opts.merge(
1895
+ :operation => :"TremendousApi.list_orders",
1896
+ :header_params => header_params,
1897
+ :query_params => query_params,
1898
+ :form_params => form_params,
1899
+ :body => post_body,
1900
+ :auth_names => auth_names,
1901
+ :return_type => return_type
1902
+ )
1903
+
1904
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1905
+ if @api_client.config.debugging
1906
+ @api_client.config.logger.debug "API called: TremendousApi#list_orders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1907
+ end
1908
+ return data, status_code, headers
1909
+ end
1910
+
1911
+ # List organizations
1912
+ # The returned list only includes the organization to which the API key belongs to, that is used for the request.
1913
+ # @param [Hash] opts the optional parameters
1914
+ # @return [ListOrganizations200Response]
1915
+ def list_organizations(opts = {})
1916
+ data, _status_code, _headers = list_organizations_with_http_info(opts)
1917
+ data
1918
+ end
1919
+
1920
+ # List organizations
1921
+ # The returned list only includes the organization to which the API key belongs to, that is used for the request.
1922
+ # @param [Hash] opts the optional parameters
1923
+ # @return [Array<(ListOrganizations200Response, Integer, Hash)>] ListOrganizations200Response data, response status code and response headers
1924
+ def list_organizations_with_http_info(opts = {})
1925
+ if @api_client.config.debugging
1926
+ @api_client.config.logger.debug 'Calling API: TremendousApi.list_organizations ...'
1927
+ end
1928
+ # resource path
1929
+ local_var_path = '/organizations'
1930
+
1931
+ # query parameters
1932
+ query_params = opts[:query_params] || {}
1933
+
1934
+ # header parameters
1935
+ header_params = opts[:header_params] || {}
1936
+ # HTTP header 'Accept' (if needed)
1937
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1938
+
1939
+ # form parameters
1940
+ form_params = opts[:form_params] || {}
1941
+
1942
+ # http body (model)
1943
+ post_body = opts[:debug_body]
1944
+
1945
+ # return_type
1946
+ return_type = opts[:debug_return_type] || 'ListOrganizations200Response'
1947
+
1948
+ # auth_names
1949
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
1950
+
1951
+ new_options = opts.merge(
1952
+ :operation => :"TremendousApi.list_organizations",
1953
+ :header_params => header_params,
1954
+ :query_params => query_params,
1955
+ :form_params => form_params,
1956
+ :body => post_body,
1957
+ :auth_names => auth_names,
1958
+ :return_type => return_type
1959
+ )
1960
+
1961
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1962
+ if @api_client.config.debugging
1963
+ @api_client.config.logger.debug "API called: TremendousApi#list_organizations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1964
+ end
1965
+ return data, status_code, headers
1966
+ end
1967
+
1968
+ # List products
1969
+ # Retrieve a list of available products
1970
+ # @param [Hash] opts the optional parameters
1971
+ # @option opts [String] :country Comma-separated list of [Alpha-2 country codes](https://www.iban.com/country-codes), used to only retrieve products available in the provided countries
1972
+ # @option opts [String] :currency Comma-separated list of [currency codes](https://www.iban.com/currency-codes), used to only retrieve products available in the provided currencies
1973
+ # @return [ListProductsResponse]
1974
+ def list_products(opts = {})
1975
+ data, _status_code, _headers = list_products_with_http_info(opts)
1976
+ data
1977
+ end
1978
+
1979
+ # List products
1980
+ # Retrieve a list of available products
1981
+ # @param [Hash] opts the optional parameters
1982
+ # @option opts [String] :country Comma-separated list of [Alpha-2 country codes](https://www.iban.com/country-codes), used to only retrieve products available in the provided countries
1983
+ # @option opts [String] :currency Comma-separated list of [currency codes](https://www.iban.com/currency-codes), used to only retrieve products available in the provided currencies
1984
+ # @return [Array<(ListProductsResponse, Integer, Hash)>] ListProductsResponse data, response status code and response headers
1985
+ def list_products_with_http_info(opts = {})
1986
+ if @api_client.config.debugging
1987
+ @api_client.config.logger.debug 'Calling API: TremendousApi.list_products ...'
1988
+ end
1989
+ # resource path
1990
+ local_var_path = '/products'
1991
+
1992
+ # query parameters
1993
+ query_params = opts[:query_params] || {}
1994
+ query_params[:'country'] = opts[:'country'] if !opts[:'country'].nil?
1995
+ query_params[:'currency'] = opts[:'currency'] if !opts[:'currency'].nil?
1996
+
1997
+ # header parameters
1998
+ header_params = opts[:header_params] || {}
1999
+ # HTTP header 'Accept' (if needed)
2000
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
2001
+
2002
+ # form parameters
2003
+ form_params = opts[:form_params] || {}
2004
+
2005
+ # http body (model)
2006
+ post_body = opts[:debug_body]
2007
+
2008
+ # return_type
2009
+ return_type = opts[:debug_return_type] || 'ListProductsResponse'
2010
+
2011
+ # auth_names
2012
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
2013
+
2014
+ new_options = opts.merge(
2015
+ :operation => :"TremendousApi.list_products",
2016
+ :header_params => header_params,
2017
+ :query_params => query_params,
2018
+ :form_params => form_params,
2019
+ :body => post_body,
2020
+ :auth_names => auth_names,
2021
+ :return_type => return_type
2022
+ )
2023
+
2024
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2025
+ if @api_client.config.debugging
2026
+ @api_client.config.logger.debug "API called: TremendousApi#list_products\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2027
+ end
2028
+ return data, status_code, headers
2029
+ end
2030
+
2031
+ # List rewards
2032
+ # Retrieve a list of all created rewards
2033
+ # @param [Hash] opts the optional parameters
2034
+ # @option opts [Integer] :offset Offsets the returned list by the given number of rewards. The returned rewards are ordered (and offsetted) by their creation date (DESC).
2035
+ # @return [ListRewards200Response]
2036
+ def list_rewards(opts = {})
2037
+ data, _status_code, _headers = list_rewards_with_http_info(opts)
2038
+ data
2039
+ end
2040
+
2041
+ # List rewards
2042
+ # Retrieve a list of all created rewards
2043
+ # @param [Hash] opts the optional parameters
2044
+ # @option opts [Integer] :offset Offsets the returned list by the given number of rewards. The returned rewards are ordered (and offsetted) by their creation date (DESC).
2045
+ # @return [Array<(ListRewards200Response, Integer, Hash)>] ListRewards200Response data, response status code and response headers
2046
+ def list_rewards_with_http_info(opts = {})
2047
+ if @api_client.config.debugging
2048
+ @api_client.config.logger.debug 'Calling API: TremendousApi.list_rewards ...'
2049
+ end
2050
+ # resource path
2051
+ local_var_path = '/rewards'
2052
+
2053
+ # query parameters
2054
+ query_params = opts[:query_params] || {}
2055
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
2056
+
2057
+ # header parameters
2058
+ header_params = opts[:header_params] || {}
2059
+ # HTTP header 'Accept' (if needed)
2060
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
2061
+
2062
+ # form parameters
2063
+ form_params = opts[:form_params] || {}
2064
+
2065
+ # http body (model)
2066
+ post_body = opts[:debug_body]
2067
+
2068
+ # return_type
2069
+ return_type = opts[:debug_return_type] || 'ListRewards200Response'
2070
+
2071
+ # auth_names
2072
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
2073
+
2074
+ new_options = opts.merge(
2075
+ :operation => :"TremendousApi.list_rewards",
2076
+ :header_params => header_params,
2077
+ :query_params => query_params,
2078
+ :form_params => form_params,
2079
+ :body => post_body,
2080
+ :auth_names => auth_names,
2081
+ :return_type => return_type
2082
+ )
2083
+
2084
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2085
+ if @api_client.config.debugging
2086
+ @api_client.config.logger.debug "API called: TremendousApi#list_rewards\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2087
+ end
2088
+ return data, status_code, headers
2089
+ end
2090
+
2091
+ # List events
2092
+ # 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
+ # @param id [String] ID of the webhook to list the events for
2094
+ # @param [Hash] opts the optional parameters
2095
+ # @return [ListWebhookEvents200Response]
2096
+ def list_webhook_events(id, opts = {})
2097
+ data, _status_code, _headers = list_webhook_events_with_http_info(id, opts)
2098
+ data
2099
+ end
2100
+
2101
+ # List events
2102
+ # Lists all event types that can be sent to the configured webhook endpoint. &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)
2103
+ # @param id [String] ID of the webhook to list the events for
2104
+ # @param [Hash] opts the optional parameters
2105
+ # @return [Array<(ListWebhookEvents200Response, Integer, Hash)>] ListWebhookEvents200Response data, response status code and response headers
2106
+ def list_webhook_events_with_http_info(id, opts = {})
2107
+ if @api_client.config.debugging
2108
+ @api_client.config.logger.debug 'Calling API: TremendousApi.list_webhook_events ...'
2109
+ end
2110
+ # verify the required parameter 'id' is set
2111
+ if @api_client.config.client_side_validation && id.nil?
2112
+ fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.list_webhook_events"
2113
+ end
2114
+ pattern = Regexp.new(/[A-Z0-9]{4,20}/)
2115
+ if @api_client.config.client_side_validation && id !~ pattern
2116
+ fail ArgumentError, "invalid value for 'id' when calling TremendousApi.list_webhook_events, must conform to the pattern #{pattern}."
2117
+ end
2118
+
2119
+ # resource path
2120
+ local_var_path = '/webhooks/{id}/events'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
2121
+
2122
+ # query parameters
2123
+ query_params = opts[:query_params] || {}
2124
+
2125
+ # header parameters
2126
+ header_params = opts[:header_params] || {}
2127
+ # HTTP header 'Accept' (if needed)
2128
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
2129
+
2130
+ # form parameters
2131
+ form_params = opts[:form_params] || {}
2132
+
2133
+ # http body (model)
2134
+ post_body = opts[:debug_body]
2135
+
2136
+ # return_type
2137
+ return_type = opts[:debug_return_type] || 'ListWebhookEvents200Response'
2138
+
2139
+ # auth_names
2140
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
2141
+
2142
+ new_options = opts.merge(
2143
+ :operation => :"TremendousApi.list_webhook_events",
2144
+ :header_params => header_params,
2145
+ :query_params => query_params,
2146
+ :form_params => form_params,
2147
+ :body => post_body,
2148
+ :auth_names => auth_names,
2149
+ :return_type => return_type
2150
+ )
2151
+
2152
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2153
+ if @api_client.config.debugging
2154
+ @api_client.config.logger.debug "API called: TremendousApi#list_webhook_events\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2155
+ end
2156
+ return data, status_code, headers
2157
+ end
2158
+
2159
+ # List webhooks
2160
+ # Every organization can only have one webhook. This endpoint shows the details about that webhook. > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > [Read it here](/docs/webhooks-1)
2161
+ # @param [Hash] opts the optional parameters
2162
+ # @return [ListWebhooks200Response]
2163
+ def list_webhooks(opts = {})
2164
+ data, _status_code, _headers = list_webhooks_with_http_info(opts)
2165
+ data
2166
+ end
2167
+
2168
+ # List webhooks
2169
+ # Every organization can only have one webhook. This endpoint shows the details about that webhook. &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)
2170
+ # @param [Hash] opts the optional parameters
2171
+ # @return [Array<(ListWebhooks200Response, Integer, Hash)>] ListWebhooks200Response data, response status code and response headers
2172
+ def list_webhooks_with_http_info(opts = {})
2173
+ if @api_client.config.debugging
2174
+ @api_client.config.logger.debug 'Calling API: TremendousApi.list_webhooks ...'
2175
+ end
2176
+ # resource path
2177
+ local_var_path = '/webhooks'
2178
+
2179
+ # query parameters
2180
+ query_params = opts[:query_params] || {}
2181
+
2182
+ # header parameters
2183
+ header_params = opts[:header_params] || {}
2184
+ # HTTP header 'Accept' (if needed)
2185
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
2186
+
2187
+ # form parameters
2188
+ form_params = opts[:form_params] || {}
2189
+
2190
+ # http body (model)
2191
+ post_body = opts[:debug_body]
2192
+
2193
+ # return_type
2194
+ return_type = opts[:debug_return_type] || 'ListWebhooks200Response'
2195
+
2196
+ # auth_names
2197
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
2198
+
2199
+ new_options = opts.merge(
2200
+ :operation => :"TremendousApi.list_webhooks",
2201
+ :header_params => header_params,
2202
+ :query_params => query_params,
2203
+ :form_params => form_params,
2204
+ :body => post_body,
2205
+ :auth_names => auth_names,
2206
+ :return_type => return_type
2207
+ )
2208
+
2209
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2210
+ if @api_client.config.debugging
2211
+ @api_client.config.logger.debug "API called: TremendousApi#list_webhooks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2212
+ end
2213
+ return data, status_code, headers
2214
+ end
2215
+
2216
+ # Reject order
2217
+ # 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
+ # @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
+ # @param [Hash] opts the optional parameters
2220
+ # @return [CreateOrder201Response]
2221
+ def reject_order(id, opts = {})
2222
+ data, _status_code, _headers = reject_order_with_http_info(id, opts)
2223
+ data
2224
+ end
2225
+
2226
+ # Reject order
2227
+ # 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
+ # @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
+ # @param [Hash] opts the optional parameters
2230
+ # @return [Array<(CreateOrder201Response, Integer, Hash)>] CreateOrder201Response data, response status code and response headers
2231
+ def reject_order_with_http_info(id, opts = {})
2232
+ if @api_client.config.debugging
2233
+ @api_client.config.logger.debug 'Calling API: TremendousApi.reject_order ...'
2234
+ end
2235
+ # verify the required parameter 'id' is set
2236
+ if @api_client.config.client_side_validation && id.nil?
2237
+ fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.reject_order"
2238
+ end
2239
+ pattern = Regexp.new(/[A-Z0-9]{4,20}/)
2240
+ if @api_client.config.client_side_validation && id !~ pattern
2241
+ fail ArgumentError, "invalid value for 'id' when calling TremendousApi.reject_order, must conform to the pattern #{pattern}."
2242
+ end
2243
+
2244
+ # resource path
2245
+ local_var_path = '/order_approvals/{id}/reject'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
2246
+
2247
+ # query parameters
2248
+ query_params = opts[:query_params] || {}
2249
+
2250
+ # header parameters
2251
+ header_params = opts[:header_params] || {}
2252
+ # HTTP header 'Accept' (if needed)
2253
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
2254
+
2255
+ # form parameters
2256
+ form_params = opts[:form_params] || {}
2257
+
2258
+ # http body (model)
2259
+ post_body = opts[:debug_body]
2260
+
2261
+ # return_type
2262
+ return_type = opts[:debug_return_type] || 'CreateOrder201Response'
2263
+
2264
+ # auth_names
2265
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
2266
+
2267
+ new_options = opts.merge(
2268
+ :operation => :"TremendousApi.reject_order",
2269
+ :header_params => header_params,
2270
+ :query_params => query_params,
2271
+ :form_params => form_params,
2272
+ :body => post_body,
2273
+ :auth_names => auth_names,
2274
+ :return_type => return_type
2275
+ )
2276
+
2277
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
2278
+ if @api_client.config.debugging
2279
+ @api_client.config.logger.debug "API called: TremendousApi#reject_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2280
+ end
2281
+ return data, status_code, headers
2282
+ end
2283
+
2284
+ # Resend reward
2285
+ # Resends a reward, identified by the given `id` in the URL, to its recipient.
2286
+ # @param id [String] ID of the reward that should be resent
2287
+ # @param [Hash] opts the optional parameters
2288
+ # @return [Object]
2289
+ def resend_reward(id, opts = {})
2290
+ data, _status_code, _headers = resend_reward_with_http_info(id, opts)
2291
+ data
2292
+ end
2293
+
2294
+ # Resend reward
2295
+ # Resends a reward, identified by the given &#x60;id&#x60; in the URL, to its recipient.
2296
+ # @param id [String] ID of the reward that should be resent
2297
+ # @param [Hash] opts the optional parameters
2298
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
2299
+ def resend_reward_with_http_info(id, opts = {})
2300
+ if @api_client.config.debugging
2301
+ @api_client.config.logger.debug 'Calling API: TremendousApi.resend_reward ...'
2302
+ end
2303
+ # verify the required parameter 'id' is set
2304
+ if @api_client.config.client_side_validation && id.nil?
2305
+ fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.resend_reward"
2306
+ end
2307
+ pattern = Regexp.new(/[A-Z0-9]{4,20}/)
2308
+ if @api_client.config.client_side_validation && id !~ pattern
2309
+ fail ArgumentError, "invalid value for 'id' when calling TremendousApi.resend_reward, must conform to the pattern #{pattern}."
2310
+ end
2311
+
2312
+ # resource path
2313
+ local_var_path = '/rewards/{id}/resend'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
2314
+
2315
+ # query parameters
2316
+ query_params = opts[:query_params] || {}
2317
+
2318
+ # header parameters
2319
+ header_params = opts[:header_params] || {}
2320
+ # HTTP header 'Accept' (if needed)
2321
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
2322
+
2323
+ # form parameters
2324
+ form_params = opts[:form_params] || {}
2325
+
2326
+ # http body (model)
2327
+ post_body = opts[:debug_body]
2328
+
2329
+ # return_type
2330
+ return_type = opts[:debug_return_type] || 'Object'
2331
+
2332
+ # auth_names
2333
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
2334
+
2335
+ new_options = opts.merge(
2336
+ :operation => :"TremendousApi.resend_reward",
2337
+ :header_params => header_params,
2338
+ :query_params => query_params,
2339
+ :form_params => form_params,
2340
+ :body => post_body,
2341
+ :auth_names => auth_names,
2342
+ :return_type => return_type
2343
+ )
2344
+
2345
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
2346
+ if @api_client.config.debugging
2347
+ @api_client.config.logger.debug "API called: TremendousApi#resend_reward\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2348
+ end
2349
+ return data, status_code, headers
2350
+ end
2351
+
2352
+ # Test webhook
2353
+ # Making a request to this endpoint will cause our system to trigger a webhook for the specified event. This can be very useful when testing the setup that processes webhooks on your end. > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > [Read it here](/docs/webhooks-1)
2354
+ # @param id [String] ID of the webhook to test
2355
+ # @param simulate_webhook_request [SimulateWebhookRequest] Webhook details
2356
+ # @param [Hash] opts the optional parameters
2357
+ # @return [String]
2358
+ def simulate_webhook(id, simulate_webhook_request, opts = {})
2359
+ data, _status_code, _headers = simulate_webhook_with_http_info(id, simulate_webhook_request, opts)
2360
+ data
2361
+ end
2362
+
2363
+ # Test webhook
2364
+ # Making a request to this endpoint will cause our system to trigger a webhook for the specified event. This can be very useful when testing the setup that processes webhooks on your end. &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)
2365
+ # @param id [String] ID of the webhook to test
2366
+ # @param simulate_webhook_request [SimulateWebhookRequest] Webhook details
2367
+ # @param [Hash] opts the optional parameters
2368
+ # @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
2369
+ def simulate_webhook_with_http_info(id, simulate_webhook_request, opts = {})
2370
+ if @api_client.config.debugging
2371
+ @api_client.config.logger.debug 'Calling API: TremendousApi.simulate_webhook ...'
2372
+ end
2373
+ # verify the required parameter 'id' is set
2374
+ if @api_client.config.client_side_validation && id.nil?
2375
+ fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.simulate_webhook"
2376
+ end
2377
+ pattern = Regexp.new(/[A-Z0-9]{4,20}/)
2378
+ if @api_client.config.client_side_validation && id !~ pattern
2379
+ fail ArgumentError, "invalid value for 'id' when calling TremendousApi.simulate_webhook, must conform to the pattern #{pattern}."
2380
+ end
2381
+
2382
+ # verify the required parameter 'simulate_webhook_request' is set
2383
+ if @api_client.config.client_side_validation && simulate_webhook_request.nil?
2384
+ fail ArgumentError, "Missing the required parameter 'simulate_webhook_request' when calling TremendousApi.simulate_webhook"
2385
+ end
2386
+ # resource path
2387
+ local_var_path = '/webhooks/{id}/simulate'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
2388
+
2389
+ # query parameters
2390
+ query_params = opts[:query_params] || {}
2391
+
2392
+ # header parameters
2393
+ header_params = opts[:header_params] || {}
2394
+ # HTTP header 'Accept' (if needed)
2395
+ header_params['Accept'] = @api_client.select_header_accept(['text/html', 'application/json'])
2396
+ # HTTP header 'Content-Type'
2397
+ content_type = @api_client.select_header_content_type(['application/json'])
2398
+ if !content_type.nil?
2399
+ header_params['Content-Type'] = content_type
2400
+ end
2401
+
2402
+ # form parameters
2403
+ form_params = opts[:form_params] || {}
2404
+
2405
+ # http body (model)
2406
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(simulate_webhook_request)
2407
+
2408
+ # return_type
2409
+ return_type = opts[:debug_return_type] || 'String'
2410
+
2411
+ # auth_names
2412
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
2413
+
2414
+ new_options = opts.merge(
2415
+ :operation => :"TremendousApi.simulate_webhook",
2416
+ :header_params => header_params,
2417
+ :query_params => query_params,
2418
+ :form_params => form_params,
2419
+ :body => post_body,
2420
+ :auth_names => auth_names,
2421
+ :return_type => return_type
2422
+ )
2423
+
2424
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
2425
+ if @api_client.config.debugging
2426
+ @api_client.config.logger.debug "API called: TremendousApi#simulate_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2427
+ end
2428
+ return data, status_code, headers
2429
+ end
2430
+
2431
+ # Update campaign
2432
+ # @param id [String] ID of the campaign that should be updated
2433
+ # @param create_campaign_request [CreateCampaignRequest] Campaign details
2434
+ # @param [Hash] opts the optional parameters
2435
+ # @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)
2438
+ data
2439
+ end
2440
+
2441
+ # Update campaign
2442
+ # @param id [String] ID of the campaign that should be updated
2443
+ # @param create_campaign_request [CreateCampaignRequest] Campaign details
2444
+ # @param [Hash] opts the optional parameters
2445
+ # @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 = {})
2447
+ if @api_client.config.debugging
2448
+ @api_client.config.logger.debug 'Calling API: TremendousApi.update_campaign ...'
2449
+ end
2450
+ # verify the required parameter 'id' is set
2451
+ if @api_client.config.client_side_validation && id.nil?
2452
+ fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.update_campaign"
2453
+ end
2454
+ pattern = Regexp.new(/[A-Z0-9]{4,20}/)
2455
+ if @api_client.config.client_side_validation && id !~ pattern
2456
+ fail ArgumentError, "invalid value for 'id' when calling TremendousApi.update_campaign, must conform to the pattern #{pattern}."
2457
+ end
2458
+
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"
2462
+ end
2463
+ # resource path
2464
+ local_var_path = '/campaigns/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
2465
+
2466
+ # query parameters
2467
+ query_params = opts[:query_params] || {}
2468
+
2469
+ # header parameters
2470
+ header_params = opts[:header_params] || {}
2471
+ # HTTP header 'Accept' (if needed)
2472
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
2473
+ # HTTP header 'Content-Type'
2474
+ content_type = @api_client.select_header_content_type(['application/json'])
2475
+ if !content_type.nil?
2476
+ header_params['Content-Type'] = content_type
2477
+ end
2478
+
2479
+ # form parameters
2480
+ form_params = opts[:form_params] || {}
2481
+
2482
+ # http body (model)
2483
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_campaign_request)
2484
+
2485
+ # return_type
2486
+ return_type = opts[:debug_return_type] || 'CreateCampaign201Response'
2487
+
2488
+ # auth_names
2489
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
2490
+
2491
+ new_options = opts.merge(
2492
+ :operation => :"TremendousApi.update_campaign",
2493
+ :header_params => header_params,
2494
+ :query_params => query_params,
2495
+ :form_params => form_params,
2496
+ :body => post_body,
2497
+ :auth_names => auth_names,
2498
+ :return_type => return_type
2499
+ )
2500
+
2501
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
2502
+ if @api_client.config.debugging
2503
+ @api_client.config.logger.debug "API called: TremendousApi#update_campaign\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2504
+ end
2505
+ return data, status_code, headers
2506
+ end
2507
+ end
2508
+ end