Skip to content

Commit e8416f3

Browse files
authored
Merge pull request #29 from XeroAPI/sid-development
Build of OAS 2.4.0
2 parents 89558c0 + afb0203 commit e8416f3

File tree

346 files changed

+1129
-484
lines changed

Some content is hidden

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

346 files changed

+1129
-484
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,5 @@ def read_file(filename):
4848
keywords="xero python sdk API oAuth",
4949
name="xero_python",
5050
packages=find_packages(include=["xero_python", "xero_python.*"]),
51-
version="1.0.12",
51+
version="1.0.13",
5252
)

tests/conftest.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,23 @@ def oauth2_token(
127127
"token_type": "Bearer",
128128
}
129129

130+
@pytest.fixture()
131+
def oauth2_token_without_id_token(
132+
xero_access_token,
133+
xero_refresh_token,
134+
xero_scope,
135+
xero_expires_in,
136+
xero_expires_at,
137+
):
138+
return {
139+
"access_token": xero_access_token,
140+
"expires_at": xero_expires_at,
141+
"expires_in": xero_expires_in,
142+
"refresh_token": xero_refresh_token,
143+
"scope": xero_scope,
144+
"token_type": "Bearer",
145+
}
146+
130147

131148
@pytest.fixture()
132149
def oauth2_refresh_token(oauth2_token, xero_refresh_token):

tests/test_api_client/test_oauth2.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,22 @@ def test_auth2_call_refresh_token_api(oauth2_refresh_token):
205205
assert call_kwargs == {}
206206
assert new_token is token
207207

208+
def test_auth2_call_refresh_token_api_without_id_token(oauth2_token_without_id_token):
209+
# Given valid refresh token and client credentials without using OpenID scope (id_token absent)
210+
oauth2_token = OAuth2Token()
211+
oauth2_token.update_token(**oauth2_token_without_id_token)
212+
token = {}
213+
token_api = FakeClass()
214+
token_api.refresh_token = FakeMethod(return_value=token)
215+
# When refresh token API endpoint called
216+
new_token = oauth2_token.call_refresh_token_api(token_api)
217+
# Then new oauth2 token received
218+
assert len(token_api.refresh_token.calls) == 1
219+
call_args, call_kwargs = token_api.refresh_token.calls[0]
220+
assert call_args == (oauth2_token.refresh_token, oauth2_token.scope)
221+
assert call_kwargs == {}
222+
assert new_token is token
223+
208224

209225
def test_token_api_refresh_token(
210226
xero_client_id, xero_client_secret, xero_scope, vcr, vcr_cassette_name

xero_python/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
__author__ = """Xero Developer API"""
44
__email__ = "[email protected]"
5-
__version__ = "1.0.12"
5+
__version__ = "1.0.13"

xero_python/accounting/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
88
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
99
10-
OpenAPI spec version: 2.3.4
10+
OpenAPI spec version: 2.4.0
1111
1212
Generated by: https://openapi-generator.tech
1313
"""
@@ -23,6 +23,8 @@
2323
from xero_python.accounting.models.accounts import Accounts
2424
from xero_python.accounting.models.accounts_payable import AccountsPayable
2525
from xero_python.accounting.models.accounts_receivable import AccountsReceivable
26+
from xero_python.accounting.models.action import Action
27+
from xero_python.accounting.models.actions import Actions
2628
from xero_python.accounting.models.address import Address
2729
from xero_python.accounting.models.allocation import Allocation
2830
from xero_python.accounting.models.allocations import Allocations

xero_python/accounting/api/accounting_api.py

Lines changed: 257 additions & 24 deletions
Large diffs are not rendered by default.

xero_python/accounting/docs/AccountingApi.md

Lines changed: 303 additions & 111 deletions
Large diffs are not rendered by default.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Action
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**name** | **str** | Name of the actions for this organisation | [optional]
7+
**status** | **str** | Status of the action for this organisation | [optional]
8+
9+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
10+
11+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Actions
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**actions** | [**list[Action]**](Action.md) | | [optional]
7+
8+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
9+
10+

xero_python/accounting/docs/ExpenseClaim.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Name | Type | Description | Notes
1414
**amount_paid** | **float** | The amount still to pay for an expense claim | [optional]
1515
**payment_due_date** | **date** | The date when the expense claim is due to be paid YYYY-MM-DD | [optional]
1616
**reporting_date** | **date** | The date the expense claim will be reported in Xero YYYY-MM-DD | [optional]
17-
**receipt_id** | **str** | The Xero identifier for the Receipt e.g. e59a2c7f-1306-4078-a0f3-73537afcbba9 | [optional]
17+
**receipt_id** | **str** | The Xero identifier for the Receipt e.g. e59a2c7f-1306-4078-a0f3-73537afcbba9 | [optional]
1818

1919
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
2020

0 commit comments

Comments
 (0)