Class: Tremendous::TremendousApi
- Inherits:
-
Object
- Object
- Tremendous::TremendousApi
- Defined in:
- lib/tremendous/api/tremendous_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#approve_order(id, opts = {}) ⇒ CreateOrder201Response
Approve order Approves an order that is pending review, identified by the given ‘id` in the URL.
-
#approve_order_with_http_info(id, opts = {}) ⇒ Array<(CreateOrder201Response, Integer, Hash)>
Approve order Approves an order that is pending review, identified by the given `id` in the URL.
-
#create_api_key(opts = {}) ⇒ CreateApiKey200Response
Create API key Creates a new API key.
-
#create_api_key_with_http_info(opts = {}) ⇒ Array<(CreateApiKey200Response, Integer, Hash)>
Create API key Creates a new API key.
-
#create_invoice(create_invoice_request, opts = {}) ⇒ CreateInvoice200Response
Create invoice Creating an invoice is the way for your organization to fund your account’s balance.
-
#create_invoice_with_http_info(create_invoice_request, opts = {}) ⇒ Array<(CreateInvoice200Response, Integer, Hash)>
Create invoice Creating an invoice is the way for your organization to fund your account's balance.
-
#create_member(create_member_request, opts = {}) ⇒ CreateMember200Response
Create member Each organization has one or more users that can access and manage that organization.
-
#create_member_with_http_info(create_member_request, opts = {}) ⇒ Array<(CreateMember200Response, Integer, Hash)>
Create member Each organization has one or more users that can access and manage that organization.
-
#create_order(create_order_request, opts = {}) ⇒ CreateOrder200Response
Create order Every time you want to send out a reward through Tremendous you need to create an order for it.
-
#create_order_with_http_info(create_order_request, opts = {}) ⇒ Array<(CreateOrder200Response, Integer, Hash)>
Create order Every time you want to send out a reward through Tremendous you need to create an order for it.
-
#create_organization(create_organization_request, opts = {}) ⇒ CreateOrganization200Response
Create organization Organizations are a way to separate different parts of your business within the same Tremendous account.
-
#create_organization_with_http_info(create_organization_request, opts = {}) ⇒ Array<(CreateOrganization200Response, Integer, Hash)>
Create organization Organizations are a way to separate different parts of your business within the same Tremendous account.
-
#create_webhook(create_webhook_request, opts = {}) ⇒ CreateWebhook200Response
Create webhook Tremendous uses webhooks as a notification system for various events that happen in your account.
-
#create_webhook_with_http_info(create_webhook_request, opts = {}) ⇒ Array<(CreateWebhook200Response, Integer, Hash)>
Create webhook Tremendous uses webhooks as a notification system for various events that happen in your account.
-
#delete_invoices(id, opts = {}) ⇒ CreateInvoice200Response
Delete invoice Removes an invoice.
-
#delete_invoices_with_http_info(id, opts = {}) ⇒ Array<(CreateInvoice200Response, Integer, Hash)>
Delete invoice Removes an invoice.
-
#download_invoice_csv(id, opts = {}) ⇒ String
Retrieve invoice as CSV Generates a CSV version for an invoice listing the associated rewards and orders.
-
#download_invoice_csv_with_http_info(id, opts = {}) ⇒ Array<(String, Integer, Hash)>
Retrieve invoice as CSV Generates a CSV version for an invoice listing the associated rewards and orders.
-
#download_invoice_pdf(id, opts = {}) ⇒ File
Retrieve invoice as PDF Generates a PDF version for an invoice.
-
#download_invoice_pdf_with_http_info(id, opts = {}) ⇒ Array<(File, Integer, Hash)>
Retrieve invoice as PDF Generates a PDF version for an invoice.
-
#generate_reward_link(id, opts = {}) ⇒ GenerateRewardLink200Response
Generate a reward URL Generate a redemption link for the reward identified by the ‘id` in the URL.
-
#generate_reward_link_with_http_info(id, opts = {}) ⇒ Array<(GenerateRewardLink200Response, Integer, Hash)>
Generate a reward URL Generate a redemption link for the reward identified by the `id` in the URL.
-
#generate_reward_token(id, opts = {}) ⇒ GenerateRewardToken200Response
Generate a reward token Generate a temporary reward token identified by the ‘id` in the URL.
-
#generate_reward_token_with_http_info(id, opts = {}) ⇒ Array<(GenerateRewardToken200Response, Integer, Hash)>
Generate a reward token Generate a temporary reward token identified by the `id` in the URL.
-
#get_campaign(id, opts = {}) ⇒ GetCampaign200Response
Retrieve campaign Retrieve a campaign, identified by the given ‘id` in the URL.
-
#get_campaign_with_http_info(id, opts = {}) ⇒ Array<(GetCampaign200Response, Integer, Hash)>
Retrieve campaign Retrieve a campaign, identified by the given `id` in the URL.
-
#get_funding_source(id, opts = {}) ⇒ GetFundingSource200Response
Retrieve funding source Retrieve a funding source, identified by the given ‘id` in the URL.
-
#get_funding_source_with_http_info(id, opts = {}) ⇒ Array<(GetFundingSource200Response, Integer, Hash)>
Retrieve funding source Retrieve a funding source, identified by the given `id` in the URL.
-
#get_invoice(id, opts = {}) ⇒ CreateInvoice200Response
Retrieve invoice Retrieve an invoice, identified by the given ‘id` in the URL > 📘 Deleted Invoices > > This endpoint can be used to retrieve details on deleted invoices > that the list of invoices omits.
-
#get_invoice_with_http_info(id, opts = {}) ⇒ Array<(CreateInvoice200Response, Integer, Hash)>
Retrieve invoice Retrieve an invoice, identified by the given `id` in the URL > 📘 Deleted Invoices > > This endpoint can be used to retrieve details on deleted invoices > that the list of invoices omits.
-
#get_member(id, opts = {}) ⇒ GetMember200Response
Retrieve member.
-
#get_member_with_http_info(id, opts = {}) ⇒ Array<(GetMember200Response, Integer, Hash)>
Retrieve member.
-
#get_order(id, opts = {}) ⇒ CreateOrder201Response
Retrieve order Retrieve the order, identified by the given ‘id` in the URL.
-
#get_order_with_http_info(id, opts = {}) ⇒ Array<(CreateOrder201Response, Integer, Hash)>
Retrieve order Retrieve the order, identified by the given `id` in the URL.
-
#get_organization(id, opts = {}) ⇒ GetOrganization200Response
Retrieve organization.
-
#get_organization_with_http_info(id, opts = {}) ⇒ Array<(GetOrganization200Response, Integer, Hash)>
Retrieve organization.
-
#get_product(id, opts = {}) ⇒ GetProductResponse
Retrieve product Retrieve a product, identified by the given ‘id` in the URL.
-
#get_product_with_http_info(id, opts = {}) ⇒ Array<(GetProductResponse, Integer, Hash)>
Retrieve product Retrieve a product, identified by the given `id` in the URL.
-
#get_reward(id, opts = {}) ⇒ GetReward200Response
Retrieve single reward Retrieve the reward, identified by the given ‘id` in the URL.
-
#get_reward_with_http_info(id, opts = {}) ⇒ Array<(GetReward200Response, Integer, Hash)>
Retrieve single reward Retrieve the reward, identified by the given `id` in the URL.
-
#get_webhook(id, opts = {}) ⇒ CreateWebhook200Response
Retrieve webhook > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > [Read it here](/docs/webhooks-1).
-
#get_webhook_with_http_info(id, opts = {}) ⇒ Array<(CreateWebhook200Response, Integer, Hash)>
Retrieve webhook > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > [Read it here](/docs/webhooks-1).
-
#initialize(api_client = ApiClient.default) ⇒ TremendousApi
constructor
A new instance of TremendousApi.
-
#list_balance_transactions(opts = {}) ⇒ ListBalanceTransactions200Response
List balance transactions Fetch a list of all balance transactions on your account.
-
#list_balance_transactions_with_http_info(opts = {}) ⇒ Array<(ListBalanceTransactions200Response, Integer, Hash)>
List balance transactions Fetch a list of all balance transactions on your account.
-
#list_campaigns(opts = {}) ⇒ ListCampaigns200Response
List campaigns Retrieve a list of all campaigns created in your account.
-
#list_campaigns_with_http_info(opts = {}) ⇒ Array<(ListCampaigns200Response, Integer, Hash)>
List campaigns Retrieve a list of all campaigns created in your account.
-
#list_fields(opts = {}) ⇒ ListFields200Response
List fields For reporting and analytics purposes, custom fields can be associated with rewards generated through the API.
-
#list_fields_with_http_info(opts = {}) ⇒ Array<(ListFields200Response, Integer, Hash)>
List fields For reporting and analytics purposes, custom fields can be associated with rewards generated through the API.
-
#list_funding_sources(opts = {}) ⇒ ListFundingSources200Response
List funding sources Retrieve a list of all funding sources available for ordering through the API in your organization’s account.
-
#list_funding_sources_with_http_info(opts = {}) ⇒ Array<(ListFundingSources200Response, Integer, Hash)>
List funding sources Retrieve a list of all funding sources available for ordering through the API in your organization's account.
-
#list_invoices(opts = {}) ⇒ ListInvoices200Response
List invoices Fetch a list of all invoices on your account.
-
#list_invoices_with_http_info(opts = {}) ⇒ Array<(ListInvoices200Response, Integer, Hash)>
List invoices Fetch a list of all invoices on your account.
-
#list_members(opts = {}) ⇒ ListMembers200Response
List members To list members of a sub-organization [create an API key for that organization](/reference/post_organizations-id-create-api-key) first, then use the new API key in the list members request.
-
#list_members_with_http_info(opts = {}) ⇒ Array<(ListMembers200Response, Integer, Hash)>
List members To list members of a sub-organization [create an API key for that organization](/reference/post_organizations-id-create-api-key) first, then use the new API key in the list members request.
-
#list_orders(opts = {}) ⇒ ListOrders200Response
List orders Retrieve a list of orders.
-
#list_orders_with_http_info(opts = {}) ⇒ Array<(ListOrders200Response, Integer, Hash)>
List orders Retrieve a list of orders.
-
#list_organizations(opts = {}) ⇒ ListOrganizations200Response
List organizations The returned list only includes the organization to which the API key belongs to, that is used for the request.
-
#list_organizations_with_http_info(opts = {}) ⇒ Array<(ListOrganizations200Response, Integer, Hash)>
List organizations The returned list only includes the organization to which the API key belongs to, that is used for the request.
-
#list_products(opts = {}) ⇒ ListProductsResponse
List products Retrieve a list of available products.
-
#list_products_with_http_info(opts = {}) ⇒ Array<(ListProductsResponse, Integer, Hash)>
List products Retrieve a list of available products.
-
#list_rewards(opts = {}) ⇒ ListRewards200Response
List rewards Retrieve a list of all created rewards.
-
#list_rewards_with_http_info(opts = {}) ⇒ Array<(ListRewards200Response, Integer, Hash)>
List rewards Retrieve a list of all created rewards.
-
#list_webhook_events(id, opts = {}) ⇒ ListWebhookEvents200Response
List events Lists all event types that can be sent to the configured webhook endpoint.
-
#list_webhook_events_with_http_info(id, opts = {}) ⇒ Array<(ListWebhookEvents200Response, Integer, Hash)>
List events Lists all event types that can be sent to the configured webhook endpoint.
-
#list_webhooks(opts = {}) ⇒ ListWebhooks200Response
List webhooks Every organization can only have one webhook.
-
#list_webhooks_with_http_info(opts = {}) ⇒ Array<(ListWebhooks200Response, Integer, Hash)>
List webhooks Every organization can only have one webhook.
-
#reject_order(id, opts = {}) ⇒ CreateOrder201Response
Reject order Rejects an order that is pending review, identified by the given ‘id` in the URL.
-
#reject_order_with_http_info(id, opts = {}) ⇒ Array<(CreateOrder201Response, Integer, Hash)>
Reject order Rejects an order that is pending review, identified by the given `id` in the URL.
-
#resend_reward(id, opts = {}) ⇒ Object
Resend reward Resends a reward, identified by the given ‘id` in the URL, to its recipient.
-
#resend_reward_with_http_info(id, opts = {}) ⇒ Array<(Object, Integer, Hash)>
Resend reward Resends a reward, identified by the given `id` in the URL, to its recipient.
-
#simulate_webhook(id, simulate_webhook_request, opts = {}) ⇒ String
Test webhook Making a request to this endpoint will cause our system to trigger a webhook for the specified event.
-
#simulate_webhook_with_http_info(id, simulate_webhook_request, opts = {}) ⇒ Array<(String, Integer, Hash)>
Test webhook Making a request to this endpoint will cause our system to trigger a webhook for the specified event.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ TremendousApi
Returns a new instance of TremendousApi.
19 20 21 |
# File 'lib/tremendous/api/tremendous_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/tremendous/api/tremendous_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#approve_order(id, opts = {}) ⇒ CreateOrder201Response
Approve order Approves an order that is pending review, identified by the given ‘id` in the URL. Approvals is a feature that requires orders to be approved by an organization admin before they are sent out. To enable approvals for your organization, please enable ’Allow approvals via API’ via the organization”s ‘Order Approvals’ settings from the Tremendous dashboard.
27 28 29 30 |
# File 'lib/tremendous/api/tremendous_api.rb', line 27 def approve_order(id, opts = {}) data, _status_code, _headers = approve_order_with_http_info(id, opts) data end |
#approve_order_with_http_info(id, opts = {}) ⇒ Array<(CreateOrder201Response, Integer, Hash)>
Approve order Approves an order that is pending review, identified by the given `id` in the URL. Approvals is a feature that requires orders to be approved by an organization admin before they are sent out. To enable approvals for your organization, please enable 'Allow approvals via API' via the organization''s 'Order Approvals' settings from the Tremendous dashboard.
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/tremendous/api/tremendous_api.rb', line 37 def approve_order_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TremendousApi.approve_order ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.approve_order" end pattern = Regexp.new(/[A-Z0-9]{4,20}/) if @api_client.config.client_side_validation && id !~ pattern fail ArgumentError, "invalid value for 'id' when calling TremendousApi.approve_order, must conform to the pattern #{pattern}." end # resource path local_var_path = '/order_approvals/{id}/approve'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'CreateOrder201Response' # auth_names auth_names = opts[:debug_auth_names] || ['BearerApiKey'] = opts.merge( :operation => :"TremendousApi.approve_order", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TremendousApi#approve_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#create_api_key(opts = {}) ⇒ CreateApiKey200Response
Create API key Creates a new API key. The API key used to make the request will remain active. Created API keys are generated randomly and returned in the response. **You cannot retrieve them again.**
94 95 96 97 |
# File 'lib/tremendous/api/tremendous_api.rb', line 94 def create_api_key(opts = {}) data, _status_code, _headers = create_api_key_with_http_info(opts) data end |
#create_api_key_with_http_info(opts = {}) ⇒ Array<(CreateApiKey200Response, Integer, Hash)>
Create API key Creates a new API key. The API key used to make the request will remain active. Created API keys are generated randomly and returned in the response. **You cannot retrieve them again.**
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 |
# File 'lib/tremendous/api/tremendous_api.rb', line 103 def create_api_key_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TremendousApi.create_api_key ...' end # resource path local_var_path = '/organizations/create_api_key' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'CreateApiKey200Response' # auth_names auth_names = opts[:debug_auth_names] || ['BearerApiKey'] = opts.merge( :operation => :"TremendousApi.create_api_key", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TremendousApi#create_api_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#create_invoice(create_invoice_request, opts = {}) ⇒ CreateInvoice200Response
Create invoice Creating an invoice is the way for your organization to fund your account’s balance. 1. Create an invoice 2. Pay the invoice 3. Funds get added to your account’s balance ## Request body <div class="object-schema-request-schema"> <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>
152 153 154 155 |
# File 'lib/tremendous/api/tremendous_api.rb', line 152 def create_invoice(create_invoice_request, opts = {}) data, _status_code, _headers = create_invoice_with_http_info(create_invoice_request, opts) data end |
#create_invoice_with_http_info(create_invoice_request, opts = {}) ⇒ Array<(CreateInvoice200Response, Integer, Hash)>
Create invoice Creating an invoice is the way for your organization to fund your account's balance. 1. Create an invoice 2. Pay the invoice 3. Funds get added to your account's balance ## Request body <div class="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>
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 |
# File 'lib/tremendous/api/tremendous_api.rb', line 162 def create_invoice_with_http_info(create_invoice_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TremendousApi.create_invoice ...' end # verify the required parameter 'create_invoice_request' is set if @api_client.config.client_side_validation && create_invoice_request.nil? fail ArgumentError, "Missing the required parameter 'create_invoice_request' when calling TremendousApi.create_invoice" end # resource path local_var_path = '/invoices' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(create_invoice_request) # return_type return_type = opts[:debug_return_type] || 'CreateInvoice200Response' # auth_names auth_names = opts[:debug_auth_names] || ['BearerApiKey'] = opts.merge( :operation => :"TremendousApi.create_invoice", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TremendousApi#create_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#create_member(create_member_request, opts = {}) ⇒ CreateMember200Response
Create member Each organization has one or more users that can access and manage that organization. These users are called members. Members can take actions via the Tremendous web dashboard directly. These actions include adding funding sources to the organization, creating Campaigns, and more. ### Permissions Members can have 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.
220 221 222 223 |
# File 'lib/tremendous/api/tremendous_api.rb', line 220 def create_member(create_member_request, opts = {}) data, _status_code, _headers = create_member_with_http_info(create_member_request, opts) data end |
#create_member_with_http_info(create_member_request, opts = {}) ⇒ Array<(CreateMember200Response, Integer, Hash)>
Create member Each organization has one or more users that can access and manage that organization. These users are called members. Members can take actions via the Tremendous web dashboard directly. These actions include adding funding sources to the organization, creating Campaigns, and more. ### Permissions Members can have 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.
230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 |
# File 'lib/tremendous/api/tremendous_api.rb', line 230 def create_member_with_http_info(create_member_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TremendousApi.create_member ...' end # verify the required parameter 'create_member_request' is set if @api_client.config.client_side_validation && create_member_request.nil? fail ArgumentError, "Missing the required parameter 'create_member_request' when calling TremendousApi.create_member" end # resource path local_var_path = '/members' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(create_member_request) # return_type return_type = opts[:debug_return_type] || 'CreateMember200Response' # auth_names auth_names = opts[:debug_auth_names] || ['BearerApiKey'] = opts.merge( :operation => :"TremendousApi.create_member", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TremendousApi#create_member\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#create_order(create_order_request, opts = {}) ⇒ CreateOrder200Response
Create order Every time you want to send out a reward through Tremendous you need to create an order for it. > 📘 Getting started with your first order > > Our step-by-step guide walks you through everything you need > to send your first gift card through the Tremendous API: > > <strong><a style="display: block; margin-top: 20px;" href="/docs/sending-rewards-intro">Check it out!</a></strong> ## Request body <div class="object-schema-request-schema"> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class="object-schema-table-body"> <tr class=""><td><div class="property-name"> <code class="property-name">external_id</code> </div> </td><td><span class="property-type">string</span></td><td><p>Reference for this order, supplied by the customer.</p> <p>When set, external_id
makes order idempotent. All requests that use the same external_id
after the initial order creation, will result in a response that returns the data of the initially created order. The response will have a 201
response code. These responses <strong>fail</strong> to create any further orders.</p> <p>It also allows for retrieving by external_id
instead of id
only.</p> </td></tr> <tr class=""><td><div class="property-name"> <code class="property-name">payment</code> </div> </td><td><span class="property-type">object</span></td><td></td></tr> <tr> <td colspan="3"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class="object-schema-table-body"> <tr class=""><td><div class="property-name"> <code class="property-name">funding_source_id</code> </div> </td><td><span class="property-type">string</span></td><td><p>Tremendous ID of the funding source that will be used to pay for the order. Use balance
to use your Tremendous's balance.</p> </td></tr> </tbody> </table> </tr> <tr class=""><td><div class="property-name"> <code class="property-name">reward</code> </div> </td><td><span class="property-type">object</span></td><td><p>A single reward, sent to a recipient. A reward is always part of an order.</p> <p>Either products
or campaign_id
must be specified.</p> </td></tr> <tr> <td colspan="3"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class="object-schema-table-body"> <tr class="property-conditional-hint-response-only"><td><div class="property-name"> <code class="property-name">id</code> </div> </td><td><span class="property-type">string</span></td><td><p>Tremendous ID of the reward</p> </td></tr> <tr class="property-conditional-hint-response-only"><td><div class="property-name"> <code class="property-name">order_id</code> </div> </td><td><span class="property-type">string</span></td><td><p>Tremendous ID of the order this reward is part of.</p> </td></tr> <tr class="property-conditional-hint-response-only"><td><div class="property-name"> <code class="property-name">created_at</code> </div> </td><td><span class="property-type">string</span> <span class="property-format">date-time</span></td><td><p>Date the reward was created</p> </td></tr> <tr class="property-conditional-hint-request-only"><td><div class="property-name"> <code class="property-name">campaign_id</code> </div> </td><td><span class="property-type">string</span></td><td><p>ID of the campaign in your account, that defines the available products (different gift cards, charity, etc.) that the recipient can choose from.</p> </td></tr> <tr class="property-conditional-hint-request-only"><td><div class="property-name"> <code class="property-name">products</code> </div> </td><td><span class="property-type">array</span> <span class="property-format">string</span></td><td><p>List of IDs of product (different gift cards, charity, etc.) that will be available to the recipient to choose from.</p> <p>Providing a products
array will override the products made available by the campaign specified using the campaign_id
property unless the products
array is empty. It will not override other campaign attributes, like the message and customization of the look and feel.</p> </td></tr> <tr class=""><td><div class="property-name"> <code class="property-name">value</code> </div> </td><td><span class="property-type">object</span></td><td></td></tr> <tr> <td colspan="3"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class="object-schema-table-body"> <tr class=""><td><div class="property-name"> <code class="property-name">denomination</code> </div> </td><td><span class="property-type">number</span> <span class="property-format">double</span></td><td><p>Amount of the reward</p> </td></tr> <tr class=""><td><div class="property-name"> <code class="property-name">currency_code</code> </div> </td><td><span class="property-type">string</span></td><td><p>Currency of the reward</p> </td></tr> </tbody> </table> </tr> <tr class=""><td><div class="property-name"> <code class="property-name">recipient</code> </div> </td><td><span class="property-type">object</span></td><td><p>Details of the recipient of the reward</p> </td></tr> <tr> <td colspan="3"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class="object-schema-table-body"> <tr class=""><td><div class="property-name"> <code class="property-name">name</code> </div> </td><td><span class="property-type">string</span></td><td><p>Name of the recipient</p> </td></tr> <tr class=""><td><div class="property-name"> <code class="property-name">email</code> </div> </td><td><span class="property-type">string</span></td><td><p>Email address of the recipient</p> </td></tr> <tr class=""><td><div class="property-name"> <code class="property-name">phone</code> </div> </td><td><span class="property-type">string</span></td><td><p>Phone number of the recipient. For non-US phone numbers, specify the country code (prefixed with +).</p> </td></tr> </tbody> </table> </tr> <tr class=""><td><div class="property-name"> <code class="property-name">deliver_at</code> </div> </td><td><span class="property-type">string</span> <span class="property-format">date</span></td><td><p>Timestamp of reward delivery within the next year. Note that if date-time is provided, the time values will be ignored.</p> </td></tr> <tr class=""><td><div class="property-name"> <code class="property-name">custom_fields</code> </div> </td><td><span class="property-type">array</span></td><td></td></tr> <tr> <td colspan="3"> <details> <summary>Show array item type</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class="object-schema-table-body"> <tr class=""><td><div class="property-name"> <code class="property-name">id</code> </div> </td><td><span class="property-type">string</span></td><td><p>Tremendous ID of the custom field</p> </td></tr> <tr class=""><td><div class="property-name"> <code class="property-name">value</code> </div> </td><td><span class="property-type">string</span></td><td><p>Value of the custom field</p> </td></tr> </tbody> </table> </tr> <tr class=""><td><div class="property-name"> <code class="property-name">language</code> </div> </td><td><span class="property-type">string</span></td><td><p>Set this to translate the redemption experience for this reward. Pass a 2-letter <a href="en.wikipedia.org/wiki/List_of_ISO_639-1_codes">ISO-639-1 code</a> for the desired language. Defaults to en
.</p> </td></tr> <tr class=""><td><div class="property-name"> <code class="property-name">delivery</code> </div> </td><td><span class="property-type">object</span></td><td><p>Details on how the reward is delivered to the recipient.</p> </td></tr> <tr> <td colspan="3"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class="object-schema-table-body"> <tr class=""><td><div class="property-name"> <code class="property-name">method</code> </div> </td><td><span class="property-type">string</span></td><td><p>How to deliver the reward to the recipient.</p> <table> <thead> <tr> <th>Delivery Method</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>EMAIL
</td> <td>Deliver the reward to the recipient by email</td> </tr> <tr> <td>LINK
</td> <td> <p>Deliver the reward to the recipient via a link.</p> <p>The link can be retrieved on a successfully ordered reward via the /rewards
or /rewards/{id}
endpoint. That link must then be delivered to the recipient out-of-band.</p> </td> </tr> <tr> <td>PHONE
</td> <td>Deliver the reward to the recipient by SMS</td> </tr> </tbody> </table> </td></tr> </tbody> </table> </tr> </tbody> </table> </tr> </tbody> </table> </div> ### Funding sources There are different ways to pay for gift cards and rewards on Tremendous. Every payment mechanism is called a "funding source". You can retrieve a list of all available funding sources by using the [Funding sources API endpoint](tremendous.readme.io/reference/core-funding-source-index). The Tremendous API sandbox environment comes with a single funding source that allows you to spend up to $5,000 in *fake money* to test the API. [Learn more about the sandbox environment](tremendous.readme.io/reference/sandbox). The HTTP status code ‘200` on the response will be used to indicate success. After processing successfully the reward gets queued to be delivered to it’s recipient (for delivery method ‘EMAIL` and `PHONE`). Delivery will happen asynchronously, after the response has been sent. ### Idempotence Requests issued with the same external_id are idempotent. Submitting an order with an already existing `external_id`, will result in a `201` response code. In this case the response will return a representation of the already existing order in the response body.
288 289 290 291 |
# File 'lib/tremendous/api/tremendous_api.rb', line 288 def create_order(create_order_request, opts = {}) data, _status_code, _headers = create_order_with_http_info(create_order_request, opts) data end |
#create_order_with_http_info(create_order_request, opts = {}) ⇒ Array<(CreateOrder200Response, Integer, Hash)>
Create order Every time you want to send out a reward through Tremendous you need to create an order for it. > 📘 Getting started with your first order > > Our step-by-step guide walks you through everything you need > to send your first gift card through the Tremendous API: > > <strong><a style="display: block; margin-top: 20px;" href="/docs/sending-rewards-intro">Check it out!</a></strong> ## Request body <div class="object-schema-request-schema"> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class="object-schema-table-body"> <tr class=""><td><div class="property-name"> <code class="property-name">external_id</code> </div> </td><td><span class="property-type">string</span></td><td><p>Reference for this order, supplied by the customer.</p> <p>When set, <code>external_id</code> makes order idempotent. All requests that use the same <code>external_id</code> after the initial order creation, will result in a response that returns the data of the initially created order. The response will have a <code>201</code> response code. These responses <strong>fail</strong> to create any further orders.</p> <p>It also allows for retrieving by <code>external_id</code> instead of <code>id</code> only.</p> </td></tr> <tr class=""><td><div class="property-name"> <code class="property-name">payment</code> </div> </td><td><span class="property-type">object</span></td><td></td></tr> <tr> <td colspan="3"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class="object-schema-table-body"> <tr class=""><td><div class="property-name"> <code class="property-name">funding_source_id</code> </div> </td><td><span class="property-type">string</span></td><td><p>Tremendous ID of the funding source that will be used to pay for the order. Use <code>balance</code> to use your Tremendous&#39;s balance.</p> </td></tr> </tbody> </table> </tr> <tr class=""><td><div class="property-name"> <code class="property-name">reward</code> </div> </td><td><span class="property-type">object</span></td><td><p>A single reward, sent to a recipient. A reward is always part of an order.</p> <p>Either <code>products</code> or <code>campaign_id</code> must be specified.</p> </td></tr> <tr> <td colspan="3"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class="object-schema-table-body"> <tr class="property-conditional-hint-response-only"><td><div class="property-name"> <code class="property-name">id</code> </div> </td><td><span class="property-type">string</span></td><td><p>Tremendous ID of the reward</p> </td></tr> <tr class="property-conditional-hint-response-only"><td><div class="property-name"> <code class="property-name">order_id</code> </div> </td><td><span class="property-type">string</span></td><td><p>Tremendous ID of the order this reward is part of.</p> </td></tr> <tr class="property-conditional-hint-response-only"><td><div class="property-name"> <code class="property-name">created_at</code> </div> </td><td><span class="property-type">string</span> <span class="property-format">date-time</span></td><td><p>Date the reward was created</p> </td></tr> <tr class="property-conditional-hint-request-only"><td><div class="property-name"> <code class="property-name">campaign_id</code> </div> </td><td><span class="property-type">string</span></td><td><p>ID of the campaign in your account, that defines the available products (different gift cards, charity, etc.) that the recipient can choose from.</p> </td></tr> <tr class="property-conditional-hint-request-only"><td><div class="property-name"> <code class="property-name">products</code> </div> </td><td><span class="property-type">array</span> <span class="property-format">string</span></td><td><p>List of IDs of product (different gift cards, charity, etc.) that will be available to the recipient to choose from.</p> <p>Providing a <code>products</code> array will override the products made available by the campaign specified using the <code>campaign_id</code> property unless the <code>products</code> array is empty. It will <em>not</em> override other campaign attributes, like the message and customization of the look and feel.</p> </td></tr> <tr class=""><td><div class="property-name"> <code class="property-name">value</code> </div> </td><td><span class="property-type">object</span></td><td></td></tr> <tr> <td colspan="3"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class="object-schema-table-body"> <tr class=""><td><div class="property-name"> <code class="property-name">denomination</code> </div> </td><td><span class="property-type">number</span> <span class="property-format">double</span></td><td><p>Amount of the reward</p> </td></tr> <tr class=""><td><div class="property-name"> <code class="property-name">currency_code</code> </div> </td><td><span class="property-type">string</span></td><td><p>Currency of the reward</p> </td></tr> </tbody> </table> </tr> <tr class=""><td><div class="property-name"> <code class="property-name">recipient</code> </div> </td><td><span class="property-type">object</span></td><td><p>Details of the recipient of the reward</p> </td></tr> <tr> <td colspan="3"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class="object-schema-table-body"> <tr class=""><td><div class="property-name"> <code class="property-name">name</code> </div> </td><td><span class="property-type">string</span></td><td><p>Name of the recipient</p> </td></tr> <tr class=""><td><div class="property-name"> <code class="property-name">email</code> </div> </td><td><span class="property-type">string</span></td><td><p>Email address of the recipient</p> </td></tr> <tr class=""><td><div class="property-name"> <code class="property-name">phone</code> </div> </td><td><span class="property-type">string</span></td><td><p>Phone number of the recipient. For non-US phone numbers, specify the country code (prefixed with +).</p> </td></tr> </tbody> </table> </tr> <tr class=""><td><div class="property-name"> <code class="property-name">deliver_at</code> </div> </td><td><span class="property-type">string</span> <span class="property-format">date</span></td><td><p>Timestamp of reward delivery within the next year. Note that if date-time is provided, the time values will be ignored.</p> </td></tr> <tr class=""><td><div class="property-name"> <code class="property-name">custom_fields</code> </div> </td><td><span class="property-type">array</span></td><td></td></tr> <tr> <td colspan="3"> <details> <summary>Show array item type</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class="object-schema-table-body"> <tr class=""><td><div class="property-name"> <code class="property-name">id</code> </div> </td><td><span class="property-type">string</span></td><td><p>Tremendous ID of the custom field</p> </td></tr> <tr class=""><td><div class="property-name"> <code class="property-name">value</code> </div> </td><td><span class="property-type">string</span></td><td><p>Value of the custom field</p> </td></tr> </tbody> </table> </tr> <tr class=""><td><div class="property-name"> <code class="property-name">language</code> </div> </td><td><span class="property-type">string</span></td><td><p>Set this to translate the redemption experience for this reward. Pass a 2-letter <a href="en.wikipedia.org/wiki/List_of_ISO_639-1_codes">ISO-639-1 code</a> for the desired language. Defaults to <code>en</code>.</p> </td></tr> <tr class=""><td><div class="property-name"> <code class="property-name">delivery</code> </div> </td><td><span class="property-type">object</span></td><td><p>Details on how the reward is delivered to the recipient.</p> </td></tr> <tr> <td colspan="3"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class="object-schema-table-body"> <tr class=""><td><div class="property-name"> <code class="property-name">method</code> </div> </td><td><span class="property-type">string</span></td><td><p>How to deliver the reward to the recipient.</p> <table> <thead> <tr> <th>Delivery Method</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>EMAIL</code></td> <td>Deliver the reward to the recipient by email</td> </tr> <tr> <td><code>LINK</code></td> <td> <p>Deliver the reward to the recipient via a link.</p> <p>The link can be retrieved on a successfully ordered reward via the <code>/rewards</code> or <code>/rewards/id</code> endpoint. That link must then be delivered to the recipient out-of-band.</p> </td> </tr> <tr> <td><code>PHONE</code></td> <td>Deliver the reward to the recipient by SMS</td> </tr> </tbody> </table> </td></tr> </tbody> </table> </tr> </tbody> </table> </tr> </tbody> </table> </div> ### Funding sources There are different ways to pay for gift cards and rewards on Tremendous. Every payment mechanism is called a "funding source". You can retrieve a list of all available funding sources by using the [Funding sources API endpoint](tremendous.readme.io/reference/core-funding-source-index). The Tremendous API sandbox environment comes with a single funding source that allows you to spend up to $5,000 in *fake money* to test the API. [Learn more about the sandbox environment](tremendous.readme.io/reference/sandbox). The HTTP status code `200` on the response will be used to indicate success. After processing successfully the reward gets queued to be delivered to it's recipient (for delivery method `EMAIL` and `PHONE`). Delivery will happen asynchronously, after the response has been sent. ### Idempotence Requests issued with the same external_id are idempotent. Submitting an order with an already existing `external_id`, will result in a `201` response code. In this case the response will return a representation of the already existing order in the response body.
298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 |
# File 'lib/tremendous/api/tremendous_api.rb', line 298 def create_order_with_http_info(create_order_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TremendousApi.create_order ...' end # verify the required parameter 'create_order_request' is set if @api_client.config.client_side_validation && create_order_request.nil? fail ArgumentError, "Missing the required parameter 'create_order_request' when calling TremendousApi.create_order" end # resource path local_var_path = '/orders' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(create_order_request) # return_type return_type = opts[:debug_return_type] || 'CreateOrder200Response' # auth_names auth_names = opts[:debug_auth_names] || ['BearerApiKey'] = opts.merge( :operation => :"TremendousApi.create_order", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TremendousApi#create_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#create_organization(create_organization_request, opts = {}) ⇒ CreateOrganization200Response
Create organization Organizations are a way to separate different parts of your business within the same Tremendous account. You can assign users in your Tremendous team as members to any organization. Users can be members of multiple organizations at once. API keys belong to a single organization. The API key used in a request determines on behalf of which organization the request is carried out. **Important note:** When creating an organization, you are required to either pass ‘with_api_key` or `copy_settings` in the request body as `true`. This ensures that your new Organization can either be accessed via the API or the Dashboard.
356 357 358 359 |
# File 'lib/tremendous/api/tremendous_api.rb', line 356 def create_organization(create_organization_request, opts = {}) data, _status_code, _headers = create_organization_with_http_info(create_organization_request, opts) data end |
#create_organization_with_http_info(create_organization_request, opts = {}) ⇒ Array<(CreateOrganization200Response, Integer, Hash)>
Create organization Organizations are a way to separate different parts of your business within the same Tremendous account. You can assign users in your Tremendous team as members to any organization. Users can be members of multiple organizations at once. API keys belong to a single organization. The API key used in a request determines on behalf of which organization the request is carried out. **Important note:** When creating an organization, you are required to either pass `with_api_key` or `copy_settings` in the request body as `true`. This ensures that your new Organization can either be accessed via the API or the Dashboard.
366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 |
# File 'lib/tremendous/api/tremendous_api.rb', line 366 def create_organization_with_http_info(create_organization_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TremendousApi.create_organization ...' end # verify the required parameter 'create_organization_request' is set if @api_client.config.client_side_validation && create_organization_request.nil? fail ArgumentError, "Missing the required parameter 'create_organization_request' when calling TremendousApi.create_organization" end # resource path local_var_path = '/organizations' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(create_organization_request) # return_type return_type = opts[:debug_return_type] || 'CreateOrganization200Response' # auth_names auth_names = opts[:debug_auth_names] || ['BearerApiKey'] = opts.merge( :operation => :"TremendousApi.create_organization", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TremendousApi#create_organization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#create_webhook(create_webhook_request, opts = {}) ⇒ CreateWebhook200Response
Create webhook Tremendous uses webhooks as a notification system for various events that happen in your account. > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > [Read it here](/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>
424 425 426 427 |
# File 'lib/tremendous/api/tremendous_api.rb', line 424 def create_webhook(create_webhook_request, opts = {}) data, _status_code, _headers = create_webhook_with_http_info(create_webhook_request, opts) data end |
#create_webhook_with_http_info(create_webhook_request, opts = {}) ⇒ Array<(CreateWebhook200Response, Integer, Hash)>
Create webhook Tremendous uses webhooks as a notification system for various events that happen in your account. > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > [Read it here](/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>
434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 |
# File 'lib/tremendous/api/tremendous_api.rb', line 434 def create_webhook_with_http_info(create_webhook_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TremendousApi.create_webhook ...' end # verify the required parameter 'create_webhook_request' is set if @api_client.config.client_side_validation && create_webhook_request.nil? fail ArgumentError, "Missing the required parameter 'create_webhook_request' when calling TremendousApi.create_webhook" end # resource path local_var_path = '/webhooks' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(create_webhook_request) # return_type return_type = opts[:debug_return_type] || 'CreateWebhook200Response' # auth_names auth_names = opts[:debug_auth_names] || ['BearerApiKey'] = opts.merge( :operation => :"TremendousApi.create_webhook", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TremendousApi#create_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_invoices(id, opts = {}) ⇒ CreateInvoice200Response
Delete invoice Removes an invoice. This has no further consequences but is a rather cosmetic operation.
492 493 494 495 |
# File 'lib/tremendous/api/tremendous_api.rb', line 492 def delete_invoices(id, opts = {}) data, _status_code, _headers = delete_invoices_with_http_info(id, opts) data end |
#delete_invoices_with_http_info(id, opts = {}) ⇒ Array<(CreateInvoice200Response, Integer, Hash)>
Delete invoice Removes an invoice. This has no further consequences but is a rather cosmetic operation.
502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 |
# File 'lib/tremendous/api/tremendous_api.rb', line 502 def delete_invoices_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TremendousApi.delete_invoices ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.delete_invoices" end # resource path local_var_path = '/invoices/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'CreateInvoice200Response' # auth_names auth_names = opts[:debug_auth_names] || ['BearerApiKey'] = opts.merge( :operation => :"TremendousApi.delete_invoices", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TremendousApi#delete_invoices\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#download_invoice_csv(id, opts = {}) ⇒ String
Retrieve invoice as CSV Generates a CSV version for an invoice listing the associated rewards and orders
555 556 557 558 |
# File 'lib/tremendous/api/tremendous_api.rb', line 555 def download_invoice_csv(id, opts = {}) data, _status_code, _headers = download_invoice_csv_with_http_info(id, opts) data end |
#download_invoice_csv_with_http_info(id, opts = {}) ⇒ Array<(String, Integer, Hash)>
Retrieve invoice as CSV Generates a CSV version for an invoice listing the associated rewards and orders
565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 |
# File 'lib/tremendous/api/tremendous_api.rb', line 565 def download_invoice_csv_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TremendousApi.download_invoice_csv ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.download_invoice_csv" end # resource path local_var_path = '/invoices/{id}/csv'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['text/csv', 'application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'String' # auth_names auth_names = opts[:debug_auth_names] || ['BearerApiKey'] = opts.merge( :operation => :"TremendousApi.download_invoice_csv", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TremendousApi#download_invoice_csv\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#download_invoice_pdf(id, opts = {}) ⇒ File
Retrieve invoice as PDF Generates a PDF version for an invoice
618 619 620 621 |
# File 'lib/tremendous/api/tremendous_api.rb', line 618 def download_invoice_pdf(id, opts = {}) data, _status_code, _headers = download_invoice_pdf_with_http_info(id, opts) data end |
#download_invoice_pdf_with_http_info(id, opts = {}) ⇒ Array<(File, Integer, Hash)>
Retrieve invoice as PDF Generates a PDF version for an invoice
628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 |
# File 'lib/tremendous/api/tremendous_api.rb', line 628 def download_invoice_pdf_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TremendousApi.download_invoice_pdf ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.download_invoice_pdf" end # resource path local_var_path = '/invoices/{id}/pdf'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/pdf', 'application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'File' # auth_names auth_names = opts[:debug_auth_names] || ['BearerApiKey'] = opts.merge( :operation => :"TremendousApi.download_invoice_pdf", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TremendousApi#download_invoice_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#generate_reward_link(id, opts = {}) ⇒ GenerateRewardLink200Response
Generate a reward URL Generate a redemption link for the reward identified by the ‘id` in the URL
681 682 683 684 |
# File 'lib/tremendous/api/tremendous_api.rb', line 681 def generate_reward_link(id, opts = {}) data, _status_code, _headers = generate_reward_link_with_http_info(id, opts) data end |
#generate_reward_link_with_http_info(id, opts = {}) ⇒ Array<(GenerateRewardLink200Response, Integer, Hash)>
Generate a reward URL Generate a redemption link for the reward identified by the `id` in the URL
691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 |
# File 'lib/tremendous/api/tremendous_api.rb', line 691 def generate_reward_link_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TremendousApi.generate_reward_link ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.generate_reward_link" end pattern = Regexp.new(/[A-Z0-9]{4,20}/) if @api_client.config.client_side_validation && id !~ pattern fail ArgumentError, "invalid value for 'id' when calling TremendousApi.generate_reward_link, must conform to the pattern #{pattern}." end # resource path local_var_path = '/rewards/{id}/generate_link'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GenerateRewardLink200Response' # auth_names auth_names = opts[:debug_auth_names] || ['BearerApiKey'] = opts.merge( :operation => :"TremendousApi.generate_reward_link", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TremendousApi#generate_reward_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#generate_reward_token(id, opts = {}) ⇒ GenerateRewardToken200Response
Generate a reward token Generate a temporary reward token identified by the ‘id` in the URL. These tokens are needed to render a reward when using [Tremendous Embed](github.com/tremendous-rewards/embed/blob/master/docs/documentation.md). The token is valid for 24 hours.
749 750 751 752 |
# File 'lib/tremendous/api/tremendous_api.rb', line 749 def generate_reward_token(id, opts = {}) data, _status_code, _headers = generate_reward_token_with_http_info(id, opts) data end |
#generate_reward_token_with_http_info(id, opts = {}) ⇒ Array<(GenerateRewardToken200Response, Integer, Hash)>
Generate a reward token Generate a temporary reward token identified by the `id` in the URL. These tokens are needed to render a reward when using [Tremendous Embed](github.com/tremendous-rewards/embed/blob/master/docs/documentation.md). The token is valid for 24 hours.
759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 |
# File 'lib/tremendous/api/tremendous_api.rb', line 759 def generate_reward_token_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TremendousApi.generate_reward_token ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.generate_reward_token" end pattern = Regexp.new(/[A-Z0-9]{4,20}/) if @api_client.config.client_side_validation && id !~ pattern fail ArgumentError, "invalid value for 'id' when calling TremendousApi.generate_reward_token, must conform to the pattern #{pattern}." end # resource path local_var_path = '/rewards/{id}/generate_embed_token'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GenerateRewardToken200Response' # auth_names auth_names = opts[:debug_auth_names] || ['BearerApiKey'] = opts.merge( :operation => :"TremendousApi.generate_reward_token", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TremendousApi#generate_reward_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_campaign(id, opts = {}) ⇒ GetCampaign200Response
Retrieve campaign Retrieve a campaign, identified by the given ‘id` in the URL
817 818 819 820 |
# File 'lib/tremendous/api/tremendous_api.rb', line 817 def get_campaign(id, opts = {}) data, _status_code, _headers = get_campaign_with_http_info(id, opts) data end |
#get_campaign_with_http_info(id, opts = {}) ⇒ Array<(GetCampaign200Response, Integer, Hash)>
Retrieve campaign Retrieve a campaign, identified by the given `id` in the URL
827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 |
# File 'lib/tremendous/api/tremendous_api.rb', line 827 def get_campaign_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TremendousApi.get_campaign ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.get_campaign" end pattern = Regexp.new(/[A-Z0-9]{4,20}/) if @api_client.config.client_side_validation && id !~ pattern fail ArgumentError, "invalid value for 'id' when calling TremendousApi.get_campaign, must conform to the pattern #{pattern}." end # resource path local_var_path = '/campaigns/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GetCampaign200Response' # auth_names auth_names = opts[:debug_auth_names] || ['BearerApiKey'] = opts.merge( :operation => :"TremendousApi.get_campaign", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TremendousApi#get_campaign\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_funding_source(id, opts = {}) ⇒ GetFundingSource200Response
Retrieve funding source Retrieve a funding source, identified by the given ‘id` in the URL
885 886 887 888 |
# File 'lib/tremendous/api/tremendous_api.rb', line 885 def get_funding_source(id, opts = {}) data, _status_code, _headers = get_funding_source_with_http_info(id, opts) data end |
#get_funding_source_with_http_info(id, opts = {}) ⇒ Array<(GetFundingSource200Response, Integer, Hash)>
Retrieve funding source Retrieve a funding source, identified by the given `id` in the URL
895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 |
# File 'lib/tremendous/api/tremendous_api.rb', line 895 def get_funding_source_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TremendousApi.get_funding_source ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.get_funding_source" end pattern = Regexp.new(/[A-Z0-9]{4,20}/) if @api_client.config.client_side_validation && id !~ pattern fail ArgumentError, "invalid value for 'id' when calling TremendousApi.get_funding_source, must conform to the pattern #{pattern}." end # resource path local_var_path = '/funding_sources/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GetFundingSource200Response' # auth_names auth_names = opts[:debug_auth_names] || ['BearerApiKey'] = opts.merge( :operation => :"TremendousApi.get_funding_source", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TremendousApi#get_funding_source\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_invoice(id, opts = {}) ⇒ CreateInvoice200Response
Retrieve invoice Retrieve an invoice, identified by the given ‘id` in the URL > 📘 Deleted Invoices > > This endpoint can be used to retrieve details on deleted invoices > that the list of invoices omits.
953 954 955 956 |
# File 'lib/tremendous/api/tremendous_api.rb', line 953 def get_invoice(id, opts = {}) data, _status_code, _headers = get_invoice_with_http_info(id, opts) data end |
#get_invoice_with_http_info(id, opts = {}) ⇒ Array<(CreateInvoice200Response, Integer, Hash)>
Retrieve invoice Retrieve an invoice, identified by the given `id` in the URL > 📘 Deleted Invoices > > This endpoint can be used to retrieve details on deleted invoices > that the list of invoices omits.
963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 |
# File 'lib/tremendous/api/tremendous_api.rb', line 963 def get_invoice_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TremendousApi.get_invoice ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.get_invoice" end # resource path local_var_path = '/invoices/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'CreateInvoice200Response' # auth_names auth_names = opts[:debug_auth_names] || ['BearerApiKey'] = opts.merge( :operation => :"TremendousApi.get_invoice", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TremendousApi#get_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_member(id, opts = {}) ⇒ GetMember200Response
Retrieve member
1015 1016 1017 1018 |
# File 'lib/tremendous/api/tremendous_api.rb', line 1015 def get_member(id, opts = {}) data, _status_code, _headers = get_member_with_http_info(id, opts) data end |
#get_member_with_http_info(id, opts = {}) ⇒ Array<(GetMember200Response, Integer, Hash)>
Retrieve member
1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 |
# File 'lib/tremendous/api/tremendous_api.rb', line 1024 def get_member_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TremendousApi.get_member ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.get_member" end pattern = Regexp.new(/[A-Z0-9]{4,20}/) if @api_client.config.client_side_validation && id !~ pattern fail ArgumentError, "invalid value for 'id' when calling TremendousApi.get_member, must conform to the pattern #{pattern}." end # resource path local_var_path = '/members/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GetMember200Response' # auth_names auth_names = opts[:debug_auth_names] || ['BearerApiKey'] = opts.merge( :operation => :"TremendousApi.get_member", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TremendousApi#get_member\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_order(id, opts = {}) ⇒ CreateOrder201Response
Retrieve order Retrieve the order, identified by the given ‘id` in the URL
1082 1083 1084 1085 |
# File 'lib/tremendous/api/tremendous_api.rb', line 1082 def get_order(id, opts = {}) data, _status_code, _headers = get_order_with_http_info(id, opts) data end |
#get_order_with_http_info(id, opts = {}) ⇒ Array<(CreateOrder201Response, Integer, Hash)>
Retrieve order Retrieve the order, identified by the given `id` in the URL
1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 |
# File 'lib/tremendous/api/tremendous_api.rb', line 1092 def get_order_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TremendousApi.get_order ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.get_order" end # resource path local_var_path = '/orders/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'CreateOrder201Response' # auth_names auth_names = opts[:debug_auth_names] || ['BearerApiKey'] = opts.merge( :operation => :"TremendousApi.get_order", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TremendousApi#get_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_organization(id, opts = {}) ⇒ GetOrganization200Response
Retrieve organization
1144 1145 1146 1147 |
# File 'lib/tremendous/api/tremendous_api.rb', line 1144 def get_organization(id, opts = {}) data, _status_code, _headers = get_organization_with_http_info(id, opts) data end |
#get_organization_with_http_info(id, opts = {}) ⇒ Array<(GetOrganization200Response, Integer, Hash)>
Retrieve organization
1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 |
# File 'lib/tremendous/api/tremendous_api.rb', line 1153 def get_organization_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TremendousApi.get_organization ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.get_organization" end pattern = Regexp.new(/[A-Z0-9]{4,20}/) if @api_client.config.client_side_validation && id !~ pattern fail ArgumentError, "invalid value for 'id' when calling TremendousApi.get_organization, must conform to the pattern #{pattern}." end # resource path local_var_path = '/organizations/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GetOrganization200Response' # auth_names auth_names = opts[:debug_auth_names] || ['BearerApiKey'] = opts.merge( :operation => :"TremendousApi.get_organization", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TremendousApi#get_organization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_product(id, opts = {}) ⇒ GetProductResponse
Retrieve product Retrieve a product, identified by the given ‘id` in the URL
1211 1212 1213 1214 |
# File 'lib/tremendous/api/tremendous_api.rb', line 1211 def get_product(id, opts = {}) data, _status_code, _headers = get_product_with_http_info(id, opts) data end |
#get_product_with_http_info(id, opts = {}) ⇒ Array<(GetProductResponse, Integer, Hash)>
Retrieve product Retrieve a product, identified by the given `id` in the URL
1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 |
# File 'lib/tremendous/api/tremendous_api.rb', line 1221 def get_product_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TremendousApi.get_product ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.get_product" end pattern = Regexp.new(/[A-Z0-9]{4,20}/) if @api_client.config.client_side_validation && id !~ pattern fail ArgumentError, "invalid value for 'id' when calling TremendousApi.get_product, must conform to the pattern #{pattern}." end # resource path local_var_path = '/products/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GetProductResponse' # auth_names auth_names = opts[:debug_auth_names] || ['BearerApiKey'] = opts.merge( :operation => :"TremendousApi.get_product", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TremendousApi#get_product\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_reward(id, opts = {}) ⇒ GetReward200Response
Retrieve single reward Retrieve the reward, identified by the given ‘id` in the URL
1279 1280 1281 1282 |
# File 'lib/tremendous/api/tremendous_api.rb', line 1279 def get_reward(id, opts = {}) data, _status_code, _headers = get_reward_with_http_info(id, opts) data end |
#get_reward_with_http_info(id, opts = {}) ⇒ Array<(GetReward200Response, Integer, Hash)>
Retrieve single reward Retrieve the reward, identified by the given `id` in the URL
1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 |
# File 'lib/tremendous/api/tremendous_api.rb', line 1289 def get_reward_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TremendousApi.get_reward ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.get_reward" end pattern = Regexp.new(/[A-Z0-9]{4,20}/) if @api_client.config.client_side_validation && id !~ pattern fail ArgumentError, "invalid value for 'id' when calling TremendousApi.get_reward, must conform to the pattern #{pattern}." end # resource path local_var_path = '/rewards/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GetReward200Response' # auth_names auth_names = opts[:debug_auth_names] || ['BearerApiKey'] = opts.merge( :operation => :"TremendousApi.get_reward", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TremendousApi#get_reward\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_webhook(id, opts = {}) ⇒ CreateWebhook200Response
Retrieve webhook > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > [Read it here](/docs/webhooks-1)
1347 1348 1349 1350 |
# File 'lib/tremendous/api/tremendous_api.rb', line 1347 def get_webhook(id, opts = {}) data, _status_code, _headers = get_webhook_with_http_info(id, opts) data end |
#get_webhook_with_http_info(id, opts = {}) ⇒ Array<(CreateWebhook200Response, Integer, Hash)>
Retrieve webhook > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > [Read it here](/docs/webhooks-1)
1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 |
# File 'lib/tremendous/api/tremendous_api.rb', line 1357 def get_webhook_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TremendousApi.get_webhook ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.get_webhook" end pattern = Regexp.new(/[A-Z0-9]{4,20}/) if @api_client.config.client_side_validation && id !~ pattern fail ArgumentError, "invalid value for 'id' when calling TremendousApi.get_webhook, must conform to the pattern #{pattern}." end # resource path local_var_path = '/webhooks/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'CreateWebhook200Response' # auth_names auth_names = opts[:debug_auth_names] || ['BearerApiKey'] = opts.merge( :operation => :"TremendousApi.get_webhook", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TremendousApi#get_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_balance_transactions(opts = {}) ⇒ ListBalanceTransactions200Response
List balance transactions Fetch a list of all balance transactions on your account.
1418 1419 1420 1421 |
# File 'lib/tremendous/api/tremendous_api.rb', line 1418 def list_balance_transactions(opts = {}) data, _status_code, _headers = list_balance_transactions_with_http_info(opts) data end |
#list_balance_transactions_with_http_info(opts = {}) ⇒ Array<(ListBalanceTransactions200Response, Integer, Hash)>
List balance transactions Fetch a list of all balance transactions on your account.
1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 |
# File 'lib/tremendous/api/tremendous_api.rb', line 1431 def list_balance_transactions_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TremendousApi.list_balance_transactions ...' end # resource path local_var_path = '/balance_transactions' # query parameters query_params = opts[:query_params] || {} query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'created_at[gte]'] = opts[:'created_at_gte'] if !opts[:'created_at_gte'].nil? query_params[:'created_at[lte]'] = opts[:'created_at_lte'] if !opts[:'created_at_lte'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListBalanceTransactions200Response' # auth_names auth_names = opts[:debug_auth_names] || ['BearerApiKey'] = opts.merge( :operation => :"TremendousApi.list_balance_transactions", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TremendousApi#list_balance_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_campaigns(opts = {}) ⇒ ListCampaigns200Response
List campaigns Retrieve a list of all campaigns created in your account
1483 1484 1485 1486 |
# File 'lib/tremendous/api/tremendous_api.rb', line 1483 def list_campaigns(opts = {}) data, _status_code, _headers = list_campaigns_with_http_info(opts) data end |
#list_campaigns_with_http_info(opts = {}) ⇒ Array<(ListCampaigns200Response, Integer, Hash)>
List campaigns Retrieve a list of all campaigns created in your account
1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 |
# File 'lib/tremendous/api/tremendous_api.rb', line 1492 def list_campaigns_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TremendousApi.list_campaigns ...' end # resource path local_var_path = '/campaigns' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListCampaigns200Response' # auth_names auth_names = opts[:debug_auth_names] || ['BearerApiKey'] = opts.merge( :operation => :"TremendousApi.list_campaigns", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TremendousApi#list_campaigns\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_fields(opts = {}) ⇒ ListFields200Response
List fields For reporting and analytics purposes, custom fields can be associated with rewards generated through the API. Custom fields must be first added by members of your admin team through the Tremendous Dashboard.
1540 1541 1542 1543 |
# File 'lib/tremendous/api/tremendous_api.rb', line 1540 def list_fields(opts = {}) data, _status_code, _headers = list_fields_with_http_info(opts) data end |
#list_fields_with_http_info(opts = {}) ⇒ Array<(ListFields200Response, Integer, Hash)>
List fields For reporting and analytics purposes, custom fields can be associated with rewards generated through the API. Custom fields must be first added by members of your admin team through the Tremendous Dashboard.
1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 |
# File 'lib/tremendous/api/tremendous_api.rb', line 1549 def list_fields_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TremendousApi.list_fields ...' end # resource path local_var_path = '/fields' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListFields200Response' # auth_names auth_names = opts[:debug_auth_names] || ['BearerApiKey'] = opts.merge( :operation => :"TremendousApi.list_fields", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TremendousApi#list_fields\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_funding_sources(opts = {}) ⇒ ListFundingSources200Response
List funding sources Retrieve a list of all funding sources available for ordering through the API in your organization’s account.
1597 1598 1599 1600 |
# File 'lib/tremendous/api/tremendous_api.rb', line 1597 def list_funding_sources(opts = {}) data, _status_code, _headers = list_funding_sources_with_http_info(opts) data end |
#list_funding_sources_with_http_info(opts = {}) ⇒ Array<(ListFundingSources200Response, Integer, Hash)>
List funding sources Retrieve a list of all funding sources available for ordering through the API in your organization's account.
1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 |
# File 'lib/tremendous/api/tremendous_api.rb', line 1606 def list_funding_sources_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TremendousApi.list_funding_sources ...' end # resource path local_var_path = '/funding_sources' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListFundingSources200Response' # auth_names auth_names = opts[:debug_auth_names] || ['BearerApiKey'] = opts.merge( :operation => :"TremendousApi.list_funding_sources", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TremendousApi#list_funding_sources\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_invoices(opts = {}) ⇒ ListInvoices200Response
List invoices Fetch a list of all invoices on your account. > 🚧 Deleted invoices are omitted > > The response does not include any previously deleted invoices.
1656 1657 1658 1659 |
# File 'lib/tremendous/api/tremendous_api.rb', line 1656 def list_invoices(opts = {}) data, _status_code, _headers = list_invoices_with_http_info(opts) data end |
#list_invoices_with_http_info(opts = {}) ⇒ Array<(ListInvoices200Response, Integer, Hash)>
List invoices Fetch a list of all invoices on your account. > 🚧 Deleted invoices are omitted > > The response does not include any previously deleted invoices.
1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 |
# File 'lib/tremendous/api/tremendous_api.rb', line 1667 def list_invoices_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TremendousApi.list_invoices ...' end # resource path local_var_path = '/invoices' # query parameters query_params = opts[:query_params] || {} query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListInvoices200Response' # auth_names auth_names = opts[:debug_auth_names] || ['BearerApiKey'] = opts.merge( :operation => :"TremendousApi.list_invoices", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TremendousApi#list_invoices\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_members(opts = {}) ⇒ ListMembers200Response
List members To list members of a sub-organization [create an API key for that organization](/reference/post_organizations-id-create-api-key) first, then use the new API key in the list members request.
1717 1718 1719 1720 |
# File 'lib/tremendous/api/tremendous_api.rb', line 1717 def list_members(opts = {}) data, _status_code, _headers = list_members_with_http_info(opts) data end |
#list_members_with_http_info(opts = {}) ⇒ Array<(ListMembers200Response, Integer, Hash)>
List members To list members of a sub-organization [create an API key for that organization](/reference/post_organizations-id-create-api-key) first, then use the new API key in the list members request.
1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 |
# File 'lib/tremendous/api/tremendous_api.rb', line 1726 def list_members_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TremendousApi.list_members ...' end # resource path local_var_path = '/members' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListMembers200Response' # auth_names auth_names = opts[:debug_auth_names] || ['BearerApiKey'] = opts.merge( :operation => :"TremendousApi.list_members", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TremendousApi#list_members\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_orders(opts = {}) ⇒ ListOrders200Response
List orders Retrieve a list of orders
1780 1781 1782 1783 |
# File 'lib/tremendous/api/tremendous_api.rb', line 1780 def list_orders(opts = {}) data, _status_code, _headers = list_orders_with_http_info(opts) data end |
#list_orders_with_http_info(opts = {}) ⇒ Array<(ListOrders200Response, Integer, Hash)>
List orders Retrieve a list of orders
1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 |
# File 'lib/tremendous/api/tremendous_api.rb', line 1795 def list_orders_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TremendousApi.list_orders ...' end # resource path local_var_path = '/orders' # query parameters query_params = opts[:query_params] || {} query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'campaign_id'] = opts[:'campaign_id'] if !opts[:'campaign_id'].nil? query_params[:'external_id'] = opts[:'external_id'] if !opts[:'external_id'].nil? query_params[:'created_at[gte]'] = opts[:'created_at_gte'] if !opts[:'created_at_gte'].nil? query_params[:'created_at[lte]'] = opts[:'created_at_lte'] if !opts[:'created_at_lte'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListOrders200Response' # auth_names auth_names = opts[:debug_auth_names] || ['BearerApiKey'] = opts.merge( :operation => :"TremendousApi.list_orders", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TremendousApi#list_orders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_organizations(opts = {}) ⇒ ListOrganizations200Response
List organizations The returned list only includes the organization to which the API key belongs to, that is used for the request.
1849 1850 1851 1852 |
# File 'lib/tremendous/api/tremendous_api.rb', line 1849 def list_organizations(opts = {}) data, _status_code, _headers = list_organizations_with_http_info(opts) data end |
#list_organizations_with_http_info(opts = {}) ⇒ Array<(ListOrganizations200Response, Integer, Hash)>
List organizations The returned list only includes the organization to which the API key belongs to, that is used for the request.
1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 |
# File 'lib/tremendous/api/tremendous_api.rb', line 1858 def list_organizations_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TremendousApi.list_organizations ...' end # resource path local_var_path = '/organizations' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListOrganizations200Response' # auth_names auth_names = opts[:debug_auth_names] || ['BearerApiKey'] = opts.merge( :operation => :"TremendousApi.list_organizations", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TremendousApi#list_organizations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_products(opts = {}) ⇒ ListProductsResponse
List products Retrieve a list of available products
1908 1909 1910 1911 |
# File 'lib/tremendous/api/tremendous_api.rb', line 1908 def list_products(opts = {}) data, _status_code, _headers = list_products_with_http_info(opts) data end |
#list_products_with_http_info(opts = {}) ⇒ Array<(ListProductsResponse, Integer, Hash)>
List products Retrieve a list of available products
1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 |
# File 'lib/tremendous/api/tremendous_api.rb', line 1919 def list_products_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TremendousApi.list_products ...' end # resource path local_var_path = '/products' # query parameters query_params = opts[:query_params] || {} query_params[:'country'] = opts[:'country'] if !opts[:'country'].nil? query_params[:'currency'] = opts[:'currency'] if !opts[:'currency'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListProductsResponse' # auth_names auth_names = opts[:debug_auth_names] || ['BearerApiKey'] = opts.merge( :operation => :"TremendousApi.list_products", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TremendousApi#list_products\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_rewards(opts = {}) ⇒ ListRewards200Response
List rewards Retrieve a list of all created rewards
1970 1971 1972 1973 |
# File 'lib/tremendous/api/tremendous_api.rb', line 1970 def list_rewards(opts = {}) data, _status_code, _headers = list_rewards_with_http_info(opts) data end |
#list_rewards_with_http_info(opts = {}) ⇒ Array<(ListRewards200Response, Integer, Hash)>
List rewards Retrieve a list of all created rewards
1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 |
# File 'lib/tremendous/api/tremendous_api.rb', line 1980 def list_rewards_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TremendousApi.list_rewards ...' end # resource path local_var_path = '/rewards' # query parameters query_params = opts[:query_params] || {} query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListRewards200Response' # auth_names auth_names = opts[:debug_auth_names] || ['BearerApiKey'] = opts.merge( :operation => :"TremendousApi.list_rewards", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TremendousApi#list_rewards\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_webhook_events(id, opts = {}) ⇒ ListWebhookEvents200Response
List events Lists all event types that can be sent to the configured webhook endpoint. > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > [Read it here](/docs/webhooks-1)
2030 2031 2032 2033 |
# File 'lib/tremendous/api/tremendous_api.rb', line 2030 def list_webhook_events(id, opts = {}) data, _status_code, _headers = list_webhook_events_with_http_info(id, opts) data end |
#list_webhook_events_with_http_info(id, opts = {}) ⇒ Array<(ListWebhookEvents200Response, Integer, Hash)>
List events Lists all event types that can be sent to the configured webhook endpoint. > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > [Read it here](/docs/webhooks-1)
2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 |
# File 'lib/tremendous/api/tremendous_api.rb', line 2040 def list_webhook_events_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TremendousApi.list_webhook_events ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.list_webhook_events" end pattern = Regexp.new(/[A-Z0-9]{4,20}/) if @api_client.config.client_side_validation && id !~ pattern fail ArgumentError, "invalid value for 'id' when calling TremendousApi.list_webhook_events, must conform to the pattern #{pattern}." end # resource path local_var_path = '/webhooks/{id}/events'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListWebhookEvents200Response' # auth_names auth_names = opts[:debug_auth_names] || ['BearerApiKey'] = opts.merge( :operation => :"TremendousApi.list_webhook_events", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TremendousApi#list_webhook_events\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_webhooks(opts = {}) ⇒ ListWebhooks200Response
List webhooks Every organization can only have one webhook. This endpoint shows the details about that webhook. > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > [Read it here](/docs/webhooks-1)
2097 2098 2099 2100 |
# File 'lib/tremendous/api/tremendous_api.rb', line 2097 def list_webhooks(opts = {}) data, _status_code, _headers = list_webhooks_with_http_info(opts) data end |
#list_webhooks_with_http_info(opts = {}) ⇒ Array<(ListWebhooks200Response, Integer, Hash)>
List webhooks Every organization can only have one webhook. This endpoint shows the details about that webhook. > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > [Read it here](/docs/webhooks-1)
2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 |
# File 'lib/tremendous/api/tremendous_api.rb', line 2106 def list_webhooks_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TremendousApi.list_webhooks ...' end # resource path local_var_path = '/webhooks' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListWebhooks200Response' # auth_names auth_names = opts[:debug_auth_names] || ['BearerApiKey'] = opts.merge( :operation => :"TremendousApi.list_webhooks", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TremendousApi#list_webhooks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#reject_order(id, opts = {}) ⇒ CreateOrder201Response
Reject order Rejects an order that is pending review, identified by the given ‘id` in the URL. Approvals is a feature that requires orders to be approved by an organization admin before they are sent out. To enable approvals for your organization, please enable ’Allow approvals via API’ via the organization”s ‘Order Approvals’ settings from the Tremendous dashboard.
2155 2156 2157 2158 |
# File 'lib/tremendous/api/tremendous_api.rb', line 2155 def reject_order(id, opts = {}) data, _status_code, _headers = reject_order_with_http_info(id, opts) data end |
#reject_order_with_http_info(id, opts = {}) ⇒ Array<(CreateOrder201Response, Integer, Hash)>
Reject order Rejects an order that is pending review, identified by the given `id` in the URL. Approvals is a feature that requires orders to be approved by an organization admin before they are sent out. To enable approvals for your organization, please enable 'Allow approvals via API' via the organization''s 'Order Approvals' settings from the Tremendous dashboard.
2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 |
# File 'lib/tremendous/api/tremendous_api.rb', line 2165 def reject_order_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TremendousApi.reject_order ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.reject_order" end pattern = Regexp.new(/[A-Z0-9]{4,20}/) if @api_client.config.client_side_validation && id !~ pattern fail ArgumentError, "invalid value for 'id' when calling TremendousApi.reject_order, must conform to the pattern #{pattern}." end # resource path local_var_path = '/order_approvals/{id}/reject'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'CreateOrder201Response' # auth_names auth_names = opts[:debug_auth_names] || ['BearerApiKey'] = opts.merge( :operation => :"TremendousApi.reject_order", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TremendousApi#reject_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#resend_reward(id, opts = {}) ⇒ Object
Resend reward Resends a reward, identified by the given ‘id` in the URL, to its recipient.
2223 2224 2225 2226 |
# File 'lib/tremendous/api/tremendous_api.rb', line 2223 def resend_reward(id, opts = {}) data, _status_code, _headers = resend_reward_with_http_info(id, opts) data end |
#resend_reward_with_http_info(id, opts = {}) ⇒ Array<(Object, Integer, Hash)>
Resend reward Resends a reward, identified by the given `id` in the URL, to its recipient.
2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 |
# File 'lib/tremendous/api/tremendous_api.rb', line 2233 def resend_reward_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TremendousApi.resend_reward ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.resend_reward" end pattern = Regexp.new(/[A-Z0-9]{4,20}/) if @api_client.config.client_side_validation && id !~ pattern fail ArgumentError, "invalid value for 'id' when calling TremendousApi.resend_reward, must conform to the pattern #{pattern}." end # resource path local_var_path = '/rewards/{id}/resend'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Object' # auth_names auth_names = opts[:debug_auth_names] || ['BearerApiKey'] = opts.merge( :operation => :"TremendousApi.resend_reward", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TremendousApi#resend_reward\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#simulate_webhook(id, simulate_webhook_request, opts = {}) ⇒ String
Test webhook Making a request to this endpoint will cause our system to trigger a webhook for the specified event. This can be very useful when testing the setup that processes webhooks on your end. > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > [Read it here](/docs/webhooks-1)
2292 2293 2294 2295 |
# File 'lib/tremendous/api/tremendous_api.rb', line 2292 def simulate_webhook(id, simulate_webhook_request, opts = {}) data, _status_code, _headers = simulate_webhook_with_http_info(id, simulate_webhook_request, opts) data end |
#simulate_webhook_with_http_info(id, simulate_webhook_request, opts = {}) ⇒ Array<(String, Integer, Hash)>
Test webhook Making a request to this endpoint will cause our system to trigger a webhook for the specified event. This can be very useful when testing the setup that processes webhooks on your end. > 📘 Learn more about Webhooks > > Our guide explains everything you need to know about the Tremendous webhooks: > [Read it here](/docs/webhooks-1)
2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 |
# File 'lib/tremendous/api/tremendous_api.rb', line 2303 def simulate_webhook_with_http_info(id, simulate_webhook_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TremendousApi.simulate_webhook ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.simulate_webhook" end pattern = Regexp.new(/[A-Z0-9]{4,20}/) if @api_client.config.client_side_validation && id !~ pattern fail ArgumentError, "invalid value for 'id' when calling TremendousApi.simulate_webhook, must conform to the pattern #{pattern}." end # verify the required parameter 'simulate_webhook_request' is set if @api_client.config.client_side_validation && simulate_webhook_request.nil? fail ArgumentError, "Missing the required parameter 'simulate_webhook_request' when calling TremendousApi.simulate_webhook" end # resource path local_var_path = '/webhooks/{id}/simulate'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['text/html', 'application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(simulate_webhook_request) # return_type return_type = opts[:debug_return_type] || 'String' # auth_names auth_names = opts[:debug_auth_names] || ['BearerApiKey'] = opts.merge( :operation => :"TremendousApi.simulate_webhook", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TremendousApi#simulate_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |