From b1535de5b30fd4785f252904736f8fbe350f22fd Mon Sep 17 00:00:00 2001 From: Lucas Mazza Date: Tue, 28 May 2024 11:03:44 -0300 Subject: [PATCH] Regenerate client for `5.1.0` * Add `create_campaign` and `update_campaign` methods * Add `webpage_style` and `email_style` to `Campaign` objects * Remove deprecated `DELETED` role for organization members - this is now exposed via the `active` property * Do not allow member's `name` to be set via the API * Add `label` to custom fields on rewards * Allow to copy the `fraud_prevention` settings when creating a new team Closes #21 --- .openapi-generator/FILES | 250 +--------- Gemfile.lock | 2 +- lib/tremendous.rb | 6 +- lib/tremendous/api/tremendous_api.rb | 153 +++++- lib/tremendous/models/campaign.rb | 39 +- ...onse.rb => create_campaign201_response.rb} | 6 +- ...response.rb => create_campaign_request.rb} | 64 ++- lib/tremendous/models/create_member.rb | 19 +- .../models/create_member_request.rb | 19 +- .../models/create_order_request_reward.rb | 2 +- ...der_request_reward_custom_fields_inner.rb} | 57 ++- ...eate_organization_request_copy_settings.rb | 20 +- lib/tremendous/models/custom_field.rb | 20 +- .../models/get_member200_response_member.rb | 18 +- lib/tremendous/models/invoice.rb | 4 +- ...t_campaigns200_response_campaigns_inner.rb | 39 +- ...0_response_campaigns_inner_email_style.rb} | 129 +++-- ...response_campaigns_inner_webpage_style.rb} | 129 +++-- ...ist_invoices200_response_invoices_inner.rb | 4 +- .../list_members200_response_members_inner.rb | 18 +- ...ist_products200_response_products_inner.rb | 457 ------------------ ...response_products_inner_countries_inner.rb | 222 --------- ...ponse_rewards_inner_custom_fields_inner.rb | 20 +- lib/tremendous/models/member.rb | 18 +- lib/tremendous/models/member_base.rb | 18 +- lib/tremendous/models/member_with_events.rb | 18 +- .../models/member_without_events.rb | 18 +- .../models/reward_base_custom_fields_inner.rb | 20 +- lib/tremendous/version.rb | 2 +- 29 files changed, 588 insertions(+), 1203 deletions(-) rename lib/tremendous/models/{get_campaign200_response.rb => create_campaign201_response.rb} (96%) rename lib/tremendous/models/{list_products200_response.rb => create_campaign_request.rb} (75%) rename lib/tremendous/models/{get_product200_response.rb => create_order_request_reward_custom_fields_inner.rb} (79%) rename lib/tremendous/models/{list_products200_response_products_inner_images_inner.rb => list_campaigns200_response_campaigns_inner_email_style.rb} (70%) rename lib/tremendous/models/{list_products200_response_products_inner_skus_inner.rb => list_campaigns200_response_campaigns_inner_webpage_style.rb} (70%) delete mode 100644 lib/tremendous/models/list_products200_response_products_inner.rb delete mode 100644 lib/tremendous/models/list_products200_response_products_inner_countries_inner.rb diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index ba1ca12..d3c6034 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -1,126 +1,3 @@ -.gitlab-ci.yml -.travis.yml -docs/BalanceTransaction.md -docs/Campaign.md -docs/CreateApiKey200Response.md -docs/CreateInvoice.md -docs/CreateInvoice200Response.md -docs/CreateInvoiceRequest.md -docs/CreateMember.md -docs/CreateMember200Response.md -docs/CreateMemberRequest.md -docs/CreateOrder200Response.md -docs/CreateOrder200ResponseOrder.md -docs/CreateOrder200ResponseOrderRewardsInner.md -docs/CreateOrder200ResponseOrderRewardsInnerDelivery.md -docs/CreateOrder201Response.md -docs/CreateOrderRequest.md -docs/CreateOrderRequestPayment.md -docs/CreateOrderRequestReward.md -docs/CreateOrderRequestRewardDelivery.md -docs/CreateOrganization.md -docs/CreateOrganization200Response.md -docs/CreateOrganization200ResponseOrganization.md -docs/CreateOrganizationRequest.md -docs/CreateOrganizationRequestCopySettings.md -docs/CreateWebhook200Response.md -docs/CreateWebhookRequest.md -docs/CurrencyCodes.md -docs/CustomField.md -docs/DeliveryDetails.md -docs/DeliveryDetailsWithLink.md -docs/DeliveryMethod.md -docs/DeliveryStatus.md -docs/ErrorModel.md -docs/Field.md -docs/FundingSource.md -docs/GenerateRewardLink200Response.md -docs/GenerateRewardLink200ResponseReward.md -docs/GenerateRewardLink403Response.md -docs/GenerateRewardToken200Response.md -docs/GenerateRewardToken200ResponseReward.md -docs/GetCampaign200Response.md -docs/GetFundingSource200Response.md -docs/GetMember200Response.md -docs/GetMember200ResponseMember.md -docs/GetMember200ResponseMemberEventsInner.md -docs/GetOrganization200Response.md -docs/GetProductResponse.md -docs/GetReward200Response.md -docs/Invoice.md -docs/ListBalanceTransactions200Response.md -docs/ListBalanceTransactions200ResponseInvoicesInner.md -docs/ListCampaigns200Response.md -docs/ListCampaigns200ResponseCampaignsInner.md -docs/ListFields200Response.md -docs/ListFields200ResponseFieldsInner.md -docs/ListFundingSources200Response.md -docs/ListFundingSources200ResponseFundingSourcesInner.md -docs/ListFundingSources200ResponseFundingSourcesInnerMeta.md -docs/ListInvoices200Response.md -docs/ListInvoices200ResponseInvoicesInner.md -docs/ListMembers200Response.md -docs/ListMembers200ResponseMembersInner.md -docs/ListOrders200Response.md -docs/ListOrders200ResponseOrdersInner.md -docs/ListOrders200ResponseOrdersInnerPayment.md -docs/ListOrders200ResponseOrdersInnerPaymentRefund.md -docs/ListOrganizations200Response.md -docs/ListOrganizations200ResponseOrganizationsInner.md -docs/ListProductsResponse.md -docs/ListProductsResponseProductsInner.md -docs/ListProductsResponseProductsInnerCountriesInner.md -docs/ListProductsResponseProductsInnerImagesInner.md -docs/ListProductsResponseProductsInnerSkusInner.md -docs/ListRewards200Response.md -docs/ListRewards200ResponseRewardsInner.md -docs/ListRewards200ResponseRewardsInnerCustomFieldsInner.md -docs/ListRewards200ResponseRewardsInnerDelivery.md -docs/ListRewards200ResponseRewardsInnerRecipient.md -docs/ListRewards200ResponseRewardsInnerValue.md -docs/ListRewards401Response.md -docs/ListRewards401ResponseErrors.md -docs/ListRewards429Response.md -docs/ListWebhookEvents200Response.md -docs/ListWebhooks200Response.md -docs/ListWebhooks200ResponseWebhooksInner.md -docs/Member.md -docs/MemberBase.md -docs/MemberWithEvents.md -docs/MemberWithoutEvents.md -docs/Order.md -docs/OrderBase.md -docs/OrderBasePayment.md -docs/OrderForCreate.md -docs/OrderForCreateReward.md -docs/OrderStatus.md -docs/OrderWithLink.md -docs/OrderWithLinkRewardsInner.md -docs/OrderWithoutLink.md -docs/OrderWithoutLinkReward.md -docs/Organization.md -docs/PaymentDetails.md -docs/PaymentDetailsRefund.md -docs/Product.md -docs/Recipient.md -docs/RefundDetails.md -docs/ResendReward422Response.md -docs/Reward.md -docs/RewardBase.md -docs/RewardBaseCustomFieldsInner.md -docs/RewardForOrderCreate.md -docs/RewardLink.md -docs/RewardToken.md -docs/RewardValue.md -docs/RewardWithLink.md -docs/RewardWithLinkDelivery.md -docs/RewardWithoutLink.md -docs/RewardWithoutLinkDelivery.md -docs/SimulateWebhookRequest.md -docs/TremendousApi.md -docs/Webhook.md -docs/WebhookPost.md -git_push.sh lib/tremendous.rb lib/tremendous/api/tremendous_api.rb lib/tremendous/api_client.rb @@ -129,6 +6,8 @@ lib/tremendous/configuration.rb lib/tremendous/models/balance_transaction.rb lib/tremendous/models/campaign.rb lib/tremendous/models/create_api_key200_response.rb +lib/tremendous/models/create_campaign201_response.rb +lib/tremendous/models/create_campaign_request.rb lib/tremendous/models/create_invoice.rb lib/tremendous/models/create_invoice200_response.rb lib/tremendous/models/create_invoice_request.rb @@ -143,6 +22,7 @@ lib/tremendous/models/create_order201_response.rb lib/tremendous/models/create_order_request.rb lib/tremendous/models/create_order_request_payment.rb lib/tremendous/models/create_order_request_reward.rb +lib/tremendous/models/create_order_request_reward_custom_fields_inner.rb lib/tremendous/models/create_order_request_reward_delivery.rb lib/tremendous/models/create_organization.rb lib/tremendous/models/create_organization200_response.rb @@ -165,7 +45,6 @@ lib/tremendous/models/generate_reward_link200_response_reward.rb lib/tremendous/models/generate_reward_link403_response.rb lib/tremendous/models/generate_reward_token200_response.rb lib/tremendous/models/generate_reward_token200_response_reward.rb -lib/tremendous/models/get_campaign200_response.rb lib/tremendous/models/get_funding_source200_response.rb lib/tremendous/models/get_member200_response.rb lib/tremendous/models/get_member200_response_member.rb @@ -178,6 +57,8 @@ lib/tremendous/models/list_balance_transactions200_response.rb lib/tremendous/models/list_balance_transactions200_response_invoices_inner.rb lib/tremendous/models/list_campaigns200_response.rb lib/tremendous/models/list_campaigns200_response_campaigns_inner.rb +lib/tremendous/models/list_campaigns200_response_campaigns_inner_email_style.rb +lib/tremendous/models/list_campaigns200_response_campaigns_inner_webpage_style.rb lib/tremendous/models/list_fields200_response.rb lib/tremendous/models/list_fields200_response_fields_inner.rb lib/tremendous/models/list_funding_sources200_response.rb @@ -245,124 +126,3 @@ lib/tremendous/models/reward_without_link_delivery.rb lib/tremendous/models/simulate_webhook_request.rb lib/tremendous/models/webhook.rb lib/tremendous/models/webhook_post.rb -spec/api/tremendous_api_spec.rb -spec/models/balance_transaction_spec.rb -spec/models/campaign_spec.rb -spec/models/create_api_key200_response_spec.rb -spec/models/create_invoice200_response_spec.rb -spec/models/create_invoice_request_spec.rb -spec/models/create_invoice_spec.rb -spec/models/create_member200_response_spec.rb -spec/models/create_member_request_spec.rb -spec/models/create_member_spec.rb -spec/models/create_order200_response_order_rewards_inner_delivery_spec.rb -spec/models/create_order200_response_order_rewards_inner_spec.rb -spec/models/create_order200_response_order_spec.rb -spec/models/create_order200_response_spec.rb -spec/models/create_order201_response_spec.rb -spec/models/create_order_request_payment_spec.rb -spec/models/create_order_request_reward_delivery_spec.rb -spec/models/create_order_request_reward_spec.rb -spec/models/create_order_request_spec.rb -spec/models/create_organization200_response_organization_spec.rb -spec/models/create_organization200_response_spec.rb -spec/models/create_organization_request_copy_settings_spec.rb -spec/models/create_organization_request_spec.rb -spec/models/create_organization_spec.rb -spec/models/create_webhook200_response_spec.rb -spec/models/create_webhook_request_spec.rb -spec/models/currency_codes_spec.rb -spec/models/custom_field_spec.rb -spec/models/delivery_details_spec.rb -spec/models/delivery_details_with_link_spec.rb -spec/models/delivery_method_spec.rb -spec/models/delivery_status_spec.rb -spec/models/error_model_spec.rb -spec/models/field_spec.rb -spec/models/funding_source_spec.rb -spec/models/generate_reward_link200_response_reward_spec.rb -spec/models/generate_reward_link200_response_spec.rb -spec/models/generate_reward_link403_response_spec.rb -spec/models/generate_reward_token200_response_reward_spec.rb -spec/models/generate_reward_token200_response_spec.rb -spec/models/get_campaign200_response_spec.rb -spec/models/get_funding_source200_response_spec.rb -spec/models/get_member200_response_member_events_inner_spec.rb -spec/models/get_member200_response_member_spec.rb -spec/models/get_member200_response_spec.rb -spec/models/get_organization200_response_spec.rb -spec/models/get_product_response_spec.rb -spec/models/get_reward200_response_spec.rb -spec/models/invoice_spec.rb -spec/models/list_balance_transactions200_response_invoices_inner_spec.rb -spec/models/list_balance_transactions200_response_spec.rb -spec/models/list_campaigns200_response_campaigns_inner_spec.rb -spec/models/list_campaigns200_response_spec.rb -spec/models/list_fields200_response_fields_inner_spec.rb -spec/models/list_fields200_response_spec.rb -spec/models/list_funding_sources200_response_funding_sources_inner_meta_spec.rb -spec/models/list_funding_sources200_response_funding_sources_inner_spec.rb -spec/models/list_funding_sources200_response_spec.rb -spec/models/list_invoices200_response_invoices_inner_spec.rb -spec/models/list_invoices200_response_spec.rb -spec/models/list_members200_response_members_inner_spec.rb -spec/models/list_members200_response_spec.rb -spec/models/list_orders200_response_orders_inner_payment_refund_spec.rb -spec/models/list_orders200_response_orders_inner_payment_spec.rb -spec/models/list_orders200_response_orders_inner_spec.rb -spec/models/list_orders200_response_spec.rb -spec/models/list_organizations200_response_organizations_inner_spec.rb -spec/models/list_organizations200_response_spec.rb -spec/models/list_products_response_products_inner_countries_inner_spec.rb -spec/models/list_products_response_products_inner_images_inner_spec.rb -spec/models/list_products_response_products_inner_skus_inner_spec.rb -spec/models/list_products_response_products_inner_spec.rb -spec/models/list_products_response_spec.rb -spec/models/list_rewards200_response_rewards_inner_custom_fields_inner_spec.rb -spec/models/list_rewards200_response_rewards_inner_delivery_spec.rb -spec/models/list_rewards200_response_rewards_inner_recipient_spec.rb -spec/models/list_rewards200_response_rewards_inner_spec.rb -spec/models/list_rewards200_response_rewards_inner_value_spec.rb -spec/models/list_rewards200_response_spec.rb -spec/models/list_rewards401_response_errors_spec.rb -spec/models/list_rewards401_response_spec.rb -spec/models/list_rewards429_response_spec.rb -spec/models/list_webhook_events200_response_spec.rb -spec/models/list_webhooks200_response_spec.rb -spec/models/list_webhooks200_response_webhooks_inner_spec.rb -spec/models/member_base_spec.rb -spec/models/member_spec.rb -spec/models/member_with_events_spec.rb -spec/models/member_without_events_spec.rb -spec/models/order_base_payment_spec.rb -spec/models/order_base_spec.rb -spec/models/order_for_create_reward_spec.rb -spec/models/order_for_create_spec.rb -spec/models/order_spec.rb -spec/models/order_status_spec.rb -spec/models/order_with_link_rewards_inner_spec.rb -spec/models/order_with_link_spec.rb -spec/models/order_without_link_reward_spec.rb -spec/models/order_without_link_spec.rb -spec/models/organization_spec.rb -spec/models/payment_details_refund_spec.rb -spec/models/payment_details_spec.rb -spec/models/product_spec.rb -spec/models/recipient_spec.rb -spec/models/refund_details_spec.rb -spec/models/resend_reward422_response_spec.rb -spec/models/reward_base_custom_fields_inner_spec.rb -spec/models/reward_base_spec.rb -spec/models/reward_for_order_create_spec.rb -spec/models/reward_link_spec.rb -spec/models/reward_spec.rb -spec/models/reward_token_spec.rb -spec/models/reward_value_spec.rb -spec/models/reward_with_link_delivery_spec.rb -spec/models/reward_with_link_spec.rb -spec/models/reward_without_link_delivery_spec.rb -spec/models/reward_without_link_spec.rb -spec/models/simulate_webhook_request_spec.rb -spec/models/webhook_post_spec.rb -spec/models/webhook_spec.rb -spec/spec_helper.rb diff --git a/Gemfile.lock b/Gemfile.lock index 1b54068..5d9972f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - tremendous_ruby (5.0.1) + tremendous_ruby (5.1.0) faraday (>= 1.0.1, < 3.0) faraday-multipart diff --git a/lib/tremendous.rb b/lib/tremendous.rb index 71f3152..05ac0e0 100644 --- a/lib/tremendous.rb +++ b/lib/tremendous.rb @@ -20,6 +20,8 @@ require 'tremendous/models/balance_transaction' require 'tremendous/models/campaign' require 'tremendous/models/create_api_key200_response' +require 'tremendous/models/create_campaign201_response' +require 'tremendous/models/create_campaign_request' require 'tremendous/models/create_invoice' require 'tremendous/models/create_invoice200_response' require 'tremendous/models/create_invoice_request' @@ -34,6 +36,7 @@ require 'tremendous/models/create_order_request' require 'tremendous/models/create_order_request_payment' require 'tremendous/models/create_order_request_reward' +require 'tremendous/models/create_order_request_reward_custom_fields_inner' require 'tremendous/models/create_order_request_reward_delivery' require 'tremendous/models/create_organization' require 'tremendous/models/create_organization200_response' @@ -56,7 +59,6 @@ require 'tremendous/models/generate_reward_link403_response' require 'tremendous/models/generate_reward_token200_response' require 'tremendous/models/generate_reward_token200_response_reward' -require 'tremendous/models/get_campaign200_response' require 'tremendous/models/get_funding_source200_response' require 'tremendous/models/get_member200_response' require 'tremendous/models/get_member200_response_member' @@ -69,6 +71,8 @@ require 'tremendous/models/list_balance_transactions200_response_invoices_inner' require 'tremendous/models/list_campaigns200_response' require 'tremendous/models/list_campaigns200_response_campaigns_inner' +require 'tremendous/models/list_campaigns200_response_campaigns_inner_email_style' +require 'tremendous/models/list_campaigns200_response_campaigns_inner_webpage_style' require 'tremendous/models/list_fields200_response' require 'tremendous/models/list_fields200_response_fields_inner' require 'tremendous/models/list_funding_sources200_response' diff --git a/lib/tremendous/api/tremendous_api.rb b/lib/tremendous/api/tremendous_api.rb index dfd9928..c7e1eb2 100644 --- a/lib/tremendous/api/tremendous_api.rb +++ b/lib/tremendous/api/tremendous_api.rb @@ -144,6 +144,72 @@ def create_api_key_with_http_info(opts = {}) return data, status_code, headers end + # Create campaign + # @param create_campaign_request [CreateCampaignRequest] Campaign details + # @param [Hash] opts the optional parameters + # @return [CreateCampaign201Response] + def create_campaign(create_campaign_request, opts = {}) + data, _status_code, _headers = create_campaign_with_http_info(create_campaign_request, opts) + data + end + + # Create campaign + # @param create_campaign_request [CreateCampaignRequest] Campaign details + # @param [Hash] opts the optional parameters + # @return [Array<(CreateCampaign201Response, Integer, Hash)>] CreateCampaign201Response data, response status code and response headers + def create_campaign_with_http_info(create_campaign_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: TremendousApi.create_campaign ...' + end + # verify the required parameter 'create_campaign_request' is set + if @api_client.config.client_side_validation && create_campaign_request.nil? + fail ArgumentError, "Missing the required parameter 'create_campaign_request' when calling TremendousApi.create_campaign" + end + # resource path + local_var_path = '/campaigns' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(create_campaign_request) + + # return_type + return_type = opts[:debug_return_type] || 'CreateCampaign201Response' + + # auth_names + auth_names = opts[:debug_auth_names] || ['BearerApiKey'] + + new_options = opts.merge( + :operation => :"TremendousApi.create_campaign", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: TremendousApi#create_campaign\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Create 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
Property Type Description
po_number
string

Reference to the purchase order number within your organization

amount
number double

Amount of the invoice in USD

memo
string

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

# @param create_invoice_request [CreateInvoiceRequest] Invoice details @@ -281,7 +347,7 @@ def create_member_with_http_info(create_member_request, opts = {}) end # 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: > > Check it out! ## Request body
Property Type Description
external_id
string

Reference for this order, supplied by the customer.

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

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

payment
object
Show object properties
Property Type Description
funding_source_id
string

Tremendous ID of the funding source that will be used to pay for the order. Use balance to use your Tremendous's balance.

reward
object

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

Either products or campaign_id must be specified.

Show object properties
Property Type Description
id
string

Tremendous ID of the reward

order_id
string

Tremendous ID of the order this reward is part of.

created_at
string date-time

Date the reward was created

campaign_id
string

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

products
array string

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

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

value
object
Show object properties
Property Type Description
denomination
number double

Amount of the reward

currency_code
string

Currency of the reward

recipient
object

Details of the recipient of the reward

Show object properties
Property Type Description
name
string

Name of the recipient

email
string

Email address of the recipient

phone
string

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

deliver_at
string date

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

custom_fields
array
Show array item type
Property Type Description
id
string

Tremendous ID of the custom field

value
string

Value of the custom field

language
string

Set this to translate the redemption experience for this reward. Pass a 2-letter ISO-639-1 code for the desired language. Defaults to en.

delivery
object

Details on how the reward is delivered to the recipient.

Show object properties
Property Type Description
method
string

How to deliver the reward to the recipient.

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

Deliver the reward to the recipient via a link.

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

PHONE Deliver the reward to the recipient by SMS
### 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](https://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](https://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. + # 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: > > Check it out! ## Request body
Property Type Description
external_id
string

Reference for this order, supplied by the customer.

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

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

payment
object
Show object properties
Property Type Description
funding_source_id
string

Tremendous ID of the funding source that will be used to pay for the order. Use balance to use your Tremendous's balance.

reward
object

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

Either products or campaign_id must be specified.

Show object properties
Property Type Description
id
string

Tremendous ID of the reward

order_id
string

Tremendous ID of the order this reward is part of.

created_at
string date-time

Date the reward was created

campaign_id
string

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

products
array string

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

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

value
object
Show object properties
Property Type Description
denomination
number double

Amount of the reward

currency_code
string

Currency of the reward

recipient
object

Details of the recipient of the reward

Show object properties
Property Type Description
name
string

Name of the recipient

email
string

Email address of the recipient

phone
string

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

deliver_at
string date

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

custom_fields
array
Show array item type
Property Type Description
id
string

Tremendous ID of the custom field

value
string

Value of the custom field

label
string

Label of the custom field

language
string

Set this to translate the redemption experience for this reward. Pass a 2-letter ISO-639-1 code for the desired language. Defaults to en.

delivery
object

Details on how the reward is delivered to the recipient.

Show object properties
Property Type Description
method
string

How to deliver the reward to the recipient.

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

Deliver the reward to the recipient via a link.

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

PHONE Deliver the reward to the recipient by SMS
### 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](https://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](https://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. # @param create_order_request [CreateOrderRequest] Order to create # @param [Hash] opts the optional parameters # @return [CreateOrder200Response] @@ -291,7 +357,7 @@ def create_order(create_order_request, opts = {}) end # 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=\"https://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](https://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](https://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. + # 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> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">label</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Label 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=\"https://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](https://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](https://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. # @param create_order_request [CreateOrderRequest] Order to create # @param [Hash] opts the optional parameters # @return [Array<(CreateOrder200Response, Integer, Hash)>] CreateOrder200Response data, response status code and response headers @@ -813,7 +879,7 @@ def generate_reward_token_with_http_info(id, opts = {}) # Retrieve a campaign, identified by the given `id` in the URL # @param id [String] ID of the campaign that should be retrieved # @param [Hash] opts the optional parameters - # @return [GetCampaign200Response] + # @return [CreateCampaign201Response] def get_campaign(id, opts = {}) data, _status_code, _headers = get_campaign_with_http_info(id, opts) data @@ -823,7 +889,7 @@ def get_campaign(id, opts = {}) # Retrieve a campaign, identified by the given `id` in the URL # @param id [String] ID of the campaign that should be retrieved # @param [Hash] opts the optional parameters - # @return [Array<(GetCampaign200Response, Integer, Hash)>] GetCampaign200Response data, response status code and response headers + # @return [Array<(CreateCampaign201Response, Integer, Hash)>] CreateCampaign201Response data, response status code and response headers def get_campaign_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TremendousApi.get_campaign ...' @@ -855,7 +921,7 @@ def get_campaign_with_http_info(id, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'GetCampaign200Response' + return_type = opts[:debug_return_type] || 'CreateCampaign201Response' # auth_names auth_names = opts[:debug_auth_names] || ['BearerApiKey'] @@ -2361,5 +2427,82 @@ def simulate_webhook_with_http_info(id, simulate_webhook_request, opts = {}) end return data, status_code, headers end + + # Update campaign + # @param id [String] ID of the campaign that should be updated + # @param create_campaign_request [CreateCampaignRequest] Campaign details + # @param [Hash] opts the optional parameters + # @return [CreateCampaign201Response] + def update_campaign(id, create_campaign_request, opts = {}) + data, _status_code, _headers = update_campaign_with_http_info(id, create_campaign_request, opts) + data + end + + # Update campaign + # @param id [String] ID of the campaign that should be updated + # @param create_campaign_request [CreateCampaignRequest] Campaign details + # @param [Hash] opts the optional parameters + # @return [Array<(CreateCampaign201Response, Integer, Hash)>] CreateCampaign201Response data, response status code and response headers + def update_campaign_with_http_info(id, create_campaign_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: TremendousApi.update_campaign ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling TremendousApi.update_campaign" + end + pattern = Regexp.new(/[A-Z0-9]{4,20}/) + if @api_client.config.client_side_validation && id !~ pattern + fail ArgumentError, "invalid value for 'id' when calling TremendousApi.update_campaign, must conform to the pattern #{pattern}." + end + + # verify the required parameter 'create_campaign_request' is set + if @api_client.config.client_side_validation && create_campaign_request.nil? + fail ArgumentError, "Missing the required parameter 'create_campaign_request' when calling TremendousApi.update_campaign" + end + # resource path + local_var_path = '/campaigns/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(create_campaign_request) + + # return_type + return_type = opts[:debug_return_type] || 'CreateCampaign201Response' + + # auth_names + auth_names = opts[:debug_auth_names] || ['BearerApiKey'] + + new_options = opts.merge( + :operation => :"TremendousApi.update_campaign", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: TremendousApi#update_campaign\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end end end diff --git a/lib/tremendous/models/campaign.rb b/lib/tremendous/models/campaign.rb index d9436b1..19126f0 100644 --- a/lib/tremendous/models/campaign.rb +++ b/lib/tremendous/models/campaign.rb @@ -14,7 +14,7 @@ require 'time' module Tremendous - # With a campaign you can define the look & feel of how rewards are sent out. It also lets you set the available products (different gift cards, charity, etc.) recipients can choose from. > Note: Campaigns must be created from the Tremendous dashboard. > > • [Production Dashboard](https://app.tremendous.com) > • [Sandbox Dashboard](https://app.testflight.tremendous.com/) + # With a campaign you can define the look & feel of how rewards are sent out. It also lets you set the available products (different gift cards, charity, etc.) recipients can choose from. class Campaign attr_accessor :id @@ -27,13 +27,19 @@ class Campaign # List of IDs of products (different gift cards, charity, etc.) that are available in this campaign. attr_accessor :products + attr_accessor :webpage_style + + attr_accessor :email_style + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'id' => :'id', :'name' => :'name', :'description' => :'description', - :'products' => :'products' + :'products' => :'products', + :'webpage_style' => :'webpage_style', + :'email_style' => :'email_style' } end @@ -48,7 +54,9 @@ def self.openapi_types :'id' => :'String', :'name' => :'String', :'description' => :'String', - :'products' => :'Array' + :'products' => :'Array', + :'webpage_style' => :'ListCampaigns200ResponseCampaignsInnerWebpageStyle', + :'email_style' => :'ListCampaigns200ResponseCampaignsInnerEmailStyle' } end @@ -76,8 +84,6 @@ def initialize(attributes = {}) if attributes.key?(:'id') self.id = attributes[:'id'] - else - self.id = nil end if attributes.key?(:'name') @@ -99,6 +105,14 @@ def initialize(attributes = {}) else self.products = nil end + + if attributes.key?(:'webpage_style') + self.webpage_style = attributes[:'webpage_style'] + end + + if attributes.key?(:'email_style') + self.email_style = attributes[:'email_style'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -106,12 +120,8 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - pattern = Regexp.new(/[A-Z0-9]{4,20}/) - if @id !~ pattern + if !@id.nil? && @id !~ pattern invalid_properties.push("invalid value for \"id\", must conform to the pattern #{pattern}.") end @@ -130,8 +140,7 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - return false if @id.nil? - return false if @id !~ Regexp.new(/[A-Z0-9]{4,20}/) + return false if !@id.nil? && @id !~ Regexp.new(/[A-Z0-9]{4,20}/) return false if @name.nil? return false if @products.nil? true @@ -160,7 +169,9 @@ def ==(o) id == o.id && name == o.name && description == o.description && - products == o.products + products == o.products && + webpage_style == o.webpage_style && + email_style == o.email_style end # @see the `==` method @@ -172,7 +183,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, name, description, products].hash + [id, name, description, products, webpage_style, email_style].hash end # Builds the object from hash diff --git a/lib/tremendous/models/get_campaign200_response.rb b/lib/tremendous/models/create_campaign201_response.rb similarity index 96% rename from lib/tremendous/models/get_campaign200_response.rb rename to lib/tremendous/models/create_campaign201_response.rb index d0739c7..eab9eef 100644 --- a/lib/tremendous/models/get_campaign200_response.rb +++ b/lib/tremendous/models/create_campaign201_response.rb @@ -14,7 +14,7 @@ require 'time' module Tremendous - class GetCampaign200Response + class CreateCampaign201Response attr_accessor :campaign # Attribute mapping from ruby-style variable name to JSON key. @@ -46,13 +46,13 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::GetCampaign200Response` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::CreateCampaign201Response` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::GetCampaign200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::CreateCampaign201Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } diff --git a/lib/tremendous/models/list_products200_response.rb b/lib/tremendous/models/create_campaign_request.rb similarity index 75% rename from lib/tremendous/models/list_products200_response.rb rename to lib/tremendous/models/create_campaign_request.rb index 54d5377..0224e9e 100644 --- a/lib/tremendous/models/list_products200_response.rb +++ b/lib/tremendous/models/create_campaign_request.rb @@ -14,13 +14,29 @@ require 'time' module Tremendous - class ListProducts200Response + # With a campaign you can define the look & feel of how rewards are sent out. It also lets you set the available products (different gift cards, charity, etc.) recipients can choose from. + class CreateCampaignRequest + # Name of the campaign + attr_accessor :name + + # Description of the campaign + attr_accessor :description + + # List of IDs of products (different gift cards, charity, etc.) that are available in this campaign. attr_accessor :products + attr_accessor :webpage_style + + attr_accessor :email_style + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'products' => :'products' + :'name' => :'name', + :'description' => :'description', + :'products' => :'products', + :'webpage_style' => :'webpage_style', + :'email_style' => :'email_style' } end @@ -32,13 +48,18 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'products' => :'Array' + :'name' => :'String', + :'description' => :'String', + :'products' => :'Array', + :'webpage_style' => :'ListCampaigns200ResponseCampaignsInnerWebpageStyle', + :'email_style' => :'ListCampaigns200ResponseCampaignsInnerEmailStyle' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'description', ]) end @@ -46,17 +67,29 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::ListProducts200Response` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::CreateCampaignRequest` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::ListProducts200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::CreateCampaignRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } + if attributes.key?(:'name') + self.name = attributes[:'name'] + else + self.name = nil + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + else + self.description = nil + end + if attributes.key?(:'products') if (value = attributes[:'products']).is_a?(Array) self.products = value @@ -64,6 +97,14 @@ def initialize(attributes = {}) else self.products = nil end + + if attributes.key?(:'webpage_style') + self.webpage_style = attributes[:'webpage_style'] + end + + if attributes.key?(:'email_style') + self.email_style = attributes[:'email_style'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -71,6 +112,10 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if @name.nil? + invalid_properties.push('invalid value for "name", name cannot be nil.') + end + if @products.nil? invalid_properties.push('invalid value for "products", products cannot be nil.') end @@ -82,6 +127,7 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @name.nil? return false if @products.nil? true end @@ -91,7 +137,11 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - products == o.products + name == o.name && + description == o.description && + products == o.products && + webpage_style == o.webpage_style && + email_style == o.email_style end # @see the `==` method @@ -103,7 +153,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [products].hash + [name, description, products, webpage_style, email_style].hash end # Builds the object from hash diff --git a/lib/tremendous/models/create_member.rb b/lib/tremendous/models/create_member.rb index 65ccc30..429bda7 100644 --- a/lib/tremendous/models/create_member.rb +++ b/lib/tremendous/models/create_member.rb @@ -18,9 +18,6 @@ class CreateMember # Email address of the member attr_accessor :email - # Full name of the member - attr_accessor :name - # Role of the member within the organization.
Role Description
MEMBER Limited permissions. Can view their own reward and order histories only.
ADMIN Update organization settings, invite other members to the organization, and view all member order and reward histories within their organization.
attr_accessor :role @@ -50,7 +47,6 @@ def valid?(value) def self.attribute_map { :'email' => :'email', - :'name' => :'name', :'role' => :'role' } end @@ -64,7 +60,6 @@ def self.acceptable_attributes def self.openapi_types { :'email' => :'String', - :'name' => :'String', :'role' => :'String' } end @@ -96,12 +91,6 @@ def initialize(attributes = {}) self.email = nil end - if attributes.key?(:'name') - self.name = attributes[:'name'] - else - self.name = nil - end - if attributes.key?(:'role') self.role = attributes[:'role'] else @@ -118,10 +107,6 @@ def list_invalid_properties invalid_properties.push('invalid value for "email", email cannot be nil.') end - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - if @role.nil? invalid_properties.push('invalid value for "role", role cannot be nil.') end @@ -134,7 +119,6 @@ def list_invalid_properties def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @email.nil? - return false if @name.nil? return false if @role.nil? role_validator = EnumAttributeValidator.new('String', ["MEMBER", "ADMIN"]) return false unless role_validator.valid?(@role) @@ -157,7 +141,6 @@ def ==(o) return true if self.equal?(o) self.class == o.class && email == o.email && - name == o.name && role == o.role end @@ -170,7 +153,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [email, name, role].hash + [email, role].hash end # Builds the object from hash diff --git a/lib/tremendous/models/create_member_request.rb b/lib/tremendous/models/create_member_request.rb index 1c03757..d40211a 100644 --- a/lib/tremendous/models/create_member_request.rb +++ b/lib/tremendous/models/create_member_request.rb @@ -18,9 +18,6 @@ class CreateMemberRequest # Email address of the member attr_accessor :email - # Full name of the member - attr_accessor :name - # Role of the member within the organization.
Role Description
MEMBER Limited permissions. Can view their own reward and order histories only.
ADMIN Update organization settings, invite other members to the organization, and view all member order and reward histories within their organization.
attr_accessor :role @@ -50,7 +47,6 @@ def valid?(value) def self.attribute_map { :'email' => :'email', - :'name' => :'name', :'role' => :'role' } end @@ -64,7 +60,6 @@ def self.acceptable_attributes def self.openapi_types { :'email' => :'String', - :'name' => :'String', :'role' => :'String' } end @@ -96,12 +91,6 @@ def initialize(attributes = {}) self.email = nil end - if attributes.key?(:'name') - self.name = attributes[:'name'] - else - self.name = nil - end - if attributes.key?(:'role') self.role = attributes[:'role'] else @@ -118,10 +107,6 @@ def list_invalid_properties invalid_properties.push('invalid value for "email", email cannot be nil.') end - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - if @role.nil? invalid_properties.push('invalid value for "role", role cannot be nil.') end @@ -134,7 +119,6 @@ def list_invalid_properties def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @email.nil? - return false if @name.nil? return false if @role.nil? role_validator = EnumAttributeValidator.new('String', ["MEMBER", "ADMIN"]) return false unless role_validator.valid?(@role) @@ -157,7 +141,6 @@ def ==(o) return true if self.equal?(o) self.class == o.class && email == o.email && - name == o.name && role == o.role end @@ -170,7 +153,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [email, name, role].hash + [email, role].hash end # Builds the object from hash diff --git a/lib/tremendous/models/create_order_request_reward.rb b/lib/tremendous/models/create_order_request_reward.rb index 0d1fe83..752c070 100644 --- a/lib/tremendous/models/create_order_request_reward.rb +++ b/lib/tremendous/models/create_order_request_reward.rb @@ -63,7 +63,7 @@ def self.openapi_types :'value' => :'ListRewards200ResponseRewardsInnerValue', :'recipient' => :'ListRewards200ResponseRewardsInnerRecipient', :'deliver_at' => :'Date', - :'custom_fields' => :'Array', + :'custom_fields' => :'Array', :'language' => :'String', :'delivery' => :'CreateOrderRequestRewardDelivery' } diff --git a/lib/tremendous/models/get_product200_response.rb b/lib/tremendous/models/create_order_request_reward_custom_fields_inner.rb similarity index 79% rename from lib/tremendous/models/get_product200_response.rb rename to lib/tremendous/models/create_order_request_reward_custom_fields_inner.rb index 41c1228..8972444 100644 --- a/lib/tremendous/models/get_product200_response.rb +++ b/lib/tremendous/models/create_order_request_reward_custom_fields_inner.rb @@ -14,13 +14,19 @@ require 'time' module Tremendous - class GetProduct200Response - attr_accessor :product + # Reward custom data for searching, tracking or copy (see [Adding custom fields to orders](https://developers.tremendous.com/reference/using-custom-fields-to-add-custom-data-to-rewards).) + class CreateOrderRequestRewardCustomFieldsInner + # Tremendous ID of the custom field + attr_accessor :id + + # Value of the custom field + attr_accessor :value # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'product' => :'product' + :'id' => :'id', + :'value' => :'value' } end @@ -32,13 +38,15 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'product' => :'ListProducts200ResponseProductsInner' + :'id' => :'String', + :'value' => :'String' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'value' ]) end @@ -46,21 +54,23 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::GetProduct200Response` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::CreateOrderRequestRewardCustomFieldsInner` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::GetProduct200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::CreateOrderRequestRewardCustomFieldsInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'product') - self.product = attributes[:'product'] - else - self.product = nil + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] end end @@ -69,8 +79,9 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new - if @product.nil? - invalid_properties.push('invalid value for "product", product cannot be nil.') + pattern = Regexp.new(/[A-Z0-9]{4,20}/) + if !@id.nil? && @id !~ pattern + invalid_properties.push("invalid value for \"id\", must conform to the pattern #{pattern}.") end invalid_properties @@ -80,16 +91,32 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - return false if @product.nil? + return false if !@id.nil? && @id !~ Regexp.new(/[A-Z0-9]{4,20}/) true end + # Custom attribute writer method with validation + # @param [Object] id Value to be assigned + def id=(id) + if id.nil? + fail ArgumentError, 'id cannot be nil' + end + + pattern = Regexp.new(/[A-Z0-9]{4,20}/) + if id !~ pattern + fail ArgumentError, "invalid value for \"id\", must conform to the pattern #{pattern}." + end + + @id = id + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && - product == o.product + id == o.id && + value == o.value end # @see the `==` method @@ -101,7 +128,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [product].hash + [id, value].hash end # Builds the object from hash diff --git a/lib/tremendous/models/create_organization_request_copy_settings.rb b/lib/tremendous/models/create_organization_request_copy_settings.rb index 2a012cc..7a3c374 100644 --- a/lib/tremendous/models/create_organization_request_copy_settings.rb +++ b/lib/tremendous/models/create_organization_request_copy_settings.rb @@ -34,6 +34,9 @@ class CreateOrganizationRequestCopySettings # Copy over the users from the current organization to the new organization. Defaults to `false`. attr_accessor :users + # Copy over the fraud prevention settings and rules from the current organization to the new organization. Defaults to `false`. + attr_accessor :fraud_prevention + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -42,7 +45,8 @@ def self.attribute_map :'order_approvals' => :'order_approvals', :'payment_methods' => :'payment_methods', :'security_settings' => :'security_settings', - :'users' => :'users' + :'users' => :'users', + :'fraud_prevention' => :'fraud_prevention' } end @@ -59,7 +63,8 @@ def self.openapi_types :'order_approvals' => :'Boolean', :'payment_methods' => :'Boolean', :'security_settings' => :'Boolean', - :'users' => :'Boolean' + :'users' => :'Boolean', + :'fraud_prevention' => :'Boolean' } end @@ -119,6 +124,12 @@ def initialize(attributes = {}) else self.users = false end + + if attributes.key?(:'fraud_prevention') + self.fraud_prevention = attributes[:'fraud_prevention'] + else + self.fraud_prevention = false + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -146,7 +157,8 @@ def ==(o) order_approvals == o.order_approvals && payment_methods == o.payment_methods && security_settings == o.security_settings && - users == o.users + users == o.users && + fraud_prevention == o.fraud_prevention end # @see the `==` method @@ -158,7 +170,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [campaigns, custom_fields, order_approvals, payment_methods, security_settings, users].hash + [campaigns, custom_fields, order_approvals, payment_methods, security_settings, users, fraud_prevention].hash end # Builds the object from hash diff --git a/lib/tremendous/models/custom_field.rb b/lib/tremendous/models/custom_field.rb index 11e5507..e268a82 100644 --- a/lib/tremendous/models/custom_field.rb +++ b/lib/tremendous/models/custom_field.rb @@ -22,11 +22,15 @@ class CustomField # Value of the custom field attr_accessor :value + # Label of the custom field + attr_accessor :label + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'id' => :'id', - :'value' => :'value' + :'value' => :'value', + :'label' => :'label' } end @@ -39,14 +43,15 @@ def self.acceptable_attributes def self.openapi_types { :'id' => :'String', - :'value' => :'String' + :'value' => :'String', + :'label' => :'String' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ - :'value' + :'value', ]) end @@ -72,6 +77,10 @@ def initialize(attributes = {}) if attributes.key?(:'value') self.value = attributes[:'value'] end + + if attributes.key?(:'label') + self.label = attributes[:'label'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -116,7 +125,8 @@ def ==(o) return true if self.equal?(o) self.class == o.class && id == o.id && - value == o.value + value == o.value && + label == o.label end # @see the `==` method @@ -128,7 +138,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, value].hash + [id, value, label].hash end # Builds the object from hash diff --git a/lib/tremendous/models/get_member200_response_member.rb b/lib/tremendous/models/get_member200_response_member.rb index c5046d0..141d9e4 100644 --- a/lib/tremendous/models/get_member200_response_member.rb +++ b/lib/tremendous/models/get_member200_response_member.rb @@ -24,7 +24,10 @@ class GetMember200ResponseMember # Full name of the member attr_accessor :name - # Role of the member within the organization.
Role Description
MEMBER Limited permissions. Can view their own reward and order histories only.
ADMIN Update organization settings, invite other members to the organization, and view all member order and reward histories within their organization.
DELETED No longer a member of this organization.
+ # Is this member currently active in the organization. If `false`, the member will not be able to access the organization. + attr_accessor :active + + # Role of the member within the organization.
Role Description
MEMBER Limited permissions. Can view their own reward and order histories only.
ADMIN Update organization settings, invite other members to the organization, and view all member order and reward histories within their organization.
attr_accessor :role # Current status of the member's account. When creating a member it starts out in the status `INVITED`. As soon as that member open the invitation link and registers an account, the status switches to `REGISTERED`. @@ -61,6 +64,7 @@ def self.attribute_map :'id' => :'id', :'email' => :'email', :'name' => :'name', + :'active' => :'active', :'role' => :'role', :'status' => :'status', :'events' => :'events' @@ -78,6 +82,7 @@ def self.openapi_types :'id' => :'String', :'email' => :'String', :'name' => :'String', + :'active' => :'Boolean', :'role' => :'String', :'status' => :'String', :'events' => :'Array' @@ -124,6 +129,10 @@ def initialize(attributes = {}) self.name = nil end + if attributes.key?(:'active') + self.active = attributes[:'active'] + end + if attributes.key?(:'role') self.role = attributes[:'role'] else @@ -180,7 +189,7 @@ def valid? return false if @id !~ Regexp.new(/[A-Z0-9]{4,20}/) return false if @email.nil? return false if @role.nil? - role_validator = EnumAttributeValidator.new('String', ["MEMBER", "ADMIN", "DELETED"]) + role_validator = EnumAttributeValidator.new('String', ["MEMBER", "ADMIN"]) return false unless role_validator.valid?(@role) return false if @status.nil? status_validator = EnumAttributeValidator.new('String', ["REGISTERED", "INVITED"]) @@ -206,7 +215,7 @@ def id=(id) # Custom attribute writer method checking allowed values (enum). # @param [Object] role Object to be assigned def role=(role) - validator = EnumAttributeValidator.new('String', ["MEMBER", "ADMIN", "DELETED"]) + validator = EnumAttributeValidator.new('String', ["MEMBER", "ADMIN"]) unless validator.valid?(role) fail ArgumentError, "invalid value for \"role\", must be one of #{validator.allowable_values}." end @@ -231,6 +240,7 @@ def ==(o) id == o.id && email == o.email && name == o.name && + active == o.active && role == o.role && status == o.status && events == o.events @@ -245,7 +255,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, email, name, role, status, events].hash + [id, email, name, active, role, status, events].hash end # Builds the object from hash diff --git a/lib/tremendous/models/invoice.rb b/lib/tremendous/models/invoice.rb index e4b07ff..5967729 100644 --- a/lib/tremendous/models/invoice.rb +++ b/lib/tremendous/models/invoice.rb @@ -90,8 +90,8 @@ def self.openapi_types :'status' => :'String', :'orders' => :'Array', :'rewards' => :'Array', - :'created_at' => :'Date', - :'paid_at' => :'Date' + :'created_at' => :'Time', + :'paid_at' => :'Time' } end diff --git a/lib/tremendous/models/list_campaigns200_response_campaigns_inner.rb b/lib/tremendous/models/list_campaigns200_response_campaigns_inner.rb index e650100..19e2cc3 100644 --- a/lib/tremendous/models/list_campaigns200_response_campaigns_inner.rb +++ b/lib/tremendous/models/list_campaigns200_response_campaigns_inner.rb @@ -14,7 +14,7 @@ require 'time' module Tremendous - # With a campaign you can define the look & feel of how rewards are sent out. It also lets you set the available products (different gift cards, charity, etc.) recipients can choose from. > Note: Campaigns must be created from the Tremendous dashboard. > > • [Production Dashboard](https://app.tremendous.com) > • [Sandbox Dashboard](https://app.testflight.tremendous.com/) + # With a campaign you can define the look & feel of how rewards are sent out. It also lets you set the available products (different gift cards, charity, etc.) recipients can choose from. class ListCampaigns200ResponseCampaignsInner attr_accessor :id @@ -27,13 +27,19 @@ class ListCampaigns200ResponseCampaignsInner # List of IDs of products (different gift cards, charity, etc.) that are available in this campaign. attr_accessor :products + attr_accessor :webpage_style + + attr_accessor :email_style + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'id' => :'id', :'name' => :'name', :'description' => :'description', - :'products' => :'products' + :'products' => :'products', + :'webpage_style' => :'webpage_style', + :'email_style' => :'email_style' } end @@ -48,7 +54,9 @@ def self.openapi_types :'id' => :'String', :'name' => :'String', :'description' => :'String', - :'products' => :'Array' + :'products' => :'Array', + :'webpage_style' => :'ListCampaigns200ResponseCampaignsInnerWebpageStyle', + :'email_style' => :'ListCampaigns200ResponseCampaignsInnerEmailStyle' } end @@ -76,8 +84,6 @@ def initialize(attributes = {}) if attributes.key?(:'id') self.id = attributes[:'id'] - else - self.id = nil end if attributes.key?(:'name') @@ -99,6 +105,14 @@ def initialize(attributes = {}) else self.products = nil end + + if attributes.key?(:'webpage_style') + self.webpage_style = attributes[:'webpage_style'] + end + + if attributes.key?(:'email_style') + self.email_style = attributes[:'email_style'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -106,12 +120,8 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - pattern = Regexp.new(/[A-Z0-9]{4,20}/) - if @id !~ pattern + if !@id.nil? && @id !~ pattern invalid_properties.push("invalid value for \"id\", must conform to the pattern #{pattern}.") end @@ -130,8 +140,7 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - return false if @id.nil? - return false if @id !~ Regexp.new(/[A-Z0-9]{4,20}/) + return false if !@id.nil? && @id !~ Regexp.new(/[A-Z0-9]{4,20}/) return false if @name.nil? return false if @products.nil? true @@ -160,7 +169,9 @@ def ==(o) id == o.id && name == o.name && description == o.description && - products == o.products + products == o.products && + webpage_style == o.webpage_style && + email_style == o.email_style end # @see the `==` method @@ -172,7 +183,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, name, description, products].hash + [id, name, description, products, webpage_style, email_style].hash end # Builds the object from hash diff --git a/lib/tremendous/models/list_products200_response_products_inner_images_inner.rb b/lib/tremendous/models/list_campaigns200_response_campaigns_inner_email_style.rb similarity index 70% rename from lib/tremendous/models/list_products200_response_products_inner_images_inner.rb rename to lib/tremendous/models/list_campaigns200_response_campaigns_inner_email_style.rb index ba97d91..203d666 100644 --- a/lib/tremendous/models/list_products200_response_products_inner_images_inner.rb +++ b/lib/tremendous/models/list_campaigns200_response_campaigns_inner_email_style.rb @@ -14,40 +14,35 @@ require 'time' module Tremendous - class ListProducts200ResponseProductsInnerImagesInner - # URL to this image - attr_accessor :src - - # Type of image - attr_accessor :type - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end + # Definition of the email style + class ListCampaigns200ResponseCampaignsInnerEmailStyle + # If sending via email, this is how the email will appear to be sent from + attr_accessor :sender_name - def valid?(value) - !value || allowable_values.include?(value) - end - end + # Email subject line + attr_accessor :subject_line + + # URL of a publicly-accessible image (png, jpeg, jpg, gif, or svg). This image will be copied to our storage location. + attr_accessor :logo_image_url + + # Image height in pixels + attr_accessor :logo_image_height_px + + # Logo backgrond color code (hex, rgb, or rgba) + attr_accessor :logo_background_color + + # Button color code (hex, rgb, or rgba) + attr_accessor :button_color # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'src' => :'src', - :'type' => :'type' + :'sender_name' => :'sender_name', + :'subject_line' => :'subject_line', + :'logo_image_url' => :'logo_image_url', + :'logo_image_height_px' => :'logo_image_height_px', + :'logo_background_color' => :'logo_background_color', + :'button_color' => :'button_color' } end @@ -59,14 +54,22 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'src' => :'String', - :'type' => :'String' + :'sender_name' => :'String', + :'subject_line' => :'String', + :'logo_image_url' => :'String', + :'logo_image_height_px' => :'Integer', + :'logo_background_color' => :'String', + :'button_color' => :'String' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'logo_image_url', + :'logo_image_height_px', + :'logo_background_color', + :'button_color' ]) end @@ -74,27 +77,39 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::ListProducts200ResponseProductsInnerImagesInner` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::ListCampaigns200ResponseCampaignsInnerEmailStyle` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::ListProducts200ResponseProductsInnerImagesInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::ListCampaigns200ResponseCampaignsInnerEmailStyle`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'src') - self.src = attributes[:'src'] - else - self.src = nil + if attributes.key?(:'sender_name') + self.sender_name = attributes[:'sender_name'] end - if attributes.key?(:'type') - self.type = attributes[:'type'] - else - self.type = nil + if attributes.key?(:'subject_line') + self.subject_line = attributes[:'subject_line'] + end + + if attributes.key?(:'logo_image_url') + self.logo_image_url = attributes[:'logo_image_url'] + end + + if attributes.key?(:'logo_image_height_px') + self.logo_image_height_px = attributes[:'logo_image_height_px'] + end + + if attributes.key?(:'logo_background_color') + self.logo_background_color = attributes[:'logo_background_color'] + end + + if attributes.key?(:'button_color') + self.button_color = attributes[:'button_color'] end end @@ -103,14 +118,6 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new - if @src.nil? - invalid_properties.push('invalid value for "src", src cannot be nil.') - end - - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - invalid_properties end @@ -118,30 +125,20 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - return false if @src.nil? - return false if @type.nil? - type_validator = EnumAttributeValidator.new('String', ["card", "logo"]) - return false unless type_validator.valid?(@type) true end - # Custom attribute writer method checking allowed values (enum). - # @param [Object] type Object to be assigned - def type=(type) - validator = EnumAttributeValidator.new('String', ["card", "logo"]) - unless validator.valid?(type) - fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." - end - @type = type - end - # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && - src == o.src && - type == o.type + sender_name == o.sender_name && + subject_line == o.subject_line && + logo_image_url == o.logo_image_url && + logo_image_height_px == o.logo_image_height_px && + logo_background_color == o.logo_background_color && + button_color == o.button_color end # @see the `==` method @@ -153,7 +150,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [src, type].hash + [sender_name, subject_line, logo_image_url, logo_image_height_px, logo_background_color, button_color].hash end # Builds the object from hash diff --git a/lib/tremendous/models/list_products200_response_products_inner_skus_inner.rb b/lib/tremendous/models/list_campaigns200_response_campaigns_inner_webpage_style.rb similarity index 70% rename from lib/tremendous/models/list_products200_response_products_inner_skus_inner.rb rename to lib/tremendous/models/list_campaigns200_response_campaigns_inner_webpage_style.rb index d44f70d..4de3adf 100644 --- a/lib/tremendous/models/list_products200_response_products_inner_skus_inner.rb +++ b/lib/tremendous/models/list_campaigns200_response_campaigns_inner_webpage_style.rb @@ -14,18 +14,35 @@ require 'time' module Tremendous - class ListProducts200ResponseProductsInnerSkusInner - # Minimal denomination that this product supports (in the product's currency) - attr_accessor :min + # Definition of the webpage style + class ListCampaigns200ResponseCampaignsInnerWebpageStyle + # Headline for the reward page + attr_accessor :headline - # Maximum denomination that this product supports (in the product's currency) - attr_accessor :max + # Message for the reward page + attr_accessor :message + + # URL of a publicly-accessible image (png, jpeg, jpg, gif, or svg). This image will be copied to our storage location. + attr_accessor :logo_image_url + + # Image height in pixels + attr_accessor :logo_image_height_px + + # Logo backgrond color code (hex, rgb, or rgba) + attr_accessor :logo_background_color + + # Backgrond color code (hex, rgb, or rgba) + attr_accessor :background_color # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'min' => :'min', - :'max' => :'max' + :'headline' => :'headline', + :'message' => :'message', + :'logo_image_url' => :'logo_image_url', + :'logo_image_height_px' => :'logo_image_height_px', + :'logo_background_color' => :'logo_background_color', + :'background_color' => :'background_color' } end @@ -37,14 +54,22 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'min' => :'Float', - :'max' => :'Float' + :'headline' => :'String', + :'message' => :'String', + :'logo_image_url' => :'String', + :'logo_image_height_px' => :'Integer', + :'logo_background_color' => :'String', + :'background_color' => :'String' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'logo_image_url', + :'logo_image_height_px', + :'logo_background_color', + :'background_color' ]) end @@ -52,51 +77,47 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::ListProducts200ResponseProductsInnerSkusInner` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::ListCampaigns200ResponseCampaignsInnerWebpageStyle` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::ListProducts200ResponseProductsInnerSkusInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::ListCampaigns200ResponseCampaignsInnerWebpageStyle`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'min') - self.min = attributes[:'min'] - else - self.min = nil + if attributes.key?(:'headline') + self.headline = attributes[:'headline'] end - if attributes.key?(:'max') - self.max = attributes[:'max'] - else - self.max = nil + if attributes.key?(:'message') + self.message = attributes[:'message'] end - end - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - if @min.nil? - invalid_properties.push('invalid value for "min", min cannot be nil.') + if attributes.key?(:'logo_image_url') + self.logo_image_url = attributes[:'logo_image_url'] end - if @min < 0 - invalid_properties.push('invalid value for "min", must be greater than or equal to 0.') + if attributes.key?(:'logo_image_height_px') + self.logo_image_height_px = attributes[:'logo_image_height_px'] end - if @max.nil? - invalid_properties.push('invalid value for "max", max cannot be nil.') + if attributes.key?(:'logo_background_color') + self.logo_background_color = attributes[:'logo_background_color'] end - if @max < 0 - invalid_properties.push('invalid value for "max", must be greater than or equal to 0.') + if attributes.key?(:'background_color') + self.background_color = attributes[:'background_color'] end + end + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new invalid_properties end @@ -104,48 +125,20 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - return false if @min.nil? - return false if @min < 0 - return false if @max.nil? - return false if @max < 0 true end - # Custom attribute writer method with validation - # @param [Object] min Value to be assigned - def min=(min) - if min.nil? - fail ArgumentError, 'min cannot be nil' - end - - if min < 0 - fail ArgumentError, 'invalid value for "min", must be greater than or equal to 0.' - end - - @min = min - end - - # Custom attribute writer method with validation - # @param [Object] max Value to be assigned - def max=(max) - if max.nil? - fail ArgumentError, 'max cannot be nil' - end - - if max < 0 - fail ArgumentError, 'invalid value for "max", must be greater than or equal to 0.' - end - - @max = max - end - # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && - min == o.min && - max == o.max + headline == o.headline && + message == o.message && + logo_image_url == o.logo_image_url && + logo_image_height_px == o.logo_image_height_px && + logo_background_color == o.logo_background_color && + background_color == o.background_color end # @see the `==` method @@ -157,7 +150,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [min, max].hash + [headline, message, logo_image_url, logo_image_height_px, logo_background_color, background_color].hash end # Builds the object from hash diff --git a/lib/tremendous/models/list_invoices200_response_invoices_inner.rb b/lib/tremendous/models/list_invoices200_response_invoices_inner.rb index 5dd855d..505cd53 100644 --- a/lib/tremendous/models/list_invoices200_response_invoices_inner.rb +++ b/lib/tremendous/models/list_invoices200_response_invoices_inner.rb @@ -90,8 +90,8 @@ def self.openapi_types :'status' => :'String', :'orders' => :'Array', :'rewards' => :'Array', - :'created_at' => :'Date', - :'paid_at' => :'Date' + :'created_at' => :'Time', + :'paid_at' => :'Time' } end diff --git a/lib/tremendous/models/list_members200_response_members_inner.rb b/lib/tremendous/models/list_members200_response_members_inner.rb index 82a1231..e9621fa 100644 --- a/lib/tremendous/models/list_members200_response_members_inner.rb +++ b/lib/tremendous/models/list_members200_response_members_inner.rb @@ -24,7 +24,10 @@ class ListMembers200ResponseMembersInner # Full name of the member attr_accessor :name - # Role of the member within the organization.
Role Description
MEMBER Limited permissions. Can view their own reward and order histories only.
ADMIN Update organization settings, invite other members to the organization, and view all member order and reward histories within their organization.
DELETED No longer a member of this organization.
+ # Is this member currently active in the organization. If `false`, the member will not be able to access the organization. + attr_accessor :active + + # Role of the member within the organization.
Role Description
MEMBER Limited permissions. Can view their own reward and order histories only.
ADMIN Update organization settings, invite other members to the organization, and view all member order and reward histories within their organization.
attr_accessor :role # Current status of the member's account. When creating a member it starts out in the status `INVITED`. As soon as that member open the invitation link and registers an account, the status switches to `REGISTERED`. @@ -64,6 +67,7 @@ def self.attribute_map :'id' => :'id', :'email' => :'email', :'name' => :'name', + :'active' => :'active', :'role' => :'role', :'status' => :'status', :'created_at' => :'created_at', @@ -82,6 +86,7 @@ def self.openapi_types :'id' => :'String', :'email' => :'String', :'name' => :'String', + :'active' => :'Boolean', :'role' => :'String', :'status' => :'String', :'created_at' => :'Time', @@ -130,6 +135,10 @@ def initialize(attributes = {}) self.name = nil end + if attributes.key?(:'active') + self.active = attributes[:'active'] + end + if attributes.key?(:'role') self.role = attributes[:'role'] else @@ -188,7 +197,7 @@ def valid? return false if @id !~ Regexp.new(/[A-Z0-9]{4,20}/) return false if @email.nil? return false if @role.nil? - role_validator = EnumAttributeValidator.new('String', ["MEMBER", "ADMIN", "DELETED"]) + role_validator = EnumAttributeValidator.new('String', ["MEMBER", "ADMIN"]) return false unless role_validator.valid?(@role) return false if @status.nil? status_validator = EnumAttributeValidator.new('String', ["REGISTERED", "INVITED"]) @@ -214,7 +223,7 @@ def id=(id) # Custom attribute writer method checking allowed values (enum). # @param [Object] role Object to be assigned def role=(role) - validator = EnumAttributeValidator.new('String', ["MEMBER", "ADMIN", "DELETED"]) + validator = EnumAttributeValidator.new('String', ["MEMBER", "ADMIN"]) unless validator.valid?(role) fail ArgumentError, "invalid value for \"role\", must be one of #{validator.allowable_values}." end @@ -239,6 +248,7 @@ def ==(o) id == o.id && email == o.email && name == o.name && + active == o.active && role == o.role && status == o.status && created_at == o.created_at && @@ -254,7 +264,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, email, name, role, status, created_at, last_login_at].hash + [id, email, name, active, role, status, created_at, last_login_at].hash end # Builds the object from hash diff --git a/lib/tremendous/models/list_products200_response_products_inner.rb b/lib/tremendous/models/list_products200_response_products_inner.rb deleted file mode 100644 index 506d6dc..0000000 --- a/lib/tremendous/models/list_products200_response_products_inner.rb +++ /dev/null @@ -1,457 +0,0 @@ -=begin -#API Endpoints - -#Deliver monetary rewards and incentives to employees, customers, survey participants, and more through the Tremendous API. For organizational tasks, like managing your organization and it's members within Tremendous, please see the Tremendous Organizational API. - -The version of the OpenAPI document: 2 -Contact: developers@tremendous.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'date' -require 'time' - -module Tremendous - # A product represents one way to payout a reward to it's recipient. Think: * Amazon.com gift card (ID: `OKMHM2X2OHYV`) * Donations to Save the Children (ID: `ESRNAD533W5A`) * Virtual Visa debit card (ID: `Q24BD9EZ332JT`) each of which is one specific product on Tremendous. > 📘 All available products > > See this [list](https://www.tremendous.com/catalog) Products can be limited in their availability to recipients by * geography (field `countries`) * currency (field `currencies`) * amount of the reward (field `skus`) * e.g. adidas gift cards accept any amount between 5 and 200 USD. See the description of each respective parameter for further details. - class ListProducts200ResponseProductsInner - attr_accessor :id - - # Name of the product - attr_accessor :name - - # Detailed description of the product. Mostly used for products with a `category` of `charities`. - attr_accessor :description - - # The category of this product
Category Description
ach Bank transfer to the recipient
charity Donations to a charity
merchant_card A gift card for a certain merchant (e.g. Amazon)
paypal Payout via PayPal
venmo Payout via Venmo
visa_card Payout in form of a Visa debit card
- attr_accessor :category - - # Legal disclosures for this product. Can be in HTML format. - attr_accessor :disclosure - - # Products may are restricted in their usage based on the amount of the reward. The `skus` array defines bands of denominations in which this product may be used for payouts. - attr_accessor :skus - - # Available currencies for this product - attr_accessor :currency_codes - - # List of countries in which this product is available to recipients. - attr_accessor :countries - - # List of product images associated with this product (e.g. logos or images of the gift cards) - attr_accessor :images - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'name' => :'name', - :'description' => :'description', - :'category' => :'category', - :'disclosure' => :'disclosure', - :'skus' => :'skus', - :'currency_codes' => :'currency_codes', - :'countries' => :'countries', - :'images' => :'images' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'name' => :'String', - :'description' => :'String', - :'category' => :'String', - :'disclosure' => :'String', - :'skus' => :'Array', - :'currency_codes' => :'Array', - :'countries' => :'Array', - :'images' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::ListProducts200ResponseProductsInner` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::ListProducts200ResponseProductsInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - else - self.id = nil - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - else - self.name = nil - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - else - self.description = nil - end - - if attributes.key?(:'category') - self.category = attributes[:'category'] - else - self.category = nil - end - - if attributes.key?(:'disclosure') - self.disclosure = attributes[:'disclosure'] - else - self.disclosure = nil - end - - if attributes.key?(:'skus') - if (value = attributes[:'skus']).is_a?(Array) - self.skus = value - end - end - - if attributes.key?(:'currency_codes') - if (value = attributes[:'currency_codes']).is_a?(Array) - self.currency_codes = value - end - else - self.currency_codes = nil - end - - if attributes.key?(:'countries') - if (value = attributes[:'countries']).is_a?(Array) - self.countries = value - end - else - self.countries = nil - end - - if attributes.key?(:'images') - if (value = attributes[:'images']).is_a?(Array) - self.images = value - end - else - self.images = nil - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - pattern = Regexp.new(/[A-Z0-9]{4,20}/) - if @id !~ pattern - invalid_properties.push("invalid value for \"id\", must conform to the pattern #{pattern}.") - end - - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @description.nil? - invalid_properties.push('invalid value for "description", description cannot be nil.') - end - - if @category.nil? - invalid_properties.push('invalid value for "category", category cannot be nil.') - end - - if @disclosure.nil? - invalid_properties.push('invalid value for "disclosure", disclosure cannot be nil.') - end - - if @currency_codes.nil? - invalid_properties.push('invalid value for "currency_codes", currency_codes cannot be nil.') - end - - if @currency_codes.length < 1 - invalid_properties.push('invalid value for "currency_codes", number of items must be greater than or equal to 1.') - end - - if @countries.nil? - invalid_properties.push('invalid value for "countries", countries cannot be nil.') - end - - if @countries.length < 1 - invalid_properties.push('invalid value for "countries", number of items must be greater than or equal to 1.') - end - - if @images.nil? - invalid_properties.push('invalid value for "images", images cannot be nil.') - end - - if @images.length < 0 - invalid_properties.push('invalid value for "images", number of items must be greater than or equal to 0.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - warn '[DEPRECATED] the `valid?` method is obsolete' - return false if @id.nil? - return false if @id !~ Regexp.new(/[A-Z0-9]{4,20}/) - return false if @name.nil? - return false if @description.nil? - return false if @category.nil? - category_validator = EnumAttributeValidator.new('String', ["ach", "charity", "merchant_card", "paypal", "venmo", "visa_card"]) - return false unless category_validator.valid?(@category) - return false if @disclosure.nil? - return false if @currency_codes.nil? - return false if @currency_codes.length < 1 - return false if @countries.nil? - return false if @countries.length < 1 - return false if @images.nil? - return false if @images.length < 0 - true - end - - # Custom attribute writer method with validation - # @param [Object] id Value to be assigned - def id=(id) - if id.nil? - fail ArgumentError, 'id cannot be nil' - end - - pattern = Regexp.new(/[A-Z0-9]{4,20}/) - if id !~ pattern - fail ArgumentError, "invalid value for \"id\", must conform to the pattern #{pattern}." - end - - @id = id - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] category Object to be assigned - def category=(category) - validator = EnumAttributeValidator.new('String', ["ach", "charity", "merchant_card", "paypal", "venmo", "visa_card"]) - unless validator.valid?(category) - fail ArgumentError, "invalid value for \"category\", must be one of #{validator.allowable_values}." - end - @category = category - end - - # Custom attribute writer method with validation - # @param [Object] countries Value to be assigned - def countries=(countries) - if countries.nil? - fail ArgumentError, 'countries cannot be nil' - end - - if countries.length < 1 - fail ArgumentError, 'invalid value for "countries", number of items must be greater than or equal to 1.' - end - - @countries = countries - end - - # Custom attribute writer method with validation - # @param [Object] images Value to be assigned - def images=(images) - if images.nil? - fail ArgumentError, 'images cannot be nil' - end - - if images.length < 0 - fail ArgumentError, 'invalid value for "images", number of items must be greater than or equal to 0.' - end - - @images = images - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - name == o.name && - description == o.description && - category == o.category && - disclosure == o.disclosure && - skus == o.skus && - currency_codes == o.currency_codes && - countries == o.countries && - images == o.images - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, name, description, category, disclosure, skus, currency_codes, countries, images].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Tremendous.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/tremendous/models/list_products200_response_products_inner_countries_inner.rb b/lib/tremendous/models/list_products200_response_products_inner_countries_inner.rb deleted file mode 100644 index 7170244..0000000 --- a/lib/tremendous/models/list_products200_response_products_inner_countries_inner.rb +++ /dev/null @@ -1,222 +0,0 @@ -=begin -#API Endpoints - -#Deliver monetary rewards and incentives to employees, customers, survey participants, and more through the Tremendous API. For organizational tasks, like managing your organization and it's members within Tremendous, please see the Tremendous Organizational API. - -The version of the OpenAPI document: 2 -Contact: developers@tremendous.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'date' -require 'time' - -module Tremendous - class ListProducts200ResponseProductsInnerCountriesInner - # ISO 3166 country code - attr_accessor :abbr - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'abbr' => :'abbr' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'abbr' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::ListProducts200ResponseProductsInnerCountriesInner` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::ListProducts200ResponseProductsInnerCountriesInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'abbr') - self.abbr = attributes[:'abbr'] - else - self.abbr = nil - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' - invalid_properties = Array.new - if @abbr.nil? - invalid_properties.push('invalid value for "abbr", abbr cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - warn '[DEPRECATED] the `valid?` method is obsolete' - return false if @abbr.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - abbr == o.abbr - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [abbr].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Tremendous.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/tremendous/models/list_rewards200_response_rewards_inner_custom_fields_inner.rb b/lib/tremendous/models/list_rewards200_response_rewards_inner_custom_fields_inner.rb index 70685a6..47e59b3 100644 --- a/lib/tremendous/models/list_rewards200_response_rewards_inner_custom_fields_inner.rb +++ b/lib/tremendous/models/list_rewards200_response_rewards_inner_custom_fields_inner.rb @@ -22,11 +22,15 @@ class ListRewards200ResponseRewardsInnerCustomFieldsInner # Value of the custom field attr_accessor :value + # Label of the custom field + attr_accessor :label + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'id' => :'id', - :'value' => :'value' + :'value' => :'value', + :'label' => :'label' } end @@ -39,14 +43,15 @@ def self.acceptable_attributes def self.openapi_types { :'id' => :'String', - :'value' => :'String' + :'value' => :'String', + :'label' => :'String' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ - :'value' + :'value', ]) end @@ -72,6 +77,10 @@ def initialize(attributes = {}) if attributes.key?(:'value') self.value = attributes[:'value'] end + + if attributes.key?(:'label') + self.label = attributes[:'label'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -116,7 +125,8 @@ def ==(o) return true if self.equal?(o) self.class == o.class && id == o.id && - value == o.value + value == o.value && + label == o.label end # @see the `==` method @@ -128,7 +138,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, value].hash + [id, value, label].hash end # Builds the object from hash diff --git a/lib/tremendous/models/member.rb b/lib/tremendous/models/member.rb index 6c78d86..2746e59 100644 --- a/lib/tremendous/models/member.rb +++ b/lib/tremendous/models/member.rb @@ -24,7 +24,10 @@ class Member # Full name of the member attr_accessor :name - # Role of the member within the organization.
Role Description
MEMBER Limited permissions. Can view their own reward and order histories only.
ADMIN Update organization settings, invite other members to the organization, and view all member order and reward histories within their organization.
DELETED No longer a member of this organization.
+ # Is this member currently active in the organization. If `false`, the member will not be able to access the organization. + attr_accessor :active + + # Role of the member within the organization.
Role Description
MEMBER Limited permissions. Can view their own reward and order histories only.
ADMIN Update organization settings, invite other members to the organization, and view all member order and reward histories within their organization.
attr_accessor :role # Current status of the member's account. When creating a member it starts out in the status `INVITED`. As soon as that member open the invitation link and registers an account, the status switches to `REGISTERED`. @@ -64,6 +67,7 @@ def self.attribute_map :'id' => :'id', :'email' => :'email', :'name' => :'name', + :'active' => :'active', :'role' => :'role', :'status' => :'status', :'created_at' => :'created_at', @@ -82,6 +86,7 @@ def self.openapi_types :'id' => :'String', :'email' => :'String', :'name' => :'String', + :'active' => :'Boolean', :'role' => :'String', :'status' => :'String', :'created_at' => :'Time', @@ -130,6 +135,10 @@ def initialize(attributes = {}) self.name = nil end + if attributes.key?(:'active') + self.active = attributes[:'active'] + end + if attributes.key?(:'role') self.role = attributes[:'role'] else @@ -188,7 +197,7 @@ def valid? return false if @id !~ Regexp.new(/[A-Z0-9]{4,20}/) return false if @email.nil? return false if @role.nil? - role_validator = EnumAttributeValidator.new('String', ["MEMBER", "ADMIN", "DELETED"]) + role_validator = EnumAttributeValidator.new('String', ["MEMBER", "ADMIN"]) return false unless role_validator.valid?(@role) return false if @status.nil? status_validator = EnumAttributeValidator.new('String', ["REGISTERED", "INVITED"]) @@ -214,7 +223,7 @@ def id=(id) # Custom attribute writer method checking allowed values (enum). # @param [Object] role Object to be assigned def role=(role) - validator = EnumAttributeValidator.new('String', ["MEMBER", "ADMIN", "DELETED"]) + validator = EnumAttributeValidator.new('String', ["MEMBER", "ADMIN"]) unless validator.valid?(role) fail ArgumentError, "invalid value for \"role\", must be one of #{validator.allowable_values}." end @@ -239,6 +248,7 @@ def ==(o) id == o.id && email == o.email && name == o.name && + active == o.active && role == o.role && status == o.status && created_at == o.created_at && @@ -254,7 +264,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, email, name, role, status, created_at, last_login_at].hash + [id, email, name, active, role, status, created_at, last_login_at].hash end # Builds the object from hash diff --git a/lib/tremendous/models/member_base.rb b/lib/tremendous/models/member_base.rb index 01143cd..2f27d0b 100644 --- a/lib/tremendous/models/member_base.rb +++ b/lib/tremendous/models/member_base.rb @@ -24,7 +24,10 @@ class MemberBase # Full name of the member attr_accessor :name - # Role of the member within the organization.
Role Description
MEMBER Limited permissions. Can view their own reward and order histories only.
ADMIN Update organization settings, invite other members to the organization, and view all member order and reward histories within their organization.
DELETED No longer a member of this organization.
+ # Is this member currently active in the organization. If `false`, the member will not be able to access the organization. + attr_accessor :active + + # Role of the member within the organization.
Role Description
MEMBER Limited permissions. Can view their own reward and order histories only.
ADMIN Update organization settings, invite other members to the organization, and view all member order and reward histories within their organization.
attr_accessor :role # Current status of the member's account. When creating a member it starts out in the status `INVITED`. As soon as that member open the invitation link and registers an account, the status switches to `REGISTERED`. @@ -58,6 +61,7 @@ def self.attribute_map :'id' => :'id', :'email' => :'email', :'name' => :'name', + :'active' => :'active', :'role' => :'role', :'status' => :'status' } @@ -74,6 +78,7 @@ def self.openapi_types :'id' => :'String', :'email' => :'String', :'name' => :'String', + :'active' => :'Boolean', :'role' => :'String', :'status' => :'String' } @@ -119,6 +124,10 @@ def initialize(attributes = {}) self.name = nil end + if attributes.key?(:'active') + self.active = attributes[:'active'] + end + if attributes.key?(:'role') self.role = attributes[:'role'] else @@ -169,7 +178,7 @@ def valid? return false if @id !~ Regexp.new(/[A-Z0-9]{4,20}/) return false if @email.nil? return false if @role.nil? - role_validator = EnumAttributeValidator.new('String', ["MEMBER", "ADMIN", "DELETED"]) + role_validator = EnumAttributeValidator.new('String', ["MEMBER", "ADMIN"]) return false unless role_validator.valid?(@role) return false if @status.nil? status_validator = EnumAttributeValidator.new('String', ["REGISTERED", "INVITED"]) @@ -195,7 +204,7 @@ def id=(id) # Custom attribute writer method checking allowed values (enum). # @param [Object] role Object to be assigned def role=(role) - validator = EnumAttributeValidator.new('String', ["MEMBER", "ADMIN", "DELETED"]) + validator = EnumAttributeValidator.new('String', ["MEMBER", "ADMIN"]) unless validator.valid?(role) fail ArgumentError, "invalid value for \"role\", must be one of #{validator.allowable_values}." end @@ -220,6 +229,7 @@ def ==(o) id == o.id && email == o.email && name == o.name && + active == o.active && role == o.role && status == o.status end @@ -233,7 +243,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, email, name, role, status].hash + [id, email, name, active, role, status].hash end # Builds the object from hash diff --git a/lib/tremendous/models/member_with_events.rb b/lib/tremendous/models/member_with_events.rb index 1a9edc7..dbb3560 100644 --- a/lib/tremendous/models/member_with_events.rb +++ b/lib/tremendous/models/member_with_events.rb @@ -24,7 +24,10 @@ class MemberWithEvents # Full name of the member attr_accessor :name - # Role of the member within the organization.
Role Description
MEMBER Limited permissions. Can view their own reward and order histories only.
ADMIN Update organization settings, invite other members to the organization, and view all member order and reward histories within their organization.
DELETED No longer a member of this organization.
+ # Is this member currently active in the organization. If `false`, the member will not be able to access the organization. + attr_accessor :active + + # Role of the member within the organization.
Role Description
MEMBER Limited permissions. Can view their own reward and order histories only.
ADMIN Update organization settings, invite other members to the organization, and view all member order and reward histories within their organization.
attr_accessor :role # Current status of the member's account. When creating a member it starts out in the status `INVITED`. As soon as that member open the invitation link and registers an account, the status switches to `REGISTERED`. @@ -61,6 +64,7 @@ def self.attribute_map :'id' => :'id', :'email' => :'email', :'name' => :'name', + :'active' => :'active', :'role' => :'role', :'status' => :'status', :'events' => :'events' @@ -78,6 +82,7 @@ def self.openapi_types :'id' => :'String', :'email' => :'String', :'name' => :'String', + :'active' => :'Boolean', :'role' => :'String', :'status' => :'String', :'events' => :'Array' @@ -124,6 +129,10 @@ def initialize(attributes = {}) self.name = nil end + if attributes.key?(:'active') + self.active = attributes[:'active'] + end + if attributes.key?(:'role') self.role = attributes[:'role'] else @@ -180,7 +189,7 @@ def valid? return false if @id !~ Regexp.new(/[A-Z0-9]{4,20}/) return false if @email.nil? return false if @role.nil? - role_validator = EnumAttributeValidator.new('String', ["MEMBER", "ADMIN", "DELETED"]) + role_validator = EnumAttributeValidator.new('String', ["MEMBER", "ADMIN"]) return false unless role_validator.valid?(@role) return false if @status.nil? status_validator = EnumAttributeValidator.new('String', ["REGISTERED", "INVITED"]) @@ -206,7 +215,7 @@ def id=(id) # Custom attribute writer method checking allowed values (enum). # @param [Object] role Object to be assigned def role=(role) - validator = EnumAttributeValidator.new('String', ["MEMBER", "ADMIN", "DELETED"]) + validator = EnumAttributeValidator.new('String', ["MEMBER", "ADMIN"]) unless validator.valid?(role) fail ArgumentError, "invalid value for \"role\", must be one of #{validator.allowable_values}." end @@ -231,6 +240,7 @@ def ==(o) id == o.id && email == o.email && name == o.name && + active == o.active && role == o.role && status == o.status && events == o.events @@ -245,7 +255,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, email, name, role, status, events].hash + [id, email, name, active, role, status, events].hash end # Builds the object from hash diff --git a/lib/tremendous/models/member_without_events.rb b/lib/tremendous/models/member_without_events.rb index 48fc0b3..db3bea1 100644 --- a/lib/tremendous/models/member_without_events.rb +++ b/lib/tremendous/models/member_without_events.rb @@ -24,7 +24,10 @@ class MemberWithoutEvents # Full name of the member attr_accessor :name - # Role of the member within the organization.
Role Description
MEMBER Limited permissions. Can view their own reward and order histories only.
ADMIN Update organization settings, invite other members to the organization, and view all member order and reward histories within their organization.
DELETED No longer a member of this organization.
+ # Is this member currently active in the organization. If `false`, the member will not be able to access the organization. + attr_accessor :active + + # Role of the member within the organization.
Role Description
MEMBER Limited permissions. Can view their own reward and order histories only.
ADMIN Update organization settings, invite other members to the organization, and view all member order and reward histories within their organization.
attr_accessor :role # Current status of the member's account. When creating a member it starts out in the status `INVITED`. As soon as that member open the invitation link and registers an account, the status switches to `REGISTERED`. @@ -64,6 +67,7 @@ def self.attribute_map :'id' => :'id', :'email' => :'email', :'name' => :'name', + :'active' => :'active', :'role' => :'role', :'status' => :'status', :'created_at' => :'created_at', @@ -82,6 +86,7 @@ def self.openapi_types :'id' => :'String', :'email' => :'String', :'name' => :'String', + :'active' => :'Boolean', :'role' => :'String', :'status' => :'String', :'created_at' => :'Time', @@ -130,6 +135,10 @@ def initialize(attributes = {}) self.name = nil end + if attributes.key?(:'active') + self.active = attributes[:'active'] + end + if attributes.key?(:'role') self.role = attributes[:'role'] else @@ -188,7 +197,7 @@ def valid? return false if @id !~ Regexp.new(/[A-Z0-9]{4,20}/) return false if @email.nil? return false if @role.nil? - role_validator = EnumAttributeValidator.new('String', ["MEMBER", "ADMIN", "DELETED"]) + role_validator = EnumAttributeValidator.new('String', ["MEMBER", "ADMIN"]) return false unless role_validator.valid?(@role) return false if @status.nil? status_validator = EnumAttributeValidator.new('String', ["REGISTERED", "INVITED"]) @@ -214,7 +223,7 @@ def id=(id) # Custom attribute writer method checking allowed values (enum). # @param [Object] role Object to be assigned def role=(role) - validator = EnumAttributeValidator.new('String', ["MEMBER", "ADMIN", "DELETED"]) + validator = EnumAttributeValidator.new('String', ["MEMBER", "ADMIN"]) unless validator.valid?(role) fail ArgumentError, "invalid value for \"role\", must be one of #{validator.allowable_values}." end @@ -239,6 +248,7 @@ def ==(o) id == o.id && email == o.email && name == o.name && + active == o.active && role == o.role && status == o.status && created_at == o.created_at && @@ -254,7 +264,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, email, name, role, status, created_at, last_login_at].hash + [id, email, name, active, role, status, created_at, last_login_at].hash end # Builds the object from hash diff --git a/lib/tremendous/models/reward_base_custom_fields_inner.rb b/lib/tremendous/models/reward_base_custom_fields_inner.rb index 0f5cc1a..aeaa2f6 100644 --- a/lib/tremendous/models/reward_base_custom_fields_inner.rb +++ b/lib/tremendous/models/reward_base_custom_fields_inner.rb @@ -22,11 +22,15 @@ class RewardBaseCustomFieldsInner # Value of the custom field attr_accessor :value + # Label of the custom field + attr_accessor :label + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'id' => :'id', - :'value' => :'value' + :'value' => :'value', + :'label' => :'label' } end @@ -39,14 +43,15 @@ def self.acceptable_attributes def self.openapi_types { :'id' => :'String', - :'value' => :'String' + :'value' => :'String', + :'label' => :'String' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ - :'value' + :'value', ]) end @@ -72,6 +77,10 @@ def initialize(attributes = {}) if attributes.key?(:'value') self.value = attributes[:'value'] end + + if attributes.key?(:'label') + self.label = attributes[:'label'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -116,7 +125,8 @@ def ==(o) return true if self.equal?(o) self.class == o.class && id == o.id && - value == o.value + value == o.value && + label == o.label end # @see the `==` method @@ -128,7 +138,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, value].hash + [id, value, label].hash end # Builds the object from hash diff --git a/lib/tremendous/version.rb b/lib/tremendous/version.rb index 42c22cf..c8e8a4c 100644 --- a/lib/tremendous/version.rb +++ b/lib/tremendous/version.rb @@ -1,3 +1,3 @@ module Tremendous - VERSION = "5.0.1" + VERSION = "5.1.0" end