diff --git a/docs/v1/accounting/index.html b/docs/v1/accounting/index.html index 1fd9a6ee..d72cc1a7 100644 --- a/docs/v1/accounting/index.html +++ b/docs/v1/accounting/index.html @@ -6008,7 +6008,7 @@ SDK: - VSN: 1.19.0 + VSN: 1.20.0 Methods createAccount diff --git a/docs/v1/appstore/index.html b/docs/v1/appstore/index.html index ef753808..b081cf9e 100644 --- a/docs/v1/appstore/index.html +++ b/docs/v1/appstore/index.html @@ -1133,7 +1133,7 @@ SDK: - VSN: 1.19.0 + VSN: 1.20.0 Methods getSubscription diff --git a/docs/v1/assets/index.html b/docs/v1/assets/index.html index 9400eee0..4ee182b7 100644 --- a/docs/v1/assets/index.html +++ b/docs/v1/assets/index.html @@ -1392,7 +1392,7 @@ SDK: - VSN: 1.19.0 + VSN: 1.20.0 Methods createAsset diff --git a/docs/v1/files/index.html b/docs/v1/files/index.html index 64f11bfb..efc7e727 100644 --- a/docs/v1/files/index.html +++ b/docs/v1/files/index.html @@ -1155,7 +1155,7 @@ SDK: - VSN: 1.19.0 + VSN: 1.20.0 Methods createFileAssociation diff --git a/docs/v1/finance/index.html b/docs/v1/finance/index.html index 68800d60..f076aa0a 100644 --- a/docs/v1/finance/index.html +++ b/docs/v1/finance/index.html @@ -2706,7 +2706,7 @@ SDK: - VSN: 1.19.0 + VSN: 1.20.0 Methods getAccountingActivityAccountUsage diff --git a/docs/v1/payroll-au/index.html b/docs/v1/payroll-au/index.html index d7ba6bb1..15c7de46 100644 --- a/docs/v1/payroll-au/index.html +++ b/docs/v1/payroll-au/index.html @@ -3254,7 +3254,7 @@ SDK: - VSN: 1.19.0 + VSN: 1.20.0 Methods createEmployee diff --git a/docs/v1/payroll-nz/index.html b/docs/v1/payroll-nz/index.html index 91c38b60..cc0655c0 100644 --- a/docs/v1/payroll-nz/index.html +++ b/docs/v1/payroll-nz/index.html @@ -3838,7 +3838,7 @@ SDK: - VSN: 1.19.0 + VSN: 1.20.0 Methods approveTimesheet diff --git a/docs/v1/payroll-uk/index.html b/docs/v1/payroll-uk/index.html index 17c5bc2e..1141c4d5 100644 --- a/docs/v1/payroll-uk/index.html +++ b/docs/v1/payroll-uk/index.html @@ -3510,7 +3510,7 @@ SDK: - VSN: 1.19.0 + VSN: 1.20.0 Methods approveTimesheet diff --git a/docs/v1/projects/index.html b/docs/v1/projects/index.html index 7ee75058..734fc68b 100644 --- a/docs/v1/projects/index.html +++ b/docs/v1/projects/index.html @@ -1468,7 +1468,7 @@ SDK: - VSN: 1.19.0 + VSN: 1.20.0 Methods createProject diff --git a/setup.py b/setup.py index 560f7cb5..227efbdd 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.19.0", + version="1.20.0", ) diff --git a/xero_python/__init__.py b/xero_python/__init__.py index 11afdfc9..9018c9a3 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.19.0" +__version__ = "1.20.0" diff --git a/xero_python/accounting/api/accounting_api.py b/xero_python/accounting/api/accounting_api.py index 5d221f0d..b5dcabfc 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.30.1 + OpenAPI spec version: 2.31.0 """ import importlib diff --git a/xero_python/accounting/docs/LineItem.md b/xero_python/accounting/docs/LineItem.md index 5613e8f6..d62092ec 100644 --- a/xero_python/accounting/docs/LineItem.md +++ b/xero_python/accounting/docs/LineItem.md @@ -13,10 +13,10 @@ Name | Type | Description | Notes **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] **item** | [**LineItemItem**](LineItemItem.md) | | [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] +**line_amount** | **float** | If you wish to omit either 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 either a DiscountRate or DiscountAmount has been used i.e. LineAmount = Quantity * Unit Amount * ((100 - DiscountRate)/100) or LineAmount = (Quantity * UnitAmount) - DiscountAmount | [optional] **tracking** | [**list[LineItemTracking]**](LineItemTracking.md) | Optional Tracking Category – see Tracking. Any LineItem can have a maximum of 2 <TrackingCategory> elements. | [optional] **discount_rate** | **float** | Percentage discount being applied to a line item (only supported on ACCREC invoices – ACC PAY invoices and credit notes in Xero do not support discounts | [optional] -**discount_amount** | **float** | Discount amount being applied to a line item. Only supported on ACCREC invoices - ACCPAY invoices and credit notes in Xero do not support discounts. | [optional] +**discount_amount** | **float** | Discount amount being applied to a line item. Only supported on ACCREC invoices and quotes. ACCPAY invoices and credit notes in Xero do not support discounts. | [optional] **repeating_invoice_id** | **str** | The Xero identifier for a Repeating Invoice | [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/models/line_item.py b/xero_python/accounting/models/line_item.py index 335c7bac..205bf854 100644 --- a/xero_python/accounting/models/line_item.py +++ b/xero_python/accounting/models/line_item.py @@ -365,7 +365,7 @@ def item(self, item): def line_amount(self): """Gets the line_amount of this LineItem. # noqa: E501 - If you wish to omit either of the or 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) # noqa: E501 + If you wish to omit either 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 either a DiscountRate or DiscountAmount has been used i.e. LineAmount = Quantity * Unit Amount * ((100 - DiscountRate)/100) or LineAmount = (Quantity * UnitAmount) - DiscountAmount # noqa: E501 :return: The line_amount of this LineItem. # noqa: E501 :rtype: float @@ -376,7 +376,7 @@ def line_amount(self): def line_amount(self, line_amount): """Sets the line_amount of this LineItem. - If you wish to omit either of the or 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) # noqa: E501 + If you wish to omit either 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 either a DiscountRate or DiscountAmount has been used i.e. LineAmount = Quantity * Unit Amount * ((100 - DiscountRate)/100) or LineAmount = (Quantity * UnitAmount) - DiscountAmount # noqa: E501 :param line_amount: The line_amount of this LineItem. # noqa: E501 :type: float @@ -434,7 +434,7 @@ def discount_rate(self, discount_rate): def discount_amount(self): """Gets the discount_amount of this LineItem. # noqa: E501 - Discount amount being applied to a line item. Only supported on ACCREC invoices - ACCPAY invoices and credit notes in Xero do not support discounts. # noqa: E501 + Discount amount being applied to a line item. Only supported on ACCREC invoices and quotes. ACCPAY invoices and credit notes in Xero do not support discounts. # noqa: E501 :return: The discount_amount of this LineItem. # noqa: E501 :rtype: float @@ -445,7 +445,7 @@ def discount_amount(self): def discount_amount(self, discount_amount): """Sets the discount_amount of this LineItem. - Discount amount being applied to a line item. Only supported on ACCREC invoices - ACCPAY invoices and credit notes in Xero do not support discounts. # noqa: E501 + Discount amount being applied to a line item. Only supported on ACCREC invoices and quotes. ACCPAY invoices and credit notes in Xero do not support discounts. # noqa: E501 :param discount_amount: The discount_amount of this LineItem. # noqa: E501 :type: float diff --git a/xero_python/accounting/models/time_zone.py b/xero_python/accounting/models/time_zone.py index 32191523..ccd9f969 100644 --- a/xero_python/accounting/models/time_zone.py +++ b/xero_python/accounting/models/time_zone.py @@ -24,112 +24,144 @@ class TimeZone(Enum): allowed enum values """ - MOROCCOSTANDARDTIME = "MOROCCOSTANDARDTIME" - UTC = "UTC" - GMTSTANDARDTIME = "GMTSTANDARDTIME" - GREENWICHSTANDARDTIME = "GREENWICHSTANDARDTIME" - WEUROPESTANDARDTIME = "WEUROPESTANDARDTIME" - CENTRALEUROPESTANDARDTIME = "CENTRALEUROPESTANDARDTIME" - ROMANCESTANDARDTIME = "ROMANCESTANDARDTIME" - CENTRALEUROPEANSTANDARDTIME = "CENTRALEUROPEANSTANDARDTIME" - WCENTRALAFRICASTANDARDTIME = "WCENTRALAFRICASTANDARDTIME" - NAMIBIASTANDARDTIME = "NAMIBIASTANDARDTIME" - JORDANSTANDARDTIME = "JORDANSTANDARDTIME" - GTBSTANDARDTIME = "GTBSTANDARDTIME" - MIDDLEEASTSTANDARDTIME = "MIDDLEEASTSTANDARDTIME" - EGYPTSTANDARDTIME = "EGYPTSTANDARDTIME" - SYRIASTANDARDTIME = "SYRIASTANDARDTIME" - EEUROPESTANDARDTIME = "EEUROPESTANDARDTIME" - SOUTHAFRICASTANDARDTIME = "SOUTHAFRICASTANDARDTIME" - FLESTANDARDTIME = "FLESTANDARDTIME" - TURKEYSTANDARDTIME = "TURKEYSTANDARDTIME" - ISRAELSTANDARDTIME = "ISRAELSTANDARDTIME" - KALININGRADSTANDARDTIME = "KALININGRADSTANDARDTIME" - LIBYASTANDARDTIME = "LIBYASTANDARDTIME" + AFGHANISTANSTANDARDTIME = "AFGHANISTANSTANDARDTIME" + ALASKANSTANDARDTIME = "ALASKANSTANDARDTIME" + ALEUTIANSTANDARDTIME = "ALEUTIANSTANDARDTIME" + ALTAISTANDARDTIME = "ALTAISTANDARDTIME" + ARABIANSTANDARDTIME = "ARABIANSTANDARDTIME" ARABICSTANDARDTIME = "ARABICSTANDARDTIME" ARABSTANDARDTIME = "ARABSTANDARDTIME" - BELARUSSTANDARDTIME = "BELARUSSTANDARDTIME" - RUSSIANSTANDARDTIME = "RUSSIANSTANDARDTIME" - EAFRICASTANDARDTIME = "EAFRICASTANDARDTIME" - IRANSTANDARDTIME = "IRANSTANDARDTIME" - ARABIANSTANDARDTIME = "ARABIANSTANDARDTIME" + ARGENTINASTANDARDTIME = "ARGENTINASTANDARDTIME" + ASTRAKHANSTANDARDTIME = "ASTRAKHANSTANDARDTIME" + ATLANTICSTANDARDTIME = "ATLANTICSTANDARDTIME" + AUSCENTRALSTANDARDTIME = "AUSCENTRALSTANDARDTIME" + AUSCENTRALWSTANDARDTIME = "AUSCENTRALWSTANDARDTIME" + AUSEASTERNSTANDARDTIME = "AUSEASTERNSTANDARDTIME" AZERBAIJANSTANDARDTIME = "AZERBAIJANSTANDARDTIME" - RUSSIATIMEZONE3 = "RUSSIATIMEZONE3" - MAURITIUSSTANDARDTIME = "MAURITIUSSTANDARDTIME" - GEORGIANSTANDARDTIME = "GEORGIANSTANDARDTIME" + AZORESSTANDARDTIME = "AZORESSTANDARDTIME" + BAHIASTANDARDTIME = "BAHIASTANDARDTIME" + BANGLADESHSTANDARDTIME = "BANGLADESHSTANDARDTIME" + BELARUSSTANDARDTIME = "BELARUSSTANDARDTIME" + BOUGAINVILLESTANDARDTIME = "BOUGAINVILLESTANDARDTIME" + CANADACENTRALSTANDARDTIME = "CANADACENTRALSTANDARDTIME" + CAPEVERDESTANDARDTIME = "CAPEVERDESTANDARDTIME" CAUCASUSSTANDARDTIME = "CAUCASUSSTANDARDTIME" - AFGHANISTANSTANDARDTIME = "AFGHANISTANSTANDARDTIME" - WESTASIASTANDARDTIME = "WESTASIASTANDARDTIME" - EKATERINBURGSTANDARDTIME = "EKATERINBURGSTANDARDTIME" - PAKISTANSTANDARDTIME = "PAKISTANSTANDARDTIME" - INDIASTANDARDTIME = "INDIASTANDARDTIME" - SRILANKASTANDARDTIME = "SRILANKASTANDARDTIME" - NEPALSTANDARDTIME = "NEPALSTANDARDTIME" + CENAUSTRALIASTANDARDTIME = "CENAUSTRALIASTANDARDTIME" + CENTRALAMERICASTANDARDTIME = "CENTRALAMERICASTANDARDTIME" CENTRALASIASTANDARDTIME = "CENTRALASIASTANDARDTIME" - BANGLADESHSTANDARDTIME = "BANGLADESHSTANDARDTIME" - NCENTRALASIASTANDARDTIME = "NCENTRALASIASTANDARDTIME" - MYANMARSTANDARDTIME = "MYANMARSTANDARDTIME" - SEASIASTANDARDTIME = "SEASIASTANDARDTIME" - NORTHASIASTANDARDTIME = "NORTHASIASTANDARDTIME" + CENTRALBRAZILIANSTANDARDTIME = "CENTRALBRAZILIANSTANDARDTIME" + CENTRALEUROPEANSTANDARDTIME = "CENTRALEUROPEANSTANDARDTIME" + CENTRALEUROPESTANDARDTIME = "CENTRALEUROPESTANDARDTIME" + CENTRALPACIFICSTANDARDTIME = "CENTRALPACIFICSTANDARDTIME" + CENTRALSTANDARDTIME = "CENTRALSTANDARDTIME" + CENTRALSTANDARDTIME_MEXICO_ = "CENTRALSTANDARDTIME(MEXICO)" + CHATHAMISLANDSSTANDARDTIME = "CHATHAMISLANDSSTANDARDTIME" CHINASTANDARDTIME = "CHINASTANDARDTIME" - NORTHASIAEASTSTANDARDTIME = "NORTHASIAEASTSTANDARDTIME" - SINGAPORESTANDARDTIME = "SINGAPORESTANDARDTIME" - WAUSTRALIASTANDARDTIME = "WAUSTRALIASTANDARDTIME" - TAIPEISTANDARDTIME = "TAIPEISTANDARDTIME" - ULAANBAATARSTANDARDTIME = "ULAANBAATARSTANDARDTIME" - TOKYOSTANDARDTIME = "TOKYOSTANDARDTIME" - KOREASTANDARDTIME = "KOREASTANDARDTIME" - YAKUTSKSTANDARDTIME = "YAKUTSKSTANDARDTIME" - CENAUSTRALIASTANDARDTIME = "CENAUSTRALIASTANDARDTIME" - AUSCENTRALSTANDARDTIME = "AUSCENTRALSTANDARDTIME" + CUBASTANDARDTIME = "CUBASTANDARDTIME" + DATELINESTANDARDTIME = "DATELINESTANDARDTIME" + EAFRICASTANDARDTIME = "EAFRICASTANDARDTIME" + EASTERISLANDSTANDARDTIME = "EASTERISLANDSTANDARDTIME" + EASTERNSTANDARDTIME = "EASTERNSTANDARDTIME" + EASTERNSTANDARDTIME_MEXICO_ = "EASTERNSTANDARDTIME(MEXICO)" EAUSTRALIASTANDARDTIME = "EAUSTRALIASTANDARDTIME" - AUSEASTERNSTANDARDTIME = "AUSEASTERNSTANDARDTIME" - WESTPACIFICSTANDARDTIME = "WESTPACIFICSTANDARDTIME" - TASMANIASTANDARDTIME = "TASMANIASTANDARDTIME" - MAGADANSTANDARDTIME = "MAGADANSTANDARDTIME" - VLADIVOSTOKSTANDARDTIME = "VLADIVOSTOKSTANDARDTIME" - RUSSIATIMEZONE10 = "RUSSIATIMEZONE10" - CENTRALPACIFICSTANDARDTIME = "CENTRALPACIFICSTANDARDTIME" - RUSSIATIMEZONE11 = "RUSSIATIMEZONE11" - NEWZEALANDSTANDARDTIME = "NEWZEALANDSTANDARDTIME" - UTC_12 = "UTC+12" - UTC_13 = "UTC+13" + EEUROPESTANDARDTIME = "EEUROPESTANDARDTIME" + EGYPTSTANDARDTIME = "EGYPTSTANDARDTIME" + EKATERINBURGSTANDARDTIME = "EKATERINBURGSTANDARDTIME" + ESOUTHAMERICASTANDARDTIME = "ESOUTHAMERICASTANDARDTIME" FIJISTANDARDTIME = "FIJISTANDARDTIME" + FLESTANDARDTIME = "FLESTANDARDTIME" + GEORGIANSTANDARDTIME = "GEORGIANSTANDARDTIME" + GMTSTANDARDTIME = "GMTSTANDARDTIME" + GREENLANDSTANDARDTIME = "GREENLANDSTANDARDTIME" + GREENWICHSTANDARDTIME = "GREENWICHSTANDARDTIME" + GTBSTANDARDTIME = "GTBSTANDARDTIME" + HAITISTANDARDTIME = "HAITISTANDARDTIME" + HAWAIIANSTANDARDTIME = "HAWAIIANSTANDARDTIME" + INDIASTANDARDTIME = "INDIASTANDARDTIME" + IRANSTANDARDTIME = "IRANSTANDARDTIME" + ISRAELSTANDARDTIME = "ISRAELSTANDARDTIME" + JORDANSTANDARDTIME = "JORDANSTANDARDTIME" + KALININGRADSTANDARDTIME = "KALININGRADSTANDARDTIME" KAMCHATKASTANDARDTIME = "KAMCHATKASTANDARDTIME" - TONGASTANDARDTIME = "TONGASTANDARDTIME" - SAMOASTANDARDTIME = "SAMOASTANDARDTIME" + KOREASTANDARDTIME = "KOREASTANDARDTIME" + LIBYASTANDARDTIME = "LIBYASTANDARDTIME" LINEISLANDSSTANDARDTIME = "LINEISLANDSSTANDARDTIME" - AZORESSTANDARDTIME = "AZORESSTANDARDTIME" - CAPEVERDESTANDARDTIME = "CAPEVERDESTANDARDTIME" - UTC02 = "UTC02" + LORDHOWESTANDARDTIME = "LORDHOWESTANDARDTIME" + MAGADANSTANDARDTIME = "MAGADANSTANDARDTIME" + MAGALLANESSTANDARDTIME = "MAGALLANESSTANDARDTIME" + MARQUESASSTANDARDTIME = "MARQUESASSTANDARDTIME" + MAURITIUSSTANDARDTIME = "MAURITIUSSTANDARDTIME" MIDATLANTICSTANDARDTIME = "MIDATLANTICSTANDARDTIME" - ESOUTHAMERICASTANDARDTIME = "ESOUTHAMERICASTANDARDTIME" - ARGENTINASTANDARDTIME = "ARGENTINASTANDARDTIME" - SAEASTERNSTANDARDTIME = "SAEASTERNSTANDARDTIME" - GREENLANDSTANDARDTIME = "GREENLANDSTANDARDTIME" + MIDDLEEASTSTANDARDTIME = "MIDDLEEASTSTANDARDTIME" MONTEVIDEOSTANDARDTIME = "MONTEVIDEOSTANDARDTIME" - BAHIASTANDARDTIME = "BAHIASTANDARDTIME" + MOROCCOSTANDARDTIME = "MOROCCOSTANDARDTIME" + MOUNTAINSTANDARDTIME = "MOUNTAINSTANDARDTIME" + MOUNTAINSTANDARDTIME_MEXICO_ = "MOUNTAINSTANDARDTIME(MEXICO)" + MYANMARSTANDARDTIME = "MYANMARSTANDARDTIME" + NAMIBIASTANDARDTIME = "NAMIBIASTANDARDTIME" + NCENTRALASIASTANDARDTIME = "NCENTRALASIASTANDARDTIME" + NEPALSTANDARDTIME = "NEPALSTANDARDTIME" NEWFOUNDLANDSTANDARDTIME = "NEWFOUNDLANDSTANDARDTIME" - PARAGUAYSTANDARDTIME = "PARAGUAYSTANDARDTIME" - ATLANTICSTANDARDTIME = "ATLANTICSTANDARDTIME" - CENTRALBRAZILIANSTANDARDTIME = "CENTRALBRAZILIANSTANDARDTIME" - SAWESTERNSTANDARDTIME = "SAWESTERNSTANDARDTIME" + NEWZEALANDSTANDARDTIME = "NEWZEALANDSTANDARDTIME" + NORFOLKSTANDARDTIME = "NORFOLKSTANDARDTIME" + NORTHASIAEASTSTANDARDTIME = "NORTHASIAEASTSTANDARDTIME" + NORTHASIASTANDARDTIME = "NORTHASIASTANDARDTIME" + NORTHKOREASTANDARDTIME = "NORTHKOREASTANDARDTIME" + OMSKSTANDARDTIME = "OMSKSTANDARDTIME" PACIFICSASTANDARDTIME = "PACIFICSASTANDARDTIME" - VENEZUELASTANDARDTIME = "VENEZUELASTANDARDTIME" + PACIFICSTANDARDTIME = "PACIFICSTANDARDTIME" + PACIFICSTANDARDTIME_MEXICO_ = "PACIFICSTANDARDTIME(MEXICO)" + PAKISTANSTANDARDTIME = "PAKISTANSTANDARDTIME" + PARAGUAYSTANDARDTIME = "PARAGUAYSTANDARDTIME" + QYZYLORDASTANDARDTIME = "QYZYLORDASTANDARDTIME" + ROMANCESTANDARDTIME = "ROMANCESTANDARDTIME" + RUSSIANSTANDARDTIME = "RUSSIANSTANDARDTIME" + RUSSIATIMEZONE10 = "RUSSIATIMEZONE10" + RUSSIATIMEZONE11 = "RUSSIATIMEZONE11" + RUSSIATIMEZONE3 = "RUSSIATIMEZONE3" + SAEASTERNSTANDARDTIME = "SAEASTERNSTANDARDTIME" + SAINTPIERRESTANDARDTIME = "SAINTPIERRESTANDARDTIME" + SAKHALINSTANDARDTIME = "SAKHALINSTANDARDTIME" + SAMOASTANDARDTIME = "SAMOASTANDARDTIME" + SAOTOMESTANDARDTIME = "SAOTOMESTANDARDTIME" SAPACIFICSTANDARDTIME = "SAPACIFICSTANDARDTIME" - EASTERNSTANDARDTIME = "EASTERNSTANDARDTIME" + SARATOVSTANDARDTIME = "SARATOVSTANDARDTIME" + SAWESTERNSTANDARDTIME = "SAWESTERNSTANDARDTIME" + SEASIASTANDARDTIME = "SEASIASTANDARDTIME" + SINGAPORESTANDARDTIME = "SINGAPORESTANDARDTIME" + SOUTHAFRICASTANDARDTIME = "SOUTHAFRICASTANDARDTIME" + SOUTHSUDANSTANDARDTIME = "SOUTHSUDANSTANDARDTIME" + SRILANKASTANDARDTIME = "SRILANKASTANDARDTIME" + SUDANSTANDARDTIME = "SUDANSTANDARDTIME" + SYRIASTANDARDTIME = "SYRIASTANDARDTIME" + TAIPEISTANDARDTIME = "TAIPEISTANDARDTIME" + TASMANIASTANDARDTIME = "TASMANIASTANDARDTIME" + TOCANTINSSTANDARDTIME = "TOCANTINSSTANDARDTIME" + TOKYOSTANDARDTIME = "TOKYOSTANDARDTIME" + TOMSKSTANDARDTIME = "TOMSKSTANDARDTIME" + TONGASTANDARDTIME = "TONGASTANDARDTIME" + TRANSBAIKALSTANDARDTIME = "TRANSBAIKALSTANDARDTIME" + TURKEYSTANDARDTIME = "TURKEYSTANDARDTIME" + TURKSANDCAICOSSTANDARDTIME = "TURKSANDCAICOSSTANDARDTIME" + ULAANBAATARSTANDARDTIME = "ULAANBAATARSTANDARDTIME" USEASTERNSTANDARDTIME = "USEASTERNSTANDARDTIME" - CENTRALAMERICASTANDARDTIME = "CENTRALAMERICASTANDARDTIME" - CENTRALSTANDARDTIME = "CENTRALSTANDARDTIME" - CENTRALSTANDARDTIME_MEXICO_ = "CENTRALSTANDARDTIME(MEXICO)" - CANADACENTRALSTANDARDTIME = "CANADACENTRALSTANDARDTIME" USMOUNTAINSTANDARDTIME = "USMOUNTAINSTANDARDTIME" - MOUNTAINSTANDARDTIME_MEXICO_ = "MOUNTAINSTANDARDTIME(MEXICO)" - MOUNTAINSTANDARDTIME = "MOUNTAINSTANDARDTIME" - PACIFICSTANDARDTIME_MEXICO_ = "PACIFICSTANDARDTIME(MEXICO)" - PACIFICSTANDARDTIME = "PACIFICSTANDARDTIME" - ALASKANSTANDARDTIME = "ALASKANSTANDARDTIME" - HAWAIIANSTANDARDTIME = "HAWAIIANSTANDARDTIME" + UTC = "UTC" + UTC_12 = "UTC+12" + UTC_13 = "UTC+13" + UTC02 = "UTC02" + UTC08 = "UTC08" + UTC09 = "UTC09" UTC11 = "UTC11" - DATELINESTANDARDTIME = "DATELINESTANDARDTIME" - EASTERISLANDSTANDARDTIME = "EASTERISLANDSTANDARDTIME" + VENEZUELASTANDARDTIME = "VENEZUELASTANDARDTIME" + VLADIVOSTOKSTANDARDTIME = "VLADIVOSTOKSTANDARDTIME" + VOLGOGRADSTANDARDTIME = "VOLGOGRADSTANDARDTIME" + WAUSTRALIASTANDARDTIME = "WAUSTRALIASTANDARDTIME" + WCENTRALAFRICASTANDARDTIME = "WCENTRALAFRICASTANDARDTIME" + WESTASIASTANDARDTIME = "WESTASIASTANDARDTIME" + WESTBANKSTANDARDTIME = "WESTBANKSTANDARDTIME" + WESTPACIFICSTANDARDTIME = "WESTPACIFICSTANDARDTIME" + WEUROPESTANDARDTIME = "WEUROPESTANDARDTIME" + WMONGOLIASTANDARDTIME = "WMONGOLIASTANDARDTIME" + YAKUTSKSTANDARDTIME = "YAKUTSKSTANDARDTIME" + YUKONSTANDARDTIME = "YUKONSTANDARDTIME" diff --git a/xero_python/appstore/__init__.py b/xero_python/appstore/__init__.py index 3edeead4..b47e2dcb 100644 --- a/xero_python/appstore/__init__.py +++ b/xero_python/appstore/__init__.py @@ -17,9 +17,13 @@ # import models into sdk package +from xero_python.appstore.models.create_usage_record import CreateUsageRecord from xero_python.appstore.models.plan import Plan from xero_python.appstore.models.price import Price from xero_python.appstore.models.problem_details import ProblemDetails from xero_python.appstore.models.product import Product from xero_python.appstore.models.subscription import Subscription from xero_python.appstore.models.subscription_item import SubscriptionItem +from xero_python.appstore.models.update_usage_record import UpdateUsageRecord +from xero_python.appstore.models.usage_record import UsageRecord +from xero_python.appstore.models.usage_records_list import UsageRecordsList diff --git a/xero_python/appstore/api/app_store_api.py b/xero_python/appstore/api/app_store_api.py index e4515a97..b5d5c829 100644 --- a/xero_python/appstore/api/app_store_api.py +++ b/xero_python/appstore/api/app_store_api.py @@ -10,7 +10,7 @@ """ """ - OpenAPI spec version: 2.30.1 + OpenAPI spec version: 2.31.0 """ import importlib @@ -121,3 +121,258 @@ def get_subscription( ) except exceptions.HTTPStatusException as error: raise translate_status_exception(error, self, "get_subscription") + + def get_usage_records( + self, + subscription_id, + _return_http_data_only=True, + _preload_content=True, + _request_timeout=None, + ): + """Gets all usage records related to the subscription # noqa: E501 + OAuth2 scope: marketplace.billing + :param str subscription_id: Unique identifier for Subscription object (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: UsageRecordsList + """ + + # verify the required parameter 'subscription_id' is set + if subscription_id is None: + raise ValueError( + "Missing the required parameter `subscription_id` " + "when calling `get_usage_records`" + ) + + collection_formats = {} + path_params = { + "subscriptionId": subscription_id, + } + + query_params = [] + + header_params = {} + + 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("/subscriptions/{subscriptionId}/usage-records") + + 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="UsageRecordsList", + 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_usage_records") + + def post_usage_records( + self, + subscription_id, + subscription_item_id, + create_usage_record, + _return_http_data_only=True, + _preload_content=True, + _request_timeout=None, + ): + """Send metered usage belonging to this subscription and subscription item # noqa: E501 + OAuth2 scope: marketplace.billing + :param str subscription_id: Unique identifier for Subscription object (required) + :param str subscription_item_id: The unique identifier of the subscriptionItem (required) + :param CreateUsageRecord create_usage_record: Contains the quantity for the usage record to create (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: UsageRecord + """ + + # verify the required parameter 'subscription_id' is set + if subscription_id is None: + raise ValueError( + "Missing the required parameter `subscription_id` " + "when calling `post_usage_records`" + ) + # verify the required parameter 'subscription_item_id' is set + if subscription_item_id is None: + raise ValueError( + "Missing the required parameter `subscription_item_id` " + "when calling `post_usage_records`" + ) + # verify the required parameter 'create_usage_record' is set + if create_usage_record is None: + raise ValueError( + "Missing the required parameter `create_usage_record` " + "when calling `post_usage_records`" + ) + + collection_formats = {} + path_params = { + "subscriptionId": subscription_id, + "subscriptionItemId": subscription_item_id, + } + + query_params = [] + + header_params = {} + + local_var_files = {} + form_params = [] + + body_params = create_usage_record + # HTTP header `Accept` + header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # HTTP header `Content-Type` + header_params["Content-Type"] = self.api_client.select_header_content_type( + ["application/json"] + ) + + # Authentication setting + auth_settings = ["OAuth2"] + url = self.get_resource_url( + "/subscriptions/{subscriptionId}/items/{subscriptionItemId}/usage-records" + ) + + try: + return self.api_client.call_api( + url, + "POST", + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type="UsageRecord", + 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, "post_usage_records") + + def put_usage_records( + self, + subscription_id, + subscription_item_id, + usage_record_id, + update_usage_record, + _return_http_data_only=True, + _preload_content=True, + _request_timeout=None, + ): + """Update and existing metered usage belonging to this subscription and subscription item # noqa: E501 + OAuth2 scope: marketplace.billing + :param str subscription_id: Unique identifier for Subscription object (required) + :param str subscription_item_id: The unique identifier of the subscriptionItem (required) + :param str usage_record_id: The unique identifier of the usage record (required) + :param UpdateUsageRecord update_usage_record: Contains the quantity for the usage record to update (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: UsageRecord + """ + + # verify the required parameter 'subscription_id' is set + if subscription_id is None: + raise ValueError( + "Missing the required parameter `subscription_id` " + "when calling `put_usage_records`" + ) + # verify the required parameter 'subscription_item_id' is set + if subscription_item_id is None: + raise ValueError( + "Missing the required parameter `subscription_item_id` " + "when calling `put_usage_records`" + ) + # verify the required parameter 'usage_record_id' is set + if usage_record_id is None: + raise ValueError( + "Missing the required parameter `usage_record_id` " + "when calling `put_usage_records`" + ) + # verify the required parameter 'update_usage_record' is set + if update_usage_record is None: + raise ValueError( + "Missing the required parameter `update_usage_record` " + "when calling `put_usage_records`" + ) + + collection_formats = {} + path_params = { + "subscriptionId": subscription_id, + "subscriptionItemId": subscription_item_id, + "usageRecordId": usage_record_id, + } + + query_params = [] + + header_params = {} + + local_var_files = {} + form_params = [] + + body_params = update_usage_record + # HTTP header `Accept` + header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # HTTP header `Content-Type` + header_params["Content-Type"] = self.api_client.select_header_content_type( + ["application/json"] + ) + + # Authentication setting + auth_settings = ["OAuth2"] + url = self.get_resource_url( + "/subscriptions/{subscriptionId}/items/{subscriptionItemId}/usage-records/{usageRecordId}" + ) + + try: + return self.api_client.call_api( + url, + "PUT", + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type="UsageRecord", + 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, "put_usage_records") diff --git a/xero_python/appstore/docs/AppStoreApi.md b/xero_python/appstore/docs/AppStoreApi.md index 475c655b..5c5f141f 100644 --- a/xero_python/appstore/docs/AppStoreApi.md +++ b/xero_python/appstore/docs/AppStoreApi.md @@ -5,6 +5,9 @@ All URIs are relative to *https://api.xero.com/appstore/2.0* Method | HTTP request | Description ------------- | ------------- | ------------- [**get_subscription**](AppStoreApi.md#get_subscription) | **GET** /subscriptions/{subscriptionId} | Retrieves a subscription for a given subscriptionId +[**get_usage_records**](AppStoreApi.md#get_usage_records) | **GET** /subscriptions/{subscriptionId}/usage-records | Gets all usage records related to the subscription +[**post_usage_records**](AppStoreApi.md#post_usage_records) | **POST** /subscriptions/{subscriptionId}/items/{subscriptionItemId}/usage-records | Send metered usage belonging to this subscription and subscription item +[**put_usage_records**](AppStoreApi.md#put_usage_records) | **PUT** /subscriptions/{subscriptionId}/items/{subscriptionItemId}/usage-records/{usageRecordId} | Update and existing metered usage belonging to this subscription and subscription item # **get_subscription** @@ -68,3 +71,196 @@ 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_usage_records** +> UsageRecordsList get_usage_records(subscription_id) + +Gets all usage records related to the subscription + +### 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.appstore import AppStoreApi +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 = AppStoreApi(api_client) + +subscription_id = '00000000-0000-0000-0000-000000000000' # str | Unique identifier for Subscription object +try: + # Gets all usage records related to the subscription + api_response = api_instance.get_usage_records(subscription_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling AppStoreApi->get_usage_records: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **subscription_id** | [**str**](.md)| Unique identifier for Subscription object | + +### Return type + +[**UsageRecordsList**](UsageRecordsList.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) + +# **post_usage_records** +> UsageRecord post_usage_records(subscription_id, subscription_item_id, create_usage_record) + +Send metered usage belonging to this subscription and subscription item + +### 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.appstore import AppStoreApi +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 = AppStoreApi(api_client) + +subscription_id = '00000000-0000-0000-0000-000000000000' # str | Unique identifier for Subscription object +subscription_item_id = '00000000-0000-0000-0000-000000000000' # str | The unique identifier of the subscriptionItem +create_usage_record = { "timestamp": "2022-01-21T13:01:00Z", "quantity": 10 } # CreateUsageRecord | Contains the quantity for the usage record to create +try: + # Send metered usage belonging to this subscription and subscription item + api_response = api_instance.post_usage_records(subscription_id, subscription_item_id, create_usage_record) + pprint(api_response) +except ApiException as e: + print("Exception when calling AppStoreApi->post_usage_records: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **subscription_id** | [**str**](.md)| Unique identifier for Subscription object | + **subscription_item_id** | [**str**](.md)| The unique identifier of the subscriptionItem | + **create_usage_record** | [**CreateUsageRecord**](CreateUsageRecord.md)| Contains the quantity for the usage record to create | + +### Return type + +[**UsageRecord**](UsageRecord.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **put_usage_records** +> UsageRecord put_usage_records(subscription_id, subscription_item_id, usage_record_id, update_usage_record) + +Update and existing metered usage belonging to this subscription and subscription item + +### 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.appstore import AppStoreApi +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 = AppStoreApi(api_client) + +subscription_id = '00000000-0000-0000-0000-000000000000' # str | Unique identifier for Subscription object +subscription_item_id = '00000000-0000-0000-0000-000000000000' # str | The unique identifier of the subscriptionItem +usage_record_id = '00000000-0000-0000-0000-000000000000' # str | The unique identifier of the usage record +update_usage_record = { "quantity": 10 } # UpdateUsageRecord | Contains the quantity for the usage record to update +try: + # Update and existing metered usage belonging to this subscription and subscription item + api_response = api_instance.put_usage_records(subscription_id, subscription_item_id, usage_record_id, update_usage_record) + pprint(api_response) +except ApiException as e: + print("Exception when calling AppStoreApi->put_usage_records: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **subscription_id** | [**str**](.md)| Unique identifier for Subscription object | + **subscription_item_id** | [**str**](.md)| The unique identifier of the subscriptionItem | + **usage_record_id** | [**str**](.md)| The unique identifier of the usage record | + **update_usage_record** | [**UpdateUsageRecord**](UpdateUsageRecord.md)| Contains the quantity for the usage record to update | + +### Return type + +[**UsageRecord**](UsageRecord.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/xero_python/appstore/docs/CreateUsageRecord.md b/xero_python/appstore/docs/CreateUsageRecord.md new file mode 100644 index 00000000..b570e578 --- /dev/null +++ b/xero_python/appstore/docs/CreateUsageRecord.md @@ -0,0 +1,11 @@ +# CreateUsageRecord + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**quantity** | **int** | The initial quantity for the usage record. Must be a whole number that is greater than or equal to 0 | +**timestamp** | **datetime** | DateTime in UTC of when the the product was consumed/used | + +[[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/appstore/docs/UpdateUsageRecord.md b/xero_python/appstore/docs/UpdateUsageRecord.md new file mode 100644 index 00000000..e22fc3b9 --- /dev/null +++ b/xero_python/appstore/docs/UpdateUsageRecord.md @@ -0,0 +1,10 @@ +# UpdateUsageRecord + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**quantity** | **int** | The new quantity for the usage record. Must be a whole number that is greater than or equal to 0 | + +[[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/appstore/docs/UsageRecord.md b/xero_python/appstore/docs/UsageRecord.md new file mode 100644 index 00000000..3f8339a3 --- /dev/null +++ b/xero_python/appstore/docs/UsageRecord.md @@ -0,0 +1,17 @@ +# UsageRecord + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**quantity** | **int** | The quantity recorded | +**subscription_id** | **str** | The unique identifier of the Subscription. | +**subscription_item_id** | **str** | The unique identifier of the SubscriptionItem. | +**test_mode** | **bool** | If the subscription is a test subscription | +**recorded_at** | **datetime** | The time when this usage was recorded in UTC | +**usage_record_id** | **str** | The unique identifier of the usageRecord. | +**price_per_unit** | **float** | The price per unit | +**product_id** | **str** | The unique identifier of the linked Product | + +[[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/appstore/docs/UsageRecordsList.md b/xero_python/appstore/docs/UsageRecordsList.md new file mode 100644 index 00000000..278ee3c6 --- /dev/null +++ b/xero_python/appstore/docs/UsageRecordsList.md @@ -0,0 +1,10 @@ +# UsageRecordsList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**usage_records** | [**list[UsageRecord]**](UsageRecord.md) | A collection of usage records | + +[[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/appstore/models/__init__.py b/xero_python/appstore/models/__init__.py index f0a6a556..7ebc8cd9 100644 --- a/xero_python/appstore/models/__init__.py +++ b/xero_python/appstore/models/__init__.py @@ -12,9 +12,13 @@ # import models into model package +from xero_python.appstore.models.create_usage_record import CreateUsageRecord from xero_python.appstore.models.plan import Plan from xero_python.appstore.models.price import Price from xero_python.appstore.models.problem_details import ProblemDetails from xero_python.appstore.models.product import Product from xero_python.appstore.models.subscription import Subscription from xero_python.appstore.models.subscription_item import SubscriptionItem +from xero_python.appstore.models.update_usage_record import UpdateUsageRecord +from xero_python.appstore.models.usage_record import UsageRecord +from xero_python.appstore.models.usage_records_list import UsageRecordsList diff --git a/xero_python/appstore/models/create_usage_record.py b/xero_python/appstore/models/create_usage_record.py new file mode 100644 index 00000000..9eaad4e7 --- /dev/null +++ b/xero_python/appstore/models/create_usage_record.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Xero AppStore API + + These endpoints are for Xero Partners to interact with the App Store Billing platform # noqa: E501 + + Contact: api@xero.com + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 + +from xero_python.models import BaseModel + + +class CreateUsageRecord(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 = {"quantity": "int", "timestamp": "datetime"} + + attribute_map = {"quantity": "quantity", "timestamp": "timestamp"} + + def __init__(self, quantity=None, timestamp=None): # noqa: E501 + """CreateUsageRecord - a model defined in OpenAPI""" # noqa: E501 + + self._quantity = None + self._timestamp = None + self.discriminator = None + + self.quantity = quantity + self.timestamp = timestamp + + @property + def quantity(self): + """Gets the quantity of this CreateUsageRecord. # noqa: E501 + + The initial quantity for the usage record. Must be a whole number that is greater than or equal to 0 # noqa: E501 + + :return: The quantity of this CreateUsageRecord. # noqa: E501 + :rtype: int + """ + return self._quantity + + @quantity.setter + def quantity(self, quantity): + """Sets the quantity of this CreateUsageRecord. + + The initial quantity for the usage record. Must be a whole number that is greater than or equal to 0 # noqa: E501 + + :param quantity: The quantity of this CreateUsageRecord. # noqa: E501 + :type: int + """ + if quantity is None: + raise ValueError( + "Invalid value for `quantity`, must not be `None`" + ) # noqa: E501 + + self._quantity = quantity + + @property + def timestamp(self): + """Gets the timestamp of this CreateUsageRecord. # noqa: E501 + + DateTime in UTC of when the the product was consumed/used # noqa: E501 + + :return: The timestamp of this CreateUsageRecord. # noqa: E501 + :rtype: datetime + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this CreateUsageRecord. + + DateTime in UTC of when the the product was consumed/used # noqa: E501 + + :param timestamp: The timestamp of this CreateUsageRecord. # noqa: E501 + :type: datetime + """ + if timestamp is None: + raise ValueError( + "Invalid value for `timestamp`, must not be `None`" + ) # noqa: E501 + + self._timestamp = timestamp diff --git a/xero_python/appstore/models/update_usage_record.py b/xero_python/appstore/models/update_usage_record.py new file mode 100644 index 00000000..09a7a3b0 --- /dev/null +++ b/xero_python/appstore/models/update_usage_record.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + Xero AppStore API + + These endpoints are for Xero Partners to interact with the App Store Billing platform # noqa: E501 + + Contact: api@xero.com + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 + +from xero_python.models import BaseModel + + +class UpdateUsageRecord(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 = {"quantity": "int"} + + attribute_map = {"quantity": "quantity"} + + def __init__(self, quantity=None): # noqa: E501 + """UpdateUsageRecord - a model defined in OpenAPI""" # noqa: E501 + + self._quantity = None + self.discriminator = None + + self.quantity = quantity + + @property + def quantity(self): + """Gets the quantity of this UpdateUsageRecord. # noqa: E501 + + The new quantity for the usage record. Must be a whole number that is greater than or equal to 0 # noqa: E501 + + :return: The quantity of this UpdateUsageRecord. # noqa: E501 + :rtype: int + """ + return self._quantity + + @quantity.setter + def quantity(self, quantity): + """Sets the quantity of this UpdateUsageRecord. + + The new quantity for the usage record. Must be a whole number that is greater than or equal to 0 # noqa: E501 + + :param quantity: The quantity of this UpdateUsageRecord. # noqa: E501 + :type: int + """ + if quantity is None: + raise ValueError( + "Invalid value for `quantity`, must not be `None`" + ) # noqa: E501 + + self._quantity = quantity diff --git a/xero_python/appstore/models/usage_record.py b/xero_python/appstore/models/usage_record.py new file mode 100644 index 00000000..5bf1ec3f --- /dev/null +++ b/xero_python/appstore/models/usage_record.py @@ -0,0 +1,300 @@ +# coding: utf-8 + +""" + Xero AppStore API + + These endpoints are for Xero Partners to interact with the App Store Billing platform # noqa: E501 + + Contact: api@xero.com + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 + +from xero_python.models import BaseModel + + +class UsageRecord(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 = { + "quantity": "int", + "subscription_id": "str", + "subscription_item_id": "str", + "test_mode": "bool", + "recorded_at": "datetime", + "usage_record_id": "str", + "price_per_unit": "float", + "product_id": "str", + } + + attribute_map = { + "quantity": "quantity", + "subscription_id": "subscriptionId", + "subscription_item_id": "subscriptionItemId", + "test_mode": "testMode", + "recorded_at": "recordedAt", + "usage_record_id": "usageRecordId", + "price_per_unit": "pricePerUnit", + "product_id": "productId", + } + + def __init__( + self, + quantity=None, + subscription_id=None, + subscription_item_id=None, + test_mode=None, + recorded_at=None, + usage_record_id=None, + price_per_unit=None, + product_id=None, + ): # noqa: E501 + """UsageRecord - a model defined in OpenAPI""" # noqa: E501 + + self._quantity = None + self._subscription_id = None + self._subscription_item_id = None + self._test_mode = None + self._recorded_at = None + self._usage_record_id = None + self._price_per_unit = None + self._product_id = None + self.discriminator = None + + self.quantity = quantity + self.subscription_id = subscription_id + self.subscription_item_id = subscription_item_id + self.test_mode = test_mode + self.recorded_at = recorded_at + self.usage_record_id = usage_record_id + self.price_per_unit = price_per_unit + self.product_id = product_id + + @property + def quantity(self): + """Gets the quantity of this UsageRecord. # noqa: E501 + + The quantity recorded # noqa: E501 + + :return: The quantity of this UsageRecord. # noqa: E501 + :rtype: int + """ + return self._quantity + + @quantity.setter + def quantity(self, quantity): + """Sets the quantity of this UsageRecord. + + The quantity recorded # noqa: E501 + + :param quantity: The quantity of this UsageRecord. # noqa: E501 + :type: int + """ + if quantity is None: + raise ValueError( + "Invalid value for `quantity`, must not be `None`" + ) # noqa: E501 + + self._quantity = quantity + + @property + def subscription_id(self): + """Gets the subscription_id of this UsageRecord. # noqa: E501 + + The unique identifier of the Subscription. # noqa: E501 + + :return: The subscription_id of this UsageRecord. # noqa: E501 + :rtype: str + """ + return self._subscription_id + + @subscription_id.setter + def subscription_id(self, subscription_id): + """Sets the subscription_id of this UsageRecord. + + The unique identifier of the Subscription. # noqa: E501 + + :param subscription_id: The subscription_id of this UsageRecord. # noqa: E501 + :type: str + """ + if subscription_id is None: + raise ValueError( + "Invalid value for `subscription_id`, must not be `None`" + ) # noqa: E501 + + self._subscription_id = subscription_id + + @property + def subscription_item_id(self): + """Gets the subscription_item_id of this UsageRecord. # noqa: E501 + + The unique identifier of the SubscriptionItem. # noqa: E501 + + :return: The subscription_item_id of this UsageRecord. # noqa: E501 + :rtype: str + """ + return self._subscription_item_id + + @subscription_item_id.setter + def subscription_item_id(self, subscription_item_id): + """Sets the subscription_item_id of this UsageRecord. + + The unique identifier of the SubscriptionItem. # noqa: E501 + + :param subscription_item_id: The subscription_item_id of this UsageRecord. # noqa: E501 + :type: str + """ + if subscription_item_id is None: + raise ValueError( + "Invalid value for `subscription_item_id`, must not be `None`" + ) # noqa: E501 + + self._subscription_item_id = subscription_item_id + + @property + def test_mode(self): + """Gets the test_mode of this UsageRecord. # noqa: E501 + + If the subscription is a test subscription # noqa: E501 + + :return: The test_mode of this UsageRecord. # noqa: E501 + :rtype: bool + """ + return self._test_mode + + @test_mode.setter + def test_mode(self, test_mode): + """Sets the test_mode of this UsageRecord. + + If the subscription is a test subscription # noqa: E501 + + :param test_mode: The test_mode of this UsageRecord. # noqa: E501 + :type: bool + """ + if test_mode is None: + raise ValueError( + "Invalid value for `test_mode`, must not be `None`" + ) # noqa: E501 + + self._test_mode = test_mode + + @property + def recorded_at(self): + """Gets the recorded_at of this UsageRecord. # noqa: E501 + + The time when this usage was recorded in UTC # noqa: E501 + + :return: The recorded_at of this UsageRecord. # noqa: E501 + :rtype: datetime + """ + return self._recorded_at + + @recorded_at.setter + def recorded_at(self, recorded_at): + """Sets the recorded_at of this UsageRecord. + + The time when this usage was recorded in UTC # noqa: E501 + + :param recorded_at: The recorded_at of this UsageRecord. # noqa: E501 + :type: datetime + """ + if recorded_at is None: + raise ValueError( + "Invalid value for `recorded_at`, must not be `None`" + ) # noqa: E501 + + self._recorded_at = recorded_at + + @property + def usage_record_id(self): + """Gets the usage_record_id of this UsageRecord. # noqa: E501 + + The unique identifier of the usageRecord. # noqa: E501 + + :return: The usage_record_id of this UsageRecord. # noqa: E501 + :rtype: str + """ + return self._usage_record_id + + @usage_record_id.setter + def usage_record_id(self, usage_record_id): + """Sets the usage_record_id of this UsageRecord. + + The unique identifier of the usageRecord. # noqa: E501 + + :param usage_record_id: The usage_record_id of this UsageRecord. # noqa: E501 + :type: str + """ + if usage_record_id is None: + raise ValueError( + "Invalid value for `usage_record_id`, must not be `None`" + ) # noqa: E501 + + self._usage_record_id = usage_record_id + + @property + def price_per_unit(self): + """Gets the price_per_unit of this UsageRecord. # noqa: E501 + + The price per unit # noqa: E501 + + :return: The price_per_unit of this UsageRecord. # noqa: E501 + :rtype: float + """ + return self._price_per_unit + + @price_per_unit.setter + def price_per_unit(self, price_per_unit): + """Sets the price_per_unit of this UsageRecord. + + The price per unit # noqa: E501 + + :param price_per_unit: The price_per_unit of this UsageRecord. # noqa: E501 + :type: float + """ + if price_per_unit is None: + raise ValueError( + "Invalid value for `price_per_unit`, must not be `None`" + ) # noqa: E501 + + self._price_per_unit = price_per_unit + + @property + def product_id(self): + """Gets the product_id of this UsageRecord. # noqa: E501 + + The unique identifier of the linked Product # noqa: E501 + + :return: The product_id of this UsageRecord. # noqa: E501 + :rtype: str + """ + return self._product_id + + @product_id.setter + def product_id(self, product_id): + """Sets the product_id of this UsageRecord. + + The unique identifier of the linked Product # noqa: E501 + + :param product_id: The product_id of this UsageRecord. # noqa: E501 + :type: str + """ + if product_id is None: + raise ValueError( + "Invalid value for `product_id`, must not be `None`" + ) # noqa: E501 + + self._product_id = product_id diff --git a/xero_python/appstore/models/usage_records_list.py b/xero_python/appstore/models/usage_records_list.py new file mode 100644 index 00000000..81f7b62b --- /dev/null +++ b/xero_python/appstore/models/usage_records_list.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + Xero AppStore API + + These endpoints are for Xero Partners to interact with the App Store Billing platform # noqa: E501 + + Contact: api@xero.com + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 + +from xero_python.models import BaseModel + + +class UsageRecordsList(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 = {"usage_records": "list[UsageRecord]"} + + attribute_map = {"usage_records": "usageRecords"} + + def __init__(self, usage_records=None): # noqa: E501 + """UsageRecordsList - a model defined in OpenAPI""" # noqa: E501 + + self._usage_records = None + self.discriminator = None + + self.usage_records = usage_records + + @property + def usage_records(self): + """Gets the usage_records of this UsageRecordsList. # noqa: E501 + + A collection of usage records # noqa: E501 + + :return: The usage_records of this UsageRecordsList. # noqa: E501 + :rtype: list[UsageRecord] + """ + return self._usage_records + + @usage_records.setter + def usage_records(self, usage_records): + """Sets the usage_records of this UsageRecordsList. + + A collection of usage records # noqa: E501 + + :param usage_records: The usage_records of this UsageRecordsList. # noqa: E501 + :type: list[UsageRecord] + """ + if usage_records is None: + raise ValueError( + "Invalid value for `usage_records`, must not be `None`" + ) # noqa: E501 + + self._usage_records = usage_records diff --git a/xero_python/assets/api/asset_api.py b/xero_python/assets/api/asset_api.py index 88250cbb..64b20f2d 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.30.1 + OpenAPI spec version: 2.31.0 """ import importlib diff --git a/xero_python/docs/README.md b/xero_python/docs/README.md index 42143eb8..4caf8606 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.30.1 -- Package version: 1.19.0 +- API version: 2.31.0 +- Package version: 1.20.0 - Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit [https://developer.xero.com](https://developer.xero.com) diff --git a/xero_python/file/api/files_api.py b/xero_python/file/api/files_api.py index 0ec74f17..1bf186db 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.30.1 + OpenAPI spec version: 2.31.0 """ import importlib diff --git a/xero_python/finance/api/finance_api.py b/xero_python/finance/api/finance_api.py index 320c8293..d2122b5a 100644 --- a/xero_python/finance/api/finance_api.py +++ b/xero_python/finance/api/finance_api.py @@ -10,7 +10,7 @@ """ """ - OpenAPI spec version: 2.30.1 + OpenAPI spec version: 2.31.0 """ import importlib diff --git a/xero_python/identity/api/identity_api.py b/xero_python/identity/api/identity_api.py index 364d429c..0378f40b 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.30.1 + OpenAPI spec version: 2.31.0 """ import importlib diff --git a/xero_python/payrollau/api/payroll_au_api.py b/xero_python/payrollau/api/payroll_au_api.py index 8d1a9ea1..f3d4915d 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.30.1 + OpenAPI spec version: 2.31.0 """ import importlib diff --git a/xero_python/payrollnz/api/payroll_nz_api.py b/xero_python/payrollnz/api/payroll_nz_api.py index 545720f3..cb4c2f96 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.30.1 + OpenAPI spec version: 2.31.0 """ import importlib diff --git a/xero_python/payrolluk/api/payroll_uk_api.py b/xero_python/payrolluk/api/payroll_uk_api.py index 60429bfb..744c0e40 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.30.1 + OpenAPI spec version: 2.31.0 """ import importlib diff --git a/xero_python/project/api/project_api.py b/xero_python/project/api/project_api.py index 79860bf3..49f9e3a8 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.30.1 + OpenAPI spec version: 2.31.0 """ import importlib