tremendous_ruby 5.13.0 → 5.14.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.
@@ -19,20 +19,9 @@ module Tremendous
19
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.
20
20
  attr_accessor :status
21
21
 
22
- # The fraud risk associated with the reward.
23
- attr_accessor :risk
24
-
25
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` * `Device 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`
26
23
  attr_accessor :reasons
27
24
 
28
- # The name of the person who reviewed the reward, or `Automatic Review` if the reward was blocked automatically. Rewards can be automatically blocked if they remain in the flagged fraud queue for more than 30 days. This field is only present if the status is not `flagged`.
29
- attr_accessor :reviewed_by
30
-
31
- # When the reward was blocked or released following fraud review. This field is only present if the status is not `flagged`.
32
- attr_accessor :reviewed_at
33
-
34
- attr_accessor :related_rewards
35
-
36
25
  # The device fingerprint, if known.
37
26
  attr_accessor :device_id
38
27
 
@@ -46,6 +35,20 @@ module Tremendous
46
35
 
47
36
  attr_accessor :reward
48
37
 
38
+ # The name of the person who reviewed the reward, or `Automatic Review` if the reward was blocked automatically. Rewards can be automatically blocked if they remain in the flagged fraud queue for more than 30 days. This field is only present if the status is not `flagged`.
39
+ attr_accessor :reviewed_by
40
+
41
+ # When the reward was blocked or released following fraud review. This field is only present if the status is not `flagged`.
42
+ attr_accessor :reviewed_at
43
+
44
+ # A hash of the destination account for redemption methods that require providing 3rd party account details (e.g., PayPal, Venmo, ACH/CashApp, international bank transfers, etc.). The hash is globally unique by redemption method + account combination. This field is omitted for redemption methods that don't have a destination account (e.g., merchant cards, charities, etc.).
45
+ attr_accessor :redemption_method_account_hash
46
+
47
+ # The fraud risk associated with the reward.
48
+ attr_accessor :risk
49
+
50
+ attr_accessor :related_rewards
51
+
49
52
  class EnumAttributeValidator
50
53
  attr_reader :datatype
51
54
  attr_reader :allowable_values
@@ -72,16 +75,17 @@ module Tremendous
72
75
  def self.attribute_map
73
76
  {
74
77
  :'status' => :'status',
75
- :'risk' => :'risk',
76
78
  :'reasons' => :'reasons',
77
- :'reviewed_by' => :'reviewed_by',
78
- :'reviewed_at' => :'reviewed_at',
79
- :'related_rewards' => :'related_rewards',
80
79
  :'device_id' => :'device_id',
81
80
  :'redemption_method' => :'redemption_method',
82
81
  :'redeemed_at' => :'redeemed_at',
83
82
  :'geo' => :'geo',
84
- :'reward' => :'reward'
83
+ :'reward' => :'reward',
84
+ :'reviewed_by' => :'reviewed_by',
85
+ :'reviewed_at' => :'reviewed_at',
86
+ :'redemption_method_account_hash' => :'redemption_method_account_hash',
87
+ :'risk' => :'risk',
88
+ :'related_rewards' => :'related_rewards'
85
89
  }
86
90
  end
87
91
 
@@ -99,16 +103,17 @@ module Tremendous
99
103
  def self.openapi_types
100
104
  {
101
105
  :'status' => :'String',
102
- :'risk' => :'String',
103
106
  :'reasons' => :'Array<String>',
104
- :'reviewed_by' => :'String',
105
- :'reviewed_at' => :'Time',
106
- :'related_rewards' => :'GetFraudReview200ResponseFraudReviewRelatedRewards',
107
107
  :'device_id' => :'String',
108
108
  :'redemption_method' => :'String',
109
109
  :'redeemed_at' => :'Time',
110
- :'geo' => :'GetFraudReview200ResponseFraudReviewGeo',
111
- :'reward' => :'ListRewards200ResponseRewardsInner'
110
+ :'geo' => :'ListFraudReviews200ResponseFraudReviewsInnerGeo',
111
+ :'reward' => :'ListRewards200ResponseRewardsInner',
112
+ :'reviewed_by' => :'String',
113
+ :'reviewed_at' => :'Time',
114
+ :'redemption_method_account_hash' => :'String',
115
+ :'risk' => :'String',
116
+ :'related_rewards' => :'GetFraudReview200ResponseFraudReviewRelatedRewards'
112
117
  }
113
118
  end
114
119
 
@@ -138,28 +143,12 @@ module Tremendous
138
143
  self.status = attributes[:'status']
139
144
  end
140
145
 
141
- if attributes.key?(:'risk')
142
- self.risk = attributes[:'risk']
143
- end
144
-
145
146
  if attributes.key?(:'reasons')
146
147
  if (value = attributes[:'reasons']).is_a?(Array)
147
148
  self.reasons = value
148
149
  end
149
150
  end
150
151
 
151
- if attributes.key?(:'reviewed_by')
152
- self.reviewed_by = attributes[:'reviewed_by']
153
- end
154
-
155
- if attributes.key?(:'reviewed_at')
156
- self.reviewed_at = attributes[:'reviewed_at']
157
- end
158
-
159
- if attributes.key?(:'related_rewards')
160
- self.related_rewards = attributes[:'related_rewards']
161
- end
162
-
163
152
  if attributes.key?(:'device_id')
164
153
  self.device_id = attributes[:'device_id']
165
154
  end
@@ -179,6 +168,26 @@ module Tremendous
179
168
  if attributes.key?(:'reward')
180
169
  self.reward = attributes[:'reward']
181
170
  end
171
+
172
+ if attributes.key?(:'reviewed_by')
173
+ self.reviewed_by = attributes[:'reviewed_by']
174
+ end
175
+
176
+ if attributes.key?(:'reviewed_at')
177
+ self.reviewed_at = attributes[:'reviewed_at']
178
+ end
179
+
180
+ if attributes.key?(:'redemption_method_account_hash')
181
+ self.redemption_method_account_hash = attributes[:'redemption_method_account_hash']
182
+ end
183
+
184
+ if attributes.key?(:'risk')
185
+ self.risk = attributes[:'risk']
186
+ end
187
+
188
+ if attributes.key?(:'related_rewards')
189
+ self.related_rewards = attributes[:'related_rewards']
190
+ end
182
191
  end
183
192
 
184
193
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -195,10 +204,10 @@ module Tremendous
195
204
  warn '[DEPRECATED] the `valid?` method is obsolete'
196
205
  status_validator = EnumAttributeValidator.new('String', ["flagged", "blocked", "released"])
197
206
  return false unless status_validator.valid?(@status)
207
+ redemption_method_validator = EnumAttributeValidator.new('String', ["bank transfer", "charity", "instant debit transfer", "international bank transfer", "merchant card", "paypal", "venmo", "visa card"])
208
+ return false unless redemption_method_validator.valid?(@redemption_method)
198
209
  risk_validator = EnumAttributeValidator.new('String', ["high", "medium", "low"])
199
210
  return false unless risk_validator.valid?(@risk)
200
- redemption_method_validator = EnumAttributeValidator.new('String', ["paypal", "bank", "merchant card", "visa card", "charity", "venmo"])
201
- return false unless redemption_method_validator.valid?(@redemption_method)
202
211
  true
203
212
  end
204
213
 
@@ -212,6 +221,16 @@ module Tremendous
212
221
  @status = status
213
222
  end
214
223
 
224
+ # Custom attribute writer method checking allowed values (enum).
225
+ # @param [Object] redemption_method Object to be assigned
226
+ def redemption_method=(redemption_method)
227
+ validator = EnumAttributeValidator.new('String', ["bank transfer", "charity", "instant debit transfer", "international bank transfer", "merchant card", "paypal", "venmo", "visa card"])
228
+ unless validator.valid?(redemption_method)
229
+ fail ArgumentError, "invalid value for \"redemption_method\", must be one of #{validator.allowable_values}."
230
+ end
231
+ @redemption_method = redemption_method
232
+ end
233
+
215
234
  # Custom attribute writer method checking allowed values (enum).
216
235
  # @param [Object] risk Object to be assigned
217
236
  def risk=(risk)
@@ -222,32 +241,23 @@ module Tremendous
222
241
  @risk = risk
223
242
  end
224
243
 
225
- # Custom attribute writer method checking allowed values (enum).
226
- # @param [Object] redemption_method Object to be assigned
227
- def redemption_method=(redemption_method)
228
- validator = EnumAttributeValidator.new('String', ["paypal", "bank", "merchant card", "visa card", "charity", "venmo"])
229
- unless validator.valid?(redemption_method)
230
- fail ArgumentError, "invalid value for \"redemption_method\", must be one of #{validator.allowable_values}."
231
- end
232
- @redemption_method = redemption_method
233
- end
234
-
235
244
  # Checks equality by comparing each attribute.
236
245
  # @param [Object] Object to be compared
237
246
  def ==(o)
238
247
  return true if self.equal?(o)
239
248
  self.class == o.class &&
240
249
  status == o.status &&
241
- risk == o.risk &&
242
250
  reasons == o.reasons &&
243
- reviewed_by == o.reviewed_by &&
244
- reviewed_at == o.reviewed_at &&
245
- related_rewards == o.related_rewards &&
246
251
  device_id == o.device_id &&
247
252
  redemption_method == o.redemption_method &&
248
253
  redeemed_at == o.redeemed_at &&
249
254
  geo == o.geo &&
250
- reward == o.reward
255
+ reward == o.reward &&
256
+ reviewed_by == o.reviewed_by &&
257
+ reviewed_at == o.reviewed_at &&
258
+ redemption_method_account_hash == o.redemption_method_account_hash &&
259
+ risk == o.risk &&
260
+ related_rewards == o.related_rewards
251
261
  end
252
262
 
253
263
  # @see the `==` method
@@ -259,7 +269,7 @@ module Tremendous
259
269
  # Calculates hash code according to all attributes.
260
270
  # @return [Integer] Hash code
261
271
  def hash
262
- [status, risk, reasons, reviewed_by, reviewed_at, related_rewards, device_id, redemption_method, redeemed_at, geo, reward].hash
272
+ [status, reasons, device_id, redemption_method, redeemed_at, geo, reward, reviewed_by, reviewed_at, redemption_method_account_hash, risk, related_rewards].hash
263
273
  end
264
274
 
265
275
  # Builds the object from hash
@@ -22,9 +22,12 @@ module Tremendous
22
22
  # Reference to the purchase order number within your organization
23
23
  attr_accessor :po_number
24
24
 
25
- # Amount of the invoice in USD
25
+ # Amount of the invoice
26
26
  attr_accessor :amount
27
27
 
28
+ # Currency of the invoice
29
+ attr_accessor :currency
30
+
28
31
  attr_accessor :international
29
32
 
30
33
  # Status of this invoice <table> <thead> <tr> <th>Status</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>DELETED</code></td> <td>Invoice has been deleted by your organization</td> </tr> <tr> <td><code>PAID</code></td> <td>Invoice has been paid by your organization</td> </tr> <tr> <td><code>OPEN</code></td> <td>Invoice has been created by your organization but has not been paid, yet</td> </tr> </tbody> </table>
@@ -70,6 +73,7 @@ module Tremendous
70
73
  :'id' => :'id',
71
74
  :'po_number' => :'po_number',
72
75
  :'amount' => :'amount',
76
+ :'currency' => :'currency',
73
77
  :'international' => :'international',
74
78
  :'status' => :'status',
75
79
  :'orders' => :'orders',
@@ -95,6 +99,7 @@ module Tremendous
95
99
  :'id' => :'String',
96
100
  :'po_number' => :'String',
97
101
  :'amount' => :'Float',
102
+ :'currency' => :'String',
98
103
  :'international' => :'Boolean',
99
104
  :'status' => :'String',
100
105
  :'orders' => :'Array<String>',
@@ -144,6 +149,12 @@ module Tremendous
144
149
  self.amount = nil
145
150
  end
146
151
 
152
+ if attributes.key?(:'currency')
153
+ self.currency = attributes[:'currency']
154
+ else
155
+ self.currency = 'USD'
156
+ end
157
+
147
158
  if attributes.key?(:'international')
148
159
  self.international = attributes[:'international']
149
160
  end
@@ -209,6 +220,8 @@ module Tremendous
209
220
  warn '[DEPRECATED] the `valid?` method is obsolete'
210
221
  return false if @id.nil?
211
222
  return false if @amount.nil?
223
+ currency_validator = EnumAttributeValidator.new('String', ["USD", "EUR", "GBP"])
224
+ return false unless currency_validator.valid?(@currency)
212
225
  return false if @status.nil?
213
226
  status_validator = EnumAttributeValidator.new('String', ["DELETED", "PAID", "OPEN", "MARKED_AS_PAID"])
214
227
  return false unless status_validator.valid?(@status)
@@ -236,6 +249,16 @@ module Tremendous
236
249
  @amount = amount
237
250
  end
238
251
 
252
+ # Custom attribute writer method checking allowed values (enum).
253
+ # @param [Object] currency Object to be assigned
254
+ def currency=(currency)
255
+ validator = EnumAttributeValidator.new('String', ["USD", "EUR", "GBP"])
256
+ unless validator.valid?(currency)
257
+ fail ArgumentError, "invalid value for \"currency\", must be one of #{validator.allowable_values}."
258
+ end
259
+ @currency = currency
260
+ end
261
+
239
262
  # Custom attribute writer method checking allowed values (enum).
240
263
  # @param [Object] status Object to be assigned
241
264
  def status=(status)
@@ -264,6 +287,7 @@ module Tremendous
264
287
  id == o.id &&
265
288
  po_number == o.po_number &&
266
289
  amount == o.amount &&
290
+ currency == o.currency &&
267
291
  international == o.international &&
268
292
  status == o.status &&
269
293
  orders == o.orders &&
@@ -281,7 +305,7 @@ module Tremendous
281
305
  # Calculates hash code according to all attributes.
282
306
  # @return [Integer] Hash code
283
307
  def hash
284
- [id, po_number, amount, international, status, orders, rewards, created_at, paid_at].hash
308
+ [id, po_number, amount, currency, international, status, orders, rewards, created_at, paid_at].hash
285
309
  end
286
310
 
287
311
  # Builds the object from hash
@@ -22,8 +22,28 @@ module Tremendous
22
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` * `Device 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
23
  attr_accessor :reasons
24
24
 
25
+ # The device fingerprint, if known.
26
+ attr_accessor :device_id
27
+
28
+ # The product selected to claim the reward
29
+ attr_accessor :redemption_method
30
+
31
+ # Date the reward was redeemed
32
+ attr_accessor :redeemed_at
33
+
34
+ attr_accessor :geo
35
+
25
36
  attr_accessor :reward
26
37
 
38
+ # The name of the person who reviewed the reward, or `Automatic Review` if the reward was blocked automatically. Rewards can be automatically blocked if they remain in the flagged fraud queue for more than 30 days. This field is only present if the status is not `flagged`.
39
+ attr_accessor :reviewed_by
40
+
41
+ # When the reward was blocked or released following fraud review. This field is only present if the status is not `flagged`.
42
+ attr_accessor :reviewed_at
43
+
44
+ # A hash of the destination account for redemption methods that require providing 3rd party account details (e.g., PayPal, Venmo, ACH/CashApp, international bank transfers, etc.). The hash is globally unique by redemption method + account combination. This field is omitted for redemption methods that don't have a destination account (e.g., merchant cards, charities, etc.).
45
+ attr_accessor :redemption_method_account_hash
46
+
27
47
  class EnumAttributeValidator
28
48
  attr_reader :datatype
29
49
  attr_reader :allowable_values
@@ -51,7 +71,14 @@ module Tremendous
51
71
  {
52
72
  :'status' => :'status',
53
73
  :'reasons' => :'reasons',
54
- :'reward' => :'reward'
74
+ :'device_id' => :'device_id',
75
+ :'redemption_method' => :'redemption_method',
76
+ :'redeemed_at' => :'redeemed_at',
77
+ :'geo' => :'geo',
78
+ :'reward' => :'reward',
79
+ :'reviewed_by' => :'reviewed_by',
80
+ :'reviewed_at' => :'reviewed_at',
81
+ :'redemption_method_account_hash' => :'redemption_method_account_hash'
55
82
  }
56
83
  end
57
84
 
@@ -70,7 +97,14 @@ module Tremendous
70
97
  {
71
98
  :'status' => :'String',
72
99
  :'reasons' => :'Array<String>',
73
- :'reward' => :'ListRewards200ResponseRewardsInner'
100
+ :'device_id' => :'String',
101
+ :'redemption_method' => :'String',
102
+ :'redeemed_at' => :'Time',
103
+ :'geo' => :'ListFraudReviews200ResponseFraudReviewsInnerGeo',
104
+ :'reward' => :'ListRewards200ResponseRewardsInner',
105
+ :'reviewed_by' => :'String',
106
+ :'reviewed_at' => :'Time',
107
+ :'redemption_method_account_hash' => :'String'
74
108
  }
75
109
  end
76
110
 
@@ -106,9 +140,37 @@ module Tremendous
106
140
  end
107
141
  end
108
142
 
143
+ if attributes.key?(:'device_id')
144
+ self.device_id = attributes[:'device_id']
145
+ end
146
+
147
+ if attributes.key?(:'redemption_method')
148
+ self.redemption_method = attributes[:'redemption_method']
149
+ end
150
+
151
+ if attributes.key?(:'redeemed_at')
152
+ self.redeemed_at = attributes[:'redeemed_at']
153
+ end
154
+
155
+ if attributes.key?(:'geo')
156
+ self.geo = attributes[:'geo']
157
+ end
158
+
109
159
  if attributes.key?(:'reward')
110
160
  self.reward = attributes[:'reward']
111
161
  end
162
+
163
+ if attributes.key?(:'reviewed_by')
164
+ self.reviewed_by = attributes[:'reviewed_by']
165
+ end
166
+
167
+ if attributes.key?(:'reviewed_at')
168
+ self.reviewed_at = attributes[:'reviewed_at']
169
+ end
170
+
171
+ if attributes.key?(:'redemption_method_account_hash')
172
+ self.redemption_method_account_hash = attributes[:'redemption_method_account_hash']
173
+ end
112
174
  end
113
175
 
114
176
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -125,6 +187,8 @@ module Tremendous
125
187
  warn '[DEPRECATED] the `valid?` method is obsolete'
126
188
  status_validator = EnumAttributeValidator.new('String', ["flagged", "blocked", "released"])
127
189
  return false unless status_validator.valid?(@status)
190
+ redemption_method_validator = EnumAttributeValidator.new('String', ["bank transfer", "charity", "instant debit transfer", "international bank transfer", "merchant card", "paypal", "venmo", "visa card"])
191
+ return false unless redemption_method_validator.valid?(@redemption_method)
128
192
  true
129
193
  end
130
194
 
@@ -138,6 +202,16 @@ module Tremendous
138
202
  @status = status
139
203
  end
140
204
 
205
+ # Custom attribute writer method checking allowed values (enum).
206
+ # @param [Object] redemption_method Object to be assigned
207
+ def redemption_method=(redemption_method)
208
+ validator = EnumAttributeValidator.new('String', ["bank transfer", "charity", "instant debit transfer", "international bank transfer", "merchant card", "paypal", "venmo", "visa card"])
209
+ unless validator.valid?(redemption_method)
210
+ fail ArgumentError, "invalid value for \"redemption_method\", must be one of #{validator.allowable_values}."
211
+ end
212
+ @redemption_method = redemption_method
213
+ end
214
+
141
215
  # Checks equality by comparing each attribute.
142
216
  # @param [Object] Object to be compared
143
217
  def ==(o)
@@ -145,7 +219,14 @@ module Tremendous
145
219
  self.class == o.class &&
146
220
  status == o.status &&
147
221
  reasons == o.reasons &&
148
- reward == o.reward
222
+ device_id == o.device_id &&
223
+ redemption_method == o.redemption_method &&
224
+ redeemed_at == o.redeemed_at &&
225
+ geo == o.geo &&
226
+ reward == o.reward &&
227
+ reviewed_by == o.reviewed_by &&
228
+ reviewed_at == o.reviewed_at &&
229
+ redemption_method_account_hash == o.redemption_method_account_hash
149
230
  end
150
231
 
151
232
  # @see the `==` method
@@ -157,7 +238,7 @@ module Tremendous
157
238
  # Calculates hash code according to all attributes.
158
239
  # @return [Integer] Hash code
159
240
  def hash
160
- [status, reasons, reward].hash
241
+ [status, reasons, device_id, redemption_method, redeemed_at, geo, reward, reviewed_by, reviewed_at, redemption_method_account_hash].hash
161
242
  end
162
243
 
163
244
  # Builds the object from hash