wallee-ruby-sdk 1.0.1 → 1.0.2

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 (132) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +21 -11
  3. data/lib/wallee-ruby-sdk/models/abstract_debt_collection_case_update.rb +270 -0
  4. data/lib/wallee-ruby-sdk/models/abstract_payment_link_update.rb +302 -0
  5. data/lib/wallee-ruby-sdk/models/abstract_subscription_affiliate_update.rb +230 -0
  6. data/lib/wallee-ruby-sdk/models/abstract_transaction_pending.rb +14 -4
  7. data/lib/wallee-ruby-sdk/models/criteria_operator.rb +1 -0
  8. data/lib/wallee-ruby-sdk/models/debt_collection_case.rb +502 -0
  9. data/lib/wallee-ruby-sdk/models/debt_collection_case_create.rb +310 -0
  10. data/lib/wallee-ruby-sdk/models/debt_collection_case_document.rb +300 -0
  11. data/lib/wallee-ruby-sdk/models/debt_collection_case_source.rb +232 -0
  12. data/lib/wallee-ruby-sdk/models/debt_collection_case_state.rb +48 -0
  13. data/lib/wallee-ruby-sdk/models/debt_collection_case_update.rb +300 -0
  14. data/lib/wallee-ruby-sdk/models/debt_collection_environment.rb +43 -0
  15. data/lib/wallee-ruby-sdk/models/debt_collection_receipt.rb +288 -0
  16. data/lib/wallee-ruby-sdk/models/debt_collection_receipt_source.rb +222 -0
  17. data/lib/wallee-ruby-sdk/models/debt_collector.rb +222 -0
  18. data/lib/wallee-ruby-sdk/models/debt_collector_condition.rb +258 -0
  19. data/lib/wallee-ruby-sdk/models/debt_collector_condition_type.rb +222 -0
  20. data/lib/wallee-ruby-sdk/models/debt_collector_configuration.rb +302 -0
  21. data/lib/wallee-ruby-sdk/models/document_template_type.rb +1 -11
  22. data/lib/wallee-ruby-sdk/models/entity_export_request.rb +215 -0
  23. data/lib/wallee-ruby-sdk/models/entity_query.rb +1 -1
  24. data/lib/wallee-ruby-sdk/models/entity_query_order_by.rb +10 -0
  25. data/lib/wallee-ruby-sdk/models/environment.rb +43 -0
  26. data/lib/wallee-ruby-sdk/models/metric_usage.rb +232 -0
  27. data/lib/wallee-ruby-sdk/models/payment_connector.rb +23 -1
  28. data/lib/wallee-ruby-sdk/models/payment_contract.rb +338 -0
  29. data/lib/wallee-ruby-sdk/models/payment_contract_state.rb +46 -0
  30. data/lib/wallee-ruby-sdk/models/payment_contract_type.rb +232 -0
  31. data/lib/wallee-ruby-sdk/models/payment_link.rb +382 -0
  32. data/lib/wallee-ruby-sdk/models/payment_link_active.rb +342 -0
  33. data/lib/wallee-ruby-sdk/models/payment_link_create.rb +337 -0
  34. data/lib/wallee-ruby-sdk/models/payment_link_protection_mode.rb +43 -0
  35. data/lib/wallee-ruby-sdk/models/payment_link_update.rb +332 -0
  36. data/lib/wallee-ruby-sdk/models/payment_method.rb +13 -1
  37. data/lib/wallee-ruby-sdk/models/payment_processor_configuration.rb +11 -1
  38. data/lib/wallee-ruby-sdk/models/refund.rb +11 -1
  39. data/lib/wallee-ruby-sdk/models/rest_address_format.rb +234 -0
  40. data/lib/wallee-ruby-sdk/models/rest_address_format_field.rb +51 -0
  41. data/lib/wallee-ruby-sdk/models/rest_country.rb +11 -1
  42. data/lib/wallee-ruby-sdk/models/subscription.rb +11 -1
  43. data/lib/wallee-ruby-sdk/models/subscription_affiliate.rb +290 -0
  44. data/lib/wallee-ruby-sdk/models/subscription_affiliate_create.rb +255 -0
  45. data/lib/wallee-ruby-sdk/models/subscription_affiliate_deleted.rb +290 -0
  46. data/lib/wallee-ruby-sdk/models/subscription_affiliate_deleting.rb +290 -0
  47. data/lib/wallee-ruby-sdk/models/subscription_affiliate_inactive.rb +260 -0
  48. data/lib/wallee-ruby-sdk/models/subscription_affiliate_update.rb +260 -0
  49. data/lib/wallee-ruby-sdk/models/subscription_change_request.rb +2 -2
  50. data/lib/wallee-ruby-sdk/models/subscription_create_request.rb +2 -2
  51. data/lib/wallee-ruby-sdk/models/subscription_pending.rb +11 -1
  52. data/lib/wallee-ruby-sdk/models/tokenizationn_mode.rb +44 -0
  53. data/lib/wallee-ruby-sdk/models/transaction.rb +63 -3
  54. data/lib/wallee-ruby-sdk/models/transaction_create.rb +41 -1
  55. data/lib/wallee-ruby-sdk/models/transaction_environment_selection_strategy.rb +43 -0
  56. data/lib/wallee-ruby-sdk/models/transaction_invoice.rb +11 -1
  57. data/lib/wallee-ruby-sdk/models/transaction_pending.rb +11 -1
  58. data/lib/wallee-ruby-sdk/models/unencrypted_card_data.rb +228 -0
  59. data/lib/wallee-ruby-sdk/models/unencrypted_card_data_create.rb +233 -0
  60. data/lib/wallee-ruby-sdk/models/webhook_listener_entity.rb +1 -11
  61. data/lib/wallee-ruby-sdk/services/account_service_api.rb +2 -2
  62. data/lib/wallee-ruby-sdk/services/application_user_service_api.rb +2 -2
  63. data/lib/wallee-ruby-sdk/services/card_processing_service_api.rb +176 -0
  64. data/lib/wallee-ruby-sdk/services/charge_attempt_service_api.rb +2 -2
  65. data/lib/wallee-ruby-sdk/services/charge_flow_level_service_api.rb +4 -4
  66. data/lib/wallee-ruby-sdk/services/charge_flow_service_api.rb +6 -6
  67. data/lib/wallee-ruby-sdk/services/condition_type_service_api.rb +4 -4
  68. data/lib/wallee-ruby-sdk/services/country_service_api.rb +2 -2
  69. data/lib/wallee-ruby-sdk/services/country_state_service_api.rb +4 -4
  70. data/lib/wallee-ruby-sdk/services/currency_service_api.rb +2 -2
  71. data/lib/wallee-ruby-sdk/services/debt_collection_case_service_api.rb +800 -0
  72. data/lib/wallee-ruby-sdk/services/debt_collector_configuration_service_api.rb +217 -0
  73. data/lib/wallee-ruby-sdk/services/debt_collector_service_api.rb +143 -0
  74. data/lib/wallee-ruby-sdk/services/delivery_indication_service_api.rb +6 -6
  75. data/lib/wallee-ruby-sdk/services/document_template_service_api.rb +2 -2
  76. data/lib/wallee-ruby-sdk/services/document_template_type_service_api.rb +4 -4
  77. data/lib/wallee-ruby-sdk/services/human_user_service_api.rb +59 -2
  78. data/lib/wallee-ruby-sdk/services/installment_payment_service_api.rb +4 -4
  79. data/lib/wallee-ruby-sdk/services/installment_payment_slice_service_api.rb +2 -2
  80. data/lib/wallee-ruby-sdk/services/installment_plan_calculation_service_api.rb +2 -2
  81. data/lib/wallee-ruby-sdk/services/installment_plan_configuration_service_api.rb +2 -2
  82. data/lib/wallee-ruby-sdk/services/installment_plan_slice_configuration_service_api.rb +2 -2
  83. data/lib/wallee-ruby-sdk/services/label_description_group_service_api.rb +4 -4
  84. data/lib/wallee-ruby-sdk/services/label_description_service_api.rb +4 -4
  85. data/lib/wallee-ruby-sdk/services/language_service_api.rb +2 -2
  86. data/lib/wallee-ruby-sdk/services/legal_organization_form_service_api.rb +201 -0
  87. data/lib/wallee-ruby-sdk/services/manual_task_service_api.rb +2 -2
  88. data/lib/wallee-ruby-sdk/services/mertic_usage_service_api.rb +100 -0
  89. data/lib/wallee-ruby-sdk/services/payment_connector_configuration_service_api.rb +2 -2
  90. data/lib/wallee-ruby-sdk/services/payment_connector_service_api.rb +4 -4
  91. data/lib/wallee-ruby-sdk/services/payment_link_service_api.rb +402 -0
  92. data/lib/wallee-ruby-sdk/services/payment_method_configuration_service_api.rb +2 -2
  93. data/lib/wallee-ruby-sdk/services/payment_method_service_api.rb +4 -4
  94. data/lib/wallee-ruby-sdk/services/payment_processor_configuration_service_api.rb +2 -2
  95. data/lib/wallee-ruby-sdk/services/payment_processor_service_api.rb +4 -4
  96. data/lib/wallee-ruby-sdk/services/permission_service_api.rb +4 -4
  97. data/lib/wallee-ruby-sdk/services/refund_service_api.rb +10 -10
  98. data/lib/wallee-ruby-sdk/services/space_service_api.rb +2 -2
  99. data/lib/wallee-ruby-sdk/services/static_value_service_api.rb +4 -4
  100. data/lib/wallee-ruby-sdk/services/subscriber_service_api.rb +2 -2
  101. data/lib/wallee-ruby-sdk/services/subscription_affiliate_service_api.rb +402 -0
  102. data/lib/wallee-ruby-sdk/services/subscription_charge_service_api.rb +4 -4
  103. data/lib/wallee-ruby-sdk/services/subscription_ledger_entry_service_api.rb +2 -2
  104. data/lib/wallee-ruby-sdk/services/subscription_metric_service_api.rb +2 -2
  105. data/lib/wallee-ruby-sdk/services/subscription_metric_usage_service_api.rb +2 -2
  106. data/lib/wallee-ruby-sdk/services/subscription_period_bill_service_api.rb +2 -2
  107. data/lib/wallee-ruby-sdk/services/subscription_product_component_group_service_api.rb +2 -2
  108. data/lib/wallee-ruby-sdk/services/subscription_product_component_service_api.rb +2 -2
  109. data/lib/wallee-ruby-sdk/services/subscription_product_fee_tier_service_api.rb +2 -2
  110. data/lib/wallee-ruby-sdk/services/subscription_product_metered_fee_service_api.rb +2 -2
  111. data/lib/wallee-ruby-sdk/services/subscription_product_period_fee_service_api.rb +2 -2
  112. data/lib/wallee-ruby-sdk/services/subscription_product_retirement_service_api.rb +2 -2
  113. data/lib/wallee-ruby-sdk/services/subscription_product_service_api.rb +2 -2
  114. data/lib/wallee-ruby-sdk/services/subscription_product_setup_fee_service_api.rb +2 -2
  115. data/lib/wallee-ruby-sdk/services/subscription_product_version_retirement_service_api.rb +2 -2
  116. data/lib/wallee-ruby-sdk/services/subscription_product_version_service_api.rb +2 -2
  117. data/lib/wallee-ruby-sdk/services/subscription_service_api.rb +12 -12
  118. data/lib/wallee-ruby-sdk/services/subscription_suspension_service_api.rb +2 -2
  119. data/lib/wallee-ruby-sdk/services/subscription_version_service_api.rb +2 -2
  120. data/lib/wallee-ruby-sdk/services/token_service_api.rb +2 -2
  121. data/lib/wallee-ruby-sdk/services/token_version_service_api.rb +4 -4
  122. data/lib/wallee-ruby-sdk/services/transaction_completion_service_api.rb +6 -6
  123. data/lib/wallee-ruby-sdk/services/transaction_invoice_service_api.rb +6 -6
  124. data/lib/wallee-ruby-sdk/services/transaction_service_api.rb +143 -18
  125. data/lib/wallee-ruby-sdk/services/transaction_void_service_api.rb +6 -6
  126. data/lib/wallee-ruby-sdk/services/user_account_role_service_api.rb +6 -6
  127. data/lib/wallee-ruby-sdk/services/user_space_role_service_api.rb +9 -9
  128. data/lib/wallee-ruby-sdk/services/webhook_listener_service_api.rb +2 -2
  129. data/lib/wallee-ruby-sdk/services/webhook_url_service_api.rb +2 -2
  130. data/lib/wallee-ruby-sdk/version.rb +1 -1
  131. data/lib/wallee-ruby-sdk.rb +47 -0
  132. metadata +50 -3
@@ -0,0 +1,502 @@
1
+ =begin
2
+ Wallee API: 1.0.0
3
+
4
+ The wallee API allows an easy interaction with the wallee web service.
5
+
6
+
7
+
8
+ Licensed under the Apache License, Version 2.0 (the "License");
9
+ you may not use this file except in compliance with the License.
10
+ You may obtain a copy of the License at
11
+
12
+ http://www.apache.org/licenses/LICENSE-2.0
13
+
14
+ Unless required by applicable law or agreed to in writing, software
15
+ distributed under the License is distributed on an "AS IS" BASIS,
16
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ See the License for the specific language governing permissions and
18
+ limitations under the License.
19
+
20
+ =end
21
+
22
+ require 'date'
23
+
24
+ module Wallee
25
+ # The debt collection case represents a try to collect the money from the debtor.
26
+ class DebtCollectionCase
27
+ # The amount is the total amount of the not paid items. The amount cannot be change once the case is reviewed.
28
+ attr_accessor :amount
29
+
30
+ # The billing address of the case identifies the debtor.
31
+ attr_accessor :billing_address
32
+
33
+ # The closed on date indicates when the case is closed on.
34
+ attr_accessor :closed_on
35
+
36
+ # The collector configuration determines how the debt collection case is processed.
37
+ attr_accessor :collector_configuration
38
+
39
+ # The contract date is the date on which the contract with the debtor was signed on.
40
+ attr_accessor :contract_date
41
+
42
+ # The created on date indicates the date on which the entity was stored into the database.
43
+ attr_accessor :created_on
44
+
45
+ # The creator references the user which has created the debt collection case.
46
+ attr_accessor :creator
47
+
48
+ # The currency defines the billing currency of the debt collection case.
49
+ attr_accessor :currency
50
+
51
+ # The due date indicates the date on which the amount receivable was due. This date has to be always in the past.
52
+ attr_accessor :due_date
53
+
54
+ # The environment in which this case will be processed. There must be a debt collector configuration present which supports the chosen environment.
55
+ attr_accessor :environment
56
+
57
+ # The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity.
58
+ attr_accessor :external_id
59
+
60
+ # The failed on date indicates when the case is failed on.
61
+ attr_accessor :failed_on
62
+
63
+ #
64
+ attr_accessor :failure_reason
65
+
66
+ # The ID is the primary key of the entity. The ID identifies the entity uniquely.
67
+ attr_accessor :id
68
+
69
+ #
70
+ attr_accessor :labels
71
+
72
+ # The language indicates the language to be used in the communication with the debtor.
73
+ attr_accessor :language
74
+
75
+ # The line items of the debt collection case will be shown on documents sent to the debtor and the total of them makes up total amount to collect.
76
+ attr_accessor :line_items
77
+
78
+ # The linked space id holds the ID of the space to which the entity belongs to.
79
+ attr_accessor :linked_space_id
80
+
81
+ #
82
+ attr_accessor :next_attempt_on
83
+
84
+ # The planned purge date indicates when the entity is permanently removed. When the date is null the entity is not planned to be removed.
85
+ attr_accessor :planned_purge_date
86
+
87
+ # The processing started on date indicates the date on which the processing of the case started on.
88
+ attr_accessor :processing_started_on
89
+
90
+ #
91
+ attr_accessor :processing_timeout_on
92
+
93
+ # The case reference is used in the communication with the debtor. It should be unique and it should be linkable with the source of the debt collection case.
94
+ attr_accessor :reference
95
+
96
+ #
97
+ attr_accessor :review_started_on
98
+
99
+ # The reviewed on date indicates when the review of the case was conducted on.
100
+ attr_accessor :reviewed_on
101
+
102
+ # The reviewer references the user which has reviewed the case.
103
+ attr_accessor :reviewer
104
+
105
+ # The source of the debt collection case indicates the origin of the amount receivable.
106
+ attr_accessor :source
107
+
108
+ # The source entity ID points to the object which is the origin of the debt collection case. This ID is only set when the case was triggered by an internal process.
109
+ attr_accessor :source_entity_id
110
+
111
+ #
112
+ attr_accessor :space_view_id
113
+
114
+ #
115
+ attr_accessor :state
116
+
117
+ # The version number indicates the version of the entity. The version is incremented whenever the entity is changed.
118
+ attr_accessor :version
119
+
120
+
121
+ # Attribute mapping from ruby-style variable name to JSON key.
122
+ def self.attribute_map
123
+ {
124
+ :'amount' => :'amount',
125
+ :'billing_address' => :'billingAddress',
126
+ :'closed_on' => :'closedOn',
127
+ :'collector_configuration' => :'collectorConfiguration',
128
+ :'contract_date' => :'contractDate',
129
+ :'created_on' => :'createdOn',
130
+ :'creator' => :'creator',
131
+ :'currency' => :'currency',
132
+ :'due_date' => :'dueDate',
133
+ :'environment' => :'environment',
134
+ :'external_id' => :'externalId',
135
+ :'failed_on' => :'failedOn',
136
+ :'failure_reason' => :'failureReason',
137
+ :'id' => :'id',
138
+ :'labels' => :'labels',
139
+ :'language' => :'language',
140
+ :'line_items' => :'lineItems',
141
+ :'linked_space_id' => :'linkedSpaceId',
142
+ :'next_attempt_on' => :'nextAttemptOn',
143
+ :'planned_purge_date' => :'plannedPurgeDate',
144
+ :'processing_started_on' => :'processingStartedOn',
145
+ :'processing_timeout_on' => :'processingTimeoutOn',
146
+ :'reference' => :'reference',
147
+ :'review_started_on' => :'reviewStartedOn',
148
+ :'reviewed_on' => :'reviewedOn',
149
+ :'reviewer' => :'reviewer',
150
+ :'source' => :'source',
151
+ :'source_entity_id' => :'sourceEntityId',
152
+ :'space_view_id' => :'spaceViewId',
153
+ :'state' => :'state',
154
+ :'version' => :'version'
155
+ }
156
+ end
157
+
158
+ # Attribute type mapping.
159
+ def self.swagger_types
160
+ {
161
+ :'amount' => :'Float',
162
+ :'billing_address' => :'Address',
163
+ :'closed_on' => :'DateTime',
164
+ :'collector_configuration' => :'DebtCollectorConfiguration',
165
+ :'contract_date' => :'DateTime',
166
+ :'created_on' => :'DateTime',
167
+ :'creator' => :'Integer',
168
+ :'currency' => :'String',
169
+ :'due_date' => :'DateTime',
170
+ :'environment' => :'DebtCollectionEnvironment',
171
+ :'external_id' => :'String',
172
+ :'failed_on' => :'DateTime',
173
+ :'failure_reason' => :'FailureReason',
174
+ :'id' => :'Integer',
175
+ :'labels' => :'Array<Label>',
176
+ :'language' => :'String',
177
+ :'line_items' => :'Array<LineItem>',
178
+ :'linked_space_id' => :'Integer',
179
+ :'next_attempt_on' => :'DateTime',
180
+ :'planned_purge_date' => :'DateTime',
181
+ :'processing_started_on' => :'DateTime',
182
+ :'processing_timeout_on' => :'DateTime',
183
+ :'reference' => :'String',
184
+ :'review_started_on' => :'DateTime',
185
+ :'reviewed_on' => :'DateTime',
186
+ :'reviewer' => :'Integer',
187
+ :'source' => :'DebtCollectionCaseSource',
188
+ :'source_entity_id' => :'Integer',
189
+ :'space_view_id' => :'Integer',
190
+ :'state' => :'DebtCollectionCaseState',
191
+ :'version' => :'Integer'
192
+ }
193
+ end
194
+
195
+ # Initializes the object
196
+ # @param [Hash] attributes Model attributes in the form of hash
197
+ def initialize(attributes = {})
198
+ return unless attributes.is_a?(Hash)
199
+
200
+ # convert string to symbol for hash key
201
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
202
+
203
+ if attributes.has_key?(:'amount')
204
+ self.amount = attributes[:'amount']
205
+ end
206
+
207
+ if attributes.has_key?(:'billingAddress')
208
+ self.billing_address = attributes[:'billingAddress']
209
+ end
210
+
211
+ if attributes.has_key?(:'closedOn')
212
+ self.closed_on = attributes[:'closedOn']
213
+ end
214
+
215
+ if attributes.has_key?(:'collectorConfiguration')
216
+ self.collector_configuration = attributes[:'collectorConfiguration']
217
+ end
218
+
219
+ if attributes.has_key?(:'contractDate')
220
+ self.contract_date = attributes[:'contractDate']
221
+ end
222
+
223
+ if attributes.has_key?(:'createdOn')
224
+ self.created_on = attributes[:'createdOn']
225
+ end
226
+
227
+ if attributes.has_key?(:'creator')
228
+ self.creator = attributes[:'creator']
229
+ end
230
+
231
+ if attributes.has_key?(:'currency')
232
+ self.currency = attributes[:'currency']
233
+ end
234
+
235
+ if attributes.has_key?(:'dueDate')
236
+ self.due_date = attributes[:'dueDate']
237
+ end
238
+
239
+ if attributes.has_key?(:'environment')
240
+ self.environment = attributes[:'environment']
241
+ end
242
+
243
+ if attributes.has_key?(:'externalId')
244
+ self.external_id = attributes[:'externalId']
245
+ end
246
+
247
+ if attributes.has_key?(:'failedOn')
248
+ self.failed_on = attributes[:'failedOn']
249
+ end
250
+
251
+ if attributes.has_key?(:'failureReason')
252
+ self.failure_reason = attributes[:'failureReason']
253
+ end
254
+
255
+ if attributes.has_key?(:'id')
256
+ self.id = attributes[:'id']
257
+ end
258
+
259
+ if attributes.has_key?(:'labels')
260
+ if (value = attributes[:'labels']).is_a?(Array)
261
+ self.labels = value
262
+ end
263
+ end
264
+
265
+ if attributes.has_key?(:'language')
266
+ self.language = attributes[:'language']
267
+ end
268
+
269
+ if attributes.has_key?(:'lineItems')
270
+ if (value = attributes[:'lineItems']).is_a?(Array)
271
+ self.line_items = value
272
+ end
273
+ end
274
+
275
+ if attributes.has_key?(:'linkedSpaceId')
276
+ self.linked_space_id = attributes[:'linkedSpaceId']
277
+ end
278
+
279
+ if attributes.has_key?(:'nextAttemptOn')
280
+ self.next_attempt_on = attributes[:'nextAttemptOn']
281
+ end
282
+
283
+ if attributes.has_key?(:'plannedPurgeDate')
284
+ self.planned_purge_date = attributes[:'plannedPurgeDate']
285
+ end
286
+
287
+ if attributes.has_key?(:'processingStartedOn')
288
+ self.processing_started_on = attributes[:'processingStartedOn']
289
+ end
290
+
291
+ if attributes.has_key?(:'processingTimeoutOn')
292
+ self.processing_timeout_on = attributes[:'processingTimeoutOn']
293
+ end
294
+
295
+ if attributes.has_key?(:'reference')
296
+ self.reference = attributes[:'reference']
297
+ end
298
+
299
+ if attributes.has_key?(:'reviewStartedOn')
300
+ self.review_started_on = attributes[:'reviewStartedOn']
301
+ end
302
+
303
+ if attributes.has_key?(:'reviewedOn')
304
+ self.reviewed_on = attributes[:'reviewedOn']
305
+ end
306
+
307
+ if attributes.has_key?(:'reviewer')
308
+ self.reviewer = attributes[:'reviewer']
309
+ end
310
+
311
+ if attributes.has_key?(:'source')
312
+ self.source = attributes[:'source']
313
+ end
314
+
315
+ if attributes.has_key?(:'sourceEntityId')
316
+ self.source_entity_id = attributes[:'sourceEntityId']
317
+ end
318
+
319
+ if attributes.has_key?(:'spaceViewId')
320
+ self.space_view_id = attributes[:'spaceViewId']
321
+ end
322
+
323
+ if attributes.has_key?(:'state')
324
+ self.state = attributes[:'state']
325
+ end
326
+
327
+ if attributes.has_key?(:'version')
328
+ self.version = attributes[:'version']
329
+ end
330
+
331
+ end
332
+
333
+ # Show invalid properties with the reasons. Usually used together with valid?
334
+ # @return Array for valid properies with the reasons
335
+ def list_invalid_properties
336
+ invalid_properties = Array.new
337
+ return invalid_properties
338
+ end
339
+
340
+ # Check to see if the all the properties in the model are valid
341
+ # @return true if the model is valid
342
+ def valid?
343
+ return true
344
+ end
345
+
346
+ # Checks equality by comparing each attribute.
347
+ # @param [Object] Object to be compared
348
+ def ==(o)
349
+ return true if self.equal?(o)
350
+ self.class == o.class &&
351
+ amount == o.amount &&
352
+ billing_address == o.billing_address &&
353
+ closed_on == o.closed_on &&
354
+ collector_configuration == o.collector_configuration &&
355
+ contract_date == o.contract_date &&
356
+ created_on == o.created_on &&
357
+ creator == o.creator &&
358
+ currency == o.currency &&
359
+ due_date == o.due_date &&
360
+ environment == o.environment &&
361
+ external_id == o.external_id &&
362
+ failed_on == o.failed_on &&
363
+ failure_reason == o.failure_reason &&
364
+ id == o.id &&
365
+ labels == o.labels &&
366
+ language == o.language &&
367
+ line_items == o.line_items &&
368
+ linked_space_id == o.linked_space_id &&
369
+ next_attempt_on == o.next_attempt_on &&
370
+ planned_purge_date == o.planned_purge_date &&
371
+ processing_started_on == o.processing_started_on &&
372
+ processing_timeout_on == o.processing_timeout_on &&
373
+ reference == o.reference &&
374
+ review_started_on == o.review_started_on &&
375
+ reviewed_on == o.reviewed_on &&
376
+ reviewer == o.reviewer &&
377
+ source == o.source &&
378
+ source_entity_id == o.source_entity_id &&
379
+ space_view_id == o.space_view_id &&
380
+ state == o.state &&
381
+ version == o.version
382
+ end
383
+
384
+ # @see the `==` method
385
+ # @param [Object] Object to be compared
386
+ def eql?(o)
387
+ self == o
388
+ end
389
+
390
+ # Calculates hash code according to all attributes.
391
+ # @return [Fixnum] Hash code
392
+ def hash
393
+ [amount, billing_address, closed_on, collector_configuration, contract_date, created_on, creator, currency, due_date, environment, external_id, failed_on, failure_reason, id, labels, language, line_items, linked_space_id, next_attempt_on, planned_purge_date, processing_started_on, processing_timeout_on, reference, review_started_on, reviewed_on, reviewer, source, source_entity_id, space_view_id, state, version].hash
394
+ end
395
+
396
+ # Builds the object from hash
397
+ # @param [Hash] attributes Model attributes in the form of hash
398
+ # @return [Object] Returns the model itself
399
+ def build_from_hash(attributes)
400
+ return nil unless attributes.is_a?(Hash)
401
+ self.class.swagger_types.each_pair do |key, type|
402
+ if type =~ /\AArray<(.*)>/i
403
+ # check to ensure the input is an array given that the the attribute
404
+ # is documented as an array but the input is not
405
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
406
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
407
+ end
408
+ elsif !attributes[self.class.attribute_map[key]].nil?
409
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
410
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
411
+ end
412
+
413
+ self
414
+ end
415
+
416
+ # Deserializes the data based on type
417
+ # @param string type Data type
418
+ # @param string value Value to be deserialized
419
+ # @return [Object] Deserialized data
420
+ def _deserialize(type, value)
421
+ case type.to_sym
422
+ when :DateTime
423
+ DateTime.parse(value)
424
+ when :Date
425
+ Date.parse(value)
426
+ when :String
427
+ value.to_s
428
+ when :Integer
429
+ value.to_i
430
+ when :Float
431
+ value.to_f
432
+ when :BOOLEAN
433
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
434
+ true
435
+ else
436
+ false
437
+ end
438
+ when :Object
439
+ # generic object (usually a Hash), return directly
440
+ value
441
+ when /\AArray<(?<inner_type>.+)>\z/
442
+ inner_type = Regexp.last_match[:inner_type]
443
+ value.map { |v| _deserialize(inner_type, v) }
444
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
445
+ k_type = Regexp.last_match[:k_type]
446
+ v_type = Regexp.last_match[:v_type]
447
+ {}.tap do |hash|
448
+ value.each do |k, v|
449
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
450
+ end
451
+ end
452
+ else # model
453
+ temp_model = Wallee.const_get(type).new
454
+ temp_model.build_from_hash(value)
455
+ end
456
+ end
457
+
458
+ # Returns the string representation of the object
459
+ # @return [String] String presentation of the object
460
+ def to_s
461
+ to_hash.to_s
462
+ end
463
+
464
+ # to_body is an alias to to_hash (backward compatibility)
465
+ # @return [Hash] Returns the object in the form of hash
466
+ def to_body
467
+ to_hash
468
+ end
469
+
470
+ # Returns the object in the form of hash
471
+ # @return [Hash] Returns the object in the form of hash
472
+ def to_hash
473
+ hash = {}
474
+ self.class.attribute_map.each_pair do |attr, param|
475
+ value = self.send(attr)
476
+ next if value.nil?
477
+ hash[param] = _to_hash(value)
478
+ end
479
+ hash
480
+ end
481
+
482
+ # Outputs non-array value in the form of hash
483
+ # For object, use to_hash. Otherwise, just return the value
484
+ # @param [Object] value Any valid value
485
+ # @return [Hash] Returns the value in the form of hash
486
+ def _to_hash(value)
487
+ if value.is_a?(Array)
488
+ value.compact.map{ |v| _to_hash(v) }
489
+ elsif value.is_a?(Hash)
490
+ {}.tap do |hash|
491
+ value.each { |k, v| hash[k] = _to_hash(v) }
492
+ end
493
+ elsif value.respond_to? :to_hash
494
+ value.to_hash
495
+ else
496
+ value
497
+ end
498
+ end
499
+
500
+ end
501
+
502
+ end