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
@@ -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
 
@@ -15,11 +15,15 @@ require 'time'
15
15
 
16
16
  module Tremendous
17
17
  class GenerateRewardLink403Response
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
@@ -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
@@ -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
 
@@ -48,9 +48,17 @@ module Tremendous
48
48
  # **Only available when `method` is set to `credit_card`.** Is this credit card expired
49
49
  attr_accessor :expired
50
50
 
51
+ # **Only available when `method` is set to `credit_card`.** Year part of card's expiration date
52
+ attr_accessor :year
53
+
54
+ # **Only available when `method` is set to `credit_card`.** Month part of card's expiration date
55
+ attr_accessor :month
56
+
51
57
  # **Only available when `method` is set to `bank_account` or `credit_card`.** Point in time when the last order failed using this bank account or credit card as a funding source.
52
58
  attr_accessor :last_payment_failed_at
53
59
 
60
+ attr_accessor :failure_details
61
+
54
62
  class EnumAttributeValidator
55
63
  attr_reader :datatype
56
64
  attr_reader :allowable_values
@@ -87,7 +95,10 @@ module Tremendous
87
95
  :'network' => :'network',
88
96
  :'last4' => :'last4',
89
97
  :'expired' => :'expired',
90
- :'last_payment_failed_at' => :'last_payment_failed_at'
98
+ :'year' => :'year',
99
+ :'month' => :'month',
100
+ :'last_payment_failed_at' => :'last_payment_failed_at',
101
+ :'failure_details' => :'failure_details'
91
102
  }
92
103
  end
93
104
 
@@ -110,7 +121,10 @@ module Tremendous
110
121
  :'network' => :'String',
111
122
  :'last4' => :'String',
112
123
  :'expired' => :'Boolean',
113
- :'last_payment_failed_at' => :'Time'
124
+ :'year' => :'String',
125
+ :'month' => :'String',
126
+ :'last_payment_failed_at' => :'Time',
127
+ :'failure_details' => :'ListFundingSources200ResponseFundingSourcesInnerMetaFailureDetails'
114
128
  }
115
129
  end
116
130
 
@@ -118,7 +132,8 @@ module Tremendous
118
132
  def self.openapi_nullable
119
133
  Set.new([
120
134
  :'bank_name',
121
- :'last_payment_failed_at'
135
+ :'last_payment_failed_at',
136
+ :'failure_details'
122
137
  ])
123
138
  end
124
139
 
@@ -181,9 +196,21 @@ module Tremendous
181
196
  self.expired = attributes[:'expired']
182
197
  end
183
198
 
199
+ if attributes.key?(:'year')
200
+ self.year = attributes[:'year']
201
+ end
202
+
203
+ if attributes.key?(:'month')
204
+ self.month = attributes[:'month']
205
+ end
206
+
184
207
  if attributes.key?(:'last_payment_failed_at')
185
208
  self.last_payment_failed_at = attributes[:'last_payment_failed_at']
186
209
  end
210
+
211
+ if attributes.key?(:'failure_details')
212
+ self.failure_details = attributes[:'failure_details']
213
+ end
187
214
  end
188
215
 
189
216
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -217,7 +244,7 @@ module Tremendous
217
244
  return false unless account_type_validator.valid?(@account_type)
218
245
  return false if !@account_number_mask.nil? && @account_number_mask !~ Regexp.new(/[0-9]{4}/)
219
246
  return false if !@account_routing_mask.nil? && @account_routing_mask !~ Regexp.new(/[0-9]{4}/)
220
- network_validator = EnumAttributeValidator.new('String', ["MasterCard", "Amex", "JCB", "Diner's Club", "visa", "discover", "laser", "elo", "maestro", "solo"])
247
+ network_validator = EnumAttributeValidator.new('String', ["MasterCard", "Amex", "JCB", "Diner's Club", "Visa", "Discover", "Laser", "Elo", "Maestro", "Solo"])
221
248
  return false unless network_validator.valid?(@network)
222
249
  return false if !@last4.nil? && @last4 !~ Regexp.new(/[0-9]{4}/)
223
250
  true
@@ -266,7 +293,7 @@ module Tremendous
266
293
  # Custom attribute writer method checking allowed values (enum).
267
294
  # @param [Object] network Object to be assigned
268
295
  def network=(network)
269
- validator = EnumAttributeValidator.new('String', ["MasterCard", "Amex", "JCB", "Diner's Club", "visa", "discover", "laser", "elo", "maestro", "solo"])
296
+ validator = EnumAttributeValidator.new('String', ["MasterCard", "Amex", "JCB", "Diner's Club", "Visa", "Discover", "Laser", "Elo", "Maestro", "Solo"])
270
297
  unless validator.valid?(network)
271
298
  fail ArgumentError, "invalid value for \"network\", must be one of #{validator.allowable_values}."
272
299
  end
@@ -304,7 +331,10 @@ module Tremendous
304
331
  network == o.network &&
305
332
  last4 == o.last4 &&
306
333
  expired == o.expired &&
307
- last_payment_failed_at == o.last_payment_failed_at
334
+ year == o.year &&
335
+ month == o.month &&
336
+ last_payment_failed_at == o.last_payment_failed_at &&
337
+ failure_details == o.failure_details
308
338
  end
309
339
 
310
340
  # @see the `==` method
@@ -316,7 +346,7 @@ module Tremendous
316
346
  # Calculates hash code according to all attributes.
317
347
  # @return [Integer] Hash code
318
348
  def hash
319
- [available_cents, pending_cents, accountholder_name, account_type, bank_name, account_number_mask, account_routing_mask, refundable, network, last4, expired, last_payment_failed_at].hash
349
+ [available_cents, pending_cents, accountholder_name, account_type, bank_name, account_number_mask, account_routing_mask, refundable, network, last4, expired, year, month, last_payment_failed_at, failure_details].hash
320
350
  end
321
351
 
322
352
  # Builds the object from hash
@@ -0,0 +1,225 @@
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 ListFundingSources200ResponseFundingSourcesInnerMetaFailureDetails
18
+ # Payment error code
19
+ attr_accessor :return_code
20
+
21
+ # Explanation of the payment error
22
+ attr_accessor :description
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'return_code' => :'return_code',
28
+ :'description' => :'description'
29
+ }
30
+ end
31
+
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ attribute_map.values
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'return_code' => :'String',
41
+ :'description' => :'String'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::ListFundingSources200ResponseFundingSourcesInnerMetaFailureDetails` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!self.class.attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::ListFundingSources200ResponseFundingSourcesInnerMetaFailureDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'return_code')
67
+ self.return_code = attributes[:'return_code']
68
+ end
69
+
70
+ if attributes.key?(:'description')
71
+ self.description = attributes[:'description']
72
+ end
73
+ end
74
+
75
+ # Show invalid properties with the reasons. Usually used together with valid?
76
+ # @return Array for valid properties with the reasons
77
+ def list_invalid_properties
78
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
79
+ invalid_properties = Array.new
80
+ invalid_properties
81
+ end
82
+
83
+ # Check to see if the all the properties in the model are valid
84
+ # @return true if the model is valid
85
+ def valid?
86
+ warn '[DEPRECATED] the `valid?` method is obsolete'
87
+ true
88
+ end
89
+
90
+ # Checks equality by comparing each attribute.
91
+ # @param [Object] Object to be compared
92
+ def ==(o)
93
+ return true if self.equal?(o)
94
+ self.class == o.class &&
95
+ return_code == o.return_code &&
96
+ description == o.description
97
+ end
98
+
99
+ # @see the `==` method
100
+ # @param [Object] Object to be compared
101
+ def eql?(o)
102
+ self == o
103
+ end
104
+
105
+ # Calculates hash code according to all attributes.
106
+ # @return [Integer] Hash code
107
+ def hash
108
+ [return_code, description].hash
109
+ end
110
+
111
+ # Builds the object from hash
112
+ # @param [Hash] attributes Model attributes in the form of hash
113
+ # @return [Object] Returns the model itself
114
+ def self.build_from_hash(attributes)
115
+ return nil unless attributes.is_a?(Hash)
116
+ attributes = attributes.transform_keys(&:to_sym)
117
+ transformed_hash = {}
118
+ openapi_types.each_pair do |key, type|
119
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
120
+ transformed_hash["#{key}"] = nil
121
+ elsif type =~ /\AArray<(.*)>/i
122
+ # check to ensure the input is an array given that the attribute
123
+ # is documented as an array but the input is not
124
+ if attributes[attribute_map[key]].is_a?(Array)
125
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
126
+ end
127
+ elsif !attributes[attribute_map[key]].nil?
128
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
129
+ end
130
+ end
131
+ new(transformed_hash)
132
+ end
133
+
134
+ # Deserializes the data based on type
135
+ # @param string type Data type
136
+ # @param string value Value to be deserialized
137
+ # @return [Object] Deserialized data
138
+ def self._deserialize(type, value)
139
+ case type.to_sym
140
+ when :Time
141
+ Time.parse(value)
142
+ when :Date
143
+ Date.parse(value)
144
+ when :String
145
+ value.to_s
146
+ when :Integer
147
+ value.to_i
148
+ when :Float
149
+ value.to_f
150
+ when :Boolean
151
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
152
+ true
153
+ else
154
+ false
155
+ end
156
+ when :Object
157
+ # generic object (usually a Hash), return directly
158
+ value
159
+ when /\AArray<(?<inner_type>.+)>\z/
160
+ inner_type = Regexp.last_match[:inner_type]
161
+ value.map { |v| _deserialize(inner_type, v) }
162
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
163
+ k_type = Regexp.last_match[:k_type]
164
+ v_type = Regexp.last_match[:v_type]
165
+ {}.tap do |hash|
166
+ value.each do |k, v|
167
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
168
+ end
169
+ end
170
+ else # model
171
+ # models (e.g. Pet) or oneOf
172
+ klass = Tremendous.const_get(type)
173
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
174
+ end
175
+ end
176
+
177
+ # Returns the string representation of the object
178
+ # @return [String] String presentation of the object
179
+ def to_s
180
+ to_hash.to_s
181
+ end
182
+
183
+ # to_body is an alias to to_hash (backward compatibility)
184
+ # @return [Hash] Returns the object in the form of hash
185
+ def to_body
186
+ to_hash
187
+ end
188
+
189
+ # Returns the object in the form of hash
190
+ # @return [Hash] Returns the object in the form of hash
191
+ def to_hash
192
+ hash = {}
193
+ self.class.attribute_map.each_pair do |attr, param|
194
+ value = self.send(attr)
195
+ if value.nil?
196
+ is_nullable = self.class.openapi_nullable.include?(attr)
197
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
198
+ end
199
+
200
+ hash[param] = _to_hash(value)
201
+ end
202
+ hash
203
+ end
204
+
205
+ # Outputs non-array value in the form of hash
206
+ # For object, use to_hash. Otherwise, just return the value
207
+ # @param [Object] value Any valid value
208
+ # @return [Hash] Returns the value in the form of hash
209
+ def _to_hash(value)
210
+ if value.is_a?(Array)
211
+ value.compact.map { |v| _to_hash(v) }
212
+ elsif value.is_a?(Hash)
213
+ {}.tap do |hash|
214
+ value.each { |k, v| hash[k] = _to_hash(v) }
215
+ end
216
+ elsif value.respond_to? :to_hash
217
+ value.to_hash
218
+ else
219
+ value
220
+ end
221
+ end
222
+
223
+ end
224
+
225
+ end
@@ -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