Skip to content

Commit

Permalink
Automated commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
maxio-sdk committed Aug 30, 2024
1 parent b3bfa41 commit 0d4bcfe
Show file tree
Hide file tree
Showing 63 changed files with 12,413 additions and 12,414 deletions.
80 changes: 40 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.0
pip install maxio-advanced-billing-sdk==5.0.1
```

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

## 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.0/doc/client.md)
**_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)

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.0/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.0.1/doc/auth/basic-authentication.md) | The credential object for Basic Authentication |

The API client can be initialized as follows:

Expand Down Expand Up @@ -86,46 +86,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.0/doc/auth/basic-authentication.md)
* [`BasicAuth (Basic Authentication)`](https://www.github.com/maxio-com/ab-python-sdk/tree/5.0.1/doc/auth/basic-authentication.md)

## List of APIs

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

## Classes Documentation

* [Utility Classes](https://www.github.com/maxio-com/ab-python-sdk/tree/5.0.0/doc/utility-classes.md)
* [HttpResponse](https://www.github.com/maxio-com/ab-python-sdk/tree/5.0.0/doc/http-response.md)
* [HttpRequest](https://www.github.com/maxio-com/ab-python-sdk/tree/5.0.0/doc/http-request.md)
* [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)

108 changes: 54 additions & 54 deletions advancedbilling/controllers/advance_invoice_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,60 @@ class AdvanceInvoiceController(BaseController):
def __init__(self, config):
super(AdvanceInvoiceController, self).__init__(config)

def void_advance_invoice(self,
subscription_id,
body=None):
"""Does a POST request to /subscriptions/{subscription_id}/advance_invoice/void.json.
Void a subscription's existing advance invoice. Once voided, it can
later be regenerated if desired.
A `reason` is required in order to void, and the invoice must have an
open status. Voiding will cause any prepayments and credits that were
applied to the invoice to be returned to the subscription. For a full
overview of the impact of voiding, please [see our help
docs]($m/Invoice).
Args:
subscription_id (int): The Chargify id of the subscription
body (VoidInvoiceRequest, optional): TODO: type description here.
Returns:
Invoice: Response from the API. Created
Raises:
APIException: When an error occurs while fetching the data from
the remote API. This exception includes the HTTP Response
code, an error message, and the HTTP body that was received in
the request.
"""

return super().new_api_call_builder.request(
RequestBuilder().server(Server.DEFAULT)
.path('/subscriptions/{subscription_id}/advance_invoice/void.json')
.http_method(HttpMethodEnum.POST)
.template_param(Parameter()
.key('subscription_id')
.value(subscription_id)
.is_required(True)
.should_encode(True))
.header_param(Parameter()
.key('Content-Type')
.value('application/json'))
.body_param(Parameter()
.value(body))
.header_param(Parameter()
.key('accept')
.value('application/json'))
.body_serializer(APIHelper.json_serialize)
.auth(Single('BasicAuth'))
).response(
ResponseHandler()
.deserializer(APIHelper.json_deserialize)
.deserialize_into(Invoice.from_dictionary)
.local_error_template('404', 'Not Found:\'{$response.body}\'', APIException)
).execute()

def issue_advance_invoice(self,
subscription_id,
body=None):
Expand Down Expand Up @@ -133,57 +187,3 @@ def read_advance_invoice(self,
.deserialize_into(Invoice.from_dictionary)
.local_error_template('404', 'Not Found:\'{$response.body}\'', APIException)
).execute()

def void_advance_invoice(self,
subscription_id,
body=None):
"""Does a POST request to /subscriptions/{subscription_id}/advance_invoice/void.json.
Void a subscription's existing advance invoice. Once voided, it can
later be regenerated if desired.
A `reason` is required in order to void, and the invoice must have an
open status. Voiding will cause any prepayments and credits that were
applied to the invoice to be returned to the subscription. For a full
overview of the impact of voiding, please [see our help
docs]($m/Invoice).
Args:
subscription_id (int): The Chargify id of the subscription
body (VoidInvoiceRequest, optional): TODO: type description here.
Returns:
Invoice: Response from the API. Created
Raises:
APIException: When an error occurs while fetching the data from
the remote API. This exception includes the HTTP Response
code, an error message, and the HTTP body that was received in
the request.
"""

return super().new_api_call_builder.request(
RequestBuilder().server(Server.DEFAULT)
.path('/subscriptions/{subscription_id}/advance_invoice/void.json')
.http_method(HttpMethodEnum.POST)
.template_param(Parameter()
.key('subscription_id')
.value(subscription_id)
.is_required(True)
.should_encode(True))
.header_param(Parameter()
.key('Content-Type')
.value('application/json'))
.body_param(Parameter()
.value(body))
.header_param(Parameter()
.key('accept')
.value('application/json'))
.body_serializer(APIHelper.json_serialize)
.auth(Single('BasicAuth'))
).response(
ResponseHandler()
.deserializer(APIHelper.json_deserialize)
.deserialize_into(Invoice.from_dictionary)
.local_error_template('404', 'Not Found:\'{$response.body}\'', APIException)
).execute()
Loading

0 comments on commit 0d4bcfe

Please sign in to comment.