maytes-api-client-rb 0.1.1

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 (163) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/LICENSE +21 -0
  4. data/README.md +47 -0
  5. data/Rakefile +10 -0
  6. data/docs/CancelCheckout409Response.md +24 -0
  7. data/docs/CancelCheckoutRequest.md +18 -0
  8. data/docs/CancelCheckoutResponse.md +18 -0
  9. data/docs/CaptureCheckout409Response.md +24 -0
  10. data/docs/CaptureCheckout422Response.md +24 -0
  11. data/docs/CaptureCheckoutRequest.md +24 -0
  12. data/docs/CaptureCheckoutResponse.md +18 -0
  13. data/docs/Checkout.md +48 -0
  14. data/docs/CheckoutCancelled.md +22 -0
  15. data/docs/CheckoutCaptured.md +28 -0
  16. data/docs/CheckoutCreated.md +24 -0
  17. data/docs/CheckoutDiscount.md +30 -0
  18. data/docs/CheckoutFee.md +32 -0
  19. data/docs/CreateCheckout401Response.md +24 -0
  20. data/docs/CreateCheckout409Response.md +24 -0
  21. data/docs/CreateCheckout422Response.md +24 -0
  22. data/docs/CreateCheckoutRequest.md +44 -0
  23. data/docs/CreateCheckoutResponse.md +18 -0
  24. data/docs/CreateRefundRequest.md +20 -0
  25. data/docs/CustomerData.md +22 -0
  26. data/docs/DefaultApi.md +633 -0
  27. data/docs/DigitalGoodsCustomData.md +18 -0
  28. data/docs/DigitalGoodsLineItem.md +38 -0
  29. data/docs/DonationLineItem.md +36 -0
  30. data/docs/ErrorResponseDto.md +24 -0
  31. data/docs/Fee.md +24 -0
  32. data/docs/FeeBreakdownLine.md +24 -0
  33. data/docs/FoodBeverageLineItem.md +36 -0
  34. data/docs/GetCheckout404Response.md +24 -0
  35. data/docs/GetCheckout422Response.md +24 -0
  36. data/docs/GetCheckoutResponse.md +18 -0
  37. data/docs/GetSettlementResponse.md +18 -0
  38. data/docs/HealthResponse.md +18 -0
  39. data/docs/LineItem.md +94 -0
  40. data/docs/ListSettlementsResponse.md +18 -0
  41. data/docs/OAuthTokenRequest.md +30 -0
  42. data/docs/OAuthTokenResponse.md +26 -0
  43. data/docs/OtherLineItem.md +36 -0
  44. data/docs/PhysicalGoodsCustomData.md +20 -0
  45. data/docs/PhysicalGoodsLineItem.md +38 -0
  46. data/docs/RefundCheckout402Response.md +24 -0
  47. data/docs/RefundCheckout409Response.md +24 -0
  48. data/docs/ServiceCustomData.md +18 -0
  49. data/docs/ServiceLineItem.md +38 -0
  50. data/docs/Settlement.md +52 -0
  51. data/docs/Tax.md +22 -0
  52. data/docs/TicketCustomData.md +40 -0
  53. data/docs/TicketLineItem.md +38 -0
  54. data/docs/TicketSeating.md +24 -0
  55. data/lib/maytes_api_client/api/default_api.rb +642 -0
  56. data/lib/maytes_api_client/api_client.rb +397 -0
  57. data/lib/maytes_api_client/api_error.rb +58 -0
  58. data/lib/maytes_api_client/api_model_base.rb +88 -0
  59. data/lib/maytes_api_client/configuration.rb +316 -0
  60. data/lib/maytes_api_client/managed_client.rb +140 -0
  61. data/lib/maytes_api_client/models/cancel_checkout409_response.rb +258 -0
  62. data/lib/maytes_api_client/models/cancel_checkout_request.rb +147 -0
  63. data/lib/maytes_api_client/models/cancel_checkout_response.rb +164 -0
  64. data/lib/maytes_api_client/models/capture_checkout409_response.rb +258 -0
  65. data/lib/maytes_api_client/models/capture_checkout422_response.rb +258 -0
  66. data/lib/maytes_api_client/models/capture_checkout_request.rb +218 -0
  67. data/lib/maytes_api_client/models/capture_checkout_response.rb +164 -0
  68. data/lib/maytes_api_client/models/checkout.rb +483 -0
  69. data/lib/maytes_api_client/models/checkout_cancelled.rb +202 -0
  70. data/lib/maytes_api_client/models/checkout_captured.rb +266 -0
  71. data/lib/maytes_api_client/models/checkout_created.rb +242 -0
  72. data/lib/maytes_api_client/models/checkout_discount.rb +329 -0
  73. data/lib/maytes_api_client/models/checkout_fee.rb +351 -0
  74. data/lib/maytes_api_client/models/create_checkout401_response.rb +258 -0
  75. data/lib/maytes_api_client/models/create_checkout409_response.rb +258 -0
  76. data/lib/maytes_api_client/models/create_checkout422_response.rb +258 -0
  77. data/lib/maytes_api_client/models/create_checkout_request.rb +444 -0
  78. data/lib/maytes_api_client/models/create_checkout_response.rb +164 -0
  79. data/lib/maytes_api_client/models/create_refund_request.rb +212 -0
  80. data/lib/maytes_api_client/models/customer_data.rb +168 -0
  81. data/lib/maytes_api_client/models/digital_goods_custom_data.rb +148 -0
  82. data/lib/maytes_api_client/models/digital_goods_line_item.rb +414 -0
  83. data/lib/maytes_api_client/models/donation_line_item.rb +405 -0
  84. data/lib/maytes_api_client/models/error_response_dto.rb +227 -0
  85. data/lib/maytes_api_client/models/fee.rb +271 -0
  86. data/lib/maytes_api_client/models/fee_breakdown_line.rb +266 -0
  87. data/lib/maytes_api_client/models/food_beverage_line_item.rb +405 -0
  88. data/lib/maytes_api_client/models/get_checkout404_response.rb +258 -0
  89. data/lib/maytes_api_client/models/get_checkout422_response.rb +258 -0
  90. data/lib/maytes_api_client/models/get_checkout_response.rb +164 -0
  91. data/lib/maytes_api_client/models/get_settlement_response.rb +164 -0
  92. data/lib/maytes_api_client/models/health_response.rb +164 -0
  93. data/lib/maytes_api_client/models/line_item.rb +65 -0
  94. data/lib/maytes_api_client/models/list_settlements_response.rb +166 -0
  95. data/lib/maytes_api_client/models/o_auth_token_request.rb +244 -0
  96. data/lib/maytes_api_client/models/o_auth_token_response.rb +251 -0
  97. data/lib/maytes_api_client/models/other_line_item.rb +405 -0
  98. data/lib/maytes_api_client/models/physical_goods_custom_data.rb +173 -0
  99. data/lib/maytes_api_client/models/physical_goods_line_item.rb +431 -0
  100. data/lib/maytes_api_client/models/refund_checkout402_response.rb +258 -0
  101. data/lib/maytes_api_client/models/refund_checkout409_response.rb +258 -0
  102. data/lib/maytes_api_client/models/service_custom_data.rb +148 -0
  103. data/lib/maytes_api_client/models/service_line_item.rb +414 -0
  104. data/lib/maytes_api_client/models/settlement.rb +526 -0
  105. data/lib/maytes_api_client/models/tax.rb +202 -0
  106. data/lib/maytes_api_client/models/ticket_custom_data.rb +333 -0
  107. data/lib/maytes_api_client/models/ticket_line_item.rb +431 -0
  108. data/lib/maytes_api_client/models/ticket_seating.rb +176 -0
  109. data/lib/maytes_api_client/version.rb +15 -0
  110. data/lib/maytes_api_client/webhook_verifier.rb +212 -0
  111. data/lib/maytes_api_client.rb +95 -0
  112. data/maytes_api_client.gemspec +39 -0
  113. data/spec/api/default_api_spec.rb +145 -0
  114. data/spec/models/cancel_checkout409_response_spec.rb +58 -0
  115. data/spec/models/cancel_checkout_request_spec.rb +36 -0
  116. data/spec/models/cancel_checkout_response_spec.rb +36 -0
  117. data/spec/models/capture_checkout409_response_spec.rb +58 -0
  118. data/spec/models/capture_checkout422_response_spec.rb +58 -0
  119. data/spec/models/capture_checkout_request_spec.rb +54 -0
  120. data/spec/models/capture_checkout_response_spec.rb +36 -0
  121. data/spec/models/checkout_cancelled_spec.rb +48 -0
  122. data/spec/models/checkout_captured_spec.rb +66 -0
  123. data/spec/models/checkout_created_spec.rb +54 -0
  124. data/spec/models/checkout_discount_spec.rb +76 -0
  125. data/spec/models/checkout_fee_spec.rb +86 -0
  126. data/spec/models/checkout_spec.rb +126 -0
  127. data/spec/models/create_checkout401_response_spec.rb +58 -0
  128. data/spec/models/create_checkout409_response_spec.rb +58 -0
  129. data/spec/models/create_checkout422_response_spec.rb +58 -0
  130. data/spec/models/create_checkout_request_spec.rb +118 -0
  131. data/spec/models/create_checkout_response_spec.rb +36 -0
  132. data/spec/models/create_refund_request_spec.rb +42 -0
  133. data/spec/models/customer_data_spec.rb +48 -0
  134. data/spec/models/digital_goods_custom_data_spec.rb +36 -0
  135. data/spec/models/digital_goods_line_item_spec.rb +100 -0
  136. data/spec/models/donation_line_item_spec.rb +94 -0
  137. data/spec/models/error_response_dto_spec.rb +54 -0
  138. data/spec/models/fee_breakdown_line_spec.rb +58 -0
  139. data/spec/models/fee_spec.rb +54 -0
  140. data/spec/models/food_beverage_line_item_spec.rb +94 -0
  141. data/spec/models/get_checkout404_response_spec.rb +58 -0
  142. data/spec/models/get_checkout422_response_spec.rb +58 -0
  143. data/spec/models/get_checkout_response_spec.rb +36 -0
  144. data/spec/models/get_settlement_response_spec.rb +36 -0
  145. data/spec/models/health_response_spec.rb +36 -0
  146. data/spec/models/line_item_spec.rb +44 -0
  147. data/spec/models/list_settlements_response_spec.rb +36 -0
  148. data/spec/models/o_auth_token_request_spec.rb +72 -0
  149. data/spec/models/o_auth_token_response_spec.rb +60 -0
  150. data/spec/models/other_line_item_spec.rb +94 -0
  151. data/spec/models/physical_goods_custom_data_spec.rb +42 -0
  152. data/spec/models/physical_goods_line_item_spec.rb +100 -0
  153. data/spec/models/refund_checkout402_response_spec.rb +58 -0
  154. data/spec/models/refund_checkout409_response_spec.rb +58 -0
  155. data/spec/models/service_custom_data_spec.rb +36 -0
  156. data/spec/models/service_line_item_spec.rb +100 -0
  157. data/spec/models/settlement_spec.rb +138 -0
  158. data/spec/models/tax_spec.rb +48 -0
  159. data/spec/models/ticket_custom_data_spec.rb +106 -0
  160. data/spec/models/ticket_line_item_spec.rb +100 -0
  161. data/spec/models/ticket_seating_spec.rb +54 -0
  162. data/spec/spec_helper.rb +111 -0
  163. metadata +295 -0
@@ -0,0 +1,526 @@
1
+ =begin
2
+ #Maytes API
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module MaytesApiClient
17
+ class Settlement < ApiModelBase
18
+ attr_accessor :uuid
19
+
20
+ attr_accessor :merchant_uuid
21
+
22
+ attr_accessor :period_from
23
+
24
+ attr_accessor :period_to
25
+
26
+ attr_accessor :idempotency_key
27
+
28
+ attr_accessor :merchant_payable_amount
29
+
30
+ attr_accessor :settled_amount
31
+
32
+ attr_accessor :currency
33
+
34
+ attr_accessor :status
35
+
36
+ attr_accessor :stripe_transfer_id
37
+
38
+ attr_accessor :notes
39
+
40
+ attr_accessor :settled_at
41
+
42
+ attr_accessor :expires_at
43
+
44
+ attr_accessor :reviewed_by_user_uuid
45
+
46
+ attr_accessor :reviewed_at
47
+
48
+ attr_accessor :rejection_reason
49
+
50
+ attr_accessor :created_at
51
+
52
+ attr_accessor :updated_at
53
+
54
+ # Attribute mapping from ruby-style variable name to JSON key.
55
+ def self.attribute_map
56
+ {
57
+ :'uuid' => :'uuid',
58
+ :'merchant_uuid' => :'merchant_uuid',
59
+ :'period_from' => :'period_from',
60
+ :'period_to' => :'period_to',
61
+ :'idempotency_key' => :'idempotency_key',
62
+ :'merchant_payable_amount' => :'merchant_payable_amount',
63
+ :'settled_amount' => :'settled_amount',
64
+ :'currency' => :'currency',
65
+ :'status' => :'status',
66
+ :'stripe_transfer_id' => :'stripe_transfer_id',
67
+ :'notes' => :'notes',
68
+ :'settled_at' => :'settled_at',
69
+ :'expires_at' => :'expires_at',
70
+ :'reviewed_by_user_uuid' => :'reviewed_by_user_uuid',
71
+ :'reviewed_at' => :'reviewed_at',
72
+ :'rejection_reason' => :'rejection_reason',
73
+ :'created_at' => :'created_at',
74
+ :'updated_at' => :'updated_at'
75
+ }
76
+ end
77
+
78
+ # Returns attribute mapping this model knows about
79
+ def self.acceptable_attribute_map
80
+ attribute_map
81
+ end
82
+
83
+ # Returns all the JSON keys this model knows about
84
+ def self.acceptable_attributes
85
+ acceptable_attribute_map.values
86
+ end
87
+
88
+ # Attribute type mapping.
89
+ def self.openapi_types
90
+ {
91
+ :'uuid' => :'String',
92
+ :'merchant_uuid' => :'String',
93
+ :'period_from' => :'Time',
94
+ :'period_to' => :'Time',
95
+ :'idempotency_key' => :'String',
96
+ :'merchant_payable_amount' => :'Integer',
97
+ :'settled_amount' => :'Integer',
98
+ :'currency' => :'String',
99
+ :'status' => :'String',
100
+ :'stripe_transfer_id' => :'String',
101
+ :'notes' => :'String',
102
+ :'settled_at' => :'Time',
103
+ :'expires_at' => :'Time',
104
+ :'reviewed_by_user_uuid' => :'String',
105
+ :'reviewed_at' => :'Time',
106
+ :'rejection_reason' => :'String',
107
+ :'created_at' => :'Time',
108
+ :'updated_at' => :'Time'
109
+ }
110
+ end
111
+
112
+ # List of attributes with nullable: true
113
+ def self.openapi_nullable
114
+ Set.new([
115
+ :'stripe_transfer_id',
116
+ :'notes',
117
+ :'settled_at',
118
+ :'expires_at',
119
+ :'reviewed_by_user_uuid',
120
+ :'reviewed_at',
121
+ :'rejection_reason',
122
+ ])
123
+ end
124
+
125
+ # Initializes the object
126
+ # @param [Hash] attributes Model attributes in the form of hash
127
+ def initialize(attributes = {})
128
+ if (!attributes.is_a?(Hash))
129
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MaytesApiClient::Settlement` initialize method"
130
+ end
131
+
132
+ # check to see if the attribute exists and convert string to symbol for hash key
133
+ acceptable_attribute_map = self.class.acceptable_attribute_map
134
+ attributes = attributes.each_with_object({}) { |(k, v), h|
135
+ if (!acceptable_attribute_map.key?(k.to_sym))
136
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MaytesApiClient::Settlement`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
137
+ end
138
+ h[k.to_sym] = v
139
+ }
140
+
141
+ if attributes.key?(:'uuid')
142
+ self.uuid = attributes[:'uuid']
143
+ else
144
+ self.uuid = nil
145
+ end
146
+
147
+ if attributes.key?(:'merchant_uuid')
148
+ self.merchant_uuid = attributes[:'merchant_uuid']
149
+ else
150
+ self.merchant_uuid = nil
151
+ end
152
+
153
+ if attributes.key?(:'period_from')
154
+ self.period_from = attributes[:'period_from']
155
+ else
156
+ self.period_from = nil
157
+ end
158
+
159
+ if attributes.key?(:'period_to')
160
+ self.period_to = attributes[:'period_to']
161
+ else
162
+ self.period_to = nil
163
+ end
164
+
165
+ if attributes.key?(:'idempotency_key')
166
+ self.idempotency_key = attributes[:'idempotency_key']
167
+ else
168
+ self.idempotency_key = nil
169
+ end
170
+
171
+ if attributes.key?(:'merchant_payable_amount')
172
+ self.merchant_payable_amount = attributes[:'merchant_payable_amount']
173
+ else
174
+ self.merchant_payable_amount = nil
175
+ end
176
+
177
+ if attributes.key?(:'settled_amount')
178
+ self.settled_amount = attributes[:'settled_amount']
179
+ else
180
+ self.settled_amount = nil
181
+ end
182
+
183
+ if attributes.key?(:'currency')
184
+ self.currency = attributes[:'currency']
185
+ else
186
+ self.currency = nil
187
+ end
188
+
189
+ if attributes.key?(:'status')
190
+ self.status = attributes[:'status']
191
+ else
192
+ self.status = nil
193
+ end
194
+
195
+ if attributes.key?(:'stripe_transfer_id')
196
+ self.stripe_transfer_id = attributes[:'stripe_transfer_id']
197
+ else
198
+ self.stripe_transfer_id = nil
199
+ end
200
+
201
+ if attributes.key?(:'notes')
202
+ self.notes = attributes[:'notes']
203
+ else
204
+ self.notes = nil
205
+ end
206
+
207
+ if attributes.key?(:'settled_at')
208
+ self.settled_at = attributes[:'settled_at']
209
+ else
210
+ self.settled_at = nil
211
+ end
212
+
213
+ if attributes.key?(:'expires_at')
214
+ self.expires_at = attributes[:'expires_at']
215
+ else
216
+ self.expires_at = nil
217
+ end
218
+
219
+ if attributes.key?(:'reviewed_by_user_uuid')
220
+ self.reviewed_by_user_uuid = attributes[:'reviewed_by_user_uuid']
221
+ else
222
+ self.reviewed_by_user_uuid = nil
223
+ end
224
+
225
+ if attributes.key?(:'reviewed_at')
226
+ self.reviewed_at = attributes[:'reviewed_at']
227
+ else
228
+ self.reviewed_at = nil
229
+ end
230
+
231
+ if attributes.key?(:'rejection_reason')
232
+ self.rejection_reason = attributes[:'rejection_reason']
233
+ else
234
+ self.rejection_reason = nil
235
+ end
236
+
237
+ if attributes.key?(:'created_at')
238
+ self.created_at = attributes[:'created_at']
239
+ else
240
+ self.created_at = nil
241
+ end
242
+
243
+ if attributes.key?(:'updated_at')
244
+ self.updated_at = attributes[:'updated_at']
245
+ else
246
+ self.updated_at = nil
247
+ end
248
+ end
249
+
250
+ # Show invalid properties with the reasons. Usually used together with valid?
251
+ # @return Array for valid properties with the reasons
252
+ def list_invalid_properties
253
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
254
+ invalid_properties = Array.new
255
+ if @uuid.nil?
256
+ invalid_properties.push('invalid value for "uuid", uuid cannot be nil.')
257
+ end
258
+
259
+ if @merchant_uuid.nil?
260
+ invalid_properties.push('invalid value for "merchant_uuid", merchant_uuid cannot be nil.')
261
+ end
262
+
263
+ if @period_from.nil?
264
+ invalid_properties.push('invalid value for "period_from", period_from cannot be nil.')
265
+ end
266
+
267
+ if @period_to.nil?
268
+ invalid_properties.push('invalid value for "period_to", period_to cannot be nil.')
269
+ end
270
+
271
+ if @idempotency_key.nil?
272
+ invalid_properties.push('invalid value for "idempotency_key", idempotency_key cannot be nil.')
273
+ end
274
+
275
+ if @merchant_payable_amount.nil?
276
+ invalid_properties.push('invalid value for "merchant_payable_amount", merchant_payable_amount cannot be nil.')
277
+ end
278
+
279
+ if @settled_amount.nil?
280
+ invalid_properties.push('invalid value for "settled_amount", settled_amount cannot be nil.')
281
+ end
282
+
283
+ if @currency.nil?
284
+ invalid_properties.push('invalid value for "currency", currency cannot be nil.')
285
+ end
286
+
287
+ if @currency.to_s.length > 3
288
+ invalid_properties.push('invalid value for "currency", the character length must be smaller than or equal to 3.')
289
+ end
290
+
291
+ if @currency.to_s.length < 3
292
+ invalid_properties.push('invalid value for "currency", the character length must be greater than or equal to 3.')
293
+ end
294
+
295
+ if @status.nil?
296
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
297
+ end
298
+
299
+ if @created_at.nil?
300
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
301
+ end
302
+
303
+ if @updated_at.nil?
304
+ invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
305
+ end
306
+
307
+ invalid_properties
308
+ end
309
+
310
+ # Check to see if the all the properties in the model are valid
311
+ # @return true if the model is valid
312
+ def valid?
313
+ warn '[DEPRECATED] the `valid?` method is obsolete'
314
+ return false if @uuid.nil?
315
+ return false if @merchant_uuid.nil?
316
+ return false if @period_from.nil?
317
+ return false if @period_to.nil?
318
+ return false if @idempotency_key.nil?
319
+ return false if @merchant_payable_amount.nil?
320
+ return false if @settled_amount.nil?
321
+ return false if @currency.nil?
322
+ return false if @currency.to_s.length > 3
323
+ return false if @currency.to_s.length < 3
324
+ return false if @status.nil?
325
+ return false if @created_at.nil?
326
+ return false if @updated_at.nil?
327
+ true
328
+ end
329
+
330
+ # Custom attribute writer method with validation
331
+ # @param [Object] uuid Value to be assigned
332
+ def uuid=(uuid)
333
+ if uuid.nil?
334
+ fail ArgumentError, 'uuid cannot be nil'
335
+ end
336
+
337
+ @uuid = uuid
338
+ end
339
+
340
+ # Custom attribute writer method with validation
341
+ # @param [Object] merchant_uuid Value to be assigned
342
+ def merchant_uuid=(merchant_uuid)
343
+ if merchant_uuid.nil?
344
+ fail ArgumentError, 'merchant_uuid cannot be nil'
345
+ end
346
+
347
+ @merchant_uuid = merchant_uuid
348
+ end
349
+
350
+ # Custom attribute writer method with validation
351
+ # @param [Object] period_from Value to be assigned
352
+ def period_from=(period_from)
353
+ if period_from.nil?
354
+ fail ArgumentError, 'period_from cannot be nil'
355
+ end
356
+
357
+ @period_from = period_from
358
+ end
359
+
360
+ # Custom attribute writer method with validation
361
+ # @param [Object] period_to Value to be assigned
362
+ def period_to=(period_to)
363
+ if period_to.nil?
364
+ fail ArgumentError, 'period_to cannot be nil'
365
+ end
366
+
367
+ @period_to = period_to
368
+ end
369
+
370
+ # Custom attribute writer method with validation
371
+ # @param [Object] idempotency_key Value to be assigned
372
+ def idempotency_key=(idempotency_key)
373
+ if idempotency_key.nil?
374
+ fail ArgumentError, 'idempotency_key cannot be nil'
375
+ end
376
+
377
+ @idempotency_key = idempotency_key
378
+ end
379
+
380
+ # Custom attribute writer method with validation
381
+ # @param [Object] merchant_payable_amount Value to be assigned
382
+ def merchant_payable_amount=(merchant_payable_amount)
383
+ if merchant_payable_amount.nil?
384
+ fail ArgumentError, 'merchant_payable_amount cannot be nil'
385
+ end
386
+
387
+ @merchant_payable_amount = merchant_payable_amount
388
+ end
389
+
390
+ # Custom attribute writer method with validation
391
+ # @param [Object] settled_amount Value to be assigned
392
+ def settled_amount=(settled_amount)
393
+ if settled_amount.nil?
394
+ fail ArgumentError, 'settled_amount cannot be nil'
395
+ end
396
+
397
+ @settled_amount = settled_amount
398
+ end
399
+
400
+ # Custom attribute writer method with validation
401
+ # @param [Object] currency Value to be assigned
402
+ def currency=(currency)
403
+ if currency.nil?
404
+ fail ArgumentError, 'currency cannot be nil'
405
+ end
406
+
407
+ if currency.to_s.length > 3
408
+ fail ArgumentError, 'invalid value for "currency", the character length must be smaller than or equal to 3.'
409
+ end
410
+
411
+ if currency.to_s.length < 3
412
+ fail ArgumentError, 'invalid value for "currency", the character length must be greater than or equal to 3.'
413
+ end
414
+
415
+ @currency = currency
416
+ end
417
+
418
+ # Custom attribute writer method with validation
419
+ # @param [Object] status Value to be assigned
420
+ def status=(status)
421
+ if status.nil?
422
+ fail ArgumentError, 'status cannot be nil'
423
+ end
424
+
425
+ @status = status
426
+ end
427
+
428
+ # Custom attribute writer method with validation
429
+ # @param [Object] created_at Value to be assigned
430
+ def created_at=(created_at)
431
+ if created_at.nil?
432
+ fail ArgumentError, 'created_at cannot be nil'
433
+ end
434
+
435
+ @created_at = created_at
436
+ end
437
+
438
+ # Custom attribute writer method with validation
439
+ # @param [Object] updated_at Value to be assigned
440
+ def updated_at=(updated_at)
441
+ if updated_at.nil?
442
+ fail ArgumentError, 'updated_at cannot be nil'
443
+ end
444
+
445
+ @updated_at = updated_at
446
+ end
447
+
448
+ # Checks equality by comparing each attribute.
449
+ # @param [Object] Object to be compared
450
+ def ==(o)
451
+ return true if self.equal?(o)
452
+ self.class == o.class &&
453
+ uuid == o.uuid &&
454
+ merchant_uuid == o.merchant_uuid &&
455
+ period_from == o.period_from &&
456
+ period_to == o.period_to &&
457
+ idempotency_key == o.idempotency_key &&
458
+ merchant_payable_amount == o.merchant_payable_amount &&
459
+ settled_amount == o.settled_amount &&
460
+ currency == o.currency &&
461
+ status == o.status &&
462
+ stripe_transfer_id == o.stripe_transfer_id &&
463
+ notes == o.notes &&
464
+ settled_at == o.settled_at &&
465
+ expires_at == o.expires_at &&
466
+ reviewed_by_user_uuid == o.reviewed_by_user_uuid &&
467
+ reviewed_at == o.reviewed_at &&
468
+ rejection_reason == o.rejection_reason &&
469
+ created_at == o.created_at &&
470
+ updated_at == o.updated_at
471
+ end
472
+
473
+ # @see the `==` method
474
+ # @param [Object] Object to be compared
475
+ def eql?(o)
476
+ self == o
477
+ end
478
+
479
+ # Calculates hash code according to all attributes.
480
+ # @return [Integer] Hash code
481
+ def hash
482
+ [uuid, merchant_uuid, period_from, period_to, idempotency_key, merchant_payable_amount, settled_amount, currency, status, stripe_transfer_id, notes, settled_at, expires_at, reviewed_by_user_uuid, reviewed_at, rejection_reason, created_at, updated_at].hash
483
+ end
484
+
485
+ # Builds the object from hash
486
+ # @param [Hash] attributes Model attributes in the form of hash
487
+ # @return [Object] Returns the model itself
488
+ def self.build_from_hash(attributes)
489
+ return nil unless attributes.is_a?(Hash)
490
+ attributes = attributes.transform_keys(&:to_sym)
491
+ transformed_hash = {}
492
+ openapi_types.each_pair do |key, type|
493
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
494
+ transformed_hash["#{key}"] = nil
495
+ elsif type =~ /\AArray<(.*)>/i
496
+ # check to ensure the input is an array given that the attribute
497
+ # is documented as an array but the input is not
498
+ if attributes[attribute_map[key]].is_a?(Array)
499
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
500
+ end
501
+ elsif !attributes[attribute_map[key]].nil?
502
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
503
+ end
504
+ end
505
+ new(transformed_hash)
506
+ end
507
+
508
+ # Returns the object in the form of hash
509
+ # @return [Hash] Returns the object in the form of hash
510
+ def to_hash
511
+ hash = {}
512
+ self.class.attribute_map.each_pair do |attr, param|
513
+ value = self.send(attr)
514
+ if value.nil?
515
+ is_nullable = self.class.openapi_nullable.include?(attr)
516
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
517
+ end
518
+
519
+ hash[param] = _to_hash(value)
520
+ end
521
+ hash
522
+ end
523
+
524
+ end
525
+
526
+ end