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
|
@@ -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,6 +31,9 @@ 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
|
|
@@ -66,6 +69,7 @@ module Tremendous
|
|
|
66
69
|
:'campaign_id' => :'campaign_id',
|
|
67
70
|
:'created_at' => :'created_at',
|
|
68
71
|
:'status' => :'status',
|
|
72
|
+
:'channel' => :'channel',
|
|
69
73
|
:'payment' => :'payment',
|
|
70
74
|
:'invoice_id' => :'invoice_id'
|
|
71
75
|
}
|
|
@@ -84,6 +88,7 @@ module Tremendous
|
|
|
84
88
|
:'campaign_id' => :'String',
|
|
85
89
|
:'created_at' => :'Time',
|
|
86
90
|
:'status' => :'String',
|
|
91
|
+
:'channel' => :'String',
|
|
87
92
|
:'payment' => :'OrderBasePayment',
|
|
88
93
|
:'invoice_id' => :'String'
|
|
89
94
|
}
|
|
@@ -138,6 +143,10 @@ module Tremendous
|
|
|
138
143
|
self.status = nil
|
|
139
144
|
end
|
|
140
145
|
|
|
146
|
+
if attributes.key?(:'channel')
|
|
147
|
+
self.channel = attributes[:'channel']
|
|
148
|
+
end
|
|
149
|
+
|
|
141
150
|
if attributes.key?(:'payment')
|
|
142
151
|
self.payment = attributes[:'payment']
|
|
143
152
|
end
|
|
@@ -188,6 +197,8 @@ module Tremendous
|
|
|
188
197
|
return false if @status.nil?
|
|
189
198
|
status_validator = EnumAttributeValidator.new('String', ["CANCELED", "CART", "EXECUTED", "FAILED", "PENDING APPROVAL", "PENDING INTERNAL PAYMENT APPROVAL"])
|
|
190
199
|
return false unless status_validator.valid?(@status)
|
|
200
|
+
channel_validator = EnumAttributeValidator.new('String', ["UI", "API", "EMBED", "DECIPHER", "QUALTRICS", "TYPEFORM", "SURVEY MONKEY"])
|
|
201
|
+
return false unless channel_validator.valid?(@channel)
|
|
191
202
|
true
|
|
192
203
|
end
|
|
193
204
|
|
|
@@ -227,6 +238,16 @@ module Tremendous
|
|
|
227
238
|
@status = status
|
|
228
239
|
end
|
|
229
240
|
|
|
241
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
242
|
+
# @param [Object] channel Object to be assigned
|
|
243
|
+
def channel=(channel)
|
|
244
|
+
validator = EnumAttributeValidator.new('String', ["UI", "API", "EMBED", "DECIPHER", "QUALTRICS", "TYPEFORM", "SURVEY MONKEY"])
|
|
245
|
+
unless validator.valid?(channel)
|
|
246
|
+
fail ArgumentError, "invalid value for \"channel\", must be one of #{validator.allowable_values}."
|
|
247
|
+
end
|
|
248
|
+
@channel = channel
|
|
249
|
+
end
|
|
250
|
+
|
|
230
251
|
# Checks equality by comparing each attribute.
|
|
231
252
|
# @param [Object] Object to be compared
|
|
232
253
|
def ==(o)
|
|
@@ -237,6 +258,7 @@ module Tremendous
|
|
|
237
258
|
campaign_id == o.campaign_id &&
|
|
238
259
|
created_at == o.created_at &&
|
|
239
260
|
status == o.status &&
|
|
261
|
+
channel == o.channel &&
|
|
240
262
|
payment == o.payment &&
|
|
241
263
|
invoice_id == o.invoice_id
|
|
242
264
|
end
|
|
@@ -250,7 +272,7 @@ module Tremendous
|
|
|
250
272
|
# Calculates hash code according to all attributes.
|
|
251
273
|
# @return [Integer] Hash code
|
|
252
274
|
def hash
|
|
253
|
-
[id, external_id, campaign_id, created_at, status, payment, invoice_id].hash
|
|
275
|
+
[id, external_id, campaign_id, created_at, status, channel, payment, invoice_id].hash
|
|
254
276
|
end
|
|
255
277
|
|
|
256
278
|
# Builds the object from hash
|
|
@@ -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
|
|
|
@@ -27,39 +27,13 @@ module Tremendous
|
|
|
27
27
|
|
|
28
28
|
attr_accessor :refund
|
|
29
29
|
|
|
30
|
-
# Name of the channel in which the order was created
|
|
31
|
-
attr_accessor :channel
|
|
32
|
-
|
|
33
|
-
class EnumAttributeValidator
|
|
34
|
-
attr_reader :datatype
|
|
35
|
-
attr_reader :allowable_values
|
|
36
|
-
|
|
37
|
-
def initialize(datatype, allowable_values)
|
|
38
|
-
@allowable_values = allowable_values.map do |value|
|
|
39
|
-
case datatype.to_s
|
|
40
|
-
when /Integer/i
|
|
41
|
-
value.to_i
|
|
42
|
-
when /Float/i
|
|
43
|
-
value.to_f
|
|
44
|
-
else
|
|
45
|
-
value
|
|
46
|
-
end
|
|
47
|
-
end
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
def valid?(value)
|
|
51
|
-
!value || allowable_values.include?(value)
|
|
52
|
-
end
|
|
53
|
-
end
|
|
54
|
-
|
|
55
30
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
56
31
|
def self.attribute_map
|
|
57
32
|
{
|
|
58
33
|
:'subtotal' => :'subtotal',
|
|
59
34
|
:'total' => :'total',
|
|
60
35
|
:'fees' => :'fees',
|
|
61
|
-
:'refund' => :'refund'
|
|
62
|
-
:'channel' => :'channel'
|
|
36
|
+
:'refund' => :'refund'
|
|
63
37
|
}
|
|
64
38
|
end
|
|
65
39
|
|
|
@@ -74,8 +48,7 @@ module Tremendous
|
|
|
74
48
|
:'subtotal' => :'Float',
|
|
75
49
|
:'total' => :'Float',
|
|
76
50
|
:'fees' => :'Float',
|
|
77
|
-
:'refund' => :'PaymentDetailsRefund'
|
|
78
|
-
:'channel' => :'String'
|
|
51
|
+
:'refund' => :'PaymentDetailsRefund'
|
|
79
52
|
}
|
|
80
53
|
end
|
|
81
54
|
|
|
@@ -115,10 +88,6 @@ module Tremendous
|
|
|
115
88
|
if attributes.key?(:'refund')
|
|
116
89
|
self.refund = attributes[:'refund']
|
|
117
90
|
end
|
|
118
|
-
|
|
119
|
-
if attributes.key?(:'channel')
|
|
120
|
-
self.channel = attributes[:'channel']
|
|
121
|
-
end
|
|
122
91
|
end
|
|
123
92
|
|
|
124
93
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -148,8 +117,6 @@ module Tremendous
|
|
|
148
117
|
return false if !@subtotal.nil? && @subtotal < 0
|
|
149
118
|
return false if !@total.nil? && @total < 0
|
|
150
119
|
return false if !@fees.nil? && @fees < 0
|
|
151
|
-
channel_validator = EnumAttributeValidator.new('String', ["UI", "API", "EMBED", "DECIPHER", "QUALTRICS", "TYPEFORM", "SURVEY MONKEY"])
|
|
152
|
-
return false unless channel_validator.valid?(@channel)
|
|
153
120
|
true
|
|
154
121
|
end
|
|
155
122
|
|
|
@@ -195,16 +162,6 @@ module Tremendous
|
|
|
195
162
|
@fees = fees
|
|
196
163
|
end
|
|
197
164
|
|
|
198
|
-
# Custom attribute writer method checking allowed values (enum).
|
|
199
|
-
# @param [Object] channel Object to be assigned
|
|
200
|
-
def channel=(channel)
|
|
201
|
-
validator = EnumAttributeValidator.new('String', ["UI", "API", "EMBED", "DECIPHER", "QUALTRICS", "TYPEFORM", "SURVEY MONKEY"])
|
|
202
|
-
unless validator.valid?(channel)
|
|
203
|
-
fail ArgumentError, "invalid value for \"channel\", must be one of #{validator.allowable_values}."
|
|
204
|
-
end
|
|
205
|
-
@channel = channel
|
|
206
|
-
end
|
|
207
|
-
|
|
208
165
|
# Checks equality by comparing each attribute.
|
|
209
166
|
# @param [Object] Object to be compared
|
|
210
167
|
def ==(o)
|
|
@@ -213,8 +170,7 @@ module Tremendous
|
|
|
213
170
|
subtotal == o.subtotal &&
|
|
214
171
|
total == o.total &&
|
|
215
172
|
fees == o.fees &&
|
|
216
|
-
refund == o.refund
|
|
217
|
-
channel == o.channel
|
|
173
|
+
refund == o.refund
|
|
218
174
|
end
|
|
219
175
|
|
|
220
176
|
# @see the `==` method
|
|
@@ -226,7 +182,7 @@ module Tremendous
|
|
|
226
182
|
# Calculates hash code according to all attributes.
|
|
227
183
|
# @return [Integer] Hash code
|
|
228
184
|
def hash
|
|
229
|
-
[subtotal, total, fees, refund
|
|
185
|
+
[subtotal, total, fees, refund].hash
|
|
230
186
|
end
|
|
231
187
|
|
|
232
188
|
# Builds the object from hash
|
|
@@ -0,0 +1,403 @@
|
|
|
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
|
+
# An order wraps around the fulfilment of one or more rewards.
|
|
18
|
+
class OrderWithLink
|
|
19
|
+
# Tremendous ID of the order
|
|
20
|
+
attr_accessor :id
|
|
21
|
+
|
|
22
|
+
# 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.
|
|
23
|
+
attr_accessor :external_id
|
|
24
|
+
|
|
25
|
+
# ID of the campaign in your account, that defines the available products (different gift cards, charity, etc.) that the recipient can choose from.
|
|
26
|
+
attr_accessor :campaign_id
|
|
27
|
+
|
|
28
|
+
# Date the order has been created
|
|
29
|
+
attr_accessor :created_at
|
|
30
|
+
|
|
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
|
+
attr_accessor :status
|
|
33
|
+
|
|
34
|
+
# Name of the channel in which the order was created
|
|
35
|
+
attr_accessor :channel
|
|
36
|
+
|
|
37
|
+
attr_accessor :payment
|
|
38
|
+
|
|
39
|
+
# The ID for the invoice associated with this order
|
|
40
|
+
attr_accessor :invoice_id
|
|
41
|
+
|
|
42
|
+
attr_accessor :rewards
|
|
43
|
+
|
|
44
|
+
class EnumAttributeValidator
|
|
45
|
+
attr_reader :datatype
|
|
46
|
+
attr_reader :allowable_values
|
|
47
|
+
|
|
48
|
+
def initialize(datatype, allowable_values)
|
|
49
|
+
@allowable_values = allowable_values.map do |value|
|
|
50
|
+
case datatype.to_s
|
|
51
|
+
when /Integer/i
|
|
52
|
+
value.to_i
|
|
53
|
+
when /Float/i
|
|
54
|
+
value.to_f
|
|
55
|
+
else
|
|
56
|
+
value
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
def valid?(value)
|
|
62
|
+
!value || allowable_values.include?(value)
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
67
|
+
def self.attribute_map
|
|
68
|
+
{
|
|
69
|
+
:'id' => :'id',
|
|
70
|
+
:'external_id' => :'external_id',
|
|
71
|
+
:'campaign_id' => :'campaign_id',
|
|
72
|
+
:'created_at' => :'created_at',
|
|
73
|
+
:'status' => :'status',
|
|
74
|
+
:'channel' => :'channel',
|
|
75
|
+
:'payment' => :'payment',
|
|
76
|
+
:'invoice_id' => :'invoice_id',
|
|
77
|
+
:'rewards' => :'rewards'
|
|
78
|
+
}
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# Returns all the JSON keys this model knows about
|
|
82
|
+
def self.acceptable_attributes
|
|
83
|
+
attribute_map.values
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# Attribute type mapping.
|
|
87
|
+
def self.openapi_types
|
|
88
|
+
{
|
|
89
|
+
:'id' => :'String',
|
|
90
|
+
:'external_id' => :'String',
|
|
91
|
+
:'campaign_id' => :'String',
|
|
92
|
+
:'created_at' => :'Time',
|
|
93
|
+
:'status' => :'String',
|
|
94
|
+
:'channel' => :'String',
|
|
95
|
+
:'payment' => :'OrderBasePayment',
|
|
96
|
+
:'invoice_id' => :'String',
|
|
97
|
+
:'rewards' => :'Array<OrderWithLinkRewardsInner>'
|
|
98
|
+
}
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# List of attributes with nullable: true
|
|
102
|
+
def self.openapi_nullable
|
|
103
|
+
Set.new([
|
|
104
|
+
:'external_id',
|
|
105
|
+
:'campaign_id',
|
|
106
|
+
])
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Initializes the object
|
|
110
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
111
|
+
def initialize(attributes = {})
|
|
112
|
+
if (!attributes.is_a?(Hash))
|
|
113
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::OrderWithLink` initialize method"
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
117
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
118
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
119
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::OrderWithLink`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
120
|
+
end
|
|
121
|
+
h[k.to_sym] = v
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
if attributes.key?(:'id')
|
|
125
|
+
self.id = attributes[:'id']
|
|
126
|
+
else
|
|
127
|
+
self.id = nil
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
if attributes.key?(:'external_id')
|
|
131
|
+
self.external_id = attributes[:'external_id']
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
if attributes.key?(:'campaign_id')
|
|
135
|
+
self.campaign_id = attributes[:'campaign_id']
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
if attributes.key?(:'created_at')
|
|
139
|
+
self.created_at = attributes[:'created_at']
|
|
140
|
+
else
|
|
141
|
+
self.created_at = nil
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
if attributes.key?(:'status')
|
|
145
|
+
self.status = attributes[:'status']
|
|
146
|
+
else
|
|
147
|
+
self.status = nil
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
if attributes.key?(:'channel')
|
|
151
|
+
self.channel = attributes[:'channel']
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
if attributes.key?(:'payment')
|
|
155
|
+
self.payment = attributes[:'payment']
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
if attributes.key?(:'invoice_id')
|
|
159
|
+
self.invoice_id = attributes[:'invoice_id']
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
if attributes.key?(:'rewards')
|
|
163
|
+
if (value = attributes[:'rewards']).is_a?(Array)
|
|
164
|
+
self.rewards = value
|
|
165
|
+
end
|
|
166
|
+
end
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
170
|
+
# @return Array for valid properties with the reasons
|
|
171
|
+
def list_invalid_properties
|
|
172
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
173
|
+
invalid_properties = Array.new
|
|
174
|
+
if @id.nil?
|
|
175
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
pattern = Regexp.new(/[A-Z0-9]{4,20}/)
|
|
179
|
+
if @id !~ pattern
|
|
180
|
+
invalid_properties.push("invalid value for \"id\", must conform to the pattern #{pattern}.")
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
pattern = Regexp.new(/[A-Z0-9]{4,20}/)
|
|
184
|
+
if !@campaign_id.nil? && @campaign_id !~ pattern
|
|
185
|
+
invalid_properties.push("invalid value for \"campaign_id\", must conform to the pattern #{pattern}.")
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
if @created_at.nil?
|
|
189
|
+
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
if @status.nil?
|
|
193
|
+
invalid_properties.push('invalid value for "status", status cannot be nil.')
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
invalid_properties
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
# Check to see if the all the properties in the model are valid
|
|
200
|
+
# @return true if the model is valid
|
|
201
|
+
def valid?
|
|
202
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
203
|
+
return false if @id.nil?
|
|
204
|
+
return false if @id !~ Regexp.new(/[A-Z0-9]{4,20}/)
|
|
205
|
+
return false if !@campaign_id.nil? && @campaign_id !~ Regexp.new(/[A-Z0-9]{4,20}/)
|
|
206
|
+
return false if @created_at.nil?
|
|
207
|
+
return false if @status.nil?
|
|
208
|
+
status_validator = EnumAttributeValidator.new('String', ["CANCELED", "CART", "EXECUTED", "FAILED", "PENDING APPROVAL", "PENDING INTERNAL PAYMENT APPROVAL"])
|
|
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)
|
|
212
|
+
true
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
# Custom attribute writer method with validation
|
|
216
|
+
# @param [Object] id Value to be assigned
|
|
217
|
+
def id=(id)
|
|
218
|
+
if id.nil?
|
|
219
|
+
fail ArgumentError, 'id cannot be nil'
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
pattern = Regexp.new(/[A-Z0-9]{4,20}/)
|
|
223
|
+
if id !~ pattern
|
|
224
|
+
fail ArgumentError, "invalid value for \"id\", must conform to the pattern #{pattern}."
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
@id = id
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
# Custom attribute writer method with validation
|
|
231
|
+
# @param [Object] campaign_id Value to be assigned
|
|
232
|
+
def campaign_id=(campaign_id)
|
|
233
|
+
pattern = Regexp.new(/[A-Z0-9]{4,20}/)
|
|
234
|
+
if !campaign_id.nil? && campaign_id !~ pattern
|
|
235
|
+
fail ArgumentError, "invalid value for \"campaign_id\", must conform to the pattern #{pattern}."
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
@campaign_id = campaign_id
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
242
|
+
# @param [Object] status Object to be assigned
|
|
243
|
+
def status=(status)
|
|
244
|
+
validator = EnumAttributeValidator.new('String', ["CANCELED", "CART", "EXECUTED", "FAILED", "PENDING APPROVAL", "PENDING INTERNAL PAYMENT APPROVAL"])
|
|
245
|
+
unless validator.valid?(status)
|
|
246
|
+
fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
|
|
247
|
+
end
|
|
248
|
+
@status = status
|
|
249
|
+
end
|
|
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
|
+
|
|
261
|
+
# Checks equality by comparing each attribute.
|
|
262
|
+
# @param [Object] Object to be compared
|
|
263
|
+
def ==(o)
|
|
264
|
+
return true if self.equal?(o)
|
|
265
|
+
self.class == o.class &&
|
|
266
|
+
id == o.id &&
|
|
267
|
+
external_id == o.external_id &&
|
|
268
|
+
campaign_id == o.campaign_id &&
|
|
269
|
+
created_at == o.created_at &&
|
|
270
|
+
status == o.status &&
|
|
271
|
+
channel == o.channel &&
|
|
272
|
+
payment == o.payment &&
|
|
273
|
+
invoice_id == o.invoice_id &&
|
|
274
|
+
rewards == o.rewards
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
# @see the `==` method
|
|
278
|
+
# @param [Object] Object to be compared
|
|
279
|
+
def eql?(o)
|
|
280
|
+
self == o
|
|
281
|
+
end
|
|
282
|
+
|
|
283
|
+
# Calculates hash code according to all attributes.
|
|
284
|
+
# @return [Integer] Hash code
|
|
285
|
+
def hash
|
|
286
|
+
[id, external_id, campaign_id, created_at, status, channel, payment, invoice_id, rewards].hash
|
|
287
|
+
end
|
|
288
|
+
|
|
289
|
+
# Builds the object from hash
|
|
290
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
291
|
+
# @return [Object] Returns the model itself
|
|
292
|
+
def self.build_from_hash(attributes)
|
|
293
|
+
return nil unless attributes.is_a?(Hash)
|
|
294
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
295
|
+
transformed_hash = {}
|
|
296
|
+
openapi_types.each_pair do |key, type|
|
|
297
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
298
|
+
transformed_hash["#{key}"] = nil
|
|
299
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
300
|
+
# check to ensure the input is an array given that the attribute
|
|
301
|
+
# is documented as an array but the input is not
|
|
302
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
303
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
304
|
+
end
|
|
305
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
306
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
307
|
+
end
|
|
308
|
+
end
|
|
309
|
+
new(transformed_hash)
|
|
310
|
+
end
|
|
311
|
+
|
|
312
|
+
# Deserializes the data based on type
|
|
313
|
+
# @param string type Data type
|
|
314
|
+
# @param string value Value to be deserialized
|
|
315
|
+
# @return [Object] Deserialized data
|
|
316
|
+
def self._deserialize(type, value)
|
|
317
|
+
case type.to_sym
|
|
318
|
+
when :Time
|
|
319
|
+
Time.parse(value)
|
|
320
|
+
when :Date
|
|
321
|
+
Date.parse(value)
|
|
322
|
+
when :String
|
|
323
|
+
value.to_s
|
|
324
|
+
when :Integer
|
|
325
|
+
value.to_i
|
|
326
|
+
when :Float
|
|
327
|
+
value.to_f
|
|
328
|
+
when :Boolean
|
|
329
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
330
|
+
true
|
|
331
|
+
else
|
|
332
|
+
false
|
|
333
|
+
end
|
|
334
|
+
when :Object
|
|
335
|
+
# generic object (usually a Hash), return directly
|
|
336
|
+
value
|
|
337
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
338
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
339
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
340
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
341
|
+
k_type = Regexp.last_match[:k_type]
|
|
342
|
+
v_type = Regexp.last_match[:v_type]
|
|
343
|
+
{}.tap do |hash|
|
|
344
|
+
value.each do |k, v|
|
|
345
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
346
|
+
end
|
|
347
|
+
end
|
|
348
|
+
else # model
|
|
349
|
+
# models (e.g. Pet) or oneOf
|
|
350
|
+
klass = Tremendous.const_get(type)
|
|
351
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
352
|
+
end
|
|
353
|
+
end
|
|
354
|
+
|
|
355
|
+
# Returns the string representation of the object
|
|
356
|
+
# @return [String] String presentation of the object
|
|
357
|
+
def to_s
|
|
358
|
+
to_hash.to_s
|
|
359
|
+
end
|
|
360
|
+
|
|
361
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
362
|
+
# @return [Hash] Returns the object in the form of hash
|
|
363
|
+
def to_body
|
|
364
|
+
to_hash
|
|
365
|
+
end
|
|
366
|
+
|
|
367
|
+
# Returns the object in the form of hash
|
|
368
|
+
# @return [Hash] Returns the object in the form of hash
|
|
369
|
+
def to_hash
|
|
370
|
+
hash = {}
|
|
371
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
372
|
+
value = self.send(attr)
|
|
373
|
+
if value.nil?
|
|
374
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
375
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
376
|
+
end
|
|
377
|
+
|
|
378
|
+
hash[param] = _to_hash(value)
|
|
379
|
+
end
|
|
380
|
+
hash
|
|
381
|
+
end
|
|
382
|
+
|
|
383
|
+
# Outputs non-array value in the form of hash
|
|
384
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
385
|
+
# @param [Object] value Any valid value
|
|
386
|
+
# @return [Hash] Returns the value in the form of hash
|
|
387
|
+
def _to_hash(value)
|
|
388
|
+
if value.is_a?(Array)
|
|
389
|
+
value.compact.map { |v| _to_hash(v) }
|
|
390
|
+
elsif value.is_a?(Hash)
|
|
391
|
+
{}.tap do |hash|
|
|
392
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
393
|
+
end
|
|
394
|
+
elsif value.respond_to? :to_hash
|
|
395
|
+
value.to_hash
|
|
396
|
+
else
|
|
397
|
+
value
|
|
398
|
+
end
|
|
399
|
+
end
|
|
400
|
+
|
|
401
|
+
end
|
|
402
|
+
|
|
403
|
+
end
|