tremendous_ruby 5.5.0 → 5.7.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 (63) hide show
  1. checksums.yaml +4 -4
  2. data/lib/tremendous/api/tremendous_api.rb +54 -256
  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/create_report201_response.rb +231 -0
  16. data/lib/tremendous/models/create_report201_response_report.rb +291 -0
  17. data/lib/tremendous/models/create_report_request.rb +295 -0
  18. data/lib/tremendous/models/{create_public_key200_response.rb → create_report_request_filters.rb} +12 -17
  19. data/lib/tremendous/models/{create_invoice.rb → create_report_request_filters_digital_rewards.rb} +128 -32
  20. data/lib/tremendous/models/{create_public_key.rb → create_report_request_filters_digital_rewards_amount.rb} +22 -18
  21. data/lib/tremendous/models/{public_keys_response.rb → create_report_request_filters_digital_rewards_created_at.rb} +22 -19
  22. data/lib/tremendous/models/delivery_details.rb +0 -14
  23. data/lib/tremendous/models/delivery_details_with_link.rb +296 -0
  24. data/lib/tremendous/models/error_model.rb +11 -1
  25. data/lib/tremendous/models/fraud_rule400_response.rb +11 -1
  26. data/lib/tremendous/models/fraud_rule422_response.rb +11 -1
  27. data/lib/tremendous/models/fraud_rules_list_item.rb +4 -2
  28. data/lib/tremendous/models/generate_reward_link403_response.rb +11 -1
  29. data/lib/tremendous/models/invoice.rb +10 -1
  30. data/lib/tremendous/models/list_fraud_reviews200_response.rb +21 -4
  31. data/lib/tremendous/models/list_fraud_rules200_response_fraud_rules_inner.rb +4 -2
  32. data/lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb +37 -7
  33. data/lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta_failure_details.rb +225 -0
  34. data/lib/tremendous/models/list_invoices200_response_invoices_inner.rb +10 -1
  35. data/lib/tremendous/models/list_orders200_response_orders_inner_payment.rb +4 -48
  36. data/lib/tremendous/models/list_rewards200_response_rewards_inner_delivery.rb +0 -14
  37. data/lib/tremendous/models/list_rewards401_response.rb +11 -1
  38. data/lib/tremendous/models/list_rewards401_response_errors.rb +4 -2
  39. data/lib/tremendous/models/list_rewards429_response.rb +11 -1
  40. data/lib/tremendous/models/order_base_payment.rb +4 -48
  41. data/lib/tremendous/models/order_with_link.rb +403 -0
  42. data/lib/tremendous/models/order_with_link_rewards_inner.rb +385 -0
  43. data/lib/tremendous/models/payment_details.rb +4 -48
  44. data/lib/tremendous/models/payout.rb +352 -0
  45. data/lib/tremendous/models/report.rb +291 -0
  46. data/lib/tremendous/models/resend_reward422_response.rb +11 -1
  47. data/lib/tremendous/models/resend_reward_request.rb +225 -0
  48. data/lib/tremendous/models/reward_for_order_create.rb +1 -1
  49. data/lib/tremendous/models/{single_reward_order1_reward.rb → reward_with_link.rb} +78 -16
  50. data/lib/tremendous/models/reward_with_link_delivery.rb +296 -0
  51. data/lib/tremendous/models/reward_without_link_delivery.rb +0 -14
  52. data/lib/tremendous/models/single_reward_order.rb +1 -1
  53. data/lib/tremendous/models/{single_reward_order1_payment.rb → single_reward_order_payment.rb} +3 -3
  54. data/lib/tremendous/models/single_reward_order_reward.rb +3 -75
  55. data/lib/tremendous/models/{single_reward_order1_reward_custom_fields_inner.rb → single_reward_order_reward_custom_fields_inner.rb} +3 -3
  56. data/lib/tremendous/models/{single_reward_order1_reward_delivery.rb → single_reward_order_reward_delivery.rb} +3 -3
  57. data/lib/tremendous/models/{test_public_key.rb → single_reward_order_with_link.rb} +14 -15
  58. data/lib/tremendous/models/single_reward_order_with_link_order.rb +403 -0
  59. data/lib/tremendous/version.rb +1 -1
  60. data/lib/tremendous.rb +27 -14
  61. metadata +29 -16
  62. data/lib/tremendous/models/single_reward_order1.rb +0 -242
  63. data/lib/tremendous/models/test_public_key_request.rb +0 -222
@@ -0,0 +1,352 @@
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 it's 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.8.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Tremendous
17
+ class Payout
18
+ # Tremendous ID of the payout
19
+ attr_accessor :id
20
+
21
+ attr_accessor :status
22
+
23
+ # Tremendous ID of the paid out product
24
+ attr_accessor :product_id
25
+
26
+ # Name of the paid out Product
27
+ attr_accessor :product_name
28
+
29
+ # Date the payout was created
30
+ attr_accessor :created_at
31
+
32
+ # Date the payout was executed
33
+ attr_accessor :executed_at
34
+
35
+ # Date when a delayed payout will be executed in the future
36
+ attr_accessor :defer_execution_until
37
+
38
+ class EnumAttributeValidator
39
+ attr_reader :datatype
40
+ attr_reader :allowable_values
41
+
42
+ def initialize(datatype, allowable_values)
43
+ @allowable_values = allowable_values.map do |value|
44
+ case datatype.to_s
45
+ when /Integer/i
46
+ value.to_i
47
+ when /Float/i
48
+ value.to_f
49
+ else
50
+ value
51
+ end
52
+ end
53
+ end
54
+
55
+ def valid?(value)
56
+ !value || allowable_values.include?(value)
57
+ end
58
+ end
59
+
60
+ # Attribute mapping from ruby-style variable name to JSON key.
61
+ def self.attribute_map
62
+ {
63
+ :'id' => :'id',
64
+ :'status' => :'status',
65
+ :'product_id' => :'product_id',
66
+ :'product_name' => :'product_name',
67
+ :'created_at' => :'created_at',
68
+ :'executed_at' => :'executed_at',
69
+ :'defer_execution_until' => :'defer_execution_until'
70
+ }
71
+ end
72
+
73
+ # Returns all the JSON keys this model knows about
74
+ def self.acceptable_attributes
75
+ attribute_map.values
76
+ end
77
+
78
+ # Attribute type mapping.
79
+ def self.openapi_types
80
+ {
81
+ :'id' => :'String',
82
+ :'status' => :'String',
83
+ :'product_id' => :'String',
84
+ :'product_name' => :'String',
85
+ :'created_at' => :'Time',
86
+ :'executed_at' => :'Time',
87
+ :'defer_execution_until' => :'Time'
88
+ }
89
+ end
90
+
91
+ # List of attributes with nullable: true
92
+ def self.openapi_nullable
93
+ Set.new([
94
+ :'executed_at',
95
+ :'defer_execution_until'
96
+ ])
97
+ end
98
+
99
+ # Initializes the object
100
+ # @param [Hash] attributes Model attributes in the form of hash
101
+ def initialize(attributes = {})
102
+ if (!attributes.is_a?(Hash))
103
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::Payout` initialize method"
104
+ end
105
+
106
+ # check to see if the attribute exists and convert string to symbol for hash key
107
+ attributes = attributes.each_with_object({}) { |(k, v), h|
108
+ if (!self.class.attribute_map.key?(k.to_sym))
109
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::Payout`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
110
+ end
111
+ h[k.to_sym] = v
112
+ }
113
+
114
+ if attributes.key?(:'id')
115
+ self.id = attributes[:'id']
116
+ end
117
+
118
+ if attributes.key?(:'status')
119
+ self.status = attributes[:'status']
120
+ end
121
+
122
+ if attributes.key?(:'product_id')
123
+ self.product_id = attributes[:'product_id']
124
+ end
125
+
126
+ if attributes.key?(:'product_name')
127
+ self.product_name = attributes[:'product_name']
128
+ end
129
+
130
+ if attributes.key?(:'created_at')
131
+ self.created_at = attributes[:'created_at']
132
+ end
133
+
134
+ if attributes.key?(:'executed_at')
135
+ self.executed_at = attributes[:'executed_at']
136
+ end
137
+
138
+ if attributes.key?(:'defer_execution_until')
139
+ self.defer_execution_until = attributes[:'defer_execution_until']
140
+ end
141
+ end
142
+
143
+ # Show invalid properties with the reasons. Usually used together with valid?
144
+ # @return Array for valid properties with the reasons
145
+ def list_invalid_properties
146
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
147
+ invalid_properties = Array.new
148
+ pattern = Regexp.new(/[A-Z0-9]{4,20}/)
149
+ if !@id.nil? && @id !~ pattern
150
+ invalid_properties.push("invalid value for \"id\", must conform to the pattern #{pattern}.")
151
+ end
152
+
153
+ pattern = Regexp.new(/[A-Z0-9]{4,20}/)
154
+ if !@product_id.nil? && @product_id !~ pattern
155
+ invalid_properties.push("invalid value for \"product_id\", must conform to the pattern #{pattern}.")
156
+ end
157
+
158
+ invalid_properties
159
+ end
160
+
161
+ # Check to see if the all the properties in the model are valid
162
+ # @return true if the model is valid
163
+ def valid?
164
+ warn '[DEPRECATED] the `valid?` method is obsolete'
165
+ return false if !@id.nil? && @id !~ Regexp.new(/[A-Z0-9]{4,20}/)
166
+ status_validator = EnumAttributeValidator.new('String', ["UNEXECUTED", "COMPLETED", "FAILED", "CANCELED", "ORGANIZATION_REVIEW", "ADMIN_HELD"])
167
+ return false unless status_validator.valid?(@status)
168
+ return false if !@product_id.nil? && @product_id !~ Regexp.new(/[A-Z0-9]{4,20}/)
169
+ true
170
+ end
171
+
172
+ # Custom attribute writer method with validation
173
+ # @param [Object] id Value to be assigned
174
+ def id=(id)
175
+ if id.nil?
176
+ fail ArgumentError, 'id cannot be nil'
177
+ end
178
+
179
+ pattern = Regexp.new(/[A-Z0-9]{4,20}/)
180
+ if id !~ pattern
181
+ fail ArgumentError, "invalid value for \"id\", must conform to the pattern #{pattern}."
182
+ end
183
+
184
+ @id = id
185
+ end
186
+
187
+ # Custom attribute writer method checking allowed values (enum).
188
+ # @param [Object] status Object to be assigned
189
+ def status=(status)
190
+ validator = EnumAttributeValidator.new('String', ["UNEXECUTED", "COMPLETED", "FAILED", "CANCELED", "ORGANIZATION_REVIEW", "ADMIN_HELD"])
191
+ unless validator.valid?(status)
192
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
193
+ end
194
+ @status = status
195
+ end
196
+
197
+ # Custom attribute writer method with validation
198
+ # @param [Object] product_id Value to be assigned
199
+ def product_id=(product_id)
200
+ if product_id.nil?
201
+ fail ArgumentError, 'product_id cannot be nil'
202
+ end
203
+
204
+ pattern = Regexp.new(/[A-Z0-9]{4,20}/)
205
+ if product_id !~ pattern
206
+ fail ArgumentError, "invalid value for \"product_id\", must conform to the pattern #{pattern}."
207
+ end
208
+
209
+ @product_id = product_id
210
+ end
211
+
212
+ # Checks equality by comparing each attribute.
213
+ # @param [Object] Object to be compared
214
+ def ==(o)
215
+ return true if self.equal?(o)
216
+ self.class == o.class &&
217
+ id == o.id &&
218
+ status == o.status &&
219
+ product_id == o.product_id &&
220
+ product_name == o.product_name &&
221
+ created_at == o.created_at &&
222
+ executed_at == o.executed_at &&
223
+ defer_execution_until == o.defer_execution_until
224
+ end
225
+
226
+ # @see the `==` method
227
+ # @param [Object] Object to be compared
228
+ def eql?(o)
229
+ self == o
230
+ end
231
+
232
+ # Calculates hash code according to all attributes.
233
+ # @return [Integer] Hash code
234
+ def hash
235
+ [id, status, product_id, product_name, created_at, executed_at, defer_execution_until].hash
236
+ end
237
+
238
+ # Builds the object from hash
239
+ # @param [Hash] attributes Model attributes in the form of hash
240
+ # @return [Object] Returns the model itself
241
+ def self.build_from_hash(attributes)
242
+ return nil unless attributes.is_a?(Hash)
243
+ attributes = attributes.transform_keys(&:to_sym)
244
+ transformed_hash = {}
245
+ openapi_types.each_pair do |key, type|
246
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
247
+ transformed_hash["#{key}"] = nil
248
+ elsif type =~ /\AArray<(.*)>/i
249
+ # check to ensure the input is an array given that the attribute
250
+ # is documented as an array but the input is not
251
+ if attributes[attribute_map[key]].is_a?(Array)
252
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
253
+ end
254
+ elsif !attributes[attribute_map[key]].nil?
255
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
256
+ end
257
+ end
258
+ new(transformed_hash)
259
+ end
260
+
261
+ # Deserializes the data based on type
262
+ # @param string type Data type
263
+ # @param string value Value to be deserialized
264
+ # @return [Object] Deserialized data
265
+ def self._deserialize(type, value)
266
+ case type.to_sym
267
+ when :Time
268
+ Time.parse(value)
269
+ when :Date
270
+ Date.parse(value)
271
+ when :String
272
+ value.to_s
273
+ when :Integer
274
+ value.to_i
275
+ when :Float
276
+ value.to_f
277
+ when :Boolean
278
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
279
+ true
280
+ else
281
+ false
282
+ end
283
+ when :Object
284
+ # generic object (usually a Hash), return directly
285
+ value
286
+ when /\AArray<(?<inner_type>.+)>\z/
287
+ inner_type = Regexp.last_match[:inner_type]
288
+ value.map { |v| _deserialize(inner_type, v) }
289
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
290
+ k_type = Regexp.last_match[:k_type]
291
+ v_type = Regexp.last_match[:v_type]
292
+ {}.tap do |hash|
293
+ value.each do |k, v|
294
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
295
+ end
296
+ end
297
+ else # model
298
+ # models (e.g. Pet) or oneOf
299
+ klass = Tremendous.const_get(type)
300
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
301
+ end
302
+ end
303
+
304
+ # Returns the string representation of the object
305
+ # @return [String] String presentation of the object
306
+ def to_s
307
+ to_hash.to_s
308
+ end
309
+
310
+ # to_body is an alias to to_hash (backward compatibility)
311
+ # @return [Hash] Returns the object in the form of hash
312
+ def to_body
313
+ to_hash
314
+ end
315
+
316
+ # Returns the object in the form of hash
317
+ # @return [Hash] Returns the object in the form of hash
318
+ def to_hash
319
+ hash = {}
320
+ self.class.attribute_map.each_pair do |attr, param|
321
+ value = self.send(attr)
322
+ if value.nil?
323
+ is_nullable = self.class.openapi_nullable.include?(attr)
324
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
325
+ end
326
+
327
+ hash[param] = _to_hash(value)
328
+ end
329
+ hash
330
+ end
331
+
332
+ # Outputs non-array value in the form of hash
333
+ # For object, use to_hash. Otherwise, just return the value
334
+ # @param [Object] value Any valid value
335
+ # @return [Hash] Returns the value in the form of hash
336
+ def _to_hash(value)
337
+ if value.is_a?(Array)
338
+ value.compact.map { |v| _to_hash(v) }
339
+ elsif value.is_a?(Hash)
340
+ {}.tap do |hash|
341
+ value.each { |k, v| hash[k] = _to_hash(v) }
342
+ end
343
+ elsif value.respond_to? :to_hash
344
+ value.to_hash
345
+ else
346
+ value
347
+ end
348
+ end
349
+
350
+ end
351
+
352
+ end
@@ -0,0 +1,291 @@
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 it's 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.8.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Tremendous
17
+ # Reports represent a collection of your Tremendous data that can be filtered and downloaded. The report object that is returned has a unique ID, a status, and an predicted time of report generation completion. When the report generation is complete, it will also contain an expiring url where you can retrieve your report.
18
+ class Report
19
+ # Tremendous ID of the report, used to retrieve your report
20
+ attr_accessor :id
21
+
22
+ # Status of this report <table> <thead> <tr> <th>Status</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>CREATED</code></td> <td>Report has been created</td> </tr> <tr> <td><code>PROCESSING</code></td> <td>Report is currently being generated</td> </tr> <tr> <td><code>READY_FOR_DOWNLOAD</code></td> <td>Report generation is complete and ready for download</td> </tr> <tr> <td><code>FAILED</code></td> <td>Report failed to generate</td> </tr> </tbody> </table>
23
+ attr_accessor :status
24
+
25
+ # Timestamp of when the report was created
26
+ attr_accessor :created_at
27
+
28
+ # Timestamp of when the report is expected to finish generating. If the report if complete, this will return the time the report completed generating at.
29
+ attr_accessor :expected_completion_at
30
+
31
+ # URL to download the report. Only returned when the report generation is complete and report is ready for download. URL is valid for 7 days from generation completion
32
+ attr_accessor :url
33
+
34
+ class EnumAttributeValidator
35
+ attr_reader :datatype
36
+ attr_reader :allowable_values
37
+
38
+ def initialize(datatype, allowable_values)
39
+ @allowable_values = allowable_values.map do |value|
40
+ case datatype.to_s
41
+ when /Integer/i
42
+ value.to_i
43
+ when /Float/i
44
+ value.to_f
45
+ else
46
+ value
47
+ end
48
+ end
49
+ end
50
+
51
+ def valid?(value)
52
+ !value || allowable_values.include?(value)
53
+ end
54
+ end
55
+
56
+ # Attribute mapping from ruby-style variable name to JSON key.
57
+ def self.attribute_map
58
+ {
59
+ :'id' => :'id',
60
+ :'status' => :'status',
61
+ :'created_at' => :'created_at',
62
+ :'expected_completion_at' => :'expected_completion_at',
63
+ :'url' => :'url'
64
+ }
65
+ end
66
+
67
+ # Returns all the JSON keys this model knows about
68
+ def self.acceptable_attributes
69
+ attribute_map.values
70
+ end
71
+
72
+ # Attribute type mapping.
73
+ def self.openapi_types
74
+ {
75
+ :'id' => :'String',
76
+ :'status' => :'String',
77
+ :'created_at' => :'Time',
78
+ :'expected_completion_at' => :'Time',
79
+ :'url' => :'String'
80
+ }
81
+ end
82
+
83
+ # List of attributes with nullable: true
84
+ def self.openapi_nullable
85
+ Set.new([
86
+ :'url'
87
+ ])
88
+ end
89
+
90
+ # Initializes the object
91
+ # @param [Hash] attributes Model attributes in the form of hash
92
+ def initialize(attributes = {})
93
+ if (!attributes.is_a?(Hash))
94
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::Report` initialize method"
95
+ end
96
+
97
+ # check to see if the attribute exists and convert string to symbol for hash key
98
+ attributes = attributes.each_with_object({}) { |(k, v), h|
99
+ if (!self.class.attribute_map.key?(k.to_sym))
100
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::Report`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
101
+ end
102
+ h[k.to_sym] = v
103
+ }
104
+
105
+ if attributes.key?(:'id')
106
+ self.id = attributes[:'id']
107
+ end
108
+
109
+ if attributes.key?(:'status')
110
+ self.status = attributes[:'status']
111
+ end
112
+
113
+ if attributes.key?(:'created_at')
114
+ self.created_at = attributes[:'created_at']
115
+ end
116
+
117
+ if attributes.key?(:'expected_completion_at')
118
+ self.expected_completion_at = attributes[:'expected_completion_at']
119
+ end
120
+
121
+ if attributes.key?(:'url')
122
+ self.url = attributes[:'url']
123
+ end
124
+ end
125
+
126
+ # Show invalid properties with the reasons. Usually used together with valid?
127
+ # @return Array for valid properties with the reasons
128
+ def list_invalid_properties
129
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
130
+ invalid_properties = Array.new
131
+ invalid_properties
132
+ end
133
+
134
+ # Check to see if the all the properties in the model are valid
135
+ # @return true if the model is valid
136
+ def valid?
137
+ warn '[DEPRECATED] the `valid?` method is obsolete'
138
+ status_validator = EnumAttributeValidator.new('String', ["CREATED", "PROCESSING", "READY_FOR_DOWNLOAD", "FAILED"])
139
+ return false unless status_validator.valid?(@status)
140
+ true
141
+ end
142
+
143
+ # Custom attribute writer method checking allowed values (enum).
144
+ # @param [Object] status Object to be assigned
145
+ def status=(status)
146
+ validator = EnumAttributeValidator.new('String', ["CREATED", "PROCESSING", "READY_FOR_DOWNLOAD", "FAILED"])
147
+ unless validator.valid?(status)
148
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
149
+ end
150
+ @status = status
151
+ end
152
+
153
+ # Checks equality by comparing each attribute.
154
+ # @param [Object] Object to be compared
155
+ def ==(o)
156
+ return true if self.equal?(o)
157
+ self.class == o.class &&
158
+ id == o.id &&
159
+ status == o.status &&
160
+ created_at == o.created_at &&
161
+ expected_completion_at == o.expected_completion_at &&
162
+ url == o.url
163
+ end
164
+
165
+ # @see the `==` method
166
+ # @param [Object] Object to be compared
167
+ def eql?(o)
168
+ self == o
169
+ end
170
+
171
+ # Calculates hash code according to all attributes.
172
+ # @return [Integer] Hash code
173
+ def hash
174
+ [id, status, created_at, expected_completion_at, url].hash
175
+ end
176
+
177
+ # Builds the object from hash
178
+ # @param [Hash] attributes Model attributes in the form of hash
179
+ # @return [Object] Returns the model itself
180
+ def self.build_from_hash(attributes)
181
+ return nil unless attributes.is_a?(Hash)
182
+ attributes = attributes.transform_keys(&:to_sym)
183
+ transformed_hash = {}
184
+ openapi_types.each_pair do |key, type|
185
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
186
+ transformed_hash["#{key}"] = nil
187
+ elsif type =~ /\AArray<(.*)>/i
188
+ # check to ensure the input is an array given that the attribute
189
+ # is documented as an array but the input is not
190
+ if attributes[attribute_map[key]].is_a?(Array)
191
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
192
+ end
193
+ elsif !attributes[attribute_map[key]].nil?
194
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
195
+ end
196
+ end
197
+ new(transformed_hash)
198
+ end
199
+
200
+ # Deserializes the data based on type
201
+ # @param string type Data type
202
+ # @param string value Value to be deserialized
203
+ # @return [Object] Deserialized data
204
+ def self._deserialize(type, value)
205
+ case type.to_sym
206
+ when :Time
207
+ Time.parse(value)
208
+ when :Date
209
+ Date.parse(value)
210
+ when :String
211
+ value.to_s
212
+ when :Integer
213
+ value.to_i
214
+ when :Float
215
+ value.to_f
216
+ when :Boolean
217
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
218
+ true
219
+ else
220
+ false
221
+ end
222
+ when :Object
223
+ # generic object (usually a Hash), return directly
224
+ value
225
+ when /\AArray<(?<inner_type>.+)>\z/
226
+ inner_type = Regexp.last_match[:inner_type]
227
+ value.map { |v| _deserialize(inner_type, v) }
228
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
229
+ k_type = Regexp.last_match[:k_type]
230
+ v_type = Regexp.last_match[:v_type]
231
+ {}.tap do |hash|
232
+ value.each do |k, v|
233
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
234
+ end
235
+ end
236
+ else # model
237
+ # models (e.g. Pet) or oneOf
238
+ klass = Tremendous.const_get(type)
239
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
240
+ end
241
+ end
242
+
243
+ # Returns the string representation of the object
244
+ # @return [String] String presentation of the object
245
+ def to_s
246
+ to_hash.to_s
247
+ end
248
+
249
+ # to_body is an alias to to_hash (backward compatibility)
250
+ # @return [Hash] Returns the object in the form of hash
251
+ def to_body
252
+ to_hash
253
+ end
254
+
255
+ # Returns the object in the form of hash
256
+ # @return [Hash] Returns the object in the form of hash
257
+ def to_hash
258
+ hash = {}
259
+ self.class.attribute_map.each_pair do |attr, param|
260
+ value = self.send(attr)
261
+ if value.nil?
262
+ is_nullable = self.class.openapi_nullable.include?(attr)
263
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
264
+ end
265
+
266
+ hash[param] = _to_hash(value)
267
+ end
268
+ hash
269
+ end
270
+
271
+ # Outputs non-array value in the form of hash
272
+ # For object, use to_hash. Otherwise, just return the value
273
+ # @param [Object] value Any valid value
274
+ # @return [Hash] Returns the value in the form of hash
275
+ def _to_hash(value)
276
+ if value.is_a?(Array)
277
+ value.compact.map { |v| _to_hash(v) }
278
+ elsif value.is_a?(Hash)
279
+ {}.tap do |hash|
280
+ value.each { |k, v| hash[k] = _to_hash(v) }
281
+ end
282
+ elsif value.respond_to? :to_hash
283
+ value.to_hash
284
+ else
285
+ value
286
+ end
287
+ end
288
+
289
+ end
290
+
291
+ end
@@ -15,11 +15,15 @@ require 'time'
15
15
 
16
16
  module Tremendous
17
17
  class ResendReward422Response
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