tremendous_ruby 5.3.0 → 5.5.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 +618 -56
- 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 +225 -0
- data/lib/tremendous/models/allow_email1.rb +225 -0
- data/lib/tremendous/models/allow_ip.rb +225 -0
- data/lib/tremendous/models/allow_ip1.rb +225 -0
- data/lib/tremendous/models/balance_transaction.rb +37 -2
- data/lib/tremendous/models/base_order_for_create.rb +232 -0
- 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_invoice.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_order_request.rb +74 -218
- data/lib/tremendous/models/create_organization.rb +1 -1
- data/lib/tremendous/models/create_organization200_response.rb +1 -1
- data/lib/tremendous/models/create_organization200_response_organization.rb +1 -1
- data/lib/tremendous/models/create_organization_request.rb +1 -1
- data/lib/tremendous/models/create_organization_request_copy_settings.rb +1 -1
- data/lib/tremendous/models/create_public_key.rb +1 -1
- data/lib/tremendous/models/create_public_key200_response.rb +1 -1
- data/lib/tremendous/models/create_public_key_request.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 +222 -0
- data/lib/tremendous/models/delivery_details.rb +1 -1
- 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 +1 -1
- data/lib/tremendous/models/field.rb +1 -1
- data/lib/tremendous/models/fraud_config_allow_email.rb +224 -0
- data/lib/tremendous/models/fraud_config_country.rb +275 -0
- data/lib/tremendous/models/fraud_config_country_update_list.rb +224 -0
- data/lib/tremendous/models/fraud_config_ip.rb +224 -0
- data/lib/tremendous/models/fraud_config_redeemed_rewards_amount.rb +292 -0
- data/lib/tremendous/models/fraud_config_redeemed_rewards_count.rb +292 -0
- data/lib/tremendous/models/fraud_config_review_email.rb +229 -0
- data/lib/tremendous/models/fraud_generic_response.rb +222 -0
- data/lib/tremendous/models/fraud_review.rb +351 -0
- data/lib/tremendous/models/fraud_review_geo.rb +235 -0
- data/lib/tremendous/models/{reward_with_link_delivery.rb → fraud_review_list_item.rb} +27 -52
- data/lib/tremendous/models/fraud_review_reason.rb +58 -0
- data/lib/tremendous/models/fraud_review_redemption_method.rb +44 -0
- data/lib/tremendous/models/fraud_review_related_rewards.rb +304 -0
- data/lib/tremendous/models/fraud_review_status.rb +41 -0
- data/lib/tremendous/models/fraud_rule200_response.rb +222 -0
- data/lib/tremendous/models/fraud_rule400_response.rb +221 -0
- data/lib/tremendous/models/fraud_rule422_response.rb +221 -0
- data/lib/tremendous/models/fraud_rule_request.rb +214 -0
- data/lib/tremendous/models/fraud_rule_request_config.rb +110 -0
- data/lib/tremendous/models/fraud_rule_type.rb +49 -0
- data/lib/tremendous/models/fraud_rules_list_item.rb +261 -0
- 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 +1 -1
- 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 +221 -0
- data/lib/tremendous/models/get_fraud_review200_response_fraud_review.rb +351 -0
- data/lib/tremendous/models/get_fraud_review200_response_fraud_review_geo.rb +236 -0
- data/lib/tremendous/models/get_fraud_review200_response_fraud_review_related_rewards.rb +305 -0
- 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 +1 -1
- 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 +3 -1
- data/lib/tremendous/models/list_campaigns200_response_campaigns_inner_webpage_style.rb +2 -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 +223 -0
- data/lib/tremendous/models/{delivery_details_with_link.rb → list_fraud_reviews200_response_fraud_reviews_inner.rb} +27 -52
- data/lib/tremendous/models/list_fraud_rules200_response.rb +223 -0
- data/lib/tremendous/models/{create_order200_response_order_rewards_inner_delivery.rb → list_fraud_rules200_response_fraud_rules_inner.rb} +29 -64
- 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 +1 -1
- 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 +1 -1
- 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 -22
- 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 -1
- data/lib/tremendous/models/list_rewards200_response_rewards_inner_recipient.rb +1 -1
- data/lib/tremendous/models/list_rewards200_response_rewards_inner_value.rb +2 -7
- data/lib/tremendous/models/list_rewards401_response.rb +1 -1
- data/lib/tremendous/models/list_rewards401_response_errors.rb +1 -1
- data/lib/tremendous/models/list_rewards429_response.rb +1 -1
- 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 +1 -1
- data/lib/tremendous/models/order_status.rb +1 -1
- 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 -25
- data/lib/tremendous/models/organization.rb +1 -1
- data/lib/tremendous/models/payment_details.rb +1 -1
- data/lib/tremendous/models/payment_details_refund.rb +1 -1
- data/lib/tremendous/models/product.rb +1 -1
- data/lib/tremendous/models/public_key.rb +2 -2
- data/lib/tremendous/models/public_keys_response.rb +1 -1
- data/lib/tremendous/models/public_keys_response_public_keys_inner.rb +2 -2
- 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 +1 -1
- data/lib/tremendous/models/review_country.rb +276 -0
- data/lib/tremendous/models/review_country1.rb +225 -0
- data/lib/tremendous/models/review_email.rb +230 -0
- data/lib/tremendous/models/review_email1.rb +230 -0
- data/lib/tremendous/models/review_ip.rb +225 -0
- data/lib/tremendous/models/review_ip1.rb +225 -0
- data/lib/tremendous/models/review_redeemed_rewards_amount.rb +293 -0
- data/lib/tremendous/models/review_redeemed_rewards_count.rb +293 -0
- data/lib/tremendous/models/reward.rb +1 -22
- data/lib/tremendous/models/reward_base.rb +1 -22
- data/lib/tremendous/models/reward_base_custom_fields_inner.rb +1 -1
- data/lib/tremendous/models/reward_for_order_create.rb +2 -23
- 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 +2 -7
- data/lib/tremendous/models/reward_without_link.rb +1 -22
- data/lib/tremendous/models/reward_without_link_delivery.rb +1 -1
- data/lib/tremendous/models/role.rb +1 -1
- data/lib/tremendous/models/simulate_webhook_request.rb +1 -1
- data/lib/tremendous/models/{order_for_create.rb → single_reward_order.rb} +7 -13
- data/lib/tremendous/models/single_reward_order1.rb +242 -0
- data/lib/tremendous/models/{create_order_request_payment.rb → single_reward_order1_payment.rb} +4 -4
- data/lib/tremendous/models/{create_order_request_reward.rb → single_reward_order1_reward.rb} +6 -27
- data/lib/tremendous/models/{create_order_request_reward_custom_fields_inner.rb → single_reward_order1_reward_custom_fields_inner.rb} +4 -4
- data/lib/tremendous/models/{create_order_request_reward_delivery.rb → single_reward_order1_reward_delivery.rb} +4 -4
- data/lib/tremendous/models/{order_for_create_reward.rb → single_reward_order_reward.rb} +5 -26
- data/lib/tremendous/models/{create_order201_response.rb → single_reward_order_without_link.rb} +5 -5
- data/lib/tremendous/models/{order_with_link.rb → single_reward_order_without_link_order.rb} +25 -22
- data/lib/tremendous/models/test_public_key.rb +1 -1
- data/lib/tremendous/models/test_public_key_request.rb +1 -1
- 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 +222 -0
- data/lib/tremendous/models/update_fraud_rule_list_request.rb +272 -0
- data/lib/tremendous/models/update_fraud_rule_list_request_config.rb +108 -0
- 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 +60 -18
- metadata +62 -20
- data/lib/tremendous/models/create_order200_response_order.rb +0 -400
- data/lib/tremendous/models/create_order200_response_order_rewards_inner.rb +0 -347
- data/lib/tremendous/models/order_with_link_rewards_inner.rb +0 -406
- data/lib/tremendous/models/reward_with_link.rb +0 -406
|
@@ -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
|
# An order wraps around the fulfilment of one or more rewards.
|
|
18
|
-
class
|
|
18
|
+
class SingleRewardOrderWithoutLinkOrder
|
|
19
19
|
# Tremendous ID of the order
|
|
20
20
|
attr_accessor :id
|
|
21
21
|
|
|
@@ -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
|
|
@@ -68,6 +71,7 @@ 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'
|
|
@@ -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
|
-
:'rewards' => :'Array<
|
|
97
|
+
:'rewards' => :'Array<OrderWithoutLinkRewardsInner>'
|
|
93
98
|
}
|
|
94
99
|
end
|
|
95
100
|
|
|
@@ -105,13 +110,13 @@ module Tremendous
|
|
|
105
110
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
106
111
|
def initialize(attributes = {})
|
|
107
112
|
if (!attributes.is_a?(Hash))
|
|
108
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::
|
|
113
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::SingleRewardOrderWithoutLinkOrder` initialize method"
|
|
109
114
|
end
|
|
110
115
|
|
|
111
116
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
112
117
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
113
118
|
if (!self.class.attribute_map.key?(k.to_sym))
|
|
114
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::
|
|
119
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::SingleRewardOrderWithoutLinkOrder`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
115
120
|
end
|
|
116
121
|
h[k.to_sym] = v
|
|
117
122
|
}
|
|
@@ -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
|
|
@@ -184,10 +193,6 @@ module Tremendous
|
|
|
184
193
|
invalid_properties.push('invalid value for "status", status cannot be nil.')
|
|
185
194
|
end
|
|
186
195
|
|
|
187
|
-
if !@rewards.nil? && @rewards.length < 1
|
|
188
|
-
invalid_properties.push('invalid value for "rewards", number of items must be greater than or equal to 1.')
|
|
189
|
-
end
|
|
190
|
-
|
|
191
196
|
invalid_properties
|
|
192
197
|
end
|
|
193
198
|
|
|
@@ -202,7 +207,8 @@ module Tremendous
|
|
|
202
207
|
return false if @status.nil?
|
|
203
208
|
status_validator = EnumAttributeValidator.new('String', ["CANCELED", "CART", "EXECUTED", "FAILED", "PENDING APPROVAL", "PENDING INTERNAL PAYMENT APPROVAL"])
|
|
204
209
|
return false unless status_validator.valid?(@status)
|
|
205
|
-
|
|
210
|
+
channel_validator = EnumAttributeValidator.new('String', ["UI", "API", "EMBED", "DECIPHER", "QUALTRICS", "TYPEFORM", "SURVEY MONKEY"])
|
|
211
|
+
return false unless channel_validator.valid?(@channel)
|
|
206
212
|
true
|
|
207
213
|
end
|
|
208
214
|
|
|
@@ -242,18 +248,14 @@ module Tremendous
|
|
|
242
248
|
@status = status
|
|
243
249
|
end
|
|
244
250
|
|
|
245
|
-
# Custom attribute writer method
|
|
246
|
-
# @param [Object]
|
|
247
|
-
def
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
if rewards.length < 1
|
|
253
|
-
fail ArgumentError, 'invalid value for "rewards", number of items must be greater than or equal to 1.'
|
|
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}."
|
|
254
257
|
end
|
|
255
|
-
|
|
256
|
-
@rewards = rewards
|
|
258
|
+
@channel = channel
|
|
257
259
|
end
|
|
258
260
|
|
|
259
261
|
# Checks equality by comparing each attribute.
|
|
@@ -266,6 +268,7 @@ module Tremendous
|
|
|
266
268
|
campaign_id == o.campaign_id &&
|
|
267
269
|
created_at == o.created_at &&
|
|
268
270
|
status == o.status &&
|
|
271
|
+
channel == o.channel &&
|
|
269
272
|
payment == o.payment &&
|
|
270
273
|
invoice_id == o.invoice_id &&
|
|
271
274
|
rewards == o.rewards
|
|
@@ -280,7 +283,7 @@ module Tremendous
|
|
|
280
283
|
# Calculates hash code according to all attributes.
|
|
281
284
|
# @return [Integer] Hash code
|
|
282
285
|
def hash
|
|
283
|
-
[id, external_id, campaign_id, created_at, status, payment, invoice_id, rewards].hash
|
|
286
|
+
[id, external_id, campaign_id, created_at, status, channel, payment, invoice_id, rewards].hash
|
|
284
287
|
end
|
|
285
288
|
|
|
286
289
|
# Builds the object from hash
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#API Endpoints
|
|
3
|
+
|
|
4
|
+
#Deliver monetary rewards and incentives to employees, customers, survey participants, and more through the Tremendous API. For organizational tasks, like managing your organization and it's members within Tremendous, please see the Tremendous Organizational API.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 2
|
|
7
|
+
Contact: developers@tremendous.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.8.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Tremendous
|
|
17
|
+
class UpdateFraudRuleList200Response
|
|
18
|
+
# A description of the result
|
|
19
|
+
attr_accessor :message
|
|
20
|
+
|
|
21
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
22
|
+
def self.attribute_map
|
|
23
|
+
{
|
|
24
|
+
:'message' => :'message'
|
|
25
|
+
}
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Returns all the JSON keys this model knows about
|
|
29
|
+
def self.acceptable_attributes
|
|
30
|
+
attribute_map.values
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Attribute type mapping.
|
|
34
|
+
def self.openapi_types
|
|
35
|
+
{
|
|
36
|
+
:'message' => :'String'
|
|
37
|
+
}
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# List of attributes with nullable: true
|
|
41
|
+
def self.openapi_nullable
|
|
42
|
+
Set.new([
|
|
43
|
+
])
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Initializes the object
|
|
47
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
48
|
+
def initialize(attributes = {})
|
|
49
|
+
if (!attributes.is_a?(Hash))
|
|
50
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::UpdateFraudRuleList200Response` initialize method"
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
54
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
55
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
56
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::UpdateFraudRuleList200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
57
|
+
end
|
|
58
|
+
h[k.to_sym] = v
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if attributes.key?(:'message')
|
|
62
|
+
self.message = attributes[:'message']
|
|
63
|
+
else
|
|
64
|
+
self.message = nil
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
69
|
+
# @return Array for valid properties with the reasons
|
|
70
|
+
def list_invalid_properties
|
|
71
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
72
|
+
invalid_properties = Array.new
|
|
73
|
+
if @message.nil?
|
|
74
|
+
invalid_properties.push('invalid value for "message", message cannot be nil.')
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
invalid_properties
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# Check to see if the all the properties in the model are valid
|
|
81
|
+
# @return true if the model is valid
|
|
82
|
+
def valid?
|
|
83
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
84
|
+
return false if @message.nil?
|
|
85
|
+
true
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Checks equality by comparing each attribute.
|
|
89
|
+
# @param [Object] Object to be compared
|
|
90
|
+
def ==(o)
|
|
91
|
+
return true if self.equal?(o)
|
|
92
|
+
self.class == o.class &&
|
|
93
|
+
message == o.message
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# @see the `==` method
|
|
97
|
+
# @param [Object] Object to be compared
|
|
98
|
+
def eql?(o)
|
|
99
|
+
self == o
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# Calculates hash code according to all attributes.
|
|
103
|
+
# @return [Integer] Hash code
|
|
104
|
+
def hash
|
|
105
|
+
[message].hash
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# Builds the object from hash
|
|
109
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
110
|
+
# @return [Object] Returns the model itself
|
|
111
|
+
def self.build_from_hash(attributes)
|
|
112
|
+
return nil unless attributes.is_a?(Hash)
|
|
113
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
114
|
+
transformed_hash = {}
|
|
115
|
+
openapi_types.each_pair do |key, type|
|
|
116
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
117
|
+
transformed_hash["#{key}"] = nil
|
|
118
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
119
|
+
# check to ensure the input is an array given that the attribute
|
|
120
|
+
# is documented as an array but the input is not
|
|
121
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
122
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
123
|
+
end
|
|
124
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
125
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
126
|
+
end
|
|
127
|
+
end
|
|
128
|
+
new(transformed_hash)
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# Deserializes the data based on type
|
|
132
|
+
# @param string type Data type
|
|
133
|
+
# @param string value Value to be deserialized
|
|
134
|
+
# @return [Object] Deserialized data
|
|
135
|
+
def self._deserialize(type, value)
|
|
136
|
+
case type.to_sym
|
|
137
|
+
when :Time
|
|
138
|
+
Time.parse(value)
|
|
139
|
+
when :Date
|
|
140
|
+
Date.parse(value)
|
|
141
|
+
when :String
|
|
142
|
+
value.to_s
|
|
143
|
+
when :Integer
|
|
144
|
+
value.to_i
|
|
145
|
+
when :Float
|
|
146
|
+
value.to_f
|
|
147
|
+
when :Boolean
|
|
148
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
149
|
+
true
|
|
150
|
+
else
|
|
151
|
+
false
|
|
152
|
+
end
|
|
153
|
+
when :Object
|
|
154
|
+
# generic object (usually a Hash), return directly
|
|
155
|
+
value
|
|
156
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
157
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
158
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
159
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
160
|
+
k_type = Regexp.last_match[:k_type]
|
|
161
|
+
v_type = Regexp.last_match[:v_type]
|
|
162
|
+
{}.tap do |hash|
|
|
163
|
+
value.each do |k, v|
|
|
164
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
165
|
+
end
|
|
166
|
+
end
|
|
167
|
+
else # model
|
|
168
|
+
# models (e.g. Pet) or oneOf
|
|
169
|
+
klass = Tremendous.const_get(type)
|
|
170
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
171
|
+
end
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
# Returns the string representation of the object
|
|
175
|
+
# @return [String] String presentation of the object
|
|
176
|
+
def to_s
|
|
177
|
+
to_hash.to_s
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
181
|
+
# @return [Hash] Returns the object in the form of hash
|
|
182
|
+
def to_body
|
|
183
|
+
to_hash
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
# Returns the object in the form of hash
|
|
187
|
+
# @return [Hash] Returns the object in the form of hash
|
|
188
|
+
def to_hash
|
|
189
|
+
hash = {}
|
|
190
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
191
|
+
value = self.send(attr)
|
|
192
|
+
if value.nil?
|
|
193
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
194
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
hash[param] = _to_hash(value)
|
|
198
|
+
end
|
|
199
|
+
hash
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
# Outputs non-array value in the form of hash
|
|
203
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
204
|
+
# @param [Object] value Any valid value
|
|
205
|
+
# @return [Hash] Returns the value in the form of hash
|
|
206
|
+
def _to_hash(value)
|
|
207
|
+
if value.is_a?(Array)
|
|
208
|
+
value.compact.map { |v| _to_hash(v) }
|
|
209
|
+
elsif value.is_a?(Hash)
|
|
210
|
+
{}.tap do |hash|
|
|
211
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
212
|
+
end
|
|
213
|
+
elsif value.respond_to? :to_hash
|
|
214
|
+
value.to_hash
|
|
215
|
+
else
|
|
216
|
+
value
|
|
217
|
+
end
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
end
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#API Endpoints
|
|
3
|
+
|
|
4
|
+
#Deliver monetary rewards and incentives to employees, customers, survey participants, and more through the Tremendous API. For organizational tasks, like managing your organization and it's members within Tremendous, please see the Tremendous Organizational API.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 2
|
|
7
|
+
Contact: developers@tremendous.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.8.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Tremendous
|
|
17
|
+
class UpdateFraudRuleListRequest
|
|
18
|
+
# * `add` - append the list to the same key of the current configuration * `remove` - remove the entries in the list from the same key of the current configuration
|
|
19
|
+
attr_accessor :operation
|
|
20
|
+
|
|
21
|
+
attr_accessor :config
|
|
22
|
+
|
|
23
|
+
class EnumAttributeValidator
|
|
24
|
+
attr_reader :datatype
|
|
25
|
+
attr_reader :allowable_values
|
|
26
|
+
|
|
27
|
+
def initialize(datatype, allowable_values)
|
|
28
|
+
@allowable_values = allowable_values.map do |value|
|
|
29
|
+
case datatype.to_s
|
|
30
|
+
when /Integer/i
|
|
31
|
+
value.to_i
|
|
32
|
+
when /Float/i
|
|
33
|
+
value.to_f
|
|
34
|
+
else
|
|
35
|
+
value
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def valid?(value)
|
|
41
|
+
!value || allowable_values.include?(value)
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
46
|
+
def self.attribute_map
|
|
47
|
+
{
|
|
48
|
+
:'operation' => :'operation',
|
|
49
|
+
:'config' => :'config'
|
|
50
|
+
}
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Returns all the JSON keys this model knows about
|
|
54
|
+
def self.acceptable_attributes
|
|
55
|
+
attribute_map.values
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Attribute type mapping.
|
|
59
|
+
def self.openapi_types
|
|
60
|
+
{
|
|
61
|
+
:'operation' => :'String',
|
|
62
|
+
:'config' => :'UpdateFraudRuleListRequestConfig'
|
|
63
|
+
}
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# List of attributes with nullable: true
|
|
67
|
+
def self.openapi_nullable
|
|
68
|
+
Set.new([
|
|
69
|
+
])
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# Initializes the object
|
|
73
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
74
|
+
def initialize(attributes = {})
|
|
75
|
+
if (!attributes.is_a?(Hash))
|
|
76
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::UpdateFraudRuleListRequest` initialize method"
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
80
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
81
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
82
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::UpdateFraudRuleListRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
83
|
+
end
|
|
84
|
+
h[k.to_sym] = v
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if attributes.key?(:'operation')
|
|
88
|
+
self.operation = attributes[:'operation']
|
|
89
|
+
else
|
|
90
|
+
self.operation = nil
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
if attributes.key?(:'config')
|
|
94
|
+
self.config = attributes[:'config']
|
|
95
|
+
else
|
|
96
|
+
self.config = nil
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
101
|
+
# @return Array for valid properties with the reasons
|
|
102
|
+
def list_invalid_properties
|
|
103
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
104
|
+
invalid_properties = Array.new
|
|
105
|
+
if @operation.nil?
|
|
106
|
+
invalid_properties.push('invalid value for "operation", operation cannot be nil.')
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
if @config.nil?
|
|
110
|
+
invalid_properties.push('invalid value for "config", config cannot be nil.')
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
invalid_properties
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# Check to see if the all the properties in the model are valid
|
|
117
|
+
# @return true if the model is valid
|
|
118
|
+
def valid?
|
|
119
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
120
|
+
return false if @operation.nil?
|
|
121
|
+
operation_validator = EnumAttributeValidator.new('String', ["add", "remove"])
|
|
122
|
+
return false unless operation_validator.valid?(@operation)
|
|
123
|
+
return false if @config.nil?
|
|
124
|
+
true
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
128
|
+
# @param [Object] operation Object to be assigned
|
|
129
|
+
def operation=(operation)
|
|
130
|
+
validator = EnumAttributeValidator.new('String', ["add", "remove"])
|
|
131
|
+
unless validator.valid?(operation)
|
|
132
|
+
fail ArgumentError, "invalid value for \"operation\", must be one of #{validator.allowable_values}."
|
|
133
|
+
end
|
|
134
|
+
@operation = operation
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# Checks equality by comparing each attribute.
|
|
138
|
+
# @param [Object] Object to be compared
|
|
139
|
+
def ==(o)
|
|
140
|
+
return true if self.equal?(o)
|
|
141
|
+
self.class == o.class &&
|
|
142
|
+
operation == o.operation &&
|
|
143
|
+
config == o.config
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# @see the `==` method
|
|
147
|
+
# @param [Object] Object to be compared
|
|
148
|
+
def eql?(o)
|
|
149
|
+
self == o
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
# Calculates hash code according to all attributes.
|
|
153
|
+
# @return [Integer] Hash code
|
|
154
|
+
def hash
|
|
155
|
+
[operation, config].hash
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
# Builds the object from hash
|
|
159
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
160
|
+
# @return [Object] Returns the model itself
|
|
161
|
+
def self.build_from_hash(attributes)
|
|
162
|
+
return nil unless attributes.is_a?(Hash)
|
|
163
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
164
|
+
transformed_hash = {}
|
|
165
|
+
openapi_types.each_pair do |key, type|
|
|
166
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
167
|
+
transformed_hash["#{key}"] = nil
|
|
168
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
169
|
+
# check to ensure the input is an array given that the attribute
|
|
170
|
+
# is documented as an array but the input is not
|
|
171
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
172
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
173
|
+
end
|
|
174
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
175
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
176
|
+
end
|
|
177
|
+
end
|
|
178
|
+
new(transformed_hash)
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
# Deserializes the data based on type
|
|
182
|
+
# @param string type Data type
|
|
183
|
+
# @param string value Value to be deserialized
|
|
184
|
+
# @return [Object] Deserialized data
|
|
185
|
+
def self._deserialize(type, value)
|
|
186
|
+
case type.to_sym
|
|
187
|
+
when :Time
|
|
188
|
+
Time.parse(value)
|
|
189
|
+
when :Date
|
|
190
|
+
Date.parse(value)
|
|
191
|
+
when :String
|
|
192
|
+
value.to_s
|
|
193
|
+
when :Integer
|
|
194
|
+
value.to_i
|
|
195
|
+
when :Float
|
|
196
|
+
value.to_f
|
|
197
|
+
when :Boolean
|
|
198
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
199
|
+
true
|
|
200
|
+
else
|
|
201
|
+
false
|
|
202
|
+
end
|
|
203
|
+
when :Object
|
|
204
|
+
# generic object (usually a Hash), return directly
|
|
205
|
+
value
|
|
206
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
207
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
208
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
209
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
210
|
+
k_type = Regexp.last_match[:k_type]
|
|
211
|
+
v_type = Regexp.last_match[:v_type]
|
|
212
|
+
{}.tap do |hash|
|
|
213
|
+
value.each do |k, v|
|
|
214
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
215
|
+
end
|
|
216
|
+
end
|
|
217
|
+
else # model
|
|
218
|
+
# models (e.g. Pet) or oneOf
|
|
219
|
+
klass = Tremendous.const_get(type)
|
|
220
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
221
|
+
end
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
# Returns the string representation of the object
|
|
225
|
+
# @return [String] String presentation of the object
|
|
226
|
+
def to_s
|
|
227
|
+
to_hash.to_s
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
231
|
+
# @return [Hash] Returns the object in the form of hash
|
|
232
|
+
def to_body
|
|
233
|
+
to_hash
|
|
234
|
+
end
|
|
235
|
+
|
|
236
|
+
# Returns the object in the form of hash
|
|
237
|
+
# @return [Hash] Returns the object in the form of hash
|
|
238
|
+
def to_hash
|
|
239
|
+
hash = {}
|
|
240
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
241
|
+
value = self.send(attr)
|
|
242
|
+
if value.nil?
|
|
243
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
244
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
hash[param] = _to_hash(value)
|
|
248
|
+
end
|
|
249
|
+
hash
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
# Outputs non-array value in the form of hash
|
|
253
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
254
|
+
# @param [Object] value Any valid value
|
|
255
|
+
# @return [Hash] Returns the value in the form of hash
|
|
256
|
+
def _to_hash(value)
|
|
257
|
+
if value.is_a?(Array)
|
|
258
|
+
value.compact.map { |v| _to_hash(v) }
|
|
259
|
+
elsif value.is_a?(Hash)
|
|
260
|
+
{}.tap do |hash|
|
|
261
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
262
|
+
end
|
|
263
|
+
elsif value.respond_to? :to_hash
|
|
264
|
+
value.to_hash
|
|
265
|
+
else
|
|
266
|
+
value
|
|
267
|
+
end
|
|
268
|
+
end
|
|
269
|
+
|
|
270
|
+
end
|
|
271
|
+
|
|
272
|
+
end
|