-
Notifications
You must be signed in to change notification settings - Fork 59
Expand file tree
/
Copy pathbank_transaction.py
More file actions
711 lines (541 loc) · 21.7 KB
/
bank_transaction.py
File metadata and controls
711 lines (541 loc) · 21.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
# coding: utf-8
"""
Xero Accounting API
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
Contact: api@xero.com
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
from xero_python.models import BaseModel
class BankTransaction(BaseModel):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually.
"""
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
openapi_types = {
"type": "str",
"contact": "Contact",
"line_items": "list[LineItem]",
"bank_account": "Account",
"is_reconciled": "bool",
"date": "date[ms-format]",
"reference": "str",
"currency_code": "CurrencyCode",
"currency_rate": "float",
"url": "str",
"status": "str",
"line_amount_types": "LineAmountTypes",
"sub_total": "float",
"total_tax": "float",
"total": "float",
"bank_transaction_id": "str",
"prepayment_id": "str",
"overpayment_id": "str",
"updated_date_utc": "datetime[ms-format]",
"has_attachments": "bool",
"status_attribute_string": "str",
"validation_errors": "list[ValidationError]",
}
attribute_map = {
"type": "Type",
"contact": "Contact",
"line_items": "LineItems",
"bank_account": "BankAccount",
"is_reconciled": "IsReconciled",
"date": "Date",
"reference": "Reference",
"currency_code": "CurrencyCode",
"currency_rate": "CurrencyRate",
"url": "Url",
"status": "Status",
"line_amount_types": "LineAmountTypes",
"sub_total": "SubTotal",
"total_tax": "TotalTax",
"total": "Total",
"bank_transaction_id": "BankTransactionID",
"prepayment_id": "PrepaymentID",
"overpayment_id": "OverpaymentID",
"updated_date_utc": "UpdatedDateUTC",
"has_attachments": "HasAttachments",
"status_attribute_string": "StatusAttributeString",
"validation_errors": "ValidationErrors",
}
def __init__(
self,
type=None,
contact=None,
line_items=None,
bank_account=None,
is_reconciled=None,
date=None,
reference=None,
currency_code=None,
currency_rate=None,
url=None,
status=None,
line_amount_types=None,
sub_total=None,
total_tax=None,
total=None,
bank_transaction_id=None,
prepayment_id=None,
overpayment_id=None,
updated_date_utc=None,
has_attachments=False,
status_attribute_string=None,
validation_errors=None,
): # noqa: E501
"""BankTransaction - a model defined in OpenAPI""" # noqa: E501
self._type = None
self._contact = None
self._line_items = None
self._bank_account = None
self._is_reconciled = None
self._date = None
self._reference = None
self._currency_code = None
self._currency_rate = None
self._url = None
self._status = None
self._line_amount_types = None
self._sub_total = None
self._total_tax = None
self._total = None
self._bank_transaction_id = None
self._prepayment_id = None
self._overpayment_id = None
self._updated_date_utc = None
self._has_attachments = None
self._status_attribute_string = None
self._validation_errors = None
self.discriminator = None
self.type = type
if contact is not None:
self.contact = contact
self.line_items = line_items
self.bank_account = bank_account
if is_reconciled is not None:
self.is_reconciled = is_reconciled
if date is not None:
self.date = date
if reference is not None:
self.reference = reference
if currency_code is not None:
self.currency_code = currency_code
if currency_rate is not None:
self.currency_rate = currency_rate
if url is not None:
self.url = url
if status is not None:
self.status = status
if line_amount_types is not None:
self.line_amount_types = line_amount_types
if sub_total is not None:
self.sub_total = sub_total
if total_tax is not None:
self.total_tax = total_tax
if total is not None:
self.total = total
if bank_transaction_id is not None:
self.bank_transaction_id = bank_transaction_id
if prepayment_id is not None:
self.prepayment_id = prepayment_id
if overpayment_id is not None:
self.overpayment_id = overpayment_id
if updated_date_utc is not None:
self.updated_date_utc = updated_date_utc
if has_attachments is not None:
self.has_attachments = has_attachments
if status_attribute_string is not None:
self.status_attribute_string = status_attribute_string
if validation_errors is not None:
self.validation_errors = validation_errors
@property
def type(self):
"""Gets the type of this BankTransaction. # noqa: E501
See Bank Transaction Types # noqa: E501
:return: The type of this BankTransaction. # noqa: E501
:rtype: str
"""
return self._type
@type.setter
def type(self, type):
"""Sets the type of this BankTransaction.
See Bank Transaction Types # noqa: E501
:param type: The type of this BankTransaction. # noqa: E501
:type: str
"""
if type is None:
raise ValueError(
"Invalid value for `type`, must not be `None`"
) # noqa: E501
allowed_values = [
"RECEIVE",
"RECEIVE-OVERPAYMENT",
"RECEIVE-PREPAYMENT",
"SPEND",
"SPEND-OVERPAYMENT",
"SPEND-PREPAYMENT",
"RECEIVE-TRANSFER",
"SPEND-TRANSFER",
"None",
] # noqa: E501
if type:
if type not in allowed_values:
raise ValueError(
"Invalid value for `type` ({0}), must be one of {1}".format( # noqa: E501
type, allowed_values
)
)
self._type = type
@property
def contact(self):
"""Gets the contact of this BankTransaction. # noqa: E501
:return: The contact of this BankTransaction. # noqa: E501
:rtype: Contact
"""
return self._contact
@contact.setter
def contact(self, contact):
"""Sets the contact of this BankTransaction.
:param contact: The contact of this BankTransaction. # noqa: E501
:type: Contact
"""
self._contact = contact
@property
def line_items(self):
"""Gets the line_items of this BankTransaction. # noqa: E501
See LineItems # noqa: E501
:return: The line_items of this BankTransaction. # noqa: E501
:rtype: list[LineItem]
"""
return self._line_items
@line_items.setter
def line_items(self, line_items):
"""Sets the line_items of this BankTransaction.
See LineItems # noqa: E501
:param line_items: The line_items of this BankTransaction. # noqa: E501
:type: list[LineItem]
"""
if line_items is None:
raise ValueError(
"Invalid value for `line_items`, must not be `None`"
) # noqa: E501
self._line_items = line_items
@property
def bank_account(self):
"""Gets the bank_account of this BankTransaction. # noqa: E501
:return: The bank_account of this BankTransaction. # noqa: E501
:rtype: Account
"""
return self._bank_account
@bank_account.setter
def bank_account(self, bank_account):
"""Sets the bank_account of this BankTransaction.
:param bank_account: The bank_account of this BankTransaction. # noqa: E501
:type: Account
"""
if bank_account is None:
raise ValueError(
"Invalid value for `bank_account`, must not be `None`"
) # noqa: E501
self._bank_account = bank_account
@property
def is_reconciled(self):
"""Gets the is_reconciled of this BankTransaction. # noqa: E501
Boolean to show if transaction is reconciled # noqa: E501
:return: The is_reconciled of this BankTransaction. # noqa: E501
:rtype: bool
"""
return self._is_reconciled
@is_reconciled.setter
def is_reconciled(self, is_reconciled):
"""Sets the is_reconciled of this BankTransaction.
Boolean to show if transaction is reconciled # noqa: E501
:param is_reconciled: The is_reconciled of this BankTransaction. # noqa: E501
:type: bool
"""
self._is_reconciled = is_reconciled
@property
def date(self):
"""Gets the date of this BankTransaction. # noqa: E501
Date of transaction – YYYY-MM-DD # noqa: E501
:return: The date of this BankTransaction. # noqa: E501
:rtype: date
"""
return self._date
@date.setter
def date(self, date):
"""Sets the date of this BankTransaction.
Date of transaction – YYYY-MM-DD # noqa: E501
:param date: The date of this BankTransaction. # noqa: E501
:type: date
"""
self._date = date
@property
def reference(self):
"""Gets the reference of this BankTransaction. # noqa: E501
Reference for the transaction. Only supported for SPEND and RECEIVE transactions. # noqa: E501
:return: The reference of this BankTransaction. # noqa: E501
:rtype: str
"""
return self._reference
@reference.setter
def reference(self, reference):
"""Sets the reference of this BankTransaction.
Reference for the transaction. Only supported for SPEND and RECEIVE transactions. # noqa: E501
:param reference: The reference of this BankTransaction. # noqa: E501
:type: str
"""
self._reference = reference
@property
def currency_code(self):
"""Gets the currency_code of this BankTransaction. # noqa: E501
:return: The currency_code of this BankTransaction. # noqa: E501
:rtype: CurrencyCode
"""
return self._currency_code
@currency_code.setter
def currency_code(self, currency_code):
"""Sets the currency_code of this BankTransaction.
:param currency_code: The currency_code of this BankTransaction. # noqa: E501
:type: CurrencyCode
"""
self._currency_code = currency_code
@property
def currency_rate(self):
"""Gets the currency_rate of this BankTransaction. # noqa: E501
Exchange rate to base currency when money is spent or received. e.g.0.7500 Only used for bank transactions in non base currency. If this isn’t specified for non base currency accounts then either the user-defined rate (preference) or the XE.com day rate will be used. Setting currency is only supported on overpayments. # noqa: E501
:return: The currency_rate of this BankTransaction. # noqa: E501
:rtype: float
"""
return self._currency_rate
@currency_rate.setter
def currency_rate(self, currency_rate):
"""Sets the currency_rate of this BankTransaction.
Exchange rate to base currency when money is spent or received. e.g.0.7500 Only used for bank transactions in non base currency. If this isn’t specified for non base currency accounts then either the user-defined rate (preference) or the XE.com day rate will be used. Setting currency is only supported on overpayments. # noqa: E501
:param currency_rate: The currency_rate of this BankTransaction. # noqa: E501
:type: float
"""
self._currency_rate = currency_rate
@property
def url(self):
"""Gets the url of this BankTransaction. # noqa: E501
URL link to a source document – shown as “Go to App Name” # noqa: E501
:return: The url of this BankTransaction. # noqa: E501
:rtype: str
"""
return self._url
@url.setter
def url(self, url):
"""Sets the url of this BankTransaction.
URL link to a source document – shown as “Go to App Name” # noqa: E501
:param url: The url of this BankTransaction. # noqa: E501
:type: str
"""
self._url = url
@property
def status(self):
"""Gets the status of this BankTransaction. # noqa: E501
See Bank Transaction Status Codes # noqa: E501
:return: The status of this BankTransaction. # noqa: E501
:rtype: str
"""
return self._status
@status.setter
def status(self, status):
"""Sets the status of this BankTransaction.
See Bank Transaction Status Codes # noqa: E501
:param status: The status of this BankTransaction. # noqa: E501
:type: str
"""
allowed_values = ["AUTHORISED", "DELETED", "VOIDED", "None"] # noqa: E501
if status:
if status not in allowed_values:
raise ValueError(
"Invalid value for `status` ({0}), must be one of {1}".format( # noqa: E501
status, allowed_values
)
)
self._status = status
@property
def line_amount_types(self):
"""Gets the line_amount_types of this BankTransaction. # noqa: E501
:return: The line_amount_types of this BankTransaction. # noqa: E501
:rtype: LineAmountTypes
"""
return self._line_amount_types
@line_amount_types.setter
def line_amount_types(self, line_amount_types):
"""Sets the line_amount_types of this BankTransaction.
:param line_amount_types: The line_amount_types of this BankTransaction. # noqa: E501
:type: LineAmountTypes
"""
self._line_amount_types = line_amount_types
@property
def sub_total(self):
"""Gets the sub_total of this BankTransaction. # noqa: E501
Total of bank transaction excluding taxes # noqa: E501
:return: The sub_total of this BankTransaction. # noqa: E501
:rtype: float
"""
return self._sub_total
@sub_total.setter
def sub_total(self, sub_total):
"""Sets the sub_total of this BankTransaction.
Total of bank transaction excluding taxes # noqa: E501
:param sub_total: The sub_total of this BankTransaction. # noqa: E501
:type: float
"""
self._sub_total = sub_total
@property
def total_tax(self):
"""Gets the total_tax of this BankTransaction. # noqa: E501
Total tax on bank transaction # noqa: E501
:return: The total_tax of this BankTransaction. # noqa: E501
:rtype: float
"""
return self._total_tax
@total_tax.setter
def total_tax(self, total_tax):
"""Sets the total_tax of this BankTransaction.
Total tax on bank transaction # noqa: E501
:param total_tax: The total_tax of this BankTransaction. # noqa: E501
:type: float
"""
self._total_tax = total_tax
@property
def total(self):
"""Gets the total of this BankTransaction. # noqa: E501
Total of bank transaction tax inclusive # noqa: E501
:return: The total of this BankTransaction. # noqa: E501
:rtype: float
"""
return self._total
@total.setter
def total(self, total):
"""Sets the total of this BankTransaction.
Total of bank transaction tax inclusive # noqa: E501
:param total: The total of this BankTransaction. # noqa: E501
:type: float
"""
self._total = total
@property
def bank_transaction_id(self):
"""Gets the bank_transaction_id of this BankTransaction. # noqa: E501
Xero generated unique identifier for bank transaction # noqa: E501
:return: The bank_transaction_id of this BankTransaction. # noqa: E501
:rtype: str
"""
return self._bank_transaction_id
@bank_transaction_id.setter
def bank_transaction_id(self, bank_transaction_id):
"""Sets the bank_transaction_id of this BankTransaction.
Xero generated unique identifier for bank transaction # noqa: E501
:param bank_transaction_id: The bank_transaction_id of this BankTransaction. # noqa: E501
:type: str
"""
self._bank_transaction_id = bank_transaction_id
@property
def prepayment_id(self):
"""Gets the prepayment_id of this BankTransaction. # noqa: E501
Xero generated unique identifier for a Prepayment. This will be returned on BankTransactions with a Type of SPEND-PREPAYMENT or RECEIVE-PREPAYMENT # noqa: E501
:return: The prepayment_id of this BankTransaction. # noqa: E501
:rtype: str
"""
return self._prepayment_id
@prepayment_id.setter
def prepayment_id(self, prepayment_id):
"""Sets the prepayment_id of this BankTransaction.
Xero generated unique identifier for a Prepayment. This will be returned on BankTransactions with a Type of SPEND-PREPAYMENT or RECEIVE-PREPAYMENT # noqa: E501
:param prepayment_id: The prepayment_id of this BankTransaction. # noqa: E501
:type: str
"""
self._prepayment_id = prepayment_id
@property
def overpayment_id(self):
"""Gets the overpayment_id of this BankTransaction. # noqa: E501
Xero generated unique identifier for an Overpayment. This will be returned on BankTransactions with a Type of SPEND-OVERPAYMENT or RECEIVE-OVERPAYMENT # noqa: E501
:return: The overpayment_id of this BankTransaction. # noqa: E501
:rtype: str
"""
return self._overpayment_id
@overpayment_id.setter
def overpayment_id(self, overpayment_id):
"""Sets the overpayment_id of this BankTransaction.
Xero generated unique identifier for an Overpayment. This will be returned on BankTransactions with a Type of SPEND-OVERPAYMENT or RECEIVE-OVERPAYMENT # noqa: E501
:param overpayment_id: The overpayment_id of this BankTransaction. # noqa: E501
:type: str
"""
self._overpayment_id = overpayment_id
@property
def updated_date_utc(self):
"""Gets the updated_date_utc of this BankTransaction. # noqa: E501
Last modified date UTC format # noqa: E501
:return: The updated_date_utc of this BankTransaction. # noqa: E501
:rtype: datetime
"""
return self._updated_date_utc
@updated_date_utc.setter
def updated_date_utc(self, updated_date_utc):
"""Sets the updated_date_utc of this BankTransaction.
Last modified date UTC format # noqa: E501
:param updated_date_utc: The updated_date_utc of this BankTransaction. # noqa: E501
:type: datetime
"""
self._updated_date_utc = updated_date_utc
@property
def has_attachments(self):
"""Gets the has_attachments of this BankTransaction. # noqa: E501
Boolean to indicate if a bank transaction has an attachment # noqa: E501
:return: The has_attachments of this BankTransaction. # noqa: E501
:rtype: bool
"""
return self._has_attachments
@has_attachments.setter
def has_attachments(self, has_attachments):
"""Sets the has_attachments of this BankTransaction.
Boolean to indicate if a bank transaction has an attachment # noqa: E501
:param has_attachments: The has_attachments of this BankTransaction. # noqa: E501
:type: bool
"""
self._has_attachments = has_attachments
@property
def status_attribute_string(self):
"""Gets the status_attribute_string of this BankTransaction. # noqa: E501
A string to indicate if a invoice status # noqa: E501
:return: The status_attribute_string of this BankTransaction. # noqa: E501
:rtype: str
"""
return self._status_attribute_string
@status_attribute_string.setter
def status_attribute_string(self, status_attribute_string):
"""Sets the status_attribute_string of this BankTransaction.
A string to indicate if a invoice status # noqa: E501
:param status_attribute_string: The status_attribute_string of this BankTransaction. # noqa: E501
:type: str
"""
self._status_attribute_string = status_attribute_string
@property
def validation_errors(self):
"""Gets the validation_errors of this BankTransaction. # noqa: E501
Displays array of validation error messages from the API # noqa: E501
:return: The validation_errors of this BankTransaction. # noqa: E501
:rtype: list[ValidationError]
"""
return self._validation_errors
@validation_errors.setter
def validation_errors(self, validation_errors):
"""Sets the validation_errors of this BankTransaction.
Displays array of validation error messages from the API # noqa: E501
:param validation_errors: The validation_errors of this BankTransaction. # noqa: E501
:type: list[ValidationError]
"""
self._validation_errors = validation_errors