tremendous_ruby 5.1.0 → 5.3.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 +538 -13
  3. data/lib/tremendous/models/campaign_base.rb +287 -0
  4. data/lib/tremendous/models/create_member.rb +1 -35
  5. data/lib/tremendous/models/create_member_request.rb +1 -35
  6. data/lib/tremendous/models/create_organization_request_copy_settings.rb +14 -2
  7. data/lib/tremendous/models/create_public_key.rb +222 -0
  8. data/lib/tremendous/models/create_public_key200_response.rb +221 -0
  9. data/lib/tremendous/models/create_public_key_request.rb +222 -0
  10. data/lib/tremendous/models/get_member200_response_member.rb +2 -20
  11. data/lib/tremendous/models/list_forex_response.rb +223 -0
  12. data/lib/tremendous/models/list_members200_response_members_inner.rb +2 -20
  13. data/lib/tremendous/models/list_roles200_response.rb +223 -0
  14. data/lib/tremendous/models/list_roles200_response_roles_inner.rb +275 -0
  15. data/lib/tremendous/models/member.rb +2 -20
  16. data/lib/tremendous/models/member_base.rb +2 -20
  17. data/lib/tremendous/models/member_with_events.rb +2 -20
  18. data/lib/tremendous/models/member_without_events.rb +2 -20
  19. data/lib/tremendous/models/public_key.rb +257 -0
  20. data/lib/tremendous/models/public_keys_response.rb +223 -0
  21. data/lib/tremendous/models/public_keys_response_public_keys_inner.rb +257 -0
  22. data/lib/tremendous/models/role.rb +275 -0
  23. data/lib/tremendous/models/test_public_key.rb +222 -0
  24. data/lib/tremendous/models/test_public_key_request.rb +222 -0
  25. data/lib/tremendous/models/update_campaign.rb +287 -0
  26. data/lib/tremendous/models/update_campaign_request.rb +257 -0
  27. data/lib/tremendous/version.rb +1 -1
  28. data/lib/tremendous.rb +15 -0
  29. metadata +18 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7cd1bb17e2a943340878ce7a7e1dba9d79b3f28a389b04107b2f26bc3aabad3c
4
- data.tar.gz: d0645af0eca913f2c047f6b25f7ff07ee77aefad79a788821bd07b2d690407ed
3
+ metadata.gz: fd57d7d4149ca0f07fa9e1443e92c3f03cdaae73c352c2480b853ab6f9b60178
4
+ data.tar.gz: aeb8265a27d4652a330804546f9fa4bbef101b7370d77447e32d4048271f8fea
5
5
  SHA512:
6
- metadata.gz: 2af63bcc0833a15e1bdb1f0f070ffa62abe810d32c48ebd80f0b4fa0cfce17a8a4401c96784e7b1201e18d184cd43c2c28280d1679fd4d49dc30db400e9dac92
7
- data.tar.gz: f363d9aa44816dc5b335b8cc3d2892e67addc53a0c80f9494914165d6e09f5064be27b5fa1b14158b8b6d7db8899ad81ff1c605c2968a803523a8023c09481d5
6
+ metadata.gz: 394e06f75e389d68c172ff1976739bf2463e1d1efe5afaa852150c3265ac1b397bbc54eb20ffe267955d48229e915b483d3a0d1867cb3f96c5f91b2877cefb67
7
+ data.tar.gz: '019bb49f5f0dfede5d6ca7face3c7a4d7893c385d907560d4c705c9621a27683ce66278ed678d5a54f7f3bdb2a7339c144a9e69edcdda94f494f2d0c8d24783f'
@@ -279,7 +279,7 @@ module Tremendous
279
279
  end
280
280
 
281
281
  # Create member
282
- # Each organization has one or more users that can access and manage that organization. These users are called members. Members can take actions via the Tremendous web dashboard directly. These actions include adding funding sources to the organization, creating Campaigns, and more. ### Permissions Members can have one of two roles that determine their permissions within the organization: 1. `MEMBER`: Limited permissions. Can view their own reward and order histories only. 2. `ADMIN`: Update organization settings, invite other members to the organization, and view all member order and reward histories within their organization. To create members of a sub-organizations [create an API key for that organization](/reference/post_organizations-id-create-api-key) first, then use the new API key in the create member request. ### Inviting new members After creating a member, an automatic invite is sent to the email address. If the user is not registered yet, that person will then need to sign up for a Tremendous account. > ❗️ Automatic invitations are not available in the sandbox > > You must manually use the returned `invite_url` field in the payload instead.
282
+ # Each organization has one or more users that can access and manage that organization. These users are called members. Members can take actions via the Tremendous web dashboard directly. These actions include adding funding sources to the organization, creating Campaigns, and more. ### Permissions Members can have a role that determine their permissions within the organization. Check the Roles API for the available roles. To create members of a sub-organizations [create an API key for that organization](/reference/post_organizations-id-create-api-key) first, then use the new API key in the create member request. ### Inviting new members After creating a member, an automatic invite is sent to the email address. If the user is not registered yet, that person will then need to sign up for a Tremendous account. > ❗️ Automatic invitations are not available in the sandbox > > You must manually use the returned `invite_url` field in the payload instead.
283
283
  # @param create_member_request [CreateMemberRequest] Member details
284
284
  # @param [Hash] opts the optional parameters
285
285
  # @return [CreateMember200Response]
@@ -289,7 +289,7 @@ module Tremendous
289
289
  end
290
290
 
291
291
  # Create member
292
- # Each organization has one or more users that can access and manage that organization. These users are called members. Members can take actions via the Tremendous web dashboard directly. These actions include adding funding sources to the organization, creating Campaigns, and more. ### Permissions Members can have one of two roles that determine their permissions within the organization: 1. `MEMBER`: Limited permissions. Can view their own reward and order histories only. 2. `ADMIN`: Update organization settings, invite other members to the organization, and view all member order and reward histories within their organization. To create members of a sub-organizations [create an API key for that organization](/reference/post_organizations-id-create-api-key) first, then use the new API key in the create member request. ### Inviting new members After creating a member, an automatic invite is sent to the email address. If the user is not registered yet, that person will then need to sign up for a Tremendous account. > ❗️ Automatic invitations are not available in the sandbox > > You must manually use the returned `invite_url` field in the payload instead.
292
+ # Each organization has one or more users that can access and manage that organization. These users are called members. Members can take actions via the Tremendous web dashboard directly. These actions include adding funding sources to the organization, creating Campaigns, and more. ### Permissions Members can have a role that determine their permissions within the organization. Check the Roles API for the available roles. To create members of a sub-organizations [create an API key for that organization](/reference/post_organizations-id-create-api-key) first, then use the new API key in the create member request. ### Inviting new members After creating a member, an automatic invite is sent to the email address. If the user is not registered yet, that person will then need to sign up for a Tremendous account. > ❗️ Automatic invitations are not available in the sandbox > > You must manually use the returned `invite_url` field in the payload instead.
293
293
  # @param create_member_request [CreateMemberRequest] Member details
294
294
  # @param [Hash] opts the optional parameters
295
295
  # @return [Array<(CreateMember200Response, Integer, Hash)>] CreateMember200Response data, response status code and response headers
@@ -482,6 +482,74 @@ module Tremendous
482
482
  return data, status_code, headers
483
483
  end
484
484
 
485
+ # Create public key
486
+ # Creating a public key is the way for your organization to share it with Tremendous. > 🔒 Generating asymmetric keys > > **We recommend using [OpenSSL](https://www.openssl.org/).** > > 1. Generate a private key and a public key in PEM: > `openssl genrsa -out tremendous_key.pem 4096` > > 2. Extract the public key in PEM format: > `openssl rsa -in tremendous_key.pem -outform PEM -pubout -out tremendous_key.pem.pub` > > 3. And, before making your request, encode it as a `base64` string: > `base64 -i tremendous_key.pem.pub` <div class=\"object-schema-request-schema\"> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">public_key</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Base64 encoded (public) PEM file</p> </td></tr> </tbody> </table> </div>
487
+ # @param create_public_key_request [CreatePublicKeyRequest] Public key details
488
+ # @param [Hash] opts the optional parameters
489
+ # @return [CreatePublicKey200Response]
490
+ def create_public_key(create_public_key_request, opts = {})
491
+ data, _status_code, _headers = create_public_key_with_http_info(create_public_key_request, opts)
492
+ data
493
+ end
494
+
495
+ # Create public key
496
+ # Creating a public key is the way for your organization to share it with Tremendous. &gt; 🔒 Generating asymmetric keys &gt; &gt; **We recommend using [OpenSSL](https://www.openssl.org/).** &gt; &gt; 1. Generate a private key and a public key in PEM: &gt; &#x60;openssl genrsa -out tremendous_key.pem 4096&#x60; &gt; &gt; 2. Extract the public key in PEM format: &gt; &#x60;openssl rsa -in tremendous_key.pem -outform PEM -pubout -out tremendous_key.pem.pub&#x60; &gt; &gt; 3. And, before making your request, encode it as a &#x60;base64&#x60; string: &gt; &#x60;base64 -i tremendous_key.pem.pub&#x60; &lt;div class&#x3D;\&quot;object-schema-request-schema\&quot;&gt; &lt;table&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Property&lt;/th&gt; &lt;th&gt;Type&lt;/th&gt; &lt;th&gt;Description&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody class&#x3D;\&quot;object-schema-table-body\&quot;&gt; &lt;tr class&#x3D;\&quot;\&quot;&gt;&lt;td&gt;&lt;div class&#x3D;\&quot;property-name\&quot;&gt; &lt;code class&#x3D;\&quot;property-name\&quot;&gt;public_key&lt;/code&gt; &lt;/div&gt; &lt;/td&gt;&lt;td&gt;&lt;span class&#x3D;\&quot;property-type\&quot;&gt;string&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;Base64 encoded (public) PEM file&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/div&gt;
497
+ # @param create_public_key_request [CreatePublicKeyRequest] Public key details
498
+ # @param [Hash] opts the optional parameters
499
+ # @return [Array<(CreatePublicKey200Response, Integer, Hash)>] CreatePublicKey200Response data, response status code and response headers
500
+ def create_public_key_with_http_info(create_public_key_request, opts = {})
501
+ if @api_client.config.debugging
502
+ @api_client.config.logger.debug 'Calling API: TremendousApi.create_public_key ...'
503
+ end
504
+ # verify the required parameter 'create_public_key_request' is set
505
+ if @api_client.config.client_side_validation && create_public_key_request.nil?
506
+ fail ArgumentError, "Missing the required parameter 'create_public_key_request' when calling TremendousApi.create_public_key"
507
+ end
508
+ # resource path
509
+ local_var_path = '/public_keys'
510
+
511
+ # query parameters
512
+ query_params = opts[:query_params] || {}
513
+
514
+ # header parameters
515
+ header_params = opts[:header_params] || {}
516
+ # HTTP header 'Accept' (if needed)
517
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
518
+ # HTTP header 'Content-Type'
519
+ content_type = @api_client.select_header_content_type(['application/json'])
520
+ if !content_type.nil?
521
+ header_params['Content-Type'] = content_type
522
+ end
523
+
524
+ # form parameters
525
+ form_params = opts[:form_params] || {}
526
+
527
+ # http body (model)
528
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_public_key_request)
529
+
530
+ # return_type
531
+ return_type = opts[:debug_return_type] || 'CreatePublicKey200Response'
532
+
533
+ # auth_names
534
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
535
+
536
+ new_options = opts.merge(
537
+ :operation => :"TremendousApi.create_public_key",
538
+ :header_params => header_params,
539
+ :query_params => query_params,
540
+ :form_params => form_params,
541
+ :body => post_body,
542
+ :auth_names => auth_names,
543
+ :return_type => return_type
544
+ )
545
+
546
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
547
+ if @api_client.config.debugging
548
+ @api_client.config.logger.debug "API called: TremendousApi#create_public_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
549
+ end
550
+ return data, status_code, headers
551
+ end
552
+
485
553
  # Create webhook
486
554
  # Tremendous uses webhooks as a notification system for various events that happen in your account. > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > [Read it here](/docs/webhooks-1) Every organization can define a single webhook endpoint where we send requests to, whenever an event happens. This endpoint allows you to setup that endpoint. The URL of the endpoint can be changed by making a request to this endpoint again with the new URL. ## Request body <div class=\"object-schema-request-schema\"> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">url</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">uri</span></td><td><p>URL the webhook will make requests to</p> </td></tr> </tbody> </table> </div>
487
555
  # @param create_webhook_request [CreateWebhookRequest] Webhook details
@@ -552,7 +620,7 @@ module Tremendous
552
620
 
553
621
  # Delete invoice
554
622
  # Removes an invoice. This has no further consequences but is a rather cosmetic operation.
555
- # @param id [String] ID of the invoice that should be retrieved
623
+ # @param id [String] ID of the invoice that should be removed
556
624
  # @param [Hash] opts the optional parameters
557
625
  # @return [CreateInvoice200Response]
558
626
  def delete_invoices(id, opts = {})
@@ -562,7 +630,7 @@ module Tremendous
562
630
 
563
631
  # Delete invoice
564
632
  # Removes an invoice. This has no further consequences but is a rather cosmetic operation.
565
- # @param id [String] ID of the invoice that should be retrieved
633
+ # @param id [String] ID of the invoice that should be removed
566
634
  # @param [Hash] opts the optional parameters
567
635
  # @return [Array<(CreateInvoice200Response, Integer, Hash)>] CreateInvoice200Response data, response status code and response headers
568
636
  def delete_invoices_with_http_info(id, opts = {})
@@ -613,6 +681,142 @@ module Tremendous
613
681
  return data, status_code, headers
614
682
  end
615
683
 
684
+ # Delete public key
685
+ # Deactivates a public key. Any further attempt to verify a request signature with this key will fail.
686
+ # @param id [String] ID of the public key that should be deactivated
687
+ # @param [Hash] opts the optional parameters
688
+ # @return [nil]
689
+ def delete_public_key(id, opts = {})
690
+ delete_public_key_with_http_info(id, opts)
691
+ nil
692
+ end
693
+
694
+ # Delete public key
695
+ # Deactivates a public key. Any further attempt to verify a request signature with this key will fail.
696
+ # @param id [String] ID of the public key that should be deactivated
697
+ # @param [Hash] opts the optional parameters
698
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
699
+ def delete_public_key_with_http_info(id, opts = {})
700
+ if @api_client.config.debugging
701
+ @api_client.config.logger.debug 'Calling API: TremendousApi.delete_public_key ...'
702
+ end
703
+ # verify the required parameter 'id' is set
704
+ if @api_client.config.client_side_validation && id.nil?
705
+ fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.delete_public_key"
706
+ end
707
+ pattern = Regexp.new(/[A-Z0-9]{4,20}/)
708
+ if @api_client.config.client_side_validation && id !~ pattern
709
+ fail ArgumentError, "invalid value for 'id' when calling TremendousApi.delete_public_key, must conform to the pattern #{pattern}."
710
+ end
711
+
712
+ # resource path
713
+ local_var_path = '/public_keys/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
714
+
715
+ # query parameters
716
+ query_params = opts[:query_params] || {}
717
+
718
+ # header parameters
719
+ header_params = opts[:header_params] || {}
720
+ # HTTP header 'Accept' (if needed)
721
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
722
+
723
+ # form parameters
724
+ form_params = opts[:form_params] || {}
725
+
726
+ # http body (model)
727
+ post_body = opts[:debug_body]
728
+
729
+ # return_type
730
+ return_type = opts[:debug_return_type]
731
+
732
+ # auth_names
733
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
734
+
735
+ new_options = opts.merge(
736
+ :operation => :"TremendousApi.delete_public_key",
737
+ :header_params => header_params,
738
+ :query_params => query_params,
739
+ :form_params => form_params,
740
+ :body => post_body,
741
+ :auth_names => auth_names,
742
+ :return_type => return_type
743
+ )
744
+
745
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
746
+ if @api_client.config.debugging
747
+ @api_client.config.logger.debug "API called: TremendousApi#delete_public_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
748
+ end
749
+ return data, status_code, headers
750
+ end
751
+
752
+ # Delete webhook
753
+ # > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > [Read it here](/docs/webhooks-1)
754
+ # @param id [String] ID of the webhook to delete
755
+ # @param [Hash] opts the optional parameters
756
+ # @return [nil]
757
+ def delete_webhook(id, opts = {})
758
+ delete_webhook_with_http_info(id, opts)
759
+ nil
760
+ end
761
+
762
+ # Delete webhook
763
+ # &gt; 📘 Learn more about Webhooks &gt; &gt; Our guide explains everything you need to know about the Tremendous webhooks: &gt; [Read it here](/docs/webhooks-1)
764
+ # @param id [String] ID of the webhook to delete
765
+ # @param [Hash] opts the optional parameters
766
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
767
+ def delete_webhook_with_http_info(id, opts = {})
768
+ if @api_client.config.debugging
769
+ @api_client.config.logger.debug 'Calling API: TremendousApi.delete_webhook ...'
770
+ end
771
+ # verify the required parameter 'id' is set
772
+ if @api_client.config.client_side_validation && id.nil?
773
+ fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.delete_webhook"
774
+ end
775
+ pattern = Regexp.new(/[A-Z0-9]{4,20}/)
776
+ if @api_client.config.client_side_validation && id !~ pattern
777
+ fail ArgumentError, "invalid value for 'id' when calling TremendousApi.delete_webhook, must conform to the pattern #{pattern}."
778
+ end
779
+
780
+ # resource path
781
+ local_var_path = '/webhooks/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
782
+
783
+ # query parameters
784
+ query_params = opts[:query_params] || {}
785
+
786
+ # header parameters
787
+ header_params = opts[:header_params] || {}
788
+ # HTTP header 'Accept' (if needed)
789
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
790
+
791
+ # form parameters
792
+ form_params = opts[:form_params] || {}
793
+
794
+ # http body (model)
795
+ post_body = opts[:debug_body]
796
+
797
+ # return_type
798
+ return_type = opts[:debug_return_type]
799
+
800
+ # auth_names
801
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
802
+
803
+ new_options = opts.merge(
804
+ :operation => :"TremendousApi.delete_webhook",
805
+ :header_params => header_params,
806
+ :query_params => query_params,
807
+ :form_params => form_params,
808
+ :body => post_body,
809
+ :auth_names => auth_names,
810
+ :return_type => return_type
811
+ )
812
+
813
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
814
+ if @api_client.config.debugging
815
+ @api_client.config.logger.debug "API called: TremendousApi#delete_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
816
+ end
817
+ return data, status_code, headers
818
+ end
819
+
616
820
  # Retrieve invoice as CSV
617
821
  # Generates a CSV version for an invoice listing the associated rewards and orders
618
822
  # @param id [String] ID of the Invoice for that the CSV should be generated
@@ -1337,6 +1541,74 @@ module Tremendous
1337
1541
  return data, status_code, headers
1338
1542
  end
1339
1543
 
1544
+ # Retrieve public key
1545
+ # Retrieve an active public key, identified by the given `id` in the URL.
1546
+ # @param id [String] ID of the public key that should be retrieved
1547
+ # @param [Hash] opts the optional parameters
1548
+ # @return [CreatePublicKey200Response]
1549
+ def get_public_key(id, opts = {})
1550
+ data, _status_code, _headers = get_public_key_with_http_info(id, opts)
1551
+ data
1552
+ end
1553
+
1554
+ # Retrieve public key
1555
+ # Retrieve an active public key, identified by the given &#x60;id&#x60; in the URL.
1556
+ # @param id [String] ID of the public key that should be retrieved
1557
+ # @param [Hash] opts the optional parameters
1558
+ # @return [Array<(CreatePublicKey200Response, Integer, Hash)>] CreatePublicKey200Response data, response status code and response headers
1559
+ def get_public_key_with_http_info(id, opts = {})
1560
+ if @api_client.config.debugging
1561
+ @api_client.config.logger.debug 'Calling API: TremendousApi.get_public_key ...'
1562
+ end
1563
+ # verify the required parameter 'id' is set
1564
+ if @api_client.config.client_side_validation && id.nil?
1565
+ fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.get_public_key"
1566
+ end
1567
+ pattern = Regexp.new(/[A-Z0-9]{4,20}/)
1568
+ if @api_client.config.client_side_validation && id !~ pattern
1569
+ fail ArgumentError, "invalid value for 'id' when calling TremendousApi.get_public_key, must conform to the pattern #{pattern}."
1570
+ end
1571
+
1572
+ # resource path
1573
+ local_var_path = '/public_keys/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
1574
+
1575
+ # query parameters
1576
+ query_params = opts[:query_params] || {}
1577
+
1578
+ # header parameters
1579
+ header_params = opts[:header_params] || {}
1580
+ # HTTP header 'Accept' (if needed)
1581
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1582
+
1583
+ # form parameters
1584
+ form_params = opts[:form_params] || {}
1585
+
1586
+ # http body (model)
1587
+ post_body = opts[:debug_body]
1588
+
1589
+ # return_type
1590
+ return_type = opts[:debug_return_type] || 'CreatePublicKey200Response'
1591
+
1592
+ # auth_names
1593
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
1594
+
1595
+ new_options = opts.merge(
1596
+ :operation => :"TremendousApi.get_public_key",
1597
+ :header_params => header_params,
1598
+ :query_params => query_params,
1599
+ :form_params => form_params,
1600
+ :body => post_body,
1601
+ :auth_names => auth_names,
1602
+ :return_type => return_type
1603
+ )
1604
+
1605
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1606
+ if @api_client.config.debugging
1607
+ @api_client.config.logger.debug "API called: TremendousApi#get_public_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1608
+ end
1609
+ return data, status_code, headers
1610
+ end
1611
+
1340
1612
  # Retrieve single reward
1341
1613
  # Retrieve the reward, identified by the given `id` in the URL
1342
1614
  # @param id [String] ID of the reward that should be retrieved
@@ -1656,6 +1928,66 @@ module Tremendous
1656
1928
  return data, status_code, headers
1657
1929
  end
1658
1930
 
1931
+ # List exchange rates
1932
+ # Retrieve a list of exchange rates
1933
+ # @param [Hash] opts the optional parameters
1934
+ # @option opts [String] :base Base currency code, default is USD.
1935
+ # @return [ListForexResponse]
1936
+ def list_forex(opts = {})
1937
+ data, _status_code, _headers = list_forex_with_http_info(opts)
1938
+ data
1939
+ end
1940
+
1941
+ # List exchange rates
1942
+ # Retrieve a list of exchange rates
1943
+ # @param [Hash] opts the optional parameters
1944
+ # @option opts [String] :base Base currency code, default is USD.
1945
+ # @return [Array<(ListForexResponse, Integer, Hash)>] ListForexResponse data, response status code and response headers
1946
+ def list_forex_with_http_info(opts = {})
1947
+ if @api_client.config.debugging
1948
+ @api_client.config.logger.debug 'Calling API: TremendousApi.list_forex ...'
1949
+ end
1950
+ # resource path
1951
+ local_var_path = '/forex'
1952
+
1953
+ # query parameters
1954
+ query_params = opts[:query_params] || {}
1955
+ query_params[:'base'] = opts[:'base'] if !opts[:'base'].nil?
1956
+
1957
+ # header parameters
1958
+ header_params = opts[:header_params] || {}
1959
+ # HTTP header 'Accept' (if needed)
1960
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1961
+
1962
+ # form parameters
1963
+ form_params = opts[:form_params] || {}
1964
+
1965
+ # http body (model)
1966
+ post_body = opts[:debug_body]
1967
+
1968
+ # return_type
1969
+ return_type = opts[:debug_return_type] || 'ListForexResponse'
1970
+
1971
+ # auth_names
1972
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
1973
+
1974
+ new_options = opts.merge(
1975
+ :operation => :"TremendousApi.list_forex",
1976
+ :header_params => header_params,
1977
+ :query_params => query_params,
1978
+ :form_params => form_params,
1979
+ :body => post_body,
1980
+ :auth_names => auth_names,
1981
+ :return_type => return_type
1982
+ )
1983
+
1984
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1985
+ if @api_client.config.debugging
1986
+ @api_client.config.logger.debug "API called: TremendousApi#list_forex\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1987
+ end
1988
+ return data, status_code, headers
1989
+ end
1990
+
1659
1991
  # List funding sources
1660
1992
  # Retrieve a list of all funding sources available for ordering through the API in your organization's account.
1661
1993
  # @param [Hash] opts the optional parameters
@@ -2028,6 +2360,63 @@ module Tremendous
2028
2360
  return data, status_code, headers
2029
2361
  end
2030
2362
 
2363
+ # List public keys
2364
+ # Fetch a list of active public keys on your account. > 🚧 Inactive public keys are omitted > > The response does not include inactive public keys.
2365
+ # @param [Hash] opts the optional parameters
2366
+ # @return [PublicKeysResponse]
2367
+ def list_public_keys(opts = {})
2368
+ data, _status_code, _headers = list_public_keys_with_http_info(opts)
2369
+ data
2370
+ end
2371
+
2372
+ # List public keys
2373
+ # Fetch a list of active public keys on your account. &gt; 🚧 Inactive public keys are omitted &gt; &gt; The response does not include inactive public keys.
2374
+ # @param [Hash] opts the optional parameters
2375
+ # @return [Array<(PublicKeysResponse, Integer, Hash)>] PublicKeysResponse data, response status code and response headers
2376
+ def list_public_keys_with_http_info(opts = {})
2377
+ if @api_client.config.debugging
2378
+ @api_client.config.logger.debug 'Calling API: TremendousApi.list_public_keys ...'
2379
+ end
2380
+ # resource path
2381
+ local_var_path = '/public_keys'
2382
+
2383
+ # query parameters
2384
+ query_params = opts[:query_params] || {}
2385
+
2386
+ # header parameters
2387
+ header_params = opts[:header_params] || {}
2388
+ # HTTP header 'Accept' (if needed)
2389
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
2390
+
2391
+ # form parameters
2392
+ form_params = opts[:form_params] || {}
2393
+
2394
+ # http body (model)
2395
+ post_body = opts[:debug_body]
2396
+
2397
+ # return_type
2398
+ return_type = opts[:debug_return_type] || 'PublicKeysResponse'
2399
+
2400
+ # auth_names
2401
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
2402
+
2403
+ new_options = opts.merge(
2404
+ :operation => :"TremendousApi.list_public_keys",
2405
+ :header_params => header_params,
2406
+ :query_params => query_params,
2407
+ :form_params => form_params,
2408
+ :body => post_body,
2409
+ :auth_names => auth_names,
2410
+ :return_type => return_type
2411
+ )
2412
+
2413
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2414
+ if @api_client.config.debugging
2415
+ @api_client.config.logger.debug "API called: TremendousApi#list_public_keys\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2416
+ end
2417
+ return data, status_code, headers
2418
+ end
2419
+
2031
2420
  # List rewards
2032
2421
  # Retrieve a list of all created rewards
2033
2422
  # @param [Hash] opts the optional parameters
@@ -2088,6 +2477,63 @@ module Tremendous
2088
2477
  return data, status_code, headers
2089
2478
  end
2090
2479
 
2480
+ # List roles
2481
+ # List all available roles in the organization.
2482
+ # @param [Hash] opts the optional parameters
2483
+ # @return [ListRoles200Response]
2484
+ def list_roles(opts = {})
2485
+ data, _status_code, _headers = list_roles_with_http_info(opts)
2486
+ data
2487
+ end
2488
+
2489
+ # List roles
2490
+ # List all available roles in the organization.
2491
+ # @param [Hash] opts the optional parameters
2492
+ # @return [Array<(ListRoles200Response, Integer, Hash)>] ListRoles200Response data, response status code and response headers
2493
+ def list_roles_with_http_info(opts = {})
2494
+ if @api_client.config.debugging
2495
+ @api_client.config.logger.debug 'Calling API: TremendousApi.list_roles ...'
2496
+ end
2497
+ # resource path
2498
+ local_var_path = '/roles'
2499
+
2500
+ # query parameters
2501
+ query_params = opts[:query_params] || {}
2502
+
2503
+ # header parameters
2504
+ header_params = opts[:header_params] || {}
2505
+ # HTTP header 'Accept' (if needed)
2506
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
2507
+
2508
+ # form parameters
2509
+ form_params = opts[:form_params] || {}
2510
+
2511
+ # http body (model)
2512
+ post_body = opts[:debug_body]
2513
+
2514
+ # return_type
2515
+ return_type = opts[:debug_return_type] || 'ListRoles200Response'
2516
+
2517
+ # auth_names
2518
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
2519
+
2520
+ new_options = opts.merge(
2521
+ :operation => :"TremendousApi.list_roles",
2522
+ :header_params => header_params,
2523
+ :query_params => query_params,
2524
+ :form_params => form_params,
2525
+ :body => post_body,
2526
+ :auth_names => auth_names,
2527
+ :return_type => return_type
2528
+ )
2529
+
2530
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2531
+ if @api_client.config.debugging
2532
+ @api_client.config.logger.debug "API called: TremendousApi#list_roles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2533
+ end
2534
+ return data, status_code, headers
2535
+ end
2536
+
2091
2537
  # List events
2092
2538
  # Lists all event types that can be sent to the configured webhook endpoint. > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > [Read it here](/docs/webhooks-1)
2093
2539
  # @param id [String] ID of the webhook to list the events for
@@ -2428,22 +2874,101 @@ module Tremendous
2428
2874
  return data, status_code, headers
2429
2875
  end
2430
2876
 
2877
+ # Test public key
2878
+ # Making a request to this endpoint with a JWT signed with your private key will return a 200 response if the public key is active and the signature is valid. > 💡 Testing your integration > > **You can use [JWT.io](https://jwt.io/) to generate a signed token:** > > > 1. Select “RS256” in their algorithm dropdown; > 3. Define a JSON payload such as `{ \"foo\": \"bar\" }`; > 4. Fill the “Verify signature” fields with your public and private keys and copy the “Encoded” token.
2879
+ # @param id [String] ID of the public key to test
2880
+ # @param test_public_key_request [TestPublicKeyRequest]
2881
+ # @param [Hash] opts the optional parameters
2882
+ # @return [nil]
2883
+ def test_public_key(id, test_public_key_request, opts = {})
2884
+ test_public_key_with_http_info(id, test_public_key_request, opts)
2885
+ nil
2886
+ end
2887
+
2888
+ # Test public key
2889
+ # Making a request to this endpoint with a JWT signed with your private key will return a 200 response if the public key is active and the signature is valid. &gt; 💡 Testing your integration &gt; &gt; **You can use [JWT.io](https://jwt.io/) to generate a signed token:** &gt; &gt; &gt; 1. Select “RS256” in their algorithm dropdown; &gt; 3. Define a JSON payload such as &#x60;{ \&quot;foo\&quot;: \&quot;bar\&quot; }&#x60;; &gt; 4. Fill the “Verify signature” fields with your public and private keys and copy the “Encoded” token.
2890
+ # @param id [String] ID of the public key to test
2891
+ # @param test_public_key_request [TestPublicKeyRequest]
2892
+ # @param [Hash] opts the optional parameters
2893
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
2894
+ def test_public_key_with_http_info(id, test_public_key_request, opts = {})
2895
+ if @api_client.config.debugging
2896
+ @api_client.config.logger.debug 'Calling API: TremendousApi.test_public_key ...'
2897
+ end
2898
+ # verify the required parameter 'id' is set
2899
+ if @api_client.config.client_side_validation && id.nil?
2900
+ fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.test_public_key"
2901
+ end
2902
+ pattern = Regexp.new(/[A-Z0-9]{4,20}/)
2903
+ if @api_client.config.client_side_validation && id !~ pattern
2904
+ fail ArgumentError, "invalid value for 'id' when calling TremendousApi.test_public_key, must conform to the pattern #{pattern}."
2905
+ end
2906
+
2907
+ # verify the required parameter 'test_public_key_request' is set
2908
+ if @api_client.config.client_side_validation && test_public_key_request.nil?
2909
+ fail ArgumentError, "Missing the required parameter 'test_public_key_request' when calling TremendousApi.test_public_key"
2910
+ end
2911
+ # resource path
2912
+ local_var_path = '/public_keys/{id}/decode_jwt'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
2913
+
2914
+ # query parameters
2915
+ query_params = opts[:query_params] || {}
2916
+
2917
+ # header parameters
2918
+ header_params = opts[:header_params] || {}
2919
+ # HTTP header 'Accept' (if needed)
2920
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
2921
+ # HTTP header 'Content-Type'
2922
+ content_type = @api_client.select_header_content_type(['application/json'])
2923
+ if !content_type.nil?
2924
+ header_params['Content-Type'] = content_type
2925
+ end
2926
+
2927
+ # form parameters
2928
+ form_params = opts[:form_params] || {}
2929
+
2930
+ # http body (model)
2931
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(test_public_key_request)
2932
+
2933
+ # return_type
2934
+ return_type = opts[:debug_return_type]
2935
+
2936
+ # auth_names
2937
+ auth_names = opts[:debug_auth_names] || ['BearerApiKey']
2938
+
2939
+ new_options = opts.merge(
2940
+ :operation => :"TremendousApi.test_public_key",
2941
+ :header_params => header_params,
2942
+ :query_params => query_params,
2943
+ :form_params => form_params,
2944
+ :body => post_body,
2945
+ :auth_names => auth_names,
2946
+ :return_type => return_type
2947
+ )
2948
+
2949
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2950
+ if @api_client.config.debugging
2951
+ @api_client.config.logger.debug "API called: TremendousApi#test_public_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2952
+ end
2953
+ return data, status_code, headers
2954
+ end
2955
+
2431
2956
  # Update campaign
2432
2957
  # @param id [String] ID of the campaign that should be updated
2433
- # @param create_campaign_request [CreateCampaignRequest] Campaign details
2958
+ # @param update_campaign_request [UpdateCampaignRequest] Campaign details
2434
2959
  # @param [Hash] opts the optional parameters
2435
2960
  # @return [CreateCampaign201Response]
2436
- def update_campaign(id, create_campaign_request, opts = {})
2437
- data, _status_code, _headers = update_campaign_with_http_info(id, create_campaign_request, opts)
2961
+ def update_campaign(id, update_campaign_request, opts = {})
2962
+ data, _status_code, _headers = update_campaign_with_http_info(id, update_campaign_request, opts)
2438
2963
  data
2439
2964
  end
2440
2965
 
2441
2966
  # Update campaign
2442
2967
  # @param id [String] ID of the campaign that should be updated
2443
- # @param create_campaign_request [CreateCampaignRequest] Campaign details
2968
+ # @param update_campaign_request [UpdateCampaignRequest] Campaign details
2444
2969
  # @param [Hash] opts the optional parameters
2445
2970
  # @return [Array<(CreateCampaign201Response, Integer, Hash)>] CreateCampaign201Response data, response status code and response headers
2446
- def update_campaign_with_http_info(id, create_campaign_request, opts = {})
2971
+ def update_campaign_with_http_info(id, update_campaign_request, opts = {})
2447
2972
  if @api_client.config.debugging
2448
2973
  @api_client.config.logger.debug 'Calling API: TremendousApi.update_campaign ...'
2449
2974
  end
@@ -2456,9 +2981,9 @@ module Tremendous
2456
2981
  fail ArgumentError, "invalid value for 'id' when calling TremendousApi.update_campaign, must conform to the pattern #{pattern}."
2457
2982
  end
2458
2983
 
2459
- # verify the required parameter 'create_campaign_request' is set
2460
- if @api_client.config.client_side_validation && create_campaign_request.nil?
2461
- fail ArgumentError, "Missing the required parameter 'create_campaign_request' when calling TremendousApi.update_campaign"
2984
+ # verify the required parameter 'update_campaign_request' is set
2985
+ if @api_client.config.client_side_validation && update_campaign_request.nil?
2986
+ fail ArgumentError, "Missing the required parameter 'update_campaign_request' when calling TremendousApi.update_campaign"
2462
2987
  end
2463
2988
  # resource path
2464
2989
  local_var_path = '/campaigns/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
@@ -2480,7 +3005,7 @@ module Tremendous
2480
3005
  form_params = opts[:form_params] || {}
2481
3006
 
2482
3007
  # http body (model)
2483
- post_body = opts[:debug_body] || @api_client.object_to_http_body(create_campaign_request)
3008
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(update_campaign_request)
2484
3009
 
2485
3010
  # return_type
2486
3011
  return_type = opts[:debug_return_type] || 'CreateCampaign201Response'