tremendous_ruby 5.0.0 → 5.0.1

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