tremendous_ruby 5.21.0 → 5.22.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 (50) hide show
  1. checksums.yaml +4 -4
  2. data/lib/tremendous/models/balance_transaction.rb +30 -3
  3. data/lib/tremendous/models/balance_transaction_order_payment.rb +32 -5
  4. data/lib/tremendous/models/campaign.rb +46 -1
  5. data/lib/tremendous/models/campaign_base.rb +46 -1
  6. data/lib/tremendous/models/connected_organization_organization.rb +11 -1
  7. data/lib/tremendous/models/create_campaign_request.rb +46 -1
  8. data/lib/tremendous/models/create_order200_response_order.rb +1 -1
  9. data/lib/tremendous/models/create_organization.rb +11 -1
  10. data/lib/tremendous/models/create_organization200_response_organization.rb +11 -1
  11. data/lib/tremendous/models/create_organization_for_response.rb +11 -1
  12. data/lib/tremendous/models/create_organization_properties.rb +11 -1
  13. data/lib/tremendous/models/create_organization_request.rb +14 -4
  14. data/lib/tremendous/models/create_topup_request.rb +1 -1
  15. data/lib/tremendous/models/fraud_config_redeemed_rewards_amount.rb +1 -1
  16. data/lib/tremendous/models/fraud_review.rb +1 -1
  17. data/lib/tremendous/models/fraud_review_related_rewards.rb +16 -5
  18. data/lib/tremendous/models/fraud_rules_list_item.rb +1 -1
  19. data/lib/tremendous/models/get_fraud_review200_response_fraud_review_related_rewards.rb +15 -5
  20. data/lib/tremendous/models/list_balance_transactions200_response_transactions_inner.rb +30 -3
  21. data/lib/tremendous/models/list_balance_transactions200_response_transactions_inner_order_payment.rb +32 -5
  22. data/lib/tremendous/models/list_campaigns200_response_campaigns_inner.rb +46 -1
  23. data/lib/tremendous/models/list_connected_organizations200_response_connected_organizations_inner_organization.rb +11 -1
  24. data/lib/tremendous/models/list_fraud_rules200_response_fraud_rules_inner.rb +1 -1
  25. data/lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb +44 -4
  26. data/lib/tremendous/models/list_orders200_response_orders_inner.rb +1 -1
  27. data/lib/tremendous/models/list_orders200_response_orders_inner_payment.rb +33 -6
  28. data/lib/tremendous/models/list_orders200_response_orders_inner_payment_refund.rb +33 -6
  29. data/lib/tremendous/models/list_organizations200_response_organizations_inner.rb +11 -1
  30. data/lib/tremendous/models/list_rewards200_response_rewards_inner_recipient.rb +1 -0
  31. data/lib/tremendous/models/list_topups200_response_topups_inner.rb +48 -7
  32. data/lib/tremendous/models/order.rb +1 -1
  33. data/lib/tremendous/models/order_base.rb +1 -1
  34. data/lib/tremendous/models/order_base_payment.rb +33 -6
  35. data/lib/tremendous/models/order_with_link.rb +1 -1
  36. data/lib/tremendous/models/order_without_link.rb +1 -1
  37. data/lib/tremendous/models/organization.rb +11 -1
  38. data/lib/tremendous/models/payment_details.rb +32 -5
  39. data/lib/tremendous/models/payment_details_refund.rb +33 -6
  40. data/lib/tremendous/models/recipient.rb +1 -0
  41. data/lib/tremendous/models/refund_details.rb +32 -5
  42. data/lib/tremendous/models/review_redeemed_rewards_amount.rb +1 -1
  43. data/lib/tremendous/models/single_reward_order_with_link_order.rb +1 -1
  44. data/lib/tremendous/models/single_reward_order_without_link_order.rb +1 -1
  45. data/lib/tremendous/models/topup.rb +48 -7
  46. data/lib/tremendous/models/topup_create_request.rb +1 -1
  47. data/lib/tremendous/models/update_campaign.rb +46 -1
  48. data/lib/tremendous/models/update_campaign_request.rb +46 -1
  49. data/lib/tremendous/version.rb +1 -1
  50. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8e1b3b289fa165e9aad09ff4db72e7d5a4cd7fee02df49e0e1e3900bdffa8169
4
- data.tar.gz: 07e4346741282945c335770ea4efcdd45ef877621990a7e3857d5a80fe03b661
3
+ metadata.gz: 45254cb5062ac51da11cd26dfe924007969603695dd4e542f7bf789954732ae1
4
+ data.tar.gz: 78b00c774379d33fd3cbafaa9ad38897ab9d1a39071554c96f4c63143209e396
5
5
  SHA512:
6
- metadata.gz: 5de40b45138974a56921e645a6134d638bb7d3a7f1fe5cde6e3da631394e978edd49e8f393bb3b436a91eeeb141e81ac87bd22924d7a5f8a309ea9bb7ef93594
7
- data.tar.gz: 4bdbe2f69085434cd50e847df92c62e1d790881c0cbe6b2592dda87af5de4113bf473555b6465f5e27ec3643b9da0e852eaf61db9bb5320d92129f0d7ebb4ccc
6
+ metadata.gz: 5b5f47b1aff50aa826b8142aac1c6c618e24a650253712ed030a9004c9d3814cfd428c9e822cfada56cf17d4a1b54e6cd4cfd97d78e6967908b34ee09bc9d458
7
+ data.tar.gz: 91f7799d8927190ef8797bdec5bba156ce6667cc6274c755db2a0521174bbd92fc1bc1b97fcef55e38d3b93e346839641367b10e4d007b910cf49f8b87eddc1d
@@ -19,10 +19,13 @@ module Tremendous
19
19
  # Date that the transaction was created
20
20
  attr_accessor :created_at
21
21
 
22
- # Amount of the transaction in USD
22
+ # Amount of the transaction, denominated in `currency_code`.
23
23
  attr_accessor :amount
24
24
 
25
- # The updated total after the transaction. Note that this running balance may be delayed and contain `null`.
25
+ # Currency of the transaction amount and running balance. Always matches the organization's currency.
26
+ attr_accessor :currency_code
27
+
28
+ # The updated total after the transaction, denominated in `currency_code`. Note that this running balance may be delayed and contain `null`.
26
29
  attr_accessor :balance
27
30
 
28
31
  # The action that was performed
@@ -38,6 +41,7 @@ module Tremendous
38
41
  {
39
42
  :'created_at' => :'created_at',
40
43
  :'amount' => :'amount',
44
+ :'currency_code' => :'currency_code',
41
45
  :'balance' => :'balance',
42
46
  :'action' => :'action',
43
47
  :'description' => :'description',
@@ -60,6 +64,7 @@ module Tremendous
60
64
  {
61
65
  :'created_at' => :'Time',
62
66
  :'amount' => :'Float',
67
+ :'currency_code' => :'String',
63
68
  :'balance' => :'Float',
64
69
  :'action' => :'String',
65
70
  :'description' => :'String',
@@ -101,6 +106,12 @@ module Tremendous
101
106
  self.amount = nil
102
107
  end
103
108
 
109
+ if attributes.key?(:'currency_code')
110
+ self.currency_code = attributes[:'currency_code']
111
+ else
112
+ self.currency_code = nil
113
+ end
114
+
104
115
  if attributes.key?(:'balance')
105
116
  self.balance = attributes[:'balance']
106
117
  else
@@ -137,6 +148,10 @@ module Tremendous
137
148
  invalid_properties.push('invalid value for "amount", amount cannot be nil.')
138
149
  end
139
150
 
151
+ if @currency_code.nil?
152
+ invalid_properties.push('invalid value for "currency_code", currency_code cannot be nil.')
153
+ end
154
+
140
155
  if @balance.nil?
141
156
  invalid_properties.push('invalid value for "balance", balance cannot be nil.')
142
157
  end
@@ -158,6 +173,7 @@ module Tremendous
158
173
  warn '[DEPRECATED] the `valid?` method is obsolete'
159
174
  return false if @created_at.nil?
160
175
  return false if @amount.nil?
176
+ return false if @currency_code.nil?
161
177
  return false if @balance.nil?
162
178
  return false if @action.nil?
163
179
  return false if @description.nil?
@@ -184,6 +200,16 @@ module Tremendous
184
200
  @amount = amount
185
201
  end
186
202
 
203
+ # Custom attribute writer method with validation
204
+ # @param [Object] currency_code Value to be assigned
205
+ def currency_code=(currency_code)
206
+ if currency_code.nil?
207
+ fail ArgumentError, 'currency_code cannot be nil'
208
+ end
209
+
210
+ @currency_code = currency_code
211
+ end
212
+
187
213
  # Custom attribute writer method with validation
188
214
  # @param [Object] balance Value to be assigned
189
215
  def balance=(balance)
@@ -221,6 +247,7 @@ module Tremendous
221
247
  self.class == o.class &&
222
248
  created_at == o.created_at &&
223
249
  amount == o.amount &&
250
+ currency_code == o.currency_code &&
224
251
  balance == o.balance &&
225
252
  action == o.action &&
226
253
  description == o.description &&
@@ -236,7 +263,7 @@ module Tremendous
236
263
  # Calculates hash code according to all attributes.
237
264
  # @return [Integer] Hash code
238
265
  def hash
239
- [created_at, amount, balance, action, description, order].hash
266
+ [created_at, amount, currency_code, balance, action, description, order].hash
240
267
  end
241
268
 
242
269
  # Builds the object from hash
@@ -15,18 +15,21 @@ require 'time'
15
15
 
16
16
  module Tremendous
17
17
  class BalanceTransactionOrderPayment
18
- # Total price of the order before fees (in USD)
18
+ # Total price of the order before fees, denominated in `currency_code`.
19
19
  attr_accessor :subtotal
20
20
 
21
- # Total price of the order including fees (in USD)
21
+ # Total price of the order including fees, denominated in `currency_code`.
22
22
  attr_accessor :total
23
23
 
24
- # Fees for the order (in USD)
24
+ # Fees for the order, denominated in `currency_code`.
25
25
  attr_accessor :fees
26
26
 
27
- # Discount for the order (in USD)
27
+ # Discount for the order, denominated in `currency_code`.
28
28
  attr_accessor :discount
29
29
 
30
+ # Currency in which the payment amounts (subtotal, total, fees, discount, refund) are denominated. This always matches the organization's currency.
31
+ attr_accessor :currency_code
32
+
30
33
  attr_accessor :refund
31
34
 
32
35
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -36,6 +39,7 @@ module Tremendous
36
39
  :'total' => :'total',
37
40
  :'fees' => :'fees',
38
41
  :'discount' => :'discount',
42
+ :'currency_code' => :'currency_code',
39
43
  :'refund' => :'refund'
40
44
  }
41
45
  end
@@ -57,6 +61,7 @@ module Tremendous
57
61
  :'total' => :'Float',
58
62
  :'fees' => :'Float',
59
63
  :'discount' => :'Float',
64
+ :'currency_code' => :'String',
60
65
  :'refund' => :'PaymentDetailsRefund'
61
66
  }
62
67
  end
@@ -107,6 +112,12 @@ module Tremendous
107
112
  self.discount = nil
108
113
  end
109
114
 
115
+ if attributes.key?(:'currency_code')
116
+ self.currency_code = attributes[:'currency_code']
117
+ else
118
+ self.currency_code = nil
119
+ end
120
+
110
121
  if attributes.key?(:'refund')
111
122
  self.refund = attributes[:'refund']
112
123
  end
@@ -149,6 +160,10 @@ module Tremendous
149
160
  invalid_properties.push('invalid value for "discount", must be greater than or equal to 0.')
150
161
  end
151
162
 
163
+ if @currency_code.nil?
164
+ invalid_properties.push('invalid value for "currency_code", currency_code cannot be nil.')
165
+ end
166
+
152
167
  invalid_properties
153
168
  end
154
169
 
@@ -164,6 +179,7 @@ module Tremendous
164
179
  return false if @fees < 0
165
180
  return false if @discount.nil?
166
181
  return false if @discount < 0
182
+ return false if @currency_code.nil?
167
183
  true
168
184
  end
169
185
 
@@ -223,6 +239,16 @@ module Tremendous
223
239
  @discount = discount
224
240
  end
225
241
 
242
+ # Custom attribute writer method with validation
243
+ # @param [Object] currency_code Value to be assigned
244
+ def currency_code=(currency_code)
245
+ if currency_code.nil?
246
+ fail ArgumentError, 'currency_code cannot be nil'
247
+ end
248
+
249
+ @currency_code = currency_code
250
+ end
251
+
226
252
  # Checks equality by comparing each attribute.
227
253
  # @param [Object] Object to be compared
228
254
  def ==(o)
@@ -232,6 +258,7 @@ module Tremendous
232
258
  total == o.total &&
233
259
  fees == o.fees &&
234
260
  discount == o.discount &&
261
+ currency_code == o.currency_code &&
235
262
  refund == o.refund
236
263
  end
237
264
 
@@ -244,7 +271,7 @@ module Tremendous
244
271
  # Calculates hash code according to all attributes.
245
272
  # @return [Integer] Hash code
246
273
  def hash
247
- [subtotal, total, fees, discount, refund].hash
274
+ [subtotal, total, fees, discount, currency_code, refund].hash
248
275
  end
249
276
 
250
277
  # Builds the object from hash
@@ -27,10 +27,35 @@ module Tremendous
27
27
  # List of IDs of products (different gift cards, charity, etc.) that are available in this campaign.
28
28
  attr_accessor :products
29
29
 
30
+ # Determines whether fees for premium products are added to the order total (`SENDER`) or deducted from the recipient's reward amount (`RECIPIENT`). Campaigns with `RECIPIENT` must include at least one fee-free product.
31
+ attr_accessor :fee_charged_to
32
+
30
33
  attr_accessor :webpage_style
31
34
 
32
35
  attr_accessor :email_style
33
36
 
37
+ class EnumAttributeValidator
38
+ attr_reader :datatype
39
+ attr_reader :allowable_values
40
+
41
+ def initialize(datatype, allowable_values)
42
+ @allowable_values = allowable_values.map do |value|
43
+ case datatype.to_s
44
+ when /Integer/i
45
+ value.to_i
46
+ when /Float/i
47
+ value.to_f
48
+ else
49
+ value
50
+ end
51
+ end
52
+ end
53
+
54
+ def valid?(value)
55
+ !value || allowable_values.include?(value)
56
+ end
57
+ end
58
+
34
59
  # Attribute mapping from ruby-style variable name to JSON key.
35
60
  def self.attribute_map
36
61
  {
@@ -38,6 +63,7 @@ module Tremendous
38
63
  :'name' => :'name',
39
64
  :'description' => :'description',
40
65
  :'products' => :'products',
66
+ :'fee_charged_to' => :'fee_charged_to',
41
67
  :'webpage_style' => :'webpage_style',
42
68
  :'email_style' => :'email_style'
43
69
  }
@@ -60,6 +86,7 @@ module Tremendous
60
86
  :'name' => :'String',
61
87
  :'description' => :'String',
62
88
  :'products' => :'Array<String>',
89
+ :'fee_charged_to' => :'String',
63
90
  :'webpage_style' => :'ListCampaigns200ResponseCampaignsInnerWebpageStyle',
64
91
  :'email_style' => :'ListCampaigns200ResponseCampaignsInnerEmailStyle'
65
92
  }
@@ -69,6 +96,7 @@ module Tremendous
69
96
  def self.openapi_nullable
70
97
  Set.new([
71
98
  :'description',
99
+ :'fee_charged_to',
72
100
  ])
73
101
  end
74
102
 
@@ -112,6 +140,10 @@ module Tremendous
112
140
  self.products = nil
113
141
  end
114
142
 
143
+ if attributes.key?(:'fee_charged_to')
144
+ self.fee_charged_to = attributes[:'fee_charged_to']
145
+ end
146
+
115
147
  if attributes.key?(:'webpage_style')
116
148
  self.webpage_style = attributes[:'webpage_style']
117
149
  end
@@ -149,6 +181,8 @@ module Tremendous
149
181
  return false if !@id.nil? && @id !~ Regexp.new(/[A-Z0-9]{4,20}/)
150
182
  return false if @name.nil?
151
183
  return false if @products.nil?
184
+ fee_charged_to_validator = EnumAttributeValidator.new('String', ["SENDER", "RECIPIENT"])
185
+ return false unless fee_charged_to_validator.valid?(@fee_charged_to)
152
186
  true
153
187
  end
154
188
 
@@ -187,6 +221,16 @@ module Tremendous
187
221
  @products = products
188
222
  end
189
223
 
224
+ # Custom attribute writer method checking allowed values (enum).
225
+ # @param [Object] fee_charged_to Object to be assigned
226
+ def fee_charged_to=(fee_charged_to)
227
+ validator = EnumAttributeValidator.new('String', ["SENDER", "RECIPIENT"])
228
+ unless validator.valid?(fee_charged_to)
229
+ fail ArgumentError, "invalid value for \"fee_charged_to\", must be one of #{validator.allowable_values}."
230
+ end
231
+ @fee_charged_to = fee_charged_to
232
+ end
233
+
190
234
  # Checks equality by comparing each attribute.
191
235
  # @param [Object] Object to be compared
192
236
  def ==(o)
@@ -196,6 +240,7 @@ module Tremendous
196
240
  name == o.name &&
197
241
  description == o.description &&
198
242
  products == o.products &&
243
+ fee_charged_to == o.fee_charged_to &&
199
244
  webpage_style == o.webpage_style &&
200
245
  email_style == o.email_style
201
246
  end
@@ -209,7 +254,7 @@ module Tremendous
209
254
  # Calculates hash code according to all attributes.
210
255
  # @return [Integer] Hash code
211
256
  def hash
212
- [id, name, description, products, webpage_style, email_style].hash
257
+ [id, name, description, products, fee_charged_to, webpage_style, email_style].hash
213
258
  end
214
259
 
215
260
  # Builds the object from hash
@@ -27,10 +27,35 @@ module Tremendous
27
27
  # List of IDs of products (different gift cards, charity, etc.) that are available in this campaign.
28
28
  attr_accessor :products
29
29
 
30
+ # Determines whether fees for premium products are added to the order total (`SENDER`) or deducted from the recipient's reward amount (`RECIPIENT`). Campaigns with `RECIPIENT` must include at least one fee-free product.
31
+ attr_accessor :fee_charged_to
32
+
30
33
  attr_accessor :webpage_style
31
34
 
32
35
  attr_accessor :email_style
33
36
 
37
+ class EnumAttributeValidator
38
+ attr_reader :datatype
39
+ attr_reader :allowable_values
40
+
41
+ def initialize(datatype, allowable_values)
42
+ @allowable_values = allowable_values.map do |value|
43
+ case datatype.to_s
44
+ when /Integer/i
45
+ value.to_i
46
+ when /Float/i
47
+ value.to_f
48
+ else
49
+ value
50
+ end
51
+ end
52
+ end
53
+
54
+ def valid?(value)
55
+ !value || allowable_values.include?(value)
56
+ end
57
+ end
58
+
34
59
  # Attribute mapping from ruby-style variable name to JSON key.
35
60
  def self.attribute_map
36
61
  {
@@ -38,6 +63,7 @@ module Tremendous
38
63
  :'name' => :'name',
39
64
  :'description' => :'description',
40
65
  :'products' => :'products',
66
+ :'fee_charged_to' => :'fee_charged_to',
41
67
  :'webpage_style' => :'webpage_style',
42
68
  :'email_style' => :'email_style'
43
69
  }
@@ -60,6 +86,7 @@ module Tremendous
60
86
  :'name' => :'String',
61
87
  :'description' => :'String',
62
88
  :'products' => :'Array<String>',
89
+ :'fee_charged_to' => :'String',
63
90
  :'webpage_style' => :'ListCampaigns200ResponseCampaignsInnerWebpageStyle',
64
91
  :'email_style' => :'ListCampaigns200ResponseCampaignsInnerEmailStyle'
65
92
  }
@@ -69,6 +96,7 @@ module Tremendous
69
96
  def self.openapi_nullable
70
97
  Set.new([
71
98
  :'description',
99
+ :'fee_charged_to',
72
100
  ])
73
101
  end
74
102
 
@@ -106,6 +134,10 @@ module Tremendous
106
134
  end
107
135
  end
108
136
 
137
+ if attributes.key?(:'fee_charged_to')
138
+ self.fee_charged_to = attributes[:'fee_charged_to']
139
+ end
140
+
109
141
  if attributes.key?(:'webpage_style')
110
142
  self.webpage_style = attributes[:'webpage_style']
111
143
  end
@@ -133,6 +165,8 @@ module Tremendous
133
165
  def valid?
134
166
  warn '[DEPRECATED] the `valid?` method is obsolete'
135
167
  return false if !@id.nil? && @id !~ Regexp.new(/[A-Z0-9]{4,20}/)
168
+ fee_charged_to_validator = EnumAttributeValidator.new('String', ["SENDER", "RECIPIENT"])
169
+ return false unless fee_charged_to_validator.valid?(@fee_charged_to)
136
170
  true
137
171
  end
138
172
 
@@ -151,6 +185,16 @@ module Tremendous
151
185
  @id = id
152
186
  end
153
187
 
188
+ # Custom attribute writer method checking allowed values (enum).
189
+ # @param [Object] fee_charged_to Object to be assigned
190
+ def fee_charged_to=(fee_charged_to)
191
+ validator = EnumAttributeValidator.new('String', ["SENDER", "RECIPIENT"])
192
+ unless validator.valid?(fee_charged_to)
193
+ fail ArgumentError, "invalid value for \"fee_charged_to\", must be one of #{validator.allowable_values}."
194
+ end
195
+ @fee_charged_to = fee_charged_to
196
+ end
197
+
154
198
  # Checks equality by comparing each attribute.
155
199
  # @param [Object] Object to be compared
156
200
  def ==(o)
@@ -160,6 +204,7 @@ module Tremendous
160
204
  name == o.name &&
161
205
  description == o.description &&
162
206
  products == o.products &&
207
+ fee_charged_to == o.fee_charged_to &&
163
208
  webpage_style == o.webpage_style &&
164
209
  email_style == o.email_style
165
210
  end
@@ -173,7 +218,7 @@ module Tremendous
173
218
  # Calculates hash code according to all attributes.
174
219
  # @return [Integer] Hash code
175
220
  def hash
176
- [id, name, description, products, webpage_style, email_style].hash
221
+ [id, name, description, products, fee_charged_to, webpage_style, email_style].hash
177
222
  end
178
223
 
179
224
  # Builds the object from hash
@@ -24,6 +24,9 @@ module Tremendous
24
24
  # URL of the website of that organization
25
25
  attr_accessor :website
26
26
 
27
+ # Currency used for this organization's balances, orders, and transactions.
28
+ attr_accessor :currency_code
29
+
27
30
  # Status of the organization. Organizations need to be approved to be able to use them to send out rewards.
28
31
  attr_accessor :status
29
32
 
@@ -58,6 +61,7 @@ module Tremendous
58
61
  :'id' => :'id',
59
62
  :'name' => :'name',
60
63
  :'website' => :'website',
64
+ :'currency_code' => :'currency_code',
61
65
  :'status' => :'status',
62
66
  :'created_at' => :'created_at'
63
67
  }
@@ -79,6 +83,7 @@ module Tremendous
79
83
  :'id' => :'String',
80
84
  :'name' => :'String',
81
85
  :'website' => :'String',
86
+ :'currency_code' => :'String',
82
87
  :'status' => :'String',
83
88
  :'created_at' => :'Date'
84
89
  }
@@ -122,6 +127,10 @@ module Tremendous
122
127
  self.website = nil
123
128
  end
124
129
 
130
+ if attributes.key?(:'currency_code')
131
+ self.currency_code = attributes[:'currency_code']
132
+ end
133
+
125
134
  if attributes.key?(:'status')
126
135
  self.status = attributes[:'status']
127
136
  end
@@ -217,6 +226,7 @@ module Tremendous
217
226
  id == o.id &&
218
227
  name == o.name &&
219
228
  website == o.website &&
229
+ currency_code == o.currency_code &&
220
230
  status == o.status &&
221
231
  created_at == o.created_at
222
232
  end
@@ -230,7 +240,7 @@ module Tremendous
230
240
  # Calculates hash code according to all attributes.
231
241
  # @return [Integer] Hash code
232
242
  def hash
233
- [id, name, website, status, created_at].hash
243
+ [id, name, website, currency_code, status, created_at].hash
234
244
  end
235
245
 
236
246
  # Builds the object from hash
@@ -25,16 +25,42 @@ module Tremendous
25
25
  # List of IDs of products (different gift cards, charity, etc.) that are available in this campaign.
26
26
  attr_accessor :products
27
27
 
28
+ # Determines whether fees for premium products are added to the order total (`SENDER`) or deducted from the recipient's reward amount (`RECIPIENT`). Campaigns with `RECIPIENT` must include at least one fee-free product.
29
+ attr_accessor :fee_charged_to
30
+
28
31
  attr_accessor :webpage_style
29
32
 
30
33
  attr_accessor :email_style
31
34
 
35
+ class EnumAttributeValidator
36
+ attr_reader :datatype
37
+ attr_reader :allowable_values
38
+
39
+ def initialize(datatype, allowable_values)
40
+ @allowable_values = allowable_values.map do |value|
41
+ case datatype.to_s
42
+ when /Integer/i
43
+ value.to_i
44
+ when /Float/i
45
+ value.to_f
46
+ else
47
+ value
48
+ end
49
+ end
50
+ end
51
+
52
+ def valid?(value)
53
+ !value || allowable_values.include?(value)
54
+ end
55
+ end
56
+
32
57
  # Attribute mapping from ruby-style variable name to JSON key.
33
58
  def self.attribute_map
34
59
  {
35
60
  :'name' => :'name',
36
61
  :'description' => :'description',
37
62
  :'products' => :'products',
63
+ :'fee_charged_to' => :'fee_charged_to',
38
64
  :'webpage_style' => :'webpage_style',
39
65
  :'email_style' => :'email_style'
40
66
  }
@@ -56,6 +82,7 @@ module Tremendous
56
82
  :'name' => :'String',
57
83
  :'description' => :'String',
58
84
  :'products' => :'Array<String>',
85
+ :'fee_charged_to' => :'String',
59
86
  :'webpage_style' => :'ListCampaigns200ResponseCampaignsInnerWebpageStyle',
60
87
  :'email_style' => :'ListCampaigns200ResponseCampaignsInnerEmailStyle'
61
88
  }
@@ -65,6 +92,7 @@ module Tremendous
65
92
  def self.openapi_nullable
66
93
  Set.new([
67
94
  :'description',
95
+ :'fee_charged_to',
68
96
  ])
69
97
  end
70
98
 
@@ -104,6 +132,10 @@ module Tremendous
104
132
  self.products = nil
105
133
  end
106
134
 
135
+ if attributes.key?(:'fee_charged_to')
136
+ self.fee_charged_to = attributes[:'fee_charged_to']
137
+ end
138
+
107
139
  if attributes.key?(:'webpage_style')
108
140
  self.webpage_style = attributes[:'webpage_style']
109
141
  end
@@ -135,6 +167,8 @@ module Tremendous
135
167
  warn '[DEPRECATED] the `valid?` method is obsolete'
136
168
  return false if @name.nil?
137
169
  return false if @products.nil?
170
+ fee_charged_to_validator = EnumAttributeValidator.new('String', ["SENDER", "RECIPIENT"])
171
+ return false unless fee_charged_to_validator.valid?(@fee_charged_to)
138
172
  true
139
173
  end
140
174
 
@@ -158,6 +192,16 @@ module Tremendous
158
192
  @products = products
159
193
  end
160
194
 
195
+ # Custom attribute writer method checking allowed values (enum).
196
+ # @param [Object] fee_charged_to Object to be assigned
197
+ def fee_charged_to=(fee_charged_to)
198
+ validator = EnumAttributeValidator.new('String', ["SENDER", "RECIPIENT"])
199
+ unless validator.valid?(fee_charged_to)
200
+ fail ArgumentError, "invalid value for \"fee_charged_to\", must be one of #{validator.allowable_values}."
201
+ end
202
+ @fee_charged_to = fee_charged_to
203
+ end
204
+
161
205
  # Checks equality by comparing each attribute.
162
206
  # @param [Object] Object to be compared
163
207
  def ==(o)
@@ -166,6 +210,7 @@ module Tremendous
166
210
  name == o.name &&
167
211
  description == o.description &&
168
212
  products == o.products &&
213
+ fee_charged_to == o.fee_charged_to &&
169
214
  webpage_style == o.webpage_style &&
170
215
  email_style == o.email_style
171
216
  end
@@ -179,7 +224,7 @@ module Tremendous
179
224
  # Calculates hash code according to all attributes.
180
225
  # @return [Integer] Hash code
181
226
  def hash
182
- [name, description, products, webpage_style, email_style].hash
227
+ [name, description, products, fee_charged_to, webpage_style, email_style].hash
183
228
  end
184
229
 
185
230
  # Builds the object from hash
@@ -25,7 +25,7 @@ module Tremendous
25
25
  # ID of the campaign in your account, that defines the available products (different gift cards, charity, etc.) that the recipient can choose from.
26
26
  attr_accessor :campaign_id
27
27
 
28
- # Date the order has been created
28
+ # Date the order was created
29
29
  attr_accessor :created_at
30
30
 
31
31
  # Execution status of a given order <table> <thead> <tr> <th> Status </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <code> CANCELED </code> </td> <td> The order and all of its rewards were canceled. </td> </tr> <tr> <td> <code> OPEN </code> </td> <td> The order has been created, but hasn't yet been processed. </td> </tr> <tr> <td> <code> EXECUTED </code> </td> <td> The order has been executed. Payment has been handled and rewards are being delivered (if applicable). </td> </tr> <tr> <td> <code> FAILED </code> </td> <td> The order could not be processed due to an error. E.g. due to insufficient funds in the account. </td> </tr> <tr> <td> <code> PENDING APPROVAL </code> </td> <td> The order has been created but needs approval to be executed. </td> </tr> <tr> <td> <code> PENDING INTERNAL PAYMENT APPROVAL </code> </td> <td> The order has been created but it is under review and requires approval from our team. </td> </tr> <tr> <td> <code> PENDING SETTLEMENT </code> </td> <td> The order has been created but the funds are being held until the settlement window clears. </td> </tr> </tbody> </table>
@@ -31,6 +31,9 @@ module Tremendous
31
31
  # Phone number of the organization. For non-US phone numbers, specify the country code (prefixed with +).
32
32
  attr_accessor :phone
33
33
 
34
+ # Currency code for the new organization. Defaults to the current organization's currency if not provided.
35
+ attr_accessor :currency_code
36
+
34
37
  # Timestamp of when the organization has been created.
35
38
  attr_accessor :created_at
36
39
 
@@ -43,6 +46,7 @@ module Tremendous
43
46
  :'with_api_key' => :'with_api_key',
44
47
  :'copy_settings' => :'copy_settings',
45
48
  :'phone' => :'phone',
49
+ :'currency_code' => :'currency_code',
46
50
  :'created_at' => :'created_at'
47
51
  }
48
52
  end
@@ -66,6 +70,7 @@ module Tremendous
66
70
  :'with_api_key' => :'Boolean',
67
71
  :'copy_settings' => :'CreateOrganizationRequestCopySettings',
68
72
  :'phone' => :'String',
73
+ :'currency_code' => :'String',
69
74
  :'created_at' => :'Date'
70
75
  }
71
76
  end
@@ -122,6 +127,10 @@ module Tremendous
122
127
  self.phone = attributes[:'phone']
123
128
  end
124
129
 
130
+ if attributes.key?(:'currency_code')
131
+ self.currency_code = attributes[:'currency_code']
132
+ end
133
+
125
134
  if attributes.key?(:'created_at')
126
135
  self.created_at = attributes[:'created_at']
127
136
  end
@@ -219,6 +228,7 @@ module Tremendous
219
228
  with_api_key == o.with_api_key &&
220
229
  copy_settings == o.copy_settings &&
221
230
  phone == o.phone &&
231
+ currency_code == o.currency_code &&
222
232
  created_at == o.created_at
223
233
  end
224
234
 
@@ -231,7 +241,7 @@ module Tremendous
231
241
  # Calculates hash code according to all attributes.
232
242
  # @return [Integer] Hash code
233
243
  def hash
234
- [id, name, website, with_api_key, copy_settings, phone, created_at].hash
244
+ [id, name, website, with_api_key, copy_settings, phone, currency_code, created_at].hash
235
245
  end
236
246
 
237
247
  # Builds the object from hash