Skip to content

Commit

Permalink
[DE-759] Release 2.0.0
Browse files Browse the repository at this point in the history
DE-766 Bug fix: listEvents endpoint deserialisation problem
  • Loading branch information
michalpierog authored Mar 19, 2024
1 parent 94412f2 commit c946062
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 54 deletions.
78 changes: 39 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ The package is compatible with Python versions `3 >=3.7, <= 3.11`.
Install the package from PyPi using the following pip command:

```python
pip install maxio-advanced-billing-sdk==1.0.1
pip install maxio-advanced-billing-sdk==2.0.0
```

You can also view the package at:
https://pypi.python.org/pypi/maxio-advanced-billing-sdk/1.0.1
https://pypi.python.org/pypi/maxio-advanced-billing-sdk/2.0.0

## Initialize the API Client

**_Note:_** Documentation for the client can be found [here.](https://www.github.com/maxio-com/ab-python-sdk/tree/1.0.1/doc/client.md)
**_Note:_** Documentation for the client can be found [here.](https://www.github.com/maxio-com/ab-python-sdk/tree/2.0.0/doc/client.md)

The following parameters are configurable for the API Client:

Expand All @@ -56,7 +56,7 @@ The following parameters are configurable for the API Client:
| `backoff_factor` | `float` | A backoff factor to apply between attempts after the second try. <br> **Default: 2** |
| `retry_statuses` | `Array of int` | The http statuses on which retry is to be done. <br> **Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]** |
| `retry_methods` | `Array of string` | The http methods on which retry is to be done. <br> **Default: ['GET', 'PUT']** |
| `basic_auth_credentials` | [`BasicAuthCredentials`](https://www.github.com/maxio-com/ab-python-sdk/tree/1.0.1/doc/$a/https://www.github.com/maxio-com/ab-python-sdk/tree/1.0.1/basic-authentication.md) | The credential object for Basic Authentication |
| `basic_auth_credentials` | [`BasicAuthCredentials`](https://www.github.com/maxio-com/ab-python-sdk/tree/2.0.0/doc/$a/https://www.github.com/maxio-com/ab-python-sdk/tree/2.0.0/basic-authentication.md) | The credential object for Basic Authentication |

The API client can be initialized as follows:

Expand Down Expand Up @@ -84,45 +84,45 @@ The SDK can be configured to use a different environment for making API calls. A

This API uses the following authentication schemes.

* [`BasicAuth (Basic Authentication)`](https://www.github.com/maxio-com/ab-python-sdk/tree/1.0.1/doc/$a/https://www.github.com/maxio-com/ab-python-sdk/tree/1.0.1/basic-authentication.md)
* [`BasicAuth (Basic Authentication)`](https://www.github.com/maxio-com/ab-python-sdk/tree/2.0.0/doc/$a/https://www.github.com/maxio-com/ab-python-sdk/tree/2.0.0/basic-authentication.md)

## List of APIs

* [API Exports](https://www.github.com/maxio-com/ab-python-sdk/tree/1.0.1/doc/controllers/api-exports.md)
* [Advance Invoice](https://www.github.com/maxio-com/ab-python-sdk/tree/1.0.1/doc/controllers/advance-invoice.md)
* [Billing Portal](https://www.github.com/maxio-com/ab-python-sdk/tree/1.0.1/doc/controllers/billing-portal.md)
* [Custom Fields](https://www.github.com/maxio-com/ab-python-sdk/tree/1.0.1/doc/controllers/custom-fields.md)
* [Events-Based Billing Segments](https://www.github.com/maxio-com/ab-python-sdk/tree/1.0.1/doc/controllers/events-based-billing-segments.md)
* [Payment Profiles](https://www.github.com/maxio-com/ab-python-sdk/tree/1.0.1/doc/controllers/payment-profiles.md)
* [Product Families](https://www.github.com/maxio-com/ab-python-sdk/tree/1.0.1/doc/controllers/product-families.md)
* [Product Price Points](https://www.github.com/maxio-com/ab-python-sdk/tree/1.0.1/doc/controllers/product-price-points.md)
* [Proforma Invoices](https://www.github.com/maxio-com/ab-python-sdk/tree/1.0.1/doc/controllers/proforma-invoices.md)
* [Reason Codes](https://www.github.com/maxio-com/ab-python-sdk/tree/1.0.1/doc/controllers/reason-codes.md)
* [Referral Codes](https://www.github.com/maxio-com/ab-python-sdk/tree/1.0.1/doc/controllers/referral-codes.md)
* [Sales Commissions](https://www.github.com/maxio-com/ab-python-sdk/tree/1.0.1/doc/controllers/sales-commissions.md)
* [Subscription Components](https://www.github.com/maxio-com/ab-python-sdk/tree/1.0.1/doc/controllers/subscription-components.md)
* [Subscription Groups](https://www.github.com/maxio-com/ab-python-sdk/tree/1.0.1/doc/controllers/subscription-groups.md)
* [Subscription Group Invoice Account](https://www.github.com/maxio-com/ab-python-sdk/tree/1.0.1/doc/controllers/subscription-group-invoice-account.md)
* [Subscription Group Status](https://www.github.com/maxio-com/ab-python-sdk/tree/1.0.1/doc/controllers/subscription-group-status.md)
* [Subscription Invoice Account](https://www.github.com/maxio-com/ab-python-sdk/tree/1.0.1/doc/controllers/subscription-invoice-account.md)
* [Subscription Notes](https://www.github.com/maxio-com/ab-python-sdk/tree/1.0.1/doc/controllers/subscription-notes.md)
* [Subscription Products](https://www.github.com/maxio-com/ab-python-sdk/tree/1.0.1/doc/controllers/subscription-products.md)
* [Subscription Status](https://www.github.com/maxio-com/ab-python-sdk/tree/1.0.1/doc/controllers/subscription-status.md)
* [Coupons](https://www.github.com/maxio-com/ab-python-sdk/tree/1.0.1/doc/controllers/coupons.md)
* [Components](https://www.github.com/maxio-com/ab-python-sdk/tree/1.0.1/doc/controllers/components.md)
* [Customers](https://www.github.com/maxio-com/ab-python-sdk/tree/1.0.1/doc/controllers/customers.md)
* [Events](https://www.github.com/maxio-com/ab-python-sdk/tree/1.0.1/doc/controllers/events.md)
* [Insights](https://www.github.com/maxio-com/ab-python-sdk/tree/1.0.1/doc/controllers/insights.md)
* [Invoices](https://www.github.com/maxio-com/ab-python-sdk/tree/1.0.1/doc/controllers/invoices.md)
* [Offers](https://www.github.com/maxio-com/ab-python-sdk/tree/1.0.1/doc/controllers/offers.md)
* [Products](https://www.github.com/maxio-com/ab-python-sdk/tree/1.0.1/doc/controllers/products.md)
* [Sites](https://www.github.com/maxio-com/ab-python-sdk/tree/1.0.1/doc/controllers/sites.md)
* [Subscriptions](https://www.github.com/maxio-com/ab-python-sdk/tree/1.0.1/doc/controllers/subscriptions.md)
* [Webhooks](https://www.github.com/maxio-com/ab-python-sdk/tree/1.0.1/doc/controllers/webhooks.md)
* [API Exports](https://www.github.com/maxio-com/ab-python-sdk/tree/2.0.0/doc/controllers/api-exports.md)
* [Advance Invoice](https://www.github.com/maxio-com/ab-python-sdk/tree/2.0.0/doc/controllers/advance-invoice.md)
* [Billing Portal](https://www.github.com/maxio-com/ab-python-sdk/tree/2.0.0/doc/controllers/billing-portal.md)
* [Custom Fields](https://www.github.com/maxio-com/ab-python-sdk/tree/2.0.0/doc/controllers/custom-fields.md)
* [Events-Based Billing Segments](https://www.github.com/maxio-com/ab-python-sdk/tree/2.0.0/doc/controllers/events-based-billing-segments.md)
* [Payment Profiles](https://www.github.com/maxio-com/ab-python-sdk/tree/2.0.0/doc/controllers/payment-profiles.md)
* [Product Families](https://www.github.com/maxio-com/ab-python-sdk/tree/2.0.0/doc/controllers/product-families.md)
* [Product Price Points](https://www.github.com/maxio-com/ab-python-sdk/tree/2.0.0/doc/controllers/product-price-points.md)
* [Proforma Invoices](https://www.github.com/maxio-com/ab-python-sdk/tree/2.0.0/doc/controllers/proforma-invoices.md)
* [Reason Codes](https://www.github.com/maxio-com/ab-python-sdk/tree/2.0.0/doc/controllers/reason-codes.md)
* [Referral Codes](https://www.github.com/maxio-com/ab-python-sdk/tree/2.0.0/doc/controllers/referral-codes.md)
* [Sales Commissions](https://www.github.com/maxio-com/ab-python-sdk/tree/2.0.0/doc/controllers/sales-commissions.md)
* [Subscription Components](https://www.github.com/maxio-com/ab-python-sdk/tree/2.0.0/doc/controllers/subscription-components.md)
* [Subscription Groups](https://www.github.com/maxio-com/ab-python-sdk/tree/2.0.0/doc/controllers/subscription-groups.md)
* [Subscription Group Invoice Account](https://www.github.com/maxio-com/ab-python-sdk/tree/2.0.0/doc/controllers/subscription-group-invoice-account.md)
* [Subscription Group Status](https://www.github.com/maxio-com/ab-python-sdk/tree/2.0.0/doc/controllers/subscription-group-status.md)
* [Subscription Invoice Account](https://www.github.com/maxio-com/ab-python-sdk/tree/2.0.0/doc/controllers/subscription-invoice-account.md)
* [Subscription Notes](https://www.github.com/maxio-com/ab-python-sdk/tree/2.0.0/doc/controllers/subscription-notes.md)
* [Subscription Products](https://www.github.com/maxio-com/ab-python-sdk/tree/2.0.0/doc/controllers/subscription-products.md)
* [Subscription Status](https://www.github.com/maxio-com/ab-python-sdk/tree/2.0.0/doc/controllers/subscription-status.md)
* [Coupons](https://www.github.com/maxio-com/ab-python-sdk/tree/2.0.0/doc/controllers/coupons.md)
* [Components](https://www.github.com/maxio-com/ab-python-sdk/tree/2.0.0/doc/controllers/components.md)
* [Customers](https://www.github.com/maxio-com/ab-python-sdk/tree/2.0.0/doc/controllers/customers.md)
* [Events](https://www.github.com/maxio-com/ab-python-sdk/tree/2.0.0/doc/controllers/events.md)
* [Insights](https://www.github.com/maxio-com/ab-python-sdk/tree/2.0.0/doc/controllers/insights.md)
* [Invoices](https://www.github.com/maxio-com/ab-python-sdk/tree/2.0.0/doc/controllers/invoices.md)
* [Offers](https://www.github.com/maxio-com/ab-python-sdk/tree/2.0.0/doc/controllers/offers.md)
* [Products](https://www.github.com/maxio-com/ab-python-sdk/tree/2.0.0/doc/controllers/products.md)
* [Sites](https://www.github.com/maxio-com/ab-python-sdk/tree/2.0.0/doc/controllers/sites.md)
* [Subscriptions](https://www.github.com/maxio-com/ab-python-sdk/tree/2.0.0/doc/controllers/subscriptions.md)
* [Webhooks](https://www.github.com/maxio-com/ab-python-sdk/tree/2.0.0/doc/controllers/webhooks.md)

## Classes Documentation

* [Utility Classes](https://www.github.com/maxio-com/ab-python-sdk/tree/1.0.1/doc/utility-classes.md)
* [HttpResponse](https://www.github.com/maxio-com/ab-python-sdk/tree/1.0.1/doc/http-response.md)
* [HttpRequest](https://www.github.com/maxio-com/ab-python-sdk/tree/1.0.1/doc/http-request.md)
* [Utility Classes](https://www.github.com/maxio-com/ab-python-sdk/tree/2.0.0/doc/utility-classes.md)
* [HttpResponse](https://www.github.com/maxio-com/ab-python-sdk/tree/2.0.0/doc/http-response.md)
* [HttpRequest](https://www.github.com/maxio-com/ab-python-sdk/tree/2.0.0/doc/http-request.md)

2 changes: 1 addition & 1 deletion advancedbilling/controllers/base_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class BaseController(object):

@staticmethod
def user_agent():
return 'AB SDK Python:1.0.1 on OS {os-info}'
return 'AB SDK Python:2.0.0 on OS {os-info}'

@staticmethod
def user_agent_parameters():
Expand Down
22 changes: 14 additions & 8 deletions advancedbilling/models/invoice_issued.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ class InvoiceIssued(object):
number (str): TODO: type description here.
role (str): TODO: type description here.
due_date (date): TODO: type description here.
issue_date (date): TODO: type description here.
paid_date (date): TODO: type description here.
issue_date (str): Invoice issue date. Can be an empty string if value
is missing.
paid_date (str): Paid date. Can be an empty string if value is
missing.
due_amount (str): TODO: type description here.
paid_amount (str): TODO: type description here.
tax_amount (str): TODO: type description here.
Expand Down Expand Up @@ -58,6 +60,10 @@ class InvoiceIssued(object):
"line_items": 'line_items'
}

_nullables = [
'due_date',
]

def __init__(self,
uid=None,
number=None,
Expand Down Expand Up @@ -120,8 +126,8 @@ def from_dictionary(cls,
number = dictionary.get("number") if dictionary.get("number") else None
role = dictionary.get("role") if dictionary.get("role") else None
due_date = dateutil.parser.parse(dictionary.get('due_date')).date() if dictionary.get('due_date') else None
issue_date = dateutil.parser.parse(dictionary.get('issue_date')).date() if dictionary.get('issue_date') else None
paid_date = dateutil.parser.parse(dictionary.get('paid_date')).date() if dictionary.get('paid_date') else None
issue_date = dictionary.get("issue_date") if dictionary.get("issue_date") else None
paid_date = dictionary.get("paid_date") if dictionary.get("paid_date") else None
due_amount = dictionary.get("due_amount") if dictionary.get("due_amount") else None
paid_amount = dictionary.get("paid_amount") if dictionary.get("paid_amount") else None
tax_amount = dictionary.get("tax_amount") if dictionary.get("tax_amount") else None
Expand Down Expand Up @@ -173,9 +179,9 @@ def validate(cls, dictionary):
return APIHelper.is_valid_type(value=dictionary.uid, type_callable=lambda value: isinstance(value, str)) \
and APIHelper.is_valid_type(value=dictionary.number, type_callable=lambda value: isinstance(value, str)) \
and APIHelper.is_valid_type(value=dictionary.role, type_callable=lambda value: isinstance(value, str)) \
and APIHelper.is_valid_type(value=dictionary.due_date, type_callable=lambda value: isinstance(value, date)) \
and APIHelper.is_valid_type(value=dictionary.issue_date, type_callable=lambda value: isinstance(value, date)) \
and APIHelper.is_valid_type(value=dictionary.paid_date, type_callable=lambda value: isinstance(value, date)) \
and APIHelper.is_valid_type(value=dictionary.due_date, type_callable=lambda value: isinstance(value, date), is_value_nullable=True) \
and APIHelper.is_valid_type(value=dictionary.issue_date, type_callable=lambda value: isinstance(value, str)) \
and APIHelper.is_valid_type(value=dictionary.paid_date, type_callable=lambda value: isinstance(value, str)) \
and APIHelper.is_valid_type(value=dictionary.due_amount, type_callable=lambda value: isinstance(value, str)) \
and APIHelper.is_valid_type(value=dictionary.paid_amount, type_callable=lambda value: isinstance(value, str)) \
and APIHelper.is_valid_type(value=dictionary.tax_amount, type_callable=lambda value: isinstance(value, str)) \
Expand All @@ -192,7 +198,7 @@ def validate(cls, dictionary):
return APIHelper.is_valid_type(value=dictionary.get('uid'), type_callable=lambda value: isinstance(value, str)) \
and APIHelper.is_valid_type(value=dictionary.get('number'), type_callable=lambda value: isinstance(value, str)) \
and APIHelper.is_valid_type(value=dictionary.get('role'), type_callable=lambda value: isinstance(value, str)) \
and APIHelper.is_valid_type(value=dictionary.get('due_date'), type_callable=lambda value: isinstance(value, str)) \
and APIHelper.is_valid_type(value=dictionary.get('due_date'), type_callable=lambda value: isinstance(value, str), is_value_nullable=True) \
and APIHelper.is_valid_type(value=dictionary.get('issue_date'), type_callable=lambda value: isinstance(value, str)) \
and APIHelper.is_valid_type(value=dictionary.get('paid_date'), type_callable=lambda value: isinstance(value, str)) \
and APIHelper.is_valid_type(value=dictionary.get('due_amount'), type_callable=lambda value: isinstance(value, str)) \
Expand Down
8 changes: 4 additions & 4 deletions doc/models/invoice-issued.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
| `number` | `str` | Required | - |
| `role` | `str` | Required | - |
| `due_date` | `date` | Required | - |
| `issue_date` | `date` | Required | - |
| `paid_date` | `date` | Required | - |
| `issue_date` | `str` | Required | Invoice issue date. Can be an empty string if value is missing. |
| `paid_date` | `str` | Required | Paid date. Can be an empty string if value is missing. |
| `due_amount` | `str` | Required | - |
| `paid_amount` | `str` | Required | - |
| `tax_amount` | `str` | Required | - |
Expand All @@ -33,8 +33,8 @@
"number": "number8",
"role": "role2",
"due_date": "2016-03-13",
"issue_date": "2016-03-13",
"paid_date": "2016-03-13",
"issue_date": "issue_date0",
"paid_date": "paid_date6",
"due_amount": "due_amount6",
"paid_amount": "paid_amount4",
"tax_amount": "tax_amount2",
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ requires = ["setuptools>=61.0"]
[project]
name = "maxio-advanced-billing-sdk"
description = "Ultimate billing and pricing flexibility for B2B SaaS.\nMaxio integrates directly into your product, so you can seamlessly manage your product catalog, bill customers, and collect payments."
version = "1.0.1"
version = "2.0.0"
readme = "README.md"
requires-python = ">=3.7"
keywords = ["Maxio", "Advaced Billing", "Payments", "Subscription"]
authors = [{name = "Maxio SDK", email = "[email protected]"}]
urls = {Homepage = "https://www.maxio.com/product/advanced-billing"}
dependencies = ["apimatic-core~=0.2.0", "apimatic-core-interfaces~=0.1.0", "apimatic-requests-client-adapter~=0.1.0", "python-dateutil~=2.8.1", "enum34~=1.1, >=1.1.10", "deprecation~=2.1", "jsonschema~=3.2.0"]
dependencies = ["apimatic-core~=0.2.0", "apimatic-core-interfaces~=0.1.0", "apimatic-requests-client-adapter~=0.1.0", "enum34~=1.1, >=1.1.10", "deprecation~=2.1", "python-dateutil~=2.8.1", "jsonschema~=3.2.0"]
classifiers = []
[project.optional-dependencies]
testutils = ["pytest>=7.2.2"]
Expand Down

0 comments on commit c946062

Please sign in to comment.