tremendous_ruby 5.6.0 → 5.8.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 (30) hide show
  1. checksums.yaml +4 -4
  2. data/lib/tremendous/api/tremendous_api.rb +148 -10
  3. data/lib/tremendous/models/balance_transaction.rb +13 -4
  4. data/lib/tremendous/models/balance_transaction_order.rb +256 -0
  5. data/lib/tremendous/models/balance_transaction_order_payment.rb +358 -0
  6. data/lib/tremendous/models/create_report201_response.rb +231 -0
  7. data/lib/tremendous/models/create_report201_response_report.rb +291 -0
  8. data/lib/tremendous/models/create_report_request.rb +295 -0
  9. data/lib/tremendous/models/create_report_request_filters.rb +216 -0
  10. data/lib/tremendous/models/create_report_request_filters_digital_rewards.rb +340 -0
  11. data/lib/tremendous/models/create_report_request_filters_digital_rewards_amount.rb +226 -0
  12. data/lib/tremendous/models/create_report_request_filters_digital_rewards_created_at.rb +226 -0
  13. data/lib/tremendous/models/fraud_review.rb +23 -1
  14. data/lib/tremendous/models/fraud_review_risk.rb +41 -0
  15. data/lib/tremendous/models/get_fraud_review200_response_fraud_review.rb +23 -1
  16. data/lib/tremendous/models/get_order200_response.rb +221 -0
  17. data/lib/tremendous/models/list_balance_transactions200_response_transactions_inner.rb +13 -4
  18. data/lib/tremendous/models/list_balance_transactions200_response_transactions_inner_order.rb +256 -0
  19. data/lib/tremendous/models/list_balance_transactions200_response_transactions_inner_order_payment.rb +358 -0
  20. data/lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb +37 -7
  21. data/lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta_failure_details.rb +225 -0
  22. data/lib/tremendous/models/list_orders200_response_orders_inner_payment.rb +64 -7
  23. data/lib/tremendous/models/order_base_payment.rb +64 -7
  24. data/lib/tremendous/models/payment_details.rb +64 -7
  25. data/lib/tremendous/models/payout.rb +16 -4
  26. data/lib/tremendous/models/report.rb +291 -0
  27. data/lib/tremendous/models/resend_reward_request.rb +225 -0
  28. data/lib/tremendous/version.rb +1 -1
  29. data/lib/tremendous.rb +16 -1
  30. metadata +19 -3
@@ -0,0 +1,226 @@
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
+ # Amount of the rewards returned in the report
18
+ class CreateReportRequestFiltersDigitalRewardsAmount
19
+ # Minimum amount of the rewards that should be returned in the report
20
+ attr_accessor :gte
21
+
22
+ # Maximum amount of the rewards that should be returned in the report
23
+ attr_accessor :lte
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'gte' => :'gte',
29
+ :'lte' => :'lte'
30
+ }
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'gte' => :'Float',
42
+ :'lte' => :'Float'
43
+ }
44
+ end
45
+
46
+ # List of attributes with nullable: true
47
+ def self.openapi_nullable
48
+ Set.new([
49
+ ])
50
+ end
51
+
52
+ # Initializes the object
53
+ # @param [Hash] attributes Model attributes in the form of hash
54
+ def initialize(attributes = {})
55
+ if (!attributes.is_a?(Hash))
56
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::CreateReportRequestFiltersDigitalRewardsAmount` initialize method"
57
+ end
58
+
59
+ # check to see if the attribute exists and convert string to symbol for hash key
60
+ attributes = attributes.each_with_object({}) { |(k, v), h|
61
+ if (!self.class.attribute_map.key?(k.to_sym))
62
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::CreateReportRequestFiltersDigitalRewardsAmount`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
63
+ end
64
+ h[k.to_sym] = v
65
+ }
66
+
67
+ if attributes.key?(:'gte')
68
+ self.gte = attributes[:'gte']
69
+ end
70
+
71
+ if attributes.key?(:'lte')
72
+ self.lte = attributes[:'lte']
73
+ end
74
+ end
75
+
76
+ # Show invalid properties with the reasons. Usually used together with valid?
77
+ # @return Array for valid properties with the reasons
78
+ def list_invalid_properties
79
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
80
+ invalid_properties = Array.new
81
+ invalid_properties
82
+ end
83
+
84
+ # Check to see if the all the properties in the model are valid
85
+ # @return true if the model is valid
86
+ def valid?
87
+ warn '[DEPRECATED] the `valid?` method is obsolete'
88
+ true
89
+ end
90
+
91
+ # Checks equality by comparing each attribute.
92
+ # @param [Object] Object to be compared
93
+ def ==(o)
94
+ return true if self.equal?(o)
95
+ self.class == o.class &&
96
+ gte == o.gte &&
97
+ lte == o.lte
98
+ end
99
+
100
+ # @see the `==` method
101
+ # @param [Object] Object to be compared
102
+ def eql?(o)
103
+ self == o
104
+ end
105
+
106
+ # Calculates hash code according to all attributes.
107
+ # @return [Integer] Hash code
108
+ def hash
109
+ [gte, lte].hash
110
+ end
111
+
112
+ # Builds the object from hash
113
+ # @param [Hash] attributes Model attributes in the form of hash
114
+ # @return [Object] Returns the model itself
115
+ def self.build_from_hash(attributes)
116
+ return nil unless attributes.is_a?(Hash)
117
+ attributes = attributes.transform_keys(&:to_sym)
118
+ transformed_hash = {}
119
+ openapi_types.each_pair do |key, type|
120
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
121
+ transformed_hash["#{key}"] = nil
122
+ elsif type =~ /\AArray<(.*)>/i
123
+ # check to ensure the input is an array given that the attribute
124
+ # is documented as an array but the input is not
125
+ if attributes[attribute_map[key]].is_a?(Array)
126
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
127
+ end
128
+ elsif !attributes[attribute_map[key]].nil?
129
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
130
+ end
131
+ end
132
+ new(transformed_hash)
133
+ end
134
+
135
+ # Deserializes the data based on type
136
+ # @param string type Data type
137
+ # @param string value Value to be deserialized
138
+ # @return [Object] Deserialized data
139
+ def self._deserialize(type, value)
140
+ case type.to_sym
141
+ when :Time
142
+ Time.parse(value)
143
+ when :Date
144
+ Date.parse(value)
145
+ when :String
146
+ value.to_s
147
+ when :Integer
148
+ value.to_i
149
+ when :Float
150
+ value.to_f
151
+ when :Boolean
152
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
153
+ true
154
+ else
155
+ false
156
+ end
157
+ when :Object
158
+ # generic object (usually a Hash), return directly
159
+ value
160
+ when /\AArray<(?<inner_type>.+)>\z/
161
+ inner_type = Regexp.last_match[:inner_type]
162
+ value.map { |v| _deserialize(inner_type, v) }
163
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
164
+ k_type = Regexp.last_match[:k_type]
165
+ v_type = Regexp.last_match[:v_type]
166
+ {}.tap do |hash|
167
+ value.each do |k, v|
168
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
169
+ end
170
+ end
171
+ else # model
172
+ # models (e.g. Pet) or oneOf
173
+ klass = Tremendous.const_get(type)
174
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
175
+ end
176
+ end
177
+
178
+ # Returns the string representation of the object
179
+ # @return [String] String presentation of the object
180
+ def to_s
181
+ to_hash.to_s
182
+ end
183
+
184
+ # to_body is an alias to to_hash (backward compatibility)
185
+ # @return [Hash] Returns the object in the form of hash
186
+ def to_body
187
+ to_hash
188
+ end
189
+
190
+ # Returns the object in the form of hash
191
+ # @return [Hash] Returns the object in the form of hash
192
+ def to_hash
193
+ hash = {}
194
+ self.class.attribute_map.each_pair do |attr, param|
195
+ value = self.send(attr)
196
+ if value.nil?
197
+ is_nullable = self.class.openapi_nullable.include?(attr)
198
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
199
+ end
200
+
201
+ hash[param] = _to_hash(value)
202
+ end
203
+ hash
204
+ end
205
+
206
+ # Outputs non-array value in the form of hash
207
+ # For object, use to_hash. Otherwise, just return the value
208
+ # @param [Object] value Any valid value
209
+ # @return [Hash] Returns the value in the form of hash
210
+ def _to_hash(value)
211
+ if value.is_a?(Array)
212
+ value.compact.map { |v| _to_hash(v) }
213
+ elsif value.is_a?(Hash)
214
+ {}.tap do |hash|
215
+ value.each { |k, v| hash[k] = _to_hash(v) }
216
+ end
217
+ elsif value.respond_to? :to_hash
218
+ value.to_hash
219
+ else
220
+ value
221
+ end
222
+ end
223
+
224
+ end
225
+
226
+ end
@@ -0,0 +1,226 @@
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
+ # Creation dates of rewards returned in the report
18
+ class CreateReportRequestFiltersDigitalRewardsCreatedAt
19
+ # Minimum date the reward was created
20
+ attr_accessor :gte
21
+
22
+ # Maximum date the reward was created
23
+ attr_accessor :lte
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'gte' => :'gte',
29
+ :'lte' => :'lte'
30
+ }
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'gte' => :'Date',
42
+ :'lte' => :'Date'
43
+ }
44
+ end
45
+
46
+ # List of attributes with nullable: true
47
+ def self.openapi_nullable
48
+ Set.new([
49
+ ])
50
+ end
51
+
52
+ # Initializes the object
53
+ # @param [Hash] attributes Model attributes in the form of hash
54
+ def initialize(attributes = {})
55
+ if (!attributes.is_a?(Hash))
56
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::CreateReportRequestFiltersDigitalRewardsCreatedAt` initialize method"
57
+ end
58
+
59
+ # check to see if the attribute exists and convert string to symbol for hash key
60
+ attributes = attributes.each_with_object({}) { |(k, v), h|
61
+ if (!self.class.attribute_map.key?(k.to_sym))
62
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::CreateReportRequestFiltersDigitalRewardsCreatedAt`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
63
+ end
64
+ h[k.to_sym] = v
65
+ }
66
+
67
+ if attributes.key?(:'gte')
68
+ self.gte = attributes[:'gte']
69
+ end
70
+
71
+ if attributes.key?(:'lte')
72
+ self.lte = attributes[:'lte']
73
+ end
74
+ end
75
+
76
+ # Show invalid properties with the reasons. Usually used together with valid?
77
+ # @return Array for valid properties with the reasons
78
+ def list_invalid_properties
79
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
80
+ invalid_properties = Array.new
81
+ invalid_properties
82
+ end
83
+
84
+ # Check to see if the all the properties in the model are valid
85
+ # @return true if the model is valid
86
+ def valid?
87
+ warn '[DEPRECATED] the `valid?` method is obsolete'
88
+ true
89
+ end
90
+
91
+ # Checks equality by comparing each attribute.
92
+ # @param [Object] Object to be compared
93
+ def ==(o)
94
+ return true if self.equal?(o)
95
+ self.class == o.class &&
96
+ gte == o.gte &&
97
+ lte == o.lte
98
+ end
99
+
100
+ # @see the `==` method
101
+ # @param [Object] Object to be compared
102
+ def eql?(o)
103
+ self == o
104
+ end
105
+
106
+ # Calculates hash code according to all attributes.
107
+ # @return [Integer] Hash code
108
+ def hash
109
+ [gte, lte].hash
110
+ end
111
+
112
+ # Builds the object from hash
113
+ # @param [Hash] attributes Model attributes in the form of hash
114
+ # @return [Object] Returns the model itself
115
+ def self.build_from_hash(attributes)
116
+ return nil unless attributes.is_a?(Hash)
117
+ attributes = attributes.transform_keys(&:to_sym)
118
+ transformed_hash = {}
119
+ openapi_types.each_pair do |key, type|
120
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
121
+ transformed_hash["#{key}"] = nil
122
+ elsif type =~ /\AArray<(.*)>/i
123
+ # check to ensure the input is an array given that the attribute
124
+ # is documented as an array but the input is not
125
+ if attributes[attribute_map[key]].is_a?(Array)
126
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
127
+ end
128
+ elsif !attributes[attribute_map[key]].nil?
129
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
130
+ end
131
+ end
132
+ new(transformed_hash)
133
+ end
134
+
135
+ # Deserializes the data based on type
136
+ # @param string type Data type
137
+ # @param string value Value to be deserialized
138
+ # @return [Object] Deserialized data
139
+ def self._deserialize(type, value)
140
+ case type.to_sym
141
+ when :Time
142
+ Time.parse(value)
143
+ when :Date
144
+ Date.parse(value)
145
+ when :String
146
+ value.to_s
147
+ when :Integer
148
+ value.to_i
149
+ when :Float
150
+ value.to_f
151
+ when :Boolean
152
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
153
+ true
154
+ else
155
+ false
156
+ end
157
+ when :Object
158
+ # generic object (usually a Hash), return directly
159
+ value
160
+ when /\AArray<(?<inner_type>.+)>\z/
161
+ inner_type = Regexp.last_match[:inner_type]
162
+ value.map { |v| _deserialize(inner_type, v) }
163
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
164
+ k_type = Regexp.last_match[:k_type]
165
+ v_type = Regexp.last_match[:v_type]
166
+ {}.tap do |hash|
167
+ value.each do |k, v|
168
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
169
+ end
170
+ end
171
+ else # model
172
+ # models (e.g. Pet) or oneOf
173
+ klass = Tremendous.const_get(type)
174
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
175
+ end
176
+ end
177
+
178
+ # Returns the string representation of the object
179
+ # @return [String] String presentation of the object
180
+ def to_s
181
+ to_hash.to_s
182
+ end
183
+
184
+ # to_body is an alias to to_hash (backward compatibility)
185
+ # @return [Hash] Returns the object in the form of hash
186
+ def to_body
187
+ to_hash
188
+ end
189
+
190
+ # Returns the object in the form of hash
191
+ # @return [Hash] Returns the object in the form of hash
192
+ def to_hash
193
+ hash = {}
194
+ self.class.attribute_map.each_pair do |attr, param|
195
+ value = self.send(attr)
196
+ if value.nil?
197
+ is_nullable = self.class.openapi_nullable.include?(attr)
198
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
199
+ end
200
+
201
+ hash[param] = _to_hash(value)
202
+ end
203
+ hash
204
+ end
205
+
206
+ # Outputs non-array value in the form of hash
207
+ # For object, use to_hash. Otherwise, just return the value
208
+ # @param [Object] value Any valid value
209
+ # @return [Hash] Returns the value in the form of hash
210
+ def _to_hash(value)
211
+ if value.is_a?(Array)
212
+ value.compact.map { |v| _to_hash(v) }
213
+ elsif value.is_a?(Hash)
214
+ {}.tap do |hash|
215
+ value.each { |k, v| hash[k] = _to_hash(v) }
216
+ end
217
+ elsif value.respond_to? :to_hash
218
+ value.to_hash
219
+ else
220
+ value
221
+ end
222
+ end
223
+
224
+ end
225
+
226
+ end
@@ -19,6 +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
+
22
25
  # 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
26
  attr_accessor :reasons
24
27
 
@@ -69,6 +72,7 @@ module Tremendous
69
72
  def self.attribute_map
70
73
  {
71
74
  :'status' => :'status',
75
+ :'risk' => :'risk',
72
76
  :'reasons' => :'reasons',
73
77
  :'reviewed_by' => :'reviewed_by',
74
78
  :'reviewed_at' => :'reviewed_at',
@@ -90,6 +94,7 @@ module Tremendous
90
94
  def self.openapi_types
91
95
  {
92
96
  :'status' => :'String',
97
+ :'risk' => :'String',
93
98
  :'reasons' => :'Array<String>',
94
99
  :'reviewed_by' => :'String',
95
100
  :'reviewed_at' => :'Time',
@@ -127,6 +132,10 @@ module Tremendous
127
132
  self.status = attributes[:'status']
128
133
  end
129
134
 
135
+ if attributes.key?(:'risk')
136
+ self.risk = attributes[:'risk']
137
+ end
138
+
130
139
  if attributes.key?(:'reasons')
131
140
  if (value = attributes[:'reasons']).is_a?(Array)
132
141
  self.reasons = value
@@ -180,6 +189,8 @@ module Tremendous
180
189
  warn '[DEPRECATED] the `valid?` method is obsolete'
181
190
  status_validator = EnumAttributeValidator.new('String', ["flagged", "blocked", "released"])
182
191
  return false unless status_validator.valid?(@status)
192
+ risk_validator = EnumAttributeValidator.new('String', ["high", "medium", "low"])
193
+ return false unless risk_validator.valid?(@risk)
183
194
  redemption_method_validator = EnumAttributeValidator.new('String', ["paypal", "bank", "merchant card", "visa card", "charity", "venmo"])
184
195
  return false unless redemption_method_validator.valid?(@redemption_method)
185
196
  true
@@ -195,6 +206,16 @@ module Tremendous
195
206
  @status = status
196
207
  end
197
208
 
209
+ # Custom attribute writer method checking allowed values (enum).
210
+ # @param [Object] risk Object to be assigned
211
+ def risk=(risk)
212
+ validator = EnumAttributeValidator.new('String', ["high", "medium", "low"])
213
+ unless validator.valid?(risk)
214
+ fail ArgumentError, "invalid value for \"risk\", must be one of #{validator.allowable_values}."
215
+ end
216
+ @risk = risk
217
+ end
218
+
198
219
  # Custom attribute writer method checking allowed values (enum).
199
220
  # @param [Object] redemption_method Object to be assigned
200
221
  def redemption_method=(redemption_method)
@@ -211,6 +232,7 @@ module Tremendous
211
232
  return true if self.equal?(o)
212
233
  self.class == o.class &&
213
234
  status == o.status &&
235
+ risk == o.risk &&
214
236
  reasons == o.reasons &&
215
237
  reviewed_by == o.reviewed_by &&
216
238
  reviewed_at == o.reviewed_at &&
@@ -231,7 +253,7 @@ module Tremendous
231
253
  # Calculates hash code according to all attributes.
232
254
  # @return [Integer] Hash code
233
255
  def hash
234
- [status, reasons, reviewed_by, reviewed_at, related_rewards, device_id, redemption_method, redeemed_at, geo, reward].hash
256
+ [status, risk, reasons, reviewed_by, reviewed_at, related_rewards, device_id, redemption_method, redeemed_at, geo, reward].hash
235
257
  end
236
258
 
237
259
  # Builds the object from hash
@@ -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
+ Generator version: 7.8.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Tremendous
17
+ class FraudReviewRisk
18
+ HIGH = "high".freeze
19
+ MEDIUM = "medium".freeze
20
+ LOW = "low".freeze
21
+
22
+ def self.all_vars
23
+ @all_vars ||= [HIGH, MEDIUM, LOW].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 FraudReviewRisk.all_vars.include?(value)
38
+ raise "Invalid ENUM value #{value} for class #FraudReviewRisk"
39
+ end
40
+ end
41
+ end
@@ -19,6 +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
+
22
25
  # 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
26
  attr_accessor :reasons
24
27
 
@@ -69,6 +72,7 @@ module Tremendous
69
72
  def self.attribute_map
70
73
  {
71
74
  :'status' => :'status',
75
+ :'risk' => :'risk',
72
76
  :'reasons' => :'reasons',
73
77
  :'reviewed_by' => :'reviewed_by',
74
78
  :'reviewed_at' => :'reviewed_at',
@@ -90,6 +94,7 @@ module Tremendous
90
94
  def self.openapi_types
91
95
  {
92
96
  :'status' => :'String',
97
+ :'risk' => :'String',
93
98
  :'reasons' => :'Array<String>',
94
99
  :'reviewed_by' => :'String',
95
100
  :'reviewed_at' => :'Time',
@@ -127,6 +132,10 @@ module Tremendous
127
132
  self.status = attributes[:'status']
128
133
  end
129
134
 
135
+ if attributes.key?(:'risk')
136
+ self.risk = attributes[:'risk']
137
+ end
138
+
130
139
  if attributes.key?(:'reasons')
131
140
  if (value = attributes[:'reasons']).is_a?(Array)
132
141
  self.reasons = value
@@ -180,6 +189,8 @@ module Tremendous
180
189
  warn '[DEPRECATED] the `valid?` method is obsolete'
181
190
  status_validator = EnumAttributeValidator.new('String', ["flagged", "blocked", "released"])
182
191
  return false unless status_validator.valid?(@status)
192
+ risk_validator = EnumAttributeValidator.new('String', ["high", "medium", "low"])
193
+ return false unless risk_validator.valid?(@risk)
183
194
  redemption_method_validator = EnumAttributeValidator.new('String', ["paypal", "bank", "merchant card", "visa card", "charity", "venmo"])
184
195
  return false unless redemption_method_validator.valid?(@redemption_method)
185
196
  true
@@ -195,6 +206,16 @@ module Tremendous
195
206
  @status = status
196
207
  end
197
208
 
209
+ # Custom attribute writer method checking allowed values (enum).
210
+ # @param [Object] risk Object to be assigned
211
+ def risk=(risk)
212
+ validator = EnumAttributeValidator.new('String', ["high", "medium", "low"])
213
+ unless validator.valid?(risk)
214
+ fail ArgumentError, "invalid value for \"risk\", must be one of #{validator.allowable_values}."
215
+ end
216
+ @risk = risk
217
+ end
218
+
198
219
  # Custom attribute writer method checking allowed values (enum).
199
220
  # @param [Object] redemption_method Object to be assigned
200
221
  def redemption_method=(redemption_method)
@@ -211,6 +232,7 @@ module Tremendous
211
232
  return true if self.equal?(o)
212
233
  self.class == o.class &&
213
234
  status == o.status &&
235
+ risk == o.risk &&
214
236
  reasons == o.reasons &&
215
237
  reviewed_by == o.reviewed_by &&
216
238
  reviewed_at == o.reviewed_at &&
@@ -231,7 +253,7 @@ module Tremendous
231
253
  # Calculates hash code according to all attributes.
232
254
  # @return [Integer] Hash code
233
255
  def hash
234
- [status, reasons, reviewed_by, reviewed_at, related_rewards, device_id, redemption_method, redeemed_at, geo, reward].hash
256
+ [status, risk, reasons, reviewed_by, reviewed_at, related_rewards, device_id, redemption_method, redeemed_at, geo, reward].hash
235
257
  end
236
258
 
237
259
  # Builds the object from hash