diff --git a/docs/v1/accounting/index.html b/docs/v1/accounting/index.html index d7cc2258..a24179de 100644 --- a/docs/v1/accounting/index.html +++ b/docs/v1/accounting/index.html @@ -6008,7 +6008,7 @@ SDK: - VSN: 1.15.0 + VSN: 1.16.0 Methods createAccount diff --git a/docs/v1/appstore/index.html b/docs/v1/appstore/index.html index 14007487..15d3e23a 100644 --- a/docs/v1/appstore/index.html +++ b/docs/v1/appstore/index.html @@ -1133,7 +1133,7 @@ SDK: - VSN: 1.15.0 + VSN: 1.16.0 Methods getSubscription diff --git a/docs/v1/assets/index.html b/docs/v1/assets/index.html index b02b7bd8..2c775874 100644 --- a/docs/v1/assets/index.html +++ b/docs/v1/assets/index.html @@ -1392,7 +1392,7 @@ SDK: - VSN: 1.15.0 + VSN: 1.16.0 Methods createAsset diff --git a/docs/v1/files/index.html b/docs/v1/files/index.html index e506614c..3e40de64 100644 --- a/docs/v1/files/index.html +++ b/docs/v1/files/index.html @@ -1155,7 +1155,7 @@ SDK: - VSN: 1.15.0 + VSN: 1.16.0 Methods createFileAssociation diff --git a/docs/v1/finance/index.html b/docs/v1/finance/index.html index a9f34474..4016c1dd 100644 --- a/docs/v1/finance/index.html +++ b/docs/v1/finance/index.html @@ -2706,7 +2706,7 @@ SDK: - VSN: 1.15.0 + VSN: 1.16.0 Methods getAccountingActivityAccountUsage diff --git a/docs/v1/payroll-au/index.html b/docs/v1/payroll-au/index.html index 2480bdc6..a41dbc4c 100644 --- a/docs/v1/payroll-au/index.html +++ b/docs/v1/payroll-au/index.html @@ -3254,7 +3254,7 @@ SDK: - VSN: 1.15.0 + VSN: 1.16.0 Methods createEmployee diff --git a/docs/v1/payroll-nz/index.html b/docs/v1/payroll-nz/index.html index 88c42a71..784bf299 100644 --- a/docs/v1/payroll-nz/index.html +++ b/docs/v1/payroll-nz/index.html @@ -3838,7 +3838,7 @@ SDK: - VSN: 1.15.0 + VSN: 1.16.0 Methods approveTimesheet diff --git a/docs/v1/payroll-uk/index.html b/docs/v1/payroll-uk/index.html index 302cb8bf..54cdb923 100644 --- a/docs/v1/payroll-uk/index.html +++ b/docs/v1/payroll-uk/index.html @@ -3510,7 +3510,7 @@ SDK: - VSN: 1.15.0 + VSN: 1.16.0 Methods approveTimesheet diff --git a/docs/v1/projects/index.html b/docs/v1/projects/index.html index 92b57cc8..825ea530 100644 --- a/docs/v1/projects/index.html +++ b/docs/v1/projects/index.html @@ -1468,7 +1468,7 @@ SDK: - VSN: 1.15.0 + VSN: 1.16.0 Methods createProject diff --git a/setup.py b/setup.py index 29cc3d15..46b7a2cb 100644 --- a/setup.py +++ b/setup.py @@ -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.15.0", + version="1.16.0", ) diff --git a/xero_python/__init__.py b/xero_python/__init__.py index 961bb771..efacb5cc 100644 --- a/xero_python/__init__.py +++ b/xero_python/__init__.py @@ -2,4 +2,4 @@ __author__ = """Xero Developer API""" __email__ = "api@xero.com" -__version__ = "1.15.0" +__version__ = "1.16.0" diff --git a/xero_python/accounting/api/accounting_api.py b/xero_python/accounting/api/accounting_api.py index fbdeedbf..3d206b89 100644 --- a/xero_python/accounting/api/accounting_api.py +++ b/xero_python/accounting/api/accounting_api.py @@ -10,7 +10,7 @@ """ """ - OpenAPI spec version: 2.22.4 + OpenAPI spec version: 2.23.0 """ import importlib diff --git a/xero_python/accounting/models/tax_rate.py b/xero_python/accounting/models/tax_rate.py index e8b4539b..81da7197 100644 --- a/xero_python/accounting/models/tax_rate.py +++ b/xero_python/accounting/models/tax_rate.py @@ -324,6 +324,7 @@ def report_tax_type(self, report_tax_type): "TXRCN33INPUT", "TXRCREINPUT", "TXRCESSINPUT", + "TXRCTSINPUT", "None", ] # noqa: E501 diff --git a/xero_python/accounting/models/tax_type.py b/xero_python/accounting/models/tax_type.py index 26bbb492..ce5340f4 100644 --- a/xero_python/accounting/models/tax_type.py +++ b/xero_python/accounting/models/tax_type.py @@ -90,3 +90,4 @@ class TaxType(Enum): TXRCN33INPUT = "TXRCN33INPUT" TXRCREINPUT = "TXRCREINPUT" TXRCESSINPUT = "TXRCESSINPUT" + TXRCTSINPUT = "TXRCTSINPUT" diff --git a/xero_python/appstore/api/app_store_api.py b/xero_python/appstore/api/app_store_api.py index bb92f458..700edf32 100644 --- a/xero_python/appstore/api/app_store_api.py +++ b/xero_python/appstore/api/app_store_api.py @@ -10,7 +10,7 @@ """ """ - OpenAPI spec version: 2.22.4 + OpenAPI spec version: 2.23.0 """ import importlib diff --git a/xero_python/assets/api/asset_api.py b/xero_python/assets/api/asset_api.py index 7b02bea3..732f57bb 100644 --- a/xero_python/assets/api/asset_api.py +++ b/xero_python/assets/api/asset_api.py @@ -10,7 +10,7 @@ """ """ - OpenAPI spec version: 2.22.4 + OpenAPI spec version: 2.23.0 """ import importlib diff --git a/xero_python/docs/README.md b/xero_python/docs/README.md index 8761f6a1..a61b0ee9 100644 --- a/xero_python/docs/README.md +++ b/xero_python/docs/README.md @@ -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.22.4 -- Package version: 1.15.0 +- API version: 2.23.0 +- Package version: 1.16.0 - Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit [https://developer.xero.com](https://developer.xero.com) diff --git a/xero_python/file/api/files_api.py b/xero_python/file/api/files_api.py index 4489d58f..9b786119 100644 --- a/xero_python/file/api/files_api.py +++ b/xero_python/file/api/files_api.py @@ -10,7 +10,7 @@ """ """ - OpenAPI spec version: 2.22.4 + OpenAPI spec version: 2.23.0 """ import importlib diff --git a/xero_python/finance/api/finance_api.py b/xero_python/finance/api/finance_api.py index 19b275fe..01e1739f 100644 --- a/xero_python/finance/api/finance_api.py +++ b/xero_python/finance/api/finance_api.py @@ -10,7 +10,7 @@ """ """ - OpenAPI spec version: 2.22.4 + OpenAPI spec version: 2.23.0 """ import importlib diff --git a/xero_python/identity/api/identity_api.py b/xero_python/identity/api/identity_api.py index 2d5f758b..3761117d 100644 --- a/xero_python/identity/api/identity_api.py +++ b/xero_python/identity/api/identity_api.py @@ -10,7 +10,7 @@ """ """ - OpenAPI spec version: 2.22.4 + OpenAPI spec version: 2.23.0 """ import importlib diff --git a/xero_python/payrollau/api/payroll_au_api.py b/xero_python/payrollau/api/payroll_au_api.py index 74a529c3..7ccda312 100644 --- a/xero_python/payrollau/api/payroll_au_api.py +++ b/xero_python/payrollau/api/payroll_au_api.py @@ -10,7 +10,7 @@ """ """ - OpenAPI spec version: 2.22.4 + OpenAPI spec version: 2.23.0 """ import importlib diff --git a/xero_python/payrollnz/api/payroll_nz_api.py b/xero_python/payrollnz/api/payroll_nz_api.py index 7327c373..8a50b0f4 100644 --- a/xero_python/payrollnz/api/payroll_nz_api.py +++ b/xero_python/payrollnz/api/payroll_nz_api.py @@ -10,7 +10,7 @@ """ """ - OpenAPI spec version: 2.22.4 + OpenAPI spec version: 2.23.0 """ import importlib diff --git a/xero_python/payrolluk/api/payroll_uk_api.py b/xero_python/payrolluk/api/payroll_uk_api.py index e8fd025f..f81d9215 100644 --- a/xero_python/payrolluk/api/payroll_uk_api.py +++ b/xero_python/payrolluk/api/payroll_uk_api.py @@ -10,7 +10,7 @@ """ """ - OpenAPI spec version: 2.22.4 + OpenAPI spec version: 2.23.0 """ import importlib diff --git a/xero_python/project/api/project_api.py b/xero_python/project/api/project_api.py index 3036b1ff..fb06ba1d 100644 --- a/xero_python/project/api/project_api.py +++ b/xero_python/project/api/project_api.py @@ -10,7 +10,7 @@ """ """ - OpenAPI spec version: 2.22.4 + OpenAPI spec version: 2.23.0 """ import importlib @@ -135,6 +135,96 @@ def create_project( except exceptions.HTTPStatusException as error: raise translate_status_exception(error, self, "create_project") + def create_task( + self, + xero_tenant_id, + project_id, + task_create_or_update, + _return_http_data_only=True, + _preload_content=True, + _request_timeout=None, + ): + """Allows you to create a task # noqa: E501 + OAuth2 scope: projects + Allows you to create a specific task # noqa: E501 + :param str xero_tenant_id: Xero identifier for Tenant (required) + :param str project_id: You can create a task on a specified projectId (required) + :param TaskCreateOrUpdate task_create_or_update: The task object you are creating (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: None + """ + + # 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 `create_task`" + ) + # verify the required parameter 'project_id' is set + if project_id is None: + raise ValueError( + "Missing the required parameter `project_id` " + "when calling `create_task`" + ) + # verify the required parameter 'task_create_or_update' is set + if task_create_or_update is None: + raise ValueError( + "Missing the required parameter `task_create_or_update` " + "when calling `create_task`" + ) + + collection_formats = {} + path_params = { + "projectId": project_id, + } + + query_params = [] + + header_params = { + "Xero-Tenant-Id": xero_tenant_id, + } + + local_var_files = {} + form_params = [] + + body_params = task_create_or_update + # 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( + ["application/json"] + ) + + # Authentication setting + auth_settings = ["OAuth2"] + url = self.get_resource_url("/Projects/{projectId}/Tasks") + + 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=None, + 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, "create_task") + def create_time_entry( self, xero_tenant_id, @@ -225,6 +315,91 @@ def create_time_entry( except exceptions.HTTPStatusException as error: raise translate_status_exception(error, self, "create_time_entry") + def delete_task( + self, + xero_tenant_id, + project_id, + task_id, + _return_http_data_only=True, + _preload_content=True, + _request_timeout=None, + ): + """Allows you to delete a task # noqa: E501 + OAuth2 scope: projects + Allows you to delete a specific task # noqa: E501 + :param str xero_tenant_id: Xero identifier for Tenant (required) + :param str project_id: You can specify an individual project by appending the projectId to the endpoint (required) + :param str task_id: You can specify an individual task by appending the id to the endpoint (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: None + """ + + # 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 `delete_task`" + ) + # verify the required parameter 'project_id' is set + if project_id is None: + raise ValueError( + "Missing the required parameter `project_id` " + "when calling `delete_task`" + ) + # verify the required parameter 'task_id' is set + if task_id is None: + raise ValueError( + "Missing the required parameter `task_id` " "when calling `delete_task`" + ) + + collection_formats = {} + path_params = { + "projectId": project_id, + "taskId": task_id, + } + + 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("/Projects/{projectId}/Tasks/{taskId}") + + try: + return self.api_client.call_api( + url, + "DELETE", + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, + 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, "delete_task") + def delete_time_entry( self, xero_tenant_id, @@ -281,6 +456,11 @@ def delete_time_entry( 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("/Projects/{projectId}/Time/{timeEntryId}") @@ -1158,6 +1338,104 @@ def update_project( except exceptions.HTTPStatusException as error: raise translate_status_exception(error, self, "update_project") + def update_task( + self, + xero_tenant_id, + project_id, + task_id, + task_create_or_update, + _return_http_data_only=True, + _preload_content=True, + _request_timeout=None, + ): + """Allows you to update a task # noqa: E501 + OAuth2 scope: projects + Allows you to update a specific task # noqa: E501 + :param str xero_tenant_id: Xero identifier for Tenant (required) + :param str project_id: You can specify an individual project by appending the projectId to the endpoint (required) + :param str task_id: You can specify an individual task by appending the id to the endpoint (required) + :param TaskCreateOrUpdate task_create_or_update: The task object you are updating (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: None + """ + + # 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 `update_task`" + ) + # verify the required parameter 'project_id' is set + if project_id is None: + raise ValueError( + "Missing the required parameter `project_id` " + "when calling `update_task`" + ) + # verify the required parameter 'task_id' is set + if task_id is None: + raise ValueError( + "Missing the required parameter `task_id` " "when calling `update_task`" + ) + # verify the required parameter 'task_create_or_update' is set + if task_create_or_update is None: + raise ValueError( + "Missing the required parameter `task_create_or_update` " + "when calling `update_task`" + ) + + collection_formats = {} + path_params = { + "projectId": project_id, + "taskId": task_id, + } + + query_params = [] + + header_params = { + "Xero-Tenant-Id": xero_tenant_id, + } + + local_var_files = {} + form_params = [] + + body_params = task_create_or_update + # 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( + ["application/json"] + ) + + # Authentication setting + auth_settings = ["OAuth2"] + url = self.get_resource_url("/Projects/{projectId}/Tasks/{taskId}") + + try: + return self.api_client.call_api( + url, + "PUT", + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, + 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, "update_task") + def update_time_entry( self, xero_tenant_id, @@ -1222,6 +1500,11 @@ def update_time_entry( form_params = [] body_params = time_entry_create_or_update + # 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( ["application/json"] diff --git a/xero_python/project/docs/ProjectApi.md b/xero_python/project/docs/ProjectApi.md index 132ea99d..199f7b3c 100644 --- a/xero_python/project/docs/ProjectApi.md +++ b/xero_python/project/docs/ProjectApi.md @@ -5,7 +5,9 @@ All URIs are relative to *https://api.xero.com/projects.xro/2.0* Method | HTTP request | Description ------------- | ------------- | ------------- [**create_project**](ProjectApi.md#create_project) | **POST** /Projects | Create one or more new projects +[**create_task**](ProjectApi.md#create_task) | **POST** /Projects/{projectId}/Tasks | Allows you to create a task [**create_time_entry**](ProjectApi.md#create_time_entry) | **POST** /Projects/{projectId}/Time | Creates a time entry for a specific project +[**delete_task**](ProjectApi.md#delete_task) | **DELETE** /Projects/{projectId}/Tasks/{taskId} | Allows you to delete a task [**delete_time_entry**](ProjectApi.md#delete_time_entry) | **DELETE** /Projects/{projectId}/Time/{timeEntryId} | Deletes a time entry for a specific project [**get_project**](ProjectApi.md#get_project) | **GET** /Projects/{projectId} | Retrieves a single project [**get_project_users**](ProjectApi.md#get_project_users) | **GET** /ProjectsUsers | Retrieves a list of all project users @@ -16,6 +18,7 @@ Method | HTTP request | Description [**get_time_entry**](ProjectApi.md#get_time_entry) | **GET** /Projects/{projectId}/Time/{timeEntryId} | Retrieves a single time entry for a specific project [**patch_project**](ProjectApi.md#patch_project) | **PATCH** /Projects/{projectId} | creates a project for the specified contact [**update_project**](ProjectApi.md#update_project) | **PUT** /Projects/{projectId} | Updates a specific project +[**update_task**](ProjectApi.md#update_task) | **PUT** /Projects/{projectId}/Tasks/{taskId} | Allows you to update a task [**update_time_entry**](ProjectApi.md#update_time_entry) | **PUT** /Projects/{projectId}/Time/{timeEntryId} | Updates a time entry for a specific project @@ -82,6 +85,72 @@ 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) +# **create_task** +> create_task(xero_tenant_id, project_id, task_create_or_update) + +Allows you to create a task + +Allows you to create a specific task + +### 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.project import ProjectApi + + +# 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 = ProjectApi(api_client) + +xero_tenant_id = 'xero_tenant_id_example' # str | Xero identifier for Tenant +project_id = 'project_id_example' # str | You can create a task on a specified projectId +task_create_or_update = { "status": "INPROGRESS" } # TaskCreateOrUpdate | The task object you are creating +try: + # Allows you to create a task + api_instance.create_task(xero_tenant_id, project_id, task_create_or_update) +except ApiException as e: + print("Exception when calling ProjectApi->create_task: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **str**| Xero identifier for Tenant | + **project_id** | [**str**](.md)| You can create a task on a specified projectId | + **task_create_or_update** | [**TaskCreateOrUpdate**](TaskCreateOrUpdate.md)| The task object you are creating | + +### Return type + +void (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **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) + # **create_time_entry** > TimeEntry create_time_entry(xero_tenant_id, project_id, time_entry_create_or_update) @@ -149,6 +218,72 @@ 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) +# **delete_task** +> delete_task(xero_tenant_id, project_id, task_id) + +Allows you to delete a task + +Allows you to delete a specific task + +### 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.project import ProjectApi + + +# 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 = ProjectApi(api_client) + +xero_tenant_id = 'xero_tenant_id_example' # str | Xero identifier for Tenant +project_id = 'project_id_example' # str | You can specify an individual project by appending the projectId to the endpoint +task_id = 'task_id_example' # str | You can specify an individual task by appending the id to the endpoint +try: + # Allows you to delete a task + api_instance.delete_task(xero_tenant_id, project_id, task_id) +except ApiException as e: + print("Exception when calling ProjectApi->delete_task: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **str**| Xero identifier for Tenant | + **project_id** | [**str**](.md)| You can specify an individual project by appending the projectId to the endpoint | + **task_id** | [**str**](.md)| You can specify an individual task by appending the id to the endpoint | + +### Return type + +void (empty response body) + +### 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) + # **delete_time_entry** > delete_time_entry(xero_tenant_id, project_id, time_entry_id) @@ -211,7 +346,7 @@ void (empty response body) ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: 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) @@ -844,6 +979,74 @@ void (empty response body) [[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) +# **update_task** +> update_task(xero_tenant_id, project_id, task_id, task_create_or_update) + +Allows you to update a task + +Allows you to update a specific task + +### 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.project import ProjectApi + + +# 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 = ProjectApi(api_client) + +xero_tenant_id = 'xero_tenant_id_example' # str | Xero identifier for Tenant +project_id = 'project_id_example' # str | You can specify an individual project by appending the projectId to the endpoint +task_id = 'task_id_example' # str | You can specify an individual task by appending the id to the endpoint +task_create_or_update = xero_python.project.TaskCreateOrUpdate() # TaskCreateOrUpdate | The task object you are updating +try: + # Allows you to update a task + api_instance.update_task(xero_tenant_id, project_id, task_id, task_create_or_update) +except ApiException as e: + print("Exception when calling ProjectApi->update_task: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **str**| Xero identifier for Tenant | + **project_id** | [**str**](.md)| You can specify an individual project by appending the projectId to the endpoint | + **task_id** | [**str**](.md)| You can specify an individual task by appending the id to the endpoint | + **task_create_or_update** | [**TaskCreateOrUpdate**](TaskCreateOrUpdate.md)| The task object you are updating | + +### Return type + +void (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **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) + # **update_time_entry** > update_time_entry(xero_tenant_id, project_id, time_entry_id, time_entry_create_or_update) @@ -908,7 +1111,7 @@ void (empty response body) ### HTTP request headers - **Content-Type**: application/json - - **Accept**: 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) diff --git a/xero_python/project/docs/Task.md b/xero_python/project/docs/Task.md index a579df7b..a1d7c492 100644 --- a/xero_python/project/docs/Task.md +++ b/xero_python/project/docs/Task.md @@ -7,14 +7,14 @@ Name | Type | Description | Notes **name** | **str** | Name of the task. | [optional] **rate** | [**Amount**](Amount.md) | | [optional] **charge_type** | [**ChargeType**](ChargeType.md) | | [optional] -**estimate_minutes** | **float** | An estimated time to perform the task | [optional] +**estimate_minutes** | **int** | An estimated time to perform the task | [optional] **project_id** | **str** | Identifier of the project task belongs to. | [optional] -**total_minutes** | **float** | Total minutes which have been logged against the task. Logged by assigning a time entry to a task | [optional] +**total_minutes** | **int** | Total minutes which have been logged against the task. Logged by assigning a time entry to a task | [optional] **total_amount** | [**Amount**](Amount.md) | | [optional] -**minutes_invoiced** | **float** | Minutes on this task which have been invoiced. | [optional] -**minutes_to_be_invoiced** | **float** | Minutes on this task which have not been invoiced. | [optional] -**fixed_minutes** | **float** | Minutes logged against this task if its charge type is `FIXED`. | [optional] -**non_chargeable_minutes** | **float** | Minutes logged against this task if its charge type is `NON_CHARGEABLE`. | [optional] +**minutes_invoiced** | **int** | Minutes on this task which have been invoiced. | [optional] +**minutes_to_be_invoiced** | **int** | Minutes on this task which have not been invoiced. | [optional] +**fixed_minutes** | **int** | Minutes logged against this task if its charge type is `FIXED`. | [optional] +**non_chargeable_minutes** | **int** | Minutes logged against this task if its charge type is `NON_CHARGEABLE`. | [optional] **amount_to_be_invoiced** | [**Amount**](Amount.md) | | [optional] **amount_invoiced** | [**Amount**](Amount.md) | | [optional] **status** | **str** | Status of the task. When a task of ChargeType is `FIXED` and the rate amount is invoiced the status will be set to `INVOICED` and can't be modified. A task with ChargeType of `TIME` or `NON_CHARGEABLE` cannot have a status of `INVOICED`. A `LOCKED` state indicates that the task is currently changing state (for example being invoiced) and can't be modified. | [optional] diff --git a/xero_python/project/docs/TaskCreateOrUpdate.md b/xero_python/project/docs/TaskCreateOrUpdate.md index 0866e1f0..81f75a8b 100644 --- a/xero_python/project/docs/TaskCreateOrUpdate.md +++ b/xero_python/project/docs/TaskCreateOrUpdate.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes **name** | **str** | Name of the task. Max length 100 characters. | **rate** | [**Amount**](Amount.md) | | **charge_type** | [**ChargeType**](ChargeType.md) | | -**estimate_minutes** | **int** | Estimated time to perform the task. EstimateMinutes has to be greater than 0 if provided. | [optional] +**estimate_minutes** | **int** | An estimated time to perform the task | [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) diff --git a/xero_python/project/models/task.py b/xero_python/project/models/task.py index 8faa5c28..17e3a476 100644 --- a/xero_python/project/models/task.py +++ b/xero_python/project/models/task.py @@ -34,14 +34,14 @@ class Task(BaseModel): "name": "str", "rate": "Amount", "charge_type": "ChargeType", - "estimate_minutes": "float", + "estimate_minutes": "int", "project_id": "str", - "total_minutes": "float", + "total_minutes": "int", "total_amount": "Amount", - "minutes_invoiced": "float", - "minutes_to_be_invoiced": "float", - "fixed_minutes": "float", - "non_chargeable_minutes": "float", + "minutes_invoiced": "int", + "minutes_to_be_invoiced": "int", + "fixed_minutes": "int", + "non_chargeable_minutes": "int", "amount_to_be_invoiced": "Amount", "amount_invoiced": "Amount", "status": "str", @@ -228,7 +228,7 @@ def estimate_minutes(self): An estimated time to perform the task # noqa: E501 :return: The estimate_minutes of this Task. # noqa: E501 - :rtype: float + :rtype: int """ return self._estimate_minutes @@ -239,7 +239,7 @@ def estimate_minutes(self, estimate_minutes): An estimated time to perform the task # noqa: E501 :param estimate_minutes: The estimate_minutes of this Task. # noqa: E501 - :type: float + :type: int """ self._estimate_minutes = estimate_minutes @@ -274,7 +274,7 @@ def total_minutes(self): Total minutes which have been logged against the task. Logged by assigning a time entry to a task # noqa: E501 :return: The total_minutes of this Task. # noqa: E501 - :rtype: float + :rtype: int """ return self._total_minutes @@ -285,7 +285,7 @@ def total_minutes(self, total_minutes): Total minutes which have been logged against the task. Logged by assigning a time entry to a task # noqa: E501 :param total_minutes: The total_minutes of this Task. # noqa: E501 - :type: float + :type: int """ self._total_minutes = total_minutes @@ -318,7 +318,7 @@ def minutes_invoiced(self): Minutes on this task which have been invoiced. # noqa: E501 :return: The minutes_invoiced of this Task. # noqa: E501 - :rtype: float + :rtype: int """ return self._minutes_invoiced @@ -329,7 +329,7 @@ def minutes_invoiced(self, minutes_invoiced): Minutes on this task which have been invoiced. # noqa: E501 :param minutes_invoiced: The minutes_invoiced of this Task. # noqa: E501 - :type: float + :type: int """ self._minutes_invoiced = minutes_invoiced @@ -341,7 +341,7 @@ def minutes_to_be_invoiced(self): Minutes on this task which have not been invoiced. # noqa: E501 :return: The minutes_to_be_invoiced of this Task. # noqa: E501 - :rtype: float + :rtype: int """ return self._minutes_to_be_invoiced @@ -352,7 +352,7 @@ def minutes_to_be_invoiced(self, minutes_to_be_invoiced): Minutes on this task which have not been invoiced. # noqa: E501 :param minutes_to_be_invoiced: The minutes_to_be_invoiced of this Task. # noqa: E501 - :type: float + :type: int """ self._minutes_to_be_invoiced = minutes_to_be_invoiced @@ -364,7 +364,7 @@ def fixed_minutes(self): Minutes logged against this task if its charge type is `FIXED`. # noqa: E501 :return: The fixed_minutes of this Task. # noqa: E501 - :rtype: float + :rtype: int """ return self._fixed_minutes @@ -375,7 +375,7 @@ def fixed_minutes(self, fixed_minutes): Minutes logged against this task if its charge type is `FIXED`. # noqa: E501 :param fixed_minutes: The fixed_minutes of this Task. # noqa: E501 - :type: float + :type: int """ self._fixed_minutes = fixed_minutes @@ -387,7 +387,7 @@ def non_chargeable_minutes(self): Minutes logged against this task if its charge type is `NON_CHARGEABLE`. # noqa: E501 :return: The non_chargeable_minutes of this Task. # noqa: E501 - :rtype: float + :rtype: int """ return self._non_chargeable_minutes @@ -398,7 +398,7 @@ def non_chargeable_minutes(self, non_chargeable_minutes): Minutes logged against this task if its charge type is `NON_CHARGEABLE`. # noqa: E501 :param non_chargeable_minutes: The non_chargeable_minutes of this Task. # noqa: E501 - :type: float + :type: int """ self._non_chargeable_minutes = non_chargeable_minutes diff --git a/xero_python/project/models/task_create_or_update.py b/xero_python/project/models/task_create_or_update.py index 1850094b..253992c6 100644 --- a/xero_python/project/models/task_create_or_update.py +++ b/xero_python/project/models/task_create_or_update.py @@ -141,7 +141,7 @@ def charge_type(self, charge_type): def estimate_minutes(self): """Gets the estimate_minutes of this TaskCreateOrUpdate. # noqa: E501 - Estimated time to perform the task. EstimateMinutes has to be greater than 0 if provided. # noqa: E501 + An estimated time to perform the task # noqa: E501 :return: The estimate_minutes of this TaskCreateOrUpdate. # noqa: E501 :rtype: int @@ -152,7 +152,7 @@ def estimate_minutes(self): def estimate_minutes(self, estimate_minutes): """Sets the estimate_minutes of this TaskCreateOrUpdate. - Estimated time to perform the task. EstimateMinutes has to be greater than 0 if provided. # noqa: E501 + An estimated time to perform the task # noqa: E501 :param estimate_minutes: The estimate_minutes of this TaskCreateOrUpdate. # noqa: E501 :type: int