tremendous_ruby 5.3.0 → 5.4.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.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/lib/tremendous/api/tremendous_api.rb +571 -9
  3. data/lib/tremendous/models/allow_email.rb +225 -0
  4. data/lib/tremendous/models/allow_email1.rb +225 -0
  5. data/lib/tremendous/models/allow_ip.rb +225 -0
  6. data/lib/tremendous/models/allow_ip1.rb +225 -0
  7. data/lib/tremendous/models/base_order_for_create.rb +232 -0
  8. data/lib/tremendous/models/create_order200_response.rb +1 -1
  9. data/lib/tremendous/models/create_order_request.rb +73 -217
  10. data/lib/tremendous/models/delete_fraud_rule200_response.rb +222 -0
  11. data/lib/tremendous/models/fraud_config_allow_email.rb +224 -0
  12. data/lib/tremendous/models/fraud_config_country.rb +275 -0
  13. data/lib/tremendous/models/fraud_config_country_update_list.rb +224 -0
  14. data/lib/tremendous/models/fraud_config_ip.rb +224 -0
  15. data/lib/tremendous/models/fraud_config_redeemed_rewards_amount.rb +292 -0
  16. data/lib/tremendous/models/fraud_config_redeemed_rewards_count.rb +292 -0
  17. data/lib/tremendous/models/fraud_config_review_email.rb +229 -0
  18. data/lib/tremendous/models/fraud_generic_response.rb +222 -0
  19. data/lib/tremendous/models/fraud_review.rb +351 -0
  20. data/lib/tremendous/models/fraud_review_geo.rb +235 -0
  21. data/lib/tremendous/models/{reward_with_link_delivery.rb → fraud_review_list_item.rb} +26 -51
  22. data/lib/tremendous/models/fraud_review_reason.rb +58 -0
  23. data/lib/tremendous/models/fraud_review_redemption_method.rb +44 -0
  24. data/lib/tremendous/models/fraud_review_related_rewards.rb +304 -0
  25. data/lib/tremendous/models/fraud_review_status.rb +41 -0
  26. data/lib/tremendous/models/fraud_rule200_response.rb +222 -0
  27. data/lib/tremendous/models/fraud_rule400_response.rb +221 -0
  28. data/lib/tremendous/models/fraud_rule422_response.rb +221 -0
  29. data/lib/tremendous/models/fraud_rule_request.rb +214 -0
  30. data/lib/tremendous/models/fraud_rule_request_config.rb +110 -0
  31. data/lib/tremendous/models/fraud_rule_type.rb +49 -0
  32. data/lib/tremendous/models/fraud_rules_list_item.rb +261 -0
  33. data/lib/tremendous/models/get_fraud_review200_response.rb +221 -0
  34. data/lib/tremendous/models/get_fraud_review200_response_fraud_review.rb +351 -0
  35. data/lib/tremendous/models/get_fraud_review200_response_fraud_review_geo.rb +236 -0
  36. data/lib/tremendous/models/get_fraud_review200_response_fraud_review_related_rewards.rb +305 -0
  37. data/lib/tremendous/models/list_campaigns200_response_campaigns_inner_email_style.rb +2 -0
  38. data/lib/tremendous/models/list_campaigns200_response_campaigns_inner_webpage_style.rb +1 -0
  39. data/lib/tremendous/models/list_fraud_reviews200_response.rb +223 -0
  40. data/lib/tremendous/models/{delivery_details_with_link.rb → list_fraud_reviews200_response_fraud_reviews_inner.rb} +26 -51
  41. data/lib/tremendous/models/list_fraud_rules200_response.rb +223 -0
  42. data/lib/tremendous/models/{create_order200_response_order_rewards_inner_delivery.rb → list_fraud_rules200_response_fraud_rules_inner.rb} +28 -63
  43. data/lib/tremendous/models/list_rewards200_response_rewards_inner.rb +0 -21
  44. data/lib/tremendous/models/list_rewards200_response_rewards_inner_value.rb +1 -6
  45. data/lib/tremendous/models/order_without_link_reward.rb +0 -21
  46. data/lib/tremendous/models/public_key.rb +1 -1
  47. data/lib/tremendous/models/public_keys_response_public_keys_inner.rb +1 -1
  48. data/lib/tremendous/models/review_country.rb +276 -0
  49. data/lib/tremendous/models/review_country1.rb +225 -0
  50. data/lib/tremendous/models/review_email.rb +230 -0
  51. data/lib/tremendous/models/review_email1.rb +230 -0
  52. data/lib/tremendous/models/review_ip.rb +225 -0
  53. data/lib/tremendous/models/review_ip1.rb +225 -0
  54. data/lib/tremendous/models/review_redeemed_rewards_amount.rb +293 -0
  55. data/lib/tremendous/models/review_redeemed_rewards_count.rb +293 -0
  56. data/lib/tremendous/models/reward.rb +0 -21
  57. data/lib/tremendous/models/reward_base.rb +0 -21
  58. data/lib/tremendous/models/reward_for_order_create.rb +1 -22
  59. data/lib/tremendous/models/reward_value.rb +1 -6
  60. data/lib/tremendous/models/reward_without_link.rb +0 -21
  61. data/lib/tremendous/models/{order_for_create.rb → single_reward_order.rb} +6 -12
  62. data/lib/tremendous/models/single_reward_order1.rb +242 -0
  63. data/lib/tremendous/models/{create_order_request_payment.rb → single_reward_order1_payment.rb} +3 -3
  64. data/lib/tremendous/models/{create_order_request_reward.rb → single_reward_order1_reward.rb} +5 -26
  65. data/lib/tremendous/models/{create_order_request_reward_custom_fields_inner.rb → single_reward_order1_reward_custom_fields_inner.rb} +3 -3
  66. data/lib/tremendous/models/{create_order_request_reward_delivery.rb → single_reward_order1_reward_delivery.rb} +3 -3
  67. data/lib/tremendous/models/{order_for_create_reward.rb → single_reward_order_reward.rb} +4 -25
  68. data/lib/tremendous/models/{create_order201_response.rb → single_reward_order_without_link.rb} +4 -4
  69. data/lib/tremendous/models/{order_with_link.rb → single_reward_order_without_link_order.rb} +10 -31
  70. data/lib/tremendous/models/update_fraud_rule_list200_response.rb +222 -0
  71. data/lib/tremendous/models/update_fraud_rule_list_request.rb +272 -0
  72. data/lib/tremendous/models/update_fraud_rule_list_request_config.rb +108 -0
  73. data/lib/tremendous/version.rb +1 -1
  74. data/lib/tremendous.rb +56 -15
  75. metadata +59 -18
  76. data/lib/tremendous/models/create_order200_response_order.rb +0 -400
  77. data/lib/tremendous/models/create_order200_response_order_rewards_inner.rb +0 -347
  78. data/lib/tremendous/models/order_with_link_rewards_inner.rb +0 -406
  79. data/lib/tremendous/models/reward_with_link.rb +0 -406
@@ -14,16 +14,15 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Tremendous
17
- # Details on how the reward is delivered to the recipient.
18
- class RewardWithLinkDelivery
19
- # How to deliver the reward to the recipient. <table> <thead> <tr> <th>Delivery Method</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>EMAIL</code></td> <td>Deliver the reward to the recipient by email</td> </tr> <tr> <td><code>LINK</code></td> <td> <p>Deliver the reward to the recipient via a link.</p> <p>The link can be retrieved on a successfully ordered reward via the <code>/rewards</code> or <code>/rewards/{id}</code> endpoint. That link must then be delivered to the recipient out-of-band.</p> </td> </tr> <tr> <td><code>PHONE</code></td> <td>Deliver the reward to the recipient by SMS</td> </tr> </tbody> </table>
20
- attr_accessor :method
21
-
22
- # Current status of the delivery of the reward: * `SCHEDULED` - Reward is scheduled for delivery and will be delivered soon. * `FAILED` - Delivery of reward failed (e.g. email bounced). * `SUCCEEDED` - Reward was successfully delivered (email or text message delivered or reward link opened). * `PENDING` - Delivery is pending but not yet scheduled.
17
+ # The fraud review associated with a reward.
18
+ class FraudReviewListItem
19
+ # The current status of the fraud review: * `flagged` - The reward has been flagged for and waiting manual review. * `blocked` - The reward was reviewed and blocked. * `released` - The reward was reviewed and released.
23
20
  attr_accessor :status
24
21
 
25
- # Link to redeem the reward at. You need to deliver this link to the recipient. Only available for rewards for which the `method` for delivery is set to `LINK`.
26
- attr_accessor :link
22
+ # The array may contain multiple reasons, depending on which rule(s) flagged the reward for review. Reasons can be any of the following: * `Disallowed IP` * `Disallowed email` * `Disallowed country` * `Over reward dollar limit` * `Over reward count limit` * `VPN detected` * `Device related to multiple emails` * `Device or account related to multiple emails` * `IP on a Tremendous fraud list` * `Bank account on a Tremendous fraud list` * `Fingerprint on a Tremendous fraud list` * `Email on a Tremendous fraud list` * `Phone on a Tremendous fraud list` * `IP related to a blocked reward` * `Bank account related to a blocked reward` * `Fingerprint related to a blocked reward` * `Email related to a blocked reward` * `Phone related to a blocked reward` * `Allowed IP` * `Allowed email`
23
+ attr_accessor :reasons
24
+
25
+ attr_accessor :reward
27
26
 
28
27
  class EnumAttributeValidator
29
28
  attr_reader :datatype
@@ -50,9 +49,9 @@ module Tremendous
50
49
  # Attribute mapping from ruby-style variable name to JSON key.
51
50
  def self.attribute_map
52
51
  {
53
- :'method' => :'method',
54
52
  :'status' => :'status',
55
- :'link' => :'link'
53
+ :'reasons' => :'reasons',
54
+ :'reward' => :'reward'
56
55
  }
57
56
  end
58
57
 
@@ -64,9 +63,9 @@ module Tremendous
64
63
  # Attribute type mapping.
65
64
  def self.openapi_types
66
65
  {
67
- :'method' => :'String',
68
66
  :'status' => :'String',
69
- :'link' => :'String'
67
+ :'reasons' => :'Array<String>',
68
+ :'reward' => :'OrderWithoutLinkReward'
70
69
  }
71
70
  end
72
71
 
@@ -80,31 +79,29 @@ module Tremendous
80
79
  # @param [Hash] attributes Model attributes in the form of hash
81
80
  def initialize(attributes = {})
82
81
  if (!attributes.is_a?(Hash))
83
- fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::RewardWithLinkDelivery` initialize method"
82
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::FraudReviewListItem` initialize method"
84
83
  end
85
84
 
86
85
  # check to see if the attribute exists and convert string to symbol for hash key
87
86
  attributes = attributes.each_with_object({}) { |(k, v), h|
88
87
  if (!self.class.attribute_map.key?(k.to_sym))
89
- fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::RewardWithLinkDelivery`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
88
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::FraudReviewListItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
90
89
  end
91
90
  h[k.to_sym] = v
92
91
  }
93
92
 
94
- if attributes.key?(:'method')
95
- self.method = attributes[:'method']
96
- else
97
- self.method = nil
98
- end
99
-
100
93
  if attributes.key?(:'status')
101
94
  self.status = attributes[:'status']
102
- else
103
- self.status = nil
104
95
  end
105
96
 
106
- if attributes.key?(:'link')
107
- self.link = attributes[:'link']
97
+ if attributes.key?(:'reasons')
98
+ if (value = attributes[:'reasons']).is_a?(Array)
99
+ self.reasons = value
100
+ end
101
+ end
102
+
103
+ if attributes.key?(:'reward')
104
+ self.reward = attributes[:'reward']
108
105
  end
109
106
  end
110
107
 
@@ -113,14 +110,6 @@ module Tremendous
113
110
  def list_invalid_properties
114
111
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
115
112
  invalid_properties = Array.new
116
- if @method.nil?
117
- invalid_properties.push('invalid value for "method", method cannot be nil.')
118
- end
119
-
120
- if @status.nil?
121
- invalid_properties.push('invalid value for "status", status cannot be nil.')
122
- end
123
-
124
113
  invalid_properties
125
114
  end
126
115
 
@@ -128,29 +117,15 @@ module Tremendous
128
117
  # @return true if the model is valid
129
118
  def valid?
130
119
  warn '[DEPRECATED] the `valid?` method is obsolete'
131
- return false if @method.nil?
132
- method_validator = EnumAttributeValidator.new('String', ["EMAIL", "LINK", "PHONE"])
133
- return false unless method_validator.valid?(@method)
134
- return false if @status.nil?
135
- status_validator = EnumAttributeValidator.new('String', ["SCHEDULED", "FAILED", "SUCCEEDED", "PENDING"])
120
+ status_validator = EnumAttributeValidator.new('String', ["flagged", "blocked", "released"])
136
121
  return false unless status_validator.valid?(@status)
137
122
  true
138
123
  end
139
124
 
140
- # Custom attribute writer method checking allowed values (enum).
141
- # @param [Object] method Object to be assigned
142
- def method=(method)
143
- validator = EnumAttributeValidator.new('String', ["EMAIL", "LINK", "PHONE"])
144
- unless validator.valid?(method)
145
- fail ArgumentError, "invalid value for \"method\", must be one of #{validator.allowable_values}."
146
- end
147
- @method = method
148
- end
149
-
150
125
  # Custom attribute writer method checking allowed values (enum).
151
126
  # @param [Object] status Object to be assigned
152
127
  def status=(status)
153
- validator = EnumAttributeValidator.new('String', ["SCHEDULED", "FAILED", "SUCCEEDED", "PENDING"])
128
+ validator = EnumAttributeValidator.new('String', ["flagged", "blocked", "released"])
154
129
  unless validator.valid?(status)
155
130
  fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
156
131
  end
@@ -162,9 +137,9 @@ module Tremendous
162
137
  def ==(o)
163
138
  return true if self.equal?(o)
164
139
  self.class == o.class &&
165
- method == o.method &&
166
140
  status == o.status &&
167
- link == o.link
141
+ reasons == o.reasons &&
142
+ reward == o.reward
168
143
  end
169
144
 
170
145
  # @see the `==` method
@@ -176,7 +151,7 @@ module Tremendous
176
151
  # Calculates hash code according to all attributes.
177
152
  # @return [Integer] Hash code
178
153
  def hash
179
- [method, status, link].hash
154
+ [status, reasons, reward].hash
180
155
  end
181
156
 
182
157
  # Builds the object from hash
@@ -0,0 +1,58 @@
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
+ OpenAPI Generator version: 7.3.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Tremendous
17
+ class FraudReviewReason
18
+ DISALLOWED_IP = "Disallowed IP".freeze
19
+ DISALLOWED_EMAIL = "Disallowed email".freeze
20
+ DISALLOWED_COUNTRY = "Disallowed country".freeze
21
+ OVER_REWARD_DOLLAR_LIMIT = "Over reward dollar limit".freeze
22
+ OVER_REWARD_COUNT_LIMIT = "Over reward count limit".freeze
23
+ VPN_DETECTED = "VPN detected".freeze
24
+ DEVICE_RELATED_TO_MULTIPLE_EMAILS = "Device related to multiple emails".freeze
25
+ DEVICE_OR_ACCOUNT_RELATED_TO_MULTIPLE_EMAILS = "Device or account related to multiple emails".freeze
26
+ IP_ON_A_TREMENDOUS_FRAUD_LIST = "IP on a Tremendous fraud list".freeze
27
+ BANK_ACCOUNT_ON_A_TREMENDOUS_FRAUD_LIST = "Bank account on a Tremendous fraud list".freeze
28
+ FINGERPRINT_ON_A_TREMENDOUS_FRAUD_LIST = "Fingerprint on a Tremendous fraud list".freeze
29
+ EMAIL_ON_A_TREMENDOUS_FRAUD_LIST = "Email on a Tremendous fraud list".freeze
30
+ PHONE_ON_A_TREMENDOUS_FRAUD_LIST = "Phone on a Tremendous fraud list".freeze
31
+ IP_RELATED_TO_A_BLOCKED_REWARD = "IP related to a blocked reward".freeze
32
+ BANK_ACCOUNT_RELATED_TO_A_BLOCKED_REWARD = "Bank account related to a blocked reward".freeze
33
+ FINGERPRINT_RELATED_TO_A_BLOCKED_REWARD = "Fingerprint related to a blocked reward".freeze
34
+ EMAIL_RELATED_TO_A_BLOCKED_REWARD = "Email related to a blocked reward".freeze
35
+ PHONE_RELATED_TO_A_BLOCKED_REWARD = "Phone related to a blocked reward".freeze
36
+ ALLOWED_IP = "Allowed IP".freeze
37
+ ALLOWED_EMAIL = "Allowed email".freeze
38
+
39
+ def self.all_vars
40
+ @all_vars ||= [DISALLOWED_IP, DISALLOWED_EMAIL, DISALLOWED_COUNTRY, OVER_REWARD_DOLLAR_LIMIT, OVER_REWARD_COUNT_LIMIT, VPN_DETECTED, DEVICE_RELATED_TO_MULTIPLE_EMAILS, DEVICE_OR_ACCOUNT_RELATED_TO_MULTIPLE_EMAILS, IP_ON_A_TREMENDOUS_FRAUD_LIST, BANK_ACCOUNT_ON_A_TREMENDOUS_FRAUD_LIST, FINGERPRINT_ON_A_TREMENDOUS_FRAUD_LIST, EMAIL_ON_A_TREMENDOUS_FRAUD_LIST, PHONE_ON_A_TREMENDOUS_FRAUD_LIST, IP_RELATED_TO_A_BLOCKED_REWARD, BANK_ACCOUNT_RELATED_TO_A_BLOCKED_REWARD, FINGERPRINT_RELATED_TO_A_BLOCKED_REWARD, EMAIL_RELATED_TO_A_BLOCKED_REWARD, PHONE_RELATED_TO_A_BLOCKED_REWARD, ALLOWED_IP, ALLOWED_EMAIL].freeze
41
+ end
42
+
43
+ # Builds the enum from string
44
+ # @param [String] The enum value in the form of the string
45
+ # @return [String] The enum value
46
+ def self.build_from_hash(value)
47
+ new.build_from_hash(value)
48
+ end
49
+
50
+ # Builds the enum from string
51
+ # @param [String] The enum value in the form of the string
52
+ # @return [String] The enum value
53
+ def build_from_hash(value)
54
+ return value if FraudReviewReason.all_vars.include?(value)
55
+ raise "Invalid ENUM value #{value} for class #FraudReviewReason"
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,44 @@
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
+ OpenAPI Generator version: 7.3.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Tremendous
17
+ class FraudReviewRedemptionMethod
18
+ PAYPAL = "paypal".freeze
19
+ BANK = "bank".freeze
20
+ MERCHANT_CARD = "merchant card".freeze
21
+ VISA_CARD = "visa card".freeze
22
+ CHARITY = "charity".freeze
23
+ VENMO = "venmo".freeze
24
+
25
+ def self.all_vars
26
+ @all_vars ||= [PAYPAL, BANK, MERCHANT_CARD, VISA_CARD, CHARITY, VENMO].freeze
27
+ end
28
+
29
+ # Builds the enum from string
30
+ # @param [String] The enum value in the form of the string
31
+ # @return [String] The enum value
32
+ def self.build_from_hash(value)
33
+ new.build_from_hash(value)
34
+ end
35
+
36
+ # Builds the enum from string
37
+ # @param [String] The enum value in the form of the string
38
+ # @return [String] The enum value
39
+ def build_from_hash(value)
40
+ return value if FraudReviewRedemptionMethod.all_vars.include?(value)
41
+ raise "Invalid ENUM value #{value} for class #FraudReviewRedemptionMethod"
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,304 @@
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
+ OpenAPI Generator version: 7.3.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Tremendous
17
+ class FraudReviewRelatedRewards
18
+ # The IDs of rewards that have similar attributes to the fraud reward. A maximum of 100 IDs is returned.
19
+ attr_accessor :ids
20
+
21
+ # How many related rewards were found in total.
22
+ attr_accessor :count
23
+
24
+ # How many related rewards have been blocked.
25
+ attr_accessor :blocked_count
26
+
27
+ # Total amount claimed by the related rewards (in USD).
28
+ attr_accessor :aggregated_value
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'ids' => :'ids',
34
+ :'count' => :'count',
35
+ :'blocked_count' => :'blocked_count',
36
+ :'aggregated_value' => :'aggregated_value'
37
+ }
38
+ end
39
+
40
+ # Returns all the JSON keys this model knows about
41
+ def self.acceptable_attributes
42
+ attribute_map.values
43
+ end
44
+
45
+ # Attribute type mapping.
46
+ def self.openapi_types
47
+ {
48
+ :'ids' => :'Array<String>',
49
+ :'count' => :'Float',
50
+ :'blocked_count' => :'Float',
51
+ :'aggregated_value' => :'Float'
52
+ }
53
+ end
54
+
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ ])
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ if (!attributes.is_a?(Hash))
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::FraudReviewRelatedRewards` initialize method"
66
+ end
67
+
68
+ # check to see if the attribute exists and convert string to symbol for hash key
69
+ attributes = attributes.each_with_object({}) { |(k, v), h|
70
+ if (!self.class.attribute_map.key?(k.to_sym))
71
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::FraudReviewRelatedRewards`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
72
+ end
73
+ h[k.to_sym] = v
74
+ }
75
+
76
+ if attributes.key?(:'ids')
77
+ if (value = attributes[:'ids']).is_a?(Array)
78
+ self.ids = value
79
+ end
80
+ end
81
+
82
+ if attributes.key?(:'count')
83
+ self.count = attributes[:'count']
84
+ end
85
+
86
+ if attributes.key?(:'blocked_count')
87
+ self.blocked_count = attributes[:'blocked_count']
88
+ end
89
+
90
+ if attributes.key?(:'aggregated_value')
91
+ self.aggregated_value = attributes[:'aggregated_value']
92
+ end
93
+ end
94
+
95
+ # Show invalid properties with the reasons. Usually used together with valid?
96
+ # @return Array for valid properties with the reasons
97
+ def list_invalid_properties
98
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
99
+ invalid_properties = Array.new
100
+ if !@count.nil? && @count < 0
101
+ invalid_properties.push('invalid value for "count", must be greater than or equal to 0.')
102
+ end
103
+
104
+ if !@blocked_count.nil? && @blocked_count < 0
105
+ invalid_properties.push('invalid value for "blocked_count", must be greater than or equal to 0.')
106
+ end
107
+
108
+ if !@aggregated_value.nil? && @aggregated_value < 0
109
+ invalid_properties.push('invalid value for "aggregated_value", must be greater than or equal to 0.')
110
+ end
111
+
112
+ invalid_properties
113
+ end
114
+
115
+ # Check to see if the all the properties in the model are valid
116
+ # @return true if the model is valid
117
+ def valid?
118
+ warn '[DEPRECATED] the `valid?` method is obsolete'
119
+ return false if !@count.nil? && @count < 0
120
+ return false if !@blocked_count.nil? && @blocked_count < 0
121
+ return false if !@aggregated_value.nil? && @aggregated_value < 0
122
+ true
123
+ end
124
+
125
+ # Custom attribute writer method with validation
126
+ # @param [Object] count Value to be assigned
127
+ def count=(count)
128
+ if count.nil?
129
+ fail ArgumentError, 'count cannot be nil'
130
+ end
131
+
132
+ if count < 0
133
+ fail ArgumentError, 'invalid value for "count", must be greater than or equal to 0.'
134
+ end
135
+
136
+ @count = count
137
+ end
138
+
139
+ # Custom attribute writer method with validation
140
+ # @param [Object] blocked_count Value to be assigned
141
+ def blocked_count=(blocked_count)
142
+ if blocked_count.nil?
143
+ fail ArgumentError, 'blocked_count cannot be nil'
144
+ end
145
+
146
+ if blocked_count < 0
147
+ fail ArgumentError, 'invalid value for "blocked_count", must be greater than or equal to 0.'
148
+ end
149
+
150
+ @blocked_count = blocked_count
151
+ end
152
+
153
+ # Custom attribute writer method with validation
154
+ # @param [Object] aggregated_value Value to be assigned
155
+ def aggregated_value=(aggregated_value)
156
+ if aggregated_value.nil?
157
+ fail ArgumentError, 'aggregated_value cannot be nil'
158
+ end
159
+
160
+ if aggregated_value < 0
161
+ fail ArgumentError, 'invalid value for "aggregated_value", must be greater than or equal to 0.'
162
+ end
163
+
164
+ @aggregated_value = aggregated_value
165
+ end
166
+
167
+ # Checks equality by comparing each attribute.
168
+ # @param [Object] Object to be compared
169
+ def ==(o)
170
+ return true if self.equal?(o)
171
+ self.class == o.class &&
172
+ ids == o.ids &&
173
+ count == o.count &&
174
+ blocked_count == o.blocked_count &&
175
+ aggregated_value == o.aggregated_value
176
+ end
177
+
178
+ # @see the `==` method
179
+ # @param [Object] Object to be compared
180
+ def eql?(o)
181
+ self == o
182
+ end
183
+
184
+ # Calculates hash code according to all attributes.
185
+ # @return [Integer] Hash code
186
+ def hash
187
+ [ids, count, blocked_count, aggregated_value].hash
188
+ end
189
+
190
+ # Builds the object from hash
191
+ # @param [Hash] attributes Model attributes in the form of hash
192
+ # @return [Object] Returns the model itself
193
+ def self.build_from_hash(attributes)
194
+ return nil unless attributes.is_a?(Hash)
195
+ attributes = attributes.transform_keys(&:to_sym)
196
+ transformed_hash = {}
197
+ openapi_types.each_pair do |key, type|
198
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
199
+ transformed_hash["#{key}"] = nil
200
+ elsif type =~ /\AArray<(.*)>/i
201
+ # check to ensure the input is an array given that the attribute
202
+ # is documented as an array but the input is not
203
+ if attributes[attribute_map[key]].is_a?(Array)
204
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
205
+ end
206
+ elsif !attributes[attribute_map[key]].nil?
207
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
208
+ end
209
+ end
210
+ new(transformed_hash)
211
+ end
212
+
213
+ # Deserializes the data based on type
214
+ # @param string type Data type
215
+ # @param string value Value to be deserialized
216
+ # @return [Object] Deserialized data
217
+ def self._deserialize(type, value)
218
+ case type.to_sym
219
+ when :Time
220
+ Time.parse(value)
221
+ when :Date
222
+ Date.parse(value)
223
+ when :String
224
+ value.to_s
225
+ when :Integer
226
+ value.to_i
227
+ when :Float
228
+ value.to_f
229
+ when :Boolean
230
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
231
+ true
232
+ else
233
+ false
234
+ end
235
+ when :Object
236
+ # generic object (usually a Hash), return directly
237
+ value
238
+ when /\AArray<(?<inner_type>.+)>\z/
239
+ inner_type = Regexp.last_match[:inner_type]
240
+ value.map { |v| _deserialize(inner_type, v) }
241
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
242
+ k_type = Regexp.last_match[:k_type]
243
+ v_type = Regexp.last_match[:v_type]
244
+ {}.tap do |hash|
245
+ value.each do |k, v|
246
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
247
+ end
248
+ end
249
+ else # model
250
+ # models (e.g. Pet) or oneOf
251
+ klass = Tremendous.const_get(type)
252
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
253
+ end
254
+ end
255
+
256
+ # Returns the string representation of the object
257
+ # @return [String] String presentation of the object
258
+ def to_s
259
+ to_hash.to_s
260
+ end
261
+
262
+ # to_body is an alias to to_hash (backward compatibility)
263
+ # @return [Hash] Returns the object in the form of hash
264
+ def to_body
265
+ to_hash
266
+ end
267
+
268
+ # Returns the object in the form of hash
269
+ # @return [Hash] Returns the object in the form of hash
270
+ def to_hash
271
+ hash = {}
272
+ self.class.attribute_map.each_pair do |attr, param|
273
+ value = self.send(attr)
274
+ if value.nil?
275
+ is_nullable = self.class.openapi_nullable.include?(attr)
276
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
277
+ end
278
+
279
+ hash[param] = _to_hash(value)
280
+ end
281
+ hash
282
+ end
283
+
284
+ # Outputs non-array value in the form of hash
285
+ # For object, use to_hash. Otherwise, just return the value
286
+ # @param [Object] value Any valid value
287
+ # @return [Hash] Returns the value in the form of hash
288
+ def _to_hash(value)
289
+ if value.is_a?(Array)
290
+ value.compact.map { |v| _to_hash(v) }
291
+ elsif value.is_a?(Hash)
292
+ {}.tap do |hash|
293
+ value.each { |k, v| hash[k] = _to_hash(v) }
294
+ end
295
+ elsif value.respond_to? :to_hash
296
+ value.to_hash
297
+ else
298
+ value
299
+ end
300
+ end
301
+
302
+ end
303
+
304
+ end
@@ -0,0 +1,41 @@
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
+ OpenAPI Generator version: 7.3.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Tremendous
17
+ class FraudReviewStatus
18
+ FLAGGED = "flagged".freeze
19
+ BLOCKED = "blocked".freeze
20
+ RELEASED = "released".freeze
21
+
22
+ def self.all_vars
23
+ @all_vars ||= [FLAGGED, BLOCKED, RELEASED].freeze
24
+ end
25
+
26
+ # Builds the enum from string
27
+ # @param [String] The enum value in the form of the string
28
+ # @return [String] The enum value
29
+ def self.build_from_hash(value)
30
+ new.build_from_hash(value)
31
+ end
32
+
33
+ # Builds the enum from string
34
+ # @param [String] The enum value in the form of the string
35
+ # @return [String] The enum value
36
+ def build_from_hash(value)
37
+ return value if FraudReviewStatus.all_vars.include?(value)
38
+ raise "Invalid ENUM value #{value} for class #FraudReviewStatus"
39
+ end
40
+ end
41
+ end