tremendous_ruby 5.5.0 → 5.6.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 (56) hide show
  1. checksums.yaml +4 -4
  2. data/lib/tremendous/api/tremendous_api.rb +9 -349
  3. data/lib/tremendous/models/base_order_for_create.rb +1 -1
  4. data/lib/tremendous/models/create_order200_response.rb +1 -1
  5. data/lib/tremendous/models/create_order200_response_order.rb +403 -0
  6. data/lib/tremendous/models/create_order200_response_order_rewards_inner.rb +326 -0
  7. data/lib/tremendous/models/create_order200_response_order_rewards_inner_delivery.rb +296 -0
  8. data/lib/tremendous/models/{create_public_key_request.rb → create_order201_response.rb} +14 -15
  9. data/lib/tremendous/models/create_order_request.rb +1 -1
  10. data/lib/tremendous/models/create_organization.rb +51 -4
  11. data/lib/tremendous/models/create_organization200_response_organization.rb +20 -45
  12. data/lib/tremendous/models/{public_keys_response_public_keys_inner.rb → create_organization_for_response.rb} +72 -20
  13. data/lib/tremendous/models/{public_key.rb → create_organization_properties.rb} +57 -20
  14. data/lib/tremendous/models/create_organization_request.rb +7 -0
  15. data/lib/tremendous/models/delivery_details.rb +0 -14
  16. data/lib/tremendous/models/delivery_details_with_link.rb +296 -0
  17. data/lib/tremendous/models/error_model.rb +11 -1
  18. data/lib/tremendous/models/fraud_rule400_response.rb +11 -1
  19. data/lib/tremendous/models/fraud_rule422_response.rb +11 -1
  20. data/lib/tremendous/models/fraud_rules_list_item.rb +4 -2
  21. data/lib/tremendous/models/generate_reward_link403_response.rb +11 -1
  22. data/lib/tremendous/models/invoice.rb +10 -1
  23. data/lib/tremendous/models/list_fraud_reviews200_response.rb +21 -4
  24. data/lib/tremendous/models/list_fraud_rules200_response_fraud_rules_inner.rb +4 -2
  25. data/lib/tremendous/models/list_invoices200_response_invoices_inner.rb +10 -1
  26. data/lib/tremendous/models/list_orders200_response_orders_inner_payment.rb +4 -48
  27. data/lib/tremendous/models/list_rewards200_response_rewards_inner_delivery.rb +0 -14
  28. data/lib/tremendous/models/list_rewards401_response.rb +11 -1
  29. data/lib/tremendous/models/list_rewards401_response_errors.rb +4 -2
  30. data/lib/tremendous/models/list_rewards429_response.rb +11 -1
  31. data/lib/tremendous/models/order_base_payment.rb +4 -48
  32. data/lib/tremendous/models/order_with_link.rb +403 -0
  33. data/lib/tremendous/models/order_with_link_rewards_inner.rb +385 -0
  34. data/lib/tremendous/models/payment_details.rb +4 -48
  35. data/lib/tremendous/models/payout.rb +340 -0
  36. data/lib/tremendous/models/resend_reward422_response.rb +11 -1
  37. data/lib/tremendous/models/reward_for_order_create.rb +1 -1
  38. data/lib/tremendous/models/{single_reward_order1_reward.rb → reward_with_link.rb} +78 -16
  39. data/lib/tremendous/models/reward_with_link_delivery.rb +296 -0
  40. data/lib/tremendous/models/reward_without_link_delivery.rb +0 -14
  41. data/lib/tremendous/models/single_reward_order.rb +1 -1
  42. data/lib/tremendous/models/{single_reward_order1_payment.rb → single_reward_order_payment.rb} +3 -3
  43. data/lib/tremendous/models/single_reward_order_reward.rb +3 -75
  44. data/lib/tremendous/models/{single_reward_order1_reward_custom_fields_inner.rb → single_reward_order_reward_custom_fields_inner.rb} +3 -3
  45. data/lib/tremendous/models/{single_reward_order1_reward_delivery.rb → single_reward_order_reward_delivery.rb} +3 -3
  46. data/lib/tremendous/models/{test_public_key.rb → single_reward_order_with_link.rb} +14 -15
  47. data/lib/tremendous/models/single_reward_order_with_link_order.rb +403 -0
  48. data/lib/tremendous/version.rb +1 -1
  49. data/lib/tremendous.rb +17 -14
  50. metadata +19 -16
  51. data/lib/tremendous/models/create_invoice.rb +0 -244
  52. data/lib/tremendous/models/create_public_key.rb +0 -222
  53. data/lib/tremendous/models/create_public_key200_response.rb +0 -221
  54. data/lib/tremendous/models/public_keys_response.rb +0 -223
  55. data/lib/tremendous/models/single_reward_order1.rb +0 -242
  56. data/lib/tremendous/models/test_public_key_request.rb +0 -222
@@ -17,10 +17,14 @@ module Tremendous
17
17
  class ListFraudReviews200Response
18
18
  attr_accessor :fraud_reviews
19
19
 
20
+ # The total number of fraud reviews
21
+ attr_accessor :total_count
22
+
20
23
  # Attribute mapping from ruby-style variable name to JSON key.
21
24
  def self.attribute_map
22
25
  {
23
- :'fraud_reviews' => :'fraud_reviews'
26
+ :'fraud_reviews' => :'fraud_reviews',
27
+ :'total_count' => :'total_count'
24
28
  }
25
29
  end
26
30
 
@@ -32,7 +36,8 @@ module Tremendous
32
36
  # Attribute type mapping.
33
37
  def self.openapi_types
34
38
  {
35
- :'fraud_reviews' => :'Array<ListFraudReviews200ResponseFraudReviewsInner>'
39
+ :'fraud_reviews' => :'Array<ListFraudReviews200ResponseFraudReviewsInner>',
40
+ :'total_count' => :'Integer'
36
41
  }
37
42
  end
38
43
 
@@ -64,6 +69,12 @@ module Tremendous
64
69
  else
65
70
  self.fraud_reviews = nil
66
71
  end
72
+
73
+ if attributes.key?(:'total_count')
74
+ self.total_count = attributes[:'total_count']
75
+ else
76
+ self.total_count = nil
77
+ end
67
78
  end
68
79
 
69
80
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -75,6 +86,10 @@ module Tremendous
75
86
  invalid_properties.push('invalid value for "fraud_reviews", fraud_reviews cannot be nil.')
76
87
  end
77
88
 
89
+ if @total_count.nil?
90
+ invalid_properties.push('invalid value for "total_count", total_count cannot be nil.')
91
+ end
92
+
78
93
  invalid_properties
79
94
  end
80
95
 
@@ -83,6 +98,7 @@ module Tremendous
83
98
  def valid?
84
99
  warn '[DEPRECATED] the `valid?` method is obsolete'
85
100
  return false if @fraud_reviews.nil?
101
+ return false if @total_count.nil?
86
102
  true
87
103
  end
88
104
 
@@ -91,7 +107,8 @@ module Tremendous
91
107
  def ==(o)
92
108
  return true if self.equal?(o)
93
109
  self.class == o.class &&
94
- fraud_reviews == o.fraud_reviews
110
+ fraud_reviews == o.fraud_reviews &&
111
+ total_count == o.total_count
95
112
  end
96
113
 
97
114
  # @see the `==` method
@@ -103,7 +120,7 @@ module Tremendous
103
120
  # Calculates hash code according to all attributes.
104
121
  # @return [Integer] Hash code
105
122
  def hash
106
- [fraud_reviews].hash
123
+ [fraud_reviews, total_count].hash
107
124
  end
108
125
 
109
126
  # Builds the object from hash
@@ -61,7 +61,7 @@ module Tremendous
61
61
  def self.openapi_types
62
62
  {
63
63
  :'rule_type' => :'String',
64
- :'config' => :'Object'
64
+ :'config' => :'Hash<String, Object>'
65
65
  }
66
66
  end
67
67
 
@@ -92,7 +92,9 @@ module Tremendous
92
92
  end
93
93
 
94
94
  if attributes.key?(:'config')
95
- self.config = attributes[:'config']
95
+ if (value = attributes[:'config']).is_a?(Hash)
96
+ self.config = value
97
+ end
96
98
  end
97
99
  end
98
100
 
@@ -25,6 +25,8 @@ module Tremendous
25
25
  # Amount of the invoice in USD
26
26
  attr_accessor :amount
27
27
 
28
+ attr_accessor :international
29
+
28
30
  # 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>
29
31
  attr_accessor :status
30
32
 
@@ -68,6 +70,7 @@ module Tremendous
68
70
  :'id' => :'id',
69
71
  :'po_number' => :'po_number',
70
72
  :'amount' => :'amount',
73
+ :'international' => :'international',
71
74
  :'status' => :'status',
72
75
  :'orders' => :'orders',
73
76
  :'rewards' => :'rewards',
@@ -87,6 +90,7 @@ module Tremendous
87
90
  :'id' => :'String',
88
91
  :'po_number' => :'String',
89
92
  :'amount' => :'Float',
93
+ :'international' => :'Boolean',
90
94
  :'status' => :'String',
91
95
  :'orders' => :'Array<String>',
92
96
  :'rewards' => :'Array<String>',
@@ -134,6 +138,10 @@ module Tremendous
134
138
  self.amount = nil
135
139
  end
136
140
 
141
+ if attributes.key?(:'international')
142
+ self.international = attributes[:'international']
143
+ end
144
+
137
145
  if attributes.key?(:'status')
138
146
  self.status = attributes[:'status']
139
147
  else
@@ -220,6 +228,7 @@ module Tremendous
220
228
  id == o.id &&
221
229
  po_number == o.po_number &&
222
230
  amount == o.amount &&
231
+ international == o.international &&
223
232
  status == o.status &&
224
233
  orders == o.orders &&
225
234
  rewards == o.rewards &&
@@ -236,7 +245,7 @@ module Tremendous
236
245
  # Calculates hash code according to all attributes.
237
246
  # @return [Integer] Hash code
238
247
  def hash
239
- [id, po_number, amount, status, orders, rewards, created_at, paid_at].hash
248
+ [id, po_number, amount, international, status, orders, rewards, created_at, paid_at].hash
240
249
  end
241
250
 
242
251
  # Builds the object from hash
@@ -27,39 +27,13 @@ module Tremendous
27
27
 
28
28
  attr_accessor :refund
29
29
 
30
- # Name of the channel in which the order was created
31
- attr_accessor :channel
32
-
33
- class EnumAttributeValidator
34
- attr_reader :datatype
35
- attr_reader :allowable_values
36
-
37
- def initialize(datatype, allowable_values)
38
- @allowable_values = allowable_values.map do |value|
39
- case datatype.to_s
40
- when /Integer/i
41
- value.to_i
42
- when /Float/i
43
- value.to_f
44
- else
45
- value
46
- end
47
- end
48
- end
49
-
50
- def valid?(value)
51
- !value || allowable_values.include?(value)
52
- end
53
- end
54
-
55
30
  # Attribute mapping from ruby-style variable name to JSON key.
56
31
  def self.attribute_map
57
32
  {
58
33
  :'subtotal' => :'subtotal',
59
34
  :'total' => :'total',
60
35
  :'fees' => :'fees',
61
- :'refund' => :'refund',
62
- :'channel' => :'channel'
36
+ :'refund' => :'refund'
63
37
  }
64
38
  end
65
39
 
@@ -74,8 +48,7 @@ module Tremendous
74
48
  :'subtotal' => :'Float',
75
49
  :'total' => :'Float',
76
50
  :'fees' => :'Float',
77
- :'refund' => :'ListOrders200ResponseOrdersInnerPaymentRefund',
78
- :'channel' => :'String'
51
+ :'refund' => :'ListOrders200ResponseOrdersInnerPaymentRefund'
79
52
  }
80
53
  end
81
54
 
@@ -115,10 +88,6 @@ module Tremendous
115
88
  if attributes.key?(:'refund')
116
89
  self.refund = attributes[:'refund']
117
90
  end
118
-
119
- if attributes.key?(:'channel')
120
- self.channel = attributes[:'channel']
121
- end
122
91
  end
123
92
 
124
93
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -148,8 +117,6 @@ module Tremendous
148
117
  return false if !@subtotal.nil? && @subtotal < 0
149
118
  return false if !@total.nil? && @total < 0
150
119
  return false if !@fees.nil? && @fees < 0
151
- channel_validator = EnumAttributeValidator.new('String', ["UI", "API", "EMBED", "DECIPHER", "QUALTRICS", "TYPEFORM", "SURVEY MONKEY"])
152
- return false unless channel_validator.valid?(@channel)
153
120
  true
154
121
  end
155
122
 
@@ -195,16 +162,6 @@ module Tremendous
195
162
  @fees = fees
196
163
  end
197
164
 
198
- # Custom attribute writer method checking allowed values (enum).
199
- # @param [Object] channel Object to be assigned
200
- def channel=(channel)
201
- validator = EnumAttributeValidator.new('String', ["UI", "API", "EMBED", "DECIPHER", "QUALTRICS", "TYPEFORM", "SURVEY MONKEY"])
202
- unless validator.valid?(channel)
203
- fail ArgumentError, "invalid value for \"channel\", must be one of #{validator.allowable_values}."
204
- end
205
- @channel = channel
206
- end
207
-
208
165
  # Checks equality by comparing each attribute.
209
166
  # @param [Object] Object to be compared
210
167
  def ==(o)
@@ -213,8 +170,7 @@ module Tremendous
213
170
  subtotal == o.subtotal &&
214
171
  total == o.total &&
215
172
  fees == o.fees &&
216
- refund == o.refund &&
217
- channel == o.channel
173
+ refund == o.refund
218
174
  end
219
175
 
220
176
  # @see the `==` method
@@ -226,7 +182,7 @@ module Tremendous
226
182
  # Calculates hash code according to all attributes.
227
183
  # @return [Integer] Hash code
228
184
  def hash
229
- [subtotal, total, fees, refund, channel].hash
185
+ [subtotal, total, fees, refund].hash
230
186
  end
231
187
 
232
188
  # Builds the object from hash
@@ -88,14 +88,10 @@ module Tremendous
88
88
 
89
89
  if attributes.key?(:'method')
90
90
  self.method = attributes[:'method']
91
- else
92
- self.method = nil
93
91
  end
94
92
 
95
93
  if attributes.key?(:'status')
96
94
  self.status = attributes[:'status']
97
- else
98
- self.status = nil
99
95
  end
100
96
  end
101
97
 
@@ -104,14 +100,6 @@ module Tremendous
104
100
  def list_invalid_properties
105
101
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
106
102
  invalid_properties = Array.new
107
- if @method.nil?
108
- invalid_properties.push('invalid value for "method", method cannot be nil.')
109
- end
110
-
111
- if @status.nil?
112
- invalid_properties.push('invalid value for "status", status cannot be nil.')
113
- end
114
-
115
103
  invalid_properties
116
104
  end
117
105
 
@@ -119,10 +107,8 @@ module Tremendous
119
107
  # @return true if the model is valid
120
108
  def valid?
121
109
  warn '[DEPRECATED] the `valid?` method is obsolete'
122
- return false if @method.nil?
123
110
  method_validator = EnumAttributeValidator.new('String', ["EMAIL", "LINK", "PHONE"])
124
111
  return false unless method_validator.valid?(@method)
125
- return false if @status.nil?
126
112
  status_validator = EnumAttributeValidator.new('String', ["SCHEDULED", "FAILED", "SUCCEEDED", "PENDING"])
127
113
  return false unless status_validator.valid?(@status)
128
114
  true
@@ -15,11 +15,15 @@ require 'time'
15
15
 
16
16
  module Tremendous
17
17
  class ListRewards401Response
18
+ # HTTP status code of the response
19
+ attr_accessor :status
20
+
18
21
  attr_accessor :errors
19
22
 
20
23
  # Attribute mapping from ruby-style variable name to JSON key.
21
24
  def self.attribute_map
22
25
  {
26
+ :'status' => :'status',
23
27
  :'errors' => :'errors'
24
28
  }
25
29
  end
@@ -32,6 +36,7 @@ module Tremendous
32
36
  # Attribute type mapping.
33
37
  def self.openapi_types
34
38
  {
39
+ :'status' => :'Integer',
35
40
  :'errors' => :'ListRewards401ResponseErrors'
36
41
  }
37
42
  end
@@ -57,6 +62,10 @@ module Tremendous
57
62
  h[k.to_sym] = v
58
63
  }
59
64
 
65
+ if attributes.key?(:'status')
66
+ self.status = attributes[:'status']
67
+ end
68
+
60
69
  if attributes.key?(:'errors')
61
70
  self.errors = attributes[:'errors']
62
71
  else
@@ -89,6 +98,7 @@ module Tremendous
89
98
  def ==(o)
90
99
  return true if self.equal?(o)
91
100
  self.class == o.class &&
101
+ status == o.status &&
92
102
  errors == o.errors
93
103
  end
94
104
 
@@ -101,7 +111,7 @@ module Tremendous
101
111
  # Calculates hash code according to all attributes.
102
112
  # @return [Integer] Hash code
103
113
  def hash
104
- [errors].hash
114
+ [status, errors].hash
105
115
  end
106
116
 
107
117
  # Builds the object from hash
@@ -38,7 +38,7 @@ module Tremendous
38
38
  def self.openapi_types
39
39
  {
40
40
  :'message' => :'String',
41
- :'payload' => :'Object'
41
+ :'payload' => :'Hash<String, Object>'
42
42
  }
43
43
  end
44
44
 
@@ -68,7 +68,9 @@ module Tremendous
68
68
  end
69
69
 
70
70
  if attributes.key?(:'payload')
71
- self.payload = attributes[:'payload']
71
+ if (value = attributes[:'payload']).is_a?(Hash)
72
+ self.payload = value
73
+ end
72
74
  end
73
75
  end
74
76
 
@@ -15,11 +15,15 @@ require 'time'
15
15
 
16
16
  module Tremendous
17
17
  class ListRewards429Response
18
+ # HTTP status code of the response
19
+ attr_accessor :status
20
+
18
21
  attr_accessor :errors
19
22
 
20
23
  # Attribute mapping from ruby-style variable name to JSON key.
21
24
  def self.attribute_map
22
25
  {
26
+ :'status' => :'status',
23
27
  :'errors' => :'errors'
24
28
  }
25
29
  end
@@ -32,6 +36,7 @@ module Tremendous
32
36
  # Attribute type mapping.
33
37
  def self.openapi_types
34
38
  {
39
+ :'status' => :'Integer',
35
40
  :'errors' => :'ListRewards401ResponseErrors'
36
41
  }
37
42
  end
@@ -57,6 +62,10 @@ module Tremendous
57
62
  h[k.to_sym] = v
58
63
  }
59
64
 
65
+ if attributes.key?(:'status')
66
+ self.status = attributes[:'status']
67
+ end
68
+
60
69
  if attributes.key?(:'errors')
61
70
  self.errors = attributes[:'errors']
62
71
  else
@@ -89,6 +98,7 @@ module Tremendous
89
98
  def ==(o)
90
99
  return true if self.equal?(o)
91
100
  self.class == o.class &&
101
+ status == o.status &&
92
102
  errors == o.errors
93
103
  end
94
104
 
@@ -101,7 +111,7 @@ module Tremendous
101
111
  # Calculates hash code according to all attributes.
102
112
  # @return [Integer] Hash code
103
113
  def hash
104
- [errors].hash
114
+ [status, errors].hash
105
115
  end
106
116
 
107
117
  # Builds the object from hash
@@ -27,39 +27,13 @@ module Tremendous
27
27
 
28
28
  attr_accessor :refund
29
29
 
30
- # Name of the channel in which the order was created
31
- attr_accessor :channel
32
-
33
- class EnumAttributeValidator
34
- attr_reader :datatype
35
- attr_reader :allowable_values
36
-
37
- def initialize(datatype, allowable_values)
38
- @allowable_values = allowable_values.map do |value|
39
- case datatype.to_s
40
- when /Integer/i
41
- value.to_i
42
- when /Float/i
43
- value.to_f
44
- else
45
- value
46
- end
47
- end
48
- end
49
-
50
- def valid?(value)
51
- !value || allowable_values.include?(value)
52
- end
53
- end
54
-
55
30
  # Attribute mapping from ruby-style variable name to JSON key.
56
31
  def self.attribute_map
57
32
  {
58
33
  :'subtotal' => :'subtotal',
59
34
  :'total' => :'total',
60
35
  :'fees' => :'fees',
61
- :'refund' => :'refund',
62
- :'channel' => :'channel'
36
+ :'refund' => :'refund'
63
37
  }
64
38
  end
65
39
 
@@ -74,8 +48,7 @@ module Tremendous
74
48
  :'subtotal' => :'Float',
75
49
  :'total' => :'Float',
76
50
  :'fees' => :'Float',
77
- :'refund' => :'PaymentDetailsRefund',
78
- :'channel' => :'String'
51
+ :'refund' => :'PaymentDetailsRefund'
79
52
  }
80
53
  end
81
54
 
@@ -115,10 +88,6 @@ module Tremendous
115
88
  if attributes.key?(:'refund')
116
89
  self.refund = attributes[:'refund']
117
90
  end
118
-
119
- if attributes.key?(:'channel')
120
- self.channel = attributes[:'channel']
121
- end
122
91
  end
123
92
 
124
93
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -148,8 +117,6 @@ module Tremendous
148
117
  return false if !@subtotal.nil? && @subtotal < 0
149
118
  return false if !@total.nil? && @total < 0
150
119
  return false if !@fees.nil? && @fees < 0
151
- channel_validator = EnumAttributeValidator.new('String', ["UI", "API", "EMBED", "DECIPHER", "QUALTRICS", "TYPEFORM", "SURVEY MONKEY"])
152
- return false unless channel_validator.valid?(@channel)
153
120
  true
154
121
  end
155
122
 
@@ -195,16 +162,6 @@ module Tremendous
195
162
  @fees = fees
196
163
  end
197
164
 
198
- # Custom attribute writer method checking allowed values (enum).
199
- # @param [Object] channel Object to be assigned
200
- def channel=(channel)
201
- validator = EnumAttributeValidator.new('String', ["UI", "API", "EMBED", "DECIPHER", "QUALTRICS", "TYPEFORM", "SURVEY MONKEY"])
202
- unless validator.valid?(channel)
203
- fail ArgumentError, "invalid value for \"channel\", must be one of #{validator.allowable_values}."
204
- end
205
- @channel = channel
206
- end
207
-
208
165
  # Checks equality by comparing each attribute.
209
166
  # @param [Object] Object to be compared
210
167
  def ==(o)
@@ -213,8 +170,7 @@ module Tremendous
213
170
  subtotal == o.subtotal &&
214
171
  total == o.total &&
215
172
  fees == o.fees &&
216
- refund == o.refund &&
217
- channel == o.channel
173
+ refund == o.refund
218
174
  end
219
175
 
220
176
  # @see the `==` method
@@ -226,7 +182,7 @@ module Tremendous
226
182
  # Calculates hash code according to all attributes.
227
183
  # @return [Integer] Hash code
228
184
  def hash
229
- [subtotal, total, fees, refund, channel].hash
185
+ [subtotal, total, fees, refund].hash
230
186
  end
231
187
 
232
188
  # Builds the object from hash