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
@@ -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>
@@ -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>
@@ -18,16 +18,19 @@ module Tremendous
18
18
  # Unique identifier for the topup request.
19
19
  attr_accessor :id
20
20
 
21
- # Amount in USD intended to be added to your organizations balance.
21
+ # Amount to add to your organization's balance, denominated in `currency_code`.
22
22
  attr_accessor :amount
23
23
 
24
+ # Currency of the topup amount. Always matches the organization's currency.
25
+ attr_accessor :currency_code
26
+
24
27
  # Amount of the processing fee for the topup (typically reserved for credit card topups).
25
28
  attr_accessor :processing_fee
26
29
 
27
30
  # ID of the funding_source object used for this topup.
28
31
  attr_accessor :funding_source_id
29
32
 
30
- # Status of the topup <table> <thead> <tr> <th> Status </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <code> created </code> </td> <td> The topup is processing (and may be under review). </td> </tr> <tr> <td> <code> fully_credited </code> </td> <td> The funds have been added to the balance. </td> </tr> <tr> <td> <code> reversed </code> </td> <td> The topup was credited, but then reversed due to a chargeback or ACH return. </td> </tr> <tr> <td> <code> rejected </code> </td> <td> The topup was rejected by an admin. </td> </tr> </tbody> </table>
33
+ # Status of the topup <table> <thead> <tr> <th> Status </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <code> created </code> </td> <td> The topup is processing (and may be under review). </td> </tr> <tr> <td> <code> partially_credited </code> </td> <td> Some funds have been credited to the balance. The remainder will be credited by <code>expected_settlement_at</code>. </td> </tr> <tr> <td> <code> fully_credited </code> </td> <td> All funds have been added to the balance. </td> </tr> <tr> <td> <code> reversed </code> </td> <td> The topup was credited, but then reversed due to a chargeback or ACH return. </td> </tr> <tr> <td> <code> rejected </code> </td> <td> The topup was rejected by an admin. </td> </tr> </tbody> </table>
31
34
  attr_accessor :status
32
35
 
33
36
  # Timestamp indicating when the topup object was created (when the request was made).
@@ -48,11 +51,21 @@ module Tremendous
48
51
  # Idempotency key to prevent duplicate requests.
49
52
  attr_accessor :idempotency_key
50
53
 
54
+ # Amount credited to the balance immediately. Equals `amount` for non-ACH topups or ACH debits fully within instant funding limits. Can be 0 if nothing was credited instantly.
55
+ attr_accessor :instant_credit_amount
56
+
57
+ # Amount that will be available once the settlement period elapses. 0 if nothing is settling.
58
+ attr_accessor :settled_amount
59
+
60
+ # Timestamp indicating when the pending amount will be credited to the balance. Null if the topup was fully credited immediately.
61
+ attr_accessor :expected_settlement_at
62
+
51
63
  # Attribute mapping from ruby-style variable name to JSON key.
52
64
  def self.attribute_map
53
65
  {
54
66
  :'id' => :'id',
55
67
  :'amount' => :'amount',
68
+ :'currency_code' => :'currency_code',
56
69
  :'processing_fee' => :'processing_fee',
57
70
  :'funding_source_id' => :'funding_source_id',
58
71
  :'status' => :'status',
@@ -61,7 +74,10 @@ module Tremendous
61
74
  :'rejected_at' => :'rejected_at',
62
75
  :'reversed_at' => :'reversed_at',
63
76
  :'reversed_reason' => :'reversed_reason',
64
- :'idempotency_key' => :'idempotency_key'
77
+ :'idempotency_key' => :'idempotency_key',
78
+ :'instant_credit_amount' => :'instant_credit_amount',
79
+ :'settled_amount' => :'settled_amount',
80
+ :'expected_settlement_at' => :'expected_settlement_at'
65
81
  }
66
82
  end
67
83
 
@@ -80,6 +96,7 @@ module Tremendous
80
96
  {
81
97
  :'id' => :'String',
82
98
  :'amount' => :'Float',
99
+ :'currency_code' => :'String',
83
100
  :'processing_fee' => :'Float',
84
101
  :'funding_source_id' => :'String',
85
102
  :'status' => :'String',
@@ -88,7 +105,10 @@ module Tremendous
88
105
  :'rejected_at' => :'Time',
89
106
  :'reversed_at' => :'Time',
90
107
  :'reversed_reason' => :'String',
91
- :'idempotency_key' => :'String'
108
+ :'idempotency_key' => :'String',
109
+ :'instant_credit_amount' => :'Float',
110
+ :'settled_amount' => :'Float',
111
+ :'expected_settlement_at' => :'Date'
92
112
  }
93
113
  end
94
114
 
@@ -99,7 +119,8 @@ module Tremendous
99
119
  :'rejected_at',
100
120
  :'reversed_at',
101
121
  :'reversed_reason',
102
- :'idempotency_key'
122
+ :'idempotency_key',
123
+ :'expected_settlement_at'
103
124
  ])
104
125
  end
105
126
 
@@ -127,6 +148,10 @@ module Tremendous
127
148
  self.amount = attributes[:'amount']
128
149
  end
129
150
 
151
+ if attributes.key?(:'currency_code')
152
+ self.currency_code = attributes[:'currency_code']
153
+ end
154
+
130
155
  if attributes.key?(:'processing_fee')
131
156
  self.processing_fee = attributes[:'processing_fee']
132
157
  end
@@ -162,6 +187,18 @@ module Tremendous
162
187
  if attributes.key?(:'idempotency_key')
163
188
  self.idempotency_key = attributes[:'idempotency_key']
164
189
  end
190
+
191
+ if attributes.key?(:'instant_credit_amount')
192
+ self.instant_credit_amount = attributes[:'instant_credit_amount']
193
+ end
194
+
195
+ if attributes.key?(:'settled_amount')
196
+ self.settled_amount = attributes[:'settled_amount']
197
+ end
198
+
199
+ if attributes.key?(:'expected_settlement_at')
200
+ self.expected_settlement_at = attributes[:'expected_settlement_at']
201
+ end
165
202
  end
166
203
 
167
204
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -186,6 +223,7 @@ module Tremendous
186
223
  self.class == o.class &&
187
224
  id == o.id &&
188
225
  amount == o.amount &&
226
+ currency_code == o.currency_code &&
189
227
  processing_fee == o.processing_fee &&
190
228
  funding_source_id == o.funding_source_id &&
191
229
  status == o.status &&
@@ -194,7 +232,10 @@ module Tremendous
194
232
  rejected_at == o.rejected_at &&
195
233
  reversed_at == o.reversed_at &&
196
234
  reversed_reason == o.reversed_reason &&
197
- idempotency_key == o.idempotency_key
235
+ idempotency_key == o.idempotency_key &&
236
+ instant_credit_amount == o.instant_credit_amount &&
237
+ settled_amount == o.settled_amount &&
238
+ expected_settlement_at == o.expected_settlement_at
198
239
  end
199
240
 
200
241
  # @see the `==` method
@@ -206,7 +247,7 @@ module Tremendous
206
247
  # Calculates hash code according to all attributes.
207
248
  # @return [Integer] Hash code
208
249
  def hash
209
- [id, amount, processing_fee, funding_source_id, status, created_at, fully_credited_at, rejected_at, reversed_at, reversed_reason, idempotency_key].hash
250
+ [id, amount, currency_code, processing_fee, funding_source_id, status, created_at, fully_credited_at, rejected_at, reversed_at, reversed_reason, idempotency_key, instant_credit_amount, settled_amount, expected_settlement_at].hash
210
251
  end
211
252
 
212
253
  # Builds the object from hash
@@ -21,7 +21,7 @@ module Tremendous
21
21
  # Unique key that ensures this request is only processed once.
22
22
  attr_accessor :idempotency_key
23
23
 
24
- # Amount in USD intended to be added to your organizations balance.
24
+ # Amount to add to your organization's balance, denominated in `currency_code`.
25
25
  attr_accessor :amount
26
26
 
27
27
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -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
@@ -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
 
@@ -98,6 +126,10 @@ module Tremendous
98
126
  end
99
127
  end
100
128
 
129
+ if attributes.key?(:'fee_charged_to')
130
+ self.fee_charged_to = attributes[:'fee_charged_to']
131
+ end
132
+
101
133
  if attributes.key?(:'webpage_style')
102
134
  self.webpage_style = attributes[:'webpage_style']
103
135
  end
@@ -119,9 +151,21 @@ module Tremendous
119
151
  # @return true if the model is valid
120
152
  def valid?
121
153
  warn '[DEPRECATED] the `valid?` method is obsolete'
154
+ fee_charged_to_validator = EnumAttributeValidator.new('String', ["SENDER", "RECIPIENT"])
155
+ return false unless fee_charged_to_validator.valid?(@fee_charged_to)
122
156
  true
123
157
  end
124
158
 
159
+ # Custom attribute writer method checking allowed values (enum).
160
+ # @param [Object] fee_charged_to Object to be assigned
161
+ def fee_charged_to=(fee_charged_to)
162
+ validator = EnumAttributeValidator.new('String', ["SENDER", "RECIPIENT"])
163
+ unless validator.valid?(fee_charged_to)
164
+ fail ArgumentError, "invalid value for \"fee_charged_to\", must be one of #{validator.allowable_values}."
165
+ end
166
+ @fee_charged_to = fee_charged_to
167
+ end
168
+
125
169
  # Checks equality by comparing each attribute.
126
170
  # @param [Object] Object to be compared
127
171
  def ==(o)
@@ -130,6 +174,7 @@ module Tremendous
130
174
  name == o.name &&
131
175
  description == o.description &&
132
176
  products == o.products &&
177
+ fee_charged_to == o.fee_charged_to &&
133
178
  webpage_style == o.webpage_style &&
134
179
  email_style == o.email_style
135
180
  end
@@ -143,7 +188,7 @@ module Tremendous
143
188
  # Calculates hash code according to all attributes.
144
189
  # @return [Integer] Hash code
145
190
  def hash
146
- [name, description, products, webpage_style, email_style].hash
191
+ [name, description, products, fee_charged_to, webpage_style, email_style].hash
147
192
  end
148
193
 
149
194
  # Builds the object from hash
@@ -1,3 +1,3 @@
1
1
  module Tremendous
2
- VERSION = "5.21.0"
2
+ VERSION = "5.22.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tremendous_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.21.0
4
+ version: 5.22.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tremendous Developers