tremendous_ruby 5.13.0 → 5.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. checksums.yaml +4 -4
  2. data/lib/tremendous/api/tremendous_api.rb +265 -7
  3. data/lib/tremendous/models/create_field.rb +320 -0
  4. data/lib/tremendous/models/create_field200_response.rb +237 -0
  5. data/lib/tremendous/models/create_field_request.rb +320 -0
  6. data/lib/tremendous/models/create_field_request_data.rb +224 -0
  7. data/lib/tremendous/models/create_invoice_request.rb +48 -2
  8. data/lib/tremendous/models/create_topup200_response.rb +220 -0
  9. data/lib/tremendous/models/create_topup_request.rb +292 -0
  10. data/lib/tremendous/models/field.rb +37 -5
  11. data/lib/tremendous/models/fraud_review.rb +66 -56
  12. data/lib/tremendous/models/fraud_review_base.rb +358 -0
  13. data/lib/tremendous/models/fraud_review_list_item.rb +85 -4
  14. data/lib/tremendous/models/fraud_review_redemption_method.rb +7 -5
  15. data/lib/tremendous/models/get_fraud_review200_response_fraud_review.rb +66 -56
  16. data/lib/tremendous/models/invoice.rb +26 -2
  17. data/lib/tremendous/models/list_fields200_response_fields_inner.rb +37 -5
  18. data/lib/tremendous/models/list_fields200_response_fields_inner_data.rb +236 -0
  19. data/lib/tremendous/models/list_fraud_reviews200_response_fraud_reviews_inner.rb +85 -4
  20. data/lib/tremendous/models/list_fraud_reviews200_response_fraud_reviews_inner_geo.rb +242 -0
  21. data/lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb +5 -0
  22. data/lib/tremendous/models/list_invoices200_response_invoices_inner.rb +26 -2
  23. data/lib/tremendous/models/list_topups200_response.rb +232 -0
  24. data/lib/tremendous/models/list_topups200_response_topups_inner.rb +326 -0
  25. data/lib/tremendous/models/topup.rb +326 -0
  26. data/lib/tremendous/models/topup_create_request.rb +292 -0
  27. data/lib/tremendous/version.rb +1 -1
  28. data/lib/tremendous.rb +13 -1
  29. metadata +14 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f6444bf51beb3a23f2b5372ef7dbd452de68808caf545876e914e9ad47d24155
4
- data.tar.gz: d7015e2adfc340231076d4d69a775d520a9f6aa6bdf3b027b013fef700181aae
3
+ metadata.gz: 8eaeb1b57c85cd5112378f641e50ca2c7e37600857fe56116146e0e3a47b951c
4
+ data.tar.gz: 07a62d978ad70d5c8c2e4ec020b1535258fbf1dd014d04124f2c8a4ca9f40446
5
5
  SHA512:
6
- metadata.gz: 69a3c98e1376554ff58f7b56156361599aeb4a47441aec7b7dea65d19969ff29fb63a79c6cb1e13b0b81becaf10ef9903ca258e06b8fcabd0a1188d793be9656
7
- data.tar.gz: 2e385b12754d2922e30355a47600f6d58412bbb6deebbdfac3d29023c798ef2bf8be5a80d4ffe323f1eb7d5b766de8858dac45481516f64e2147cd434afb7d8e
6
+ metadata.gz: 18007403ac4a6dc63966de049f0033a9e455296e070ec349bb4f5b0da0078aa1568eea6aefb0461e0e6cb98aa04c88203750d356116975c0912e686cba4c3378
7
+ data.tar.gz: a55869240fef9138b37e2f35c93ea99ecd9ff21133b10c0c3cdf97ff4c1073e1b5a5958bcb1ccc26f8def68f481ebeefd500c4ed9e44cbb171caab900440a0d9
@@ -551,8 +551,76 @@ module Tremendous
551
551
  return data, status_code, headers
552
552
  end
553
553
 
554
+ # Create field
555
+ # Create a custom field to be associated with rewards. Custom fields can be used for reporting and analytics purposes.
556
+ # @param create_field_request [CreateFieldRequest] Field details
557
+ # @param [Hash] opts the optional parameters
558
+ # @return [CreateField200Response]
559
+ def create_field(create_field_request, opts = {})
560
+ data, _status_code, _headers = create_field_with_http_info(create_field_request, opts)
561
+ data
562
+ end
563
+
564
+ # Create field
565
+ # Create a custom field to be associated with rewards. Custom fields can be used for reporting and analytics purposes.
566
+ # @param create_field_request [CreateFieldRequest] Field details
567
+ # @param [Hash] opts the optional parameters
568
+ # @return [Array<(CreateField200Response, Integer, Hash)>] CreateField200Response data, response status code and response headers
569
+ def create_field_with_http_info(create_field_request, opts = {})
570
+ if @api_client.config.debugging
571
+ @api_client.config.logger.debug 'Calling API: TremendousApi.create_field ...'
572
+ end
573
+ # verify the required parameter 'create_field_request' is set
574
+ if @api_client.config.client_side_validation && create_field_request.nil?
575
+ fail ArgumentError, "Missing the required parameter 'create_field_request' when calling TremendousApi.create_field"
576
+ end
577
+ # resource path
578
+ local_var_path = '/fields'
579
+
580
+ # query parameters
581
+ query_params = opts[:query_params] || {}
582
+
583
+ # header parameters
584
+ header_params = opts[:header_params] || {}
585
+ # HTTP header 'Accept' (if needed)
586
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
587
+ # HTTP header 'Content-Type'
588
+ content_type = @api_client.select_header_content_type(['application/json'])
589
+ if !content_type.nil?
590
+ header_params['Content-Type'] = content_type
591
+ end
592
+
593
+ # form parameters
594
+ form_params = opts[:form_params] || {}
595
+
596
+ # http body (model)
597
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_field_request)
598
+
599
+ # return_type
600
+ return_type = opts[:debug_return_type] || 'CreateField200Response'
601
+
602
+ # auth_names
603
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
604
+
605
+ new_options = opts.merge(
606
+ :operation => :"TremendousApi.create_field",
607
+ :header_params => header_params,
608
+ :query_params => query_params,
609
+ :form_params => form_params,
610
+ :body => post_body,
611
+ :auth_names => auth_names,
612
+ :return_type => return_type
613
+ )
614
+
615
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
616
+ if @api_client.config.debugging
617
+ @api_client.config.logger.debug "API called: TremendousApi#create_field\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
618
+ end
619
+ return data, status_code, headers
620
+ end
621
+
554
622
  # Create invoice
555
- # Creating an invoice is the way for your organization to fund your account's balance. 1. Create an invoice 2. Pay the invoice 3. Funds get added to your account's balance ## Request body <div class=\"object-schema-request-schema\"> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">po_number</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Reference to the purchase order number within your organization</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">amount</code> </div> </td><td><span class=\"property-type\">number</span> <span class=\"property-format\">double</span></td><td><p>Amount of the invoice in USD</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">memo</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>A note to be included in the invoice. This is for your internal use and will not be visible to the recipient.</p> </td></tr> </tbody> </table> </div>
623
+ # Creating an invoice is the way for your organization to fund your account's balance. 1. Create an invoice 2. Pay the invoice 3. Funds get added to your account's balance ## Request body <div class=\"object-schema-request-schema\"> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">po_number</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Reference to the purchase order number within your organization</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">amount</code> </div> </td><td><span class=\"property-type\">number</span> <span class=\"property-format\">double</span></td><td><p>Amount of the invoice</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">currency</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Currency of the invoice</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">memo</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>A note to be included in the invoice. This is for your internal use and will not be visible to the recipient.</p> </td></tr> </tbody> </table> </div>
556
624
  # @param create_invoice_request [CreateInvoiceRequest] Invoice details
557
625
  # @param [Hash] opts the optional parameters
558
626
  # @return [CreateInvoice200Response]
@@ -562,7 +630,7 @@ module Tremendous
562
630
  end
563
631
 
564
632
  # Create invoice
565
- # Creating an invoice is the way for your organization to fund your account&#39;s balance. 1. Create an invoice 2. Pay the invoice 3. Funds get added to your account&#39;s balance ## Request body &lt;div class&#x3D;\&quot;object-schema-request-schema\&quot;&gt; &lt;table&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Property&lt;/th&gt; &lt;th&gt;Type&lt;/th&gt; &lt;th&gt;Description&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody class&#x3D;\&quot;object-schema-table-body\&quot;&gt; &lt;tr class&#x3D;\&quot;\&quot;&gt;&lt;td&gt;&lt;div class&#x3D;\&quot;property-name\&quot;&gt; &lt;code class&#x3D;\&quot;property-name\&quot;&gt;po_number&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;\&quot;property-type\&quot;&gt;string&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Reference to the purchase order number within your organization&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr class&#x3D;\&quot;\&quot;&gt;&lt;td&gt;&lt;div class&#x3D;\&quot;property-name\&quot;&gt; &lt;code class&#x3D;\&quot;property-name\&quot;&gt;amount&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;\&quot;property-type\&quot;&gt;number&lt;/span&gt; &lt;span class&#x3D;\&quot;property-format\&quot;&gt;double&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Amount of the invoice in USD&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr class&#x3D;\&quot;\&quot;&gt;&lt;td&gt;&lt;div class&#x3D;\&quot;property-name\&quot;&gt; &lt;code class&#x3D;\&quot;property-name\&quot;&gt;memo&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;\&quot;property-type\&quot;&gt;string&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;A note to be included in the invoice. This is for your internal use and will not be visible to the recipient.&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/div&gt;
633
+ # Creating an invoice is the way for your organization to fund your account&#39;s balance. 1. Create an invoice 2. Pay the invoice 3. Funds get added to your account&#39;s balance ## Request body &lt;div class&#x3D;\&quot;object-schema-request-schema\&quot;&gt; &lt;table&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Property&lt;/th&gt; &lt;th&gt;Type&lt;/th&gt; &lt;th&gt;Description&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody class&#x3D;\&quot;object-schema-table-body\&quot;&gt; &lt;tr class&#x3D;\&quot;\&quot;&gt;&lt;td&gt;&lt;div class&#x3D;\&quot;property-name\&quot;&gt; &lt;code class&#x3D;\&quot;property-name\&quot;&gt;po_number&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;\&quot;property-type\&quot;&gt;string&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Reference to the purchase order number within your organization&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr class&#x3D;\&quot;\&quot;&gt;&lt;td&gt;&lt;div class&#x3D;\&quot;property-name\&quot;&gt; &lt;code class&#x3D;\&quot;property-name\&quot;&gt;amount&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;\&quot;property-type\&quot;&gt;number&lt;/span&gt; &lt;span class&#x3D;\&quot;property-format\&quot;&gt;double&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Amount of the invoice&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr class&#x3D;\&quot;\&quot;&gt;&lt;td&gt;&lt;div class&#x3D;\&quot;property-name\&quot;&gt; &lt;code class&#x3D;\&quot;property-name\&quot;&gt;currency&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;\&quot;property-type\&quot;&gt;string&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Currency of the invoice&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr class&#x3D;\&quot;\&quot;&gt;&lt;td&gt;&lt;div class&#x3D;\&quot;property-name\&quot;&gt; &lt;code class&#x3D;\&quot;property-name\&quot;&gt;memo&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;\&quot;property-type\&quot;&gt;string&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;A note to be included in the invoice. This is for your internal use and will not be visible to the recipient.&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/div&gt;
566
634
  # @param create_invoice_request [CreateInvoiceRequest] Invoice details
567
635
  # @param [Hash] opts the optional parameters
568
636
  # @return [Array<(CreateInvoice200Response, Integer, Hash)>] CreateInvoice200Response data, response status code and response headers
@@ -891,6 +959,68 @@ module Tremendous
891
959
  return data, status_code, headers
892
960
  end
893
961
 
962
+ # Create a topup
963
+ # @param [Hash] opts the optional parameters
964
+ # @option opts [CreateTopupRequest] :create_topup_request Parameters required to create a new topup. The &#x60;idempotency_key&#x60; should be unique for each request.
965
+ # @return [CreateTopup200Response]
966
+ def create_topup(opts = {})
967
+ data, _status_code, _headers = create_topup_with_http_info(opts)
968
+ data
969
+ end
970
+
971
+ # Create a topup
972
+ # @param [Hash] opts the optional parameters
973
+ # @option opts [CreateTopupRequest] :create_topup_request Parameters required to create a new topup. The &#x60;idempotency_key&#x60; should be unique for each request.
974
+ # @return [Array<(CreateTopup200Response, Integer, Hash)>] CreateTopup200Response data, response status code and response headers
975
+ def create_topup_with_http_info(opts = {})
976
+ if @api_client.config.debugging
977
+ @api_client.config.logger.debug 'Calling API: TremendousApi.create_topup ...'
978
+ end
979
+ # resource path
980
+ local_var_path = '/topups'
981
+
982
+ # query parameters
983
+ query_params = opts[:query_params] || {}
984
+
985
+ # header parameters
986
+ header_params = opts[:header_params] || {}
987
+ # HTTP header 'Accept' (if needed)
988
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
989
+ # HTTP header 'Content-Type'
990
+ content_type = @api_client.select_header_content_type(['application/json'])
991
+ if !content_type.nil?
992
+ header_params['Content-Type'] = content_type
993
+ end
994
+
995
+ # form parameters
996
+ form_params = opts[:form_params] || {}
997
+
998
+ # http body (model)
999
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'create_topup_request'])
1000
+
1001
+ # return_type
1002
+ return_type = opts[:debug_return_type] || 'CreateTopup200Response'
1003
+
1004
+ # auth_names
1005
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
1006
+
1007
+ new_options = opts.merge(
1008
+ :operation => :"TremendousApi.create_topup",
1009
+ :header_params => header_params,
1010
+ :query_params => query_params,
1011
+ :form_params => form_params,
1012
+ :body => post_body,
1013
+ :auth_names => auth_names,
1014
+ :return_type => return_type
1015
+ )
1016
+
1017
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
1018
+ if @api_client.config.debugging
1019
+ @api_client.config.logger.debug "API called: TremendousApi#create_topup\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1020
+ end
1021
+ return data, status_code, headers
1022
+ end
1023
+
894
1024
  # Create webhook
895
1025
  # Tremendous uses webhooks as a notification system for various events that happen in your account. > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > [Read it here](/docs/webhooks-1) Every organization can define a single webhook endpoint where we send requests to, whenever an event happens. This endpoint allows you to setup that endpoint. The URL of the endpoint can be changed by making a request to this endpoint again with the new URL. ## Request body <div class=\"object-schema-request-schema\"> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">url</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">uri</span></td><td><p>URL the webhook will make requests to</p> </td></tr> </tbody> </table> </div>
896
1026
  # @param create_webhook_request [CreateWebhookRequest] Webhook details
@@ -1685,8 +1815,8 @@ module Tremendous
1685
1815
  end
1686
1816
 
1687
1817
  # Retrieve funding source
1688
- # Retrieve a funding source, identified by the given `id` in the URL
1689
- # @param id [String] ID of the funding source that should be retrieved
1818
+ # Retrieve a funding source, identified by the given `id` in the URL. You can also use the special keyword `BALANCE` (case-insensitive) to retrieve the organization's balance funding source.
1819
+ # @param id [String] ID of the funding source that should be retrieved. Can also use \&quot;BALANCE\&quot; (case-insensitive) to retrieve the organization&#39;s balance funding source.
1690
1820
  # @param [Hash] opts the optional parameters
1691
1821
  # @return [GetFundingSource200Response]
1692
1822
  def get_funding_source(id, opts = {})
@@ -1695,8 +1825,8 @@ module Tremendous
1695
1825
  end
1696
1826
 
1697
1827
  # Retrieve funding source
1698
- # Retrieve a funding source, identified by the given &#x60;id&#x60; in the URL
1699
- # @param id [String] ID of the funding source that should be retrieved
1828
+ # Retrieve a funding source, identified by the given &#x60;id&#x60; in the URL. You can also use the special keyword &#x60;BALANCE&#x60; (case-insensitive) to retrieve the organization&#39;s balance funding source.
1829
+ # @param id [String] ID of the funding source that should be retrieved. Can also use \&quot;BALANCE\&quot; (case-insensitive) to retrieve the organization&#39;s balance funding source.
1700
1830
  # @param [Hash] opts the optional parameters
1701
1831
  # @return [Array<(GetFundingSource200Response, Integer, Hash)>] GetFundingSource200Response data, response status code and response headers
1702
1832
  def get_funding_source_with_http_info(id, opts = {})
@@ -1707,7 +1837,7 @@ module Tremendous
1707
1837
  if @api_client.config.client_side_validation && id.nil?
1708
1838
  fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.get_funding_source"
1709
1839
  end
1710
- pattern = Regexp.new(/[A-Z0-9]{4,20}/)
1840
+ pattern = Regexp.new(/^([A-Z0-9]{4,20}|[Bb][Aa][Ll][Aa][Nn][Cc][Ee])$/)
1711
1841
  if @api_client.config.client_side_validation && id !~ pattern
1712
1842
  fail ArgumentError, "invalid value for 'id' when calling TremendousApi.get_funding_source, must conform to the pattern #{pattern}."
1713
1843
  end
@@ -2209,6 +2339,74 @@ module Tremendous
2209
2339
  return data, status_code, headers
2210
2340
  end
2211
2341
 
2342
+ # Retrieve single topup
2343
+ # Retrieve a topup, identified by the given `id` in the URL.
2344
+ # @param id [String] ID of the topup request that should be retrieved
2345
+ # @param [Hash] opts the optional parameters
2346
+ # @return [CreateTopup200Response]
2347
+ def get_topup(id, opts = {})
2348
+ data, _status_code, _headers = get_topup_with_http_info(id, opts)
2349
+ data
2350
+ end
2351
+
2352
+ # Retrieve single topup
2353
+ # Retrieve a topup, identified by the given &#x60;id&#x60; in the URL.
2354
+ # @param id [String] ID of the topup request that should be retrieved
2355
+ # @param [Hash] opts the optional parameters
2356
+ # @return [Array<(CreateTopup200Response, Integer, Hash)>] CreateTopup200Response data, response status code and response headers
2357
+ def get_topup_with_http_info(id, opts = {})
2358
+ if @api_client.config.debugging
2359
+ @api_client.config.logger.debug 'Calling API: TremendousApi.get_topup ...'
2360
+ end
2361
+ # verify the required parameter 'id' is set
2362
+ if @api_client.config.client_side_validation && id.nil?
2363
+ fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.get_topup"
2364
+ end
2365
+ pattern = Regexp.new(/[A-Z0-9]{4,20}/)
2366
+ if @api_client.config.client_side_validation && id !~ pattern
2367
+ fail ArgumentError, "invalid value for 'id' when calling TremendousApi.get_topup, must conform to the pattern #{pattern}."
2368
+ end
2369
+
2370
+ # resource path
2371
+ local_var_path = '/topups/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
2372
+
2373
+ # query parameters
2374
+ query_params = opts[:query_params] || {}
2375
+
2376
+ # header parameters
2377
+ header_params = opts[:header_params] || {}
2378
+ # HTTP header 'Accept' (if needed)
2379
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
2380
+
2381
+ # form parameters
2382
+ form_params = opts[:form_params] || {}
2383
+
2384
+ # http body (model)
2385
+ post_body = opts[:debug_body]
2386
+
2387
+ # return_type
2388
+ return_type = opts[:debug_return_type] || 'CreateTopup200Response'
2389
+
2390
+ # auth_names
2391
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
2392
+
2393
+ new_options = opts.merge(
2394
+ :operation => :"TremendousApi.get_topup",
2395
+ :header_params => header_params,
2396
+ :query_params => query_params,
2397
+ :form_params => form_params,
2398
+ :body => post_body,
2399
+ :auth_names => auth_names,
2400
+ :return_type => return_type
2401
+ )
2402
+
2403
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2404
+ if @api_client.config.debugging
2405
+ @api_client.config.logger.debug "API called: TremendousApi#get_topup\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2406
+ end
2407
+ return data, status_code, headers
2408
+ end
2409
+
2212
2410
  # Retrieve webhook
2213
2411
  # > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > [Read it here](/docs/webhooks-1)
2214
2412
  # @param id [String] ID of the webhook to retrieve
@@ -3299,6 +3497,66 @@ module Tremendous
3299
3497
  return data, status_code, headers
3300
3498
  end
3301
3499
 
3500
+ # List topups
3501
+ # Retrieve a list of all topup requests.
3502
+ # @param [Hash] opts the optional parameters
3503
+ # @option opts [Integer] :offset Offsets the returned list by the given number of topups. The returned topups are ordered and offset by their creation date (DESC).
3504
+ # @return [ListTopups200Response]
3505
+ def list_topups(opts = {})
3506
+ data, _status_code, _headers = list_topups_with_http_info(opts)
3507
+ data
3508
+ end
3509
+
3510
+ # List topups
3511
+ # Retrieve a list of all topup requests.
3512
+ # @param [Hash] opts the optional parameters
3513
+ # @option opts [Integer] :offset Offsets the returned list by the given number of topups. The returned topups are ordered and offset by their creation date (DESC).
3514
+ # @return [Array<(ListTopups200Response, Integer, Hash)>] ListTopups200Response data, response status code and response headers
3515
+ def list_topups_with_http_info(opts = {})
3516
+ if @api_client.config.debugging
3517
+ @api_client.config.logger.debug 'Calling API: TremendousApi.list_topups ...'
3518
+ end
3519
+ # resource path
3520
+ local_var_path = '/topups'
3521
+
3522
+ # query parameters
3523
+ query_params = opts[:query_params] || {}
3524
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
3525
+
3526
+ # header parameters
3527
+ header_params = opts[:header_params] || {}
3528
+ # HTTP header 'Accept' (if needed)
3529
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
3530
+
3531
+ # form parameters
3532
+ form_params = opts[:form_params] || {}
3533
+
3534
+ # http body (model)
3535
+ post_body = opts[:debug_body]
3536
+
3537
+ # return_type
3538
+ return_type = opts[:debug_return_type] || 'ListTopups200Response'
3539
+
3540
+ # auth_names
3541
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
3542
+
3543
+ new_options = opts.merge(
3544
+ :operation => :"TremendousApi.list_topups",
3545
+ :header_params => header_params,
3546
+ :query_params => query_params,
3547
+ :form_params => form_params,
3548
+ :body => post_body,
3549
+ :auth_names => auth_names,
3550
+ :return_type => return_type
3551
+ )
3552
+
3553
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
3554
+ if @api_client.config.debugging
3555
+ @api_client.config.logger.debug "API called: TremendousApi#list_topups\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
3556
+ end
3557
+ return data, status_code, headers
3558
+ end
3559
+
3302
3560
  # List events
3303
3561
  # Lists all event types that can be sent to the configured webhook endpoint. > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > [Read it here](/docs/webhooks-1)
3304
3562
  # @param id [String] ID of the webhook to list the events for
@@ -0,0 +1,320 @@
1
+ =begin
2
+ #API Endpoints
3
+
4
+ #Deliver monetary rewards and incentives to employees, customers, survey participants, and more through the Tremendous API. For organizational tasks, like managing your organization and its members within Tremendous, please see the Tremendous Organizational API.
5
+
6
+ The version of the OpenAPI document: 2
7
+ Contact: developers@tremendous.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.12.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Tremendous
17
+ class CreateField
18
+ # A human-readable name for the field. Can contain letters, numbers, spaces, and underscores. The field's `label` (a reference name used in API requests) will be automatically derived from this value.
19
+ attr_accessor :display_name
20
+
21
+ # Type of the values of the field <table> <thead> <tr> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>Checkbox</code></td> <td>A boolean value (true/false)</td> </tr> <tr> <td><code>Currency</code></td> <td>A monetary value</td> </tr> <tr> <td><code>Date</code></td> <td>A date value</td> </tr> <tr> <td><code>Dropdown</code></td> <td>A single selection from predefined options (see <code>data.options</code>)</td> </tr> <tr> <td><code>Email</code></td> <td>An email address</td> </tr> <tr> <td><code>List</code></td> <td>Multiple selections from predefined options (see <code>data.options</code>)</td> </tr> <tr> <td><code>Number</code></td> <td>A numeric value</td> </tr> <tr> <td><code>Phone</code></td> <td>A phone number</td> </tr> <tr> <td><code>Text</code></td> <td>A single-line text value</td> </tr> <tr> <td><code>TextArea</code></td> <td>A multi-line text value</td> </tr> </tbody> </table>
22
+ attr_accessor :data_type
23
+
24
+ attr_accessor :data
25
+
26
+ # Is this field required (true) or optional (false). Defaults to false.
27
+ attr_accessor :required
28
+
29
+ # A description of the field's purpose
30
+ attr_accessor :description
31
+
32
+ class EnumAttributeValidator
33
+ attr_reader :datatype
34
+ attr_reader :allowable_values
35
+
36
+ def initialize(datatype, allowable_values)
37
+ @allowable_values = allowable_values.map do |value|
38
+ case datatype.to_s
39
+ when /Integer/i
40
+ value.to_i
41
+ when /Float/i
42
+ value.to_f
43
+ else
44
+ value
45
+ end
46
+ end
47
+ end
48
+
49
+ def valid?(value)
50
+ !value || allowable_values.include?(value)
51
+ end
52
+ end
53
+
54
+ # Attribute mapping from ruby-style variable name to JSON key.
55
+ def self.attribute_map
56
+ {
57
+ :'display_name' => :'display_name',
58
+ :'data_type' => :'data_type',
59
+ :'data' => :'data',
60
+ :'required' => :'required',
61
+ :'description' => :'description'
62
+ }
63
+ end
64
+
65
+ # Returns attribute mapping this model knows about
66
+ def self.acceptable_attribute_map
67
+ attribute_map
68
+ end
69
+
70
+ # Returns all the JSON keys this model knows about
71
+ def self.acceptable_attributes
72
+ acceptable_attribute_map.values
73
+ end
74
+
75
+ # Attribute type mapping.
76
+ def self.openapi_types
77
+ {
78
+ :'display_name' => :'String',
79
+ :'data_type' => :'String',
80
+ :'data' => :'CreateFieldRequestData',
81
+ :'required' => :'Boolean',
82
+ :'description' => :'String'
83
+ }
84
+ end
85
+
86
+ # List of attributes with nullable: true
87
+ def self.openapi_nullable
88
+ Set.new([
89
+ ])
90
+ end
91
+
92
+ # Initializes the object
93
+ # @param [Hash] attributes Model attributes in the form of hash
94
+ def initialize(attributes = {})
95
+ if (!attributes.is_a?(Hash))
96
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::CreateField` initialize method"
97
+ end
98
+
99
+ # check to see if the attribute exists and convert string to symbol for hash key
100
+ acceptable_attribute_map = self.class.acceptable_attribute_map
101
+ attributes = attributes.each_with_object({}) { |(k, v), h|
102
+ if (!acceptable_attribute_map.key?(k.to_sym))
103
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::CreateField`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
104
+ end
105
+ h[k.to_sym] = v
106
+ }
107
+
108
+ if attributes.key?(:'display_name')
109
+ self.display_name = attributes[:'display_name']
110
+ else
111
+ self.display_name = nil
112
+ end
113
+
114
+ if attributes.key?(:'data_type')
115
+ self.data_type = attributes[:'data_type']
116
+ else
117
+ self.data_type = nil
118
+ end
119
+
120
+ if attributes.key?(:'data')
121
+ self.data = attributes[:'data']
122
+ end
123
+
124
+ if attributes.key?(:'required')
125
+ self.required = attributes[:'required']
126
+ else
127
+ self.required = false
128
+ end
129
+
130
+ if attributes.key?(:'description')
131
+ self.description = attributes[:'description']
132
+ end
133
+ end
134
+
135
+ # Show invalid properties with the reasons. Usually used together with valid?
136
+ # @return Array for valid properties with the reasons
137
+ def list_invalid_properties
138
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
139
+ invalid_properties = Array.new
140
+ if @display_name.nil?
141
+ invalid_properties.push('invalid value for "display_name", display_name cannot be nil.')
142
+ end
143
+
144
+ if @data_type.nil?
145
+ invalid_properties.push('invalid value for "data_type", data_type cannot be nil.')
146
+ end
147
+
148
+ invalid_properties
149
+ end
150
+
151
+ # Check to see if the all the properties in the model are valid
152
+ # @return true if the model is valid
153
+ def valid?
154
+ warn '[DEPRECATED] the `valid?` method is obsolete'
155
+ return false if @display_name.nil?
156
+ return false if @data_type.nil?
157
+ data_type_validator = EnumAttributeValidator.new('String', ["Checkbox", "Currency", "Date", "Dropdown", "Email", "List", "Number", "Phone", "Text", "TextArea"])
158
+ return false unless data_type_validator.valid?(@data_type)
159
+ true
160
+ end
161
+
162
+ # Custom attribute writer method with validation
163
+ # @param [Object] display_name Value to be assigned
164
+ def display_name=(display_name)
165
+ if display_name.nil?
166
+ fail ArgumentError, 'display_name cannot be nil'
167
+ end
168
+
169
+ @display_name = display_name
170
+ end
171
+
172
+ # Custom attribute writer method checking allowed values (enum).
173
+ # @param [Object] data_type Object to be assigned
174
+ def data_type=(data_type)
175
+ validator = EnumAttributeValidator.new('String', ["Checkbox", "Currency", "Date", "Dropdown", "Email", "List", "Number", "Phone", "Text", "TextArea"])
176
+ unless validator.valid?(data_type)
177
+ fail ArgumentError, "invalid value for \"data_type\", must be one of #{validator.allowable_values}."
178
+ end
179
+ @data_type = data_type
180
+ end
181
+
182
+ # Checks equality by comparing each attribute.
183
+ # @param [Object] Object to be compared
184
+ def ==(o)
185
+ return true if self.equal?(o)
186
+ self.class == o.class &&
187
+ display_name == o.display_name &&
188
+ data_type == o.data_type &&
189
+ data == o.data &&
190
+ required == o.required &&
191
+ description == o.description
192
+ end
193
+
194
+ # @see the `==` method
195
+ # @param [Object] Object to be compared
196
+ def eql?(o)
197
+ self == o
198
+ end
199
+
200
+ # Calculates hash code according to all attributes.
201
+ # @return [Integer] Hash code
202
+ def hash
203
+ [display_name, data_type, data, required, description].hash
204
+ end
205
+
206
+ # Builds the object from hash
207
+ # @param [Hash] attributes Model attributes in the form of hash
208
+ # @return [Object] Returns the model itself
209
+ def self.build_from_hash(attributes)
210
+ return nil unless attributes.is_a?(Hash)
211
+ attributes = attributes.transform_keys(&:to_sym)
212
+ transformed_hash = {}
213
+ openapi_types.each_pair do |key, type|
214
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
215
+ transformed_hash["#{key}"] = nil
216
+ elsif type =~ /\AArray<(.*)>/i
217
+ # check to ensure the input is an array given that the attribute
218
+ # is documented as an array but the input is not
219
+ if attributes[attribute_map[key]].is_a?(Array)
220
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
221
+ end
222
+ elsif !attributes[attribute_map[key]].nil?
223
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
224
+ end
225
+ end
226
+ new(transformed_hash)
227
+ end
228
+
229
+ # Deserializes the data based on type
230
+ # @param string type Data type
231
+ # @param string value Value to be deserialized
232
+ # @return [Object] Deserialized data
233
+ def self._deserialize(type, value)
234
+ case type.to_sym
235
+ when :Time
236
+ Time.parse(value)
237
+ when :Date
238
+ Date.parse(value)
239
+ when :String
240
+ value.to_s
241
+ when :Integer
242
+ value.to_i
243
+ when :Float
244
+ value.to_f
245
+ when :Boolean
246
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
247
+ true
248
+ else
249
+ false
250
+ end
251
+ when :Object
252
+ # generic object (usually a Hash), return directly
253
+ value
254
+ when /\AArray<(?<inner_type>.+)>\z/
255
+ inner_type = Regexp.last_match[:inner_type]
256
+ value.map { |v| _deserialize(inner_type, v) }
257
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
258
+ k_type = Regexp.last_match[:k_type]
259
+ v_type = Regexp.last_match[:v_type]
260
+ {}.tap do |hash|
261
+ value.each do |k, v|
262
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
263
+ end
264
+ end
265
+ else # model
266
+ # models (e.g. Pet) or oneOf
267
+ klass = Tremendous.const_get(type)
268
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
269
+ end
270
+ end
271
+
272
+ # Returns the string representation of the object
273
+ # @return [String] String presentation of the object
274
+ def to_s
275
+ to_hash.to_s
276
+ end
277
+
278
+ # to_body is an alias to to_hash (backward compatibility)
279
+ # @return [Hash] Returns the object in the form of hash
280
+ def to_body
281
+ to_hash
282
+ end
283
+
284
+ # Returns the object in the form of hash
285
+ # @return [Hash] Returns the object in the form of hash
286
+ def to_hash
287
+ hash = {}
288
+ self.class.attribute_map.each_pair do |attr, param|
289
+ value = self.send(attr)
290
+ if value.nil?
291
+ is_nullable = self.class.openapi_nullable.include?(attr)
292
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
293
+ end
294
+
295
+ hash[param] = _to_hash(value)
296
+ end
297
+ hash
298
+ end
299
+
300
+ # Outputs non-array value in the form of hash
301
+ # For object, use to_hash. Otherwise, just return the value
302
+ # @param [Object] value Any valid value
303
+ # @return [Hash] Returns the value in the form of hash
304
+ def _to_hash(value)
305
+ if value.is_a?(Array)
306
+ value.compact.map { |v| _to_hash(v) }
307
+ elsif value.is_a?(Hash)
308
+ {}.tap do |hash|
309
+ value.each { |k, v| hash[k] = _to_hash(v) }
310
+ end
311
+ elsif value.respond_to? :to_hash
312
+ value.to_hash
313
+ else
314
+ value
315
+ end
316
+ end
317
+
318
+ end
319
+
320
+ end