Skip to content

Commit 38e7eb8

Browse files
sangeet-joy-twsangeet-joy_xeromanishT72
authored
Build from OAS 5.0.0 (#135)
* build from OAS 5.0.0 * cleared print statement * adjusted the py test cases * added the page size changes from open api 5.0.0 * test cases commented for now due to wrong data received from api. * python sdk version update * fix test_get_invoices test * test cases fixed * build from latest OAS --------- Co-authored-by: sangeet-joy_xero <sangeet.joy@xero.com> Co-authored-by: manishT72 <147086188+manishT72@users.noreply.github.com>
1 parent 6aaad9d commit 38e7eb8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+2808
-137
lines changed

docs/v1/accounting/index.html

Lines changed: 428 additions & 8 deletions
Large diffs are not rendered by default.

docs/v1/appstore/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1241,7 +1241,7 @@
12411241
<nav id="scrollingNav">
12421242
<ul class="sidenav nav nav-list">
12431243
<li class="nav-header" data-group="AppStore"><strong>SDK: </strong><span id='sdk-name'></span></li>
1244-
<li class="nav-header" data-group="AppStore"><strong>VSN: </strong>4.0.0</li>
1244+
<li class="nav-header" data-group="AppStore"><strong>VSN: </strong>5.0.0</li>
12451245
<li class="nav-header" data-group="AppStore"><a href="#api-AppStore">Methods</a></li>
12461246
<li data-group="AppStore" data-name="getSubscription" class="">
12471247
<a href="#api-AppStore-getSubscription">getSubscription</a>

docs/v1/assets/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1392,7 +1392,7 @@
13921392
<nav id="scrollingNav">
13931393
<ul class="sidenav nav nav-list">
13941394
<li class="nav-header" data-group="Asset"><strong>SDK: </strong><span id='sdk-name'></span></li>
1395-
<li class="nav-header" data-group="Asset"><strong>VSN: </strong>4.0.0</li>
1395+
<li class="nav-header" data-group="Asset"><strong>VSN: </strong>5.0.0</li>
13961396
<li class="nav-header" data-group="Asset"><a href="#api-Asset">Methods</a></li>
13971397
<li data-group="Asset" data-name="createAsset" class="">
13981398
<a href="#api-Asset-createAsset">createAsset</a>

docs/v1/files/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1170,7 +1170,7 @@
11701170
<nav id="scrollingNav">
11711171
<ul class="sidenav nav nav-list">
11721172
<li class="nav-header" data-group="Files"><strong>SDK: </strong><span id='sdk-name'></span></li>
1173-
<li class="nav-header" data-group="Files"><strong>VSN: </strong>4.0.0</li>
1173+
<li class="nav-header" data-group="Files"><strong>VSN: </strong>5.0.0</li>
11741174
<li class="nav-header" data-group="Files"><a href="#api-Files">Methods</a></li>
11751175
<li data-group="Files" data-name="createFileAssociation" class="">
11761176
<a href="#api-Files-createFileAssociation">createFileAssociation</a>

docs/v1/finance/index.html

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1529,91 +1529,94 @@
15291529
"properties" : {
15301530
"directBankFeed" : {
15311531
"type" : "number",
1532-
"description" : "Sum of the amounts of all statement lines where the source of the data was a direct bank feed in to Xero. This gives an indication on the certainty of correctness of the data.",
1532+
"description" : "Sum of the amounts of all statement lines where the source of the data was a direct bank feed in to Xero via an API integration. This could be from a bank or aggregator. This gives an indication on the certainty of correctness of the data.",
15331533
"format" : "double",
15341534
"x-is-money" : true
15351535
},
15361536
"indirectBankFeed" : {
15371537
"type" : "number",
1538-
"description" : "Sum of the amounts of all statement lines where the source of the data was a indirect bank feed to Xero (usually via Yodlee). This gives an indication on the certainty of correctness of the data.",
1538+
"description" : "No longer in use.",
15391539
"format" : "double",
1540+
"deprecated" : true,
15401541
"x-is-money" : true
15411542
},
15421543
"fileUpload" : {
15431544
"type" : "number",
1544-
"description" : "Sum of the amounts of all statement lines where the source of the data was a CSV file upload in to Xero. This gives an indication on the certainty of correctness of the data.",
1545+
"description" : "Sum of the amounts of all statement lines where the source of the data was a file manually uploaded in to Xero. This gives an indication on the certainty of correctness of the data.",
15451546
"format" : "double",
15461547
"x-is-money" : true
15471548
},
15481549
"manual" : {
15491550
"type" : "number",
1550-
"description" : "Sum of the amounts of all statement lines where the source of the data was manually keyed in to Xero. This gives an indication on the certainty of correctness of the data.",
1551+
"description" : "Sum of the amounts of all statement lines where the source of the data was manually input in to Xero. This gives an indication on the certainty of correctness of the data.",
15511552
"format" : "double",
15521553
"x-is-money" : true
15531554
},
15541555
"directBankFeedPos" : {
15551556
"type" : "number",
1556-
"description" : "Sum of the amounts of all statement lines where the source of the data was a direct bank feed in to Xero. This gives an indication on the certainty of correctness of the data. Only positive transactions are included.",
1557+
"description" : "Sum of the amounts of all statement lines where the source of the data was a direct bank feed in to Xero via an API integration. This could be from a bank or aggregator. This gives an indication on the certainty of correctness of the data. Only positive transactions are included.",
15571558
"format" : "double",
15581559
"x-is-money" : true
15591560
},
15601561
"indirectBankFeedPos" : {
15611562
"type" : "number",
1562-
"description" : "Sum of the amounts of all statement lines where the source of the data was a indirect bank feed to Xero (usually via Yodlee). This gives an indication on the certainty of correctness of the data. Only positive transactions are included.",
1563+
"description" : "No longer in use.",
15631564
"format" : "double",
1565+
"deprecated" : true,
15641566
"x-is-money" : true
15651567
},
15661568
"fileUploadPos" : {
15671569
"type" : "number",
1568-
"description" : "Sum of the amounts of all statement lines where the source of the data was a CSV file upload in to Xero. This gives an indication on the certainty of correctness of the data. Only positive transactions are included.",
1570+
"description" : "Sum of the amounts of all statement lines where the source of the data was a file manually uploaded in to Xero. This gives an indication on the certainty of correctness of the data. Only positive transactions are included.",
15691571
"format" : "double",
15701572
"x-is-money" : true
15711573
},
15721574
"manualPos" : {
15731575
"type" : "number",
1574-
"description" : "Sum of the amounts of all statement lines where the source of the data was manually keyed in to Xero. This gives an indication on the certainty of correctness of the data. Only positive transactions are included.",
1576+
"description" : "Sum of the amounts of all statement lines where the source of the data was manually input in to Xero. This gives an indication on the certainty of correctness of the data. Only positive transactions are included.",
15751577
"format" : "double",
15761578
"x-is-money" : true
15771579
},
15781580
"directBankFeedNeg" : {
15791581
"type" : "number",
1580-
"description" : "Sum of the amounts of all statement lines where the source of the data was a direct bank feed in to Xero. This gives an indication on the certainty of correctness of the data. Only negative transactions are included.",
1582+
"description" : "Sum of the amounts of all statement lines where the source of the data was a direct bank feed in to Xero via an API integration. This could be from a bank or aggregator. This gives an indication on the certainty of correctness of the data. Only negative transactions are included.",
15811583
"format" : "double",
15821584
"x-is-money" : true
15831585
},
15841586
"indirectBankFeedNeg" : {
15851587
"type" : "number",
1586-
"description" : "Sum of the amounts of all statement lines where the source of the data was a indirect bank feed to Xero (usually via Yodlee). This gives an indication on the certainty of correctness of the data. Only negative transactions are included.",
1588+
"description" : "No longer in use.",
15871589
"format" : "double",
1590+
"deprecated" : true,
15881591
"x-is-money" : true
15891592
},
15901593
"fileUploadNeg" : {
15911594
"type" : "number",
1592-
"description" : "Sum of the amounts of all statement lines where the source of the data was a CSV file upload in to Xero. This gives an indication on the certainty of correctness of the data. Only negative transactions are included.",
1595+
"description" : "Sum of the amounts of all statement lines where the source of the data was a file manually uploaded in to Xero. This gives an indication on the certainty of correctness of the data. Only negative transactions are included.",
15931596
"format" : "double",
15941597
"x-is-money" : true
15951598
},
15961599
"manualNeg" : {
15971600
"type" : "number",
1598-
"description" : "Sum of the amounts of all statement lines where the source of the data was manually keyed in to Xero. This gives an indication on the certainty of correctness of the data. Only negative transactions are included.",
1601+
"description" : "Sum of the amounts of all statement lines where the source of the data was manually input in to Xero. This gives an indication on the certainty of correctness of the data. Only negative transactions are included.",
15991602
"format" : "double",
16001603
"x-is-money" : true
16011604
},
16021605
"otherPos" : {
16031606
"type" : "number",
1604-
"description" : "Sum of the amounts of all statement lines where the source of the data was any other category. This gives an indication on the certainty of correctness of the data. Only positive transactions are included.",
1607+
"description" : "Sum of the amounts of all statement lines where the source of the data was unknown. This gives an indication on the certainty of correctness of the data. Only positive transactions are included.",
16051608
"format" : "double",
16061609
"x-is-money" : true
16071610
},
16081611
"otherNeg" : {
16091612
"type" : "number",
1610-
"description" : "Sum of the amounts of all statement lines where the source of the data was any other category. This gives an indication on the certainty of correctness of the data. Only negative transactions are included.",
1613+
"description" : "Sum of the amounts of all statement lines where the source of the data was unknown. This gives an indication on the certainty of correctness of the data. Only negative transactions are included.",
16111614
"format" : "double",
16121615
"x-is-money" : true
16131616
},
16141617
"other" : {
16151618
"type" : "number",
1616-
"description" : "Sum of the amounts of all statement lines where the source of the data was any other category. This gives an indication on the certainty of correctness of the data.",
1619+
"description" : "Sum of the amounts of all statement lines where the source of the data was unknown. This gives an indication on the certainty of correctness of the data.",
16171620
"format" : "double",
16181621
"x-is-money" : true
16191622
}
@@ -2734,7 +2737,7 @@
27342737
<nav id="scrollingNav">
27352738
<ul class="sidenav nav nav-list">
27362739
<li class="nav-header" data-group="Finance"><strong>SDK: </strong><span id='sdk-name'></span></li>
2737-
<li class="nav-header" data-group="Finance"><strong>VSN: </strong>4.0.0</li>
2740+
<li class="nav-header" data-group="Finance"><strong>VSN: </strong>5.0.0</li>
27382741
<li class="nav-header" data-group="Finance"><a href="#api-Finance">Methods</a></li>
27392742
<li data-group="Finance" data-name="getAccountingActivityAccountUsage" class="">
27402743
<a href="#api-Finance-getAccountingActivityAccountUsage">getAccountingActivityAccountUsage</a>

docs/v1/payroll-au/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3412,7 +3412,7 @@
34123412
<nav id="scrollingNav">
34133413
<ul class="sidenav nav nav-list">
34143414
<li class="nav-header" data-group="PayrollAu"><strong>SDK: </strong><span id='sdk-name'></span></li>
3415-
<li class="nav-header" data-group="PayrollAu"><strong>VSN: </strong>4.0.0</li>
3415+
<li class="nav-header" data-group="PayrollAu"><strong>VSN: </strong>5.0.0</li>
34163416
<li class="nav-header" data-group="PayrollAu"><a href="#api-PayrollAu">Methods</a></li>
34173417
<li data-group="PayrollAu" data-name="approveLeaveApplication" class="">
34183418
<a href="#api-PayrollAu-approveLeaveApplication">approveLeaveApplication</a>

docs/v1/payroll-nz/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3843,7 +3843,7 @@
38433843
<nav id="scrollingNav">
38443844
<ul class="sidenav nav nav-list">
38453845
<li class="nav-header" data-group="PayrollNz"><strong>SDK: </strong><span id='sdk-name'></span></li>
3846-
<li class="nav-header" data-group="PayrollNz"><strong>VSN: </strong>4.0.0</li>
3846+
<li class="nav-header" data-group="PayrollNz"><strong>VSN: </strong>5.0.0</li>
38473847
<li class="nav-header" data-group="PayrollNz"><a href="#api-PayrollNz">Methods</a></li>
38483848
<li data-group="PayrollNz" data-name="approveTimesheet" class="">
38493849
<a href="#api-PayrollNz-approveTimesheet">approveTimesheet</a>

docs/v1/payroll-uk/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3510,7 +3510,7 @@
35103510
<nav id="scrollingNav">
35113511
<ul class="sidenav nav nav-list">
35123512
<li class="nav-header" data-group="PayrollUk"><strong>SDK: </strong><span id='sdk-name'></span></li>
3513-
<li class="nav-header" data-group="PayrollUk"><strong>VSN: </strong>4.0.0</li>
3513+
<li class="nav-header" data-group="PayrollUk"><strong>VSN: </strong>5.0.0</li>
35143514
<li class="nav-header" data-group="PayrollUk"><a href="#api-PayrollUk">Methods</a></li>
35153515
<li data-group="PayrollUk" data-name="approveTimesheet" class="">
35163516
<a href="#api-PayrollUk-approveTimesheet">approveTimesheet</a>

docs/v1/projects/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1462,7 +1462,7 @@
14621462
<nav id="scrollingNav">
14631463
<ul class="sidenav nav nav-list">
14641464
<li class="nav-header" data-group="Project"><strong>SDK: </strong><span id='sdk-name'></span></li>
1465-
<li class="nav-header" data-group="Project"><strong>VSN: </strong>4.0.0</li>
1465+
<li class="nav-header" data-group="Project"><strong>VSN: </strong>5.0.0</li>
14661466
<li class="nav-header" data-group="Project"><a href="#api-Project">Methods</a></li>
14671467
<li data-group="Project" data-name="createProject" class="">
14681468
<a href="#api-Project-createProject">createProject</a>

tests/accounting/api/test_accounting_api.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
LineItem,
3030
Attachments,
3131
Attachment,
32+
GetInvoicesResponse
3233
)
3334
from xero_python.api_client import ApiClient
3435
from xero_python.rest import RESTClientObject
@@ -94,11 +95,11 @@ def test_invoice_attachment_upload_and_download(
9495
"""
9596

9697
# 1. get first page of invoices
97-
invoices = accounting_api.get_invoices(xero_tenant_id, page=1)
98-
assert isinstance(invoices, Invoices)
99-
assert len(invoices.invoices)
98+
invoiceResponse = accounting_api.get_invoices(xero_tenant_id, page=1)
99+
assert isinstance(invoiceResponse, GetInvoicesResponse)
100+
assert len(invoiceResponse.invoices)
100101
# 2. choose first invoice
101-
invoice = invoices.invoices[0]
102+
invoice = invoiceResponse.invoices[0]
102103
assert isinstance(invoice, Invoice)
103104
# 3. upload test pdf file as invoice attachment
104105
include_online = True
@@ -341,7 +342,7 @@ def test_get_invoices(sandbox_accounting_api: AccountingApi, xero_tenant_id):
341342
# When getting all invoices
342343
result = sandbox_accounting_api.get_invoices(xero_tenant_id)
343344
# Then expect correct invoices received
344-
expected = Invoices(
345+
expected = GetInvoicesResponse(
345346
invoices=[
346347
Invoice(
347348
amount_credited=Decimal("0.00"),
@@ -473,7 +474,11 @@ def test_get_invoices(sandbox_accounting_api: AccountingApi, xero_tenant_id):
473474
2018, 11, 2, 16, 37, 28, 927000, tzinfo=tz.UTC
474475
),
475476
),
476-
]
477+
],
478+
provider_name = 'Provider Name Example',
479+
status = 'OK',
480+
date_time_utc = '/Date(1552326816230)/',
481+
id = '900c500b-e83c-4ce2-902a-b8ba04751748'
477482
)
478483
assert result == expected
479484

xero_python/accounting/__init__.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,27 @@
7676
from xero_python.accounting.models.expense_claim import ExpenseClaim
7777
from xero_python.accounting.models.expense_claims import ExpenseClaims
7878
from xero_python.accounting.models.external_link import ExternalLink
79+
from xero_python.accounting.models.get_bank_transactions_response import (
80+
GetBankTransactionsResponse,
81+
)
82+
from xero_python.accounting.models.get_contacts_response import GetContactsResponse
83+
from xero_python.accounting.models.get_credit_notes_response import (
84+
GetCreditNotesResponse,
85+
)
86+
from xero_python.accounting.models.get_invoices_response import GetInvoicesResponse
87+
from xero_python.accounting.models.get_manual_journals_response import (
88+
GetManualJournalsResponse,
89+
)
90+
from xero_python.accounting.models.get_overpayments_response import (
91+
GetOverpaymentsResponse,
92+
)
93+
from xero_python.accounting.models.get_payments_response import GetPaymentsResponse
94+
from xero_python.accounting.models.get_prepayments_response import (
95+
GetPrepaymentsResponse,
96+
)
97+
from xero_python.accounting.models.get_purchase_orders_response import (
98+
GetPurchaseOrdersResponse,
99+
)
79100
from xero_python.accounting.models.history_record import HistoryRecord
80101
from xero_python.accounting.models.history_records import HistoryRecords
81102
from xero_python.accounting.models.import_summary import ImportSummary
@@ -108,6 +129,7 @@
108129
from xero_python.accounting.models.organisations import Organisations
109130
from xero_python.accounting.models.overpayment import Overpayment
110131
from xero_python.accounting.models.overpayments import Overpayments
132+
from xero_python.accounting.models.page_info import PageInfo
111133
from xero_python.accounting.models.payment import Payment
112134
from xero_python.accounting.models.payment_delete import PaymentDelete
113135
from xero_python.accounting.models.payment_service import PaymentService

0 commit comments

Comments
 (0)