Skip to content

Commit

Permalink
[DE-988] Release 5.1.0 (#51)
Browse files Browse the repository at this point in the history
- Add `imported` to subscription `cancellation_method`
- Add `salesforce_id` attribute to Customer
- Add `id` filter to List Products API
  • Loading branch information
maciej-nedza authored Sep 27, 2024
1 parent 4a6dd54 commit 41057bb
Show file tree
Hide file tree
Showing 35 changed files with 210 additions and 175 deletions.
81 changes: 41 additions & 40 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==5.0.1
pip install maxio-advanced-billing-sdk==5.1.0
```

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

## Initialize the API Client

**_Note:_** Documentation for the client can be found [here.](https://www.github.com/maxio-com/ab-python-sdk/tree/5.0.1/doc/client.md)
**_Note:_** Documentation for the client can be found [here.](https://www.github.com/maxio-com/ab-python-sdk/tree/5.1.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/5.0.1/doc/auth/basic-authentication.md) | The credential object for Basic Authentication |
| `basic_auth_credentials` | [`BasicAuthCredentials`](https://www.github.com/maxio-com/ab-python-sdk/tree/5.1.0/doc/auth/basic-authentication.md) | The credential object for Basic Authentication |

The API client can be initialized as follows:

Expand All @@ -66,6 +66,7 @@ client = AdvancedBillingClient(
username='BasicAuthUserName',
password='BasicAuthPassword'
),
environment=Environment.PRODUCTION,
subdomain='subdomain',
domain='chargify.com'
)
Expand All @@ -86,46 +87,46 @@ 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/5.0.1/doc/auth/basic-authentication.md)
* [`BasicAuth (Basic Authentication)`](https://www.github.com/maxio-com/ab-python-sdk/tree/5.1.0/doc/auth/basic-authentication.md)

## List of APIs

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

## Classes Documentation

* [Utility Classes](https://www.github.com/maxio-com/ab-python-sdk/tree/5.0.1/doc/utility-classes.md)
* [HttpResponse](https://www.github.com/maxio-com/ab-python-sdk/tree/5.0.1/doc/http-response.md)
* [HttpRequest](https://www.github.com/maxio-com/ab-python-sdk/tree/5.0.1/doc/http-request.md)
* [Utility Classes](https://www.github.com/maxio-com/ab-python-sdk/tree/5.1.0/doc/utility-classes.md)
* [HttpResponse](https://www.github.com/maxio-com/ab-python-sdk/tree/5.1.0/doc/http-response.md)
* [HttpRequest](https://www.github.com/maxio-com/ab-python-sdk/tree/5.1.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:5.0.1 on OS {os-info}'
return 'AB SDK Python:5.1.0 on OS {os-info}'

@staticmethod
def user_agent_parameters():
Expand Down
3 changes: 3 additions & 0 deletions advancedbilling/models/cancellation_method.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class CancellationMethod(object):
DUNNING: TODO: type description here.
BILLING_PORTAL: TODO: type description here.
UNKNOWN: TODO: type description here.
IMPORTED: TODO: type description here.
"""
MERCHANT_UI = 'merchant_ui'
Expand All @@ -33,3 +34,5 @@ class CancellationMethod(object):

UNKNOWN = 'unknown'

IMPORTED = 'imported'

11 changes: 10 additions & 1 deletion advancedbilling/models/list_products_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ class ListProductsFilter(object):
TODO: type model description here.
Attributes:
ids (List[int]): Allows fetching products with matching id based on
provided values. Use in query `filter[ids]=1,2,3`.
prepaid_product_price_point (PrepaidProductPricePointFilter): Allows
fetching products only if a prepaid product price point is present
or not. To use this filter you also have to include the following
Expand All @@ -32,22 +34,27 @@ class ListProductsFilter(object):

# Create a mapping from Model property names to API property names
_names = {
"ids": 'ids',
"prepaid_product_price_point": 'prepaid_product_price_point',
"use_site_exchange_rate": 'use_site_exchange_rate'
}

_optionals = [
'ids',
'prepaid_product_price_point',
'use_site_exchange_rate',
]

def __init__(self,
ids=APIHelper.SKIP,
prepaid_product_price_point=APIHelper.SKIP,
use_site_exchange_rate=APIHelper.SKIP,
additional_properties={}):
"""Constructor for the ListProductsFilter class"""

# Initialize members of the class
if ids is not APIHelper.SKIP:
self.ids = ids
if prepaid_product_price_point is not APIHelper.SKIP:
self.prepaid_product_price_point = prepaid_product_price_point
if use_site_exchange_rate is not APIHelper.SKIP:
Expand Down Expand Up @@ -75,13 +82,15 @@ def from_dictionary(cls,
return None

# Extract variables from the dictionary
ids = dictionary.get("ids") if dictionary.get("ids") else APIHelper.SKIP
prepaid_product_price_point = PrepaidProductPricePointFilter.from_dictionary(dictionary.get('prepaid_product_price_point')) if 'prepaid_product_price_point' in dictionary.keys() else APIHelper.SKIP
use_site_exchange_rate = dictionary.get("use_site_exchange_rate") if "use_site_exchange_rate" in dictionary.keys() else APIHelper.SKIP
# Clean out expected properties from dictionary
for key in cls._names.values():
if key in dictionary:
del dictionary[key]
# Return an object of this model
return cls(prepaid_product_price_point,
return cls(ids,
prepaid_product_price_point,
use_site_exchange_rate,
dictionary)
1 change: 1 addition & 0 deletions doc/client.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ client = AdvancedBillingClient(
username='BasicAuthUserName',
password='BasicAuthPassword'
),
environment=Environment.PRODUCTION,
subdomain='subdomain',
domain='chargify.com'
)
Expand Down
12 changes: 6 additions & 6 deletions doc/controllers/api-exports.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ def list_exported_proforma_invoices(self,
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `batch_id` | `str` | Template, Required | Id of a Batch Job. |
| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request.<br>Default value is 100.<br>The maximum allowed values is 10000; any per_page value over 10000 will be changed to 10000. |
| `page` | `int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.<br>Use in query `page=1`. |
| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request.<br>Default value is 100.<br>The maximum allowed values is 10000; any per_page value over 10000 will be changed to 10000.<br>**Default**: `100`<br>**Constraints**: `>= 1`, `<= 10000` |
| `page` | `int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.<br>Use in query `page=1`.<br>**Default**: `1`<br>**Constraints**: `>= 1` |

## Response Type

Expand Down Expand Up @@ -78,8 +78,8 @@ def list_exported_invoices(self,
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `batch_id` | `str` | Template, Required | Id of a Batch Job. |
| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request.<br>Default value is 100.<br>The maximum allowed values is 10000; any per_page value over 10000 will be changed to 10000. |
| `page` | `int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.<br>Use in query `page=1`. |
| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request.<br>Default value is 100.<br>The maximum allowed values is 10000; any per_page value over 10000 will be changed to 10000.<br>**Default**: `100`<br>**Constraints**: `>= 1`, `<= 10000` |
| `page` | `int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.<br>Use in query `page=1`.<br>**Default**: `1`<br>**Constraints**: `>= 1` |

## Response Type

Expand Down Expand Up @@ -119,8 +119,8 @@ def list_exported_subscriptions(self,
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `batch_id` | `str` | Template, Required | Id of a Batch Job. |
| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request.<br>Default value is 100.<br>The maximum allowed values is 10000; any per_page value over 10000 will be changed to 10000. |
| `page` | `int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.<br>Use in query `page=1`. |
| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request.<br>Default value is 100.<br>The maximum allowed values is 10000; any per_page value over 10000 will be changed to 10000.<br>**Default**: `100`<br>**Constraints**: `>= 1`, `<= 10000` |
| `page` | `int` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.<br>Use in query `page=1`.<br>**Default**: `1`<br>**Constraints**: `>= 1` |

## Response Type

Expand Down
Loading

0 comments on commit 41057bb

Please sign in to comment.