tremendous_ruby 5.4.0 → 5.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/tremendous/api/tremendous_api.rb +59 -399
- data/lib/tremendous/api_client.rb +31 -26
- data/lib/tremendous/api_error.rb +1 -1
- data/lib/tremendous/configuration.rb +2 -2
- data/lib/tremendous/models/allow_email.rb +1 -1
- data/lib/tremendous/models/allow_email1.rb +1 -1
- data/lib/tremendous/models/allow_ip.rb +1 -1
- data/lib/tremendous/models/allow_ip1.rb +1 -1
- data/lib/tremendous/models/balance_transaction.rb +37 -2
- data/lib/tremendous/models/base_order_for_create.rb +2 -2
- data/lib/tremendous/models/campaign.rb +1 -1
- data/lib/tremendous/models/campaign_base.rb +1 -1
- data/lib/tremendous/models/channel.rb +45 -0
- data/lib/tremendous/models/create_api_key200_response.rb +1 -1
- data/lib/tremendous/models/create_campaign201_response.rb +1 -1
- data/lib/tremendous/models/create_campaign_request.rb +1 -1
- data/lib/tremendous/models/create_invoice200_response.rb +1 -1
- data/lib/tremendous/models/create_invoice_request.rb +1 -1
- data/lib/tremendous/models/create_member.rb +1 -1
- data/lib/tremendous/models/create_member200_response.rb +1 -1
- data/lib/tremendous/models/create_member_request.rb +1 -1
- data/lib/tremendous/models/create_order200_response.rb +2 -2
- data/lib/tremendous/models/create_order200_response_order.rb +403 -0
- data/lib/tremendous/models/create_order200_response_order_rewards_inner.rb +326 -0
- data/lib/tremendous/models/create_order200_response_order_rewards_inner_delivery.rb +296 -0
- data/lib/tremendous/models/{create_public_key_request.rb → create_order201_response.rb} +15 -16
- data/lib/tremendous/models/create_order_request.rb +2 -2
- data/lib/tremendous/models/create_organization.rb +52 -5
- data/lib/tremendous/models/create_organization200_response.rb +1 -1
- data/lib/tremendous/models/create_organization200_response_organization.rb +21 -46
- data/lib/tremendous/models/{public_keys_response_public_keys_inner.rb → create_organization_for_response.rb} +73 -21
- data/lib/tremendous/models/{public_key.rb → create_organization_properties.rb} +58 -21
- data/lib/tremendous/models/create_organization_request.rb +8 -1
- data/lib/tremendous/models/create_organization_request_copy_settings.rb +1 -1
- data/lib/tremendous/models/create_webhook200_response.rb +1 -1
- data/lib/tremendous/models/create_webhook_request.rb +1 -1
- data/lib/tremendous/models/currency_codes.rb +1 -1
- data/lib/tremendous/models/custom_field.rb +1 -1
- data/lib/tremendous/models/delete_fraud_rule200_response.rb +1 -1
- data/lib/tremendous/models/delivery_details.rb +1 -15
- data/lib/tremendous/models/delivery_details_with_link.rb +296 -0
- data/lib/tremendous/models/delivery_method.rb +1 -1
- data/lib/tremendous/models/delivery_status.rb +1 -1
- data/lib/tremendous/models/error_model.rb +12 -2
- data/lib/tremendous/models/field.rb +1 -1
- data/lib/tremendous/models/fraud_config_allow_email.rb +1 -1
- data/lib/tremendous/models/fraud_config_country.rb +1 -1
- data/lib/tremendous/models/fraud_config_country_update_list.rb +1 -1
- data/lib/tremendous/models/fraud_config_ip.rb +1 -1
- data/lib/tremendous/models/fraud_config_redeemed_rewards_amount.rb +1 -1
- data/lib/tremendous/models/fraud_config_redeemed_rewards_count.rb +1 -1
- data/lib/tremendous/models/fraud_config_review_email.rb +1 -1
- data/lib/tremendous/models/fraud_generic_response.rb +1 -1
- data/lib/tremendous/models/fraud_review.rb +2 -2
- data/lib/tremendous/models/fraud_review_geo.rb +1 -1
- data/lib/tremendous/models/fraud_review_list_item.rb +2 -2
- data/lib/tremendous/models/fraud_review_reason.rb +1 -1
- data/lib/tremendous/models/fraud_review_redemption_method.rb +1 -1
- data/lib/tremendous/models/fraud_review_related_rewards.rb +1 -1
- data/lib/tremendous/models/fraud_review_status.rb +1 -1
- data/lib/tremendous/models/fraud_rule200_response.rb +1 -1
- data/lib/tremendous/models/fraud_rule400_response.rb +12 -2
- data/lib/tremendous/models/fraud_rule422_response.rb +12 -2
- data/lib/tremendous/models/fraud_rule_request.rb +1 -1
- data/lib/tremendous/models/fraud_rule_request_config.rb +1 -1
- data/lib/tremendous/models/fraud_rule_type.rb +1 -1
- data/lib/tremendous/models/fraud_rules_list_item.rb +5 -3
- data/lib/tremendous/models/funding_source.rb +1 -1
- data/lib/tremendous/models/generate_reward_link200_response.rb +1 -1
- data/lib/tremendous/models/generate_reward_link200_response_reward.rb +1 -1
- data/lib/tremendous/models/generate_reward_link403_response.rb +12 -2
- data/lib/tremendous/models/generate_reward_token200_response.rb +1 -1
- data/lib/tremendous/models/generate_reward_token200_response_reward.rb +1 -1
- data/lib/tremendous/models/get_fraud_review200_response.rb +1 -1
- data/lib/tremendous/models/get_fraud_review200_response_fraud_review.rb +1 -1
- data/lib/tremendous/models/get_fraud_review200_response_fraud_review_geo.rb +1 -1
- data/lib/tremendous/models/get_fraud_review200_response_fraud_review_related_rewards.rb +1 -1
- data/lib/tremendous/models/get_funding_source200_response.rb +1 -1
- data/lib/tremendous/models/get_member200_response.rb +1 -1
- data/lib/tremendous/models/get_member200_response_member.rb +1 -1
- data/lib/tremendous/models/get_member200_response_member_events_inner.rb +1 -1
- data/lib/tremendous/models/get_organization200_response.rb +1 -1
- data/lib/tremendous/models/get_product_response.rb +1 -1
- data/lib/tremendous/models/get_reward200_response.rb +1 -1
- data/lib/tremendous/models/invoice.rb +11 -2
- data/lib/tremendous/models/list_balance_transactions200_response.rb +16 -9
- data/lib/tremendous/models/{list_balance_transactions200_response_invoices_inner.rb → list_balance_transactions200_response_transactions_inner.rb} +40 -5
- data/lib/tremendous/models/list_campaigns200_response.rb +1 -1
- data/lib/tremendous/models/list_campaigns200_response_campaigns_inner.rb +1 -1
- data/lib/tremendous/models/list_campaigns200_response_campaigns_inner_email_style.rb +1 -1
- data/lib/tremendous/models/list_campaigns200_response_campaigns_inner_webpage_style.rb +1 -1
- data/lib/tremendous/models/list_fields200_response.rb +1 -1
- data/lib/tremendous/models/list_fields200_response_fields_inner.rb +1 -1
- data/lib/tremendous/models/list_forex_response.rb +1 -1
- data/lib/tremendous/models/list_fraud_reviews200_response.rb +22 -5
- data/lib/tremendous/models/list_fraud_reviews200_response_fraud_reviews_inner.rb +1 -1
- data/lib/tremendous/models/list_fraud_rules200_response.rb +1 -1
- data/lib/tremendous/models/list_fraud_rules200_response_fraud_rules_inner.rb +5 -3
- data/lib/tremendous/models/list_funding_sources200_response.rb +1 -1
- data/lib/tremendous/models/list_funding_sources200_response_funding_sources_inner.rb +1 -1
- data/lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb +1 -1
- data/lib/tremendous/models/list_invoices200_response.rb +1 -1
- data/lib/tremendous/models/list_invoices200_response_invoices_inner.rb +11 -2
- data/lib/tremendous/models/list_members200_response.rb +1 -1
- data/lib/tremendous/models/list_members200_response_members_inner.rb +1 -1
- data/lib/tremendous/models/list_orders200_response.rb +1 -1
- data/lib/tremendous/models/list_orders200_response_orders_inner.rb +32 -8
- data/lib/tremendous/models/list_orders200_response_orders_inner_payment.rb +5 -49
- data/lib/tremendous/models/list_orders200_response_orders_inner_payment_refund.rb +1 -1
- data/lib/tremendous/models/list_organizations200_response.rb +1 -1
- data/lib/tremendous/models/list_organizations200_response_organizations_inner.rb +1 -1
- data/lib/tremendous/models/list_products_response.rb +1 -1
- data/lib/tremendous/models/list_products_response_products_inner.rb +1 -1
- data/lib/tremendous/models/list_products_response_products_inner_countries_inner.rb +1 -1
- data/lib/tremendous/models/list_products_response_products_inner_images_inner.rb +1 -1
- data/lib/tremendous/models/list_products_response_products_inner_skus_inner.rb +1 -1
- data/lib/tremendous/models/list_rewards200_response.rb +1 -1
- data/lib/tremendous/models/list_rewards200_response_rewards_inner.rb +1 -1
- data/lib/tremendous/models/list_rewards200_response_rewards_inner_custom_fields_inner.rb +1 -1
- data/lib/tremendous/models/list_rewards200_response_rewards_inner_delivery.rb +1 -15
- data/lib/tremendous/models/list_rewards200_response_rewards_inner_recipient.rb +1 -1
- data/lib/tremendous/models/list_rewards200_response_rewards_inner_value.rb +1 -1
- data/lib/tremendous/models/list_rewards401_response.rb +12 -2
- data/lib/tremendous/models/list_rewards401_response_errors.rb +5 -3
- data/lib/tremendous/models/list_rewards429_response.rb +12 -2
- data/lib/tremendous/models/list_roles200_response.rb +1 -1
- data/lib/tremendous/models/list_roles200_response_roles_inner.rb +1 -1
- data/lib/tremendous/models/list_webhook_events200_response.rb +1 -1
- data/lib/tremendous/models/list_webhooks200_response.rb +1 -1
- data/lib/tremendous/models/list_webhooks200_response_webhooks_inner.rb +1 -1
- data/lib/tremendous/models/member.rb +1 -1
- data/lib/tremendous/models/member_base.rb +1 -1
- data/lib/tremendous/models/member_with_events.rb +1 -1
- data/lib/tremendous/models/member_without_events.rb +1 -1
- data/lib/tremendous/models/order.rb +32 -8
- data/lib/tremendous/models/order_base.rb +24 -2
- data/lib/tremendous/models/order_base_payment.rb +5 -49
- data/lib/tremendous/models/order_status.rb +1 -1
- data/lib/tremendous/models/order_with_link.rb +403 -0
- data/lib/tremendous/models/order_with_link_rewards_inner.rb +385 -0
- data/lib/tremendous/models/order_without_link.rb +32 -8
- data/lib/tremendous/models/{order_without_link_reward.rb → order_without_link_rewards_inner.rb} +4 -4
- data/lib/tremendous/models/organization.rb +1 -1
- data/lib/tremendous/models/payment_details.rb +5 -49
- data/lib/tremendous/models/payment_details_refund.rb +1 -1
- data/lib/tremendous/models/payout.rb +340 -0
- data/lib/tremendous/models/product.rb +1 -1
- data/lib/tremendous/models/recipient.rb +1 -1
- data/lib/tremendous/models/refund_details.rb +1 -1
- data/lib/tremendous/models/resend_reward422_response.rb +12 -2
- data/lib/tremendous/models/review_country.rb +1 -1
- data/lib/tremendous/models/review_country1.rb +1 -1
- data/lib/tremendous/models/review_email.rb +1 -1
- data/lib/tremendous/models/review_email1.rb +1 -1
- data/lib/tremendous/models/review_ip.rb +1 -1
- data/lib/tremendous/models/review_ip1.rb +1 -1
- data/lib/tremendous/models/review_redeemed_rewards_amount.rb +1 -1
- data/lib/tremendous/models/review_redeemed_rewards_count.rb +1 -1
- data/lib/tremendous/models/reward.rb +1 -1
- data/lib/tremendous/models/reward_base.rb +1 -1
- data/lib/tremendous/models/reward_base_custom_fields_inner.rb +1 -1
- data/lib/tremendous/models/reward_for_order_create.rb +2 -2
- data/lib/tremendous/models/reward_link.rb +1 -1
- data/lib/tremendous/models/reward_token.rb +1 -1
- data/lib/tremendous/models/reward_value.rb +1 -1
- data/lib/tremendous/models/{single_reward_order1_reward.rb → reward_with_link.rb} +79 -17
- data/lib/tremendous/models/reward_with_link_delivery.rb +296 -0
- data/lib/tremendous/models/reward_without_link.rb +1 -1
- data/lib/tremendous/models/reward_without_link_delivery.rb +1 -15
- data/lib/tremendous/models/role.rb +1 -1
- data/lib/tremendous/models/simulate_webhook_request.rb +1 -1
- data/lib/tremendous/models/single_reward_order.rb +2 -2
- data/lib/tremendous/models/{single_reward_order1_payment.rb → single_reward_order_payment.rb} +4 -4
- data/lib/tremendous/models/single_reward_order_reward.rb +4 -76
- data/lib/tremendous/models/{single_reward_order1_reward_custom_fields_inner.rb → single_reward_order_reward_custom_fields_inner.rb} +4 -4
- data/lib/tremendous/models/{single_reward_order1_reward_delivery.rb → single_reward_order_reward_delivery.rb} +4 -4
- data/lib/tremendous/models/{test_public_key.rb → single_reward_order_with_link.rb} +15 -16
- data/lib/tremendous/models/single_reward_order_with_link_order.rb +403 -0
- data/lib/tremendous/models/single_reward_order_without_link.rb +1 -1
- data/lib/tremendous/models/single_reward_order_without_link_order.rb +32 -8
- data/lib/tremendous/models/update_campaign.rb +1 -1
- data/lib/tremendous/models/update_campaign_request.rb +1 -1
- data/lib/tremendous/models/update_fraud_rule_list200_response.rb +1 -1
- data/lib/tremendous/models/update_fraud_rule_list_request.rb +1 -1
- data/lib/tremendous/models/update_fraud_rule_list_request_config.rb +1 -1
- data/lib/tremendous/models/webhook.rb +1 -1
- data/lib/tremendous/models/webhook_post.rb +1 -1
- data/lib/tremendous/version.rb +1 -1
- data/lib/tremendous.rb +21 -17
- metadata +22 -18
- data/lib/tremendous/models/create_invoice.rb +0 -244
- data/lib/tremendous/models/create_public_key.rb +0 -222
- data/lib/tremendous/models/create_public_key200_response.rb +0 -221
- data/lib/tremendous/models/public_keys_response.rb +0 -223
- data/lib/tremendous/models/single_reward_order1.rb +0 -242
- data/lib/tremendous/models/test_public_key_request.rb +0 -222
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#API Endpoints
|
|
3
|
+
|
|
4
|
+
#Deliver monetary rewards and incentives to employees, customers, survey participants, and more through the Tremendous API. For organizational tasks, like managing your organization and it's members within Tremendous, please see the Tremendous Organizational API.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 2
|
|
7
|
+
Contact: developers@tremendous.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.8.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Tremendous
|
|
17
|
+
# A single reward, sent to a recipient. A reward is always part of an order. Either `products` or `campaign_id` must be specified.
|
|
18
|
+
class OrderWithLinkRewardsInner
|
|
19
|
+
# Tremendous ID of the reward
|
|
20
|
+
attr_accessor :id
|
|
21
|
+
|
|
22
|
+
# Tremendous ID of the order this reward is part of.
|
|
23
|
+
attr_accessor :order_id
|
|
24
|
+
|
|
25
|
+
# Date the reward was created
|
|
26
|
+
attr_accessor :created_at
|
|
27
|
+
|
|
28
|
+
# ID of the campaign in your account, that defines the available products (different gift cards, charity, etc.) that the recipient can choose from.
|
|
29
|
+
attr_accessor :campaign_id
|
|
30
|
+
|
|
31
|
+
# 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.
|
|
32
|
+
attr_accessor :products
|
|
33
|
+
|
|
34
|
+
attr_accessor :value
|
|
35
|
+
|
|
36
|
+
attr_accessor :recipient
|
|
37
|
+
|
|
38
|
+
# Timestamp of reward delivery within the next year. Note that if date-time is provided, the time values will be ignored.
|
|
39
|
+
attr_accessor :deliver_at
|
|
40
|
+
|
|
41
|
+
attr_accessor :custom_fields
|
|
42
|
+
|
|
43
|
+
attr_accessor :delivery
|
|
44
|
+
|
|
45
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
46
|
+
def self.attribute_map
|
|
47
|
+
{
|
|
48
|
+
:'id' => :'id',
|
|
49
|
+
:'order_id' => :'order_id',
|
|
50
|
+
:'created_at' => :'created_at',
|
|
51
|
+
:'campaign_id' => :'campaign_id',
|
|
52
|
+
:'products' => :'products',
|
|
53
|
+
:'value' => :'value',
|
|
54
|
+
:'recipient' => :'recipient',
|
|
55
|
+
:'deliver_at' => :'deliver_at',
|
|
56
|
+
:'custom_fields' => :'custom_fields',
|
|
57
|
+
:'delivery' => :'delivery'
|
|
58
|
+
}
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Returns all the JSON keys this model knows about
|
|
62
|
+
def self.acceptable_attributes
|
|
63
|
+
attribute_map.values
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Attribute type mapping.
|
|
67
|
+
def self.openapi_types
|
|
68
|
+
{
|
|
69
|
+
:'id' => :'String',
|
|
70
|
+
:'order_id' => :'String',
|
|
71
|
+
:'created_at' => :'Time',
|
|
72
|
+
:'campaign_id' => :'String',
|
|
73
|
+
:'products' => :'Array<String>',
|
|
74
|
+
:'value' => :'ListRewards200ResponseRewardsInnerValue',
|
|
75
|
+
:'recipient' => :'ListRewards200ResponseRewardsInnerRecipient',
|
|
76
|
+
:'deliver_at' => :'Date',
|
|
77
|
+
:'custom_fields' => :'Array<RewardBaseCustomFieldsInner>',
|
|
78
|
+
:'delivery' => :'RewardWithLinkDelivery'
|
|
79
|
+
}
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# List of attributes with nullable: true
|
|
83
|
+
def self.openapi_nullable
|
|
84
|
+
Set.new([
|
|
85
|
+
:'campaign_id',
|
|
86
|
+
])
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# Initializes the object
|
|
90
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
91
|
+
def initialize(attributes = {})
|
|
92
|
+
if (!attributes.is_a?(Hash))
|
|
93
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::OrderWithLinkRewardsInner` initialize method"
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
97
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
98
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
99
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::OrderWithLinkRewardsInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
100
|
+
end
|
|
101
|
+
h[k.to_sym] = v
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if attributes.key?(:'id')
|
|
105
|
+
self.id = attributes[:'id']
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
if attributes.key?(:'order_id')
|
|
109
|
+
self.order_id = attributes[:'order_id']
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
if attributes.key?(:'created_at')
|
|
113
|
+
self.created_at = attributes[:'created_at']
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
if attributes.key?(:'campaign_id')
|
|
117
|
+
self.campaign_id = attributes[:'campaign_id']
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
if attributes.key?(:'products')
|
|
121
|
+
if (value = attributes[:'products']).is_a?(Array)
|
|
122
|
+
self.products = value
|
|
123
|
+
end
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
if attributes.key?(:'value')
|
|
127
|
+
self.value = attributes[:'value']
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
if attributes.key?(:'recipient')
|
|
131
|
+
self.recipient = attributes[:'recipient']
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
if attributes.key?(:'deliver_at')
|
|
135
|
+
self.deliver_at = attributes[:'deliver_at']
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
if attributes.key?(:'custom_fields')
|
|
139
|
+
if (value = attributes[:'custom_fields']).is_a?(Array)
|
|
140
|
+
self.custom_fields = value
|
|
141
|
+
end
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
if attributes.key?(:'delivery')
|
|
145
|
+
self.delivery = attributes[:'delivery']
|
|
146
|
+
end
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
150
|
+
# @return Array for valid properties with the reasons
|
|
151
|
+
def list_invalid_properties
|
|
152
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
153
|
+
invalid_properties = Array.new
|
|
154
|
+
pattern = Regexp.new(/[A-Z0-9]{4,20}/)
|
|
155
|
+
if !@id.nil? && @id !~ pattern
|
|
156
|
+
invalid_properties.push("invalid value for \"id\", must conform to the pattern #{pattern}.")
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
pattern = Regexp.new(/[A-Z0-9]{4,20}/)
|
|
160
|
+
if !@order_id.nil? && @order_id !~ pattern
|
|
161
|
+
invalid_properties.push("invalid value for \"order_id\", must conform to the pattern #{pattern}.")
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
pattern = Regexp.new(/[A-Z0-9]{4,20}/)
|
|
165
|
+
if !@campaign_id.nil? && @campaign_id !~ pattern
|
|
166
|
+
invalid_properties.push("invalid value for \"campaign_id\", must conform to the pattern #{pattern}.")
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
if !@products.nil? && @products.length < 1
|
|
170
|
+
invalid_properties.push('invalid value for "products", number of items must be greater than or equal to 1.')
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
invalid_properties
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
# Check to see if the all the properties in the model are valid
|
|
177
|
+
# @return true if the model is valid
|
|
178
|
+
def valid?
|
|
179
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
180
|
+
return false if !@id.nil? && @id !~ Regexp.new(/[A-Z0-9]{4,20}/)
|
|
181
|
+
return false if !@order_id.nil? && @order_id !~ Regexp.new(/[A-Z0-9]{4,20}/)
|
|
182
|
+
return false if !@campaign_id.nil? && @campaign_id !~ Regexp.new(/[A-Z0-9]{4,20}/)
|
|
183
|
+
return false if !@products.nil? && @products.length < 1
|
|
184
|
+
true
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
# Custom attribute writer method with validation
|
|
188
|
+
# @param [Object] id Value to be assigned
|
|
189
|
+
def id=(id)
|
|
190
|
+
if id.nil?
|
|
191
|
+
fail ArgumentError, 'id cannot be nil'
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
pattern = Regexp.new(/[A-Z0-9]{4,20}/)
|
|
195
|
+
if id !~ pattern
|
|
196
|
+
fail ArgumentError, "invalid value for \"id\", must conform to the pattern #{pattern}."
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
@id = id
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
# Custom attribute writer method with validation
|
|
203
|
+
# @param [Object] order_id Value to be assigned
|
|
204
|
+
def order_id=(order_id)
|
|
205
|
+
if order_id.nil?
|
|
206
|
+
fail ArgumentError, 'order_id cannot be nil'
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
pattern = Regexp.new(/[A-Z0-9]{4,20}/)
|
|
210
|
+
if order_id !~ pattern
|
|
211
|
+
fail ArgumentError, "invalid value for \"order_id\", must conform to the pattern #{pattern}."
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
@order_id = order_id
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
# Custom attribute writer method with validation
|
|
218
|
+
# @param [Object] campaign_id Value to be assigned
|
|
219
|
+
def campaign_id=(campaign_id)
|
|
220
|
+
pattern = Regexp.new(/[A-Z0-9]{4,20}/)
|
|
221
|
+
if !campaign_id.nil? && campaign_id !~ pattern
|
|
222
|
+
fail ArgumentError, "invalid value for \"campaign_id\", must conform to the pattern #{pattern}."
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
@campaign_id = campaign_id
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
# Custom attribute writer method with validation
|
|
229
|
+
# @param [Object] products Value to be assigned
|
|
230
|
+
def products=(products)
|
|
231
|
+
if products.nil?
|
|
232
|
+
fail ArgumentError, 'products cannot be nil'
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
if products.length < 1
|
|
236
|
+
fail ArgumentError, 'invalid value for "products", number of items must be greater than or equal to 1.'
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
@products = products
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
# Checks equality by comparing each attribute.
|
|
243
|
+
# @param [Object] Object to be compared
|
|
244
|
+
def ==(o)
|
|
245
|
+
return true if self.equal?(o)
|
|
246
|
+
self.class == o.class &&
|
|
247
|
+
id == o.id &&
|
|
248
|
+
order_id == o.order_id &&
|
|
249
|
+
created_at == o.created_at &&
|
|
250
|
+
campaign_id == o.campaign_id &&
|
|
251
|
+
products == o.products &&
|
|
252
|
+
value == o.value &&
|
|
253
|
+
recipient == o.recipient &&
|
|
254
|
+
deliver_at == o.deliver_at &&
|
|
255
|
+
custom_fields == o.custom_fields &&
|
|
256
|
+
delivery == o.delivery
|
|
257
|
+
end
|
|
258
|
+
|
|
259
|
+
# @see the `==` method
|
|
260
|
+
# @param [Object] Object to be compared
|
|
261
|
+
def eql?(o)
|
|
262
|
+
self == o
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
# Calculates hash code according to all attributes.
|
|
266
|
+
# @return [Integer] Hash code
|
|
267
|
+
def hash
|
|
268
|
+
[id, order_id, created_at, campaign_id, products, value, recipient, deliver_at, custom_fields, delivery].hash
|
|
269
|
+
end
|
|
270
|
+
|
|
271
|
+
# Builds the object from hash
|
|
272
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
273
|
+
# @return [Object] Returns the model itself
|
|
274
|
+
def self.build_from_hash(attributes)
|
|
275
|
+
return nil unless attributes.is_a?(Hash)
|
|
276
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
277
|
+
transformed_hash = {}
|
|
278
|
+
openapi_types.each_pair do |key, type|
|
|
279
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
280
|
+
transformed_hash["#{key}"] = nil
|
|
281
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
282
|
+
# check to ensure the input is an array given that the attribute
|
|
283
|
+
# is documented as an array but the input is not
|
|
284
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
285
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
286
|
+
end
|
|
287
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
288
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
289
|
+
end
|
|
290
|
+
end
|
|
291
|
+
new(transformed_hash)
|
|
292
|
+
end
|
|
293
|
+
|
|
294
|
+
# Deserializes the data based on type
|
|
295
|
+
# @param string type Data type
|
|
296
|
+
# @param string value Value to be deserialized
|
|
297
|
+
# @return [Object] Deserialized data
|
|
298
|
+
def self._deserialize(type, value)
|
|
299
|
+
case type.to_sym
|
|
300
|
+
when :Time
|
|
301
|
+
Time.parse(value)
|
|
302
|
+
when :Date
|
|
303
|
+
Date.parse(value)
|
|
304
|
+
when :String
|
|
305
|
+
value.to_s
|
|
306
|
+
when :Integer
|
|
307
|
+
value.to_i
|
|
308
|
+
when :Float
|
|
309
|
+
value.to_f
|
|
310
|
+
when :Boolean
|
|
311
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
312
|
+
true
|
|
313
|
+
else
|
|
314
|
+
false
|
|
315
|
+
end
|
|
316
|
+
when :Object
|
|
317
|
+
# generic object (usually a Hash), return directly
|
|
318
|
+
value
|
|
319
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
320
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
321
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
322
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
323
|
+
k_type = Regexp.last_match[:k_type]
|
|
324
|
+
v_type = Regexp.last_match[:v_type]
|
|
325
|
+
{}.tap do |hash|
|
|
326
|
+
value.each do |k, v|
|
|
327
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
328
|
+
end
|
|
329
|
+
end
|
|
330
|
+
else # model
|
|
331
|
+
# models (e.g. Pet) or oneOf
|
|
332
|
+
klass = Tremendous.const_get(type)
|
|
333
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
334
|
+
end
|
|
335
|
+
end
|
|
336
|
+
|
|
337
|
+
# Returns the string representation of the object
|
|
338
|
+
# @return [String] String presentation of the object
|
|
339
|
+
def to_s
|
|
340
|
+
to_hash.to_s
|
|
341
|
+
end
|
|
342
|
+
|
|
343
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
344
|
+
# @return [Hash] Returns the object in the form of hash
|
|
345
|
+
def to_body
|
|
346
|
+
to_hash
|
|
347
|
+
end
|
|
348
|
+
|
|
349
|
+
# Returns the object in the form of hash
|
|
350
|
+
# @return [Hash] Returns the object in the form of hash
|
|
351
|
+
def to_hash
|
|
352
|
+
hash = {}
|
|
353
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
354
|
+
value = self.send(attr)
|
|
355
|
+
if value.nil?
|
|
356
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
357
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
358
|
+
end
|
|
359
|
+
|
|
360
|
+
hash[param] = _to_hash(value)
|
|
361
|
+
end
|
|
362
|
+
hash
|
|
363
|
+
end
|
|
364
|
+
|
|
365
|
+
# Outputs non-array value in the form of hash
|
|
366
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
367
|
+
# @param [Object] value Any valid value
|
|
368
|
+
# @return [Hash] Returns the value in the form of hash
|
|
369
|
+
def _to_hash(value)
|
|
370
|
+
if value.is_a?(Array)
|
|
371
|
+
value.compact.map { |v| _to_hash(v) }
|
|
372
|
+
elsif value.is_a?(Hash)
|
|
373
|
+
{}.tap do |hash|
|
|
374
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
375
|
+
end
|
|
376
|
+
elsif value.respond_to? :to_hash
|
|
377
|
+
value.to_hash
|
|
378
|
+
else
|
|
379
|
+
value
|
|
380
|
+
end
|
|
381
|
+
end
|
|
382
|
+
|
|
383
|
+
end
|
|
384
|
+
|
|
385
|
+
end
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 2
|
|
7
7
|
Contact: developers@tremendous.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
|
|
9
|
+
Generator version: 7.8.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -31,12 +31,15 @@ module Tremendous
|
|
|
31
31
|
# Execution status of a given order <table> <thead> <tr> <th> Status </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <code> CANCELED </code> </td> <td> The order and all of its rewards were canceled. </td> </tr> <tr> <td> <code> CART </code> </td> <td> The order has been created, but hasn't yet been processed. </td> </tr> <tr> <td> <code> EXECUTED </code> </td> <td> The order has been executed. Payment has been handled and rewards are being delivered (if applicable). </td> </tr> <tr> <td> <code> FAILED </code> </td> <td> The order could not be processed due to an error. E.g. due to insufficient funds in the account. </td> </tr> <tr> <td> <code> PENDING APPROVAL </code> </td> <td> The order has been created but needs approval to be executed. </td> </tr> <tr> <td> <code> PENDING INTERNAL PAYMENT APPROVAL </code> </td> <td> The order has been created but it is under review and requires approval from our team. </td> </tr> </tbody> </table>
|
|
32
32
|
attr_accessor :status
|
|
33
33
|
|
|
34
|
+
# Name of the channel in which the order was created
|
|
35
|
+
attr_accessor :channel
|
|
36
|
+
|
|
34
37
|
attr_accessor :payment
|
|
35
38
|
|
|
36
39
|
# The ID for the invoice associated with this order
|
|
37
40
|
attr_accessor :invoice_id
|
|
38
41
|
|
|
39
|
-
attr_accessor :
|
|
42
|
+
attr_accessor :rewards
|
|
40
43
|
|
|
41
44
|
class EnumAttributeValidator
|
|
42
45
|
attr_reader :datatype
|
|
@@ -68,9 +71,10 @@ module Tremendous
|
|
|
68
71
|
:'campaign_id' => :'campaign_id',
|
|
69
72
|
:'created_at' => :'created_at',
|
|
70
73
|
:'status' => :'status',
|
|
74
|
+
:'channel' => :'channel',
|
|
71
75
|
:'payment' => :'payment',
|
|
72
76
|
:'invoice_id' => :'invoice_id',
|
|
73
|
-
:'
|
|
77
|
+
:'rewards' => :'rewards'
|
|
74
78
|
}
|
|
75
79
|
end
|
|
76
80
|
|
|
@@ -87,9 +91,10 @@ module Tremendous
|
|
|
87
91
|
:'campaign_id' => :'String',
|
|
88
92
|
:'created_at' => :'Time',
|
|
89
93
|
:'status' => :'String',
|
|
94
|
+
:'channel' => :'String',
|
|
90
95
|
:'payment' => :'OrderBasePayment',
|
|
91
96
|
:'invoice_id' => :'String',
|
|
92
|
-
:'
|
|
97
|
+
:'rewards' => :'Array<OrderWithoutLinkRewardsInner>'
|
|
93
98
|
}
|
|
94
99
|
end
|
|
95
100
|
|
|
@@ -142,6 +147,10 @@ module Tremendous
|
|
|
142
147
|
self.status = nil
|
|
143
148
|
end
|
|
144
149
|
|
|
150
|
+
if attributes.key?(:'channel')
|
|
151
|
+
self.channel = attributes[:'channel']
|
|
152
|
+
end
|
|
153
|
+
|
|
145
154
|
if attributes.key?(:'payment')
|
|
146
155
|
self.payment = attributes[:'payment']
|
|
147
156
|
end
|
|
@@ -150,8 +159,10 @@ module Tremendous
|
|
|
150
159
|
self.invoice_id = attributes[:'invoice_id']
|
|
151
160
|
end
|
|
152
161
|
|
|
153
|
-
if attributes.key?(:'
|
|
154
|
-
|
|
162
|
+
if attributes.key?(:'rewards')
|
|
163
|
+
if (value = attributes[:'rewards']).is_a?(Array)
|
|
164
|
+
self.rewards = value
|
|
165
|
+
end
|
|
155
166
|
end
|
|
156
167
|
end
|
|
157
168
|
|
|
@@ -196,6 +207,8 @@ module Tremendous
|
|
|
196
207
|
return false if @status.nil?
|
|
197
208
|
status_validator = EnumAttributeValidator.new('String', ["CANCELED", "CART", "EXECUTED", "FAILED", "PENDING APPROVAL", "PENDING INTERNAL PAYMENT APPROVAL"])
|
|
198
209
|
return false unless status_validator.valid?(@status)
|
|
210
|
+
channel_validator = EnumAttributeValidator.new('String', ["UI", "API", "EMBED", "DECIPHER", "QUALTRICS", "TYPEFORM", "SURVEY MONKEY"])
|
|
211
|
+
return false unless channel_validator.valid?(@channel)
|
|
199
212
|
true
|
|
200
213
|
end
|
|
201
214
|
|
|
@@ -235,6 +248,16 @@ module Tremendous
|
|
|
235
248
|
@status = status
|
|
236
249
|
end
|
|
237
250
|
|
|
251
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
252
|
+
# @param [Object] channel Object to be assigned
|
|
253
|
+
def channel=(channel)
|
|
254
|
+
validator = EnumAttributeValidator.new('String', ["UI", "API", "EMBED", "DECIPHER", "QUALTRICS", "TYPEFORM", "SURVEY MONKEY"])
|
|
255
|
+
unless validator.valid?(channel)
|
|
256
|
+
fail ArgumentError, "invalid value for \"channel\", must be one of #{validator.allowable_values}."
|
|
257
|
+
end
|
|
258
|
+
@channel = channel
|
|
259
|
+
end
|
|
260
|
+
|
|
238
261
|
# Checks equality by comparing each attribute.
|
|
239
262
|
# @param [Object] Object to be compared
|
|
240
263
|
def ==(o)
|
|
@@ -245,9 +268,10 @@ module Tremendous
|
|
|
245
268
|
campaign_id == o.campaign_id &&
|
|
246
269
|
created_at == o.created_at &&
|
|
247
270
|
status == o.status &&
|
|
271
|
+
channel == o.channel &&
|
|
248
272
|
payment == o.payment &&
|
|
249
273
|
invoice_id == o.invoice_id &&
|
|
250
|
-
|
|
274
|
+
rewards == o.rewards
|
|
251
275
|
end
|
|
252
276
|
|
|
253
277
|
# @see the `==` method
|
|
@@ -259,7 +283,7 @@ module Tremendous
|
|
|
259
283
|
# Calculates hash code according to all attributes.
|
|
260
284
|
# @return [Integer] Hash code
|
|
261
285
|
def hash
|
|
262
|
-
[id, external_id, campaign_id, created_at, status, payment, invoice_id,
|
|
286
|
+
[id, external_id, campaign_id, created_at, status, channel, payment, invoice_id, rewards].hash
|
|
263
287
|
end
|
|
264
288
|
|
|
265
289
|
# Builds the object from hash
|
data/lib/tremendous/models/{order_without_link_reward.rb → order_without_link_rewards_inner.rb}
RENAMED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 2
|
|
7
7
|
Contact: developers@tremendous.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
|
|
9
|
+
Generator version: 7.8.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -15,7 +15,7 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module Tremendous
|
|
17
17
|
# A single reward, sent to a recipient. A reward is always part of an order. Either `products` or `campaign_id` must be specified.
|
|
18
|
-
class
|
|
18
|
+
class OrderWithoutLinkRewardsInner
|
|
19
19
|
# Tremendous ID of the reward
|
|
20
20
|
attr_accessor :id
|
|
21
21
|
|
|
@@ -90,13 +90,13 @@ module Tremendous
|
|
|
90
90
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
91
91
|
def initialize(attributes = {})
|
|
92
92
|
if (!attributes.is_a?(Hash))
|
|
93
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::
|
|
93
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::OrderWithoutLinkRewardsInner` initialize method"
|
|
94
94
|
end
|
|
95
95
|
|
|
96
96
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
97
97
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
98
98
|
if (!self.class.attribute_map.key?(k.to_sym))
|
|
99
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::
|
|
99
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::OrderWithoutLinkRewardsInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
100
100
|
end
|
|
101
101
|
h[k.to_sym] = v
|
|
102
102
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 2
|
|
7
7
|
Contact: developers@tremendous.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
|
|
9
|
+
Generator version: 7.8.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -26,39 +26,13 @@ module Tremendous
|
|
|
26
26
|
|
|
27
27
|
attr_accessor :refund
|
|
28
28
|
|
|
29
|
-
# Name of the channel in which the order was created
|
|
30
|
-
attr_accessor :channel
|
|
31
|
-
|
|
32
|
-
class EnumAttributeValidator
|
|
33
|
-
attr_reader :datatype
|
|
34
|
-
attr_reader :allowable_values
|
|
35
|
-
|
|
36
|
-
def initialize(datatype, allowable_values)
|
|
37
|
-
@allowable_values = allowable_values.map do |value|
|
|
38
|
-
case datatype.to_s
|
|
39
|
-
when /Integer/i
|
|
40
|
-
value.to_i
|
|
41
|
-
when /Float/i
|
|
42
|
-
value.to_f
|
|
43
|
-
else
|
|
44
|
-
value
|
|
45
|
-
end
|
|
46
|
-
end
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
def valid?(value)
|
|
50
|
-
!value || allowable_values.include?(value)
|
|
51
|
-
end
|
|
52
|
-
end
|
|
53
|
-
|
|
54
29
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
55
30
|
def self.attribute_map
|
|
56
31
|
{
|
|
57
32
|
:'subtotal' => :'subtotal',
|
|
58
33
|
:'total' => :'total',
|
|
59
34
|
:'fees' => :'fees',
|
|
60
|
-
:'refund' => :'refund'
|
|
61
|
-
:'channel' => :'channel'
|
|
35
|
+
:'refund' => :'refund'
|
|
62
36
|
}
|
|
63
37
|
end
|
|
64
38
|
|
|
@@ -73,8 +47,7 @@ module Tremendous
|
|
|
73
47
|
:'subtotal' => :'Float',
|
|
74
48
|
:'total' => :'Float',
|
|
75
49
|
:'fees' => :'Float',
|
|
76
|
-
:'refund' => :'PaymentDetailsRefund'
|
|
77
|
-
:'channel' => :'String'
|
|
50
|
+
:'refund' => :'PaymentDetailsRefund'
|
|
78
51
|
}
|
|
79
52
|
end
|
|
80
53
|
|
|
@@ -114,10 +87,6 @@ module Tremendous
|
|
|
114
87
|
if attributes.key?(:'refund')
|
|
115
88
|
self.refund = attributes[:'refund']
|
|
116
89
|
end
|
|
117
|
-
|
|
118
|
-
if attributes.key?(:'channel')
|
|
119
|
-
self.channel = attributes[:'channel']
|
|
120
|
-
end
|
|
121
90
|
end
|
|
122
91
|
|
|
123
92
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -147,8 +116,6 @@ module Tremendous
|
|
|
147
116
|
return false if !@subtotal.nil? && @subtotal < 0
|
|
148
117
|
return false if !@total.nil? && @total < 0
|
|
149
118
|
return false if !@fees.nil? && @fees < 0
|
|
150
|
-
channel_validator = EnumAttributeValidator.new('String', ["UI", "API", "EMBED", "DECIPHER", "QUALTRICS", "TYPEFORM", "SURVEY MONKEY"])
|
|
151
|
-
return false unless channel_validator.valid?(@channel)
|
|
152
119
|
true
|
|
153
120
|
end
|
|
154
121
|
|
|
@@ -194,16 +161,6 @@ module Tremendous
|
|
|
194
161
|
@fees = fees
|
|
195
162
|
end
|
|
196
163
|
|
|
197
|
-
# Custom attribute writer method checking allowed values (enum).
|
|
198
|
-
# @param [Object] channel Object to be assigned
|
|
199
|
-
def channel=(channel)
|
|
200
|
-
validator = EnumAttributeValidator.new('String', ["UI", "API", "EMBED", "DECIPHER", "QUALTRICS", "TYPEFORM", "SURVEY MONKEY"])
|
|
201
|
-
unless validator.valid?(channel)
|
|
202
|
-
fail ArgumentError, "invalid value for \"channel\", must be one of #{validator.allowable_values}."
|
|
203
|
-
end
|
|
204
|
-
@channel = channel
|
|
205
|
-
end
|
|
206
|
-
|
|
207
164
|
# Checks equality by comparing each attribute.
|
|
208
165
|
# @param [Object] Object to be compared
|
|
209
166
|
def ==(o)
|
|
@@ -212,8 +169,7 @@ module Tremendous
|
|
|
212
169
|
subtotal == o.subtotal &&
|
|
213
170
|
total == o.total &&
|
|
214
171
|
fees == o.fees &&
|
|
215
|
-
refund == o.refund
|
|
216
|
-
channel == o.channel
|
|
172
|
+
refund == o.refund
|
|
217
173
|
end
|
|
218
174
|
|
|
219
175
|
# @see the `==` method
|
|
@@ -225,7 +181,7 @@ module Tremendous
|
|
|
225
181
|
# Calculates hash code according to all attributes.
|
|
226
182
|
# @return [Integer] Hash code
|
|
227
183
|
def hash
|
|
228
|
-
[subtotal, total, fees, refund
|
|
184
|
+
[subtotal, total, fees, refund].hash
|
|
229
185
|
end
|
|
230
186
|
|
|
231
187
|
# Builds the object from hash
|