Class: Tremendous::TremendousApi

Inherits:
Object
  • Object
show all
Defined in:
lib/tremendous/api/tremendous_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ TremendousApi

Returns a new instance of TremendousApi.



19
20
21
# File 'lib/tremendous/api/tremendous_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/tremendous/api/tremendous_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#approve_order(id, opts = {}) ⇒ GetOrder200Response

Approve order 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.

Parameters:

  • 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.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



27
28
29
30
# File 'lib/tremendous/api/tremendous_api.rb', line 27

def approve_order(id, opts = {})
  data, _status_code, _headers = approve_order_with_http_info(id, opts)
  data
end

#approve_order_with_http_info(id, opts = {}) ⇒ Array<(GetOrder200Response, Integer, Hash)>

Approve order 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.

Parameters:

  • 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.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(GetOrder200Response, Integer, Hash)>)

    GetOrder200Response data, response status code and response headers



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/tremendous/api/tremendous_api.rb', line 37

def approve_order_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.approve_order ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.approve_order"
  end
  pattern = Regexp.new(/[A-Z0-9]{4,20}/)
  if @api_client.config.client_side_validation && id !~ pattern
    fail ArgumentError, "invalid value for 'id' when calling TremendousApi.approve_order, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/order_approvals/{id}/approve'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetOrder200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.approve_order",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#approve_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#block_fraud_review(id, opts = {}) ⇒ GetFraudReview200Response

Block fraud review Completes the fraud review identified by the given id in the URL, and blocks the reward. The reward is canceled and the amount refunded.

Parameters:

  • id (String)

    The ID of the reward that should be blocked.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



95
96
97
98
# File 'lib/tremendous/api/tremendous_api.rb', line 95

def block_fraud_review(id, opts = {})
  data, _status_code, _headers = block_fraud_review_with_http_info(id, opts)
  data
end

#block_fraud_review_with_http_info(id, opts = {}) ⇒ Array<(GetFraudReview200Response, Integer, Hash)>

Block fraud review Completes the fraud review identified by the given `id` in the URL, and blocks the reward. The reward is canceled and the amount refunded.

Parameters:

  • id (String)

    The ID of the reward that should be blocked.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(GetFraudReview200Response, Integer, Hash)>)

    GetFraudReview200Response data, response status code and response headers



105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/tremendous/api/tremendous_api.rb', line 105

def block_fraud_review_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.block_fraud_review ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.block_fraud_review"
  end
  # resource path
  local_var_path = '/fraud_reviews/{id}/block'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetFraudReview200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.block_fraud_review",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#block_fraud_review\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#cancel_reward(id, opts = {}) ⇒ Object

Cancel reward Cancels a reward, identified by the given id in the URL. Only non-expired rewards with a delivery failure can be canceled. Rewards that have already been redeemed cannot be canceled: the request fails with a 422 error and the reward is left unchanged.

Parameters:

  • id (String)

    ID of the reward that should be canceled

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Object)


158
159
160
161
# File 'lib/tremendous/api/tremendous_api.rb', line 158

def cancel_reward(id, opts = {})
  data, _status_code, _headers = cancel_reward_with_http_info(id, opts)
  data
end

#cancel_reward_with_http_info(id, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Cancel reward Cancels a reward, identified by the given `id` in the URL. Only non-expired rewards with a delivery failure can be canceled. Rewards that have already been redeemed cannot be canceled: the request fails with a `422` error and the reward is left unchanged.

Parameters:

  • id (String)

    ID of the reward that should be canceled

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
# File 'lib/tremendous/api/tremendous_api.rb', line 168

def cancel_reward_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.cancel_reward ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.cancel_reward"
  end
  pattern = Regexp.new(/[A-Z0-9]{4,20}/)
  if @api_client.config.client_side_validation && id !~ pattern
    fail ArgumentError, "invalid value for 'id' when calling TremendousApi.cancel_reward, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/rewards/{id}/cancel'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.cancel_reward",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#cancel_reward\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_api_key(opts = {}) ⇒ CreateApiKey200Response

Create API key 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.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



226
227
228
229
# File 'lib/tremendous/api/tremendous_api.rb', line 226

def create_api_key(opts = {})
  data, _status_code, _headers = create_api_key_with_http_info(opts)
  data
end

#create_api_key_with_http_info(opts = {}) ⇒ Array<(CreateApiKey200Response, Integer, Hash)>

Create API key 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.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(CreateApiKey200Response, Integer, Hash)>)

    CreateApiKey200Response data, response status code and response headers



236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
# File 'lib/tremendous/api/tremendous_api.rb', line 236

def create_api_key_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.create_api_key ...'
  end
  # resource path
  local_var_path = '/organizations/create_api_key'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'create_api_key_request'])

  # return_type
  return_type = opts[:debug_return_type] || 'CreateApiKey200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.create_api_key",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#create_api_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_campaign(create_campaign_request, opts = {}) ⇒ CreateCampaign200Response

Create campaign

Parameters:

  • create_campaign_request (CreateCampaignRequest)

    Campaign details

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



289
290
291
292
# File 'lib/tremendous/api/tremendous_api.rb', line 289

def create_campaign(create_campaign_request, opts = {})
  data, _status_code, _headers = create_campaign_with_http_info(create_campaign_request, opts)
  data
end

#create_campaign_with_http_info(create_campaign_request, opts = {}) ⇒ Array<(CreateCampaign200Response, Integer, Hash)>

Create campaign

Parameters:

  • create_campaign_request (CreateCampaignRequest)

    Campaign details

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CreateCampaign200Response, Integer, Hash)>)

    CreateCampaign200Response data, response status code and response headers



298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
# File 'lib/tremendous/api/tremendous_api.rb', line 298

def create_campaign_with_http_info(create_campaign_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.create_campaign ...'
  end
  # verify the required parameter 'create_campaign_request' is set
  if @api_client.config.client_side_validation && create_campaign_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_campaign_request' when calling TremendousApi.create_campaign"
  end
  # resource path
  local_var_path = '/campaigns'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(create_campaign_request)

  # return_type
  return_type = opts[:debug_return_type] || 'CreateCampaign200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.create_campaign",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#create_campaign\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_connected_organization(create_connected_organization_request, opts = {}) ⇒ CreateConnectedOrganization200Response

Create connected organization Create a connected organization. Optionally pass currency_code to set the connected organization's balance currency. Supported values are USD, EUR, and GBP. If omitted, the balance currency defaults to USD. Optionally pass a kyb_prefill object to forward KYB (Know Your Business) details you have already collected for the end client. When provided, these values prefill the end client's onboarding form; the end client still reviews, edits where needed, and submits the form. Every kyb_prefill field is optional, but any value provided is validated. Malformed KYB details (for example an unsupported country_code or a malformed website_url) return a 400.

Parameters:

  • create_connected_organization_request (CreateConnectedOrganizationRequest)

    Connected organization to create

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



356
357
358
359
# File 'lib/tremendous/api/tremendous_api.rb', line 356

def create_connected_organization(create_connected_organization_request, opts = {})
  data, _status_code, _headers = create_connected_organization_with_http_info(create_connected_organization_request, opts)
  data
end

#create_connected_organization_member(create_connected_organization_member_request, opts = {}) ⇒ CreateConnectedOrganizationMember200Response

Create connected organization member Create a connected organization member.

Parameters:

Returns:



424
425
426
427
# File 'lib/tremendous/api/tremendous_api.rb', line 424

def create_connected_organization_member(create_connected_organization_member_request, opts = {})
  data, _status_code, _headers = create_connected_organization_member_with_http_info(create_connected_organization_member_request, opts)
  data
end

#create_connected_organization_member_session(id, create_connected_organization_member_session_request, opts = {}) ⇒ CreateConnectedOrganizationMemberSession200Response

Create connected organization member session Create a connected organization member session.

Parameters:

  • id (String)

    ID of the connected organization member.

  • create_connected_organization_member_session_request (CreateConnectedOrganizationMemberSessionRequest)

    Connected organization member requiring the session

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



493
494
495
496
# File 'lib/tremendous/api/tremendous_api.rb', line 493

def create_connected_organization_member_session(id, create_connected_organization_member_session_request, opts = {})
  data, _status_code, _headers = create_connected_organization_member_session_with_http_info(id, create_connected_organization_member_session_request, opts)
  data
end

#create_connected_organization_member_session_with_http_info(id, create_connected_organization_member_session_request, opts = {}) ⇒ Array<(CreateConnectedOrganizationMemberSession200Response, Integer, Hash)>

Create connected organization member session Create a connected organization member session.

Parameters:

  • id (String)

    ID of the connected organization member.

  • create_connected_organization_member_session_request (CreateConnectedOrganizationMemberSessionRequest)

    Connected organization member requiring the session

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
# File 'lib/tremendous/api/tremendous_api.rb', line 504

def create_connected_organization_member_session_with_http_info(id, create_connected_organization_member_session_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.create_connected_organization_member_session ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.create_connected_organization_member_session"
  end
  # verify the required parameter 'create_connected_organization_member_session_request' is set
  if @api_client.config.client_side_validation && create_connected_organization_member_session_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_connected_organization_member_session_request' when calling TremendousApi.create_connected_organization_member_session"
  end
  # resource path
  local_var_path = '/connected_organization_members/{id}/sessions'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(create_connected_organization_member_session_request)

  # return_type
  return_type = opts[:debug_return_type] || 'CreateConnectedOrganizationMemberSession200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.create_connected_organization_member_session",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#create_connected_organization_member_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_connected_organization_member_with_http_info(create_connected_organization_member_request, opts = {}) ⇒ Array<(CreateConnectedOrganizationMember200Response, Integer, Hash)>

Create connected organization member Create a connected organization member.

Parameters:

Returns:



434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
# File 'lib/tremendous/api/tremendous_api.rb', line 434

def create_connected_organization_member_with_http_info(create_connected_organization_member_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.create_connected_organization_member ...'
  end
  # verify the required parameter 'create_connected_organization_member_request' is set
  if @api_client.config.client_side_validation && create_connected_organization_member_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_connected_organization_member_request' when calling TremendousApi.create_connected_organization_member"
  end
  # resource path
  local_var_path = '/connected_organization_members'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(create_connected_organization_member_request)

  # return_type
  return_type = opts[:debug_return_type] || 'CreateConnectedOrganizationMember200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.create_connected_organization_member",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#create_connected_organization_member\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_connected_organization_with_http_info(create_connected_organization_request, opts = {}) ⇒ Array<(CreateConnectedOrganization200Response, Integer, Hash)>

Create connected organization Create a connected organization. Optionally pass `currency_code` to set the connected organization's balance currency. Supported values are `USD`, `EUR`, and `GBP`. If omitted, the balance currency defaults to `USD`. Optionally pass a `kyb_prefill` object to forward KYB (Know Your Business) details you have already collected for the end client. When provided, these values prefill the end client's onboarding form; the end client still reviews, edits where needed, and submits the form. Every `kyb_prefill` field is optional, but any value provided is validated. Malformed KYB details (for example an unsupported `country_code` or a malformed `website_url`) return a `400`.

Parameters:

  • create_connected_organization_request (CreateConnectedOrganizationRequest)

    Connected organization to create

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
# File 'lib/tremendous/api/tremendous_api.rb', line 366

def create_connected_organization_with_http_info(create_connected_organization_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.create_connected_organization ...'
  end
  # verify the required parameter 'create_connected_organization_request' is set
  if @api_client.config.client_side_validation && create_connected_organization_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_connected_organization_request' when calling TremendousApi.create_connected_organization"
  end
  # resource path
  local_var_path = '/connected_organizations'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(create_connected_organization_request)

  # return_type
  return_type = opts[:debug_return_type] || 'CreateConnectedOrganization200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.create_connected_organization",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#create_connected_organization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_field(create_field_request, opts = {}) ⇒ CreateField200Response

Create field Create a custom field to be associated with rewards. Custom fields can be used for reporting and analytics purposes.

Parameters:

  • create_field_request (CreateFieldRequest)

    Field details

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



566
567
568
569
# File 'lib/tremendous/api/tremendous_api.rb', line 566

def create_field(create_field_request, opts = {})
  data, _status_code, _headers = create_field_with_http_info(create_field_request, opts)
  data
end

#create_field_with_http_info(create_field_request, opts = {}) ⇒ Array<(CreateField200Response, Integer, Hash)>

Create field Create a custom field to be associated with rewards. Custom fields can be used for reporting and analytics purposes.

Parameters:

  • create_field_request (CreateFieldRequest)

    Field details

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CreateField200Response, Integer, Hash)>)

    CreateField200Response data, response status code and response headers



576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
# File 'lib/tremendous/api/tremendous_api.rb', line 576

def create_field_with_http_info(create_field_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.create_field ...'
  end
  # verify the required parameter 'create_field_request' is set
  if @api_client.config.client_side_validation && create_field_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_field_request' when calling TremendousApi.create_field"
  end
  # resource path
  local_var_path = '/fields'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(create_field_request)

  # return_type
  return_type = opts[:debug_return_type] || 'CreateField200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.create_field",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#create_field\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_invoice(create_invoice_request, opts = {}) ⇒ CreateInvoice200Response

Create invoice 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">

<tbody class="object-schema-table-body"> <tr class=""> <tr class=""> <tr class=""> <tr class=""> <tr class="">
Property Type Description
<div class="property-name"> <code class="property-name">po_number <span class="property-type">string

Reference to the purchase order number within your organization

<div class="property-name"> <code class="property-name">amount <span class="property-type">number <span class="property-format">double

Amount of the invoice

<div class="property-name"> <code class="property-name">currency_code <span class="property-type">string

Currency of the invoice. Defaults to the organization's currency if not provided.

<div class="property-name"> <code class="property-name">currency <span class="property-type">string

Deprecated: Use currency_code instead.

<div class="property-name"> <code class="property-name">memo <span class="property-type">string

A note to be included in the invoice. This is for your internal use and will not be visible to the recipient.

Parameters:

  • create_invoice_request (CreateInvoiceRequest)

    Invoice details

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



634
635
636
637
# File 'lib/tremendous/api/tremendous_api.rb', line 634

def create_invoice(create_invoice_request, opts = {})
  data, _status_code, _headers = create_invoice_with_http_info(create_invoice_request, opts)
  data
end

#create_invoice_with_http_info(create_invoice_request, opts = {}) ⇒ Array<(CreateInvoice200Response, Integer, Hash)>

Create invoice 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=&quot;object-schema-request-schema&quot;> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=&quot;object-schema-table-body&quot;> <tr class=&quot;&quot;><td><div class=&quot;property-name&quot;> <code class=&quot;property-name&quot;>po_number</code> </div> </td><td><span class=&quot;property-type&quot;>string</span></td><td><p>Reference to the purchase order number within your organization</p> </td></tr> <tr class=&quot;&quot;><td><div class=&quot;property-name&quot;> <code class=&quot;property-name&quot;>amount</code> </div> </td><td><span class=&quot;property-type&quot;>number</span> <span class=&quot;property-format&quot;>double</span></td><td><p>Amount of the invoice</p> </td></tr> <tr class=&quot;&quot;><td><div class=&quot;property-name&quot;> <code class=&quot;property-name&quot;>currency_code</code> </div> </td><td><span class=&quot;property-type&quot;>string</span></td><td><p>Currency of the invoice. Defaults to the organization&#39;s currency if not provided.</p> </td></tr> <tr class=&quot;&quot;><td><div class=&quot;property-name&quot;> <code class=&quot;property-name&quot;>currency</code> </div> </td><td><span class=&quot;property-type&quot;>string</span></td><td><p>Deprecated: Use <code>currency_code</code> instead.</p> </td></tr> <tr class=&quot;&quot;><td><div class=&quot;property-name&quot;> <code class=&quot;property-name&quot;>memo</code> </div> </td><td><span class=&quot;property-type&quot;>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>

Parameters:

  • create_invoice_request (CreateInvoiceRequest)

    Invoice details

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CreateInvoice200Response, Integer, Hash)>)

    CreateInvoice200Response data, response status code and response headers



644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
# File 'lib/tremendous/api/tremendous_api.rb', line 644

def create_invoice_with_http_info(create_invoice_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.create_invoice ...'
  end
  # verify the required parameter 'create_invoice_request' is set
  if @api_client.config.client_side_validation && create_invoice_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_invoice_request' when calling TremendousApi.create_invoice"
  end
  # resource path
  local_var_path = '/invoices'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(create_invoice_request)

  # return_type
  return_type = opts[:debug_return_type] || 'CreateInvoice200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.create_invoice",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#create_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_member(create_member_request, opts = {}) ⇒ CreateMember200Response

Create member Each organization has one or more users that can access and manage that organization. These users are called members. Members can take actions via the Tremendous web dashboard directly. These actions include adding funding sources to the organization, creating Campaigns, and more. ### Permissions Members can have a role that determine their permissions within the organization. Check the Roles API for the available roles. To create members of a sub-organizations create an API key for that organization 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.

Parameters:

  • create_member_request (CreateMemberRequest)

    Member details

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



702
703
704
705
# File 'lib/tremendous/api/tremendous_api.rb', line 702

def create_member(create_member_request, opts = {})
  data, _status_code, _headers = create_member_with_http_info(create_member_request, opts)
  data
end

#create_member_with_http_info(create_member_request, opts = {}) ⇒ Array<(CreateMember200Response, Integer, Hash)>

Create member Each organization has one or more users that can access and manage that organization. These users are called members. Members can take actions via the Tremendous web dashboard directly. These actions include adding funding sources to the organization, creating Campaigns, and more. ### Permissions Members can have a role that determine their permissions within the organization. Check the Roles API for the available roles. To create members of a sub-organizations create an API key for that organization 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.

Parameters:

  • create_member_request (CreateMemberRequest)

    Member details

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CreateMember200Response, Integer, Hash)>)

    CreateMember200Response data, response status code and response headers



712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
# File 'lib/tremendous/api/tremendous_api.rb', line 712

def create_member_with_http_info(create_member_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.create_member ...'
  end
  # verify the required parameter 'create_member_request' is set
  if @api_client.config.client_side_validation && create_member_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_member_request' when calling TremendousApi.create_member"
  end
  # resource path
  local_var_path = '/members'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(create_member_request)

  # return_type
  return_type = opts[:debug_return_type] || 'CreateMember200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.create_member",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#create_member\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_order(create_order_request, opts = {}) ⇒ CreateOrder200Response

Create order 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: > > <a style="display: block; margin-top: 20px;" href="/docs/sending-rewards-intro">Check it out! ## Request body <div class="object-schema-request-schema">

<tbody class="object-schema-table-body"> <tr class=""> <tr class=""> <td colspan="3">
Show object properties
Property Type Description
<div class="property-name"> <code class="property-name">external_id <span class="property-type">string

Reference for this order, supplied by the customer.

When set, external_id makes order idempotent. All requests that use the same external_id after the initial order creation, will result in a response that returns the data of the initially created order. The response will have a 201 response code. These responses fail to create any further orders.

It also allows for retrieving by external_id instead of id only.

<div class="property-name"> <code class="property-name">payment <span class="property-type">object
<tbody class="object-schema-table-body"> <tr class="">
Property Type Description
<div class="property-name"> <code class="property-name">funding_source_id <span class="property-type">string

Tremendous ID of the funding source that will be used to pay for the order.

You can also pass one of the following magic values (case-insensitive):

  • BALANCE — pay from your Tremendous balance.
  • INVOICE — pay from your commercial invoice account.
  • INVOICE_THEN_BALANCE — pay from your commercial invoice account if doing so wouldn't exceed your credit limit, otherwise fall back to your Tremendous balance. The balance must have sufficient funds to pay for the order.

Note: INVOICE and INVOICE_THEN_BALANCE are only available to select Enterprise clients with an existing commercial invoicing setup. If your organization already uses commercial invoicing and you have questions, contact your Customer Success Manager.

<tr class=""><div class="property-name"> <code class="property-name">reward
<span class="property-type">object

A single reward, sent to a recipient. A reward is always part of an order.

Either products or campaign_id must be specified.

<td colspan="3">
Show object properties <tbody class="object-schema-table-body"> <tr class="property-conditional-hint-response-only"> <tr class="property-conditional-hint-response-only"> <tr class="property-conditional-hint-response-only"> <tr class="property-conditional-hint-response-only"> <tr class="property-conditional-hint-request-only"> <tr class="property-conditional-hint-request-only"> <tr class=""> <td colspan="3">
Show object properties
Property Type Description
<div class="property-name"> <code class="property-name">id <span class="property-type">string

Tremendous ID of the reward

<div class="property-name"> <code class="property-name">order_id <span class="property-type">string

Tremendous ID of the order this reward is part of.

<div class="property-name"> <code class="property-name">created_at <span class="property-type">string <span class="property-format">date-time

Date the reward was created

<div class="property-name"> <code class="property-name">expires_at <span class="property-type">string <span class="property-format">date-time

Expiration date of the reward. If null, the reward does not expire.

<div class="property-name"> <code class="property-name">campaign_id <span class="property-type">string

ID of the campaign in your account, that defines the available products (different gift cards, charity, etc.) that the recipient can choose from.

<div class="property-name"> <code class="property-name">products <span class="property-type">array <span class="property-format">string

List of IDs of product (different gift cards, charity, etc.) that will be available to the recipient to choose from.

Providing a products array will override the products made available by the campaign specified using the campaign_id property unless the products array is empty. It will not override other campaign attributes, like the message and customization of the look and feel.

<div class="property-name"> <code class="property-name">value <span class="property-type">object
<tbody class="object-schema-table-body"> <tr class=""> <tr class="">
Property Type Description
<div class="property-name"> <code class="property-name">denomination <span class="property-type">number <span class="property-format">double

Amount of the reward

<div class="property-name"> <code class="property-name">currency_code <span class="property-type">string

Currency of the reward. Defaults to the organization's currency if not provided.

<tr class=""><div class="property-name"> <code class="property-name">recipient
<span class="property-type">object

Details of the recipient of the reward

<td colspan="3">
Show object properties <tbody class="object-schema-table-body"> <tr class=""> <tr class=""> <tr class="">
Property Type Description
<div class="property-name"> <code class="property-name">name <span class="property-type">string

Name of the recipient

<div class="property-name"> <code class="property-name">email <span class="property-type">string

Email address of the recipient

<div class="property-name"> <code class="property-name">phone <span class="property-type">string

Phone number of the recipient. For non-US phone numbers, specify the country code (prefixed with +).

<tr class=""><div class="property-name"> <code class="property-name">deliver_at
<span class="property-type">string <span class="property-format">date

Timestamp of reward delivery within the next year. Note that if date-time is provided, the time values will be ignored.

<tr class=""><div class="property-name"> <code class="property-name">custom_fields
<span class="property-type">array <td colspan="3">
Show array item type <tbody class="object-schema-table-body"> <tr class=""> <tr class=""> <tr class="property-conditional-hint-response-only">
Property Type Description
<div class="property-name"> <code class="property-name">id <span class="property-type">string

Tremendous ID of the custom field

<div class="property-name"> <code class="property-name">value <span class="property-type">string

Value of the custom field

<div class="property-name"> <code class="property-name">label <span class="property-type">string

Label of the custom field

<tr class=""><div class="property-name"> <code class="property-name">language
<span class="property-type">string

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"&gt;ISO-639-1 code for the desired language. Defaults to en.

<tr class=""><div class="property-name"> <code class="property-name">delivery <span class="property-type">object

Details on how the reward is delivered to the recipient.

<td colspan="3">
Show object properties <tbody class="object-schema-table-body"> <tr class=""> <tr class=""> <td colspan="3">
Show object properties
Property Type Description
<div class="property-name"> <code class="property-name">method <span class="property-type">string

How to deliver the reward to the recipient.

Delivery Method Description
EMAIL Deliver the reward to the recipient by email
LINK

Deliver the reward to the recipient via a link.

The initial POST /orders response for a link reward includes the link in delivery.link.

The link must then be delivered to the recipient out-of-band.

To obtain a new link for an existing reward, call POST /rewards/{id}/generate_link.

PHONE Deliver the reward to the recipient by SMS
<div class="property-name"> <code class="property-name">meta <span class="property-type">object

Customizable reward delivery metadata, taking precedence over the related campaign settings.

<tbody class="object-schema-table-body"> <tr class=""> <tr class=""> <tr class="">
Property Type Description
<div class="property-name"> <code class="property-name">sender_name <span class="property-type">string

The "sender name" used in the delivery. If it's an email reward, "via Tremendous" will be appended to the value. Please note that you cannot customize the sender email.

<div class="property-name"> <code class="property-name">subject_line <span class="property-type">string

The subject line used in the delivery.

<div class="property-name"> <code class="property-name">message <span class="property-type">string

The content of the message of the reward, shown in the email / SMS and on the landing page.

### 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. The Tremendous API sandbox environment comes with a single funding source that allows you to spend up to $100,000 in fake money to test the API. Learn more about the sandbox environment. 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 not create a new order. If the payload is the same as a previously issued order, our API will return a 201 response code, along with a representation of the already-existing order in the response body. If the external_id used is for an order with different parameters (e.g. amount, recipient), our API will return a 409 response code, indicating a conflicting resource.

Parameters:

Returns:



770
771
772
773
# File 'lib/tremendous/api/tremendous_api.rb', line 770

def create_order(create_order_request, opts = {})
  data, _status_code, _headers = create_order_with_http_info(create_order_request, opts)
  data
end

#create_order_with_http_info(create_order_request, opts = {}) ⇒ Array<(CreateOrder200Response, Integer, Hash)>

Create order 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=&quot;display: block; margin-top: 20px;&quot; href=&quot;/docs/sending-rewards-intro&quot;>Check it out!</a></strong> ## Request body <div class=&quot;object-schema-request-schema&quot;> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=&quot;object-schema-table-body&quot;> <tr class=&quot;&quot;><td><div class=&quot;property-name&quot;> <code class=&quot;property-name&quot;>external_id</code> </div> </td><td><span class=&quot;property-type&quot;>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=&quot;&quot;><td><div class=&quot;property-name&quot;> <code class=&quot;property-name&quot;>payment</code> </div> </td><td><span class=&quot;property-type&quot;>object</span></td><td></td></tr> <tr> <td colspan=&quot;3&quot;> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=&quot;object-schema-table-body&quot;> <tr class=&quot;&quot;><td><div class=&quot;property-name&quot;> <code class=&quot;property-name&quot;>funding_source_id</code> </div> </td><td><span class=&quot;property-type&quot;>string</span></td><td><p>Tremendous ID of the funding source that will be used to pay for the order.</p> <p>You can also pass one of the following magic values (case-insensitive):</p> <ul> <li><code>BALANCE</code> — pay from your Tremendous balance.</li> <li><code>INVOICE</code> — pay from your commercial invoice account.</li> <li><code>INVOICE_THEN_BALANCE</code> — pay from your commercial invoice account if doing so wouldn&#39;t exceed your credit limit, otherwise fall back to your Tremendous balance. The balance must have sufficient funds to pay for the order.</li> </ul> <p><strong>Note:</strong> <code>INVOICE</code> and <code>INVOICE_THEN_BALANCE</code> are only available to select Enterprise clients with an existing commercial invoicing setup. If your organization already uses commercial invoicing and you have questions, contact your Customer Success Manager.</p> </td></tr> </tbody> </table> </tr> <tr class=&quot;&quot;><td><div class=&quot;property-name&quot;> <code class=&quot;property-name&quot;>reward</code> </div> </td><td><span class=&quot;property-type&quot;>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=&quot;3&quot;> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=&quot;object-schema-table-body&quot;> <tr class=&quot;property-conditional-hint-response-only&quot;><td><div class=&quot;property-name&quot;> <code class=&quot;property-name&quot;>id</code> </div> </td><td><span class=&quot;property-type&quot;>string</span></td><td><p>Tremendous ID of the reward</p> </td></tr> <tr class=&quot;property-conditional-hint-response-only&quot;><td><div class=&quot;property-name&quot;> <code class=&quot;property-name&quot;>order_id</code> </div> </td><td><span class=&quot;property-type&quot;>string</span></td><td><p>Tremendous ID of the order this reward is part of.</p> </td></tr> <tr class=&quot;property-conditional-hint-response-only&quot;><td><div class=&quot;property-name&quot;> <code class=&quot;property-name&quot;>created_at</code> </div> </td><td><span class=&quot;property-type&quot;>string</span> <span class=&quot;property-format&quot;>date-time</span></td><td><p>Date the reward was created</p> </td></tr> <tr class=&quot;property-conditional-hint-response-only&quot;><td><div class=&quot;property-name&quot;> <code class=&quot;property-name&quot;>expires_at</code> </div> </td><td><span class=&quot;property-type&quot;>string</span> <span class=&quot;property-format&quot;>date-time</span></td><td><p>Expiration date of the reward. If null, the reward does not expire.</p> </td></tr> <tr class=&quot;property-conditional-hint-request-only&quot;><td><div class=&quot;property-name&quot;> <code class=&quot;property-name&quot;>campaign_id</code> </div> </td><td><span class=&quot;property-type&quot;>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=&quot;property-conditional-hint-request-only&quot;><td><div class=&quot;property-name&quot;> <code class=&quot;property-name&quot;>products</code> </div> </td><td><span class=&quot;property-type&quot;>array</span> <span class=&quot;property-format&quot;>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=&quot;&quot;><td><div class=&quot;property-name&quot;> <code class=&quot;property-name&quot;>value</code> </div> </td><td><span class=&quot;property-type&quot;>object</span></td><td></td></tr> <tr> <td colspan=&quot;3&quot;> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=&quot;object-schema-table-body&quot;> <tr class=&quot;&quot;><td><div class=&quot;property-name&quot;> <code class=&quot;property-name&quot;>denomination</code> </div> </td><td><span class=&quot;property-type&quot;>number</span> <span class=&quot;property-format&quot;>double</span></td><td><p>Amount of the reward</p> </td></tr> <tr class=&quot;&quot;><td><div class=&quot;property-name&quot;> <code class=&quot;property-name&quot;>currency_code</code> </div> </td><td><span class=&quot;property-type&quot;>string</span></td><td><p>Currency of the reward. Defaults to the organization&#39;s currency if not provided.</p> </td></tr> </tbody> </table> </tr> <tr class=&quot;&quot;><td><div class=&quot;property-name&quot;> <code class=&quot;property-name&quot;>recipient</code> </div> </td><td><span class=&quot;property-type&quot;>object</span></td><td><p>Details of the recipient of the reward</p> </td></tr> <tr> <td colspan=&quot;3&quot;> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=&quot;object-schema-table-body&quot;> <tr class=&quot;&quot;><td><div class=&quot;property-name&quot;> <code class=&quot;property-name&quot;>name</code> </div> </td><td><span class=&quot;property-type&quot;>string</span></td><td><p>Name of the recipient</p> </td></tr> <tr class=&quot;&quot;><td><div class=&quot;property-name&quot;> <code class=&quot;property-name&quot;>email</code> </div> </td><td><span class=&quot;property-type&quot;>string</span></td><td><p>Email address of the recipient</p> </td></tr> <tr class=&quot;&quot;><td><div class=&quot;property-name&quot;> <code class=&quot;property-name&quot;>phone</code> </div> </td><td><span class=&quot;property-type&quot;>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=&quot;&quot;><td><div class=&quot;property-name&quot;> <code class=&quot;property-name&quot;>deliver_at</code> </div> </td><td><span class=&quot;property-type&quot;>string</span> <span class=&quot;property-format&quot;>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=&quot;&quot;><td><div class=&quot;property-name&quot;> <code class=&quot;property-name&quot;>custom_fields</code> </div> </td><td><span class=&quot;property-type&quot;>array</span></td><td></td></tr> <tr> <td colspan=&quot;3&quot;> <details> <summary>Show array item type</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=&quot;object-schema-table-body&quot;> <tr class=&quot;&quot;><td><div class=&quot;property-name&quot;> <code class=&quot;property-name&quot;>id</code> </div> </td><td><span class=&quot;property-type&quot;>string</span></td><td><p>Tremendous ID of the custom field</p> </td></tr> <tr class=&quot;&quot;><td><div class=&quot;property-name&quot;> <code class=&quot;property-name&quot;>value</code> </div> </td><td><span class=&quot;property-type&quot;>string</span></td><td><p>Value of the custom field</p> </td></tr> <tr class=&quot;property-conditional-hint-response-only&quot;><td><div class=&quot;property-name&quot;> <code class=&quot;property-name&quot;>label</code> </div> </td><td><span class=&quot;property-type&quot;>string</span></td><td><p>Label of the custom field</p> </td></tr> </tbody> </table> </tr> <tr class=&quot;&quot;><td><div class=&quot;property-name&quot;> <code class=&quot;property-name&quot;>language</code> </div> </td><td><span class=&quot;property-type&quot;>string</span></td><td><p>Set this to translate the redemption experience for this reward. Pass a 2-letter <a href=&quot;https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes&quot;>ISO-639-1 code</a> for the desired language. Defaults to <code>en</code>.</p> </td></tr> <tr class=&quot;&quot;><td><div class=&quot;property-name&quot;> <code class=&quot;property-name&quot;>delivery</code> </div> </td><td><span class=&quot;property-type&quot;>object</span></td><td><p>Details on how the reward is delivered to the recipient.</p> </td></tr> <tr> <td colspan=&quot;3&quot;> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=&quot;object-schema-table-body&quot;> <tr class=&quot;&quot;><td><div class=&quot;property-name&quot;> <code class=&quot;property-name&quot;>method</code> </div> </td><td><span class=&quot;property-type&quot;>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 initial <code>POST /orders</code> response for a link reward includes the link in <code>delivery.link</code>.</p> <p>The link must then be delivered to the recipient out-of-band.</p> <p>To obtain a new link for an existing reward, call <code>POST /rewards/id/generate_link</code>.</p> </td> </tr> <tr> <td><code>PHONE</code></td> <td>Deliver the reward to the recipient by SMS</td> </tr> </tbody> </table> </td></tr> <tr class=&quot;&quot;><td><div class=&quot;property-name&quot;> <code class=&quot;property-name&quot;>meta</code> </div> </td><td><span class=&quot;property-type&quot;>object</span></td><td><p>Customizable reward delivery metadata, taking precedence over the related campaign settings.</p> </td></tr> <tr> <td colspan=&quot;3&quot;> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=&quot;object-schema-table-body&quot;> <tr class=&quot;&quot;><td><div class=&quot;property-name&quot;> <code class=&quot;property-name&quot;>sender_name</code> </div> </td><td><span class=&quot;property-type&quot;>string</span></td><td><p>The &quot;sender name&quot; used in the delivery. If it&#39;s an email reward, &quot;via Tremendous&quot; will be appended to the value. Please note that you cannot customize the sender email.</p> </td></tr> <tr class=&quot;&quot;><td><div class=&quot;property-name&quot;> <code class=&quot;property-name&quot;>subject_line</code> </div> </td><td><span class=&quot;property-type&quot;>string</span></td><td><p>The subject line used in the delivery.</p> </td></tr> <tr class=&quot;&quot;><td><div class=&quot;property-name&quot;> <code class=&quot;property-name&quot;>message</code> </div> </td><td><span class=&quot;property-type&quot;>string</span></td><td><p>The content of the message of the reward, shown in the email / SMS and on the landing page.</p> </td></tr> </tbody> </table> </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 &quot;funding source&quot;. You can retrieve a list of all available funding sources by using the Funding sources API endpoint. The Tremendous API sandbox environment comes with a single funding source that allows you to spend up to $100,000 in fake money to test the API. Learn more about the sandbox environment. 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 not create a new order. If the payload is the same as a previously issued order, our API will return a `201` response code, along with a representation of the already-existing order in the response body. If the `external_id` used is for an order with different parameters (e.g. amount, recipient), our API will return a `409` response code, indicating a conflicting resource.

Parameters:

  • create_order_request (CreateOrderRequest)

    Order to create

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CreateOrder200Response, Integer, Hash)>)

    CreateOrder200Response data, response status code and response headers



780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
# File 'lib/tremendous/api/tremendous_api.rb', line 780

def create_order_with_http_info(create_order_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.create_order ...'
  end
  # verify the required parameter 'create_order_request' is set
  if @api_client.config.client_side_validation && create_order_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_order_request' when calling TremendousApi.create_order"
  end
  # resource path
  local_var_path = '/orders'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(create_order_request)

  # return_type
  return_type = opts[:debug_return_type] || 'CreateOrder200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.create_order",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#create_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_organization(create_organization_request, opts = {}) ⇒ CreateOrganization200Response

Create organization 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.

Parameters:

  • create_organization_request (CreateOrganizationRequest)

    Organization details

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



838
839
840
841
# File 'lib/tremendous/api/tremendous_api.rb', line 838

def create_organization(create_organization_request, opts = {})
  data, _status_code, _headers = create_organization_with_http_info(create_organization_request, opts)
  data
end

#create_organization_with_http_info(create_organization_request, opts = {}) ⇒ Array<(CreateOrganization200Response, Integer, Hash)>

Create organization 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` in the request body as `true`. This ensures that your new Organization can either be accessed via the API or the Dashboard.

Parameters:

  • create_organization_request (CreateOrganizationRequest)

    Organization details

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
# File 'lib/tremendous/api/tremendous_api.rb', line 848

def create_organization_with_http_info(create_organization_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.create_organization ...'
  end
  # verify the required parameter 'create_organization_request' is set
  if @api_client.config.client_side_validation && create_organization_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_organization_request' when calling TremendousApi.create_organization"
  end
  # resource path
  local_var_path = '/organizations'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(create_organization_request)

  # return_type
  return_type = opts[:debug_return_type] || 'CreateOrganization200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.create_organization",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#create_organization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_report(create_report_request, opts = {}) ⇒ CreateReport200Response

Create report Creating a report allows your organization to programmatically retrieve information that's available in our dashboard UI. This request creates a new report object with a unique ID, and kicks off an async report generation. To retrieve a completed report, either poll /api/v2/reports/{id} or listen for REPORTS webhook event. ## Request body <div class="object-schema-request-schema">

<tbody class="object-schema-table-body"> <tr class=""> <tr class=""> <tr class=""> <td colspan="3">
Show object properties
Property Type Description
<div class="property-name"> <code class="property-name">report_type <span class="property-type">string

Type of report for retrieval.

Report type Description
digital_rewards Report for Tremendous digital reward history

<div class="property-name"> <code class="property-name">format <span class="property-type">string

Format the report will be generated in.

Format Description
csv CSV format for report

<div class="property-name"> <code class="property-name">filters <span class="property-type">object

Filters to apply to the report. Corresponds to the filters provided in the dashboard

<tbody class="object-schema-table-body"> <tr class=""> <td colspan="3">
Show object properties
Property Type Description
<div class="property-name"> <code class="property-name">digital_rewards <span class="property-type">object

Filters object for a report_type: digital_rewards report

<tbody class="object-schema-table-body"> <tr class=""> <td colspan="3">
Show object properties
Property Type Description
<div class="property-name"> <code class="property-name">amount <span class="property-type">object

Amount of the rewards returned in the report

<tbody class="object-schema-table-body"> <tr class=""> <tr class="">
Property Type Description
<div class="property-name"> <code class="property-name">gte <span class="property-type">number <span class="property-format">double

Minimum amount of the rewards that should be returned in the report

<div class="property-name"> <code class="property-name">lte <span class="property-type">number <span class="property-format">double

Maximum amount of the rewards that should be returned in the report

<tr class=""><div class="property-name"> <code class="property-name">campaign_id
<span class="property-type">string

ID of the Tremendous campaign that this report should be limited to

<tr class=""><div class="property-name"> <code class="property-name">created_at
<span class="property-type">object

Creation dates of rewards returned in the report

<td colspan="3">
Show object properties <tbody class="object-schema-table-body"> <tr class=""> <tr class="">
Property Type Description
<div class="property-name"> <code class="property-name">gte <span class="property-type">string <span class="property-format">date

Minimum date the reward was created

<div class="property-name"> <code class="property-name">lte <span class="property-type">string <span class="property-format">date

Maximum date the reward was created

<tr class=""><div class="property-name"> <code class="property-name">delivered_at
<span class="property-type">string <span class="property-format">date

Delivery date for gifts that should be returned in the report

<tr class=""><div class="property-name"> <code class="property-name">delivery_method <span class="property-type">string

Delivery method for rewards returned in the report

<tr class=""><div class="property-name"> <code class="property-name">order_id <span class="property-type">string

ID of the Tremendous order that this report should be limited to

<tr class=""><div class="property-name"> <code class="property-name">order_status <span class="property-type">string

Order status for rewards returned in the report

<tr class=""><div class="property-name"> <code class="property-name">status <span class="property-type">array <span class="property-format">string

Status for rewards returned in the report

## Rate limits Some reports may take a long time to generate and we limit the number of reports that can be simultaneously generated by an organization at a given time. If you exceed the rate limit, you'll receive a 429 response.

Parameters:

Returns:



906
907
908
909
# File 'lib/tremendous/api/tremendous_api.rb', line 906

def create_report(create_report_request, opts = {})
  data, _status_code, _headers = create_report_with_http_info(create_report_request, opts)
  data
end

#create_report_with_http_info(create_report_request, opts = {}) ⇒ Array<(CreateReport200Response, Integer, Hash)>

Create report Creating a report allows your organization to programmatically retrieve information that's available in our dashboard UI. This request creates a new report object with a unique ID, and kicks off an async report generation. To retrieve a completed report, either poll `/api/v2/reports/id` or listen for REPORTS webhook event. ## Request body <div class=&quot;object-schema-request-schema&quot;> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=&quot;object-schema-table-body&quot;> <tr class=&quot;&quot;><td><div class=&quot;property-name&quot;> <code class=&quot;property-name&quot;>report_type</code> </div> </td><td><span class=&quot;property-type&quot;>string</span></td><td><p>Type of report for retrieval. <table> <thead> <tr> <th>Report type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>digital_rewards</code></td> <td>Report for Tremendous digital reward history</td> </tr> </tbody> </table></p> </td></tr> <tr class=&quot;&quot;><td><div class=&quot;property-name&quot;> <code class=&quot;property-name&quot;>format</code> </div> </td><td><span class=&quot;property-type&quot;>string</span></td><td><p>Format the report will be generated in. <table> <thead> <tr> <th>Format</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>csv</code></td> <td>CSV format for report</td> </tr> </tbody> </table></p> </td></tr> <tr class=&quot;&quot;><td><div class=&quot;property-name&quot;> <code class=&quot;property-name&quot;>filters</code> </div> </td><td><span class=&quot;property-type&quot;>object</span></td><td><p>Filters to apply to the report. Corresponds to the filters provided in the dashboard</p> </td></tr> <tr> <td colspan=&quot;3&quot;> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=&quot;object-schema-table-body&quot;> <tr class=&quot;&quot;><td><div class=&quot;property-name&quot;> <code class=&quot;property-name&quot;>digital_rewards</code> </div> </td><td><span class=&quot;property-type&quot;>object</span></td><td><p>Filters object for a <code>report_type: digital_rewards</code> report</p> </td></tr> <tr> <td colspan=&quot;3&quot;> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=&quot;object-schema-table-body&quot;> <tr class=&quot;&quot;><td><div class=&quot;property-name&quot;> <code class=&quot;property-name&quot;>amount</code> </div> </td><td><span class=&quot;property-type&quot;>object</span></td><td><p>Amount of the rewards returned in the report</p> </td></tr> <tr> <td colspan=&quot;3&quot;> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=&quot;object-schema-table-body&quot;> <tr class=&quot;&quot;><td><div class=&quot;property-name&quot;> <code class=&quot;property-name&quot;>gte</code> </div> </td><td><span class=&quot;property-type&quot;>number</span> <span class=&quot;property-format&quot;>double</span></td><td><p>Minimum amount of the rewards that should be returned in the report</p> </td></tr> <tr class=&quot;&quot;><td><div class=&quot;property-name&quot;> <code class=&quot;property-name&quot;>lte</code> </div> </td><td><span class=&quot;property-type&quot;>number</span> <span class=&quot;property-format&quot;>double</span></td><td><p>Maximum amount of the rewards that should be returned in the report</p> </td></tr> </tbody> </table> </tr> <tr class=&quot;&quot;><td><div class=&quot;property-name&quot;> <code class=&quot;property-name&quot;>campaign_id</code> </div> </td><td><span class=&quot;property-type&quot;>string</span></td><td><p>ID of the Tremendous campaign that this report should be limited to</p> </td></tr> <tr class=&quot;&quot;><td><div class=&quot;property-name&quot;> <code class=&quot;property-name&quot;>created_at</code> </div> </td><td><span class=&quot;property-type&quot;>object</span></td><td><p>Creation dates of rewards returned in the report</p> </td></tr> <tr> <td colspan=&quot;3&quot;> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=&quot;object-schema-table-body&quot;> <tr class=&quot;&quot;><td><div class=&quot;property-name&quot;> <code class=&quot;property-name&quot;>gte</code> </div> </td><td><span class=&quot;property-type&quot;>string</span> <span class=&quot;property-format&quot;>date</span></td><td><p>Minimum date the reward was created</p> </td></tr> <tr class=&quot;&quot;><td><div class=&quot;property-name&quot;> <code class=&quot;property-name&quot;>lte</code> </div> </td><td><span class=&quot;property-type&quot;>string</span> <span class=&quot;property-format&quot;>date</span></td><td><p>Maximum date the reward was created</p> </td></tr> </tbody> </table> </tr> <tr class=&quot;&quot;><td><div class=&quot;property-name&quot;> <code class=&quot;property-name&quot;>delivered_at</code> </div> </td><td><span class=&quot;property-type&quot;>string</span> <span class=&quot;property-format&quot;>date</span></td><td><p>Delivery date for gifts that should be returned in the report</p> </td></tr> <tr class=&quot;&quot;><td><div class=&quot;property-name&quot;> <code class=&quot;property-name&quot;>delivery_method</code> </div> </td><td><span class=&quot;property-type&quot;>string</span></td><td><p>Delivery method for rewards returned in the report</p> </td></tr> <tr class=&quot;&quot;><td><div class=&quot;property-name&quot;> <code class=&quot;property-name&quot;>order_id</code> </div> </td><td><span class=&quot;property-type&quot;>string</span></td><td><p>ID of the Tremendous order that this report should be limited to</p> </td></tr> <tr class=&quot;&quot;><td><div class=&quot;property-name&quot;> <code class=&quot;property-name&quot;>order_status</code> </div> </td><td><span class=&quot;property-type&quot;>string</span></td><td><p>Order status for rewards returned in the report</p> </td></tr> <tr class=&quot;&quot;><td><div class=&quot;property-name&quot;> <code class=&quot;property-name&quot;>status</code> </div> </td><td><span class=&quot;property-type&quot;>array</span> <span class=&quot;property-format&quot;>string</span></td><td><p>Status for rewards returned in the report</p> </td></tr> </tbody> </table> </tr> </tbody> </table> </tr> </tbody> </table> </div> ## Rate limits Some reports may take a long time to generate and we limit the number of reports that can be simultaneously generated by an organization at a given time. If you exceed the rate limit, you'll receive a `429` response.

Parameters:

  • create_report_request (CreateReportRequest)

    Report to create

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CreateReport200Response, Integer, Hash)>)

    CreateReport200Response data, response status code and response headers



916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
# File 'lib/tremendous/api/tremendous_api.rb', line 916

def create_report_with_http_info(create_report_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.create_report ...'
  end
  # verify the required parameter 'create_report_request' is set
  if @api_client.config.client_side_validation && create_report_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_report_request' when calling TremendousApi.create_report"
  end
  # resource path
  local_var_path = '/reports'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(create_report_request)

  # return_type
  return_type = opts[:debug_return_type] || 'CreateReport200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.create_report",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#create_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_topup(opts = {}) ⇒ CreateTopup200Response

Create a topup

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :create_topup_request (CreateTopupRequest)

    Parameters required to create a new topup. The `idempotency_key` should be unique for each request.

Returns:



973
974
975
976
# File 'lib/tremendous/api/tremendous_api.rb', line 973

def create_topup(opts = {})
  data, _status_code, _headers = create_topup_with_http_info(opts)
  data
end

#create_topup_with_http_info(opts = {}) ⇒ Array<(CreateTopup200Response, Integer, Hash)>

Create a topup

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :create_topup_request (CreateTopupRequest)

    Parameters required to create a new topup. The `idempotency_key` should be unique for each request.

Returns:

  • (Array<(CreateTopup200Response, Integer, Hash)>)

    CreateTopup200Response data, response status code and response headers



982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
# File 'lib/tremendous/api/tremendous_api.rb', line 982

def create_topup_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.create_topup ...'
  end
  # resource path
  local_var_path = '/topups'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'create_topup_request'])

  # return_type
  return_type = opts[:debug_return_type] || 'CreateTopup200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.create_topup",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#create_topup\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_webhook(create_webhook_request, opts = {}) ⇒ CreateWebhook200Response

Create webhook 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 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">

<tbody class="object-schema-table-body"> <tr class="">
Property Type Description
<div class="property-name"> <code class="property-name">url <span class="property-type">string <span class="property-format">uri

URL the webhook will make requests to

Parameters:

Returns:



1036
1037
1038
1039
# File 'lib/tremendous/api/tremendous_api.rb', line 1036

def create_webhook(create_webhook_request, opts = {})
  data, _status_code, _headers = create_webhook_with_http_info(create_webhook_request, opts)
  data
end

#create_webhook_with_http_info(create_webhook_request, opts = {}) ⇒ Array<(CreateWebhook200Response, Integer, Hash)>

Create webhook 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 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=&quot;object-schema-request-schema&quot;> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=&quot;object-schema-table-body&quot;> <tr class=&quot;&quot;><td><div class=&quot;property-name&quot;> <code class=&quot;property-name&quot;>url</code> </div> </td><td><span class=&quot;property-type&quot;>string</span> <span class=&quot;property-format&quot;>uri</span></td><td><p>URL the webhook will make requests to</p> </td></tr> </tbody> </table> </div>

Parameters:

  • create_webhook_request (CreateWebhookRequest)

    Webhook details

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CreateWebhook200Response, Integer, Hash)>)

    CreateWebhook200Response data, response status code and response headers



1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
# File 'lib/tremendous/api/tremendous_api.rb', line 1046

def create_webhook_with_http_info(create_webhook_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.create_webhook ...'
  end
  # verify the required parameter 'create_webhook_request' is set
  if @api_client.config.client_side_validation && create_webhook_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_webhook_request' when calling TremendousApi.create_webhook"
  end
  # resource path
  local_var_path = '/webhooks'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(create_webhook_request)

  # return_type
  return_type = opts[:debug_return_type] || 'CreateWebhook200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.create_webhook",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#create_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_connected_organization(id, opts = {}) ⇒ CreateConnectedOrganization200Response

Delete a connected organization Deletes a connected organization and revokes the associated OAuth connection. The underlying Tremendous organization is not affected and remains accessible.

Parameters:

  • id (String)

    ID of the connected organization to delete.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1104
1105
1106
1107
# File 'lib/tremendous/api/tremendous_api.rb', line 1104

def delete_connected_organization(id, opts = {})
  data, _status_code, _headers = delete_connected_organization_with_http_info(id, opts)
  data
end

#delete_connected_organization_member(id, opts = {}) ⇒ CreateConnectedOrganizationMember200Response

Remove a connected organization member Removes a connected organization member. If the member has completed registration and has an associated Tremendous member, that membership is also revoked. The connected organization itself is not affected.

Parameters:

  • id (String)

    ID of the connected organization member to remove.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1167
1168
1169
1170
# File 'lib/tremendous/api/tremendous_api.rb', line 1167

def delete_connected_organization_member(id, opts = {})
  data, _status_code, _headers = delete_connected_organization_member_with_http_info(id, opts)
  data
end

#delete_connected_organization_member_with_http_info(id, opts = {}) ⇒ Array<(CreateConnectedOrganizationMember200Response, Integer, Hash)>

Remove a connected organization member Removes a connected organization member. If the member has completed registration and has an associated Tremendous member, that membership is also revoked. The connected organization itself is not affected.

Parameters:

  • id (String)

    ID of the connected organization member to remove.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
# File 'lib/tremendous/api/tremendous_api.rb', line 1177

def delete_connected_organization_member_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.delete_connected_organization_member ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.delete_connected_organization_member"
  end
  # resource path
  local_var_path = '/connected_organization_members/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'CreateConnectedOrganizationMember200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.delete_connected_organization_member",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#delete_connected_organization_member\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_connected_organization_with_http_info(id, opts = {}) ⇒ Array<(CreateConnectedOrganization200Response, Integer, Hash)>

Delete a connected organization Deletes a connected organization and revokes the associated OAuth connection. The underlying Tremendous organization is not affected and remains accessible.

Parameters:

  • id (String)

    ID of the connected organization to delete.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
# File 'lib/tremendous/api/tremendous_api.rb', line 1114

def delete_connected_organization_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.delete_connected_organization ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.delete_connected_organization"
  end
  # resource path
  local_var_path = '/connected_organizations/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'CreateConnectedOrganization200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.delete_connected_organization",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#delete_connected_organization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_fraud_rule(rule_type, opts = {}) ⇒ DeleteFraudRule200Response

Delete fraud rule Deletes the rule of the type passed in the URL.

Parameters:

  • rule_type (String)

    The rule type to create or update.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1230
1231
1232
1233
# File 'lib/tremendous/api/tremendous_api.rb', line 1230

def delete_fraud_rule(rule_type, opts = {})
  data, _status_code, _headers = delete_fraud_rule_with_http_info(rule_type, opts)
  data
end

#delete_fraud_rule_with_http_info(rule_type, opts = {}) ⇒ Array<(DeleteFraudRule200Response, Integer, Hash)>

Delete fraud rule Deletes the rule of the type passed in the URL.

Parameters:

  • rule_type (String)

    The rule type to create or update.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(DeleteFraudRule200Response, Integer, Hash)>)

    DeleteFraudRule200Response data, response status code and response headers



1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
# File 'lib/tremendous/api/tremendous_api.rb', line 1240

def delete_fraud_rule_with_http_info(rule_type, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.delete_fraud_rule ...'
  end
  # verify the required parameter 'rule_type' is set
  if @api_client.config.client_side_validation && rule_type.nil?
    fail ArgumentError, "Missing the required parameter 'rule_type' when calling TremendousApi.delete_fraud_rule"
  end
  # verify enum value
  allowable_values = ["review_country", "review_ip", "review_email", "review_redeemed_rewards_count", "review_redeemed_rewards_amount", "review_multiple_emails", "review_vpn", "review_tremendous_flag_list", "review_previously_blocked_recipients", "allow_ip", "allow_email"]
  if @api_client.config.client_side_validation && !allowable_values.include?(rule_type)
    fail ArgumentError, "invalid value for \"rule_type\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/fraud_rules/{rule_type}'.sub('{' + 'rule_type' + '}', CGI.escape(rule_type.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'DeleteFraudRule200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.delete_fraud_rule",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#delete_fraud_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_invoices(id, opts = {}) ⇒ CreateInvoice200Response

Delete invoice Removes an invoice. This has no further consequences but is a rather cosmetic operation.

Parameters:

  • id (String)

    ID of the invoice that should be removed

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1298
1299
1300
1301
# File 'lib/tremendous/api/tremendous_api.rb', line 1298

def delete_invoices(id, opts = {})
  data, _status_code, _headers = delete_invoices_with_http_info(id, opts)
  data
end

#delete_invoices_with_http_info(id, opts = {}) ⇒ Array<(CreateInvoice200Response, Integer, Hash)>

Delete invoice Removes an invoice. This has no further consequences but is a rather cosmetic operation.

Parameters:

  • id (String)

    ID of the invoice that should be removed

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CreateInvoice200Response, Integer, Hash)>)

    CreateInvoice200Response data, response status code and response headers



1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
# File 'lib/tremendous/api/tremendous_api.rb', line 1308

def delete_invoices_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.delete_invoices ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.delete_invoices"
  end
  # resource path
  local_var_path = '/invoices/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'CreateInvoice200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.delete_invoices",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#delete_invoices\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_member(id, opts = {}) ⇒ nil

Delete member Removes an existing member from the organization, identified by the given id in the URL. The member loses access to the organization and a MEMBERS.DELETED webhook event is emitted.

Parameters:

  • id (String)

    ID of the member to delete

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


1361
1362
1363
1364
# File 'lib/tremendous/api/tremendous_api.rb', line 1361

def delete_member(id, opts = {})
  delete_member_with_http_info(id, opts)
  nil
end

#delete_member_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete member Removes an existing member from the organization, identified by the given `id` in the URL. The member loses access to the organization and a `MEMBERS.DELETED` webhook event is emitted.

Parameters:

  • id (String)

    ID of the member to delete

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
# File 'lib/tremendous/api/tremendous_api.rb', line 1371

def delete_member_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.delete_member ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.delete_member"
  end
  pattern = Regexp.new(/[A-Z0-9]{4,20}/)
  if @api_client.config.client_side_validation && id !~ pattern
    fail ArgumentError, "invalid value for 'id' when calling TremendousApi.delete_member, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/members/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.delete_member",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#delete_member\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_webhook(id, opts = {}) ⇒ nil

Delete webhook

📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > Read it here

Parameters:

  • id (String)

    ID of the webhook to delete

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


1429
1430
1431
1432
# File 'lib/tremendous/api/tremendous_api.rb', line 1429

def delete_webhook(id, opts = {})
  delete_webhook_with_http_info(id, opts)
  nil
end

#delete_webhook_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete webhook > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > Read it here

Parameters:

  • id (String)

    ID of the webhook to delete

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
# File 'lib/tremendous/api/tremendous_api.rb', line 1439

def delete_webhook_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.delete_webhook ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.delete_webhook"
  end
  pattern = Regexp.new(/[A-Z0-9]{4,20}/)
  if @api_client.config.client_side_validation && id !~ pattern
    fail ArgumentError, "invalid value for 'id' when calling TremendousApi.delete_webhook, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/webhooks/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.delete_webhook",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#delete_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#download_invoice_csv(id, opts = {}) ⇒ String

Retrieve invoice as CSV Generates a CSV version for an invoice listing the associated rewards and orders

Parameters:

  • id (String)

    ID of the Invoice for that the CSV should be generated

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (String)


1497
1498
1499
1500
# File 'lib/tremendous/api/tremendous_api.rb', line 1497

def download_invoice_csv(id, opts = {})
  data, _status_code, _headers = download_invoice_csv_with_http_info(id, opts)
  data
end

#download_invoice_csv_with_http_info(id, opts = {}) ⇒ Array<(String, Integer, Hash)>

Retrieve invoice as CSV Generates a CSV version for an invoice listing the associated rewards and orders

Parameters:

  • id (String)

    ID of the Invoice for that the CSV should be generated

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(String, Integer, Hash)>)

    String data, response status code and response headers



1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
# File 'lib/tremendous/api/tremendous_api.rb', line 1507

def download_invoice_csv_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.download_invoice_csv ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.download_invoice_csv"
  end
  # resource path
  local_var_path = '/invoices/{id}/csv'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['text/csv', 'application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'String'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.download_invoice_csv",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#download_invoice_csv\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#download_invoice_pdf(id, opts = {}) ⇒ File

Retrieve invoice as PDF Generates a PDF version for an invoice

Parameters:

  • id (String)

    ID of the Invoice for that the PDF should be generated

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (File)


1560
1561
1562
1563
# File 'lib/tremendous/api/tremendous_api.rb', line 1560

def download_invoice_pdf(id, opts = {})
  data, _status_code, _headers = download_invoice_pdf_with_http_info(id, opts)
  data
end

#download_invoice_pdf_with_http_info(id, opts = {}) ⇒ Array<(File, Integer, Hash)>

Retrieve invoice as PDF Generates a PDF version for an invoice

Parameters:

  • id (String)

    ID of the Invoice for that the PDF should be generated

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(File, Integer, Hash)>)

    File data, response status code and response headers



1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
# File 'lib/tremendous/api/tremendous_api.rb', line 1570

def download_invoice_pdf_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.download_invoice_pdf ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.download_invoice_pdf"
  end
  # resource path
  local_var_path = '/invoices/{id}/pdf'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/pdf', 'application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'File'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.download_invoice_pdf",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#download_invoice_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#fraud_rule(rule_type, opts = {}) ⇒ FraudRule200Response

Configure fraud rule Configure a fraud rule of the type passed in the URL. If a rule of the same type already exists, it will be overwritten.

Parameters:

  • rule_type (String)

    The rule type to create or update.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :fraud_rule_request (FraudRuleRequest)

    Rules `review_multiple_emails`, `review_tremendous_flaglist`, and `review_previously_blocked_recipients` require no body. `review_vpn` also accepts no body for the default behavior. Pass `config.skip_apple_private_relay` only to override whether Apple Private Relay traffic is flagged.

Returns:



1624
1625
1626
1627
# File 'lib/tremendous/api/tremendous_api.rb', line 1624

def fraud_rule(rule_type, opts = {})
  data, _status_code, _headers = fraud_rule_with_http_info(rule_type, opts)
  data
end

#fraud_rule_with_http_info(rule_type, opts = {}) ⇒ Array<(FraudRule200Response, Integer, Hash)>

Configure fraud rule Configure a fraud rule of the type passed in the URL. If a rule of the same type already exists, it will be overwritten.

Parameters:

  • rule_type (String)

    The rule type to create or update.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :fraud_rule_request (FraudRuleRequest)

    Rules `review_multiple_emails`, `review_tremendous_flaglist`, and `review_previously_blocked_recipients` require no body. `review_vpn` also accepts no body for the default behavior. Pass `config.skip_apple_private_relay` only to override whether Apple Private Relay traffic is flagged.

Returns:

  • (Array<(FraudRule200Response, Integer, Hash)>)

    FraudRule200Response data, response status code and response headers



1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
# File 'lib/tremendous/api/tremendous_api.rb', line 1635

def fraud_rule_with_http_info(rule_type, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.fraud_rule ...'
  end
  # verify the required parameter 'rule_type' is set
  if @api_client.config.client_side_validation && rule_type.nil?
    fail ArgumentError, "Missing the required parameter 'rule_type' when calling TremendousApi.fraud_rule"
  end
  # verify enum value
  allowable_values = ["review_country", "review_ip", "review_email", "review_redeemed_rewards_count", "review_redeemed_rewards_amount", "review_multiple_emails", "review_vpn", "review_tremendous_flag_list", "review_previously_blocked_recipients", "allow_ip", "allow_email"]
  if @api_client.config.client_side_validation && !allowable_values.include?(rule_type)
    fail ArgumentError, "invalid value for \"rule_type\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/fraud_rules/{rule_type}'.sub('{' + 'rule_type' + '}', CGI.escape(rule_type.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'fraud_rule_request'])

  # return_type
  return_type = opts[:debug_return_type] || 'FraudRule200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.fraud_rule",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#fraud_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

Generate a reward URL Generate a redemption link for the reward identified by the id in the URL

Parameters:

  • id (String)

    ID of the reward

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1698
1699
1700
1701
# File 'lib/tremendous/api/tremendous_api.rb', line 1698

def generate_reward_link(id, opts = {})
  data, _status_code, _headers = generate_reward_link_with_http_info(id, opts)
  data
end

Generate a reward URL Generate a redemption link for the reward identified by the `id` in the URL

Parameters:

  • id (String)

    ID of the reward

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
# File 'lib/tremendous/api/tremendous_api.rb', line 1708

def generate_reward_link_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.generate_reward_link ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.generate_reward_link"
  end
  pattern = Regexp.new(/[A-Z0-9]{4,20}/)
  if @api_client.config.client_side_validation && id !~ pattern
    fail ArgumentError, "invalid value for 'id' when calling TremendousApi.generate_reward_link, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/rewards/{id}/generate_link'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GenerateRewardLink200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.generate_reward_link",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#generate_reward_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_campaign(id, opts = {}) ⇒ CreateCampaign200Response

Retrieve campaign Retrieve a campaign, identified by the given id in the URL

Parameters:

  • id (String)

    ID of the campaign that should be retrieved

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1766
1767
1768
1769
# File 'lib/tremendous/api/tremendous_api.rb', line 1766

def get_campaign(id, opts = {})
  data, _status_code, _headers = get_campaign_with_http_info(id, opts)
  data
end

#get_campaign_with_http_info(id, opts = {}) ⇒ Array<(CreateCampaign200Response, Integer, Hash)>

Retrieve campaign Retrieve a campaign, identified by the given `id` in the URL

Parameters:

  • id (String)

    ID of the campaign that should be retrieved

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CreateCampaign200Response, Integer, Hash)>)

    CreateCampaign200Response data, response status code and response headers



1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
# File 'lib/tremendous/api/tremendous_api.rb', line 1776

def get_campaign_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.get_campaign ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.get_campaign"
  end
  pattern = Regexp.new(/[A-Z0-9]{4,20}/)
  if @api_client.config.client_side_validation && id !~ pattern
    fail ArgumentError, "invalid value for 'id' when calling TremendousApi.get_campaign, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/campaigns/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'CreateCampaign200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.get_campaign",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#get_campaign\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_connected_organization(id, opts = {}) ⇒ CreateConnectedOrganization200Response

Retrieve a connected organization Retrieve the connected organization, identified by the given id in the URL

Parameters:

  • id (String)

    ID of the connected organization that should be retrieved.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1834
1835
1836
1837
# File 'lib/tremendous/api/tremendous_api.rb', line 1834

def get_connected_organization(id, opts = {})
  data, _status_code, _headers = get_connected_organization_with_http_info(id, opts)
  data
end

#get_connected_organization_member(id, opts = {}) ⇒ CreateConnectedOrganizationMember200Response

Retrieve a connected organization member Retrieve the connected organization member, identified by the given id in the URL

Parameters:

  • id (String)

    ID of the connected organization member that should be retrieved.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1897
1898
1899
1900
# File 'lib/tremendous/api/tremendous_api.rb', line 1897

def get_connected_organization_member(id, opts = {})
  data, _status_code, _headers = get_connected_organization_member_with_http_info(id, opts)
  data
end

#get_connected_organization_member_with_http_info(id, opts = {}) ⇒ Array<(CreateConnectedOrganizationMember200Response, Integer, Hash)>

Retrieve a connected organization member Retrieve the connected organization member, identified by the given `id` in the URL

Parameters:

  • id (String)

    ID of the connected organization member that should be retrieved.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
# File 'lib/tremendous/api/tremendous_api.rb', line 1907

def get_connected_organization_member_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.get_connected_organization_member ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.get_connected_organization_member"
  end
  # resource path
  local_var_path = '/connected_organization_members/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'CreateConnectedOrganizationMember200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.get_connected_organization_member",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#get_connected_organization_member\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_connected_organization_with_http_info(id, opts = {}) ⇒ Array<(CreateConnectedOrganization200Response, Integer, Hash)>

Retrieve a connected organization Retrieve the connected organization, identified by the given `id` in the URL

Parameters:

  • id (String)

    ID of the connected organization that should be retrieved.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
# File 'lib/tremendous/api/tremendous_api.rb', line 1844

def get_connected_organization_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.get_connected_organization ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.get_connected_organization"
  end
  # resource path
  local_var_path = '/connected_organizations/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'CreateConnectedOrganization200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.get_connected_organization",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#get_connected_organization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_fraud_review(id, opts = {}) ⇒ GetFraudReview200Response

Retrieve single fraud review Retrieve the details of a fraud review, identified by the given id in the URL. Returns additional details regarding the fraud review beyond what's provided in the List fraud reviews endpoint, including reward details, recipient geolocation, etc.

Parameters:

  • id (String)

    The ID of the reward that should be retrieved.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1960
1961
1962
1963
# File 'lib/tremendous/api/tremendous_api.rb', line 1960

def get_fraud_review(id, opts = {})
  data, _status_code, _headers = get_fraud_review_with_http_info(id, opts)
  data
end

#get_fraud_review_with_http_info(id, opts = {}) ⇒ Array<(GetFraudReview200Response, Integer, Hash)>

Retrieve single fraud review Retrieve the details of a fraud review, identified by the given `id` in the URL. Returns additional details regarding the fraud review beyond what's provided in the List fraud reviews endpoint, including reward details, recipient geolocation, etc.

Parameters:

  • id (String)

    The ID of the reward that should be retrieved.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(GetFraudReview200Response, Integer, Hash)>)

    GetFraudReview200Response data, response status code and response headers



1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
# File 'lib/tremendous/api/tremendous_api.rb', line 1970

def get_fraud_review_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.get_fraud_review ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.get_fraud_review"
  end
  # resource path
  local_var_path = '/fraud_reviews/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetFraudReview200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.get_fraud_review",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#get_fraud_review\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_funding_source(id, opts = {}) ⇒ GetFundingSource200Response

Retrieve funding source Retrieve a funding source, identified by the given id in the URL. You can also use the following special keywords (case-insensitive): - BALANCE retrieves the organization's balance funding source. - INVOICE retrieves the organization's active commercial invoice funding source. Note: Commercial invoicing is only available to select Enterprise clients with an existing commercial invoicing setup. If your organization already uses commercial invoicing and you have questions, contact your Customer Success Manager.

Parameters:

  • id (String)

    ID of the funding source that should be retrieved. Can also use `BALANCE` or `INVOICE` (case-insensitive) to retrieve the corresponding funding source.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



2023
2024
2025
2026
# File 'lib/tremendous/api/tremendous_api.rb', line 2023

def get_funding_source(id, opts = {})
  data, _status_code, _headers = get_funding_source_with_http_info(id, opts)
  data
end

#get_funding_source_with_http_info(id, opts = {}) ⇒ Array<(GetFundingSource200Response, Integer, Hash)>

Retrieve funding source Retrieve a funding source, identified by the given `id` in the URL. You can also use the following special keywords (case-insensitive): - `BALANCE` retrieves the organization's balance funding source. - `INVOICE` retrieves the organization's active commercial invoice funding source. Note: Commercial invoicing is only available to select Enterprise clients with an existing commercial invoicing setup. If your organization already uses commercial invoicing and you have questions, contact your Customer Success Manager.

Parameters:

  • id (String)

    ID of the funding source that should be retrieved. Can also use `BALANCE` or `INVOICE` (case-insensitive) to retrieve the corresponding funding source.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(GetFundingSource200Response, Integer, Hash)>)

    GetFundingSource200Response data, response status code and response headers



2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
# File 'lib/tremendous/api/tremendous_api.rb', line 2033

def get_funding_source_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.get_funding_source ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.get_funding_source"
  end
  pattern = Regexp.new(/^([A-Z0-9]{4,20}|[Bb][Aa][Ll][Aa][Nn][Cc][Ee]|[Ii][Nn][Vv][Oo][Ii][Cc][Ee])$/)
  if @api_client.config.client_side_validation && id !~ pattern
    fail ArgumentError, "invalid value for 'id' when calling TremendousApi.get_funding_source, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/funding_sources/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetFundingSource200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.get_funding_source",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#get_funding_source\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_invoice(id, opts = {}) ⇒ CreateInvoice200Response

Retrieve invoice 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.

Parameters:

  • id (String)

    ID of the invoice that should be retrieved

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



2091
2092
2093
2094
# File 'lib/tremendous/api/tremendous_api.rb', line 2091

def get_invoice(id, opts = {})
  data, _status_code, _headers = get_invoice_with_http_info(id, opts)
  data
end

#get_invoice_with_http_info(id, opts = {}) ⇒ Array<(CreateInvoice200Response, Integer, Hash)>

Retrieve invoice 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.

Parameters:

  • id (String)

    ID of the invoice that should be retrieved

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CreateInvoice200Response, Integer, Hash)>)

    CreateInvoice200Response data, response status code and response headers



2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
# File 'lib/tremendous/api/tremendous_api.rb', line 2101

def get_invoice_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.get_invoice ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.get_invoice"
  end
  # resource path
  local_var_path = '/invoices/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'CreateInvoice200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.get_invoice",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#get_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_member(id, opts = {}) ⇒ GetMember200Response

Retrieve member

Parameters:

  • id (String)

    ID of the member to retrieve

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



2153
2154
2155
2156
# File 'lib/tremendous/api/tremendous_api.rb', line 2153

def get_member(id, opts = {})
  data, _status_code, _headers = get_member_with_http_info(id, opts)
  data
end

#get_member_with_http_info(id, opts = {}) ⇒ Array<(GetMember200Response, Integer, Hash)>

Retrieve member

Parameters:

  • id (String)

    ID of the member to retrieve

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(GetMember200Response, Integer, Hash)>)

    GetMember200Response data, response status code and response headers



2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
# File 'lib/tremendous/api/tremendous_api.rb', line 2162

def get_member_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.get_member ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.get_member"
  end
  pattern = Regexp.new(/[A-Z0-9]{4,20}/)
  if @api_client.config.client_side_validation && id !~ pattern
    fail ArgumentError, "invalid value for 'id' when calling TremendousApi.get_member, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/members/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetMember200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.get_member",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#get_member\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_order(id, opts = {}) ⇒ GetOrder200Response

Retrieve order Retrieve the order, identified by the given id in the URL

Parameters:

  • id (String)

    ID of the order that should be retrieved. In case the order has an `external_id` reference supplied by the customer on creation, it's possible to use it instead.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



2220
2221
2222
2223
# File 'lib/tremendous/api/tremendous_api.rb', line 2220

def get_order(id, opts = {})
  data, _status_code, _headers = get_order_with_http_info(id, opts)
  data
end

#get_order_with_http_info(id, opts = {}) ⇒ Array<(GetOrder200Response, Integer, Hash)>

Retrieve order Retrieve the order, identified by the given `id` in the URL

Parameters:

  • id (String)

    ID of the order that should be retrieved. In case the order has an `external_id` reference supplied by the customer on creation, it's possible to use it instead.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(GetOrder200Response, Integer, Hash)>)

    GetOrder200Response data, response status code and response headers



2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
# File 'lib/tremendous/api/tremendous_api.rb', line 2230

def get_order_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.get_order ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.get_order"
  end
  # resource path
  local_var_path = '/orders/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetOrder200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.get_order",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#get_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_organization(id, opts = {}) ⇒ GetOrganization200Response

Retrieve organization

Parameters:

  • id (String)

    ID of the organization to retrieve

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



2282
2283
2284
2285
# File 'lib/tremendous/api/tremendous_api.rb', line 2282

def get_organization(id, opts = {})
  data, _status_code, _headers = get_organization_with_http_info(id, opts)
  data
end

#get_organization_with_http_info(id, opts = {}) ⇒ Array<(GetOrganization200Response, Integer, Hash)>

Retrieve organization

Parameters:

  • id (String)

    ID of the organization to retrieve

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(GetOrganization200Response, Integer, Hash)>)

    GetOrganization200Response data, response status code and response headers



2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
# File 'lib/tremendous/api/tremendous_api.rb', line 2291

def get_organization_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.get_organization ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.get_organization"
  end
  pattern = Regexp.new(/[A-Z0-9]{4,20}/)
  if @api_client.config.client_side_validation && id !~ pattern
    fail ArgumentError, "invalid value for 'id' when calling TremendousApi.get_organization, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/organizations/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetOrganization200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.get_organization",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#get_organization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_product(id, opts = {}) ⇒ GetProductResponse

Retrieve product Retrieve a product, identified by the given id in the URL

Parameters:

  • id (String)

    ID of the product that should be retrieved

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



2349
2350
2351
2352
# File 'lib/tremendous/api/tremendous_api.rb', line 2349

def get_product(id, opts = {})
  data, _status_code, _headers = get_product_with_http_info(id, opts)
  data
end

#get_product_with_http_info(id, opts = {}) ⇒ Array<(GetProductResponse, Integer, Hash)>

Retrieve product Retrieve a product, identified by the given `id` in the URL

Parameters:

  • id (String)

    ID of the product that should be retrieved

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(GetProductResponse, Integer, Hash)>)

    GetProductResponse data, response status code and response headers



2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
# File 'lib/tremendous/api/tremendous_api.rb', line 2359

def get_product_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.get_product ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.get_product"
  end
  pattern = Regexp.new(/[A-Z0-9]{4,20}/)
  if @api_client.config.client_side_validation && id !~ pattern
    fail ArgumentError, "invalid value for 'id' when calling TremendousApi.get_product, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/products/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetProductResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.get_product",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#get_product\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_report(id, opts = {}) ⇒ CreateReport200Response

Retrieve report Retrieve the report, identified by the given id in the URL Using the ID that was returned by POST /api/v2/reports, retrieves a download link for the report, identified by the given ID in the URL. Returns the report’s current status and, if available, the URL for download. The URL is valid for 7 days.

Parameters:

  • id (String)

    ID of the report that should be retrieved. ID is returned from `POST` to /api/v2/reports

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



2417
2418
2419
2420
# File 'lib/tremendous/api/tremendous_api.rb', line 2417

def get_report(id, opts = {})
  data, _status_code, _headers = get_report_with_http_info(id, opts)
  data
end

#get_report_with_http_info(id, opts = {}) ⇒ Array<(CreateReport200Response, Integer, Hash)>

Retrieve report Retrieve the report, identified by the given `id` in the URL Using the ID that was returned by `POST /api/v2/reports`, retrieves a download link for the report, identified by the given ID in the URL. Returns the report’s current status and, if available, the URL for download. The URL is valid for 7 days.

Parameters:

  • id (String)

    ID of the report that should be retrieved. ID is returned from `POST` to /api/v2/reports

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CreateReport200Response, Integer, Hash)>)

    CreateReport200Response data, response status code and response headers



2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
# File 'lib/tremendous/api/tremendous_api.rb', line 2427

def get_report_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.get_report ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.get_report"
  end
  # resource path
  local_var_path = '/reports/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'CreateReport200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.get_report",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#get_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_reward(id, opts = {}) ⇒ GetReward200Response

Retrieve single reward Retrieve the reward, identified by the given id in the URL

Parameters:

  • id (String)

    ID of the reward that should be retrieved

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



2480
2481
2482
2483
# File 'lib/tremendous/api/tremendous_api.rb', line 2480

def get_reward(id, opts = {})
  data, _status_code, _headers = get_reward_with_http_info(id, opts)
  data
end

#get_reward_with_http_info(id, opts = {}) ⇒ Array<(GetReward200Response, Integer, Hash)>

Retrieve single reward Retrieve the reward, identified by the given `id` in the URL

Parameters:

  • id (String)

    ID of the reward that should be retrieved

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(GetReward200Response, Integer, Hash)>)

    GetReward200Response data, response status code and response headers



2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
# File 'lib/tremendous/api/tremendous_api.rb', line 2490

def get_reward_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.get_reward ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.get_reward"
  end
  pattern = Regexp.new(/[A-Z0-9]{4,20}/)
  if @api_client.config.client_side_validation && id !~ pattern
    fail ArgumentError, "invalid value for 'id' when calling TremendousApi.get_reward, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/rewards/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetReward200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.get_reward",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#get_reward\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_topup(id, opts = {}) ⇒ CreateTopup200Response

Retrieve single topup Retrieve a topup, identified by the given id in the URL.

Parameters:

  • id (String)

    ID of the topup request that should be retrieved

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



2548
2549
2550
2551
# File 'lib/tremendous/api/tremendous_api.rb', line 2548

def get_topup(id, opts = {})
  data, _status_code, _headers = get_topup_with_http_info(id, opts)
  data
end

#get_topup_with_http_info(id, opts = {}) ⇒ Array<(CreateTopup200Response, Integer, Hash)>

Retrieve single topup Retrieve a topup, identified by the given `id` in the URL.

Parameters:

  • id (String)

    ID of the topup request that should be retrieved

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CreateTopup200Response, Integer, Hash)>)

    CreateTopup200Response data, response status code and response headers



2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
# File 'lib/tremendous/api/tremendous_api.rb', line 2558

def get_topup_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.get_topup ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.get_topup"
  end
  pattern = Regexp.new(/[A-Z0-9]{4,20}/)
  if @api_client.config.client_side_validation && id !~ pattern
    fail ArgumentError, "invalid value for 'id' when calling TremendousApi.get_topup, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/topups/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'CreateTopup200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.get_topup",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#get_topup\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_webhook(id, opts = {}) ⇒ CreateWebhook200Response

Retrieve webhook

📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > Read it here

Parameters:

  • id (String)

    ID of the webhook to retrieve

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



2616
2617
2618
2619
# File 'lib/tremendous/api/tremendous_api.rb', line 2616

def get_webhook(id, opts = {})
  data, _status_code, _headers = get_webhook_with_http_info(id, opts)
  data
end

#get_webhook_with_http_info(id, opts = {}) ⇒ Array<(CreateWebhook200Response, Integer, Hash)>

Retrieve webhook > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > Read it here

Parameters:

  • id (String)

    ID of the webhook to retrieve

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CreateWebhook200Response, Integer, Hash)>)

    CreateWebhook200Response data, response status code and response headers



2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
# File 'lib/tremendous/api/tremendous_api.rb', line 2626

def get_webhook_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.get_webhook ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.get_webhook"
  end
  pattern = Regexp.new(/[A-Z0-9]{4,20}/)
  if @api_client.config.client_side_validation && id !~ pattern
    fail ArgumentError, "invalid value for 'id' when calling TremendousApi.get_webhook, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/webhooks/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'CreateWebhook200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.get_webhook",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#get_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_balance_transactions(opts = {}) ⇒ ListBalanceTransactions200Response

List balance transactions Fetch a list of all balance transactions on your account.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :offset (Integer)

    Offsets the returned list by the given number of transactions. The returned transactions are ordered (and offsetted) by their creation date (DESC).

  • :limit (Integer)

    Limits the number of transactions listed. The default value is 10.

  • :created_at_gte (String)

    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.

  • :created_at_lte (String)

    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.

Returns:



2687
2688
2689
2690
# File 'lib/tremendous/api/tremendous_api.rb', line 2687

def list_balance_transactions(opts = {})
  data, _status_code, _headers = list_balance_transactions_with_http_info(opts)
  data
end

#list_balance_transactions_with_http_info(opts = {}) ⇒ Array<(ListBalanceTransactions200Response, Integer, Hash)>

List balance transactions Fetch a list of all balance transactions on your account.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :offset (Integer)

    Offsets the returned list by the given number of transactions. The returned transactions are ordered (and offsetted) by their creation date (DESC).

  • :limit (Integer)

    Limits the number of transactions listed. The default value is 10.

  • :created_at_gte (String)

    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.

  • :created_at_lte (String)

    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.

Returns:



2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
# File 'lib/tremendous/api/tremendous_api.rb', line 2700

def list_balance_transactions_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.list_balance_transactions ...'
  end
  # resource path
  local_var_path = '/balance_transactions'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'created_at[gte]'] = opts[:'created_at_gte'] if !opts[:'created_at_gte'].nil?
  query_params[:'created_at[lte]'] = opts[:'created_at_lte'] if !opts[:'created_at_lte'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListBalanceTransactions200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.list_balance_transactions",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#list_balance_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_campaigns(opts = {}) ⇒ ListCampaigns200Response

List campaigns Retrieve a list of all campaigns created in your account

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



2752
2753
2754
2755
# File 'lib/tremendous/api/tremendous_api.rb', line 2752

def list_campaigns(opts = {})
  data, _status_code, _headers = list_campaigns_with_http_info(opts)
  data
end

#list_campaigns_with_http_info(opts = {}) ⇒ Array<(ListCampaigns200Response, Integer, Hash)>

List campaigns Retrieve a list of all campaigns created in your account

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ListCampaigns200Response, Integer, Hash)>)

    ListCampaigns200Response data, response status code and response headers



2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
# File 'lib/tremendous/api/tremendous_api.rb', line 2761

def list_campaigns_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.list_campaigns ...'
  end
  # resource path
  local_var_path = '/campaigns'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListCampaigns200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.list_campaigns",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#list_campaigns\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_connected_organization_members(connected_organization_id, opts = {}) ⇒ ListConnectedOrganizationMembers200Response

List connected organization members Retrieve a list of connected organization members.

Parameters:

  • connected_organization_id (String)

    ID of the connected organization.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :offset (Integer)

    Offsets the returned list by the given number of connected organizations.

  • :limit (Integer)

    Limits the number of connected organizations listed. The maximum value is 100 and the default is 10.

Returns:



2812
2813
2814
2815
# File 'lib/tremendous/api/tremendous_api.rb', line 2812

def list_connected_organization_members(connected_organization_id, opts = {})
  data, _status_code, _headers = list_connected_organization_members_with_http_info(connected_organization_id, opts)
  data
end

#list_connected_organization_members_with_http_info(connected_organization_id, opts = {}) ⇒ Array<(ListConnectedOrganizationMembers200Response, Integer, Hash)>

List connected organization members Retrieve a list of connected organization members.

Parameters:

  • connected_organization_id (String)

    ID of the connected organization.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :offset (Integer)

    Offsets the returned list by the given number of connected organizations.

  • :limit (Integer)

    Limits the number of connected organizations listed. The maximum value is 100 and the default is 10.

Returns:



2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
# File 'lib/tremendous/api/tremendous_api.rb', line 2824

def list_connected_organization_members_with_http_info(connected_organization_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.list_connected_organization_members ...'
  end
  # verify the required parameter 'connected_organization_id' is set
  if @api_client.config.client_side_validation && connected_organization_id.nil?
    fail ArgumentError, "Missing the required parameter 'connected_organization_id' when calling TremendousApi.list_connected_organization_members"
  end
  # resource path
  local_var_path = '/connected_organization_members'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'connected_organization_id'] = connected_organization_id
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListConnectedOrganizationMembers200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.list_connected_organization_members",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#list_connected_organization_members\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_connected_organizations(opts = {}) ⇒ ListConnectedOrganizations200Response

List connected organizations Retrieve a list of connected organizations.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :offset (Integer)

    Offsets the returned list by the given number of connected organizations.

  • :limit (Integer)

    Limits the number of connected organizations listed. The maximum value is 100 and the default is 10.

Returns:



2881
2882
2883
2884
# File 'lib/tremendous/api/tremendous_api.rb', line 2881

def list_connected_organizations(opts = {})
  data, _status_code, _headers = list_connected_organizations_with_http_info(opts)
  data
end

#list_connected_organizations_with_http_info(opts = {}) ⇒ Array<(ListConnectedOrganizations200Response, Integer, Hash)>

List connected organizations Retrieve a list of connected organizations.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :offset (Integer)

    Offsets the returned list by the given number of connected organizations.

  • :limit (Integer)

    Limits the number of connected organizations listed. The maximum value is 100 and the default is 10.

Returns:



2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
# File 'lib/tremendous/api/tremendous_api.rb', line 2892

def list_connected_organizations_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.list_connected_organizations ...'
  end
  # resource path
  local_var_path = '/connected_organizations'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListConnectedOrganizations200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.list_connected_organizations",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#list_connected_organizations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_fields(opts = {}) ⇒ ListFields200Response

List fields 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.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



2942
2943
2944
2945
# File 'lib/tremendous/api/tremendous_api.rb', line 2942

def list_fields(opts = {})
  data, _status_code, _headers = list_fields_with_http_info(opts)
  data
end

#list_fields_with_http_info(opts = {}) ⇒ Array<(ListFields200Response, Integer, Hash)>

List fields 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.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ListFields200Response, Integer, Hash)>)

    ListFields200Response data, response status code and response headers



2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
# File 'lib/tremendous/api/tremendous_api.rb', line 2951

def list_fields_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.list_fields ...'
  end
  # resource path
  local_var_path = '/fields'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListFields200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.list_fields",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#list_fields\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_forex(opts = {}) ⇒ ListForexResponse

List exchange rates Retrieve a list of exchange rates

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :base (String)

    Base currency code, default is USD.

Returns:



3000
3001
3002
3003
# File 'lib/tremendous/api/tremendous_api.rb', line 3000

def list_forex(opts = {})
  data, _status_code, _headers = list_forex_with_http_info(opts)
  data
end

#list_forex_with_http_info(opts = {}) ⇒ Array<(ListForexResponse, Integer, Hash)>

List exchange rates Retrieve a list of exchange rates

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :base (String)

    Base currency code, default is USD.

Returns:

  • (Array<(ListForexResponse, Integer, Hash)>)

    ListForexResponse data, response status code and response headers



3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
# File 'lib/tremendous/api/tremendous_api.rb', line 3010

def list_forex_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.list_forex ...'
  end
  # resource path
  local_var_path = '/forex'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'base'] = opts[:'base'] if !opts[:'base'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListForexResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.list_forex",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#list_forex\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_fraud_reviews(opts = {}) ⇒ ListFraudReviews200Response

List fraud reviews Retrieve a paginated list of all fraud reviews. List can be filtered by status, created or redeemed at dates.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :offset (Integer)

    Offsets the returned list by the given number of records. The returned fraud reviews are ordered (and offsetted) by their redemption date (DESC).

  • :limit (Integer)

    Limits the number of fraud reviews listed. The default value is 10.

  • :status (String)

    Filters fraud reviews by status. Can be `flagged`, `blocked` or `released`.

  • :created_at_gte (String)

    Return results where the created_at field is >= to the supplied value. Expects an ISO 8601 datetime.

  • :created_at_lte (String)

    Return results where the created_at field is <= to the supplied value. Expects an ISO 8601 datetime.

  • :redeemed_at_gte (String)

    Return results where the redeemed_at field is >= the supplied value. Expects an ISO 8601 datetime.

  • :redeemed_at_lte (String)

    Return results where the redeemed_at field is <= the supplied value. Expects an ISO 8601 datetime.

Returns:



3066
3067
3068
3069
# File 'lib/tremendous/api/tremendous_api.rb', line 3066

def list_fraud_reviews(opts = {})
  data, _status_code, _headers = list_fraud_reviews_with_http_info(opts)
  data
end

#list_fraud_reviews_with_http_info(opts = {}) ⇒ Array<(ListFraudReviews200Response, Integer, Hash)>

List fraud reviews Retrieve a paginated list of all fraud reviews. List can be filtered by status, created or redeemed at dates.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :offset (Integer)

    Offsets the returned list by the given number of records. The returned fraud reviews are ordered (and offsetted) by their redemption date (DESC).

  • :limit (Integer)

    Limits the number of fraud reviews listed. The default value is 10.

  • :status (String)

    Filters fraud reviews by status. Can be `flagged`, `blocked` or `released`.

  • :created_at_gte (String)

    Return results where the created_at field is >= to the supplied value. Expects an ISO 8601 datetime.

  • :created_at_lte (String)

    Return results where the created_at field is <= to the supplied value. Expects an ISO 8601 datetime.

  • :redeemed_at_gte (String)

    Return results where the redeemed_at field is >= the supplied value. Expects an ISO 8601 datetime.

  • :redeemed_at_lte (String)

    Return results where the redeemed_at field is <= the supplied value. Expects an ISO 8601 datetime.

Returns:

  • (Array<(ListFraudReviews200Response, Integer, Hash)>)

    ListFraudReviews200Response data, response status code and response headers



3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
# File 'lib/tremendous/api/tremendous_api.rb', line 3082

def list_fraud_reviews_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.list_fraud_reviews ...'
  end
  if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
    fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling TremendousApi.list_fraud_reviews, must be greater than or equal to 0.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling TremendousApi.list_fraud_reviews, must be smaller than or equal to 100.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling TremendousApi.list_fraud_reviews, must be greater than or equal to 1.'
  end

  allowable_values = ["flagged", "blocked", "released"]
  if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
    fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/fraud_reviews'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
  query_params[:'created_at[gte]'] = opts[:'created_at_gte'] if !opts[:'created_at_gte'].nil?
  query_params[:'created_at[lte]'] = opts[:'created_at_lte'] if !opts[:'created_at_lte'].nil?
  query_params[:'redeemed_at[gte]'] = opts[:'redeemed_at_gte'] if !opts[:'redeemed_at_gte'].nil?
  query_params[:'redeemed_at[lte]'] = opts[:'redeemed_at_lte'] if !opts[:'redeemed_at_lte'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListFraudReviews200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.list_fraud_reviews",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#list_fraud_reviews\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_fraud_rules(opts = {}) ⇒ ListFraudRules200Response

List fraud rules List active fraud rules associated with the organization tied to your API key.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



3153
3154
3155
3156
# File 'lib/tremendous/api/tremendous_api.rb', line 3153

def list_fraud_rules(opts = {})
  data, _status_code, _headers = list_fraud_rules_with_http_info(opts)
  data
end

#list_fraud_rules_with_http_info(opts = {}) ⇒ Array<(ListFraudRules200Response, Integer, Hash)>

List fraud rules List active fraud rules associated with the organization tied to your API key.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ListFraudRules200Response, Integer, Hash)>)

    ListFraudRules200Response data, response status code and response headers



3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
# File 'lib/tremendous/api/tremendous_api.rb', line 3162

def list_fraud_rules_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.list_fraud_rules ...'
  end
  # resource path
  local_var_path = '/fraud_rules'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListFraudRules200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.list_fraud_rules",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#list_fraud_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_funding_sources(opts = {}) ⇒ ListFundingSources200Response

List funding sources Retrieve a list of all funding sources in your organization's account.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



3210
3211
3212
3213
# File 'lib/tremendous/api/tremendous_api.rb', line 3210

def list_funding_sources(opts = {})
  data, _status_code, _headers = list_funding_sources_with_http_info(opts)
  data
end

#list_funding_sources_with_http_info(opts = {}) ⇒ Array<(ListFundingSources200Response, Integer, Hash)>

List funding sources Retrieve a list of all funding sources in your organization's account.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
# File 'lib/tremendous/api/tremendous_api.rb', line 3219

def list_funding_sources_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.list_funding_sources ...'
  end
  # resource path
  local_var_path = '/funding_sources'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListFundingSources200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.list_funding_sources",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#list_funding_sources\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_invoices(opts = {}) ⇒ ListInvoices200Response

List invoices Fetch a list of all invoices on your account. > 🚧 Deleted invoices are omitted > > The response does not include any previously deleted invoices.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :offset (Integer)

    Offsets the returned list by the given number of invoices. The returned invoices are ordered (and offsetted) by their creation date (DESC).

  • :limit (Integer)

    Limits the number of invoices listed. The maximum and default value is 10.

Returns:



3269
3270
3271
3272
# File 'lib/tremendous/api/tremendous_api.rb', line 3269

def list_invoices(opts = {})
  data, _status_code, _headers = list_invoices_with_http_info(opts)
  data
end

#list_invoices_with_http_info(opts = {}) ⇒ Array<(ListInvoices200Response, Integer, Hash)>

List invoices Fetch a list of all invoices on your account. > 🚧 Deleted invoices are omitted > > The response does not include any previously deleted invoices.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :offset (Integer)

    Offsets the returned list by the given number of invoices. The returned invoices are ordered (and offsetted) by their creation date (DESC).

  • :limit (Integer)

    Limits the number of invoices listed. The maximum and default value is 10.

Returns:

  • (Array<(ListInvoices200Response, Integer, Hash)>)

    ListInvoices200Response data, response status code and response headers



3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
# File 'lib/tremendous/api/tremendous_api.rb', line 3280

def list_invoices_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.list_invoices ...'
  end
  # resource path
  local_var_path = '/invoices'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListInvoices200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.list_invoices",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#list_invoices\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_members(opts = {}) ⇒ ListMembers200Response

List members To list members of a sub-organization create an API key for that organization first, then use the new API key in the list members request.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



3330
3331
3332
3333
# File 'lib/tremendous/api/tremendous_api.rb', line 3330

def list_members(opts = {})
  data, _status_code, _headers = list_members_with_http_info(opts)
  data
end

#list_members_with_http_info(opts = {}) ⇒ Array<(ListMembers200Response, Integer, Hash)>

List members To list members of a sub-organization create an API key for that organization first, then use the new API key in the list members request.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ListMembers200Response, Integer, Hash)>)

    ListMembers200Response data, response status code and response headers



3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
# File 'lib/tremendous/api/tremendous_api.rb', line 3339

def list_members_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.list_members ...'
  end
  # resource path
  local_var_path = '/members'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListMembers200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.list_members",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#list_members\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_orders(opts = {}) ⇒ ListOrders200Response

List orders Retrieve a list of orders

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :offset (Integer)

    Offsets the returned list by the given number of orders. The returned orders are ordered (and offsetted) by their creation date (DESC).

  • :campaign_id (String)

    Only return results with a matching campaign_id.

  • :external_id (String)

    Only return results with a matching external_id.

  • :created_at_gte (String)

    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.

  • :created_at_lte (String)

    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.

  • :limit (Integer)

    Limits the number of orders listed. The maximum value is 500 and the default is 10.

Returns:



3393
3394
3395
3396
# File 'lib/tremendous/api/tremendous_api.rb', line 3393

def list_orders(opts = {})
  data, _status_code, _headers = list_orders_with_http_info(opts)
  data
end

#list_orders_with_http_info(opts = {}) ⇒ Array<(ListOrders200Response, Integer, Hash)>

List orders Retrieve a list of orders

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :offset (Integer)

    Offsets the returned list by the given number of orders. The returned orders are ordered (and offsetted) by their creation date (DESC).

  • :campaign_id (String)

    Only return results with a matching campaign_id.

  • :external_id (String)

    Only return results with a matching external_id.

  • :created_at_gte (String)

    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.

  • :created_at_lte (String)

    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.

  • :limit (Integer)

    Limits the number of orders listed. The maximum value is 500 and the default is 10.

Returns:

  • (Array<(ListOrders200Response, Integer, Hash)>)

    ListOrders200Response data, response status code and response headers



3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
# File 'lib/tremendous/api/tremendous_api.rb', line 3408

def list_orders_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.list_orders ...'
  end
  # resource path
  local_var_path = '/orders'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'campaign_id'] = opts[:'campaign_id'] if !opts[:'campaign_id'].nil?
  query_params[:'external_id'] = opts[:'external_id'] if !opts[:'external_id'].nil?
  query_params[:'created_at[gte]'] = opts[:'created_at_gte'] if !opts[:'created_at_gte'].nil?
  query_params[:'created_at[lte]'] = opts[:'created_at_lte'] if !opts[:'created_at_lte'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListOrders200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.list_orders",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#list_orders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_organizations(opts = {}) ⇒ ListOrganizations200Response

List organizations The returned list only includes the organization to which the API key belongs to, that is used for the request.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



3462
3463
3464
3465
# File 'lib/tremendous/api/tremendous_api.rb', line 3462

def list_organizations(opts = {})
  data, _status_code, _headers = list_organizations_with_http_info(opts)
  data
end

#list_organizations_with_http_info(opts = {}) ⇒ Array<(ListOrganizations200Response, Integer, Hash)>

List organizations The returned list only includes the organization to which the API key belongs to, that is used for the request.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
# File 'lib/tremendous/api/tremendous_api.rb', line 3471

def list_organizations_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.list_organizations ...'
  end
  # resource path
  local_var_path = '/organizations'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListOrganizations200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.list_organizations",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#list_organizations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_products(opts = {}) ⇒ ListProductsResponse

List products Retrieve a list of available products

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :country (String)

    Comma-separated list of Alpha-2 country codes, used to only retrieve products available in the provided countries

  • :currency (String)

    Comma-separated list of currency codes, used to only retrieve products available in the provided currencies

  • :subcategory (String)

    Comma-separated list of subcategories, used to only retrieve products with the provided subcategories

Returns:



3522
3523
3524
3525
# File 'lib/tremendous/api/tremendous_api.rb', line 3522

def list_products(opts = {})
  data, _status_code, _headers = list_products_with_http_info(opts)
  data
end

#list_products_with_http_info(opts = {}) ⇒ Array<(ListProductsResponse, Integer, Hash)>

List products Retrieve a list of available products

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :country (String)

    Comma-separated list of Alpha-2 country codes, used to only retrieve products available in the provided countries

  • :currency (String)

    Comma-separated list of currency codes, used to only retrieve products available in the provided currencies

  • :subcategory (String)

    Comma-separated list of subcategories, used to only retrieve products with the provided subcategories

Returns:

  • (Array<(ListProductsResponse, Integer, Hash)>)

    ListProductsResponse data, response status code and response headers



3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
# File 'lib/tremendous/api/tremendous_api.rb', line 3534

def list_products_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.list_products ...'
  end
  # resource path
  local_var_path = '/products'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'country'] = opts[:'country'] if !opts[:'country'].nil?
  query_params[:'currency'] = opts[:'currency'] if !opts[:'currency'].nil?
  query_params[:'subcategory'] = opts[:'subcategory'] if !opts[:'subcategory'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListProductsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.list_products",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#list_products\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_rewards(opts = {}) ⇒ ListRewards200Response

List rewards Retrieve a list of all created rewards. You can query for rewards by custom field attributes using the field label and values as query params. Learn more

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :offset (Integer)

    Offsets the returned list by the given number of rewards. The returned rewards are ordered (and offsetted) by their creation date (DESC).

  • :limit (Integer)

    Limits the number of rewards listed. The maximum value is 500 and the default is 100.

Returns:



3587
3588
3589
3590
# File 'lib/tremendous/api/tremendous_api.rb', line 3587

def list_rewards(opts = {})
  data, _status_code, _headers = list_rewards_with_http_info(opts)
  data
end

#list_rewards_with_http_info(opts = {}) ⇒ Array<(ListRewards200Response, Integer, Hash)>

List rewards Retrieve a list of all created rewards. You can query for rewards by custom field attributes using the field label and values as query params. Learn more

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :offset (Integer)

    Offsets the returned list by the given number of rewards. The returned rewards are ordered (and offsetted) by their creation date (DESC).

  • :limit (Integer)

    Limits the number of rewards listed. The maximum value is 500 and the default is 100.

Returns:

  • (Array<(ListRewards200Response, Integer, Hash)>)

    ListRewards200Response data, response status code and response headers



3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
# File 'lib/tremendous/api/tremendous_api.rb', line 3598

def list_rewards_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.list_rewards ...'
  end
  # resource path
  local_var_path = '/rewards'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListRewards200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.list_rewards",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#list_rewards\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_roles(opts = {}) ⇒ ListRoles200Response

List roles List all available roles in the organization.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



3648
3649
3650
3651
# File 'lib/tremendous/api/tremendous_api.rb', line 3648

def list_roles(opts = {})
  data, _status_code, _headers = list_roles_with_http_info(opts)
  data
end

#list_roles_with_http_info(opts = {}) ⇒ Array<(ListRoles200Response, Integer, Hash)>

List roles List all available roles in the organization.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ListRoles200Response, Integer, Hash)>)

    ListRoles200Response data, response status code and response headers



3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
# File 'lib/tremendous/api/tremendous_api.rb', line 3657

def list_roles_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.list_roles ...'
  end
  # resource path
  local_var_path = '/roles'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListRoles200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.list_roles",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#list_roles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_topups(opts = {}) ⇒ ListTopups200Response

List topups Retrieve a list of all topup requests.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :offset (Integer)

    Offsets the returned list by the given number of topups. The returned topups are ordered and offset by their creation date (DESC).

Returns:



3706
3707
3708
3709
# File 'lib/tremendous/api/tremendous_api.rb', line 3706

def list_topups(opts = {})
  data, _status_code, _headers = list_topups_with_http_info(opts)
  data
end

#list_topups_with_http_info(opts = {}) ⇒ Array<(ListTopups200Response, Integer, Hash)>

List topups Retrieve a list of all topup requests.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :offset (Integer)

    Offsets the returned list by the given number of topups. The returned topups are ordered and offset by their creation date (DESC).

Returns:

  • (Array<(ListTopups200Response, Integer, Hash)>)

    ListTopups200Response data, response status code and response headers



3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
# File 'lib/tremendous/api/tremendous_api.rb', line 3716

def list_topups_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.list_topups ...'
  end
  # resource path
  local_var_path = '/topups'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListTopups200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.list_topups",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#list_topups\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_webhook_events(id, opts = {}) ⇒ ListWebhookEvents200Response

List events 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

Parameters:

  • id (String)

    ID of the webhook to list the events for

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



3766
3767
3768
3769
# File 'lib/tremendous/api/tremendous_api.rb', line 3766

def list_webhook_events(id, opts = {})
  data, _status_code, _headers = list_webhook_events_with_http_info(id, opts)
  data
end

#list_webhook_events_with_http_info(id, opts = {}) ⇒ Array<(ListWebhookEvents200Response, Integer, Hash)>

List events 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

Parameters:

  • id (String)

    ID of the webhook to list the events for

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
# File 'lib/tremendous/api/tremendous_api.rb', line 3776

def list_webhook_events_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.list_webhook_events ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.list_webhook_events"
  end
  pattern = Regexp.new(/[A-Z0-9]{4,20}/)
  if @api_client.config.client_side_validation && id !~ pattern
    fail ArgumentError, "invalid value for 'id' when calling TremendousApi.list_webhook_events, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/webhooks/{id}/events'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListWebhookEvents200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.list_webhook_events",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#list_webhook_events\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_webhooks(opts = {}) ⇒ ListWebhooks200Response

List webhooks 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

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



3833
3834
3835
3836
# File 'lib/tremendous/api/tremendous_api.rb', line 3833

def list_webhooks(opts = {})
  data, _status_code, _headers = list_webhooks_with_http_info(opts)
  data
end

#list_webhooks_with_http_info(opts = {}) ⇒ Array<(ListWebhooks200Response, Integer, Hash)>

List webhooks 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

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ListWebhooks200Response, Integer, Hash)>)

    ListWebhooks200Response data, response status code and response headers



3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
# File 'lib/tremendous/api/tremendous_api.rb', line 3842

def list_webhooks_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.list_webhooks ...'
  end
  # resource path
  local_var_path = '/webhooks'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListWebhooks200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.list_webhooks",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#list_webhooks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#reject_order(id, opts = {}) ⇒ GetOrder200Response

Reject order 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.

Parameters:

  • id (String)

    ID of the order that should be rejected. In case the order has an `external_id` reference supplied by the customer on creation, it's possible to use it instead.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



3891
3892
3893
3894
# File 'lib/tremendous/api/tremendous_api.rb', line 3891

def reject_order(id, opts = {})
  data, _status_code, _headers = reject_order_with_http_info(id, opts)
  data
end

#reject_order_with_http_info(id, opts = {}) ⇒ Array<(GetOrder200Response, Integer, Hash)>

Reject order 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.

Parameters:

  • id (String)

    ID of the order that should be rejected. In case the order has an `external_id` reference supplied by the customer on creation, it's possible to use it instead.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(GetOrder200Response, Integer, Hash)>)

    GetOrder200Response data, response status code and response headers



3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
# File 'lib/tremendous/api/tremendous_api.rb', line 3901

def reject_order_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.reject_order ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.reject_order"
  end
  pattern = Regexp.new(/[A-Z0-9]{4,20}/)
  if @api_client.config.client_side_validation && id !~ pattern
    fail ArgumentError, "invalid value for 'id' when calling TremendousApi.reject_order, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/order_approvals/{id}/reject'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetOrder200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.reject_order",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#reject_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#release_fraud_review(id, opts = {}) ⇒ GetFraudReview200Response

Release fraud review Completes the fraud review identified by the given id in the URL, and releases the associated reward to the recipient.

Parameters:

  • id (String)

    The ID of the reward that should be released.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



3959
3960
3961
3962
# File 'lib/tremendous/api/tremendous_api.rb', line 3959

def release_fraud_review(id, opts = {})
  data, _status_code, _headers = release_fraud_review_with_http_info(id, opts)
  data
end

#release_fraud_review_with_http_info(id, opts = {}) ⇒ Array<(GetFraudReview200Response, Integer, Hash)>

Release fraud review Completes the fraud review identified by the given `id` in the URL, and releases the associated reward to the recipient.

Parameters:

  • id (String)

    The ID of the reward that should be released.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(GetFraudReview200Response, Integer, Hash)>)

    GetFraudReview200Response data, response status code and response headers



3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
# File 'lib/tremendous/api/tremendous_api.rb', line 3969

def release_fraud_review_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.release_fraud_review ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.release_fraud_review"
  end
  # resource path
  local_var_path = '/fraud_reviews/{id}/release'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetFraudReview200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.release_fraud_review",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#release_fraud_review\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#resend_reward(id, opts = {}) ⇒ Object

Resend reward Resends a reward, identified by the given id in the URL, to its recipient. Only rewards with a previous delivery failure can be resent.

Parameters:

  • id (String)

    ID of the reward that should be resent

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :resend_reward_request (ResendRewardRequest)

    You can update the email or phone number used for the resend. You can only provide one of `updated_email` or `updated_phone`, not both.

Returns:

  • (Object)


4023
4024
4025
4026
# File 'lib/tremendous/api/tremendous_api.rb', line 4023

def resend_reward(id, opts = {})
  data, _status_code, _headers = resend_reward_with_http_info(id, opts)
  data
end

#resend_reward_with_http_info(id, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Resend reward Resends a reward, identified by the given `id` in the URL, to its recipient. Only rewards with a previous delivery failure can be resent.

Parameters:

  • id (String)

    ID of the reward that should be resent

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :resend_reward_request (ResendRewardRequest)

    You can update the email or phone number used for the resend. You can only provide one of `updated_email` or `updated_phone`, not both.

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
# File 'lib/tremendous/api/tremendous_api.rb', line 4034

def resend_reward_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.resend_reward ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.resend_reward"
  end
  pattern = Regexp.new(/[A-Z0-9]{4,20}/)
  if @api_client.config.client_side_validation && id !~ pattern
    fail ArgumentError, "invalid value for 'id' when calling TremendousApi.resend_reward, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/rewards/{id}/resend'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'resend_reward_request'])

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.resend_reward",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#resend_reward\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#simulate_webhook(id, simulate_webhook_request, opts = {}) ⇒ String

Test webhook 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

Parameters:

  • id (String)

    ID of the webhook to test

  • simulate_webhook_request (SimulateWebhookRequest)

    Webhook details

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (String)


4098
4099
4100
4101
# File 'lib/tremendous/api/tremendous_api.rb', line 4098

def simulate_webhook(id, simulate_webhook_request, opts = {})
  data, _status_code, _headers = simulate_webhook_with_http_info(id, simulate_webhook_request, opts)
  data
end

#simulate_webhook_with_http_info(id, simulate_webhook_request, opts = {}) ⇒ Array<(String, Integer, Hash)>

Test webhook 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

Parameters:

  • id (String)

    ID of the webhook to test

  • simulate_webhook_request (SimulateWebhookRequest)

    Webhook details

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(String, Integer, Hash)>)

    String data, response status code and response headers



4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
# File 'lib/tremendous/api/tremendous_api.rb', line 4109

def simulate_webhook_with_http_info(id, simulate_webhook_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.simulate_webhook ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.simulate_webhook"
  end
  pattern = Regexp.new(/[A-Z0-9]{4,20}/)
  if @api_client.config.client_side_validation && id !~ pattern
    fail ArgumentError, "invalid value for 'id' when calling TremendousApi.simulate_webhook, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'simulate_webhook_request' is set
  if @api_client.config.client_side_validation && simulate_webhook_request.nil?
    fail ArgumentError, "Missing the required parameter 'simulate_webhook_request' when calling TremendousApi.simulate_webhook"
  end
  # resource path
  local_var_path = '/webhooks/{id}/simulate'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['text/html', 'application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(simulate_webhook_request)

  # return_type
  return_type = opts[:debug_return_type] || 'String'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.simulate_webhook",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#simulate_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_campaign(id, update_campaign_request, opts = {}) ⇒ CreateCampaign200Response

Update campaign

Parameters:

  • id (String)

    ID of the campaign that should be updated

  • update_campaign_request (UpdateCampaignRequest)

    Campaign details

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



4176
4177
4178
4179
# File 'lib/tremendous/api/tremendous_api.rb', line 4176

def update_campaign(id, update_campaign_request, opts = {})
  data, _status_code, _headers = update_campaign_with_http_info(id, update_campaign_request, opts)
  data
end

#update_campaign_with_http_info(id, update_campaign_request, opts = {}) ⇒ Array<(CreateCampaign200Response, Integer, Hash)>

Update campaign

Parameters:

  • id (String)

    ID of the campaign that should be updated

  • update_campaign_request (UpdateCampaignRequest)

    Campaign details

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CreateCampaign200Response, Integer, Hash)>)

    CreateCampaign200Response data, response status code and response headers



4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
# File 'lib/tremendous/api/tremendous_api.rb', line 4186

def update_campaign_with_http_info(id, update_campaign_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.update_campaign ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.update_campaign"
  end
  pattern = Regexp.new(/[A-Z0-9]{4,20}/)
  if @api_client.config.client_side_validation && id !~ pattern
    fail ArgumentError, "invalid value for 'id' when calling TremendousApi.update_campaign, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'update_campaign_request' is set
  if @api_client.config.client_side_validation && update_campaign_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_campaign_request' when calling TremendousApi.update_campaign"
  end
  # resource path
  local_var_path = '/campaigns/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(update_campaign_request)

  # return_type
  return_type = opts[:debug_return_type] || 'CreateCampaign200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.update_campaign",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#update_campaign\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_fraud_rule_list(rule_type, update_fraud_rule_list_request, opts = {}) ⇒ UpdateFraudRuleList200Response

Update fraud rule list Use this endpoint to modify a list associated with an already-configured rule. Add and remove operations supported. For example, to append new IPs to the review_ip rule, a valid JSON body would be: json { \"operation\": \"add\", \"config\": { \"ips\": [\"123.123.123.123\"] } }

Parameters:

  • rule_type (String)

    The rule type to create or update.

  • update_fraud_rule_list_request (UpdateFraudRuleListRequest)

    The lists to add or remove from the current configuration

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



4254
4255
4256
4257
# File 'lib/tremendous/api/tremendous_api.rb', line 4254

def update_fraud_rule_list(rule_type, update_fraud_rule_list_request, opts = {})
  data, _status_code, _headers = update_fraud_rule_list_with_http_info(rule_type, update_fraud_rule_list_request, opts)
  data
end

#update_fraud_rule_list_with_http_info(rule_type, update_fraud_rule_list_request, opts = {}) ⇒ Array<(UpdateFraudRuleList200Response, Integer, Hash)>

Update fraud rule list Use this endpoint to modify a list associated with an already-configured rule. Add and remove operations supported. For example, to append new IPs to the `review_ip` rule, a valid JSON body would be: ```json { &quot;operation&quot;: &quot;add&quot;, &quot;config&quot;: { &quot;ips&quot;: [&quot;123.123.123.123&quot;] } } ```

Parameters:

  • rule_type (String)

    The rule type to create or update.

  • update_fraud_rule_list_request (UpdateFraudRuleListRequest)

    The lists to add or remove from the current configuration

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
# File 'lib/tremendous/api/tremendous_api.rb', line 4265

def update_fraud_rule_list_with_http_info(rule_type, update_fraud_rule_list_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.update_fraud_rule_list ...'
  end
  # verify the required parameter 'rule_type' is set
  if @api_client.config.client_side_validation && rule_type.nil?
    fail ArgumentError, "Missing the required parameter 'rule_type' when calling TremendousApi.update_fraud_rule_list"
  end
  # verify enum value
  allowable_values = ["review_country", "review_ip", "review_email", "allow_ip", "allow_email"]
  if @api_client.config.client_side_validation && !allowable_values.include?(rule_type)
    fail ArgumentError, "invalid value for \"rule_type\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'update_fraud_rule_list_request' is set
  if @api_client.config.client_side_validation && update_fraud_rule_list_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_fraud_rule_list_request' when calling TremendousApi.update_fraud_rule_list"
  end
  # resource path
  local_var_path = '/fraud_rules/{rule_type}/update_list'.sub('{' + 'rule_type' + '}', CGI.escape(rule_type.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(update_fraud_rule_list_request)

  # return_type
  return_type = opts[:debug_return_type] || 'UpdateFraudRuleList200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.update_fraud_rule_list",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#update_fraud_rule_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_member(id, update_member_request, opts = {}) ⇒ CreateMember200Response

Update member Updates the role of an existing member, identified by the given id in the URL. Check the Roles API for the roles available within the organization.

Parameters:

  • id (String)

    ID of the member to update

  • update_member_request (UpdateMemberRequest)

    Attributes to update on the member

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



4333
4334
4335
4336
# File 'lib/tremendous/api/tremendous_api.rb', line 4333

def update_member(id, update_member_request, opts = {})
  data, _status_code, _headers = update_member_with_http_info(id, update_member_request, opts)
  data
end

#update_member_with_http_info(id, update_member_request, opts = {}) ⇒ Array<(CreateMember200Response, Integer, Hash)>

Update member Updates the role of an existing member, identified by the given `id` in the URL. Check the Roles API for the roles available within the organization.

Parameters:

  • id (String)

    ID of the member to update

  • update_member_request (UpdateMemberRequest)

    Attributes to update on the member

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CreateMember200Response, Integer, Hash)>)

    CreateMember200Response data, response status code and response headers



4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
# File 'lib/tremendous/api/tremendous_api.rb', line 4344

def update_member_with_http_info(id, update_member_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TremendousApi.update_member ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.update_member"
  end
  pattern = Regexp.new(/[A-Z0-9]{4,20}/)
  if @api_client.config.client_side_validation && id !~ pattern
    fail ArgumentError, "invalid value for 'id' when calling TremendousApi.update_member, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'update_member_request' is set
  if @api_client.config.client_side_validation && update_member_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_member_request' when calling TremendousApi.update_member"
  end
  # resource path
  local_var_path = '/members/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(update_member_request)

  # return_type
  return_type = opts[:debug_return_type] || 'CreateMember200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerApiKey']

  new_options = opts.merge(
    :operation => :"TremendousApi.update_member",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TremendousApi#update_member\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end