Skip to content

Commit

Permalink
Merge pull request #90 from XeroAPI/xero-python-1.15.0
Browse files Browse the repository at this point in the history
generates xero-python-1.15.0 from OAS 2.22.0
  • Loading branch information
RettBehrens authored May 10, 2022
2 parents 8b2cffd + 3f79a1a commit 36c9132
Show file tree
Hide file tree
Showing 28 changed files with 241 additions and 26 deletions.
2 changes: 1 addition & 1 deletion docs/v1/accounting/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6008,7 +6008,7 @@
<nav id="scrollingNav">
<ul class="sidenav nav nav-list">
<li class="nav-header" data-group="Accounting"><strong>SDK: </strong><span id='sdk-name'></span></li>
<li class="nav-header" data-group="Accounting"><strong>VSN: </strong>1.14.0</li>
<li class="nav-header" data-group="Accounting"><strong>VSN: </strong>1.15.0</li>
<li class="nav-header" data-group="Accounting"><a href="#api-Accounting">Methods</a></li>
<li data-group="Accounting" data-name="createAccount" class="">
<a href="#api-Accounting-createAccount">createAccount</a>
Expand Down
2 changes: 1 addition & 1 deletion docs/v1/appstore/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1133,7 +1133,7 @@
<nav id="scrollingNav">
<ul class="sidenav nav nav-list">
<li class="nav-header" data-group="AppStore"><strong>SDK: </strong><span id='sdk-name'></span></li>
<li class="nav-header" data-group="AppStore"><strong>VSN: </strong>1.14.0</li>
<li class="nav-header" data-group="AppStore"><strong>VSN: </strong>1.15.0</li>
<li class="nav-header" data-group="AppStore"><a href="#api-AppStore">Methods</a></li>
<li data-group="AppStore" data-name="getSubscription" class="">
<a href="#api-AppStore-getSubscription">getSubscription</a>
Expand Down
2 changes: 1 addition & 1 deletion docs/v1/assets/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1392,7 +1392,7 @@
<nav id="scrollingNav">
<ul class="sidenav nav nav-list">
<li class="nav-header" data-group="Asset"><strong>SDK: </strong><span id='sdk-name'></span></li>
<li class="nav-header" data-group="Asset"><strong>VSN: </strong>1.14.0</li>
<li class="nav-header" data-group="Asset"><strong>VSN: </strong>1.15.0</li>
<li class="nav-header" data-group="Asset"><a href="#api-Asset">Methods</a></li>
<li data-group="Asset" data-name="createAsset" class="">
<a href="#api-Asset-createAsset">createAsset</a>
Expand Down
2 changes: 1 addition & 1 deletion docs/v1/files/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1155,7 +1155,7 @@
<nav id="scrollingNav">
<ul class="sidenav nav nav-list">
<li class="nav-header" data-group="Files"><strong>SDK: </strong><span id='sdk-name'></span></li>
<li class="nav-header" data-group="Files"><strong>VSN: </strong>1.14.0</li>
<li class="nav-header" data-group="Files"><strong>VSN: </strong>1.15.0</li>
<li class="nav-header" data-group="Files"><a href="#api-Files">Methods</a></li>
<li data-group="Files" data-name="createFileAssociation" class="">
<a href="#api-Files-createFileAssociation">createFileAssociation</a>
Expand Down
2 changes: 1 addition & 1 deletion docs/v1/finance/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2706,7 +2706,7 @@
<nav id="scrollingNav">
<ul class="sidenav nav nav-list">
<li class="nav-header" data-group="Finance"><strong>SDK: </strong><span id='sdk-name'></span></li>
<li class="nav-header" data-group="Finance"><strong>VSN: </strong>1.14.0</li>
<li class="nav-header" data-group="Finance"><strong>VSN: </strong>1.15.0</li>
<li class="nav-header" data-group="Finance"><a href="#api-Finance">Methods</a></li>
<li data-group="Finance" data-name="getAccountingActivityAccountUsage" class="">
<a href="#api-Finance-getAccountingActivityAccountUsage">getAccountingActivityAccountUsage</a>
Expand Down
2 changes: 1 addition & 1 deletion docs/v1/payroll-au/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3254,7 +3254,7 @@
<nav id="scrollingNav">
<ul class="sidenav nav nav-list">
<li class="nav-header" data-group="PayrollAu"><strong>SDK: </strong><span id='sdk-name'></span></li>
<li class="nav-header" data-group="PayrollAu"><strong>VSN: </strong>1.14.0</li>
<li class="nav-header" data-group="PayrollAu"><strong>VSN: </strong>1.15.0</li>
<li class="nav-header" data-group="PayrollAu"><a href="#api-PayrollAu">Methods</a></li>
<li data-group="PayrollAu" data-name="createEmployee" class="">
<a href="#api-PayrollAu-createEmployee">createEmployee</a>
Expand Down
2 changes: 1 addition & 1 deletion docs/v1/payroll-nz/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3838,7 +3838,7 @@
<nav id="scrollingNav">
<ul class="sidenav nav nav-list">
<li class="nav-header" data-group="PayrollNz"><strong>SDK: </strong><span id='sdk-name'></span></li>
<li class="nav-header" data-group="PayrollNz"><strong>VSN: </strong>1.14.0</li>
<li class="nav-header" data-group="PayrollNz"><strong>VSN: </strong>1.15.0</li>
<li class="nav-header" data-group="PayrollNz"><a href="#api-PayrollNz">Methods</a></li>
<li data-group="PayrollNz" data-name="approveTimesheet" class="">
<a href="#api-PayrollNz-approveTimesheet">approveTimesheet</a>
Expand Down
2 changes: 1 addition & 1 deletion docs/v1/payroll-uk/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3510,7 +3510,7 @@
<nav id="scrollingNav">
<ul class="sidenav nav nav-list">
<li class="nav-header" data-group="PayrollUk"><strong>SDK: </strong><span id='sdk-name'></span></li>
<li class="nav-header" data-group="PayrollUk"><strong>VSN: </strong>1.14.0</li>
<li class="nav-header" data-group="PayrollUk"><strong>VSN: </strong>1.15.0</li>
<li class="nav-header" data-group="PayrollUk"><a href="#api-PayrollUk">Methods</a></li>
<li data-group="PayrollUk" data-name="approveTimesheet" class="">
<a href="#api-PayrollUk-approveTimesheet">approveTimesheet</a>
Expand Down
2 changes: 1 addition & 1 deletion docs/v1/projects/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1468,7 +1468,7 @@
<nav id="scrollingNav">
<ul class="sidenav nav nav-list">
<li class="nav-header" data-group="Project"><strong>SDK: </strong><span id='sdk-name'></span></li>
<li class="nav-header" data-group="Project"><strong>VSN: </strong>1.14.0</li>
<li class="nav-header" data-group="Project"><strong>VSN: </strong>1.15.0</li>
<li class="nav-header" data-group="Project"><a href="#api-Project">Methods</a></li>
<li data-group="Project" data-name="createProject" class="">
<a href="#api-Project-createProject">createProject</a>
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@ def read_file(filename):
keywords="xero python sdk API oAuth",
name="xero_python",
packages=find_packages(include=["xero_python", "xero_python.*"]),
version="1.14.0",
version="1.15.0",
)
2 changes: 1 addition & 1 deletion xero_python/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

__author__ = """Xero Developer API"""
__email__ = "api@xero.com"
__version__ = "1.14.0"
__version__ = "1.15.0"
78 changes: 77 additions & 1 deletion xero_python/accounting/api/accounting_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"""

"""
OpenAPI spec version: 2.21.0
OpenAPI spec version: 2.22.4
"""

import importlib
Expand Down Expand Up @@ -10636,6 +10636,82 @@ def get_journal(
except exceptions.HTTPStatusException as error:
raise translate_status_exception(error, self, "get_journal")

def get_journal_by_number(
self,
xero_tenant_id,
journal_number,
_return_http_data_only=True,
_preload_content=True,
_request_timeout=None,
):
"""Retrieves a specific journal using a unique journal number. # noqa: E501
OAuth2 scope: accounting.journals.read
:param str xero_tenant_id: Xero identifier for Tenant (required)
:param int journal_number: Number of a Journal (required)
:param bool _return_http_data_only: return received data only
:param bool _preload_content: load received data in models
:param bool _request_timeout: maximum wait time for response
:return: Journals
"""

# verify the required parameter 'xero_tenant_id' is set
if xero_tenant_id is None:
raise ValueError(
"Missing the required parameter `xero_tenant_id` "
"when calling `get_journal_by_number`"
)
# verify the required parameter 'journal_number' is set
if journal_number is None:
raise ValueError(
"Missing the required parameter `journal_number` "
"when calling `get_journal_by_number`"
)

collection_formats = {}
path_params = {
"JournalNumber": journal_number,
}

query_params = []

header_params = {
"xero-tenant-id": xero_tenant_id,
}

local_var_files = {}
form_params = []

body_params = None
# HTTP header `Accept`
header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
)

# Authentication setting
auth_settings = ["OAuth2"]
url = self.get_resource_url("/Journals/{JournalNumber}")

try:
return self.api_client.call_api(
url,
"GET",
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type="Journals",
response_model_finder=self.get_model_finder(),
auth_settings=auth_settings,
_return_http_data_only=_return_http_data_only,
_preload_content=_preload_content,
_request_timeout=_request_timeout,
collection_formats=collection_formats,
)
except exceptions.HTTPStatusException as error:
raise translate_status_exception(error, self, "get_journal_by_number")

def get_journals(
self,
xero_tenant_id,
Expand Down
64 changes: 64 additions & 0 deletions xero_python/accounting/docs/AccountingApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ Method | HTTP request | Description
[**get_item_history**](AccountingApi.md#get_item_history) | **GET** /Items/{ItemID}/History | Retrieves history for a specific item
[**get_items**](AccountingApi.md#get_items) | **GET** /Items | Retrieves items
[**get_journal**](AccountingApi.md#get_journal) | **GET** /Journals/{JournalID} | Retrieves a specific journal using a unique journal Id.
[**get_journal_by_number**](AccountingApi.md#get_journal_by_number) | **GET** /Journals/{JournalNumber} | Retrieves a specific journal using a unique journal number.
[**get_journals**](AccountingApi.md#get_journals) | **GET** /Journals | Retrieves journals
[**get_linked_transaction**](AccountingApi.md#get_linked_transaction) | **GET** /LinkedTransactions/{LinkedTransactionID} | Retrieves a specific linked transaction (billable expenses) using a unique linked transaction Id
[**get_linked_transactions**](AccountingApi.md#get_linked_transactions) | **GET** /LinkedTransactions | Retrieves linked transactions (billable expenses)
Expand Down Expand Up @@ -8254,6 +8255,69 @@ Name | Type | Description | Notes

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

# **get_journal_by_number**
> Journals get_journal_by_number(xero_tenant_id, journal_number)

Retrieves a specific journal using a unique journal number.

### Example

* OAuth Authentication (OAuth2):
```python
from xero_python.api_client import Configuration, ApiClient
from xero_python.api_client.oauth2 import OAuth2Token
from xero_python.exceptions import ApiException
from xero_python.accounting import AccountingApi
from pprint import pprint

# Configure OAuth2 access token for authorization: OAuth2
# simplified version, `xero_oauth2_token` represents permanent global token storage
xero_oauth2_token = {} # set to valid xero oauth2 token dictionary
# create client configuration with client id and client secret for automatic token refresh
api_config = Configuration(oauth2_token=OAuth2Token(
client_id="YOUR_API_CLIENT_ID", client_secret="YOUR_API_CLIENT_SECRET"
))
# configure xero-python sdk client
api_client = ApiClient(
api_config,
oauth2_token_saver=lambda x: xero_oauth2_token.update(x),
oauth2_token_getter=lambda : xero_oauth2_token
)
# create an instance of the API class
api_instance = AccountingApi(api_client)

xero_tenant_id = 'YOUR_XERO_TENANT_ID' # str | Xero identifier for Tenant
journal_number = 1000 # int | Number of a Journal
try:
# Retrieves a specific journal using a unique journal number.
api_response = api_instance.get_journal_by_number(xero_tenant_id, journal_number)
pprint(api_response)
except ApiException as e:
print("Exception when calling AccountingApi->get_journal_by_number: %s\n" % e)
```

### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**xero_tenant_id** | **str**| Xero identifier for Tenant |
**journal_number** | **int**| Number of a Journal |

### Return type

[**Journals**](Journals.md)

### Authorization

[OAuth2](../README.md#OAuth2)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

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

# **get_journals**
> Journals get_journals(xero_tenant_id, if_modified_since=if_modified_since, offset=offset, payments_only=payments_only)

Expand Down
1 change: 1 addition & 0 deletions xero_python/accounting/models/organisation.py
Original file line number Diff line number Diff line change
Expand Up @@ -979,6 +979,7 @@ def _class(self, _class):
"LEDGER",
"GST_CASHBOOK",
"NON_GST_CASHBOOK",
"ULTIMATE",
"None",
] # noqa: E501

Expand Down
7 changes: 7 additions & 0 deletions xero_python/accounting/models/tax_rate.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,13 @@ def report_tax_type(self, report_tax_type):
"ZRINPUT",
"BADDEBT",
"OTHERINPUT",
"BADDEBTRELIEF",
"IGDSINPUT3",
"SROVR",
"TOURISTREFUND",
"TXRCN33INPUT",
"TXRCREINPUT",
"TXRCESSINPUT",
"None",
] # noqa: E501

Expand Down
7 changes: 7 additions & 0 deletions xero_python/accounting/models/tax_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,10 @@ class TaxType(Enum):
DRCHARGE20 = "DRCHARGE20"
DRCHARGESUPPLY5 = "DRCHARGESUPPLY5"
DRCHARGE5 = "DRCHARGE5"
BADDEBTRELIEF = "BADDEBTRELIEF"
IGDSINPUT3 = "IGDSINPUT3"
SROVR = "SROVR"
TOURISTREFUND = "TOURISTREFUND"
TXRCN33INPUT = "TXRCN33INPUT"
TXRCREINPUT = "TXRCREINPUT"
TXRCESSINPUT = "TXRCESSINPUT"
2 changes: 1 addition & 1 deletion xero_python/appstore/api/app_store_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"""

"""
OpenAPI spec version: 2.21.0
OpenAPI spec version: 2.22.4
"""

import importlib
Expand Down
2 changes: 1 addition & 1 deletion xero_python/assets/api/asset_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"""

"""
OpenAPI spec version: 2.21.0
OpenAPI spec version: 2.22.4
"""

import importlib
Expand Down
4 changes: 2 additions & 2 deletions xero_python/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ These endpoints are related to managing authentication tokens and identity for X

The `xero_python` package is automatically generated by the [XeroAPI SDK 2.0 Codegen](https://github.com/xero-github/xeroapi-sdk-codegen) project:

- API version: 2.21.0
- Package version: 1.14.0
- API version: 2.22.4
- Package version: 1.15.0
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
For more information, please visit [https://developer.xero.com](https://developer.xero.com)

Expand Down
2 changes: 1 addition & 1 deletion xero_python/file/api/files_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"""

"""
OpenAPI spec version: 2.21.0
OpenAPI spec version: 2.22.4
"""

import importlib
Expand Down
2 changes: 1 addition & 1 deletion xero_python/finance/api/finance_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"""

"""
OpenAPI spec version: 2.21.0
OpenAPI spec version: 2.22.4
"""

import importlib
Expand Down
4 changes: 3 additions & 1 deletion xero_python/finance/docs/StatementResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ Name | Type | Description | Notes
**start_date** | **date** | Start date of statement | [optional]
**end_date** | **date** | End date of statement | [optional]
**imported_date_time_utc** | **datetime** | Utc date time of when the statement was imported in Xero | [optional]
**import_source** | **str** | Import source of statement (STMTIMPORTSRC/MANUAL, STMTIMPORTSRC/CSV, STMTIMPORTSRC/QIF, STMTIMPORTSRC/OFX, XeroApi) | [optional]
**import_source** | **str** | Indicates the source of the statement data. Either imported from 1) direct bank feed OR 2) manual customer entry or upload. Manual import sources are STMTIMPORTSRC/MANUAL, STMTIMPORTSRC/CSV, STMTIMPORTSRC/OFX, Ofx or STMTIMPORTSRC/QIF. All other import sources are direct and, depending on the direct solution, may contain the name of the financial institution. | [optional]
**start_balance** | **float** | Opening balance sourced from imported bank statements (if supplied). Note, for manually uploaded statements, this balance is also manual and usually not supplied. | [optional]
**end_balance** | **float** | Closing balance sourced from imported bank statements (if supplied). Note, for manually uploaded statements, this balance is also manual and usually not supplied. | [optional]
**statement_lines** | [**list[StatementLineResponse]**](StatementLineResponse.md) | List of statement lines | [optional]

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

0 comments on commit 36c9132

Please sign in to comment.