tremendous_ruby 5.12.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.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/lib/tremendous/api/tremendous_api.rb +202 -9
  3. data/lib/tremendous/models/allow_email.rb +9 -0
  4. data/lib/tremendous/models/allow_email1.rb +9 -0
  5. data/lib/tremendous/models/allow_ip.rb +9 -0
  6. data/lib/tremendous/models/allow_ip1.rb +9 -0
  7. data/lib/tremendous/models/create_invoice_request.rb +48 -2
  8. data/lib/tremendous/models/create_topup200_response.rb +220 -0
  9. data/lib/tremendous/models/create_topup_request.rb +292 -0
  10. data/lib/tremendous/models/custom_field.rb +1 -1
  11. data/lib/tremendous/models/fraud_config_allow_email.rb +9 -0
  12. data/lib/tremendous/models/fraud_config_ip.rb +9 -0
  13. data/lib/tremendous/models/fraud_config_review_email.rb +19 -0
  14. data/lib/tremendous/models/fraud_review.rb +66 -56
  15. data/lib/tremendous/models/fraud_review_base.rb +358 -0
  16. data/lib/tremendous/models/fraud_review_list_item.rb +85 -4
  17. data/lib/tremendous/models/fraud_review_redemption_method.rb +7 -5
  18. data/lib/tremendous/models/funding_source.rb +3 -3
  19. data/lib/tremendous/models/get_fraud_review200_response_fraud_review.rb +66 -56
  20. data/lib/tremendous/models/invoice.rb +26 -2
  21. data/lib/tremendous/models/list_fraud_reviews200_response_fraud_reviews_inner.rb +85 -4
  22. data/lib/tremendous/models/list_fraud_reviews200_response_fraud_reviews_inner_geo.rb +242 -0
  23. data/lib/tremendous/models/list_funding_sources200_response_funding_sources_inner.rb +3 -3
  24. data/lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb +7 -2
  25. data/lib/tremendous/models/list_invoices200_response_invoices_inner.rb +26 -2
  26. data/lib/tremendous/models/list_products_response_products_inner.rb +24 -2
  27. data/lib/tremendous/models/list_rewards200_response_rewards_inner_custom_fields_inner.rb +1 -1
  28. data/lib/tremendous/models/list_topups200_response.rb +232 -0
  29. data/lib/tremendous/models/list_topups200_response_topups_inner.rb +326 -0
  30. data/lib/tremendous/models/product.rb +24 -2
  31. data/lib/tremendous/models/review_email.rb +19 -0
  32. data/lib/tremendous/models/review_email1.rb +19 -0
  33. data/lib/tremendous/models/review_ip.rb +9 -0
  34. data/lib/tremendous/models/review_ip1.rb +9 -0
  35. data/lib/tremendous/models/reward_base_custom_fields_inner.rb +1 -1
  36. data/lib/tremendous/models/single_reward_order_reward_custom_fields_inner.rb +1 -1
  37. data/lib/tremendous/models/topup.rb +326 -0
  38. data/lib/tremendous/models/topup_create_request.rb +292 -0
  39. data/lib/tremendous/version.rb +1 -1
  40. data/lib/tremendous.rb +8 -1
  41. metadata +9 -1
@@ -0,0 +1,220 @@
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 its 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.12.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Tremendous
17
+ class CreateTopup200Response
18
+ attr_accessor :topup
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'topup' => :'topup'
24
+ }
25
+ end
26
+
27
+ # Returns attribute mapping this model knows about
28
+ def self.acceptable_attribute_map
29
+ attribute_map
30
+ end
31
+
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ acceptable_attribute_map.values
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'topup' => :'ListTopups200ResponseTopupsInner'
41
+ }
42
+ end
43
+
44
+ # List of attributes with nullable: true
45
+ def self.openapi_nullable
46
+ Set.new([
47
+ ])
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ if (!attributes.is_a?(Hash))
54
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::CreateTopup200Response` initialize method"
55
+ end
56
+
57
+ # check to see if the attribute exists and convert string to symbol for hash key
58
+ acceptable_attribute_map = self.class.acceptable_attribute_map
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!acceptable_attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::CreateTopup200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'topup')
67
+ self.topup = attributes[:'topup']
68
+ end
69
+ end
70
+
71
+ # Show invalid properties with the reasons. Usually used together with valid?
72
+ # @return Array for valid properties with the reasons
73
+ def list_invalid_properties
74
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
75
+ invalid_properties = Array.new
76
+ invalid_properties
77
+ end
78
+
79
+ # Check to see if the all the properties in the model are valid
80
+ # @return true if the model is valid
81
+ def valid?
82
+ warn '[DEPRECATED] the `valid?` method is obsolete'
83
+ true
84
+ end
85
+
86
+ # Checks equality by comparing each attribute.
87
+ # @param [Object] Object to be compared
88
+ def ==(o)
89
+ return true if self.equal?(o)
90
+ self.class == o.class &&
91
+ topup == o.topup
92
+ end
93
+
94
+ # @see the `==` method
95
+ # @param [Object] Object to be compared
96
+ def eql?(o)
97
+ self == o
98
+ end
99
+
100
+ # Calculates hash code according to all attributes.
101
+ # @return [Integer] Hash code
102
+ def hash
103
+ [topup].hash
104
+ end
105
+
106
+ # Builds the object from hash
107
+ # @param [Hash] attributes Model attributes in the form of hash
108
+ # @return [Object] Returns the model itself
109
+ def self.build_from_hash(attributes)
110
+ return nil unless attributes.is_a?(Hash)
111
+ attributes = attributes.transform_keys(&:to_sym)
112
+ transformed_hash = {}
113
+ openapi_types.each_pair do |key, type|
114
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
115
+ transformed_hash["#{key}"] = nil
116
+ elsif type =~ /\AArray<(.*)>/i
117
+ # check to ensure the input is an array given that the attribute
118
+ # is documented as an array but the input is not
119
+ if attributes[attribute_map[key]].is_a?(Array)
120
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
121
+ end
122
+ elsif !attributes[attribute_map[key]].nil?
123
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
124
+ end
125
+ end
126
+ new(transformed_hash)
127
+ end
128
+
129
+ # Deserializes the data based on type
130
+ # @param string type Data type
131
+ # @param string value Value to be deserialized
132
+ # @return [Object] Deserialized data
133
+ def self._deserialize(type, value)
134
+ case type.to_sym
135
+ when :Time
136
+ Time.parse(value)
137
+ when :Date
138
+ Date.parse(value)
139
+ when :String
140
+ value.to_s
141
+ when :Integer
142
+ value.to_i
143
+ when :Float
144
+ value.to_f
145
+ when :Boolean
146
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
147
+ true
148
+ else
149
+ false
150
+ end
151
+ when :Object
152
+ # generic object (usually a Hash), return directly
153
+ value
154
+ when /\AArray<(?<inner_type>.+)>\z/
155
+ inner_type = Regexp.last_match[:inner_type]
156
+ value.map { |v| _deserialize(inner_type, v) }
157
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
158
+ k_type = Regexp.last_match[:k_type]
159
+ v_type = Regexp.last_match[:v_type]
160
+ {}.tap do |hash|
161
+ value.each do |k, v|
162
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
163
+ end
164
+ end
165
+ else # model
166
+ # models (e.g. Pet) or oneOf
167
+ klass = Tremendous.const_get(type)
168
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
169
+ end
170
+ end
171
+
172
+ # Returns the string representation of the object
173
+ # @return [String] String presentation of the object
174
+ def to_s
175
+ to_hash.to_s
176
+ end
177
+
178
+ # to_body is an alias to to_hash (backward compatibility)
179
+ # @return [Hash] Returns the object in the form of hash
180
+ def to_body
181
+ to_hash
182
+ end
183
+
184
+ # Returns the object in the form of hash
185
+ # @return [Hash] Returns the object in the form of hash
186
+ def to_hash
187
+ hash = {}
188
+ self.class.attribute_map.each_pair do |attr, param|
189
+ value = self.send(attr)
190
+ if value.nil?
191
+ is_nullable = self.class.openapi_nullable.include?(attr)
192
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
193
+ end
194
+
195
+ hash[param] = _to_hash(value)
196
+ end
197
+ hash
198
+ end
199
+
200
+ # Outputs non-array value in the form of hash
201
+ # For object, use to_hash. Otherwise, just return the value
202
+ # @param [Object] value Any valid value
203
+ # @return [Hash] Returns the value in the form of hash
204
+ def _to_hash(value)
205
+ if value.is_a?(Array)
206
+ value.compact.map { |v| _to_hash(v) }
207
+ elsif value.is_a?(Hash)
208
+ {}.tap do |hash|
209
+ value.each { |k, v| hash[k] = _to_hash(v) }
210
+ end
211
+ elsif value.respond_to? :to_hash
212
+ value.to_hash
213
+ else
214
+ value
215
+ end
216
+ end
217
+
218
+ end
219
+
220
+ end
@@ -0,0 +1,292 @@
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 its 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.12.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Tremendous
17
+ class CreateTopupRequest
18
+ # The ID of the funding source to top up.
19
+ attr_accessor :funding_source_id
20
+
21
+ # Unique key that ensures this request is only processed once.
22
+ attr_accessor :idempotency_key
23
+
24
+ # Amount in USD intended to be added to your organization’s balance.
25
+ attr_accessor :amount
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'funding_source_id' => :'funding_source_id',
31
+ :'idempotency_key' => :'idempotency_key',
32
+ :'amount' => :'amount'
33
+ }
34
+ end
35
+
36
+ # Returns attribute mapping this model knows about
37
+ def self.acceptable_attribute_map
38
+ attribute_map
39
+ end
40
+
41
+ # Returns all the JSON keys this model knows about
42
+ def self.acceptable_attributes
43
+ acceptable_attribute_map.values
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.openapi_types
48
+ {
49
+ :'funding_source_id' => :'String',
50
+ :'idempotency_key' => :'String',
51
+ :'amount' => :'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::CreateTopupRequest` initialize method"
66
+ end
67
+
68
+ # check to see if the attribute exists and convert string to symbol for hash key
69
+ acceptable_attribute_map = self.class.acceptable_attribute_map
70
+ attributes = attributes.each_with_object({}) { |(k, v), h|
71
+ if (!acceptable_attribute_map.key?(k.to_sym))
72
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::CreateTopupRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
73
+ end
74
+ h[k.to_sym] = v
75
+ }
76
+
77
+ if attributes.key?(:'funding_source_id')
78
+ self.funding_source_id = attributes[:'funding_source_id']
79
+ else
80
+ self.funding_source_id = nil
81
+ end
82
+
83
+ if attributes.key?(:'idempotency_key')
84
+ self.idempotency_key = attributes[:'idempotency_key']
85
+ else
86
+ self.idempotency_key = nil
87
+ end
88
+
89
+ if attributes.key?(:'amount')
90
+ self.amount = attributes[:'amount']
91
+ else
92
+ self.amount = nil
93
+ end
94
+ end
95
+
96
+ # Show invalid properties with the reasons. Usually used together with valid?
97
+ # @return Array for valid properties with the reasons
98
+ def list_invalid_properties
99
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
100
+ invalid_properties = Array.new
101
+ if @funding_source_id.nil?
102
+ invalid_properties.push('invalid value for "funding_source_id", funding_source_id cannot be nil.')
103
+ end
104
+
105
+ if @idempotency_key.nil?
106
+ invalid_properties.push('invalid value for "idempotency_key", idempotency_key cannot be nil.')
107
+ end
108
+
109
+ if @amount.nil?
110
+ invalid_properties.push('invalid value for "amount", amount 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 @funding_source_id.nil?
121
+ return false if @idempotency_key.nil?
122
+ return false if @amount.nil?
123
+ true
124
+ end
125
+
126
+ # Custom attribute writer method with validation
127
+ # @param [Object] funding_source_id Value to be assigned
128
+ def funding_source_id=(funding_source_id)
129
+ if funding_source_id.nil?
130
+ fail ArgumentError, 'funding_source_id cannot be nil'
131
+ end
132
+
133
+ @funding_source_id = funding_source_id
134
+ end
135
+
136
+ # Custom attribute writer method with validation
137
+ # @param [Object] idempotency_key Value to be assigned
138
+ def idempotency_key=(idempotency_key)
139
+ if idempotency_key.nil?
140
+ fail ArgumentError, 'idempotency_key cannot be nil'
141
+ end
142
+
143
+ @idempotency_key = idempotency_key
144
+ end
145
+
146
+ # Custom attribute writer method with validation
147
+ # @param [Object] amount Value to be assigned
148
+ def amount=(amount)
149
+ if amount.nil?
150
+ fail ArgumentError, 'amount cannot be nil'
151
+ end
152
+
153
+ @amount = amount
154
+ end
155
+
156
+ # Checks equality by comparing each attribute.
157
+ # @param [Object] Object to be compared
158
+ def ==(o)
159
+ return true if self.equal?(o)
160
+ self.class == o.class &&
161
+ funding_source_id == o.funding_source_id &&
162
+ idempotency_key == o.idempotency_key &&
163
+ amount == o.amount
164
+ end
165
+
166
+ # @see the `==` method
167
+ # @param [Object] Object to be compared
168
+ def eql?(o)
169
+ self == o
170
+ end
171
+
172
+ # Calculates hash code according to all attributes.
173
+ # @return [Integer] Hash code
174
+ def hash
175
+ [funding_source_id, idempotency_key, amount].hash
176
+ end
177
+
178
+ # Builds the object from hash
179
+ # @param [Hash] attributes Model attributes in the form of hash
180
+ # @return [Object] Returns the model itself
181
+ def self.build_from_hash(attributes)
182
+ return nil unless attributes.is_a?(Hash)
183
+ attributes = attributes.transform_keys(&:to_sym)
184
+ transformed_hash = {}
185
+ openapi_types.each_pair do |key, type|
186
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
187
+ transformed_hash["#{key}"] = nil
188
+ elsif type =~ /\AArray<(.*)>/i
189
+ # check to ensure the input is an array given that the attribute
190
+ # is documented as an array but the input is not
191
+ if attributes[attribute_map[key]].is_a?(Array)
192
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
193
+ end
194
+ elsif !attributes[attribute_map[key]].nil?
195
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
196
+ end
197
+ end
198
+ new(transformed_hash)
199
+ end
200
+
201
+ # Deserializes the data based on type
202
+ # @param string type Data type
203
+ # @param string value Value to be deserialized
204
+ # @return [Object] Deserialized data
205
+ def self._deserialize(type, value)
206
+ case type.to_sym
207
+ when :Time
208
+ Time.parse(value)
209
+ when :Date
210
+ Date.parse(value)
211
+ when :String
212
+ value.to_s
213
+ when :Integer
214
+ value.to_i
215
+ when :Float
216
+ value.to_f
217
+ when :Boolean
218
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
219
+ true
220
+ else
221
+ false
222
+ end
223
+ when :Object
224
+ # generic object (usually a Hash), return directly
225
+ value
226
+ when /\AArray<(?<inner_type>.+)>\z/
227
+ inner_type = Regexp.last_match[:inner_type]
228
+ value.map { |v| _deserialize(inner_type, v) }
229
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
230
+ k_type = Regexp.last_match[:k_type]
231
+ v_type = Regexp.last_match[:v_type]
232
+ {}.tap do |hash|
233
+ value.each do |k, v|
234
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
235
+ end
236
+ end
237
+ else # model
238
+ # models (e.g. Pet) or oneOf
239
+ klass = Tremendous.const_get(type)
240
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
241
+ end
242
+ end
243
+
244
+ # Returns the string representation of the object
245
+ # @return [String] String presentation of the object
246
+ def to_s
247
+ to_hash.to_s
248
+ end
249
+
250
+ # to_body is an alias to to_hash (backward compatibility)
251
+ # @return [Hash] Returns the object in the form of hash
252
+ def to_body
253
+ to_hash
254
+ end
255
+
256
+ # Returns the object in the form of hash
257
+ # @return [Hash] Returns the object in the form of hash
258
+ def to_hash
259
+ hash = {}
260
+ self.class.attribute_map.each_pair do |attr, param|
261
+ value = self.send(attr)
262
+ if value.nil?
263
+ is_nullable = self.class.openapi_nullable.include?(attr)
264
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
265
+ end
266
+
267
+ hash[param] = _to_hash(value)
268
+ end
269
+ hash
270
+ end
271
+
272
+ # Outputs non-array value in the form of hash
273
+ # For object, use to_hash. Otherwise, just return the value
274
+ # @param [Object] value Any valid value
275
+ # @return [Hash] Returns the value in the form of hash
276
+ def _to_hash(value)
277
+ if value.is_a?(Array)
278
+ value.compact.map { |v| _to_hash(v) }
279
+ elsif value.is_a?(Hash)
280
+ {}.tap do |hash|
281
+ value.each { |k, v| hash[k] = _to_hash(v) }
282
+ end
283
+ elsif value.respond_to? :to_hash
284
+ value.to_hash
285
+ else
286
+ value
287
+ end
288
+ end
289
+
290
+ end
291
+
292
+ end
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Tremendous
17
- # Reward custom data for searching, tracking or copy (see [Adding custom fields to orders](https://developers.tremendous.com/reference/using-custom-fields-to-add-custom-data-to-rewards).)
17
+ # Reward custom data for searching, tracking or copy (see [Adding custom fields to orders](https://developers.tremendous.com/docs/using-custom-fields-to-add-custom-data-to-rewards).)
18
18
  class CustomField
19
19
  # Tremendous ID of the custom field
20
20
  attr_accessor :id
@@ -82,6 +82,10 @@ module Tremendous
82
82
  invalid_properties.push('invalid value for "emails", emails cannot be nil.')
83
83
  end
84
84
 
85
+ if @emails.length > 50000
86
+ invalid_properties.push('invalid value for "emails", number of items must be less than or equal to 50000.')
87
+ end
88
+
85
89
  invalid_properties
86
90
  end
87
91
 
@@ -90,6 +94,7 @@ module Tremendous
90
94
  def valid?
91
95
  warn '[DEPRECATED] the `valid?` method is obsolete'
92
96
  return false if @emails.nil?
97
+ return false if @emails.length > 50000
93
98
  true
94
99
  end
95
100
 
@@ -100,6 +105,10 @@ module Tremendous
100
105
  fail ArgumentError, 'emails cannot be nil'
101
106
  end
102
107
 
108
+ if emails.length > 50000
109
+ fail ArgumentError, 'invalid value for "emails", number of items must be less than or equal to 50000.'
110
+ end
111
+
103
112
  @emails = emails
104
113
  end
105
114
 
@@ -82,6 +82,10 @@ module Tremendous
82
82
  invalid_properties.push('invalid value for "ips", ips cannot be nil.')
83
83
  end
84
84
 
85
+ if @ips.length > 50000
86
+ invalid_properties.push('invalid value for "ips", number of items must be less than or equal to 50000.')
87
+ end
88
+
85
89
  invalid_properties
86
90
  end
87
91
 
@@ -90,6 +94,7 @@ module Tremendous
90
94
  def valid?
91
95
  warn '[DEPRECATED] the `valid?` method is obsolete'
92
96
  return false if @ips.nil?
97
+ return false if @ips.length > 50000
93
98
  true
94
99
  end
95
100
 
@@ -100,6 +105,10 @@ module Tremendous
100
105
  fail ArgumentError, 'ips cannot be nil'
101
106
  end
102
107
 
108
+ if ips.length > 50000
109
+ fail ArgumentError, 'invalid value for "ips", number of items must be less than or equal to 50000.'
110
+ end
111
+
103
112
  @ips = ips
104
113
  end
105
114
 
@@ -87,6 +87,10 @@ module Tremendous
87
87
  def list_invalid_properties
88
88
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
89
89
  invalid_properties = Array.new
90
+ if !@emails.nil? && @emails.length > 50000
91
+ invalid_properties.push('invalid value for "emails", number of items must be less than or equal to 50000.')
92
+ end
93
+
90
94
  invalid_properties
91
95
  end
92
96
 
@@ -94,9 +98,24 @@ module Tremendous
94
98
  # @return true if the model is valid
95
99
  def valid?
96
100
  warn '[DEPRECATED] the `valid?` method is obsolete'
101
+ return false if !@emails.nil? && @emails.length > 50000
97
102
  true
98
103
  end
99
104
 
105
+ # Custom attribute writer method with validation
106
+ # @param [Object] emails Value to be assigned
107
+ def emails=(emails)
108
+ if emails.nil?
109
+ fail ArgumentError, 'emails cannot be nil'
110
+ end
111
+
112
+ if emails.length > 50000
113
+ fail ArgumentError, 'invalid value for "emails", number of items must be less than or equal to 50000.'
114
+ end
115
+
116
+ @emails = emails
117
+ end
118
+
100
119
  # Checks equality by comparing each attribute.
101
120
  # @param [Object] Object to be compared
102
121
  def ==(o)