From 89cbb2458b49ae239754eb7cb3a5c6ea0248f5c6 Mon Sep 17 00:00:00 2001 From: Rett Behrens Date: Fri, 16 Jul 2021 12:55:16 -0600 Subject: [PATCH 1/6] fetch token using client credentials auth added --- xero_python/api_client/__init__.py | 10 ++++++++ xero_python/api_client/oauth2.py | 41 +++++++++++++++++++++++++++--- 2 files changed, 47 insertions(+), 4 deletions(-) diff --git a/xero_python/api_client/__init__.py b/xero_python/api_client/__init__.py index 22b8f792..d88e7166 100644 --- a/xero_python/api_client/__init__.py +++ b/xero_python/api_client/__init__.py @@ -758,6 +758,16 @@ def revoke_oauth2_token(self): if oauth2_token.revoke_access_token(self): return self.get_oauth2_token() + def get_client_credentials_token(self): + """ + Obtain oauth2 token using client credentials grant type + :return: oauth2 token + """ + oauth2_token = self.configuration.oauth2_token + # oauth2_token.update_token(**self.get_oauth2_token()) + if oauth2_token.get_client_credentials_access_token(self): + return self.get_oauth2_token() + def oauth2_token_getter(self, token_getter): """ A decorator to register a callback function for getting oauth2 token diff --git a/xero_python/api_client/oauth2.py b/xero_python/api_client/oauth2.py index 7f7e41a5..82620ae4 100644 --- a/xero_python/api_client/oauth2.py +++ b/xero_python/api_client/oauth2.py @@ -10,6 +10,7 @@ class TokenApi: Api class handles interactions with xero token API endpoints """ + client_credentials_token_url = "https://identity.xero.com/connect/token" refresh_token_url = "https://identity.xero.com/connect/token" revoke_token_url = "https://identity.xero.com/connect/revocation" @@ -80,6 +81,31 @@ def revoke_token(self, refresh_token): ) return status + def get_client_credentials_token(self): + post_data = { + "client_id": self.client_id, + "client_secret": self.client_secret, + "grant_type": "client_credentials", + } + response, status, headers = self.api_client.call_api( + self.client_credentials_token_url, + "POST", + header_params={ + "Accept": "application/json", + "Content-Type": "application/x-www-form-urlencoded", + }, + post_params=post_data, + auth_settings=None, # important to prevent infinite recursive loop + _preload_content=False, + ) + if status != 200: + # todo improve error handling + raise Exception( + "refresh token status {} {} {!r}".format(status, response, headers) + ) + # todo validate response is json + return self.parse_token_response(response) + def parse_token_response(self, response): """ Parse token data from http response @@ -200,6 +226,13 @@ def refresh_access_token(self, api_client): self.update_token(**new_token) api_client.set_oauth2_token(new_token) return True + + def get_client_credentials_access_token(self, api_client): + token_api = TokenApi(api_client, self.client_id, self.client_secret) + new_token = token_api.get_client_credentials_token() + self.update_token(**new_token) + api_client.set_oauth2_token(new_token) + return True def revoke_access_token(self, api_client): """ @@ -228,19 +261,19 @@ def revoke_access_token(self, api_client): def update_token( self, access_token, - refresh_token, scope, - expires_at, expires_in, token_type, + expires_at=None, + refresh_token=None, id_token=None, ): """ Set new auth2 token details :param access_token: str - :param refresh_token: str + :param refresh_token: str (optional) :param scope: list of strings - :param expires_at: float timestamp + :param expires_at: float timestamp (optioanl) :param expires_in: number :param token_type: str :param id_token: str (optional) From 9834af074066430b835850b2cf286380f26882be Mon Sep 17 00:00:00 2001 From: Rett Behrens Date: Wed, 21 Jul 2021 11:06:43 -0600 Subject: [PATCH 2/6] adds documentation to new methods and overhauls readme --- README.md | 618 ++++++++++++++++++++++++----- xero_python/api_client/__init__.py | 1 - xero_python/api_client/oauth2.py | 9 + 3 files changed, 523 insertions(+), 105 deletions(-) diff --git a/README.md b/README.md index a3336844..24042b1b 100644 --- a/README.md +++ b/README.md @@ -1,123 +1,533 @@ # xero-python +[![PyPI version](https://badge.fury.io/py/xero-python.svg)](https://badge.fury.io/py/xero-python) +[![Github forks](https://img.shields.io/github/forks/XeroAPI/xero-python.svg)](https://github.com/XeroAPI/xero-python/network) +[![Github stars](https://img.shields.io/github/stars/XeroAPI/xero-python.svg)](https://github.com/XeroAPI/xero-python/stargazers) +![total downloads](https://ruby-gem-downloads-badge.herokuapp.com/xero-ruby?type=total) -[![image](https://img.shields.io/pypi/v/xero-python.svg)](https://pypi.python.org/pypi/xero-python) +The xero-python SDK makes it easy for developers to access Xero's APIs in their python code, and build robust applications and software using small business & general ledger accounting data. +# Table of Contents +- [API Client documentation](#api-client-documentation) +- [Sample Applications](#sample-applications) +- [Xero Account Requirements](#xero-account-requirements) +- [Installation](#installation) +- [Configuration](#configuration) +- [Authentication](#authentication) +- [Custom Connections](#custom-connections) +- [API Clients](#api-clients) +- [Helper Methods](#helper-methods) +- [Usage Examples](#usage-examples) +- [SDK conventions](#sdk-conventions) +- [Participating in Xero’s developer community](#participating-in-xeros-developer-community) +- [Contributing](#contributing) - +
- +## API Client documentation +This SDK supports full method coverage for the following Xero API sets: - +| API Set | Description | +| --- | --- | +| [`Accounting`](https://xeroapi.github.io/xero-python/v1/accounting/index.html) | The Accounting API exposes accounting functions of the main Xero application *(most commonly used)* +| [Assets](https://xeroapi.github.io/xero-python/v1/assets/index.html) | The Assets API exposes fixed asset related functions of the Xero Accounting application | +| [Files](https://xeroapi.github.io/xero-python/v1/files/index.html) | The Files API provides access to the files, folders, and the association of files within a Xero organisation | +| [Projects](https://xeroapi.github.io/xero-python/v1/projects/index.html) | Xero Projects allows businesses to track time and costs on projects/jobs and report on profitability | +| [Payroll (AU)](https://xeroapi.github.io/xero-python/v1/payroll_au/index.html) | The (AU) Payroll API exposes payroll related functions of the payroll Xero application | +| [Payroll (UK)](https://xeroapi.github.io/xero-python/v1/payroll_uk/index.html) | The (UK) Payroll API exposes payroll related functions of the payroll Xero application | +| [Payroll (NZ)](https://xeroapi.github.io/xero-python/v1/payroll_nz/index.html) | The (NZ) Payroll API exposes payroll related functions of the payroll Xero application | -Official python SDK for Xero API generated by OpenAPI spec for oAuth 2 +drawing -## Features +
-* XERO API Client with oauth2 token integration. -* Automatic OAuth 2 token refresh before token expiration. -* Class based interface for Xero API endpoints. -* Model classes used to represent API data. -* Currently Supported API sets: +## Sample Applications +Sample apps can get you started quickly with simple auth flows and advanced usage examples. - * [Accounting API](https://developer.xero.com/documentation/api/api-overview) - * [Assets API](https://developer.xero.com/documentation/assets-api/overview) - * [Files API](https://developer.xero.com/documentation/files-api/overview-files) - * [Payroll API (AU)](https://developer.xero.com/documentation/payroll-api/overview) - * [Payroll API (NZ)](https://developer.xero.com/documentation/payroll-api-nz/overview) - * [Payroll API (UK)](https://developer.xero.com/documentation/payroll-api-uk/overview) - * [Projects API](https://developer.xero.com/documentation/projects/overview-projects) +| Sample App | Description | Screenshot | +| --- | --- | --- | +| [`starter-app`](https://github.com/XeroAPI/xero-python-oauth2-starter) | Basic getting started code samples | drawing +| [`full-app`](https://github.com/XeroAPI/xero-python-oauth2-app) | Complete app with more complex examples | drawing +| [`custom-connections-starter`](https://github.com/XeroAPI/xero-python-custom-connections-starter) | Basic app showing Custom Connections - a Xero [premium option](https://developer.xero.com/documentation/oauth2/custom-connections) for building M2M integrations to a single org | drawing + +
+ +## Xero Account Requirements +- Create a [free Xero user account](https://www.xero.com/us/signup/api/) +- Login to your Xero developer [dashboard](https://developer.xero.com/app/manage) and create an API application +- Copy the credentials from your API app and store them using a secure ENV variable strategy +- Decide the [neccesary scopes](https://developer.xero.com/documentation/oauth2/scopes) for your app's functionality + +# Installation +To install this SDK in your project: +``` +pip install xero-python +``` + +--- +## Configuration +```python +# -*- coding: utf-8 -*- +import os +from functools import wraps +from io import BytesIO +from logging.config import dictConfig +from flask import Flask, session +from flask_oauthlib.contrib.client import OAuth, OAuth2Application +from flask_session import Session +from xero_python.accounting import AccountingApi +from xero_python.assets import AssetApi +from xero_python.project import ProjectApi +from xero_python.payrollau import PayrollAuApi +from xero_python.payrolluk import PayrollUkApi +from xero_python.payrollnz import PayrollNzApi +from xero_python.file import FilesApi +from xero_python.api_client import ApiClient, serialize +from xero_python.api_client.configuration import Configuration +from xero_python.api_client.oauth2 import OAuth2Token +from xero_python.exceptions import AccountingBadRequestException, PayrollUkBadRequestException +from xero_python.identity import IdentityApi +from xero_python.utils import getvalue +import logging_settings +from utils import jsonify, serialize_model + +dictConfig(logging_settings.default_settings) + +# configure main flask application +app = Flask(__name__) +app.config.from_object("default_settings") +app.config.from_pyfile("config.py", silent=True) + +if app.config["ENV"] != "production": + # allow oauth2 loop to run over http (used for local testing only) + os.environ["OAUTHLIB_INSECURE_TRANSPORT"] = "1" + +# configure persistent session cache +Session(app) + +# configure flask-oauthlib application +oauth = OAuth(app) +xero = oauth.remote_app( + name="xero", + version="2", + client_id=app.config["CLIENT_ID"], + client_secret=app.config["CLIENT_SECRET"], + endpoint_url="https://api.xero.com/", + authorization_url="https://login.xero.com/identity/connect/authorize", + access_token_url="https://identity.xero.com/connect/token", + refresh_token_url="https://identity.xero.com/connect/token", + scope="offline_access openid profile email accounting.transactions " + "accounting.transactions.read accounting.reports.read " + "accounting.journals.read accounting.settings accounting.settings.read " + "accounting.contacts accounting.contacts.read accounting.attachments " + "accounting.attachments.read assets projects " + "files " + "payroll.employees payroll.payruns payroll.payslip payroll.timesheets payroll.settings", +) # type: OAuth2Application + + +# configure xero-python sdk client +api_client = ApiClient( + Configuration( + debug=app.config["DEBUG"], + oauth2_token=OAuth2Token( + client_id=app.config["CLIENT_ID"], client_secret=app.config["CLIENT_SECRET"] + ), + ), + pool_threads=1, +) + +# configure token persistence and exchange point between flask-oauthlib and xero-python +@xero.tokengetter +@api_client.oauth2_token_getter +def obtain_xero_oauth2_token(): + return session.get("token") + +@xero.tokensaver +@api_client.oauth2_token_saver +def store_xero_oauth2_token(token): + session["token"] = token + session.modified = True +``` + +--- +## Authentication +All API requests go through Xero's OAuth 2.0 gateway and require a valid `access_token` to be set on the `client` which appends the `access_token` [JWT](https://jwt.io/) to the header of each request. + +If you are making an API call for the first time: + +1. Send the user to the Xero authorization URL +```python +@app.route("/login") +def login(): + redirect_url = url_for("oauth_callback", _external=True) + session["state"] = app.config["STATE"] + try: + response = xero.authorize(callback_uri=redirect_url, state=session["state"]) + except Exception as e: + print(e) + raise + return response +``` +2. The user will authorize your application and be sent to your `redirect_uri`. This is when and where to check that the returned "state" param matches that which was previously defined. If the "state" params match, calling the oauth library's `authorized_response()` method will swap the temporary auth code for an access token which you can store and use for subsequent API calls. +```python +@app.route("/callback") +def oauth_callback(): + if request.args.get("state") != session["state"]: + return "Error, state doesn't match, no token for you." + try: + response = xero.authorized_response() + except Exception as e: + print(e) + raise + if response is None or response.get("access_token") is None: + return "Access denied: response=%s" % response + store_xero_oauth2_token(response) + return redirect(url_for("index", _external=True)) +``` +3. Call the Xero API like so: +```python +@app.route("/accounting_invoice_read_all") +@xero_token_required +def accounting_invoice_read_all(): + code = get_code_snippet("INVOICES","READ_ALL") + + #[INVOICES:READ_ALL] + xero_tenant_id = get_xero_tenant_id() + accounting_api = AccountingApi(api_client) + + try: + invoices_read = accounting_api.get_invoices( + xero_tenant_id + ) + except AccountingBadRequestException as exception: + output = "Error: " + exception.reason + json = jsonify(exception.error_data) + else: + output = "Total invoices found: {}.".format(len(invoices_read.invoices) + ) + json = serialize_model(invoices_read) + #[/INVOICES:READ_ALL] + + return render_template( + "output.html", title="Invoices",code=code, output=output, json=json, len = 0, set="accounting", endpoint="invoice", action="read_all" + ) +``` + +It is recommended that you store this token set JSON in a datastore in relation to the user who has authenticated the Xero API connection. Each time you want to call the Xero API, you will need to access the previously generated token set, initialize it on the SDK `client`, and refresh the `access_token` prior to making API calls. + +### Token Set +| key | value | description | +| --- | --- | --- | +| id_token: | "xxx.yyy.zzz" | [OpenID Connect](https://openid.net/connect/) token returned if `openid profile email` scopes accepted | +| access_token: | "xxx.yyy.zzz" | [Bearer token](https://oauth.net/2/jwt/) with a 30 minute expiration required for all API calls | +| expires_in: | 1800 | Time in seconds till the token expires - 1800s is 30m | +| refresh_token: | "XXXXXXX" | Alphanumeric string used to obtain a new Token Set w/ a fresh access_token - 60 day expiry | +| scope: | "email profile openid accounting.transactions offline_access" | The Xero permissions that are embedded in the `access_token` | + +Example Token Set JSON: +``` +{ + "id_token": "xxx.yyy.zz", + "access_token": "xxx.yyy.zzz", + "expires_in": 1800, + "token_type": "Bearer", + "refresh_token": "xxxxxxxxx", + "scope": "email profile openid accounting.transactions offline_access" +} +``` + +--- +## Custom Connections + +Custom Connections are a Xero [premium option](https://developer.xero.com/documentation/oauth2/custom-connections) used for building M2M integrations to a single organisation. A custom connection uses OAuth 2.0's [`client_credentials`](https://www.oauth.com/oauth2-servers/access-tokens/client-credentials/) grant which eliminates the step of exchanging the temporary code for a token set. + +To use this SDK with a Custom Connections: +```python +# -*- coding: utf-8 -*- +import os +from functools import wraps +from io import BytesIO +from logging.config import dictConfig +from flask import Flask, url_for, render_template, session, redirect, json, send_file +from flask_session import Session +from xero_python.accounting import AccountingApi, ContactPerson, Contact, Contacts +from xero_python.api_client import ApiClient, serialize +from xero_python.api_client.configuration import Configuration +from xero_python.api_client.oauth2 import OAuth2Token +from xero_python.exceptions import AccountingBadRequestException +from xero_python.identity import IdentityApi +from xero_python.utils import getvalue +import logging_settings +from utils import jsonify, serialize_model + +dictConfig(logging_settings.default_settings) + +# configure main flask application +app = Flask(__name__) +app.config.from_object("default_settings") +app.config.from_pyfile("config.py", silent=True) + +# configure persistent session cache +Session(app) + +# configure xero-python sdk client +api_client = ApiClient( + Configuration( + debug=app.config["DEBUG"], + oauth2_token=OAuth2Token( + client_id=app.config["CLIENT_ID"], client_secret=app.config["CLIENT_SECRET"] + ), + ), + pool_threads=1, +) + +# configure token persistence and exchange point between app session and xero-python +@api_client.oauth2_token_getter +def obtain_xero_oauth2_token(): + return session.get("token") + +@api_client.oauth2_token_saver +def store_xero_oauth2_token(token): + session["token"] = token + session.modified = True + +@app.route("/get_token") +def get_token(): + try: + # no user auth flow, no exchanging temp code for token + xero_token = api_client.get_client_credentials_token() + except Exception as e: + print(e) + raise + # todo validate state value + if xero_token is None or xero_token.get("access_token") is None: + return "Access denied: response=%s" % xero_token + store_xero_oauth2_token(xero_token) + return redirect(url_for("index", _external=True)) + +@app.route("/accounting_invoice_read_all") +@xero_token_required +def accounting_invoice_read_all(): + code = get_code_snippet("INVOICES","READ_ALL") + + #[INVOICES:READ_ALL] + accounting_api = AccountingApi(api_client) + + try: + invoices_read = accounting_api.get_invoices('') + except AccountingBadRequestException as exception: + output = "Error: " + exception.reason + json = jsonify(exception.error_data) + else: + output = "Total invoices found: {}.".format(len(invoices_read.invoices) + ) + json = serialize_model(invoices_read) + #[/INVOICES:READ_ALL] + + return render_template( + "output.html", title="Invoices",code=code, output=output, json=json, len = 0, set="accounting", endpoint="invoice", action="read_all" + ) +``` + +Because Custom Connections are only valid for a single organisation you don't need to pass the xero-tenant-id as the first parameter to every method, or more specifically for this SDK xeroTenantId can be an empty string. + +> Because the SDK is generated from the OpenAPI spec the parameter remains. For now you are required to pass an empty string to use this SDK with a Custom Connection. + +--- +## API Clients +You can access the different API sets and their available methods through the following: + +```python +accounting_api = AccountingApi(api_client) +read_accounts = accounting_api.get_accounts(xero_tenant_id) +asset_api = AssetApi(api_client) +read_assets = asset_api.get_assets(xero_tenant_id) +# ... all the API sets follow the same pattern +``` +--- +## Helper Methods + +Once you have a valid Token Set in your datastore, the next time you want to call the Xero API simply initialize a new `client` and refresh the token set. + +```python +# configure xero-python sdk client +api_client = ApiClient( + Configuration( + debug=app.config["DEBUG"], + oauth2_token=OAuth2Token( + client_id=app.config["CLIENT_ID"], client_secret=app.config["CLIENT_SECRET"] + ), + ), + pool_threads=1, +) + +# configure token persistence and exchange point between app session and xero-python +@api_client.oauth2_token_getter +def obtain_xero_oauth2_token(): + return session.get("token") + +@api_client.oauth2_token_saver +def store_xero_oauth2_token(token): + session["token"] = token + session.modified = True + +# get existing token set +token_set = get_token_set_from_database(user_id); // example function name + +# set token set to the api client +store_xero_oauth2_token(token_set) + +# refresh token set on the api client +api_client.refresh_oauth2_token() + +# call the Xero API +accounting_api = AccountingApi(api_client) +read_accounts = accounting_api.get_accounts(xero_tenant_id) +``` + +A full list of the SDK client's methods: + +| method | description | params | returns +| --- | --- | --- | --- | +| api_client.`oauth2_token_saver` | A decorator to register a callback function for saving refreshed token while the old token has expired | token_saver: the callback function accepting `token` argument | token_saver to allow this method be used as decorator | +| api_client.`oauth2_token_getter` | A decorator to register a callback function for getting oauth2 token | token_getter: the callback function returning oauth2 token dictionary | token_getter to allow this method be used as decorator | +| api_client.`revoke_oauth2_token` | Revokes a users refresh token and removes all their connections to your app | N/A | empty OAuth2 token | +| api_client.`refresh_oauth2_token` | Refreshes OAuth2 token set | N/A | new token set | +| api_client.`set_oauth2_token` | Sets OAuth2 token directly on the client | dict token: standard token dictionary | N/A | +| api_client.`get_oauth2_token` | Get OAuth2 token dictionary | N/A | dict | +--- +## Usage Examples +### Accounting API +```python +from xero_python.accounting import AccountingApi +from xero_python.utils import getvalue + +accounting_api = AccountingApi(api_client) + +# Get Accounts +read_accounts = accounting_api.get_accounts(xero_tenant_id) +account_id = getvalue(read_accounts, "accounts.0.account_id", "") + +# Get Account by ID +read_one_account = accounting_api.get_account(xero_tenant_id, account_id) + +# Create Invoice +# get contact +read_contacts = accounting_api.get_contacts(xero_tenant_id) +contact_id = getvalue(read_contacts, "contacts.0.contact_id", "") +# get account +where = "Type==\"SALES\"&&Status==\"ACTIVE\"" +read_accounts = accounting_api.get_accounts( + xero_tenant_id, where=where +) +account_id = getvalue(read_accounts, "accounts.0.account_id", "") +# build Invoices +contact = Contact( + contact_id=contact_id +) +line_item = LineItem( + account_code=account_id, + description= "Consulting", + quantity=1.0, + unit_amount=10.0, +) +invoice = Invoice( + line_items=[line_item], + contact=contact, + due_date= dateutil.parser.parse("2020-09-03T00:00:00Z"), + date= dateutil.parser.parse("2020-07-03T00:00:00Z"), + type="ACCREC" +) +invoices = Invoices(invoices=[invoice]) +created_invoices = accounting_api.create_invoices(xero_tenant_id, invoices=invoices) +invoice_id = getvalue(read_invoices, "invoices.0.invoice_id", "") + +# Create Attachment +include_online = True +file_name = "helo-heros.jpg" +path_to_upload = Path(__file__).resolve().parent.joinpath(file_name) +open_file = open(path_to_upload, 'rb') +body = open_file.read() +content_type = mimetypes.MimeTypes().guess_type(file_name)[0] + +created_invoice_attachments_by_file_name = accounting_api.create_invoice_attachment_by_file_name( + xero_tenant_id, + invoice_id, + file_name, + body, + include_online, +) +``` + +--- +## SDK conventions + +### Querying & Filtering + +Describe the support for query options and filtering + +```python +# configure api_client for use with xero-python sdk client +api_client = ApiClient( + Configuration( + debug=false, + oauth2_token=OAuth2Token( + client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET" + ), + ), + pool_threads=1, +) + +api_client.set_oauth2_token("YOUR_ACCESS_TOKEN") + +def accounting_get_invoices(): + api_instance = AccountingApi(api_client) + xero_tenant_id = 'YOUR_XERO_TENANT_ID' + if_modified_since = dateutil.parser.parse("2020-02-06T12:17:43.202-08:00") + where = 'Status=="DRAFT"' + order = 'InvoiceNumber ASC' + ids = ["00000000-0000-0000-0000-000000000000"] + invoice_numbers = ["INV-001", "INV-002"] + contact_ids = ["00000000-0000-0000-0000-000000000000"] + statuses = ["DRAFT", "SUBMITTED"] + include_archived = 'true' + created_by_my_app = 'false' + summary_only = 'true' -* Error handling for ease of use. - -## SDK Documentation -* [Accounting](https://xeroapi.github.io/xero-python/v1/accounting/index.html) - -## Starter Project -We've created [xero-python-outh2-starter](https://github.com/XeroAPI/xero-python-oauth2-starter) a project to demonstrate how to use this SDK. - -* oauth 2 flow to obtain a token -* token refresh -* identity to obtain tenant_id -* organisation endpoint -* create contact -* create multiple contacts -* get invoices using where clause - -Here is a [15 min video walkthrough](https://www.youtube.com/watch?v=i8JWtbMo90M) on using the starter project. - -## Kitchen Sync app -We've created [xero-python-outh2-app](https://github.com/XeroAPI/xero-python-oauth2-app) a project to demonstrate how to make API calls and displays the python code used to make the call and the JSON response. - -* oauth 2 flow to obtain a token -* token refresh -* identity to obtain tenant_id -* accounting - * accounts - * contacts - * invoices -* assets - * asset - * asset type - * asset settings -* projects - * projects - * project users - * tasks - * time -* au payroll - * employee - * leave applications - * pay items - * payroll calendar - * pay runs - * pay slips - * settings - * superfunds - * superfund products - * timesheets -* uk payroll - * employees - * employement - * employees tax - * employee opening balance - * employees leave - * employees leave balances - * employees statutory leave balances - * employees statutory leave summary - * employees statutory sick leave - * employees leave periods - * employees leave types - * employees pay templates - * employer pensions - * deductions - * earnings orders - * earnings rates - * leave types - * reimbursements - * timesheets - * payment methods - * payrun calendars - * salary and wage - * pay runs - * pay slips - * settings - * tracking categories - -## Credits - -* This package was created with -[Cookiecutter](https://github.com/audreyr/cookiecutter) and the -[audreyr/cookiecutter-pypackage](https://github.com/audreyr/cookiecutter-pypackage) -project template. +api_response = api_instance.get_invoices( + xero_tenant_id, + if_modified_since, + where, + order, + ids, + invoice_numbers, + contact_ids, + statuses, + page, + include_archived, + created_by_my_app, + unitdp, + summary_only +) +``` + +--- ## Participating in Xero’s developer community + This SDK is one of a number of SDK’s that the Xero Developer team builds and maintains. We are grateful for all the contributions that the community makes. Here are a few things you should be aware of as a contributor: -* Xero has adopted the Contributor Covenant [Code of Conduct](https://github.com/XeroAPI/xero-python/blob/master/CODE_OF_CONDUCT.md), we expect all contributors in our community to adhere to it -* If you raise an issue then please make sure to fill out the github issue template, doing so helps us help you +* Xero has adopted the Contributor Covenant [Code of Conduct](https://github.com/XeroAPI/xero-ruby/blob/master/CODE_OF_CONDUCT.md), we expect all contributors in our community to adhere to it +* If you raise an issue then please make sure to fill out the Github issue template, doing so helps us help you * You’re welcome to raise PRs. As our SDKs are generated we may use your code in the core SDK build instead of merging your code -* We have a [contribution guide](https://github.com/XeroAPI/xero-python/blob/master/CONTRIBUTING.md) for you to follow when contributing to this SDK +* We have a [contribution guide](https://github.com/XeroAPI/xero-ruby/blob/master/CONTRIBUTING.md) for you to follow when contributing to this SDK * Curious about how we generate our SDK’s? Have a [read of our process](https://devblog.xero.com/building-sdks-for-the-future-b79ff726dfd6) and have a look at our [OpenAPISpec](https://github.com/XeroAPI/Xero-OpenAPI) -* This software is published under the [MIT License](https://github.com/XeroAPI/xero-python/blob/master/LICENSE) +* This software is published under the [MIT License](https://github.com/XeroAPI/xero-ruby/blob/master/LICENSE) For questions that aren’t related to SDKs please refer to our [developer support page](https://developer.xero.com/support/). + +### Contributing +PRs, issues, and discussion are highly appreciated and encouraged. Note that the majority of this project is generated code based on [Xero's OpenAPI specs](https://github.com/XeroAPI/Xero-OpenAPI) - PR's will be evaluated and pre-merge will be incorporated into the root generation templates. + +### Versioning +We do our best to keep OS industry `semver` standards, but we can make mistakes! If something is not accurately reflected in a version's release notes please let the team know. \ No newline at end of file diff --git a/xero_python/api_client/__init__.py b/xero_python/api_client/__init__.py index d88e7166..69a5e17e 100644 --- a/xero_python/api_client/__init__.py +++ b/xero_python/api_client/__init__.py @@ -764,7 +764,6 @@ def get_client_credentials_token(self): :return: oauth2 token """ oauth2_token = self.configuration.oauth2_token - # oauth2_token.update_token(**self.get_oauth2_token()) if oauth2_token.get_client_credentials_access_token(self): return self.get_oauth2_token() diff --git a/xero_python/api_client/oauth2.py b/xero_python/api_client/oauth2.py index 82620ae4..6e879309 100644 --- a/xero_python/api_client/oauth2.py +++ b/xero_python/api_client/oauth2.py @@ -82,6 +82,10 @@ def revoke_token(self, refresh_token): return status def get_client_credentials_token(self): + """ + Call Xero Identity API to obtain an access token via OAuth2 Client Credentails grant type + :return: dictionary with new auth2 token + """ post_data = { "client_id": self.client_id, "client_secret": self.client_secret, @@ -228,6 +232,11 @@ def refresh_access_token(self, api_client): return True def get_client_credentials_access_token(self, api_client): + """ + Perform OAuth2 Client Credentials grant token request. + :param api_client: ApiClient instance used to perform refresh token API call. + :return: bool - True if success + """ token_api = TokenApi(api_client, self.client_id, self.client_secret) new_token = token_api.get_client_credentials_token() self.update_token(**new_token) From 0a8fbe74b0c4317cac768c81c057e6b933e1bf8c Mon Sep 17 00:00:00 2001 From: Rett Behrens Date: Wed, 21 Jul 2021 12:28:24 -0600 Subject: [PATCH 3/6] builds latest from OAS 2.13.4 --- docs/v1/accounting/index.html | 1228 +++++++++++------ setup.py | 2 +- xero_python/__init__.py | 2 +- xero_python/accounting/__init__.py | 4 + xero_python/accounting/api/accounting_api.py | 465 +++++-- xero_python/accounting/docs/AccountingApi.md | 372 +++-- xero_python/accounting/docs/Budget.md | 15 + xero_python/accounting/docs/BudgetBalance.md | 13 + xero_python/accounting/docs/BudgetLine.md | 12 + xero_python/accounting/docs/Budgets.md | 10 + xero_python/accounting/docs/LineItem.md | 1 + xero_python/accounting/docs/Report.md | 1 - xero_python/accounting/docs/ReportWithRow.md | 2 +- xero_python/accounting/models/__init__.py | 4 + xero_python/accounting/models/budget.py | 228 +++ .../accounting/models/budget_balance.py | 161 +++ xero_python/accounting/models/budget_line.py | 126 ++ xero_python/accounting/models/budgets.py | 64 + xero_python/accounting/models/line_item.py | 29 + xero_python/accounting/models/report.py | 29 - .../accounting/models/report_with_row.py | 4 +- xero_python/api_client/oauth2.py | 2 +- xero_python/assets/api/asset_api.py | 2 +- xero_python/docs/README.md | 4 +- xero_python/file/api/files_api.py | 2 +- xero_python/identity/api/identity_api.py | 2 +- xero_python/payrollau/api/payroll_au_api.py | 2 +- xero_python/payrollau/docs/PayrollCalendar.md | 1 + .../payrollau/models/payroll_calendar.py | 29 + xero_python/payrollnz/api/payroll_nz_api.py | 2 +- xero_python/payrolluk/api/payroll_uk_api.py | 2 +- xero_python/payrolluk/docs/PayrollUkApi.md | 4 +- xero_python/payrolluk/models/earnings_rate.py | 1 + xero_python/project/api/project_api.py | 2 +- xero_python/project/docs/ProjectApi.md | 6 +- 35 files changed, 2101 insertions(+), 732 deletions(-) create mode 100644 xero_python/accounting/docs/Budget.md create mode 100644 xero_python/accounting/docs/BudgetBalance.md create mode 100644 xero_python/accounting/docs/BudgetLine.md create mode 100644 xero_python/accounting/docs/Budgets.md create mode 100644 xero_python/accounting/models/budget.py create mode 100644 xero_python/accounting/models/budget_balance.py create mode 100644 xero_python/accounting/models/budget_line.py create mode 100644 xero_python/accounting/models/budgets.py diff --git a/docs/v1/accounting/index.html b/docs/v1/accounting/index.html index 163ff5d1..e9ba07de 100644 --- a/docs/v1/accounting/index.html +++ b/docs/v1/accounting/index.html @@ -1773,6 +1773,115 @@ }, "description" : "", "x-isObjectArray" : true +}; + defs["Budget"] = { + "title" : "", + "type" : "object", + "properties" : { + "BudgetID" : { + "type" : "string", + "description" : "Xero identifier", + "format" : "uuid" + }, + "Type" : { + "type" : "string", + "description" : "Type of Budget. OVERALL or TRACKING", + "enum" : [ "OVERALL", "TRACKING" ] + }, + "Description" : { + "maxLength" : 255, + "type" : "string", + "description" : "The Budget description" + }, + "UpdatedDateUTC" : { + "type" : "string", + "description" : "UTC timestamp of last update to budget", + "readOnly" : true, + "example" : "/Date(1573755038314)/", + "x-is-msdate-time" : true + }, + "BudgetLines" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/BudgetLine" + } + }, + "Tracking" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/TrackingCategory" + } + } + }, + "description" : "", + "externalDocs" : { + "url" : "http://developer.xero.com/documentation/api/budgets/" + } +}; + defs["BudgetBalance"] = { + "title" : "", + "type" : "object", + "properties" : { + "Period" : { + "type" : "string", + "description" : "Period the amount applies to (e.g. “2019-08”)", + "x-is-msdate" : true + }, + "Amount" : { + "type" : "integer", + "description" : "LineItem Quantity" + }, + "UnitAmount" : { + "type" : "integer", + "description" : "Budgeted amount" + }, + "Notes" : { + "maxLength" : 255, + "type" : "string", + "description" : "Any footnotes associated with this balance" + } + }, + "description" : "" +}; + defs["BudgetLine"] = { + "title" : "", + "type" : "object", + "properties" : { + "AccountID" : { + "type" : "string", + "description" : "See Accounts", + "format" : "uuid" + }, + "AccountCode" : { + "type" : "string", + "description" : "See Accounts", + "example" : "90.0" + }, + "BudgetBalances" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/BudgetBalance" + } + } + }, + "description" : "", + "externalDocs" : { + "url" : "http://developer.xero.com/documentation/api/budgets/" + } +}; + defs["Budgets"] = { + "title" : "", + "type" : "object", + "properties" : { + "Budgets" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Budget" + } + } + }, + "description" : "", + "x-isObjectArray" : true }; defs["CISOrgSetting"] = { "title" : "", @@ -3370,6 +3479,12 @@ "type" : "string", "description" : "See Accounts" }, + "AccountID" : { + "type" : "string", + "description" : "The associated account ID related to this line item", + "format" : "uuid", + "example" : "00000000-0000-0000-0000-000000000000" + }, "TaxType" : { "type" : "string", "description" : "The tax type from TaxRates" @@ -5005,10 +5120,6 @@ defs["Report"] = { "title" : "", "properties" : { - "ReportID" : { - "type" : "string", - "description" : "See Prepayment Types" - }, "ReportName" : { "type" : "string", "description" : "See Prepayment Types" @@ -5141,7 +5252,7 @@ "properties" : { "ReportID" : { "type" : "string", - "description" : "Report id" + "description" : "ID of the Report" }, "ReportName" : { "type" : "string", @@ -5755,7 +5866,7 @@
@@ -5819,7 +5930,7 @@

-
-
+
+
-

getContact

-

Retrieves a specific contacts in a Xero organisation using a unique contact Id

+

getBudget

+

Retrieves a specific budgets, which includes budget lines

@@ -20439,17 +20556,17 @@

getContact


-
/Contacts/{ContactID}
+
/Budgets/{BudgetID}

Usage and SDK Samples

-
+
# configure api_client for use with xero-python sdk client
 api_client = ApiClient(
     Configuration(
@@ -20463,24 +20580,24 @@ 

Usage and SDK Samples

api_client.set_oauth2_token("YOUR_ACCESS_TOKEN") -def accounting_get_contact(): +def accounting_get_budget(): api_instance = AccountingApi(api_client) xero_tenant_id = 'YOUR_XERO_TENANT_ID' - contact_id = '00000000-0000-0000-0000-000000000000' + budget_id = '00000000-0000-0000-0000-000000000000' try: - api_response = api_instance.get_contact(xero_tenant_id, contact_id) + api_response = api_instance.get_budget(xero_tenant_id, budget_id) print(api_response) except AccountingBadRequestException as e: - print("Exception when calling AccountingApi->getContact: %s\n" % e)
+ print("Exception when calling AccountingApi->getBudget: %s\n" % e)

Scopes

- - + +
accounting.contacts.readGrant read-only access to contacts and contact groupsaccounting.budgets.read
@@ -20491,11 +20608,11 @@

Parameters

Name Description - ContactID* + BudgetID* -
+
@@ -20506,7 +20623,7 @@

Parameters

-Unique identifier for a Contact +Unique identifier for Budgets
@@ -20528,7 +20645,7 @@

Parameters

-
+
@@ -20551,11 +20668,11 @@

Parameters


-
-
+
+
-

getContactAttachmentByFileName

-

Retrieves a specific attachment from a specific contact by file name

+

getBudgets

+

Retrieve a list of budgets

@@ -20563,17 +20680,17 @@

getContactAttachmentByFileName


-
/Contacts/{ContactID}/Attachments/{FileName}
+
/Budgets

Usage and SDK Samples

-
+
# configure api_client for use with xero-python sdk client
 api_client = ApiClient(
     Configuration(
@@ -20587,26 +20704,193 @@ 

Usage and SDK Samples

api_client.set_oauth2_token("YOUR_ACCESS_TOKEN") -def accounting_get_contact_attachment_by_file_name(): +def accounting_get_budgets(): + api_instance = AccountingApi(api_client) + xero_tenant_id = 'YOUR_XERO_TENANT_ID' + ids = ["00000000-0000-0000-0000-000000000000"] + dateTo = dateutil.parser.parse("2013-10-20") + dateFrom = dateutil.parser.parse("2013-10-20") + + try: + api_response = api_instance.get_budgets(xero_tenant_id, ids, dateTo, dateFrom) + print(api_response) + except AccountingBadRequestException as e: + print("Exception when calling AccountingApi->getBudgets: %s\n" % e)
+
+
+

Scopes

+ + + + + + + +
accounting.budgets.read
+

Parameters

+
Header parameters
+ + + + + + + + + +
NameDescription
xero-tenant-id* + + +
+
+
+ + String + + +
+Xero identifier for Tenant +
+
+
+ Required +
+
+
+
+
Query parameters
+ + + + + + + + + + + + + + + + + +
NameDescription
IDs + + +
+
+
+ + array[UUID] + + + (uuid) + + +
+Filter by BudgetID. Allows you to retrieve a specific individual budget. +
+
+
+
+
DateTo + + +
+
+
+ + date + + + (date) + + +
+Filter by start date +
+
+
+
+
DateFrom + + +
+
+
+ + date + + + (date) + + +
+Filter by end date +
+
+
+
+
+
+
+
+
+
+
+

getContact

+

Retrieves a specific contacts in a Xero organisation using a unique contact Id

+
+
+
+

+

+

+
+
/Contacts/{ContactID}
+

+

Usage and SDK Samples

+

+ +
+ +
+
# configure api_client for use with xero-python sdk client
+api_client = ApiClient(
+    Configuration(
+        debug=false,
+        oauth2_token=OAuth2Token(
+            client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET"
+        ),
+    ),
+    pool_threads=1,
+)
+
+api_client.set_oauth2_token("YOUR_ACCESS_TOKEN")
+
+def accounting_get_contact():
     api_instance = AccountingApi(api_client)
     xero_tenant_id = 'YOUR_XERO_TENANT_ID'
     contact_id = '00000000-0000-0000-0000-000000000000'
-    file_name = 'xero-dev.jpg'
-    content_type = 'image/jpg'
     
     try:
-        api_response = api_instance.get_contact_attachment_by_file_name(xero_tenant_id, contact_id, file_name, content_type)
+        api_response = api_instance.get_contact(xero_tenant_id, contact_id)
         print(api_response)
     except AccountingBadRequestException as e:
-        print("Exception when calling AccountingApi->getContactAttachmentByFileName: %s\n" % e)
+ print("Exception when calling AccountingApi->getContact: %s\n" % e)

Scopes

- - + +
accounting.attachments.readGrant read-only access to attachmentsaccounting.contacts.readGrant read-only access to contacts and contact groups
@@ -20621,7 +20905,133 @@

Parameters

-
+
+
+
+ + UUID + + + (uuid) + + +
+Unique identifier for a Contact +
+
+
+ Required +
+
+
+ + + + +
Header parameters
+ + + + + + + + + +
NameDescription
xero-tenant-id* + + +
+
+
+ + String + + +
+Xero identifier for Tenant +
+
+
+ Required +
+
+
+
+
+
+
+
+
+
+

getContactAttachmentByFileName

+

Retrieves a specific attachment from a specific contact by file name

+
+
+
+

+

+

+
+
/Contacts/{ContactID}/Attachments/{FileName}
+

+

Usage and SDK Samples

+

+ +
+ +
+
# configure api_client for use with xero-python sdk client
+api_client = ApiClient(
+    Configuration(
+        debug=false,
+        oauth2_token=OAuth2Token(
+            client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET"
+        ),
+    ),
+    pool_threads=1,
+)
+
+api_client.set_oauth2_token("YOUR_ACCESS_TOKEN")
+
+def accounting_get_contact_attachment_by_file_name():
+    api_instance = AccountingApi(api_client)
+    xero_tenant_id = 'YOUR_XERO_TENANT_ID'
+    contact_id = '00000000-0000-0000-0000-000000000000'
+    file_name = 'xero-dev.jpg'
+    content_type = 'image/jpg'
+    
+    try:
+        api_response = api_instance.get_contact_attachment_by_file_name(xero_tenant_id, contact_id, file_name, content_type)
+        print(api_response)
+    except AccountingBadRequestException as e:
+        print("Exception when calling AccountingApi->getContactAttachmentByFileName: %s\n" % e)
+
+
+

Scopes

+ + + + + + + +
accounting.attachments.readGrant read-only access to attachments
+

Parameters

+
Path parameters
+ + + + + + + - + - +
NameDescription
ContactID* + + +
@@ -21395,7 +21805,7 @@

Parameters

getContactGroups

-

Retrieves the contact Id and name of all the contacts in a contact group

+

Retrieves the contact Id and name of each contact group

@@ -24824,7 +25234,7 @@

Usage and SDK Samples

summary_only = 'true' try: - api_response = api_instance.get_invoices(xero_tenant_id, if_modified_since, where, order, ids, invoice_numbers, contact_ids, statuses, page, include_archived, created_by_my_app, summary_only, unitdp) + api_response = api_instance.get_invoices(xero_tenant_id, if_modified_since, where, order, ids, invoice_numbers, contact_ids, statuses, page, include_archived, created_by_my_app, unitdp, summary_only) print(api_response) except AccountingBadRequestException as e: print("Exception when calling AccountingApi->getInvoices: %s\n" % e) @@ -25085,19 +25495,19 @@

Parameters

summaryOnly
unitdp -
+
- Boolean + Integer
-Use summaryOnly=true in GET Contacts and Invoices endpoint to retrieve a smaller version of the response object. This returns only lightweight fields, excluding computation-heavy fields from the response, making the API calls quick and efficient. +e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
@@ -25105,19 +25515,19 @@

Parameters

unitdp
summaryOnly -
+
- Integer + Boolean
-e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts +Use summaryOnly=true in GET Contacts and Invoices endpoint to retrieve a smaller version of the response object. This returns only lightweight fields, excluding computation-heavy fields from the response, making the API calls quick and efficient.
@@ -33519,11 +33929,11 @@

Parameters


-
-
+
+
-

getReportBASorGST

-

Retrieves a specific report for BAS using a unique report Id (only valid for AU orgs)

+

getReportBalanceSheet

+

Retrieves report for balancesheet

@@ -33531,17 +33941,17 @@

getReportBASorGST


-
/Reports/{ReportID}
+
/Reports/BalanceSheet

Usage and SDK Samples

-
+
# configure api_client for use with xero-python sdk client
 api_client = ApiClient(
     Configuration(
@@ -33555,16 +33965,21 @@ 

Usage and SDK Samples

api_client.set_oauth2_token("YOUR_ACCESS_TOKEN") -def accounting_get_report_ba_sor_gst(): +def accounting_get_report_balance_sheet(): api_instance = AccountingApi(api_client) xero_tenant_id = 'YOUR_XERO_TENANT_ID' - report_id = '00000000-0000-0000-0000-000000000000' + date = dateutil.parser.parse("2019-11-01") + time_frame = 'MONTH' + tracking_option_id_1 = '00000000-0000-0000-0000-000000000000' + tracking_option_id_2 = '00000000-0000-0000-0000-000000000000' + standard_layout = 'true' + payments_only = 'false' try: - api_response = api_instance.get_report_ba_sor_gst(xero_tenant_id, report_id) + api_response = api_instance.get_report_balance_sheet(xero_tenant_id, date, periods, time_frame, tracking_option_id_1, tracking_option_id_2, standard_layout, payments_only) print(api_response) except AccountingBadRequestException as e: - print("Exception when calling AccountingApi->getReportBASorGST: %s\n" % e)
+ print("Exception when calling AccountingApi->getReportBalanceSheet: %s\n" % e)

Scopes

@@ -33577,17 +33992,17 @@

Scopes

Parameters

-
Path parameters
+
Header parameters
- +
Name Description
ReportID*
xero-tenant-id* -
+
@@ -33595,7 +34010,7 @@

Parameters

-Unique identifier for a Report +Xero identifier for Tenant
@@ -33607,17 +34022,60 @@

Parameters

-
Header parameters
+
Query parameters
- + + + + + + + + + + + + + + + + + + + + + + + + + @@ -33640,11 +34175,11 @@

Parameters


-
-
+
+
-

getReportBASorGSTList

-

Retrieves report for BAS (only valid for AU orgs)

+

getReportBankSummary

+

Retrieves report for bank summary

@@ -33652,17 +34187,17 @@

getReportBASorGSTList


-
/Reports
+
/Reports/BankSummary

Usage and SDK Samples

-
+
# configure api_client for use with xero-python sdk client
 api_client = ApiClient(
     Configuration(
@@ -33676,15 +34211,17 @@ 

Usage and SDK Samples

api_client.set_oauth2_token("YOUR_ACCESS_TOKEN") -def accounting_get_report_ba_sor_gst_list(): +def accounting_get_report_bank_summary(): api_instance = AccountingApi(api_client) xero_tenant_id = 'YOUR_XERO_TENANT_ID' + from_date = dateutil.parser.parse("2013-10-20") + to_date = dateutil.parser.parse("2013-10-20") try: - api_response = api_instance.get_report_ba_sor_gst_list(xero_tenant_id) + api_response = api_instance.get_report_bank_summary(xero_tenant_id, from_date, to_date) print(api_response) except AccountingBadRequestException as e: - print("Exception when calling AccountingApi->getReportBASorGSTList: %s\n" % e)
+ print("Exception when calling AccountingApi->getReportBankSummary: %s\n" % e)

Scopes

@@ -33707,7 +34244,7 @@

Parameters

+ + +
Name Description
xero-tenant-id*
date + + +
+
+
+ + date + + + (date) + + +
+The date of the Balance Sheet report +
+
+
+
+
periods + + +
+
+
+ + Integer + + +
+The number of periods for the Balance Sheet report +
+
+
+
+
timeframe -
+
@@ -33625,12 +34083,89 @@

Parameters

-Xero identifier for Tenant +The period size to compare to (MONTH, QUARTER, YEAR) +
+
+
+
+
trackingOptionID1 + + +
+
+
+ + String + + +
+The tracking option 1 for the Balance Sheet report +
+
+
+
+
trackingOptionID2 + + +
+
+
+ + String + + +
+The tracking option 2 for the Balance Sheet report +
+
+
+
+
standardLayout + + +
+
+
+ + Boolean + + +
+The standard layout boolean for the Balance Sheet report +
+
+
+
+
paymentsOnly + + +
+
+
+ + Boolean + + +
+return a cash basis for the Balance Sheet report
-
- Required -
-
+
@@ -33724,17 +34261,70 @@

Parameters

+
Query parameters
+ + + + + + + + + + +
NameDescription
fromDate + + +
+
+
+ + date + + + (date) + + +
+filter by the from date of the report e.g. 2021-02-01 +
+
+
+
+
toDate + + +
+
+
+ + date + + + (date) + + +
+filter by the to date of the report e.g. 2021-02-28 +
+
+
+
+

-
-
+
+
-

getReportBalanceSheet

-

Retrieves report for balancesheet

+

getReportBudgetSummary

+

Retrieves report for budget summary

@@ -33742,17 +34332,17 @@

getReportBalanceSheet


-
/Reports/BalanceSheet
+
/Reports/BudgetSummary

Usage and SDK Samples

-
+
# configure api_client for use with xero-python sdk client
 api_client = ApiClient(
     Configuration(
@@ -33766,21 +34356,16 @@ 

Usage and SDK Samples

api_client.set_oauth2_token("YOUR_ACCESS_TOKEN") -def accounting_get_report_balance_sheet(): +def accounting_get_report_budget_summary(): api_instance = AccountingApi(api_client) xero_tenant_id = 'YOUR_XERO_TENANT_ID' - date = dateutil.parser.parse("2019-11-01") - time_frame = 'MONTH' - tracking_option_id_1 = '00000000-0000-0000-0000-000000000000' - tracking_option_id_2 = '00000000-0000-0000-0000-000000000000' - standard_layout = 'true' - payments_only = 'false' + date = dateutil.parser.parse("2019-03-31") try: - api_response = api_instance.get_report_balance_sheet(xero_tenant_id, date, periods, time_frame, tracking_option_id_1, tracking_option_id_2, standard_layout, payments_only) + api_response = api_instance.get_report_budget_summary(xero_tenant_id, date, periods, time_frame) print(api_response) except AccountingBadRequestException as e: - print("Exception when calling AccountingApi->getReportBalanceSheet: %s\n" % e)
+ print("Exception when calling AccountingApi->getReportBudgetSummary: %s\n" % e)

Scopes

@@ -33803,7 +34388,7 @@

Parameters

-
+
@@ -33833,7 +34418,7 @@

Parameters

-
+
@@ -33844,7 +34429,7 @@

Parameters

-The date of the Balance Sheet report +The date for the Bank Summary report e.g. 2018-03-31
@@ -33856,7 +34441,7 @@

Parameters

-
+
@@ -33864,7 +34449,7 @@

Parameters

-The number of periods for the Balance Sheet report +The number of periods to compare (integer between 1 and 12)
@@ -33876,95 +34461,15 @@

Parameters

-
-
-
- - String - - -
-The period size to compare to (MONTH, QUARTER, YEAR) -
-
-
-
- - - - trackingOptionID1 - - - -
-
-
- - String - - -
-The tracking option 1 for the Balance Sheet report -
-
-
-
- - - - trackingOptionID2 - - - -
-
-
- - String - - -
-The tracking option 2 for the Balance Sheet report -
-
-
-
- - - - standardLayout - - - -
-
-
- - Boolean - - -
-The standard layout boolean for the Balance Sheet report -
-
-
-
- - - - paymentsOnly - - - -
+
- Boolean + Integer
-return a cash basis for the Balance Sheet report +The period size to compare to (1=month, 3=quarter, 12=year)
@@ -33976,11 +34481,11 @@

Parameters


-
-
+
+
-

getReportBankSummary

-

Retrieves report for bank summary

+

getReportExecutiveSummary

+

Retrieves report for executive summary

@@ -33988,17 +34493,17 @@

getReportBankSummary


-
/Reports/BankSummary
+
/Reports/ExecutiveSummary

Usage and SDK Samples

-
+
# configure api_client for use with xero-python sdk client
 api_client = ApiClient(
     Configuration(
@@ -34012,17 +34517,16 @@ 

Usage and SDK Samples

api_client.set_oauth2_token("YOUR_ACCESS_TOKEN") -def accounting_get_report_bank_summary(): +def accounting_get_report_executive_summary(): api_instance = AccountingApi(api_client) xero_tenant_id = 'YOUR_XERO_TENANT_ID' - from_date = dateutil.parser.parse("2013-10-20") - to_date = dateutil.parser.parse("2013-10-20") + date = dateutil.parser.parse("2019-03-31") try: - api_response = api_instance.get_report_bank_summary(xero_tenant_id, from_date, to_date) + api_response = api_instance.get_report_executive_summary(xero_tenant_id, date) print(api_response) except AccountingBadRequestException as e: - print("Exception when calling AccountingApi->getReportBankSummary: %s\n" % e)
+ print("Exception when calling AccountingApi->getReportExecutiveSummary: %s\n" % e)

Scopes

@@ -34045,7 +34549,7 @@

Parameters

-
+
@@ -34071,34 +34575,11 @@

Parameters

Name Description - fromDate - - - -
-
-
- - date - - - (date) - - -
-filter by the from date of the report e.g. 2021-02-01 -
-
-
-
- - - - toDate + date -
+
@@ -34109,7 +34590,7 @@

Parameters

-filter by the to date of the report e.g. 2021-02-28 +The date for the Bank Summary report e.g. 2018-03-31
@@ -34121,11 +34602,11 @@

Parameters


-
-
+
+
-

getReportBudgetSummary

-

Retrieves report for budget summary

+

getReportFromId

+

Retrieves a specific report using a unique ReportID

@@ -34133,17 +34614,17 @@

getReportBudgetSummary


-
/Reports/BudgetSummary
+
/Reports/{ReportID}

Usage and SDK Samples

-
+
# configure api_client for use with xero-python sdk client
 api_client = ApiClient(
     Configuration(
@@ -34157,16 +34638,16 @@ 

Usage and SDK Samples

api_client.set_oauth2_token("YOUR_ACCESS_TOKEN") -def accounting_get_report_budget_summary(): +def accounting_get_report_from_id(): api_instance = AccountingApi(api_client) xero_tenant_id = 'YOUR_XERO_TENANT_ID' - date = dateutil.parser.parse("2019-03-31") + report_id = '00000000-0000-0000-0000-000000000000' try: - api_response = api_instance.get_report_budget_summary(xero_tenant_id, date, period, time_frame) + api_response = api_instance.get_report_from_id(xero_tenant_id, report_id) print(api_response) except AccountingBadRequestException as e: - print("Exception when calling AccountingApi->getReportBudgetSummary: %s\n" % e)
+ print("Exception when calling AccountingApi->getReportFromId: %s\n" % e)

Scopes

@@ -34179,17 +34660,17 @@

Scopes

Parameters

-
Header parameters
+
Path parameters
- +
Name Description
xero-tenant-id*
ReportID* -
+
@@ -34197,7 +34678,7 @@

Parameters

-Xero identifier for Tenant +Unique identifier for a Report
@@ -34209,137 +34690,6 @@

Parameters

-
Query parameters
- - - - - - - - - - - - - - - - - -
NameDescription
date - - -
-
-
- - date - - - (date) - - -
-The date for the Bank Summary report e.g. 2018-03-31 -
-
-
-
-
period - - -
-
-
- - Integer - - -
-The number of periods to compare (integer between 1 and 12) -
-
-
-
-
timeframe - - -
-
-
- - Integer - - -
-The period size to compare to (1=month, 3=quarter, 12=year) -
-
-
-
-
-
-
-
-
-
-
-

getReportExecutiveSummary

-

Retrieves report for executive summary

-
-
-
-

-

-

-
-
/Reports/ExecutiveSummary
-

-

Usage and SDK Samples

-

- -
- -
-
# configure api_client for use with xero-python sdk client
-api_client = ApiClient(
-    Configuration(
-        debug=false,
-        oauth2_token=OAuth2Token(
-            client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET"
-        ),
-    ),
-    pool_threads=1,
-)
-
-api_client.set_oauth2_token("YOUR_ACCESS_TOKEN")
-
-def accounting_get_report_executive_summary():
-    api_instance = AccountingApi(api_client)
-    xero_tenant_id = 'YOUR_XERO_TENANT_ID'
-    date = dateutil.parser.parse("2019-03-31")
-    
-    try:
-        api_response = api_instance.get_report_executive_summary(xero_tenant_id, date)
-        print(api_response)
-    except AccountingBadRequestException as e:
-        print("Exception when calling AccountingApi->getReportExecutiveSummary: %s\n" % e)
-
-
-

Scopes

- - - - - - - -
accounting.reports.readGrant read-only access to accounting reports
-

Parameters

Header parameters
@@ -34350,7 +34700,7 @@

Parameters

- - -
-
+
@@ -34367,36 +34717,6 @@

Parameters

-
Query parameters
- - - - - - -
NameDescription
date - - -
-
-
- - date - - - (date) - - -
-The date for the Bank Summary report e.g. 2018-03-31 -
-
-
-
-
@@ -34969,6 +35289,96 @@

Parameters

+ + + +
+
+
+
+
+
+

getReportsList

+

Retrieves a list of the organistaions unique reports that require a uuid to fetch

+
+
+
+

+

+

+
+
/Reports
+

+

Usage and SDK Samples

+

+ +
+ +
+
# configure api_client for use with xero-python sdk client
+api_client = ApiClient(
+    Configuration(
+        debug=false,
+        oauth2_token=OAuth2Token(
+            client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET"
+        ),
+    ),
+    pool_threads=1,
+)
+
+api_client.set_oauth2_token("YOUR_ACCESS_TOKEN")
+
+def accounting_get_reports_list():
+    api_instance = AccountingApi(api_client)
+    xero_tenant_id = 'YOUR_XERO_TENANT_ID'
+    
+    try:
+        api_response = api_instance.get_reports_list(xero_tenant_id)
+        print(api_response)
+    except AccountingBadRequestException as e:
+        print("Exception when calling AccountingApi->getReportsList: %s\n" % e)
+
+
+

Scopes

+ + + + + + + +
accounting.reports.readGrant read-only access to accounting reports
+

Parameters

+
Header parameters
+ + + + + + +
NameDescription
xero-tenant-id* + + +
+
+
+ + String + + +
+Xero identifier for Tenant +
+
+
+ Required +
+
+
+
diff --git a/setup.py b/setup.py index 8e711b9c..a6f702d9 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.6.0", + version="1.8.0b2", ) diff --git a/xero_python/__init__.py b/xero_python/__init__.py index ed1f454e..8c84affe 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.6.0" +__version__ = "1.8.0b2" diff --git a/xero_python/accounting/__init__.py b/xero_python/accounting/__init__.py index 59ae9915..4fcc0c14 100644 --- a/xero_python/accounting/__init__.py +++ b/xero_python/accounting/__init__.py @@ -44,6 +44,10 @@ from xero_python.accounting.models.bill import Bill from xero_python.accounting.models.branding_theme import BrandingTheme from xero_python.accounting.models.branding_themes import BrandingThemes +from xero_python.accounting.models.budget import Budget +from xero_python.accounting.models.budget_balance import BudgetBalance +from xero_python.accounting.models.budget_line import BudgetLine +from xero_python.accounting.models.budgets import Budgets from xero_python.accounting.models.cis_org_setting import CISOrgSetting from xero_python.accounting.models.cis_org_settings import CISOrgSettings from xero_python.accounting.models.cis_setting import CISSetting diff --git a/xero_python/accounting/api/accounting_api.py b/xero_python/accounting/api/accounting_api.py index 2ed48e93..cd6dccca 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.12.0 + OpenAPI spec version: 2.13.4 """ import importlib @@ -7555,6 +7555,165 @@ def get_branding_themes( except exceptions.HTTPStatusException as error: raise translate_status_exception(error, self, "get_branding_themes") + def get_budget( + self, + xero_tenant_id, + budget_id, + _return_http_data_only=True, + _preload_content=True, + _request_timeout=None, + ): + """Retrieves a specific budgets, which includes budget lines # noqa: E501 + OAuth2 scope: accounting.budgets.read + :param str xero_tenant_id: Xero identifier for Tenant (required) + :param str budget_id: Unique identifier for Budgets (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: Budgets + """ + + # 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_budget`" + ) + # verify the required parameter 'budget_id' is set + if budget_id is None: + raise ValueError( + "Missing the required parameter `budget_id` " + "when calling `get_budget`" + ) + + collection_formats = {} + path_params = { + "BudgetID": budget_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("/Budgets/{BudgetID}") + + 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="Budgets", + 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_budget") + + def get_budgets( + self, + xero_tenant_id, + i_ds=empty, + date_to=empty, + date_from=empty, + _return_http_data_only=True, + _preload_content=True, + _request_timeout=None, + ): + """Retrieve a list of budgets # noqa: E501 + OAuth2 scope: accounting.budgets.read + :param str xero_tenant_id: Xero identifier for Tenant (required) + :param list[str] i_ds: Filter by BudgetID. Allows you to retrieve a specific individual budget. + :param date date_to: Filter by start date + :param date date_from: Filter by end date + :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: Budgets + """ + + # 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_budgets`" + ) + + collection_formats = { + "IDs": "csv", + } + path_params = {} + + query_params = [] + + if i_ds is not empty: + query_params.append(("IDs", i_ds)) + + if date_to is not empty: + query_params.append(("DateTo", date_to)) + + if date_from is not empty: + query_params.append(("DateFrom", date_from)) + + 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("/Budgets") + + 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="Budgets", + 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_budgets") + def get_contact( self, xero_tenant_id, @@ -8138,7 +8297,7 @@ def get_contact_groups( _preload_content=True, _request_timeout=None, ): - """Retrieves the contact Id and name of all the contacts in a contact group # noqa: E501 + """Retrieves the contact Id and name of each contact group # noqa: E501 OAuth2 scope: accounting.contacts.read :param str xero_tenant_id: Xero identifier for Tenant (required) :param str where: Filter by an any element @@ -10026,8 +10185,8 @@ def get_invoices( page=empty, include_archived=empty, created_by_my_app=empty, - summary_only=empty, unitdp=empty, + summary_only=empty, _return_http_data_only=True, _preload_content=True, _request_timeout=None, @@ -10045,8 +10204,8 @@ def get_invoices( :param int page: e.g. page=1 – Up to 100 invoices will be returned in a single API call with line items shown for each invoice :param bool include_archived: e.g. includeArchived=true - Invoices with a status of ARCHIVED will be included in the response :param bool created_by_my_app: When set to true you'll only retrieve Invoices created by your app - :param bool summary_only: Use summaryOnly=true in GET Contacts and Invoices endpoint to retrieve a smaller version of the response object. This returns only lightweight fields, excluding computation-heavy fields from the response, making the API calls quick and efficient. :param int unitdp: e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + :param bool summary_only: Use summaryOnly=true in GET Contacts and Invoices endpoint to retrieve a smaller version of the response object. This returns only lightweight fields, excluding computation-heavy fields from the response, making the API calls quick and efficient. :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 @@ -10097,12 +10256,12 @@ def get_invoices( if created_by_my_app is not empty: query_params.append(("createdByMyApp", created_by_my_app)) - if summary_only is not empty: - query_params.append(("summaryOnly", summary_only)) - if unitdp is not empty: query_params.append(("unitdp", unitdp)) + if summary_only is not empty: + query_params.append(("summaryOnly", summary_only)) + header_params = { "xero-tenant-id": xero_tenant_id, } @@ -14791,148 +14950,6 @@ def get_report_aged_receivables_by_contact( error, self, "get_report_aged_receivables_by_contact" ) - def get_report_ba_sor_gst( - self, - xero_tenant_id, - report_id, - _return_http_data_only=True, - _preload_content=True, - _request_timeout=None, - ): - """Retrieves a specific report for BAS using a unique report Id (only valid for AU orgs) # noqa: E501 - OAuth2 scope: accounting.reports.read - :param str xero_tenant_id: Xero identifier for Tenant (required) - :param str report_id: Unique identifier for a Report (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: ReportWithRows - """ - - # 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_report_ba_sor_gst`" - ) - # verify the required parameter 'report_id' is set - if report_id is None: - raise ValueError( - "Missing the required parameter `report_id` " - "when calling `get_report_ba_sor_gst`" - ) - - collection_formats = {} - path_params = { - "ReportID": report_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("/Reports/{ReportID}") - - 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="ReportWithRows", - 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_report_ba_sor_gst") - - def get_report_ba_sor_gst_list( - self, - xero_tenant_id, - _return_http_data_only=True, - _preload_content=True, - _request_timeout=None, - ): - """Retrieves report for BAS (only valid for AU orgs) # noqa: E501 - OAuth2 scope: accounting.reports.read - :param str xero_tenant_id: Xero identifier for Tenant (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: ReportWithRows - """ - - # 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_report_ba_sor_gst_list`" - ) - - collection_formats = {} - path_params = {} - - 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("/Reports") - - 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="ReportWithRows", - 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_report_ba_sor_gst_list") - def get_report_balance_sheet( self, xero_tenant_id, @@ -15114,7 +15131,7 @@ def get_report_budget_summary( self, xero_tenant_id, date=empty, - period=empty, + periods=empty, timeframe=empty, _return_http_data_only=True, _preload_content=True, @@ -15124,7 +15141,7 @@ def get_report_budget_summary( OAuth2 scope: accounting.reports.read :param str xero_tenant_id: Xero identifier for Tenant (required) :param date date: The date for the Bank Summary report e.g. 2018-03-31 - :param int period: The number of periods to compare (integer between 1 and 12) + :param int periods: The number of periods to compare (integer between 1 and 12) :param int timeframe: The period size to compare to (1=month, 3=quarter, 12=year) :param bool _return_http_data_only: return received data only :param bool _preload_content: load received data in models @@ -15147,8 +15164,8 @@ def get_report_budget_summary( if date is not empty: query_params.append(("date", date)) - if period is not empty: - query_params.append(("period", period)) + if periods is not empty: + query_params.append(("periods", periods)) if timeframe is not empty: query_params.append(("timeframe", timeframe)) @@ -15264,6 +15281,82 @@ def get_report_executive_summary( error, self, "get_report_executive_summary" ) + def get_report_from_id( + self, + xero_tenant_id, + report_id, + _return_http_data_only=True, + _preload_content=True, + _request_timeout=None, + ): + """Retrieves a specific report using a unique ReportID # noqa: E501 + OAuth2 scope: accounting.reports.read + :param str xero_tenant_id: Xero identifier for Tenant (required) + :param str report_id: Unique identifier for a Report (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: ReportWithRows + """ + + # 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_report_from_id`" + ) + # verify the required parameter 'report_id' is set + if report_id is None: + raise ValueError( + "Missing the required parameter `report_id` " + "when calling `get_report_from_id`" + ) + + collection_formats = {} + path_params = { + "ReportID": report_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("/Reports/{ReportID}") + + 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="ReportWithRows", + 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_report_from_id") + def get_report_profit_and_loss( self, xero_tenant_id, @@ -15527,6 +15620,72 @@ def get_report_trial_balance( except exceptions.HTTPStatusException as error: raise translate_status_exception(error, self, "get_report_trial_balance") + def get_reports_list( + self, + xero_tenant_id, + _return_http_data_only=True, + _preload_content=True, + _request_timeout=None, + ): + """Retrieves a list of the organistaions unique reports that require a uuid to fetch # noqa: E501 + OAuth2 scope: accounting.reports.read + :param str xero_tenant_id: Xero identifier for Tenant (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: ReportWithRows + """ + + # 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_reports_list`" + ) + + collection_formats = {} + path_params = {} + + 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("/Reports") + + 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="ReportWithRows", + 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_reports_list") + def get_tax_rates( self, xero_tenant_id, diff --git a/xero_python/accounting/docs/AccountingApi.md b/xero_python/accounting/docs/AccountingApi.md index 7c2f3eb7..dbe08668 100644 --- a/xero_python/accounting/docs/AccountingApi.md +++ b/xero_python/accounting/docs/AccountingApi.md @@ -90,6 +90,8 @@ Method | HTTP request | Description [**get_branding_theme**](AccountingApi.md#get_branding_theme) | **GET** /BrandingThemes/{BrandingThemeID} | Retrieves a specific branding theme using a unique branding theme Id [**get_branding_theme_payment_services**](AccountingApi.md#get_branding_theme_payment_services) | **GET** /BrandingThemes/{BrandingThemeID}/PaymentServices | Retrieves the payment services for a specific branding theme [**get_branding_themes**](AccountingApi.md#get_branding_themes) | **GET** /BrandingThemes | Retrieves all the branding themes +[**get_budget**](AccountingApi.md#get_budget) | **GET** /Budgets/{BudgetID} | Retrieves a specific budgets, which includes budget lines +[**get_budgets**](AccountingApi.md#get_budgets) | **GET** /Budgets | Retrieve a list of budgets [**get_contact**](AccountingApi.md#get_contact) | **GET** /Contacts/{ContactID} | Retrieves a specific contacts in a Xero organisation using a unique contact Id [**get_contact_attachment_by_file_name**](AccountingApi.md#get_contact_attachment_by_file_name) | **GET** /Contacts/{ContactID}/Attachments/{FileName} | Retrieves a specific attachment from a specific contact by file name [**get_contact_attachment_by_id**](AccountingApi.md#get_contact_attachment_by_id) | **GET** /Contacts/{ContactID}/Attachments/{AttachmentID} | Retrieves a specific attachment from a specific contact using a unique attachment Id @@ -97,7 +99,7 @@ Method | HTTP request | Description [**get_contact_by_contact_number**](AccountingApi.md#get_contact_by_contact_number) | **GET** /Contacts/{ContactNumber} | Retrieves a specific contact by contact number in a Xero organisation [**get_contact_cis_settings**](AccountingApi.md#get_contact_cis_settings) | **GET** /Contacts/{ContactID}/CISSettings | Retrieves CIS settings for a specific contact in a Xero organisation [**get_contact_group**](AccountingApi.md#get_contact_group) | **GET** /ContactGroups/{ContactGroupID} | Retrieves a specific contact group by using a unique contact group Id -[**get_contact_groups**](AccountingApi.md#get_contact_groups) | **GET** /ContactGroups | Retrieves the contact Id and name of all the contacts in a contact group +[**get_contact_groups**](AccountingApi.md#get_contact_groups) | **GET** /ContactGroups | Retrieves the contact Id and name of each contact group [**get_contact_history**](AccountingApi.md#get_contact_history) | **GET** /Contacts/{ContactID}/History | Retrieves history records for a specific contact [**get_contacts**](AccountingApi.md#get_contacts) | **GET** /Contacts | Retrieves all contacts in a Xero organisation [**get_credit_note**](AccountingApi.md#get_credit_note) | **GET** /CreditNotes/{CreditNoteID} | Retrieves a specific credit note using a unique credit note Id @@ -177,15 +179,15 @@ Method | HTTP request | Description [**get_repeating_invoices**](AccountingApi.md#get_repeating_invoices) | **GET** /RepeatingInvoices | Retrieves repeating invoices [**get_report_aged_payables_by_contact**](AccountingApi.md#get_report_aged_payables_by_contact) | **GET** /Reports/AgedPayablesByContact | Retrieves report for aged payables by contact [**get_report_aged_receivables_by_contact**](AccountingApi.md#get_report_aged_receivables_by_contact) | **GET** /Reports/AgedReceivablesByContact | Retrieves report for aged receivables by contact -[**get_report_ba_sor_gst**](AccountingApi.md#get_report_ba_sor_gst) | **GET** /Reports/{ReportID} | Retrieves a specific report for BAS using a unique report Id (only valid for AU orgs) -[**get_report_ba_sor_gst_list**](AccountingApi.md#get_report_ba_sor_gst_list) | **GET** /Reports | Retrieves report for BAS (only valid for AU orgs) [**get_report_balance_sheet**](AccountingApi.md#get_report_balance_sheet) | **GET** /Reports/BalanceSheet | Retrieves report for balancesheet [**get_report_bank_summary**](AccountingApi.md#get_report_bank_summary) | **GET** /Reports/BankSummary | Retrieves report for bank summary [**get_report_budget_summary**](AccountingApi.md#get_report_budget_summary) | **GET** /Reports/BudgetSummary | Retrieves report for budget summary [**get_report_executive_summary**](AccountingApi.md#get_report_executive_summary) | **GET** /Reports/ExecutiveSummary | Retrieves report for executive summary +[**get_report_from_id**](AccountingApi.md#get_report_from_id) | **GET** /Reports/{ReportID} | Retrieves a specific report using a unique ReportID [**get_report_profit_and_loss**](AccountingApi.md#get_report_profit_and_loss) | **GET** /Reports/ProfitAndLoss | Retrieves report for profit and loss [**get_report_ten_ninety_nine**](AccountingApi.md#get_report_ten_ninety_nine) | **GET** /Reports/TenNinetyNine | Retrieve reports for 1099 [**get_report_trial_balance**](AccountingApi.md#get_report_trial_balance) | **GET** /Reports/TrialBalance | Retrieves report for trial balance +[**get_reports_list**](AccountingApi.md#get_reports_list) | **GET** /Reports | Retrieves a list of the organistaions unique reports that require a uuid to fetch [**get_tax_rates**](AccountingApi.md#get_tax_rates) | **GET** /TaxRates | Retrieves tax rates [**get_tracking_categories**](AccountingApi.md#get_tracking_categories) | **GET** /TrackingCategories | Retrieves tracking categories and options [**get_tracking_category**](AccountingApi.md#get_tracking_category) | **GET** /TrackingCategories/{TrackingCategoryID} | Retrieves specific tracking categories and options using a unique tracking category Id @@ -916,7 +918,7 @@ api_instance = AccountingApi(api_client) xero_tenant_id = 'YOUR_XERO_TENANT_ID' # str | Xero identifier for Tenant branding_theme_id = '00000000-0000-0000-0000-000000000000' # str | Unique identifier for a Branding Theme -payment_service = { "PaymentServiceID": "00000000-0000-0000-0000-000000000000", "PaymentServiceName": "ACME Payments", "PaymentServiceUrl": "https://www.payupnow.com/", "PayNowText": "Pay Now" } # PaymentService | PaymentService object in body of request +payment_service = { "PaymentServiceID": "00000000-0000-0000-0000-000000000000", "PaymentServiceName": "Payments Service", "PaymentServiceUrl": "https://www.paymentservice.com/", "PayNowText": "Pay Now" } # PaymentService | PaymentService object in body of request try: # Creates a new custom payment service for a specific branding theme api_response = api_instance.create_branding_theme_payment_services(xero_tenant_id, branding_theme_id, payment_service) @@ -5823,6 +5825,136 @@ 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_budget** +> Budgets get_budget(xero_tenant_id, budget_id) + +Retrieves a specific budgets, which includes budget lines + +### 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 +budget_id = '00000000-0000-0000-0000-000000000000' # str | Unique identifier for Budgets +try: + # Retrieves a specific budgets, which includes budget lines + api_response = api_instance.get_budget(xero_tenant_id, budget_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling AccountingApi->get_budget: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **str**| Xero identifier for Tenant | + **budget_id** | [**str**](.md)| Unique identifier for Budgets | + +### Return type + +[**Budgets**](Budgets.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_budgets** +> Budgets get_budgets(xero_tenant_id, i_ds=i_ds, date_to=date_to, date_from=date_from) + +Retrieve a list of budgets + +### 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 +i_ds = ['"00000000-0000-0000-0000-000000000000"'] # list[str] | Filter by BudgetID. Allows you to retrieve a specific individual budget. (optional) +date_to = '2013-10-20' # date | Filter by start date (optional) +date_from = '2013-10-20' # date | Filter by end date (optional) +try: + # Retrieve a list of budgets + api_response = api_instance.get_budgets(xero_tenant_id, i_ds=i_ds, date_to=date_to, date_from=date_from) + pprint(api_response) +except ApiException as e: + print("Exception when calling AccountingApi->get_budgets: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **str**| Xero identifier for Tenant | + **i_ds** | [**list[str]**](str.md)| Filter by BudgetID. Allows you to retrieve a specific individual budget. | [optional] + **date_to** | **date**| Filter by start date | [optional] + **date_from** | **date**| Filter by end date | [optional] + +### Return type + +[**Budgets**](Budgets.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_contact** > Contacts get_contact(xero_tenant_id, contact_id) @@ -6275,7 +6407,7 @@ Name | Type | Description | Notes # **get_contact_groups** > ContactGroups get_contact_groups(xero_tenant_id, where=where, order=order) -Retrieves the contact Id and name of all the contacts in a contact group +Retrieves the contact Id and name of each contact group ### Example @@ -6307,7 +6439,7 @@ xero_tenant_id = 'YOUR_XERO_TENANT_ID' # str | Xero identifier for Tenant where = 'Status==\"ACTIVE\"' # str | Filter by an any element (optional) order = 'Name ASC' # str | Order by an any element (optional) try: - # Retrieves the contact Id and name of all the contacts in a contact group + # Retrieves the contact Id and name of each contact group api_response = api_instance.get_contact_groups(xero_tenant_id, where=where, order=order) pprint(api_response) except ApiException as e: @@ -7772,7 +7904,7 @@ 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_invoices** -> Invoices get_invoices(xero_tenant_id, if_modified_since=if_modified_since, where=where, order=order, i_ds=i_ds, invoice_numbers=invoice_numbers, contact_i_ds=contact_i_ds, statuses=statuses, page=page, include_archived=include_archived, created_by_my_app=created_by_my_app, summary_only=summary_only, unitdp=unitdp) +> Invoices get_invoices(xero_tenant_id, if_modified_since=if_modified_since, where=where, order=order, i_ds=i_ds, invoice_numbers=invoice_numbers, contact_i_ds=contact_i_ds, statuses=statuses, page=page, include_archived=include_archived, created_by_my_app=created_by_my_app, unitdp=unitdp, summary_only=summary_only) Retrieves sales invoices or purchase bills @@ -7813,11 +7945,11 @@ statuses = ['"DRAFT", "SUBMITTED"'] # list[str] | Filter by page = 1 # int | e.g. page=1 – Up to 100 invoices will be returned in a single API call with line items shown for each invoice (optional) include_archived = True # bool | e.g. includeArchived=true - Invoices with a status of ARCHIVED will be included in the response (optional) created_by_my_app = false # bool | When set to true you'll only retrieve Invoices created by your app (optional) -summary_only = False # bool | Use summaryOnly=true in GET Contacts and Invoices endpoint to retrieve a smaller version of the response object. This returns only lightweight fields, excluding computation-heavy fields from the response, making the API calls quick and efficient. (optional) (default to False) unitdp = 4 # int | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) +summary_only = False # bool | Use summaryOnly=true in GET Contacts and Invoices endpoint to retrieve a smaller version of the response object. This returns only lightweight fields, excluding computation-heavy fields from the response, making the API calls quick and efficient. (optional) (default to False) try: # Retrieves sales invoices or purchase bills - api_response = api_instance.get_invoices(xero_tenant_id, if_modified_since=if_modified_since, where=where, order=order, i_ds=i_ds, invoice_numbers=invoice_numbers, contact_i_ds=contact_i_ds, statuses=statuses, page=page, include_archived=include_archived, created_by_my_app=created_by_my_app, summary_only=summary_only, unitdp=unitdp) + api_response = api_instance.get_invoices(xero_tenant_id, if_modified_since=if_modified_since, where=where, order=order, i_ds=i_ds, invoice_numbers=invoice_numbers, contact_i_ds=contact_i_ds, statuses=statuses, page=page, include_archived=include_archived, created_by_my_app=created_by_my_app, unitdp=unitdp, summary_only=summary_only) pprint(api_response) except ApiException as e: print("Exception when calling AccountingApi->get_invoices: %s\n" % e) @@ -7838,8 +7970,8 @@ Name | Type | Description | Notes **page** | **int**| e.g. page=1 – Up to 100 invoices will be returned in a single API call with line items shown for each invoice | [optional] **include_archived** | **bool**| e.g. includeArchived=true - Invoices with a status of ARCHIVED will be included in the response | [optional] **created_by_my_app** | **bool**| When set to true you'll only retrieve Invoices created by your app | [optional] - **summary_only** | **bool**| Use summaryOnly=true in GET Contacts and Invoices endpoint to retrieve a smaller version of the response object. This returns only lightweight fields, excluding computation-heavy fields from the response, making the API calls quick and efficient. | [optional] [default to False] **unitdp** | **int**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] + **summary_only** | **bool**| Use summaryOnly=true in GET Contacts and Invoices endpoint to retrieve a smaller version of the response object. This returns only lightweight fields, excluding computation-heavy fields from the response, making the API calls quick and efficient. | [optional] [default to False] ### Return type @@ -11518,10 +11650,10 @@ 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_report_ba_sor_gst** -> ReportWithRows get_report_ba_sor_gst(xero_tenant_id, report_id) +# **get_report_balance_sheet** +> ReportWithRows get_report_balance_sheet(xero_tenant_id, date=date, periods=periods, timeframe=timeframe, tracking_option_id1=tracking_option_id1, tracking_option_id2=tracking_option_id2, standard_layout=standard_layout, payments_only=payments_only) -Retrieves a specific report for BAS using a unique report Id (only valid for AU orgs) +Retrieves report for balancesheet ### Example @@ -11550,13 +11682,19 @@ api_client = ApiClient( api_instance = AccountingApi(api_client) xero_tenant_id = 'YOUR_XERO_TENANT_ID' # str | Xero identifier for Tenant -report_id = '00000000-0000-0000-0000-000000000000' # str | Unique identifier for a Report +date = '2019-11-01' # date | The date of the Balance Sheet report (optional) +periods = 3 # int | The number of periods for the Balance Sheet report (optional) +timeframe = 'MONTH' # str | The period size to compare to (MONTH, QUARTER, YEAR) (optional) +tracking_option_id1 = '00000000-0000-0000-0000-000000000000' # str | The tracking option 1 for the Balance Sheet report (optional) +tracking_option_id2 = '00000000-0000-0000-0000-000000000000' # str | The tracking option 2 for the Balance Sheet report (optional) +standard_layout = true # bool | The standard layout boolean for the Balance Sheet report (optional) +payments_only = false # bool | return a cash basis for the Balance Sheet report (optional) try: - # Retrieves a specific report for BAS using a unique report Id (only valid for AU orgs) - api_response = api_instance.get_report_ba_sor_gst(xero_tenant_id, report_id) + # Retrieves report for balancesheet + api_response = api_instance.get_report_balance_sheet(xero_tenant_id, date=date, periods=periods, timeframe=timeframe, tracking_option_id1=tracking_option_id1, tracking_option_id2=tracking_option_id2, standard_layout=standard_layout, payments_only=payments_only) pprint(api_response) except ApiException as e: - print("Exception when calling AccountingApi->get_report_ba_sor_gst: %s\n" % e) + print("Exception when calling AccountingApi->get_report_balance_sheet: %s\n" % e) ``` ### Parameters @@ -11564,7 +11702,13 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **xero_tenant_id** | **str**| Xero identifier for Tenant | - **report_id** | **str**| Unique identifier for a Report | + **date** | **date**| The date of the Balance Sheet report | [optional] + **periods** | **int**| The number of periods for the Balance Sheet report | [optional] + **timeframe** | **str**| The period size to compare to (MONTH, QUARTER, YEAR) | [optional] + **tracking_option_id1** | **str**| The tracking option 1 for the Balance Sheet report | [optional] + **tracking_option_id2** | **str**| The tracking option 2 for the Balance Sheet report | [optional] + **standard_layout** | **bool**| The standard layout boolean for the Balance Sheet report | [optional] + **payments_only** | **bool**| return a cash basis for the Balance Sheet report | [optional] ### Return type @@ -11581,10 +11725,10 @@ 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_report_ba_sor_gst_list** -> ReportWithRows get_report_ba_sor_gst_list(xero_tenant_id) +# **get_report_bank_summary** +> ReportWithRows get_report_bank_summary(xero_tenant_id, from_date=from_date, to_date=to_date) -Retrieves report for BAS (only valid for AU orgs) +Retrieves report for bank summary ### Example @@ -11613,12 +11757,14 @@ api_client = ApiClient( api_instance = AccountingApi(api_client) xero_tenant_id = 'YOUR_XERO_TENANT_ID' # str | Xero identifier for Tenant +from_date = '2013-10-20' # date | filter by the from date of the report e.g. 2021-02-01 (optional) +to_date = '2013-10-20' # date | filter by the to date of the report e.g. 2021-02-28 (optional) try: - # Retrieves report for BAS (only valid for AU orgs) - api_response = api_instance.get_report_ba_sor_gst_list(xero_tenant_id) + # Retrieves report for bank summary + api_response = api_instance.get_report_bank_summary(xero_tenant_id, from_date=from_date, to_date=to_date) pprint(api_response) except ApiException as e: - print("Exception when calling AccountingApi->get_report_ba_sor_gst_list: %s\n" % e) + print("Exception when calling AccountingApi->get_report_bank_summary: %s\n" % e) ``` ### Parameters @@ -11626,6 +11772,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **xero_tenant_id** | **str**| Xero identifier for Tenant | + **from_date** | **date**| filter by the from date of the report e.g. 2021-02-01 | [optional] + **to_date** | **date**| filter by the to date of the report e.g. 2021-02-28 | [optional] ### Return type @@ -11642,10 +11790,10 @@ 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_report_balance_sheet** -> ReportWithRows get_report_balance_sheet(xero_tenant_id, date=date, periods=periods, timeframe=timeframe, tracking_option_id1=tracking_option_id1, tracking_option_id2=tracking_option_id2, standard_layout=standard_layout, payments_only=payments_only) +# **get_report_budget_summary** +> ReportWithRows get_report_budget_summary(xero_tenant_id, date=date, periods=periods, timeframe=timeframe) -Retrieves report for balancesheet +Retrieves report for budget summary ### Example @@ -11674,19 +11822,15 @@ api_client = ApiClient( api_instance = AccountingApi(api_client) xero_tenant_id = 'YOUR_XERO_TENANT_ID' # str | Xero identifier for Tenant -date = '2019-11-01' # date | The date of the Balance Sheet report (optional) -periods = 3 # int | The number of periods for the Balance Sheet report (optional) -timeframe = 'MONTH' # str | The period size to compare to (MONTH, QUARTER, YEAR) (optional) -tracking_option_id1 = '00000000-0000-0000-0000-000000000000' # str | The tracking option 1 for the Balance Sheet report (optional) -tracking_option_id2 = '00000000-0000-0000-0000-000000000000' # str | The tracking option 2 for the Balance Sheet report (optional) -standard_layout = true # bool | The standard layout boolean for the Balance Sheet report (optional) -payments_only = false # bool | return a cash basis for the Balance Sheet report (optional) +date = '2019-03-31' # date | The date for the Bank Summary report e.g. 2018-03-31 (optional) +periods = 2 # int | The number of periods to compare (integer between 1 and 12) (optional) +timeframe = 3 # int | The period size to compare to (1=month, 3=quarter, 12=year) (optional) try: - # Retrieves report for balancesheet - api_response = api_instance.get_report_balance_sheet(xero_tenant_id, date=date, periods=periods, timeframe=timeframe, tracking_option_id1=tracking_option_id1, tracking_option_id2=tracking_option_id2, standard_layout=standard_layout, payments_only=payments_only) + # Retrieves report for budget summary + api_response = api_instance.get_report_budget_summary(xero_tenant_id, date=date, periods=periods, timeframe=timeframe) pprint(api_response) except ApiException as e: - print("Exception when calling AccountingApi->get_report_balance_sheet: %s\n" % e) + print("Exception when calling AccountingApi->get_report_budget_summary: %s\n" % e) ``` ### Parameters @@ -11694,13 +11838,9 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **xero_tenant_id** | **str**| Xero identifier for Tenant | - **date** | **date**| The date of the Balance Sheet report | [optional] - **periods** | **int**| The number of periods for the Balance Sheet report | [optional] - **timeframe** | **str**| The period size to compare to (MONTH, QUARTER, YEAR) | [optional] - **tracking_option_id1** | **str**| The tracking option 1 for the Balance Sheet report | [optional] - **tracking_option_id2** | **str**| The tracking option 2 for the Balance Sheet report | [optional] - **standard_layout** | **bool**| The standard layout boolean for the Balance Sheet report | [optional] - **payments_only** | **bool**| return a cash basis for the Balance Sheet report | [optional] + **date** | **date**| The date for the Bank Summary report e.g. 2018-03-31 | [optional] + **periods** | **int**| The number of periods to compare (integer between 1 and 12) | [optional] + **timeframe** | **int**| The period size to compare to (1=month, 3=quarter, 12=year) | [optional] ### Return type @@ -11717,10 +11857,10 @@ 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_report_bank_summary** -> ReportWithRows get_report_bank_summary(xero_tenant_id, from_date=from_date, to_date=to_date) +# **get_report_executive_summary** +> ReportWithRows get_report_executive_summary(xero_tenant_id, date=date) -Retrieves report for bank summary +Retrieves report for executive summary ### Example @@ -11749,14 +11889,13 @@ api_client = ApiClient( api_instance = AccountingApi(api_client) xero_tenant_id = 'YOUR_XERO_TENANT_ID' # str | Xero identifier for Tenant -from_date = '2013-10-20' # date | filter by the from date of the report e.g. 2021-02-01 (optional) -to_date = '2013-10-20' # date | filter by the to date of the report e.g. 2021-02-28 (optional) +date = '2019-03-31' # date | The date for the Bank Summary report e.g. 2018-03-31 (optional) try: - # Retrieves report for bank summary - api_response = api_instance.get_report_bank_summary(xero_tenant_id, from_date=from_date, to_date=to_date) + # Retrieves report for executive summary + api_response = api_instance.get_report_executive_summary(xero_tenant_id, date=date) pprint(api_response) except ApiException as e: - print("Exception when calling AccountingApi->get_report_bank_summary: %s\n" % e) + print("Exception when calling AccountingApi->get_report_executive_summary: %s\n" % e) ``` ### Parameters @@ -11764,8 +11903,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **xero_tenant_id** | **str**| Xero identifier for Tenant | - **from_date** | **date**| filter by the from date of the report e.g. 2021-02-01 | [optional] - **to_date** | **date**| filter by the to date of the report e.g. 2021-02-28 | [optional] + **date** | **date**| The date for the Bank Summary report e.g. 2018-03-31 | [optional] ### Return type @@ -11782,10 +11920,10 @@ 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_report_budget_summary** -> ReportWithRows get_report_budget_summary(xero_tenant_id, date=date, period=period, timeframe=timeframe) +# **get_report_from_id** +> ReportWithRows get_report_from_id(xero_tenant_id, report_id) -Retrieves report for budget summary +Retrieves a specific report using a unique ReportID ### Example @@ -11814,15 +11952,13 @@ api_client = ApiClient( api_instance = AccountingApi(api_client) xero_tenant_id = 'YOUR_XERO_TENANT_ID' # str | Xero identifier for Tenant -date = '2019-03-31' # date | The date for the Bank Summary report e.g. 2018-03-31 (optional) -period = 2 # int | The number of periods to compare (integer between 1 and 12) (optional) -timeframe = 3 # int | The period size to compare to (1=month, 3=quarter, 12=year) (optional) +report_id = '00000000-0000-0000-0000-000000000000' # str | Unique identifier for a Report try: - # Retrieves report for budget summary - api_response = api_instance.get_report_budget_summary(xero_tenant_id, date=date, period=period, timeframe=timeframe) + # Retrieves a specific report using a unique ReportID + api_response = api_instance.get_report_from_id(xero_tenant_id, report_id) pprint(api_response) except ApiException as e: - print("Exception when calling AccountingApi->get_report_budget_summary: %s\n" % e) + print("Exception when calling AccountingApi->get_report_from_id: %s\n" % e) ``` ### Parameters @@ -11830,9 +11966,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **xero_tenant_id** | **str**| Xero identifier for Tenant | - **date** | **date**| The date for the Bank Summary report e.g. 2018-03-31 | [optional] - **period** | **int**| The number of periods to compare (integer between 1 and 12) | [optional] - **timeframe** | **int**| The period size to compare to (1=month, 3=quarter, 12=year) | [optional] + **report_id** | **str**| Unique identifier for a Report | ### Return type @@ -11849,10 +11983,10 @@ 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_report_executive_summary** -> ReportWithRows get_report_executive_summary(xero_tenant_id, date=date) +# **get_report_profit_and_loss** +> ReportWithRows get_report_profit_and_loss(xero_tenant_id, from_date=from_date, to_date=to_date, periods=periods, timeframe=timeframe, tracking_category_id=tracking_category_id, tracking_category_id2=tracking_category_id2, tracking_option_id=tracking_option_id, tracking_option_id2=tracking_option_id2, standard_layout=standard_layout, payments_only=payments_only) -Retrieves report for executive summary +Retrieves report for profit and loss ### Example @@ -11881,13 +12015,22 @@ api_client = ApiClient( api_instance = AccountingApi(api_client) xero_tenant_id = 'YOUR_XERO_TENANT_ID' # str | Xero identifier for Tenant -date = '2019-03-31' # date | The date for the Bank Summary report e.g. 2018-03-31 (optional) +from_date = '2013-10-20' # date | filter by the from date of the report e.g. 2021-02-01 (optional) +to_date = '2013-10-20' # date | filter by the to date of the report e.g. 2021-02-28 (optional) +periods = 3 # int | The number of periods to compare (integer between 1 and 12) (optional) +timeframe = 'MONTH' # str | The period size to compare to (MONTH, QUARTER, YEAR) (optional) +tracking_category_id = '00000000-0000-0000-0000-000000000000' # str | The trackingCategory 1 for the ProfitAndLoss report (optional) +tracking_category_id2 = '00000000-0000-0000-0000-000000000000' # str | The trackingCategory 2 for the ProfitAndLoss report (optional) +tracking_option_id = '00000000-0000-0000-0000-000000000000' # str | The tracking option 1 for the ProfitAndLoss report (optional) +tracking_option_id2 = '00000000-0000-0000-0000-000000000000' # str | The tracking option 2 for the ProfitAndLoss report (optional) +standard_layout = true # bool | Return the standard layout for the ProfitAndLoss report (optional) +payments_only = false # bool | Return cash only basis for the ProfitAndLoss report (optional) try: - # Retrieves report for executive summary - api_response = api_instance.get_report_executive_summary(xero_tenant_id, date=date) + # Retrieves report for profit and loss + api_response = api_instance.get_report_profit_and_loss(xero_tenant_id, from_date=from_date, to_date=to_date, periods=periods, timeframe=timeframe, tracking_category_id=tracking_category_id, tracking_category_id2=tracking_category_id2, tracking_option_id=tracking_option_id, tracking_option_id2=tracking_option_id2, standard_layout=standard_layout, payments_only=payments_only) pprint(api_response) except ApiException as e: - print("Exception when calling AccountingApi->get_report_executive_summary: %s\n" % e) + print("Exception when calling AccountingApi->get_report_profit_and_loss: %s\n" % e) ``` ### Parameters @@ -11895,7 +12038,16 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **xero_tenant_id** | **str**| Xero identifier for Tenant | - **date** | **date**| The date for the Bank Summary report e.g. 2018-03-31 | [optional] + **from_date** | **date**| filter by the from date of the report e.g. 2021-02-01 | [optional] + **to_date** | **date**| filter by the to date of the report e.g. 2021-02-28 | [optional] + **periods** | **int**| The number of periods to compare (integer between 1 and 12) | [optional] + **timeframe** | **str**| The period size to compare to (MONTH, QUARTER, YEAR) | [optional] + **tracking_category_id** | **str**| The trackingCategory 1 for the ProfitAndLoss report | [optional] + **tracking_category_id2** | **str**| The trackingCategory 2 for the ProfitAndLoss report | [optional] + **tracking_option_id** | **str**| The tracking option 1 for the ProfitAndLoss report | [optional] + **tracking_option_id2** | **str**| The tracking option 2 for the ProfitAndLoss report | [optional] + **standard_layout** | **bool**| Return the standard layout for the ProfitAndLoss report | [optional] + **payments_only** | **bool**| Return cash only basis for the ProfitAndLoss report | [optional] ### Return type @@ -11912,10 +12064,10 @@ 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_report_profit_and_loss** -> ReportWithRows get_report_profit_and_loss(xero_tenant_id, from_date=from_date, to_date=to_date, periods=periods, timeframe=timeframe, tracking_category_id=tracking_category_id, tracking_category_id2=tracking_category_id2, tracking_option_id=tracking_option_id, tracking_option_id2=tracking_option_id2, standard_layout=standard_layout, payments_only=payments_only) +# **get_report_ten_ninety_nine** +> Reports get_report_ten_ninety_nine(xero_tenant_id, report_year=report_year) -Retrieves report for profit and loss +Retrieve reports for 1099 ### Example @@ -11944,22 +12096,13 @@ api_client = ApiClient( api_instance = AccountingApi(api_client) xero_tenant_id = 'YOUR_XERO_TENANT_ID' # str | Xero identifier for Tenant -from_date = '2013-10-20' # date | filter by the from date of the report e.g. 2021-02-01 (optional) -to_date = '2013-10-20' # date | filter by the to date of the report e.g. 2021-02-28 (optional) -periods = 3 # int | The number of periods to compare (integer between 1 and 12) (optional) -timeframe = 'MONTH' # str | The period size to compare to (MONTH, QUARTER, YEAR) (optional) -tracking_category_id = '00000000-0000-0000-0000-000000000000' # str | The trackingCategory 1 for the ProfitAndLoss report (optional) -tracking_category_id2 = '00000000-0000-0000-0000-000000000000' # str | The trackingCategory 2 for the ProfitAndLoss report (optional) -tracking_option_id = '00000000-0000-0000-0000-000000000000' # str | The tracking option 1 for the ProfitAndLoss report (optional) -tracking_option_id2 = '00000000-0000-0000-0000-000000000000' # str | The tracking option 2 for the ProfitAndLoss report (optional) -standard_layout = true # bool | Return the standard layout for the ProfitAndLoss report (optional) -payments_only = false # bool | Return cash only basis for the ProfitAndLoss report (optional) +report_year = '2019' # str | The year of the 1099 report (optional) try: - # Retrieves report for profit and loss - api_response = api_instance.get_report_profit_and_loss(xero_tenant_id, from_date=from_date, to_date=to_date, periods=periods, timeframe=timeframe, tracking_category_id=tracking_category_id, tracking_category_id2=tracking_category_id2, tracking_option_id=tracking_option_id, tracking_option_id2=tracking_option_id2, standard_layout=standard_layout, payments_only=payments_only) + # Retrieve reports for 1099 + api_response = api_instance.get_report_ten_ninety_nine(xero_tenant_id, report_year=report_year) pprint(api_response) except ApiException as e: - print("Exception when calling AccountingApi->get_report_profit_and_loss: %s\n" % e) + print("Exception when calling AccountingApi->get_report_ten_ninety_nine: %s\n" % e) ``` ### Parameters @@ -11967,20 +12110,11 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **xero_tenant_id** | **str**| Xero identifier for Tenant | - **from_date** | **date**| filter by the from date of the report e.g. 2021-02-01 | [optional] - **to_date** | **date**| filter by the to date of the report e.g. 2021-02-28 | [optional] - **periods** | **int**| The number of periods to compare (integer between 1 and 12) | [optional] - **timeframe** | **str**| The period size to compare to (MONTH, QUARTER, YEAR) | [optional] - **tracking_category_id** | **str**| The trackingCategory 1 for the ProfitAndLoss report | [optional] - **tracking_category_id2** | **str**| The trackingCategory 2 for the ProfitAndLoss report | [optional] - **tracking_option_id** | **str**| The tracking option 1 for the ProfitAndLoss report | [optional] - **tracking_option_id2** | **str**| The tracking option 2 for the ProfitAndLoss report | [optional] - **standard_layout** | **bool**| Return the standard layout for the ProfitAndLoss report | [optional] - **payments_only** | **bool**| Return cash only basis for the ProfitAndLoss report | [optional] + **report_year** | **str**| The year of the 1099 report | [optional] ### Return type -[**ReportWithRows**](ReportWithRows.md) +[**Reports**](Reports.md) ### Authorization @@ -11993,10 +12127,10 @@ 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_report_ten_ninety_nine** -> Reports get_report_ten_ninety_nine(xero_tenant_id, report_year=report_year) +# **get_report_trial_balance** +> ReportWithRows get_report_trial_balance(xero_tenant_id, date=date, payments_only=payments_only) -Retrieve reports for 1099 +Retrieves report for trial balance ### Example @@ -12025,13 +12159,14 @@ api_client = ApiClient( api_instance = AccountingApi(api_client) xero_tenant_id = 'YOUR_XERO_TENANT_ID' # str | Xero identifier for Tenant -report_year = '2019' # str | The year of the 1099 report (optional) +date = '2019-10-31' # date | The date for the Trial Balance report e.g. 2018-03-31 (optional) +payments_only = true # bool | Return cash only basis for the Trial Balance report (optional) try: - # Retrieve reports for 1099 - api_response = api_instance.get_report_ten_ninety_nine(xero_tenant_id, report_year=report_year) + # Retrieves report for trial balance + api_response = api_instance.get_report_trial_balance(xero_tenant_id, date=date, payments_only=payments_only) pprint(api_response) except ApiException as e: - print("Exception when calling AccountingApi->get_report_ten_ninety_nine: %s\n" % e) + print("Exception when calling AccountingApi->get_report_trial_balance: %s\n" % e) ``` ### Parameters @@ -12039,11 +12174,12 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **xero_tenant_id** | **str**| Xero identifier for Tenant | - **report_year** | **str**| The year of the 1099 report | [optional] + **date** | **date**| The date for the Trial Balance report e.g. 2018-03-31 | [optional] + **payments_only** | **bool**| Return cash only basis for the Trial Balance report | [optional] ### Return type -[**Reports**](Reports.md) +[**ReportWithRows**](ReportWithRows.md) ### Authorization @@ -12056,10 +12192,10 @@ 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_report_trial_balance** -> ReportWithRows get_report_trial_balance(xero_tenant_id, date=date, payments_only=payments_only) +# **get_reports_list** +> ReportWithRows get_reports_list(xero_tenant_id) -Retrieves report for trial balance +Retrieves a list of the organistaions unique reports that require a uuid to fetch ### Example @@ -12088,14 +12224,12 @@ api_client = ApiClient( api_instance = AccountingApi(api_client) xero_tenant_id = 'YOUR_XERO_TENANT_ID' # str | Xero identifier for Tenant -date = '2019-10-31' # date | The date for the Trial Balance report e.g. 2018-03-31 (optional) -payments_only = true # bool | Return cash only basis for the Trial Balance report (optional) try: - # Retrieves report for trial balance - api_response = api_instance.get_report_trial_balance(xero_tenant_id, date=date, payments_only=payments_only) + # Retrieves a list of the organistaions unique reports that require a uuid to fetch + api_response = api_instance.get_reports_list(xero_tenant_id) pprint(api_response) except ApiException as e: - print("Exception when calling AccountingApi->get_report_trial_balance: %s\n" % e) + print("Exception when calling AccountingApi->get_reports_list: %s\n" % e) ``` ### Parameters @@ -12103,8 +12237,6 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **xero_tenant_id** | **str**| Xero identifier for Tenant | - **date** | **date**| The date for the Trial Balance report e.g. 2018-03-31 | [optional] - **payments_only** | **bool**| Return cash only basis for the Trial Balance report | [optional] ### Return type diff --git a/xero_python/accounting/docs/Budget.md b/xero_python/accounting/docs/Budget.md new file mode 100644 index 00000000..c5583969 --- /dev/null +++ b/xero_python/accounting/docs/Budget.md @@ -0,0 +1,15 @@ +# Budget + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**budget_id** | **str** | Xero identifier | [optional] +**type** | **str** | Type of Budget. OVERALL or TRACKING | [optional] +**description** | **str** | The Budget description | [optional] +**updated_date_utc** | **datetime** | UTC timestamp of last update to budget | [optional] +**budget_lines** | [**list[BudgetLine]**](BudgetLine.md) | | [optional] +**tracking** | [**list[TrackingCategory]**](TrackingCategory.md) | | [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/accounting/docs/BudgetBalance.md b/xero_python/accounting/docs/BudgetBalance.md new file mode 100644 index 00000000..74b082ea --- /dev/null +++ b/xero_python/accounting/docs/BudgetBalance.md @@ -0,0 +1,13 @@ +# BudgetBalance + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**period** | **date** | Period the amount applies to (e.g. “2019-08”) | [optional] +**amount** | **int** | LineItem Quantity | [optional] +**unit_amount** | **int** | Budgeted amount | [optional] +**notes** | **str** | Any footnotes associated with this balance | [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/accounting/docs/BudgetLine.md b/xero_python/accounting/docs/BudgetLine.md new file mode 100644 index 00000000..3bc2c61d --- /dev/null +++ b/xero_python/accounting/docs/BudgetLine.md @@ -0,0 +1,12 @@ +# BudgetLine + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**account_id** | **str** | See Accounts | [optional] +**account_code** | **str** | See Accounts | [optional] +**budget_balances** | [**list[BudgetBalance]**](BudgetBalance.md) | | [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/accounting/docs/Budgets.md b/xero_python/accounting/docs/Budgets.md new file mode 100644 index 00000000..e6773308 --- /dev/null +++ b/xero_python/accounting/docs/Budgets.md @@ -0,0 +1,10 @@ +# Budgets + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**budgets** | [**list[Budget]**](Budget.md) | | [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/accounting/docs/LineItem.md b/xero_python/accounting/docs/LineItem.md index c97d0098..40142d9c 100644 --- a/xero_python/accounting/docs/LineItem.md +++ b/xero_python/accounting/docs/LineItem.md @@ -9,6 +9,7 @@ Name | Type | Description | Notes **unit_amount** | **float** | LineItem Unit Amount | [optional] **item_code** | **str** | See Items | [optional] **account_code** | **str** | See Accounts | [optional] +**account_id** | **str** | The associated account ID related to this line item | [optional] **tax_type** | **str** | The tax type from TaxRates | [optional] **tax_amount** | **float** | The tax amount is auto calculated as a percentage of the line amount (see below) based on the tax rate. This value can be overriden if the calculated <TaxAmount> is not correct. | [optional] **line_amount** | **float** | If you wish to omit either of the <Quantity> or <UnitAmount> you can provide a LineAmount and Xero will calculate the missing amount for you. The line amount reflects the discounted price if a DiscountRate has been used . i.e LineAmount = Quantity * Unit Amount * ((100 – DiscountRate)/100) | [optional] diff --git a/xero_python/accounting/docs/Report.md b/xero_python/accounting/docs/Report.md index 2b842d6c..b8e32bdf 100644 --- a/xero_python/accounting/docs/Report.md +++ b/xero_python/accounting/docs/Report.md @@ -3,7 +3,6 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**report_id** | **str** | See Prepayment Types | [optional] **report_name** | **str** | See Prepayment Types | [optional] **report_type** | **str** | See Prepayment Types | [optional] **report_title** | **str** | See Prepayment Types | [optional] diff --git a/xero_python/accounting/docs/ReportWithRow.md b/xero_python/accounting/docs/ReportWithRow.md index 3bb06e2a..60ebb625 100644 --- a/xero_python/accounting/docs/ReportWithRow.md +++ b/xero_python/accounting/docs/ReportWithRow.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**report_id** | **str** | Report id | [optional] +**report_id** | **str** | ID of the Report | [optional] **report_name** | **str** | Name of the report | [optional] **report_title** | **str** | Title of the report | [optional] **report_type** | **str** | The type of report (BalanceSheet,ProfitLoss, etc) | [optional] diff --git a/xero_python/accounting/models/__init__.py b/xero_python/accounting/models/__init__.py index 053b6f68..a529bddf 100644 --- a/xero_python/accounting/models/__init__.py +++ b/xero_python/accounting/models/__init__.py @@ -39,6 +39,10 @@ from xero_python.accounting.models.bill import Bill from xero_python.accounting.models.branding_theme import BrandingTheme from xero_python.accounting.models.branding_themes import BrandingThemes +from xero_python.accounting.models.budget import Budget +from xero_python.accounting.models.budget_balance import BudgetBalance +from xero_python.accounting.models.budget_line import BudgetLine +from xero_python.accounting.models.budgets import Budgets from xero_python.accounting.models.cis_org_setting import CISOrgSetting from xero_python.accounting.models.cis_org_settings import CISOrgSettings from xero_python.accounting.models.cis_setting import CISSetting diff --git a/xero_python/accounting/models/budget.py b/xero_python/accounting/models/budget.py new file mode 100644 index 00000000..d1c1db28 --- /dev/null +++ b/xero_python/accounting/models/budget.py @@ -0,0 +1,228 @@ +# coding: utf-8 + +""" + Xero Accounting API + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + Contact: api@xero.com + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 + +from xero_python.models import BaseModel + + +class Budget(BaseModel): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + "budget_id": "str", + "type": "str", + "description": "str", + "updated_date_utc": "datetime[ms-format]", + "budget_lines": "list[BudgetLine]", + "tracking": "list[TrackingCategory]", + } + + attribute_map = { + "budget_id": "BudgetID", + "type": "Type", + "description": "Description", + "updated_date_utc": "UpdatedDateUTC", + "budget_lines": "BudgetLines", + "tracking": "Tracking", + } + + def __init__( + self, + budget_id=None, + type=None, + description=None, + updated_date_utc=None, + budget_lines=None, + tracking=None, + ): # noqa: E501 + """Budget - a model defined in OpenAPI""" # noqa: E501 + + self._budget_id = None + self._type = None + self._description = None + self._updated_date_utc = None + self._budget_lines = None + self._tracking = None + self.discriminator = None + + if budget_id is not None: + self.budget_id = budget_id + if type is not None: + self.type = type + if description is not None: + self.description = description + if updated_date_utc is not None: + self.updated_date_utc = updated_date_utc + if budget_lines is not None: + self.budget_lines = budget_lines + if tracking is not None: + self.tracking = tracking + + @property + def budget_id(self): + """Gets the budget_id of this Budget. # noqa: E501 + + Xero identifier # noqa: E501 + + :return: The budget_id of this Budget. # noqa: E501 + :rtype: str + """ + return self._budget_id + + @budget_id.setter + def budget_id(self, budget_id): + """Sets the budget_id of this Budget. + + Xero identifier # noqa: E501 + + :param budget_id: The budget_id of this Budget. # noqa: E501 + :type: str + """ + + self._budget_id = budget_id + + @property + def type(self): + """Gets the type of this Budget. # noqa: E501 + + Type of Budget. OVERALL or TRACKING # noqa: E501 + + :return: The type of this Budget. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this Budget. + + Type of Budget. OVERALL or TRACKING # noqa: E501 + + :param type: The type of this Budget. # noqa: E501 + :type: str + """ + allowed_values = ["OVERALL", "TRACKING", "None"] # noqa: E501 + + if type: + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}".format( # noqa: E501 + type, allowed_values + ) + ) + + self._type = type + + @property + def description(self): + """Gets the description of this Budget. # noqa: E501 + + The Budget description # noqa: E501 + + :return: The description of this Budget. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this Budget. + + The Budget description # noqa: E501 + + :param description: The description of this Budget. # noqa: E501 + :type: str + """ + if description is not None and len(description) > 255: + raise ValueError( + "Invalid value for `description`, " + "length must be less than or equal to `255`" + ) # noqa: E501 + + self._description = description + + @property + def updated_date_utc(self): + """Gets the updated_date_utc of this Budget. # noqa: E501 + + UTC timestamp of last update to budget # noqa: E501 + + :return: The updated_date_utc of this Budget. # noqa: E501 + :rtype: datetime + """ + return self._updated_date_utc + + @updated_date_utc.setter + def updated_date_utc(self, updated_date_utc): + """Sets the updated_date_utc of this Budget. + + UTC timestamp of last update to budget # noqa: E501 + + :param updated_date_utc: The updated_date_utc of this Budget. # noqa: E501 + :type: datetime + """ + + self._updated_date_utc = updated_date_utc + + @property + def budget_lines(self): + """Gets the budget_lines of this Budget. # noqa: E501 + + + :return: The budget_lines of this Budget. # noqa: E501 + :rtype: list[BudgetLine] + """ + return self._budget_lines + + @budget_lines.setter + def budget_lines(self, budget_lines): + """Sets the budget_lines of this Budget. + + + :param budget_lines: The budget_lines of this Budget. # noqa: E501 + :type: list[BudgetLine] + """ + + self._budget_lines = budget_lines + + @property + def tracking(self): + """Gets the tracking of this Budget. # noqa: E501 + + + :return: The tracking of this Budget. # noqa: E501 + :rtype: list[TrackingCategory] + """ + return self._tracking + + @tracking.setter + def tracking(self, tracking): + """Sets the tracking of this Budget. + + + :param tracking: The tracking of this Budget. # noqa: E501 + :type: list[TrackingCategory] + """ + + self._tracking = tracking diff --git a/xero_python/accounting/models/budget_balance.py b/xero_python/accounting/models/budget_balance.py new file mode 100644 index 00000000..af7b2056 --- /dev/null +++ b/xero_python/accounting/models/budget_balance.py @@ -0,0 +1,161 @@ +# coding: utf-8 + +""" + Xero Accounting API + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + Contact: api@xero.com + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 + +from xero_python.models import BaseModel + + +class BudgetBalance(BaseModel): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + "period": "date[ms-format]", + "amount": "int", + "unit_amount": "int", + "notes": "str", + } + + attribute_map = { + "period": "Period", + "amount": "Amount", + "unit_amount": "UnitAmount", + "notes": "Notes", + } + + def __init__( + self, period=None, amount=None, unit_amount=None, notes=None + ): # noqa: E501 + """BudgetBalance - a model defined in OpenAPI""" # noqa: E501 + + self._period = None + self._amount = None + self._unit_amount = None + self._notes = None + self.discriminator = None + + if period is not None: + self.period = period + if amount is not None: + self.amount = amount + if unit_amount is not None: + self.unit_amount = unit_amount + if notes is not None: + self.notes = notes + + @property + def period(self): + """Gets the period of this BudgetBalance. # noqa: E501 + + Period the amount applies to (e.g. “2019-08”) # noqa: E501 + + :return: The period of this BudgetBalance. # noqa: E501 + :rtype: date + """ + return self._period + + @period.setter + def period(self, period): + """Sets the period of this BudgetBalance. + + Period the amount applies to (e.g. “2019-08”) # noqa: E501 + + :param period: The period of this BudgetBalance. # noqa: E501 + :type: date + """ + + self._period = period + + @property + def amount(self): + """Gets the amount of this BudgetBalance. # noqa: E501 + + LineItem Quantity # noqa: E501 + + :return: The amount of this BudgetBalance. # noqa: E501 + :rtype: int + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this BudgetBalance. + + LineItem Quantity # noqa: E501 + + :param amount: The amount of this BudgetBalance. # noqa: E501 + :type: int + """ + + self._amount = amount + + @property + def unit_amount(self): + """Gets the unit_amount of this BudgetBalance. # noqa: E501 + + Budgeted amount # noqa: E501 + + :return: The unit_amount of this BudgetBalance. # noqa: E501 + :rtype: int + """ + return self._unit_amount + + @unit_amount.setter + def unit_amount(self, unit_amount): + """Sets the unit_amount of this BudgetBalance. + + Budgeted amount # noqa: E501 + + :param unit_amount: The unit_amount of this BudgetBalance. # noqa: E501 + :type: int + """ + + self._unit_amount = unit_amount + + @property + def notes(self): + """Gets the notes of this BudgetBalance. # noqa: E501 + + Any footnotes associated with this balance # noqa: E501 + + :return: The notes of this BudgetBalance. # noqa: E501 + :rtype: str + """ + return self._notes + + @notes.setter + def notes(self, notes): + """Sets the notes of this BudgetBalance. + + Any footnotes associated with this balance # noqa: E501 + + :param notes: The notes of this BudgetBalance. # noqa: E501 + :type: str + """ + if notes is not None and len(notes) > 255: + raise ValueError( + "Invalid value for `notes`, " + "length must be less than or equal to `255`" + ) # noqa: E501 + + self._notes = notes diff --git a/xero_python/accounting/models/budget_line.py b/xero_python/accounting/models/budget_line.py new file mode 100644 index 00000000..0c311919 --- /dev/null +++ b/xero_python/accounting/models/budget_line.py @@ -0,0 +1,126 @@ +# coding: utf-8 + +""" + Xero Accounting API + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + Contact: api@xero.com + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 + +from xero_python.models import BaseModel + + +class BudgetLine(BaseModel): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + "account_id": "str", + "account_code": "str", + "budget_balances": "list[BudgetBalance]", + } + + attribute_map = { + "account_id": "AccountID", + "account_code": "AccountCode", + "budget_balances": "BudgetBalances", + } + + def __init__( + self, account_id=None, account_code=None, budget_balances=None + ): # noqa: E501 + """BudgetLine - a model defined in OpenAPI""" # noqa: E501 + + self._account_id = None + self._account_code = None + self._budget_balances = None + self.discriminator = None + + if account_id is not None: + self.account_id = account_id + if account_code is not None: + self.account_code = account_code + if budget_balances is not None: + self.budget_balances = budget_balances + + @property + def account_id(self): + """Gets the account_id of this BudgetLine. # noqa: E501 + + See Accounts # noqa: E501 + + :return: The account_id of this BudgetLine. # noqa: E501 + :rtype: str + """ + return self._account_id + + @account_id.setter + def account_id(self, account_id): + """Sets the account_id of this BudgetLine. + + See Accounts # noqa: E501 + + :param account_id: The account_id of this BudgetLine. # noqa: E501 + :type: str + """ + + self._account_id = account_id + + @property + def account_code(self): + """Gets the account_code of this BudgetLine. # noqa: E501 + + See Accounts # noqa: E501 + + :return: The account_code of this BudgetLine. # noqa: E501 + :rtype: str + """ + return self._account_code + + @account_code.setter + def account_code(self, account_code): + """Sets the account_code of this BudgetLine. + + See Accounts # noqa: E501 + + :param account_code: The account_code of this BudgetLine. # noqa: E501 + :type: str + """ + + self._account_code = account_code + + @property + def budget_balances(self): + """Gets the budget_balances of this BudgetLine. # noqa: E501 + + + :return: The budget_balances of this BudgetLine. # noqa: E501 + :rtype: list[BudgetBalance] + """ + return self._budget_balances + + @budget_balances.setter + def budget_balances(self, budget_balances): + """Sets the budget_balances of this BudgetLine. + + + :param budget_balances: The budget_balances of this BudgetLine. # noqa: E501 + :type: list[BudgetBalance] + """ + + self._budget_balances = budget_balances diff --git a/xero_python/accounting/models/budgets.py b/xero_python/accounting/models/budgets.py new file mode 100644 index 00000000..f42d49dc --- /dev/null +++ b/xero_python/accounting/models/budgets.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + Xero Accounting API + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + Contact: api@xero.com + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 + +from xero_python.models import BaseModel + + +class Budgets(BaseModel): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = {"budgets": "list[Budget]"} + + attribute_map = {"budgets": "Budgets"} + + def __init__(self, budgets=None): # noqa: E501 + """Budgets - a model defined in OpenAPI""" # noqa: E501 + + self._budgets = None + self.discriminator = None + + if budgets is not None: + self.budgets = budgets + + @property + def budgets(self): + """Gets the budgets of this Budgets. # noqa: E501 + + + :return: The budgets of this Budgets. # noqa: E501 + :rtype: list[Budget] + """ + return self._budgets + + @budgets.setter + def budgets(self, budgets): + """Sets the budgets of this Budgets. + + + :param budgets: The budgets of this Budgets. # noqa: E501 + :type: list[Budget] + """ + + self._budgets = budgets diff --git a/xero_python/accounting/models/line_item.py b/xero_python/accounting/models/line_item.py index 7c7afc7a..0aa686be 100644 --- a/xero_python/accounting/models/line_item.py +++ b/xero_python/accounting/models/line_item.py @@ -36,6 +36,7 @@ class LineItem(BaseModel): "unit_amount": "float", "item_code": "str", "account_code": "str", + "account_id": "str", "tax_type": "str", "tax_amount": "float", "line_amount": "float", @@ -52,6 +53,7 @@ class LineItem(BaseModel): "unit_amount": "UnitAmount", "item_code": "ItemCode", "account_code": "AccountCode", + "account_id": "AccountID", "tax_type": "TaxType", "tax_amount": "TaxAmount", "line_amount": "LineAmount", @@ -69,6 +71,7 @@ def __init__( unit_amount=None, item_code=None, account_code=None, + account_id=None, tax_type=None, tax_amount=None, line_amount=None, @@ -85,6 +88,7 @@ def __init__( self._unit_amount = None self._item_code = None self._account_code = None + self._account_id = None self._tax_type = None self._tax_amount = None self._line_amount = None @@ -106,6 +110,8 @@ def __init__( self.item_code = item_code if account_code is not None: self.account_code = account_code + if account_id is not None: + self.account_id = account_id if tax_type is not None: self.tax_type = tax_type if tax_amount is not None: @@ -259,6 +265,29 @@ def account_code(self, account_code): self._account_code = account_code + @property + def account_id(self): + """Gets the account_id of this LineItem. # noqa: E501 + + The associated account ID related to this line item # noqa: E501 + + :return: The account_id of this LineItem. # noqa: E501 + :rtype: str + """ + return self._account_id + + @account_id.setter + def account_id(self, account_id): + """Sets the account_id of this LineItem. + + The associated account ID related to this line item # noqa: E501 + + :param account_id: The account_id of this LineItem. # noqa: E501 + :type: str + """ + + self._account_id = account_id + @property def tax_type(self): """Gets the tax_type of this LineItem. # noqa: E501 diff --git a/xero_python/accounting/models/report.py b/xero_python/accounting/models/report.py index 584a8a3f..9a598b27 100644 --- a/xero_python/accounting/models/report.py +++ b/xero_python/accounting/models/report.py @@ -30,7 +30,6 @@ class Report(BaseModel): and the value is json key in definition. """ openapi_types = { - "report_id": "str", "report_name": "str", "report_type": "str", "report_title": "str", @@ -40,7 +39,6 @@ class Report(BaseModel): } attribute_map = { - "report_id": "ReportID", "report_name": "ReportName", "report_type": "ReportType", "report_title": "ReportTitle", @@ -51,7 +49,6 @@ class Report(BaseModel): def __init__( self, - report_id=None, report_name=None, report_type=None, report_title=None, @@ -61,7 +58,6 @@ def __init__( ): # noqa: E501 """Report - a model defined in OpenAPI""" # noqa: E501 - self._report_id = None self._report_name = None self._report_type = None self._report_title = None @@ -70,8 +66,6 @@ def __init__( self._contacts = None self.discriminator = None - if report_id is not None: - self.report_id = report_id if report_name is not None: self.report_name = report_name if report_type is not None: @@ -85,29 +79,6 @@ def __init__( if contacts is not None: self.contacts = contacts - @property - def report_id(self): - """Gets the report_id of this Report. # noqa: E501 - - See Prepayment Types # noqa: E501 - - :return: The report_id of this Report. # noqa: E501 - :rtype: str - """ - return self._report_id - - @report_id.setter - def report_id(self, report_id): - """Sets the report_id of this Report. - - See Prepayment Types # noqa: E501 - - :param report_id: The report_id of this Report. # noqa: E501 - :type: str - """ - - self._report_id = report_id - @property def report_name(self): """Gets the report_name of this Report. # noqa: E501 diff --git a/xero_python/accounting/models/report_with_row.py b/xero_python/accounting/models/report_with_row.py index 3e383501..27c40ee3 100644 --- a/xero_python/accounting/models/report_with_row.py +++ b/xero_python/accounting/models/report_with_row.py @@ -101,7 +101,7 @@ def __init__( def report_id(self): """Gets the report_id of this ReportWithRow. # noqa: E501 - Report id # noqa: E501 + ID of the Report # noqa: E501 :return: The report_id of this ReportWithRow. # noqa: E501 :rtype: str @@ -112,7 +112,7 @@ def report_id(self): def report_id(self, report_id): """Sets the report_id of this ReportWithRow. - Report id # noqa: E501 + ID of the Report # noqa: E501 :param report_id: The report_id of this ReportWithRow. # noqa: E501 :type: str diff --git a/xero_python/api_client/oauth2.py b/xero_python/api_client/oauth2.py index 6e879309..b7543ce3 100644 --- a/xero_python/api_client/oauth2.py +++ b/xero_python/api_client/oauth2.py @@ -230,7 +230,7 @@ def refresh_access_token(self, api_client): self.update_token(**new_token) api_client.set_oauth2_token(new_token) return True - + def get_client_credentials_access_token(self, api_client): """ Perform OAuth2 Client Credentials grant token request. diff --git a/xero_python/assets/api/asset_api.py b/xero_python/assets/api/asset_api.py index 49afe196..3287d1f7 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.12.0 + OpenAPI spec version: 2.13.4 """ import importlib diff --git a/xero_python/docs/README.md b/xero_python/docs/README.md index 4acdbb61..dabd5481 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.12.0 -- Package version: 1.6.0 +- API version: 2.13.4 +- Package version: 1.8.0b2 - 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 7d53b916..b31b3259 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.12.0 + OpenAPI spec version: 2.13.4 """ import importlib diff --git a/xero_python/identity/api/identity_api.py b/xero_python/identity/api/identity_api.py index 6abd565a..ef974d1a 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.12.0 + OpenAPI spec version: 2.13.4 """ import importlib diff --git a/xero_python/payrollau/api/payroll_au_api.py b/xero_python/payrollau/api/payroll_au_api.py index 24b07909..ae4d34c3 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.12.0 + OpenAPI spec version: 2.13.4 """ import importlib diff --git a/xero_python/payrollau/docs/PayrollCalendar.md b/xero_python/payrollau/docs/PayrollCalendar.md index 1cfb0ed1..389c25a6 100644 --- a/xero_python/payrollau/docs/PayrollCalendar.md +++ b/xero_python/payrollau/docs/PayrollCalendar.md @@ -9,6 +9,7 @@ Name | Type | Description | Notes **payment_date** | **date** | The date on which employees will be paid for the upcoming pay period (YYYY-MM-DD) | [optional] **payroll_calendar_id** | **str** | Xero identifier | [optional] **updated_date_utc** | **datetime** | Last modified timestamp | [optional] +**reference_date** | **date** | Reference Date (YYYY-MM-DD) | [optional] **validation_errors** | [**list[ValidationError]**](ValidationError.md) | Displays array of validation error messages from the API | [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/payrollau/models/payroll_calendar.py b/xero_python/payrollau/models/payroll_calendar.py index 32477d9e..8ae75b2e 100644 --- a/xero_python/payrollau/models/payroll_calendar.py +++ b/xero_python/payrollau/models/payroll_calendar.py @@ -36,6 +36,7 @@ class PayrollCalendar(BaseModel): "payment_date": "date[ms-format]", "payroll_calendar_id": "str", "updated_date_utc": "datetime[ms-format]", + "reference_date": "date[ms-format]", "validation_errors": "list[ValidationError]", } @@ -46,6 +47,7 @@ class PayrollCalendar(BaseModel): "payment_date": "PaymentDate", "payroll_calendar_id": "PayrollCalendarID", "updated_date_utc": "UpdatedDateUTC", + "reference_date": "ReferenceDate", "validation_errors": "ValidationErrors", } @@ -57,6 +59,7 @@ def __init__( payment_date=None, payroll_calendar_id=None, updated_date_utc=None, + reference_date=None, validation_errors=None, ): # noqa: E501 """PayrollCalendar - a model defined in OpenAPI""" # noqa: E501 @@ -67,6 +70,7 @@ def __init__( self._payment_date = None self._payroll_calendar_id = None self._updated_date_utc = None + self._reference_date = None self._validation_errors = None self.discriminator = None @@ -82,6 +86,8 @@ def __init__( self.payroll_calendar_id = payroll_calendar_id if updated_date_utc is not None: self.updated_date_utc = updated_date_utc + if reference_date is not None: + self.reference_date = reference_date if validation_errors is not None: self.validation_errors = validation_errors @@ -221,6 +227,29 @@ def updated_date_utc(self, updated_date_utc): self._updated_date_utc = updated_date_utc + @property + def reference_date(self): + """Gets the reference_date of this PayrollCalendar. # noqa: E501 + + Reference Date (YYYY-MM-DD) # noqa: E501 + + :return: The reference_date of this PayrollCalendar. # noqa: E501 + :rtype: date + """ + return self._reference_date + + @reference_date.setter + def reference_date(self, reference_date): + """Sets the reference_date of this PayrollCalendar. + + Reference Date (YYYY-MM-DD) # noqa: E501 + + :param reference_date: The reference_date of this PayrollCalendar. # noqa: E501 + :type: date + """ + + self._reference_date = reference_date + @property def validation_errors(self): """Gets the validation_errors of this PayrollCalendar. # noqa: E501 diff --git a/xero_python/payrollnz/api/payroll_nz_api.py b/xero_python/payrollnz/api/payroll_nz_api.py index c385c95a..1219b18c 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.12.0 + OpenAPI spec version: 2.13.4 """ import importlib diff --git a/xero_python/payrolluk/api/payroll_uk_api.py b/xero_python/payrolluk/api/payroll_uk_api.py index 878cf663..1be45452 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.12.0 + OpenAPI spec version: 2.13.4 """ import importlib diff --git a/xero_python/payrolluk/docs/PayrollUkApi.md b/xero_python/payrolluk/docs/PayrollUkApi.md index 2a9c03bc..8829494f 100644 --- a/xero_python/payrolluk/docs/PayrollUkApi.md +++ b/xero_python/payrolluk/docs/PayrollUkApi.md @@ -2339,9 +2339,9 @@ api_client = ApiClient( api_instance = PayrollUkApi(api_client) xero_tenant_id = 'xero_tenant_id_example' # str | Xero identifier for Tenant -employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # str | Employee id for single object +employee_id = '00000000-0000-0000-0000-000000000000' # str | Employee id for single object start_date = '2013-10-20' # date | Filter by start date (optional) -end_date = 'Johnson' # date | Filter by end date (optional) +end_date = '2013-10-20' # date | Filter by end date (optional) try: # Retrieves a specific employee's leave periods using a unique employee ID api_response = api_instance.get_employee_leave_periods(xero_tenant_id, employee_id, start_date=start_date, end_date=end_date) diff --git a/xero_python/payrolluk/models/earnings_rate.py b/xero_python/payrolluk/models/earnings_rate.py index e1bd3f43..a2fe7fad 100644 --- a/xero_python/payrolluk/models/earnings_rate.py +++ b/xero_python/payrolluk/models/earnings_rate.py @@ -195,6 +195,7 @@ def earnings_type(self, earnings_type): "StatutorySickPayNonPensionable", "Tips(Direct)", "Tips(Non-Direct)", + "TerminationPay", "None", ] # noqa: E501 diff --git a/xero_python/project/api/project_api.py b/xero_python/project/api/project_api.py index c3afe84d..4dc1bb6c 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.12.0 + OpenAPI spec version: 2.13.4 """ import importlib diff --git a/xero_python/project/docs/ProjectApi.md b/xero_python/project/docs/ProjectApi.md index b94d98fc..132ea99d 100644 --- a/xero_python/project/docs/ProjectApi.md +++ b/xero_python/project/docs/ProjectApi.md @@ -51,7 +51,7 @@ api_client = ApiClient( api_instance = ProjectApi(api_client) xero_tenant_id = 'xero_tenant_id_example' # str | Xero identifier for Tenant -project_create_or_update = { "contactId":"00000000-0000-0000-000-000000000000", "name":"New Kitchen", "deadlineUtc":"2019-12-10T12:59:59Z", "estimateAmount":"99.99" } # ProjectCreateOrUpdate | Create a new project with ProjectCreateOrUpdate object +project_create_or_update = { "contactId": "00000000-0000-0000-000-000000000000", "name": "New Kitchen", "deadlineUtc": "2019-12-10T12:59:59Z", "estimateAmount": "99.99" } # ProjectCreateOrUpdate | Create a new project with ProjectCreateOrUpdate object try: # Create one or more new projects api_response = api_instance.create_project(xero_tenant_id, project_create_or_update) @@ -117,7 +117,7 @@ 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 -time_entry_create_or_update = { "userId":"740add2a-a703-4b8a-a670-1093919c2040", "taskId":"7be77337-feec-4458-bb1b-dbaa5a4aafce", "dateUtc":"2020-02-26T15:00:00Z", "duration":30, "description":"My description" } # TimeEntryCreateOrUpdate | The time entry object you are creating +time_entry_create_or_update = { "userId": "00000000-0000-0000-0000-000000000000", "taskId": "00000000-0000-0000-0000-000000000000", "dateUtc": "2020-02-26T15:00:00Z", "duration":30, "description": "My description" } # TimeEntryCreateOrUpdate | The time entry object you are creating try: # Creates a time entry for a specific project api_response = api_instance.create_time_entry(xero_tenant_id, project_id, time_entry_create_or_update) @@ -880,7 +880,7 @@ 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 time_entry_id = 'time_entry_id_example' # str | You can specify an individual time entry by appending the id to the endpoint -time_entry_create_or_update = { "userId":"740add2a-a703-4b8a-a670-1093919c2040", "taskId":"7be77337-feec-4458-bb1b-dbaa5a4aafce", "dateUtc":"2020-02-27T15:00:00Z", "duration":45, "description":"My UPDATED description" } # TimeEntryCreateOrUpdate | The time entry object you are updating +time_entry_create_or_update = { "userId": "00000000-0000-0000-0000-000000000000", "taskId": "00000000-0000-0000-0000-000000000000", "dateUtc": "2020-02-27T15:00:00Z", "duration":45, "description": "My UPDATED description" } # TimeEntryCreateOrUpdate | The time entry object you are updating try: # Updates a time entry for a specific project api_instance.update_time_entry(xero_tenant_id, project_id, time_entry_id, time_entry_create_or_update) From 920347ad757672944d9ea05276654d4b0f3fbc27 Mon Sep 17 00:00:00 2001 From: Rett Behrens Date: Wed, 21 Jul 2021 13:31:00 -0600 Subject: [PATCH 4/6] change version number to 1.8.0 --- docs/v1/accounting/index.html | 2 +- setup.py | 2 +- xero_python/__init__.py | 2 +- xero_python/docs/README.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/v1/accounting/index.html b/docs/v1/accounting/index.html index e9ba07de..ec14aaf9 100644 --- a/docs/v1/accounting/index.html +++ b/docs/v1/accounting/index.html @@ -5930,7 +5930,7 @@