Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122,340 changes: 122,340 additions & 0 deletions docs/v1/accounting/index.html

Large diffs are not rendered by default.

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.5.0",
version="1.5.1",
)
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.5.0"
__version__ = "1.5.1"
2 changes: 1 addition & 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.10.1
OpenAPI spec version: 2.10.2
"""

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.10.1
OpenAPI spec version: 2.10.2
"""

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.10.1
- Package version: 1.5.0
- API version: 2.10.2
- Package version: 1.5.1
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
For more information, please visit [https://developer.xero.com](https://developer.xero.com)

Expand Down
1 change: 1 addition & 0 deletions xero_python/file/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from xero_python.file.models.folder import Folder
from xero_python.file.models.folders import Folders
from xero_python.file.models.inline_object import InlineObject
from xero_python.file.models.inline_object1 import InlineObject1
from xero_python.file.models.object_group import ObjectGroup
from xero_python.file.models.object_type import ObjectType
from xero_python.file.models.user import User
104 changes: 97 additions & 7 deletions 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.10.1
OpenAPI spec version: 2.10.2
"""

import importlib
Expand Down Expand Up @@ -1231,7 +1231,6 @@ def update_folder(
def upload_file(
self,
xero_tenant_id,
folder_id=empty,
body=empty,
name=empty,
filename=empty,
Expand All @@ -1240,10 +1239,9 @@ def upload_file(
_preload_content=True,
_request_timeout=None,
):
"""Uploads a File # noqa: E501
"""Uploads a File to the inbox # noqa: E501
OAuth2 scope: files
:param str xero_tenant_id: Xero identifier for Tenant (required)
:param str folder_id: pass an optional folder id to save file to specific folder
:param str body:
:param str name: exact name of the file you are uploading
:param str filename:
Expand All @@ -1266,9 +1264,6 @@ def upload_file(

query_params = []

if folder_id is not empty:
query_params.append(("FolderId", folder_id))

header_params = {
"xero-tenant-id": xero_tenant_id,
}
Expand Down Expand Up @@ -1317,3 +1312,98 @@ def upload_file(
)
except exceptions.HTTPStatusException as error:
raise translate_status_exception(error, self, "upload_file")

def upload_file_to_folder(
self,
xero_tenant_id,
folder_id,
body=empty,
name=empty,
filename=empty,
mime_type=empty,
_return_http_data_only=True,
_preload_content=True,
_request_timeout=None,
):
"""Uploads a File to a specific folder # noqa: E501
OAuth2 scope: files
:param str xero_tenant_id: Xero identifier for Tenant (required)
:param str folder_id: pass required folder id to save file to specific folder (required)
:param str body:
:param str name: exact name of the file you are uploading
:param str filename:
:param str mime_type:
: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: FileObject
"""

# 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 `upload_file_to_folder`"
)
# verify the required parameter 'folder_id' is set
if folder_id is None:
raise ValueError(
"Missing the required parameter `folder_id` "
"when calling `upload_file_to_folder`"
)

collection_formats = {}
path_params = {
"FolderId": folder_id,
}

query_params = []

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

local_var_files = {}
form_params = [
("body", body),
("name", name),
("filename", filename),
("mimeType", mime_type),
]

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

# HTTP header `Content-Type`
header_params["Content-Type"] = self.api_client.select_header_content_type(
["multipart/form-data"]
)

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

try:
return self.api_client.call_api(
url,
"POST",
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type="FileObject",
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, "upload_file_to_folder")
84 changes: 77 additions & 7 deletions xero_python/file/docs/FilesApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ Method | HTTP request | Description
[**get_inbox**](FilesApi.md#get_inbox) | **GET** /Inbox | Retrieves inbox folder
[**update_file**](FilesApi.md#update_file) | **PUT** /Files/{FileId} | Update a file
[**update_folder**](FilesApi.md#update_folder) | **PUT** /Folders/{FolderId} | Updates an existing folder
[**upload_file**](FilesApi.md#upload_file) | **POST** /Files | Uploads a File
[**upload_file**](FilesApi.md#upload_file) | **POST** /Files | Uploads a File to the inbox
[**upload_file_to_folder**](FilesApi.md#upload_file_to_folder) | **POST** /Folders/{FolderId} | Uploads a File to a specific folder


# **create_file_association**
Expand Down Expand Up @@ -1001,9 +1002,9 @@ 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)

# **upload_file**
> FileObject upload_file(xero_tenant_id, folder_id=folder_id, body=body, name=name, filename=filename, mime_type=mime_type)
> FileObject upload_file(xero_tenant_id, body=body, name=name, filename=filename, mime_type=mime_type)

Uploads a File
Uploads a File to the inbox

### Example

Expand Down Expand Up @@ -1032,14 +1033,13 @@ api_client = ApiClient(
api_instance = FilesApi(api_client)

xero_tenant_id = 'YOUR_XERO_TENANT_ID' # str | Xero identifier for Tenant
folder_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # str | pass an optional folder id to save file to specific folder (optional)
body = 'body_example' # str | (optional)
name = 'name_example' # str | exact name of the file you are uploading (optional)
filename = 'filename_example' # str | (optional)
mime_type = 'mime_type_example' # str | (optional)
try:
# Uploads a File
api_response = api_instance.upload_file(xero_tenant_id, folder_id=folder_id, body=body, name=name, filename=filename, mime_type=mime_type)
# Uploads a File to the inbox
api_response = api_instance.upload_file(xero_tenant_id, body=body, name=name, filename=filename, mime_type=mime_type)
pprint(api_response)
except ApiException as e:
print("Exception when calling FilesApi->upload_file: %s\n" % e)
Expand All @@ -1050,7 +1050,77 @@ except ApiException as e:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**xero_tenant_id** | **str**| Xero identifier for Tenant |
**folder_id** | [**str**](.md)| pass an optional folder id to save file to specific folder | [optional]
**body** | **str**| | [optional]
**name** | **str**| exact name of the file you are uploading | [optional]
**filename** | **str**| | [optional]
**mime_type** | **str**| | [optional]

### Return type

[**FileObject**](FileObject.md)

### Authorization

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

### HTTP request headers

- **Content-Type**: multipart/form-data
- **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)

# **upload_file_to_folder**
> FileObject upload_file_to_folder(xero_tenant_id, folder_id, body=body, name=name, filename=filename, mime_type=mime_type)

Uploads a File to a specific folder

### 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.file import FilesApi
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 = FilesApi(api_client)

xero_tenant_id = 'YOUR_XERO_TENANT_ID' # str | Xero identifier for Tenant
folder_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # str | pass required folder id to save file to specific folder
body = 'body_example' # str | (optional)
name = 'name_example' # str | exact name of the file you are uploading (optional)
filename = 'filename_example' # str | (optional)
mime_type = 'mime_type_example' # str | (optional)
try:
# Uploads a File to a specific folder
api_response = api_instance.upload_file_to_folder(xero_tenant_id, folder_id, body=body, name=name, filename=filename, mime_type=mime_type)
pprint(api_response)
except ApiException as e:
print("Exception when calling FilesApi->upload_file_to_folder: %s\n" % e)
```

### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**xero_tenant_id** | **str**| Xero identifier for Tenant |
**folder_id** | [**str**](.md)| pass required folder id to save file to specific folder |
**body** | **str**| | [optional]
**name** | **str**| exact name of the file you are uploading | [optional]
**filename** | **str**| | [optional]
Expand Down
13 changes: 13 additions & 0 deletions xero_python/file/docs/InlineObject1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# InlineObject1

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**body** | **str** | | [optional]
**name** | **str** | exact name of the file you are uploading | [optional]
**filename** | **str** | | [optional]
**mime_type** | **str** | | [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)


1 change: 1 addition & 0 deletions xero_python/file/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from xero_python.file.models.folder import Folder
from xero_python.file.models.folders import Folders
from xero_python.file.models.inline_object import InlineObject
from xero_python.file.models.inline_object1 import InlineObject1
from xero_python.file.models.object_group import ObjectGroup
from xero_python.file.models.object_type import ObjectType
from xero_python.file.models.user import User
Loading