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,242 @@
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
+ # The Geo location, based on the recipient's IP.
18
+ class ListFraudReviews200ResponseFraudReviewsInnerGeo
19
+ # The recipient's IP.
20
+ attr_accessor :ip
21
+
22
+ # The country code (ISO-3166 alpha-2 character code) linked to the recipient's IP.
23
+ attr_accessor :country
24
+
25
+ # The city associated with the recipient's IP.
26
+ attr_accessor :city
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'ip' => :'ip',
32
+ :'country' => :'country',
33
+ :'city' => :'city'
34
+ }
35
+ end
36
+
37
+ # Returns attribute mapping this model knows about
38
+ def self.acceptable_attribute_map
39
+ attribute_map
40
+ end
41
+
42
+ # Returns all the JSON keys this model knows about
43
+ def self.acceptable_attributes
44
+ acceptable_attribute_map.values
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.openapi_types
49
+ {
50
+ :'ip' => :'String',
51
+ :'country' => :'String',
52
+ :'city' => :'String'
53
+ }
54
+ end
55
+
56
+ # List of attributes with nullable: true
57
+ def self.openapi_nullable
58
+ Set.new([
59
+ ])
60
+ end
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ def initialize(attributes = {})
65
+ if (!attributes.is_a?(Hash))
66
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::ListFraudReviews200ResponseFraudReviewsInnerGeo` initialize method"
67
+ end
68
+
69
+ # check to see if the attribute exists and convert string to symbol for hash key
70
+ acceptable_attribute_map = self.class.acceptable_attribute_map
71
+ attributes = attributes.each_with_object({}) { |(k, v), h|
72
+ if (!acceptable_attribute_map.key?(k.to_sym))
73
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::ListFraudReviews200ResponseFraudReviewsInnerGeo`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
74
+ end
75
+ h[k.to_sym] = v
76
+ }
77
+
78
+ if attributes.key?(:'ip')
79
+ self.ip = attributes[:'ip']
80
+ end
81
+
82
+ if attributes.key?(:'country')
83
+ self.country = attributes[:'country']
84
+ end
85
+
86
+ if attributes.key?(:'city')
87
+ self.city = attributes[:'city']
88
+ end
89
+ end
90
+
91
+ # Show invalid properties with the reasons. Usually used together with valid?
92
+ # @return Array for valid properties with the reasons
93
+ def list_invalid_properties
94
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
95
+ invalid_properties = Array.new
96
+ invalid_properties
97
+ end
98
+
99
+ # Check to see if the all the properties in the model are valid
100
+ # @return true if the model is valid
101
+ def valid?
102
+ warn '[DEPRECATED] the `valid?` method is obsolete'
103
+ true
104
+ end
105
+
106
+ # Checks equality by comparing each attribute.
107
+ # @param [Object] Object to be compared
108
+ def ==(o)
109
+ return true if self.equal?(o)
110
+ self.class == o.class &&
111
+ ip == o.ip &&
112
+ country == o.country &&
113
+ city == o.city
114
+ end
115
+
116
+ # @see the `==` method
117
+ # @param [Object] Object to be compared
118
+ def eql?(o)
119
+ self == o
120
+ end
121
+
122
+ # Calculates hash code according to all attributes.
123
+ # @return [Integer] Hash code
124
+ def hash
125
+ [ip, country, city].hash
126
+ end
127
+
128
+ # Builds the object from hash
129
+ # @param [Hash] attributes Model attributes in the form of hash
130
+ # @return [Object] Returns the model itself
131
+ def self.build_from_hash(attributes)
132
+ return nil unless attributes.is_a?(Hash)
133
+ attributes = attributes.transform_keys(&:to_sym)
134
+ transformed_hash = {}
135
+ openapi_types.each_pair do |key, type|
136
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
137
+ transformed_hash["#{key}"] = nil
138
+ elsif type =~ /\AArray<(.*)>/i
139
+ # check to ensure the input is an array given that the attribute
140
+ # is documented as an array but the input is not
141
+ if attributes[attribute_map[key]].is_a?(Array)
142
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
143
+ end
144
+ elsif !attributes[attribute_map[key]].nil?
145
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
146
+ end
147
+ end
148
+ new(transformed_hash)
149
+ end
150
+
151
+ # Deserializes the data based on type
152
+ # @param string type Data type
153
+ # @param string value Value to be deserialized
154
+ # @return [Object] Deserialized data
155
+ def self._deserialize(type, value)
156
+ case type.to_sym
157
+ when :Time
158
+ Time.parse(value)
159
+ when :Date
160
+ Date.parse(value)
161
+ when :String
162
+ value.to_s
163
+ when :Integer
164
+ value.to_i
165
+ when :Float
166
+ value.to_f
167
+ when :Boolean
168
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
169
+ true
170
+ else
171
+ false
172
+ end
173
+ when :Object
174
+ # generic object (usually a Hash), return directly
175
+ value
176
+ when /\AArray<(?<inner_type>.+)>\z/
177
+ inner_type = Regexp.last_match[:inner_type]
178
+ value.map { |v| _deserialize(inner_type, v) }
179
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
180
+ k_type = Regexp.last_match[:k_type]
181
+ v_type = Regexp.last_match[:v_type]
182
+ {}.tap do |hash|
183
+ value.each do |k, v|
184
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
185
+ end
186
+ end
187
+ else # model
188
+ # models (e.g. Pet) or oneOf
189
+ klass = Tremendous.const_get(type)
190
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
191
+ end
192
+ end
193
+
194
+ # Returns the string representation of the object
195
+ # @return [String] String presentation of the object
196
+ def to_s
197
+ to_hash.to_s
198
+ end
199
+
200
+ # to_body is an alias to to_hash (backward compatibility)
201
+ # @return [Hash] Returns the object in the form of hash
202
+ def to_body
203
+ to_hash
204
+ end
205
+
206
+ # Returns the object in the form of hash
207
+ # @return [Hash] Returns the object in the form of hash
208
+ def to_hash
209
+ hash = {}
210
+ self.class.attribute_map.each_pair do |attr, param|
211
+ value = self.send(attr)
212
+ if value.nil?
213
+ is_nullable = self.class.openapi_nullable.include?(attr)
214
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
215
+ end
216
+
217
+ hash[param] = _to_hash(value)
218
+ end
219
+ hash
220
+ end
221
+
222
+ # Outputs non-array value in the form of hash
223
+ # For object, use to_hash. Otherwise, just return the value
224
+ # @param [Object] value Any valid value
225
+ # @return [Hash] Returns the value in the form of hash
226
+ def _to_hash(value)
227
+ if value.is_a?(Array)
228
+ value.compact.map { |v| _to_hash(v) }
229
+ elsif value.is_a?(Hash)
230
+ {}.tap do |hash|
231
+ value.each { |k, v| hash[k] = _to_hash(v) }
232
+ end
233
+ elsif value.respond_to? :to_hash
234
+ value.to_hash
235
+ else
236
+ value
237
+ end
238
+ end
239
+
240
+ end
241
+
242
+ end
@@ -24,7 +24,7 @@ module Tremendous
24
24
  # Indicates which actions this funding source can perform. <table> <thead> <tr> <th>Permission</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>api_orders</code></td> <td>Usable for orders via API.</td> </tr> <tr> <td><code>dashboard_orders</code></td> <td>Usable for orders via Tremendous dashboard.</td> </tr> <tr> <td><code>balance_funding</code></td> <td>Usable to add funds to a balance (via dashboard or API).</td> </tr> </tbody> </table>
25
25
  attr_accessor :usage_permissions
26
26
 
27
- # Status of the funding_source <table> <thead> <tr> <th>Status</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>active</code></td> <td>Ready for use.</td> </tr> <tr> <td><code>deleted</code></td> <td>Manually removed, and not usable.</td> </tr> <tr> <td><code>pending_confirmation</code></td> <td>Awaiting verification of ownership.</td> </tr> <tr> <td><code>failed</code></td> <td>Last payment attempt failed, and not usable (contact Tremendous support to reinstate).</td> </tr> </tbody> </table>
27
+ # Status of the funding_source <table> <thead> <tr> <th>Status</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>active</code></td> <td>Ready for use.</td> </tr> <tr> <td><code>deleted</code></td> <td>Manually removed, and not usable.</td> </tr> <tr> <td><code>failed</code></td> <td>Last payment attempt failed, and not usable (contact Tremendous support to reinstate).</td> </tr> </tbody> </table>
28
28
  attr_accessor :status
29
29
 
30
30
  # **Only available when `method` is set to `invoice`.**
@@ -177,7 +177,7 @@ module Tremendous
177
177
  return false if @method.nil?
178
178
  method_validator = EnumAttributeValidator.new('String', ["balance", "bank_account", "credit_card", "invoice"])
179
179
  return false unless method_validator.valid?(@method)
180
- status_validator = EnumAttributeValidator.new('String', ["active", "deleted", "pending_confirmation", "failed"])
180
+ status_validator = EnumAttributeValidator.new('String', ["active", "deleted", "failed"])
181
181
  return false unless status_validator.valid?(@status)
182
182
  type_validator = EnumAttributeValidator.new('String', ["COMMERCIAL", "PRO_FORMA", "PREFUNDING_ONLY"])
183
183
  return false unless type_validator.valid?(@type)
@@ -213,7 +213,7 @@ module Tremendous
213
213
  # Custom attribute writer method checking allowed values (enum).
214
214
  # @param [Object] status Object to be assigned
215
215
  def status=(status)
216
- validator = EnumAttributeValidator.new('String', ["active", "deleted", "pending_confirmation", "failed"])
216
+ validator = EnumAttributeValidator.new('String', ["active", "deleted", "failed"])
217
217
  unless validator.valid?(status)
218
218
  fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
219
219
  end
@@ -15,10 +15,10 @@ require 'time'
15
15
 
16
16
  module Tremendous
17
17
  class ListFundingSources200ResponseFundingSourcesInnerMeta
18
- # **Only exists for balance and commercial invoicing.** For balance: available amount (in cents USD) For commercial invoicing: available credit amount calculated as (credit limit - outstanding balance) (in cents USD)
18
+ # **Only exists for balance and commercial invoicing.** For balance: available amount (in cents USD) For commercial invoicing: available credit amount calculated as (credit limit - outstanding balance) (in cents USD) *Caution: In the \"list funding sources\" endpoint this value is cached and may not be up to date. Use the \"get funding source\" endpoint to get the most up to date value.*
19
19
  attr_accessor :available_cents
20
20
 
21
- # **Only available when `method` is set to `balance`.** Funds that are already registered on your Tremendous account but which have not yet been deposited in your account (e.g. unpaid invoices) (in Cents USD).
21
+ # **Only available when `method` is set to `balance`.** Funds that are already registered on your Tremendous account but which have not yet been deposited in your account (e.g. payments that need to be manually reviewed by our ops team) (in Cents USD).
22
22
  attr_accessor :pending_cents
23
23
 
24
24
  # **Only exists for commercial invoicing.** Available credit limit (in cents USD)
@@ -207,6 +207,11 @@ module Tremendous
207
207
  :'day_of_week',
208
208
  :'address_1',
209
209
  :'address_2',
210
+ :'city',
211
+ :'state',
212
+ :'zip',
213
+ :'phone',
214
+ :'emails',
210
215
  :'failure_details'
211
216
  ])
212
217
  end
@@ -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
@@ -24,9 +24,12 @@ module Tremendous
24
24
  # Detailed description of the product. Mostly used for products with a `category` of `charities`.
25
25
  attr_accessor :description
26
26
 
27
- # The category of this product <table> <thead> <tr> <th>Category</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>ach</code></td> <td>Bank transfer to the recipient</td> </tr> <tr> <td><code>charity</code></td> <td>Donations to a charity</td> </tr> <tr> <td><code>instant_debit_transfer</code></td> <td>Instant debit transfer to the recipient</td> </tr> <tr> <td><code>merchant_card</code></td> <td>A gift card for a certain merchant (e.g. Amazon)</td> </tr> <tr> <td><code>paypal</code></td> <td>Payout via PayPal</td> </tr> <tr> <td><code>venmo</code></td> <td>Payout via Venmo</td> </tr> <tr> <td><code>visa_card</code></td> <td>Payout in form of a Visa debit card</td> </tr> <tr> <td><code>cash_app</code></td> <td>Payout via Cash App</td> </tr> </tbody> </table>
27
+ # The category of the product <table> <thead> <tr> <th>Category</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>ach</code></td> <td>Bank transfer to the recipient</td> </tr> <tr> <td><code>charity</code></td> <td>Donations to a charity</td> </tr> <tr> <td><code>instant_debit_transfer</code></td> <td>Instant debit transfer to the recipient</td> </tr> <tr> <td><code>merchant_card</code></td> <td>A gift card for a certain merchant (e.g. Amazon)</td> </tr> <tr> <td><code>paypal</code></td> <td>Payout via PayPal</td> </tr> <tr> <td><code>venmo</code></td> <td>Payout via Venmo</td> </tr> <tr> <td><code>visa_card</code></td> <td>Payout in form of a Visa debit card</td> </tr> <tr> <td><code>cash_app</code></td> <td>Payout via Cash App</td> </tr> </tbody> </table>
28
28
  attr_accessor :category
29
29
 
30
+ # Additional classification for the product. Only applicable to products with a `category` of `merchant_card`. Possible subcategories: * `beauty_and_health` * `digital_financial_services` * `electronics` * `entertainment` * `fashion` * `food_and_drink` * `general_merchandise` * `grocery_and_supermarkets` * `home_and_living` * `mobility_and_fuel` * `sports_and_outdoor_gear` * `travel_and_hospitality`
31
+ attr_accessor :subcategory
32
+
30
33
  # Legal disclosures for this product. Can be in HTML format.
31
34
  attr_accessor :disclosure
32
35
 
@@ -76,6 +79,7 @@ module Tremendous
76
79
  :'name' => :'name',
77
80
  :'description' => :'description',
78
81
  :'category' => :'category',
82
+ :'subcategory' => :'subcategory',
79
83
  :'disclosure' => :'disclosure',
80
84
  :'skus' => :'skus',
81
85
  :'currency_codes' => :'currency_codes',
@@ -103,6 +107,7 @@ module Tremendous
103
107
  :'name' => :'String',
104
108
  :'description' => :'String',
105
109
  :'category' => :'String',
110
+ :'subcategory' => :'String',
106
111
  :'disclosure' => :'String',
107
112
  :'skus' => :'Array<ListProductsResponseProductsInnerSkusInner>',
108
113
  :'currency_codes' => :'Array<String>',
@@ -160,6 +165,10 @@ module Tremendous
160
165
  self.category = nil
161
166
  end
162
167
 
168
+ if attributes.key?(:'subcategory')
169
+ self.subcategory = attributes[:'subcategory']
170
+ end
171
+
163
172
  if attributes.key?(:'disclosure')
164
173
  self.disclosure = attributes[:'disclosure']
165
174
  else
@@ -273,6 +282,8 @@ module Tremendous
273
282
  return false if @category.nil?
274
283
  category_validator = EnumAttributeValidator.new('String', ["ach", "charity", "instant_debit_transfer", "merchant_card", "paypal", "venmo", "visa_card", "cash_app"])
275
284
  return false unless category_validator.valid?(@category)
285
+ subcategory_validator = EnumAttributeValidator.new('String', ["beauty_and_health", "digital_financial_services", "electronics", "entertainment", "fashion", "food_and_drink", "general_merchandise", "grocery_and_supermarkets", "home_and_living", "mobility_and_fuel", "sports_and_outdoor_gear", "travel_and_hospitality"])
286
+ return false unless subcategory_validator.valid?(@subcategory)
276
287
  return false if @disclosure.nil?
277
288
  return false if @currency_codes.nil?
278
289
  return false if @currency_codes.length < 1
@@ -328,6 +339,16 @@ module Tremendous
328
339
  @category = category
329
340
  end
330
341
 
342
+ # Custom attribute writer method checking allowed values (enum).
343
+ # @param [Object] subcategory Object to be assigned
344
+ def subcategory=(subcategory)
345
+ validator = EnumAttributeValidator.new('String', ["beauty_and_health", "digital_financial_services", "electronics", "entertainment", "fashion", "food_and_drink", "general_merchandise", "grocery_and_supermarkets", "home_and_living", "mobility_and_fuel", "sports_and_outdoor_gear", "travel_and_hospitality"])
346
+ unless validator.valid?(subcategory)
347
+ fail ArgumentError, "invalid value for \"subcategory\", must be one of #{validator.allowable_values}."
348
+ end
349
+ @subcategory = subcategory
350
+ end
351
+
331
352
  # Custom attribute writer method with validation
332
353
  # @param [Object] disclosure Value to be assigned
333
354
  def disclosure=(disclosure)
@@ -375,6 +396,7 @@ module Tremendous
375
396
  name == o.name &&
376
397
  description == o.description &&
377
398
  category == o.category &&
399
+ subcategory == o.subcategory &&
378
400
  disclosure == o.disclosure &&
379
401
  skus == o.skus &&
380
402
  currency_codes == o.currency_codes &&
@@ -393,7 +415,7 @@ module Tremendous
393
415
  # Calculates hash code according to all attributes.
394
416
  # @return [Integer] Hash code
395
417
  def hash
396
- [id, name, description, category, disclosure, skus, currency_codes, countries, images, usage_instructions, documents].hash
418
+ [id, name, description, category, subcategory, disclosure, skus, currency_codes, countries, images, usage_instructions, documents].hash
397
419
  end
398
420
 
399
421
  # Builds the object from hash
@@ -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 ListRewards200ResponseRewardsInnerCustomFieldsInner
19
19
  # Tremendous ID of the custom field
20
20
  attr_accessor :id