tremendous_ruby 5.6.0 → 5.7.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.
- checksums.yaml +4 -4
- data/lib/tremendous/api/tremendous_api.rb +139 -1
- data/lib/tremendous/models/create_report201_response.rb +231 -0
- data/lib/tremendous/models/create_report201_response_report.rb +291 -0
- data/lib/tremendous/models/create_report_request.rb +295 -0
- data/lib/tremendous/models/create_report_request_filters.rb +216 -0
- data/lib/tremendous/models/create_report_request_filters_digital_rewards.rb +340 -0
- data/lib/tremendous/models/create_report_request_filters_digital_rewards_amount.rb +226 -0
- data/lib/tremendous/models/create_report_request_filters_digital_rewards_created_at.rb +226 -0
- data/lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb +37 -7
- data/lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta_failure_details.rb +225 -0
- data/lib/tremendous/models/payout.rb +16 -4
- data/lib/tremendous/models/report.rb +291 -0
- data/lib/tremendous/models/resend_reward_request.rb +225 -0
- data/lib/tremendous/version.rb +1 -1
- data/lib/tremendous.rb +10 -0
- metadata +12 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 195da80d84c9b36ee4e1f637992aa13deface61e0ab23e16b8987c1285b554f4
|
4
|
+
data.tar.gz: 4cee12139802e096dba6067ead8eb03349cdb94f75b8b075d0336bf8f4241043
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d74b168ef7ee0c64df551edce823e2656ee9be73970b50240dbc421b64b2b36d584ed1bea33026de07c9073ad53f0a688d3334fe6e1c4017f2bdda0cd73cb832
|
7
|
+
data.tar.gz: 7aa7bb52a9c9b443f9d0ea2ccb807392963d9773fd00ceba6d8a647d47c31bfc15fd1efd75aba167b747f8518e95969d8d9aa1793bfb5d9d2464922766fd6293
|
@@ -545,6 +545,74 @@ module Tremendous
|
|
545
545
|
return data, status_code, headers
|
546
546
|
end
|
547
547
|
|
548
|
+
# Create report
|
549
|
+
# 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\"> <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\">report_type</code> </div> </td><td><span class=\"property-type\">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=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">format</code> </div> </td><td><span class=\"property-type\">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=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">filters</code> </div> </td><td><span class=\"property-type\">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=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">digital_rewards</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Filters object for a <code>report_type: digital_rewards</code> report</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">amount</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Amount of the rewards returned in the report</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">gte</code> </div> </td><td><span class=\"property-type\">number</span> <span class=\"property-format\">double</span></td><td><p>Minimum amount of the rewards that should be returned in the report</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">lte</code> </div> </td><td><span class=\"property-type\">number</span> <span class=\"property-format\">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=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">campaign_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>ID of the Tremendous campaign that this report should be limited to</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">created_at</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Creation dates of rewards returned in the report</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">gte</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">date</span></td><td><p>Minimum date the reward was created</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">lte</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">date</span></td><td><p>Maximum date the reward was created</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">delivered_at</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">date</span></td><td><p>Delivery date for gifts that should be returned in the report</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">delivery_method</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Delivery method for rewards returned in the report</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">order_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>ID of the Tremendous order that this report should be limited to</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">order_status</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Order status for rewards returned in the report</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">status</code> </div> </td><td><span class=\"property-type\">array</span> <span class=\"property-format\">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 simulataneously generated by an organization at a given time. If you exceed the rate limit, you'll receive a `429` response.
|
550
|
+
# @param create_report_request [CreateReportRequest] Report to create
|
551
|
+
# @param [Hash] opts the optional parameters
|
552
|
+
# @return [CreateReport201Response]
|
553
|
+
def create_report(create_report_request, opts = {})
|
554
|
+
data, _status_code, _headers = create_report_with_http_info(create_report_request, opts)
|
555
|
+
data
|
556
|
+
end
|
557
|
+
|
558
|
+
# Create report
|
559
|
+
# 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\"> <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\">report_type</code> </div> </td><td><span class=\"property-type\">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=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">format</code> </div> </td><td><span class=\"property-type\">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=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">filters</code> </div> </td><td><span class=\"property-type\">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=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">digital_rewards</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Filters object for a <code>report_type: digital_rewards</code> report</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">amount</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Amount of the rewards returned in the report</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">gte</code> </div> </td><td><span class=\"property-type\">number</span> <span class=\"property-format\">double</span></td><td><p>Minimum amount of the rewards that should be returned in the report</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">lte</code> </div> </td><td><span class=\"property-type\">number</span> <span class=\"property-format\">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=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">campaign_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>ID of the Tremendous campaign that this report should be limited to</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">created_at</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Creation dates of rewards returned in the report</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">gte</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">date</span></td><td><p>Minimum date the reward was created</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">lte</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">date</span></td><td><p>Maximum date the reward was created</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">delivered_at</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">date</span></td><td><p>Delivery date for gifts that should be returned in the report</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">delivery_method</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Delivery method for rewards returned in the report</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">order_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>ID of the Tremendous order that this report should be limited to</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">order_status</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Order status for rewards returned in the report</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">status</code> </div> </td><td><span class=\"property-type\">array</span> <span class=\"property-format\">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 simulataneously generated by an organization at a given time. If you exceed the rate limit, you'll receive a `429` response.
|
560
|
+
# @param create_report_request [CreateReportRequest] Report to create
|
561
|
+
# @param [Hash] opts the optional parameters
|
562
|
+
# @return [Array<(CreateReport201Response, Integer, Hash)>] CreateReport201Response data, response status code and response headers
|
563
|
+
def create_report_with_http_info(create_report_request, opts = {})
|
564
|
+
if @api_client.config.debugging
|
565
|
+
@api_client.config.logger.debug 'Calling API: TremendousApi.create_report ...'
|
566
|
+
end
|
567
|
+
# verify the required parameter 'create_report_request' is set
|
568
|
+
if @api_client.config.client_side_validation && create_report_request.nil?
|
569
|
+
fail ArgumentError, "Missing the required parameter 'create_report_request' when calling TremendousApi.create_report"
|
570
|
+
end
|
571
|
+
# resource path
|
572
|
+
local_var_path = '/reports'
|
573
|
+
|
574
|
+
# query parameters
|
575
|
+
query_params = opts[:query_params] || {}
|
576
|
+
|
577
|
+
# header parameters
|
578
|
+
header_params = opts[:header_params] || {}
|
579
|
+
# HTTP header 'Accept' (if needed)
|
580
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
581
|
+
# HTTP header 'Content-Type'
|
582
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
583
|
+
if !content_type.nil?
|
584
|
+
header_params['Content-Type'] = content_type
|
585
|
+
end
|
586
|
+
|
587
|
+
# form parameters
|
588
|
+
form_params = opts[:form_params] || {}
|
589
|
+
|
590
|
+
# http body (model)
|
591
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_report_request)
|
592
|
+
|
593
|
+
# return_type
|
594
|
+
return_type = opts[:debug_return_type] || 'CreateReport201Response'
|
595
|
+
|
596
|
+
# auth_names
|
597
|
+
auth_names = opts[:debug_auth_names] || ['BearerApiKey']
|
598
|
+
|
599
|
+
new_options = opts.merge(
|
600
|
+
:operation => :"TremendousApi.create_report",
|
601
|
+
:header_params => header_params,
|
602
|
+
:query_params => query_params,
|
603
|
+
:form_params => form_params,
|
604
|
+
:body => post_body,
|
605
|
+
:auth_names => auth_names,
|
606
|
+
:return_type => return_type
|
607
|
+
)
|
608
|
+
|
609
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
610
|
+
if @api_client.config.debugging
|
611
|
+
@api_client.config.logger.debug "API called: TremendousApi#create_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
612
|
+
end
|
613
|
+
return data, status_code, headers
|
614
|
+
end
|
615
|
+
|
548
616
|
# Create webhook
|
549
617
|
# 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>
|
550
618
|
# @param create_webhook_request [CreateWebhookRequest] Webhook details
|
@@ -1674,6 +1742,69 @@ module Tremendous
|
|
1674
1742
|
return data, status_code, headers
|
1675
1743
|
end
|
1676
1744
|
|
1745
|
+
# Retrieve report
|
1746
|
+
# 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.
|
1747
|
+
# @param id [String] ID of the report that should be retrieved. ID is returned from `POST` to /api/v2/reports
|
1748
|
+
# @param [Hash] opts the optional parameters
|
1749
|
+
# @return [CreateReport201Response]
|
1750
|
+
def get_report(id, opts = {})
|
1751
|
+
data, _status_code, _headers = get_report_with_http_info(id, opts)
|
1752
|
+
data
|
1753
|
+
end
|
1754
|
+
|
1755
|
+
# Retrieve report
|
1756
|
+
# 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.
|
1757
|
+
# @param id [String] ID of the report that should be retrieved. ID is returned from `POST` to /api/v2/reports
|
1758
|
+
# @param [Hash] opts the optional parameters
|
1759
|
+
# @return [Array<(CreateReport201Response, Integer, Hash)>] CreateReport201Response data, response status code and response headers
|
1760
|
+
def get_report_with_http_info(id, opts = {})
|
1761
|
+
if @api_client.config.debugging
|
1762
|
+
@api_client.config.logger.debug 'Calling API: TremendousApi.get_report ...'
|
1763
|
+
end
|
1764
|
+
# verify the required parameter 'id' is set
|
1765
|
+
if @api_client.config.client_side_validation && id.nil?
|
1766
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.get_report"
|
1767
|
+
end
|
1768
|
+
# resource path
|
1769
|
+
local_var_path = '/reports/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
1770
|
+
|
1771
|
+
# query parameters
|
1772
|
+
query_params = opts[:query_params] || {}
|
1773
|
+
|
1774
|
+
# header parameters
|
1775
|
+
header_params = opts[:header_params] || {}
|
1776
|
+
# HTTP header 'Accept' (if needed)
|
1777
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
1778
|
+
|
1779
|
+
# form parameters
|
1780
|
+
form_params = opts[:form_params] || {}
|
1781
|
+
|
1782
|
+
# http body (model)
|
1783
|
+
post_body = opts[:debug_body]
|
1784
|
+
|
1785
|
+
# return_type
|
1786
|
+
return_type = opts[:debug_return_type] || 'CreateReport201Response'
|
1787
|
+
|
1788
|
+
# auth_names
|
1789
|
+
auth_names = opts[:debug_auth_names] || ['BearerApiKey']
|
1790
|
+
|
1791
|
+
new_options = opts.merge(
|
1792
|
+
:operation => :"TremendousApi.get_report",
|
1793
|
+
:header_params => header_params,
|
1794
|
+
:query_params => query_params,
|
1795
|
+
:form_params => form_params,
|
1796
|
+
:body => post_body,
|
1797
|
+
:auth_names => auth_names,
|
1798
|
+
:return_type => return_type
|
1799
|
+
)
|
1800
|
+
|
1801
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
1802
|
+
if @api_client.config.debugging
|
1803
|
+
@api_client.config.logger.debug "API called: TremendousApi#get_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1804
|
+
end
|
1805
|
+
return data, status_code, headers
|
1806
|
+
end
|
1807
|
+
|
1677
1808
|
# Retrieve single reward
|
1678
1809
|
# Retrieve the reward, identified by the given `id` in the URL
|
1679
1810
|
# @param id [String] ID of the reward that should be retrieved
|
@@ -2953,6 +3084,7 @@ module Tremendous
|
|
2953
3084
|
# Resends a reward, identified by the given `id` in the URL, to its recipient.
|
2954
3085
|
# @param id [String] ID of the reward that should be resent
|
2955
3086
|
# @param [Hash] opts the optional parameters
|
3087
|
+
# @option opts [ResendRewardRequest] :resend_reward_request _Only_ for rewards with a previous delivery failure: 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.
|
2956
3088
|
# @return [Object]
|
2957
3089
|
def resend_reward(id, opts = {})
|
2958
3090
|
data, _status_code, _headers = resend_reward_with_http_info(id, opts)
|
@@ -2963,6 +3095,7 @@ module Tremendous
|
|
2963
3095
|
# Resends a reward, identified by the given `id` in the URL, to its recipient.
|
2964
3096
|
# @param id [String] ID of the reward that should be resent
|
2965
3097
|
# @param [Hash] opts the optional parameters
|
3098
|
+
# @option opts [ResendRewardRequest] :resend_reward_request _Only_ for rewards with a previous delivery failure: 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.
|
2966
3099
|
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
2967
3100
|
def resend_reward_with_http_info(id, opts = {})
|
2968
3101
|
if @api_client.config.debugging
|
@@ -2987,12 +3120,17 @@ module Tremendous
|
|
2987
3120
|
header_params = opts[:header_params] || {}
|
2988
3121
|
# HTTP header 'Accept' (if needed)
|
2989
3122
|
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
3123
|
+
# HTTP header 'Content-Type'
|
3124
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
3125
|
+
if !content_type.nil?
|
3126
|
+
header_params['Content-Type'] = content_type
|
3127
|
+
end
|
2990
3128
|
|
2991
3129
|
# form parameters
|
2992
3130
|
form_params = opts[:form_params] || {}
|
2993
3131
|
|
2994
3132
|
# http body (model)
|
2995
|
-
post_body = opts[:debug_body]
|
3133
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'resend_reward_request'])
|
2996
3134
|
|
2997
3135
|
# return_type
|
2998
3136
|
return_type = opts[:debug_return_type] || 'Object'
|
@@ -0,0 +1,231 @@
|
|
1
|
+
=begin
|
2
|
+
#API Endpoints
|
3
|
+
|
4
|
+
#Deliver monetary rewards and incentives to employees, customers, survey participants, and more through the Tremendous API. For organizational tasks, like managing your organization and it's members within Tremendous, please see the Tremendous Organizational API.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 2
|
7
|
+
Contact: developers@tremendous.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
Generator version: 7.8.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module Tremendous
|
17
|
+
class CreateReport201Response
|
18
|
+
attr_accessor :report
|
19
|
+
|
20
|
+
# Report status message
|
21
|
+
attr_accessor :message
|
22
|
+
|
23
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
24
|
+
def self.attribute_map
|
25
|
+
{
|
26
|
+
:'report' => :'report',
|
27
|
+
:'message' => :'message'
|
28
|
+
}
|
29
|
+
end
|
30
|
+
|
31
|
+
# Returns all the JSON keys this model knows about
|
32
|
+
def self.acceptable_attributes
|
33
|
+
attribute_map.values
|
34
|
+
end
|
35
|
+
|
36
|
+
# Attribute type mapping.
|
37
|
+
def self.openapi_types
|
38
|
+
{
|
39
|
+
:'report' => :'CreateReport201ResponseReport',
|
40
|
+
:'message' => :'String'
|
41
|
+
}
|
42
|
+
end
|
43
|
+
|
44
|
+
# List of attributes with nullable: true
|
45
|
+
def self.openapi_nullable
|
46
|
+
Set.new([
|
47
|
+
])
|
48
|
+
end
|
49
|
+
|
50
|
+
# Initializes the object
|
51
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
52
|
+
def initialize(attributes = {})
|
53
|
+
if (!attributes.is_a?(Hash))
|
54
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::CreateReport201Response` initialize method"
|
55
|
+
end
|
56
|
+
|
57
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
58
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
59
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
60
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::CreateReport201Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
61
|
+
end
|
62
|
+
h[k.to_sym] = v
|
63
|
+
}
|
64
|
+
|
65
|
+
if attributes.key?(:'report')
|
66
|
+
self.report = attributes[:'report']
|
67
|
+
else
|
68
|
+
self.report = nil
|
69
|
+
end
|
70
|
+
|
71
|
+
if attributes.key?(:'message')
|
72
|
+
self.message = attributes[:'message']
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
77
|
+
# @return Array for valid properties with the reasons
|
78
|
+
def list_invalid_properties
|
79
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
80
|
+
invalid_properties = Array.new
|
81
|
+
if @report.nil?
|
82
|
+
invalid_properties.push('invalid value for "report", report cannot be nil.')
|
83
|
+
end
|
84
|
+
|
85
|
+
invalid_properties
|
86
|
+
end
|
87
|
+
|
88
|
+
# Check to see if the all the properties in the model are valid
|
89
|
+
# @return true if the model is valid
|
90
|
+
def valid?
|
91
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
92
|
+
return false if @report.nil?
|
93
|
+
true
|
94
|
+
end
|
95
|
+
|
96
|
+
# Checks equality by comparing each attribute.
|
97
|
+
# @param [Object] Object to be compared
|
98
|
+
def ==(o)
|
99
|
+
return true if self.equal?(o)
|
100
|
+
self.class == o.class &&
|
101
|
+
report == o.report &&
|
102
|
+
message == o.message
|
103
|
+
end
|
104
|
+
|
105
|
+
# @see the `==` method
|
106
|
+
# @param [Object] Object to be compared
|
107
|
+
def eql?(o)
|
108
|
+
self == o
|
109
|
+
end
|
110
|
+
|
111
|
+
# Calculates hash code according to all attributes.
|
112
|
+
# @return [Integer] Hash code
|
113
|
+
def hash
|
114
|
+
[report, message].hash
|
115
|
+
end
|
116
|
+
|
117
|
+
# Builds the object from hash
|
118
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
119
|
+
# @return [Object] Returns the model itself
|
120
|
+
def self.build_from_hash(attributes)
|
121
|
+
return nil unless attributes.is_a?(Hash)
|
122
|
+
attributes = attributes.transform_keys(&:to_sym)
|
123
|
+
transformed_hash = {}
|
124
|
+
openapi_types.each_pair do |key, type|
|
125
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
126
|
+
transformed_hash["#{key}"] = nil
|
127
|
+
elsif type =~ /\AArray<(.*)>/i
|
128
|
+
# check to ensure the input is an array given that the attribute
|
129
|
+
# is documented as an array but the input is not
|
130
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
131
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
132
|
+
end
|
133
|
+
elsif !attributes[attribute_map[key]].nil?
|
134
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
135
|
+
end
|
136
|
+
end
|
137
|
+
new(transformed_hash)
|
138
|
+
end
|
139
|
+
|
140
|
+
# Deserializes the data based on type
|
141
|
+
# @param string type Data type
|
142
|
+
# @param string value Value to be deserialized
|
143
|
+
# @return [Object] Deserialized data
|
144
|
+
def self._deserialize(type, value)
|
145
|
+
case type.to_sym
|
146
|
+
when :Time
|
147
|
+
Time.parse(value)
|
148
|
+
when :Date
|
149
|
+
Date.parse(value)
|
150
|
+
when :String
|
151
|
+
value.to_s
|
152
|
+
when :Integer
|
153
|
+
value.to_i
|
154
|
+
when :Float
|
155
|
+
value.to_f
|
156
|
+
when :Boolean
|
157
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
158
|
+
true
|
159
|
+
else
|
160
|
+
false
|
161
|
+
end
|
162
|
+
when :Object
|
163
|
+
# generic object (usually a Hash), return directly
|
164
|
+
value
|
165
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
166
|
+
inner_type = Regexp.last_match[:inner_type]
|
167
|
+
value.map { |v| _deserialize(inner_type, v) }
|
168
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
169
|
+
k_type = Regexp.last_match[:k_type]
|
170
|
+
v_type = Regexp.last_match[:v_type]
|
171
|
+
{}.tap do |hash|
|
172
|
+
value.each do |k, v|
|
173
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
174
|
+
end
|
175
|
+
end
|
176
|
+
else # model
|
177
|
+
# models (e.g. Pet) or oneOf
|
178
|
+
klass = Tremendous.const_get(type)
|
179
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
180
|
+
end
|
181
|
+
end
|
182
|
+
|
183
|
+
# Returns the string representation of the object
|
184
|
+
# @return [String] String presentation of the object
|
185
|
+
def to_s
|
186
|
+
to_hash.to_s
|
187
|
+
end
|
188
|
+
|
189
|
+
# to_body is an alias to to_hash (backward compatibility)
|
190
|
+
# @return [Hash] Returns the object in the form of hash
|
191
|
+
def to_body
|
192
|
+
to_hash
|
193
|
+
end
|
194
|
+
|
195
|
+
# Returns the object in the form of hash
|
196
|
+
# @return [Hash] Returns the object in the form of hash
|
197
|
+
def to_hash
|
198
|
+
hash = {}
|
199
|
+
self.class.attribute_map.each_pair do |attr, param|
|
200
|
+
value = self.send(attr)
|
201
|
+
if value.nil?
|
202
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
203
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
204
|
+
end
|
205
|
+
|
206
|
+
hash[param] = _to_hash(value)
|
207
|
+
end
|
208
|
+
hash
|
209
|
+
end
|
210
|
+
|
211
|
+
# Outputs non-array value in the form of hash
|
212
|
+
# For object, use to_hash. Otherwise, just return the value
|
213
|
+
# @param [Object] value Any valid value
|
214
|
+
# @return [Hash] Returns the value in the form of hash
|
215
|
+
def _to_hash(value)
|
216
|
+
if value.is_a?(Array)
|
217
|
+
value.compact.map { |v| _to_hash(v) }
|
218
|
+
elsif value.is_a?(Hash)
|
219
|
+
{}.tap do |hash|
|
220
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
221
|
+
end
|
222
|
+
elsif value.respond_to? :to_hash
|
223
|
+
value.to_hash
|
224
|
+
else
|
225
|
+
value
|
226
|
+
end
|
227
|
+
end
|
228
|
+
|
229
|
+
end
|
230
|
+
|
231
|
+
end
|