From 9f694aa308102e60710d524a6b79efe9aa115310 Mon Sep 17 00:00:00 2001 From: maxio-sdk Date: Tue, 9 Sep 2025 13:13:15 +0000 Subject: [PATCH 1/2] Automated commit message --- README.md | 91 ++++++++++--------- advancedbilling/advanced_billing_client.py | 4 +- advancedbilling/configuration.py | 24 +++-- .../controllers/base_controller.py | 2 +- .../controllers/components_controller.py | 6 +- .../controllers/customers_controller.py | 4 +- .../payment_profiles_controller.py | 21 ++--- .../subscription_components_controller.py | 44 ++++++--- .../controllers/subscriptions_controller.py | 45 +++++---- advancedbilling/http/__init__.py | 1 + advancedbilling/http/proxy_settings.py | 14 +++ .../utilities/union_type_lookup.py | 12 +++ doc/client.md | 1 + doc/controllers/component-price-points.md | 5 +- doc/controllers/components.md | 4 +- doc/controllers/customers.md | 39 +++++++- doc/controllers/payment-profiles.md | 10 +- doc/controllers/product-price-points.md | 5 +- doc/controllers/subscription-components.md | 12 +-- doc/controllers/subscriptions.md | 18 ++-- ...eate-usage-subscription-id-or-reference.md | 14 +++ ...ages-input-subscription-id-or-reference.md | 14 +++ doc/proxy-settings.md | 30 ++++++ pyproject.toml | 4 +- requirements.txt | 4 +- 25 files changed, 289 insertions(+), 139 deletions(-) create mode 100644 advancedbilling/http/proxy_settings.py create mode 100644 doc/models/containers/create-usage-subscription-id-or-reference.md create mode 100644 doc/models/containers/list-usages-input-subscription-id-or-reference.md create mode 100644 doc/proxy-settings.md diff --git a/README.md b/README.md index da50b942..c82e80f8 100644 --- a/README.md +++ b/README.md @@ -30,15 +30,15 @@ The package is compatible with Python versions `3.7+`. Install the package from PyPi using the following pip command: ```bash -pip install maxio-advanced-billing-sdk==7.0.0 +pip install maxio-advanced-billing-sdk==7.0.1 ``` You can also view the package at: -https://pypi.python.org/pypi/maxio-advanced-billing-sdk/7.0.0 +https://pypi.python.org/pypi/maxio-advanced-billing-sdk/7.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/7.0.0/doc/client.md) +**_Note:_** Documentation for the client can be found [here.](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/client.md) The following parameters are configurable for the API Client: @@ -54,7 +54,8 @@ The following parameters are configurable for the API Client: | backoff_factor | `float` | A backoff factor to apply between attempts after the second try.
**Default: 2** | | retry_statuses | `Array of int` | The http statuses on which retry is to be done.
**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.
**Default: ['GET', 'PUT']** | -| basic_auth_credentials | [`BasicAuthCredentials`](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/auth/basic-authentication.md) | The credential object for Basic Authentication | +| proxy_settings | [`ProxySettings`](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/proxy-settings.md) | Optional proxy configuration to route HTTP requests through a proxy server. | +| basic_auth_credentials | [`BasicAuthCredentials`](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/auth/basic-authentication.md) | The credential object for Basic Authentication | The API client can be initialized as follows: @@ -88,54 +89,58 @@ 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/7.0.0/doc/auth/basic-authentication.md) +* [`BasicAuth (Basic Authentication)`](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/auth/basic-authentication.md) ## List of APIs -* [API Exports](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/api-exports.md) -* [Advance Invoice](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/advance-invoice.md) -* [Billing Portal](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/billing-portal.md) -* [Component Price Points](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/component-price-points.md) -* [Custom Fields](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/custom-fields.md) -* [Events-Based Billing Segments](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/events-based-billing-segments.md) -* [Payment Profiles](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/payment-profiles.md) -* [Product Families](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/product-families.md) -* [Product Price Points](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/product-price-points.md) -* [Proforma Invoices](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/proforma-invoices.md) -* [Reason Codes](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/reason-codes.md) -* [Referral Codes](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/referral-codes.md) -* [Sales Commissions](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/sales-commissions.md) -* [Subscription Components](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/subscription-components.md) -* [Subscription Groups](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/subscription-groups.md) -* [Subscription Group Invoice Account](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/subscription-group-invoice-account.md) -* [Subscription Group Status](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/subscription-group-status.md) -* [Subscription Invoice Account](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/subscription-invoice-account.md) -* [Subscription Notes](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/subscription-notes.md) -* [Subscription Products](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/subscription-products.md) -* [Subscription Status](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/subscription-status.md) -* [Coupons](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/coupons.md) -* [Components](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/components.md) -* [Customers](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/customers.md) -* [Events](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/events.md) -* [Insights](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/insights.md) -* [Invoices](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/invoices.md) -* [Offers](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/offers.md) -* [Products](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/products.md) -* [Sites](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/sites.md) -* [Subscriptions](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/subscriptions.md) -* [Webhooks](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/controllers/webhooks.md) +* [API Exports](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/api-exports.md) +* [Advance Invoice](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/advance-invoice.md) +* [Billing Portal](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/billing-portal.md) +* [Component Price Points](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/component-price-points.md) +* [Custom Fields](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/custom-fields.md) +* [Events-Based Billing Segments](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/events-based-billing-segments.md) +* [Payment Profiles](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/payment-profiles.md) +* [Product Families](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/product-families.md) +* [Product Price Points](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/product-price-points.md) +* [Proforma Invoices](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/proforma-invoices.md) +* [Reason Codes](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/reason-codes.md) +* [Referral Codes](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/referral-codes.md) +* [Sales Commissions](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/sales-commissions.md) +* [Subscription Components](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/subscription-components.md) +* [Subscription Groups](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/subscription-groups.md) +* [Subscription Group Invoice Account](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/subscription-group-invoice-account.md) +* [Subscription Group Status](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/subscription-group-status.md) +* [Subscription Invoice Account](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/subscription-invoice-account.md) +* [Subscription Notes](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/subscription-notes.md) +* [Subscription Products](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/subscription-products.md) +* [Subscription Status](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/subscription-status.md) +* [Coupons](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/coupons.md) +* [Components](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/components.md) +* [Customers](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/customers.md) +* [Events](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/events.md) +* [Insights](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/insights.md) +* [Invoices](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/invoices.md) +* [Offers](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/offers.md) +* [Products](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/products.md) +* [Sites](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/sites.md) +* [Subscriptions](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/subscriptions.md) +* [Webhooks](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/controllers/webhooks.md) ## SDK Infrastructure +### Configuration + +* [ProxySettings](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/proxy-settings.md) + ### HTTP -* [HttpResponse](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/http-response.md) -* [HttpRequest](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/http-request.md) +* [HttpResponse](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/http-response.md) +* [HttpRequest](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/http-request.md) ### Utilities -* [ApiHelper](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/api-helper.md) -* [HttpDateTime](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/http-date-time.md) -* [RFC3339DateTime](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/rfc3339-date-time.md) -* [UnixDateTime](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.0/doc/unix-date-time.md) +* [ApiHelper](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/api-helper.md) +* [HttpDateTime](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/http-date-time.md) +* [RFC3339DateTime](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/rfc3339-date-time.md) +* [UnixDateTime](https://www.github.com/maxio-com/ab-python-sdk/tree/7.0.1/doc/unix-date-time.md) diff --git a/advancedbilling/advanced_billing_client.py b/advancedbilling/advanced_billing_client.py index a4704526..b5d23185 100644 --- a/advancedbilling/advanced_billing_client.py +++ b/advancedbilling/advanced_billing_client.py @@ -203,7 +203,7 @@ def webhooks(self): def __init__(self, http_client_instance=None, override_http_client_configuration=False, http_call_back=None, timeout=120, max_retries=0, backoff_factor=2, - retry_statuses=None, retry_methods=None, + retry_statuses=None, retry_methods=None, proxy_settings=None, environment=Environment.US, site='subdomain', basic_auth_credentials=None, config=None): self.config = config or Configuration( @@ -212,7 +212,7 @@ def __init__(self, http_client_instance=None, http_call_back=http_call_back, timeout=timeout, max_retries=max_retries, backoff_factor=backoff_factor, retry_statuses=retry_statuses, retry_methods=retry_methods, - environment=environment, site=site, + proxy_settings=proxy_settings, environment=environment, site=site, basic_auth_credentials=basic_auth_credentials) self.global_configuration = GlobalConfiguration(self.config)\ diff --git a/advancedbilling/configuration.py b/advancedbilling/configuration.py index 80add27b..8b4891e3 100644 --- a/advancedbilling/configuration.py +++ b/advancedbilling/configuration.py @@ -46,7 +46,7 @@ def basic_auth_credentials(self): def __init__(self, http_client_instance=None, override_http_client_configuration=False, http_call_back=None, timeout=120, max_retries=0, backoff_factor=2, - retry_statuses=None, retry_methods=None, + retry_statuses=None, retry_methods=None, proxy_settings=None, environment=Environment.US, site='subdomain', basic_auth_credentials=None): if retry_methods is None: @@ -55,10 +55,14 @@ def __init__(self, http_client_instance=None, if retry_statuses is None: retry_statuses = [408, 413, 429, 500, 502, 503, 504, 521, 522, 524] - super().__init__(http_client_instance, - override_http_client_configuration, http_call_back, - timeout, max_retries, backoff_factor, retry_statuses, - retry_methods) + super().__init__( + http_client_instance=http_client_instance, + override_http_client_configuration=override_http_client_configuration, + http_call_back=http_call_back, timeout=timeout, + max_retries=max_retries, backoff_factor=backoff_factor, + retry_statuses=retry_statuses, retry_methods=retry_methods, + proxy_settings=proxy_settings + ) # Current API environment self._environment = environment @@ -74,8 +78,8 @@ def __init__(self, http_client_instance=None, def clone_with(self, http_client_instance=None, override_http_client_configuration=None, http_call_back=None, timeout=None, max_retries=None, backoff_factor=None, - retry_statuses=None, retry_methods=None, environment=None, - site=None, basic_auth_credentials=None): + retry_statuses=None, retry_methods=None, proxy_settings=None, + environment=None, site=None, basic_auth_credentials=None): http_client_instance = http_client_instance or self.http_client_instance override_http_client_configuration = override_http_client_configuration or self.override_http_client_configuration http_call_back = http_call_back or self.http_callback @@ -84,6 +88,7 @@ def clone_with(self, http_client_instance=None, backoff_factor = backoff_factor or self.backoff_factor retry_statuses = retry_statuses or self.retry_statuses retry_methods = retry_methods or self.retry_methods + proxy_settings = proxy_settings or self.proxy_settings environment = environment or self.environment site = site or self.site basic_auth_credentials = basic_auth_credentials or self.basic_auth_credentials @@ -93,7 +98,7 @@ def clone_with(self, http_client_instance=None, http_call_back=http_call_back, timeout=timeout, max_retries=max_retries, backoff_factor=backoff_factor, retry_statuses=retry_statuses, retry_methods=retry_methods, - environment=environment, site=site, + proxy_settings=proxy_settings, environment=environment, site=site, basic_auth_credentials=basic_auth_credentials ) @@ -104,7 +109,8 @@ def create_http_client(self): retry_methods=self.retry_methods, http_client_instance=self.http_client_instance, override_http_client_configuration=self.override_http_client_configuration, - response_factory=self.http_response_factory + response_factory=self.http_response_factory, + proxies=self.proxy_settings.to_proxies() if self.proxy_settings else None ) # All the environments the SDK can run in diff --git a/advancedbilling/controllers/base_controller.py b/advancedbilling/controllers/base_controller.py index f79f8ac2..41502638 100644 --- a/advancedbilling/controllers/base_controller.py +++ b/advancedbilling/controllers/base_controller.py @@ -30,7 +30,7 @@ class BaseController(object): @staticmethod def user_agent(): - return 'AB SDK Python:7.0.0 on OS {os-info}' + return 'AB SDK Python:7.0.1 on OS {os-info}' @staticmethod def user_agent_parameters(): diff --git a/advancedbilling/controllers/components_controller.py b/advancedbilling/controllers/components_controller.py index 55ce1b8e..4d522ad8 100644 --- a/advancedbilling/controllers/components_controller.py +++ b/advancedbilling/controllers/components_controller.py @@ -391,9 +391,9 @@ def read_component(self, component_id): """Does a GET request to /product_families/{product_family_id}/components/{component_id}.json. - This request will return information regarding a component from a - specific product family. - You may read the component by either the component's id or handle. + Returns information regarding a component from a specific product + family. + You can read the component by either the component's id or handle. When using the handle, it must be prefixed with `handle:`. Args: diff --git a/advancedbilling/controllers/customers_controller.py b/advancedbilling/controllers/customers_controller.py index 168c0a95..b74d2406 100644 --- a/advancedbilling/controllers/customers_controller.py +++ b/advancedbilling/controllers/customers_controller.py @@ -230,8 +230,8 @@ def read_customer(self, id): """Does a GET request to /customers/{id}.json. - This method allows to retrieve the Customer properties by Advanced - Billing-generated Customer ID. + Retrieves the Customer properties by Advanced Billing-generated + Customer ID. Args: id (int): The Advanced Billing id of the customer diff --git a/advancedbilling/controllers/payment_profiles_controller.py b/advancedbilling/controllers/payment_profiles_controller.py index 860528d2..4f278db5 100644 --- a/advancedbilling/controllers/payment_profiles_controller.py +++ b/advancedbilling/controllers/payment_profiles_controller.py @@ -121,11 +121,11 @@ def create_payment_profile(self, GoCardless](https://maxio.zendesk.com/hc/en-us/articles/24176159136909- GoCardless) + [Using Chargify.js with GoCardless - minimal - example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0Nj - AzNDIy-examples#minimal-example-with-direct-debit-gocardless-gateway) + example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Exampl + es#h_01K0PJ15QQZKCER8CFK40MR6XJ) + [Using Chargify.js with GoCardless - full - example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0Nj - AzNDIy-examples#full-example-with-direct-debit-gocardless-gateway) + example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Exampl + es#h_01K0PJ15QR09JVHWW0MCA7HVJV) ### GoCardless with Local Bank Details Following examples create customer, bank account and mandate in GoCardless: @@ -196,12 +196,11 @@ def create_payment_profile(self, Debit](https://maxio.zendesk.com/hc/en-us/articles/24176170430093-Strip e-SEPA-and-BECS-Direct-Debit) + [Using Chargify.js with Stripe Direct Debit - minimal - example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0Nj - AzNDIy-examples#minimal-example-with-sepa-or-becs-direct-debit-stripe-g - ateway) + example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Exampl + es#h_01K0PJ15QQFKKN8Z7B7DZ9AJS5) + [Using Chargify.js with Stripe Direct Debit - full - example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0Nj - AzNDIy-examples#full-example-with-sepa-direct-debit-stripe-gateway) + example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Exampl + es#h_01K0PJ15QRECQQ4ECS3ZA55GY7) ### Stripe SEPA Direct Debit Payment Profiles The following example creates a customer, bank account and mandate in Stripe: @@ -917,8 +916,8 @@ def read_one_time_token(self, profile instead of passing all bank account or credit card data directly to a given API endpoint. To obtain a One Time Token you have to use - [Chargify.js](https://developers.chargify.com/docs/developer-docs/ZG9jO - jE0NjAzNDI0-overview). + [Chargify.js](https://docs.maxio.com/hc/en-us/articles/38163190843789-C + hargify-js-Overview#chargify-js-overview-0-0). Args: chargify_token (str): Advanced Billing Token diff --git a/advancedbilling/controllers/subscription_components_controller.py b/advancedbilling/controllers/subscription_components_controller.py index 6e869a2b..65953696 100644 --- a/advancedbilling/controllers/subscription_components_controller.py +++ b/advancedbilling/controllers/subscription_components_controller.py @@ -776,10 +776,10 @@ def delete_prepaid_usage_allocation(self, ).execute() def create_usage(self, - subscription_id, + subscription_id_or_reference, component_id, body=None): - """Does a POST request to /subscriptions/{subscription_id}/components/{component_id}/usages.json. + """Does a POST request to /subscriptions/{subscription_id_or_reference}/components/{component_id}/usages.json. ## Documentation Full documentation on how to create Components in the Advanced Billing @@ -853,7 +853,14 @@ def create_usage(self, both an SMS Message and an Email, send an API call for each. Args: - subscription_id (int): The Chargify id of the subscription + subscription_id_or_reference (int | str): Either the Advanced + Billing subscription ID (integer) or the subscription + reference (string). Important: In cases where a numeric string + value matches both an existing subscription ID and an existing + subscription reference, the system will prioritize the + subscription ID lookup. For example, if both subscription ID + 123 and subscription reference "123" exist, passing "123" will + return the subscription with ID 123. component_id (int | str): Either the Advanced Billing id for the component or the component's handle prefixed by `handle:` body (CreateUsageRequest, optional): The request body parameter. @@ -871,13 +878,14 @@ def create_usage(self, return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/components/{component_id}/usages.json') + .path('/subscriptions/{subscription_id_or_reference}/components/{component_id}/usages.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() - .key('subscription_id') - .value(subscription_id) + .key('subscription_id_or_reference') + .value(subscription_id_or_reference) .is_required(True) - .should_encode(True)) + .should_encode(True) + .validator(lambda value: UnionTypeLookUp.get('CreateUsageSubscriptionIdOrReference').validate(value))) .template_param(Parameter() .key('component_id') .value(component_id) @@ -903,7 +911,7 @@ def create_usage(self, def list_usages(self, options=dict()): - """Does a GET request to /subscriptions/{subscription_id}/components/{component_id}/usages.json. + """Does a GET request to /subscriptions/{subscription_id_or_reference}/components/{component_id}/usages.json. This request will return a list of the usages associated with a subscription for a particular metered component. This will display the @@ -929,8 +937,15 @@ def list_usages(self, being the key and their desired values being the value. A list of parameters that can be used are:: - subscription_id -- int -- The Chargify id of the - subscription + subscription_id_or_reference -- int | str -- Either the + Advanced Billing subscription ID (integer) or the + subscription reference (string). Important: In cases + where a numeric string value matches both an existing + subscription ID and an existing subscription + reference, the system will prioritize the subscription + ID lookup. For example, if both subscription ID 123 + and subscription reference "123" exist, passing "123" + will return the subscription with ID 123. component_id -- int | str -- Either the Advanced Billing id for the component or the component's handle prefixed by `handle:` @@ -972,13 +987,14 @@ def list_usages(self, return super().new_api_call_builder.request( RequestBuilder().server(Server.PRODUCTION) - .path('/subscriptions/{subscription_id}/components/{component_id}/usages.json') + .path('/subscriptions/{subscription_id_or_reference}/components/{component_id}/usages.json') .http_method(HttpMethodEnum.GET) .template_param(Parameter() - .key('subscription_id') - .value(options.get('subscription_id', None)) + .key('subscription_id_or_reference') + .value(options.get('subscription_id_or_reference', None)) .is_required(True) - .should_encode(True)) + .should_encode(True) + .validator(lambda value: UnionTypeLookUp.get('ListUsagesInputSubscriptionIdOrReference').validate(value))) .template_param(Parameter() .key('component_id') .value(options.get('component_id', None)) diff --git a/advancedbilling/controllers/subscriptions_controller.py b/advancedbilling/controllers/subscriptions_controller.py index e2716b64..136c4a9f 100644 --- a/advancedbilling/controllers/subscriptions_controller.py +++ b/advancedbilling/controllers/subscriptions_controller.py @@ -82,13 +82,13 @@ def create_subscription(self, Bulk creation of subscriptions is currently not supported. For scenarios where multiple subscriptions must be added, particularly when assigning to the same subscription group, it is essential to - switch to a single-threaded approach. + switch to a single-threaded approach. To avoid data conflicts or inaccuracies, incorporate a sleep interval between requests. While this single-threaded approach may impact performance, it ensures data consistency and accuracy in cases where concurrent creation attempts could otherwise lead to issues with subscription alignment - and integrity. + and integrity. ## Taxable Subscriptions If your intent is to charge your subscribers tax via [Avalara Taxes](https://maxio.zendesk.com/hc/en-us/articles/24287043035661-Avala @@ -175,10 +175,10 @@ def create_subscription(self, # Passing Payment Information ## Subscription with Chargify.js token The `chargify_token` can be obtained using - [Chargify.js](https://developers.chargify.com/docs/developer-docs/ZG9jO - jE0NjAzNDI0-overview). The token represents payment profile attributes - that were provided by the customer in their browser and stored at the - payment gateway. + [Chargify.js](https://docs.maxio.com/hc/en-us/articles/38163190843789-C + hargify-js-Overview#chargify-js-overview-0-0). The token represents + payment profile attributes that were provided by the customer in their + browser and stored at the payment gateway. The `payment_type` attribute may either be `credit_card` or `bank_account`, depending on the type of payment method being added. If a bank account is being passed, the payment attributes should be @@ -304,11 +304,11 @@ def create_subscription(self, GoCardless](https://maxio.zendesk.com/hc/en-us/articles/24176159136909- GoCardless) + [Using Chargify.js with GoCardless - minimal - example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0Nj - AzNDIy-examples#minimal-example-with-direct-debit-gocardless-gateway) + example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Exampl + es#h_01K0PJ15QQZKCER8CFK40MR6XJ) + [Using Chargify.js with GoCardless - full - example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0Nj - AzNDIy-examples#full-example-with-direct-debit-gocardless-gateway) + example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Exampl + es#h_01K0PJ15QR09JVHWW0MCA7HVJV) ```json { "subscription": { @@ -366,12 +366,11 @@ def create_subscription(self, Debit](https://maxio.zendesk.com/hc/en-us/articles/24176170430093-Strip e-SEPA-and-BECS-Direct-Debit) + [Using Chargify.js with Stripe SEPA or BECS Direct Debit - minimal - example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0Nj - AzNDIy-examples#minimal-example-with-sepa-or-becs-direct-debit-stripe-g - ateway) + example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Exampl + es#h_01K0PJ15QQFKKN8Z7B7DZ9AJS5) + [Using Chargify.js with Stripe SEPA Direct Debit - full - example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0Nj - AzNDIy-examples#full-example-with-sepa-direct-debit-stripe-gateway) + example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Exampl + es#h_01K0PJ15QR09JVHWW0MCA7HVJV) ```json { "subscription": { @@ -399,11 +398,11 @@ def create_subscription(self, e-SEPA-and-BECS-Direct-Debit) + [Using Chargify.js with Stripe SEPA, BECS or BACS Direct Debit - minimal - example](page:development-tools/chargify-js/examples#minimal-example-wi - th-sepa-becs-or-bacs-direct-debit-stripe-gateway) + example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Exampl + es#h_01K0PJ15QQFKKN8Z7B7DZ9AJS5) + [Using Chargify.js with Stripe BECS Direct Debit - full - example](page:development-tools/chargify-js/examples#full-example-with- - becs-direct-debit-stripe-gateway) + example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Exampl + es#h_01K0PJ15QRX4B1TYZKZD8ZND6D) ```json { "subscription": { @@ -432,11 +431,11 @@ def create_subscription(self, e-SEPA-and-BECS-Direct-Debit) + [Using Chargify.js with Stripe SEPA, BECS or BACS Direct Debit - minimal - example](page:development-tools/chargify-js/examples#minimal-example-wi - th-sepa-becs-or-bacs-direct-debit-stripe-gateway) + example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Exampl + es#h_01K0PJ15QQFKKN8Z7B7DZ9AJS5) + [Using Chargify.js with Stripe BACS Direct Debit - full - example](page:development-tools/chargify-js/examples#full-example-with- - bacs-direct-debit-stripe-gateway) + example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Exampl + es#h_01K0PJ15QR7PA1DJ3XE9MD05FM) ```json { "subscription": { diff --git a/advancedbilling/http/__init__.py b/advancedbilling/http/__init__.py index b489ef8a..7ab8540c 100644 --- a/advancedbilling/http/__init__.py +++ b/advancedbilling/http/__init__.py @@ -4,4 +4,5 @@ 'http_request', 'http_response', 'http_call_back', + 'proxy_settings', ] diff --git a/advancedbilling/http/proxy_settings.py b/advancedbilling/http/proxy_settings.py new file mode 100644 index 00000000..2dba35bd --- /dev/null +++ b/advancedbilling/http/proxy_settings.py @@ -0,0 +1,14 @@ + +""" +advanced_billing + +This file was automatically generated for Maxio by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + +from apimatic_core.http.configurations.proxy_settings import ProxySettings as CoreProxySettings + +class ProxySettings(CoreProxySettings): + """ + A simple data model for configuring HTTP(S) proxy settings. + """ diff --git a/advancedbilling/utilities/union_type_lookup.py b/advancedbilling/utilities/union_type_lookup.py index e054831c..ff869665 100644 --- a/advancedbilling/utilities/union_type_lookup.py +++ b/advancedbilling/utilities/union_type_lookup.py @@ -158,12 +158,24 @@ class UnionTypeLookUp: LeafType(str) ] ), + 'CreateUsageSubscriptionIdOrReference': OneOf( + [ + LeafType(int), + LeafType(str) + ] + ), 'CreateUsageComponentId': OneOf( [ LeafType(int), LeafType(str) ] ), + 'ListUsagesInputSubscriptionIdOrReference': OneOf( + [ + LeafType(int), + LeafType(str) + ] + ), 'ListUsagesInputComponentId': OneOf( [ LeafType(int), diff --git a/doc/client.md b/doc/client.md index bd289e1b..fb4eb6b5 100644 --- a/doc/client.md +++ b/doc/client.md @@ -15,6 +15,7 @@ The following parameters are configurable for the API Client: | backoff_factor | `float` | A backoff factor to apply between attempts after the second try.
**Default: 2** | | retry_statuses | `Array of int` | The http statuses on which retry is to be done.
**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.
**Default: ['GET', 'PUT']** | +| proxy_settings | [`ProxySettings`](../doc/proxy-settings.md) | Optional proxy configuration to route HTTP requests through a proxy server. | | basic_auth_credentials | [`BasicAuthCredentials`](auth/basic-authentication.md) | The credential object for Basic Authentication | The API client can be initialized as follows: diff --git a/doc/controllers/component-price-points.md b/doc/controllers/component-price-points.md index fb10d9d1..577c169d 100644 --- a/doc/controllers/component-price-points.md +++ b/doc/controllers/component-price-points.md @@ -189,10 +189,11 @@ def list_component_price_points(self, ## Example Usage ```python -collect = {Liquid error: Value cannot be null. (Parameter 'key') +collect = { 'component_id': 222, 'page': 2, - 'per_page': 50 + 'per_page': 50, + 'filter_type': Liquid error: Value cannot be null. (Parameter 'key') } result = component_price_points_controller.list_component_price_points(collect) print(result) diff --git a/doc/controllers/components.md b/doc/controllers/components.md index 3b3f7989..15c203fc 100644 --- a/doc/controllers/components.md +++ b/doc/controllers/components.md @@ -652,9 +652,9 @@ print(result) # Read Component -This request will return information regarding a component from a specific product family. +Returns information regarding a component from a specific product family. -You may read the component by either the component's id or handle. When using the handle, it must be prefixed with `handle:`. +You can read the component by either the component's id or handle. When using the handle, it must be prefixed with `handle:`. ```python def read_component(self, diff --git a/doc/controllers/customers.md b/doc/controllers/customers.md index 2963ddd6..99d6f050 100644 --- a/doc/controllers/customers.md +++ b/doc/controllers/customers.md @@ -271,7 +271,7 @@ print(result) # Read Customer -This method allows to retrieve the Customer properties by Advanced Billing-generated Customer ID. +Retrieves the Customer properties by Advanced Billing-generated Customer ID. ```python def read_customer(self, @@ -297,6 +297,43 @@ result = customers_controller.read_customer(id) print(result) ``` +## Example Response *(as JSON)* + +```json +{ + "customer": { + "first_name": "Jane", + "last_name": "Doe", + "email": "jane@example.com", + "cc_emails": "joe@example.com", + "organization": "ABC, Inc.", + "reference": "1234567890", + "id": 88833369, + "created_at": "2025-05-08T11:39:18-04:00", + "updated_at": "2025-05-08T11:39:18-04:00", + "address": "123 Main Street", + "address_2": "Unit 10", + "city": "Anytown", + "state": "MA", + "state_name": "Massachusetts", + "zip": "02120", + "country": "US", + "country_name": "United States", + "phone": "555-555-1212", + "verified": false, + "portal_customer_created_at": null, + "portal_invite_last_sent_at": null, + "portal_invite_last_accepted_at": null, + "tax_exempt": false, + "vat_number": null, + "parent_id": null, + "locale": "es-MX", + "salesforce_id": null, + "default_auto_renewal_profile_id": null + } +} +``` + # Update Customer diff --git a/doc/controllers/payment-profiles.md b/doc/controllers/payment-profiles.md index 7365645d..8fa27208 100644 --- a/doc/controllers/payment-profiles.md +++ b/doc/controllers/payment-profiles.md @@ -96,9 +96,9 @@ For more information on GoCardless, please view the following resources: + [Full documentation on GoCardless](https://maxio.zendesk.com/hc/en-us/articles/24176159136909-GoCardless) -+ [Using Chargify.js with GoCardless - minimal example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDIy-examples#minimal-example-with-direct-debit-gocardless-gateway) ++ [Using Chargify.js with GoCardless - minimal example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Examples#h_01K0PJ15QQZKCER8CFK40MR6XJ) -+ [Using Chargify.js with GoCardless - full example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDIy-examples#full-example-with-direct-debit-gocardless-gateway) ++ [Using Chargify.js with GoCardless - full example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Examples#h_01K0PJ15QR09JVHWW0MCA7HVJV) ### GoCardless with Local Bank Details @@ -170,9 +170,9 @@ For more information on Stripe SEPA Direct Debit, please view the following reso + [Full documentation on Stripe SEPA Direct Debit](https://maxio.zendesk.com/hc/en-us/articles/24176170430093-Stripe-SEPA-and-BECS-Direct-Debit) -+ [Using Chargify.js with Stripe Direct Debit - minimal example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDIy-examples#minimal-example-with-sepa-or-becs-direct-debit-stripe-gateway) ++ [Using Chargify.js with Stripe Direct Debit - minimal example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Examples#h_01K0PJ15QQFKKN8Z7B7DZ9AJS5) -+ [Using Chargify.js with Stripe Direct Debit - full example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDIy-examples#full-example-with-sepa-direct-debit-stripe-gateway) ++ [Using Chargify.js with Stripe Direct Debit - full example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Examples#h_01K0PJ15QRECQQ4ECS3ZA55GY7) ### Stripe SEPA Direct Debit Payment Profiles @@ -1035,7 +1035,7 @@ One Time Tokens aka Advanced Billing Tokens house the credit card or ACH (Author You can use One Time Tokens while creating a subscription or payment profile instead of passing all bank account or credit card data directly to a given API endpoint. -To obtain a One Time Token you have to use [Chargify.js](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDI0-overview). +To obtain a One Time Token you have to use [Chargify.js](https://docs.maxio.com/hc/en-us/articles/38163190843789-Chargify-js-Overview#chargify-js-overview-0-0). ```python def read_one_time_token(self, diff --git a/doc/controllers/product-price-points.md b/doc/controllers/product-price-points.md index 625e1f28..2cd9caf3 100644 --- a/doc/controllers/product-price-points.md +++ b/doc/controllers/product-price-points.md @@ -135,10 +135,11 @@ def list_product_price_points(self, ## Example Usage ```python -collect = {Liquid error: Value cannot be null. (Parameter 'key') +collect = { 'product_id': 124, 'page': 2, - 'per_page': 10 + 'per_page': 10, + 'filter_type': Liquid error: Value cannot be null. (Parameter 'key') } result = product_price_points_controller.list_product_price_points(collect) print(result) diff --git a/doc/controllers/subscription-components.md b/doc/controllers/subscription-components.md index a14b357b..3c1f80bc 100644 --- a/doc/controllers/subscription-components.md +++ b/doc/controllers/subscription-components.md @@ -1092,7 +1092,7 @@ A. No. Usage should be reported as one API call per component on a single subscr ```python def create_usage(self, - subscription_id, + subscription_id_or_reference, component_id, body=None) ``` @@ -1101,7 +1101,7 @@ def create_usage(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id_or_reference` | int \| str | Template, Required | This is a container for one-of cases. | | `component_id` | int \| str | Template, Required | This is a container for one-of cases. | | `body` | [`CreateUsageRequest`](../../doc/models/create-usage-request.md) | Body, Optional | - | @@ -1112,7 +1112,7 @@ def create_usage(self, ## Example Usage ```python -subscription_id = 222 +subscription_id_or_reference = 234 component_id = 144 @@ -1125,7 +1125,7 @@ body = CreateUsageRequest( ) result = subscription_components_controller.create_usage( - subscription_id, + subscription_id_or_reference, component_id, body=body ) @@ -1183,7 +1183,7 @@ def list_usages(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | +| `subscription_id_or_reference` | int \| str | Template, Required | This is a container for one-of cases. | | `component_id` | int \| str | Template, Required | This is a container for one-of cases. | | `since_id` | `int` | Query, Optional | Returns usages with an id greater than or equal to the one specified | | `max_id` | `int` | Query, Optional | Returns usages with an id less than or equal to the one specified | @@ -1200,7 +1200,7 @@ def list_usages(self, ```python collect = { - 'subscription_id': 222, + 'subscription_id_or_reference': 234, 'component_id': 144, 'page': 2, 'per_page': 50 diff --git a/doc/controllers/subscriptions.md b/doc/controllers/subscriptions.md index f3d05c4a..643b1343 100644 --- a/doc/controllers/subscriptions.md +++ b/doc/controllers/subscriptions.md @@ -117,7 +117,7 @@ Custom prices and price points can exist in harmony on a subscription. ## Subscription with Chargify.js token -The `chargify_token` can be obtained using [Chargify.js](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDI0-overview). The token represents payment profile attributes that were provided by the customer in their browser and stored at the payment gateway. +The `chargify_token` can be obtained using [Chargify.js](https://docs.maxio.com/hc/en-us/articles/38163190843789-Chargify-js-Overview#chargify-js-overview-0-0). The token represents payment profile attributes that were provided by the customer in their browser and stored at the payment gateway. The `payment_type` attribute may either be `credit_card` or `bank_account`, depending on the type of payment method being added. If a bank account is being passed, the payment attributes should be changed to `bank_account_attributes`. @@ -248,9 +248,9 @@ For more information on GoCardless, please view the following two resources: + [Full documentation on GoCardless](https://maxio.zendesk.com/hc/en-us/articles/24176159136909-GoCardless) -+ [Using Chargify.js with GoCardless - minimal example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDIy-examples#minimal-example-with-direct-debit-gocardless-gateway) ++ [Using Chargify.js with GoCardless - minimal example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Examples#h_01K0PJ15QQZKCER8CFK40MR6XJ) -+ [Using Chargify.js with GoCardless - full example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDIy-examples#full-example-with-direct-debit-gocardless-gateway) ++ [Using Chargify.js with GoCardless - full example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Examples#h_01K0PJ15QR09JVHWW0MCA7HVJV) ```json { @@ -310,9 +310,9 @@ For more information on Stripe Direct Debit, please view the following two resou + [Full documentation on Stripe Direct Debit](https://maxio.zendesk.com/hc/en-us/articles/24176170430093-Stripe-SEPA-and-BECS-Direct-Debit) -+ [Using Chargify.js with Stripe SEPA or BECS Direct Debit - minimal example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDIy-examples#minimal-example-with-sepa-or-becs-direct-debit-stripe-gateway) ++ [Using Chargify.js with Stripe SEPA or BECS Direct Debit - minimal example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Examples#h_01K0PJ15QQFKKN8Z7B7DZ9AJS5) -+ [Using Chargify.js with Stripe SEPA Direct Debit - full example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDIy-examples#full-example-with-sepa-direct-debit-stripe-gateway) ++ [Using Chargify.js with Stripe SEPA Direct Debit - full example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Examples#h_01K0PJ15QR09JVHWW0MCA7HVJV) ```json { @@ -340,9 +340,9 @@ For more information on Stripe Direct Debit, please view the following two resou + [Full documentation on Stripe Direct Debit](https://maxio.zendesk.com/hc/en-us/articles/24176170430093-Stripe-SEPA-and-BECS-Direct-Debit) -+ [Using Chargify.js with Stripe SEPA, BECS or BACS Direct Debit - minimal example](page:development-tools/chargify-js/examples#minimal-example-with-sepa-becs-or-bacs-direct-debit-stripe-gateway) ++ [Using Chargify.js with Stripe SEPA, BECS or BACS Direct Debit - minimal example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Examples#h_01K0PJ15QQFKKN8Z7B7DZ9AJS5) -+ [Using Chargify.js with Stripe BECS Direct Debit - full example](page:development-tools/chargify-js/examples#full-example-with-becs-direct-debit-stripe-gateway) ++ [Using Chargify.js with Stripe BECS Direct Debit - full example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Examples#h_01K0PJ15QRX4B1TYZKZD8ZND6D) ```json { @@ -371,9 +371,9 @@ For more information on Stripe Direct Debit, please view the following two resou + [Full documentation on Stripe Direct Debit](https://maxio.zendesk.com/hc/en-us/articles/24176170430093-Stripe-SEPA-and-BECS-Direct-Debit) -+ [Using Chargify.js with Stripe SEPA, BECS or BACS Direct Debit - minimal example](page:development-tools/chargify-js/examples#minimal-example-with-sepa-becs-or-bacs-direct-debit-stripe-gateway) ++ [Using Chargify.js with Stripe SEPA, BECS or BACS Direct Debit - minimal example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Examples#h_01K0PJ15QQFKKN8Z7B7DZ9AJS5) -+ [Using Chargify.js with Stripe BACS Direct Debit - full example](page:development-tools/chargify-js/examples#full-example-with-bacs-direct-debit-stripe-gateway) ++ [Using Chargify.js with Stripe BACS Direct Debit - full example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Examples#h_01K0PJ15QR7PA1DJ3XE9MD05FM) ```json { diff --git a/doc/models/containers/create-usage-subscription-id-or-reference.md b/doc/models/containers/create-usage-subscription-id-or-reference.md new file mode 100644 index 00000000..5180df9e --- /dev/null +++ b/doc/models/containers/create-usage-subscription-id-or-reference.md @@ -0,0 +1,14 @@ + +# Create Usage Subscription Id or Reference + +## Data Type + +`int | str` + +## Cases + +| Type | +| --- | +| `int` | +| `str` | + diff --git a/doc/models/containers/list-usages-input-subscription-id-or-reference.md b/doc/models/containers/list-usages-input-subscription-id-or-reference.md new file mode 100644 index 00000000..3d900ee9 --- /dev/null +++ b/doc/models/containers/list-usages-input-subscription-id-or-reference.md @@ -0,0 +1,14 @@ + +# List Usages Input Subscription Id or Reference + +## Data Type + +`int | str` + +## Cases + +| Type | +| --- | +| `int` | +| `str` | + diff --git a/doc/proxy-settings.md b/doc/proxy-settings.md new file mode 100644 index 00000000..ef6f7993 --- /dev/null +++ b/doc/proxy-settings.md @@ -0,0 +1,30 @@ + +# ProxySettings + +Represents the proxy server configurations for API calls. + +## Properties + +| Name | Type | Tag | Description | +| --- | --- | --- | --- | +| address | `str` | required | The proxy server URL. | +| port | `int` | optional | The port to connect to the proxy server. | +| username | `str` | optional | Username for proxy authentication. | +| password | `str` | optional | Password for proxy authentication. | + +## Usage Example + +```python +from advancedbilling.advanced_billing_client import AdvancedBillingClient +from advancedbilling.http.proxy_settings import ProxySettings + +client = AdvancedBillingClient( + proxy_settings=ProxySettings( + address='http://localhost', + port=8888, + username='user', + password='pass' + ) +) +``` + diff --git a/pyproject.toml b/pyproject.toml index f8454935..1f130dd0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,10 +4,10 @@ build-backend = "setuptools.build_meta" [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 = "7.0.0" +version = "7.0.1" readme = "README.md" keywords = ["Maxio", "Advaced Billing", "Payments", "Subscription"] -dependencies = ["apimatic-core~=0.2.0, >= 0.2.20", "apimatic-core-interfaces~=0.1.0, >= 0.1.5", "apimatic-requests-client-adapter~=0.1.0, >= 0.1.6", "deprecation~=2.1"] +dependencies = ["apimatic-core~=0.2.0, >= 0.2.22", "apimatic-core-interfaces~=0.1.0, >= 0.1.5", "apimatic-requests-client-adapter~=0.1.0, >= 0.1.8", "deprecation~=2.1"] classifiers = [] requires-python = ">=3.7" [[project.authors]] diff --git a/requirements.txt b/requirements.txt index 281cd7ac..4c5fcccf 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -apimatic-core~=0.2.0, >= 0.2.20 +apimatic-core~=0.2.0, >= 0.2.22 apimatic-core-interfaces~=0.1.0, >= 0.1.5 -apimatic-requests-client-adapter~=0.1.0, >= 0.1.6 +apimatic-requests-client-adapter~=0.1.0, >= 0.1.8 deprecation~=2.1 \ No newline at end of file From 4b3735ea8759b5bc7aa7b83d5759743a2587bef1 Mon Sep 17 00:00:00 2001 From: maxio-sdk Date: Tue, 9 Sep 2025 14:40:36 +0000 Subject: [PATCH 2/2] Automated commit message --- .../component_price_points_controller.py | 3 +- .../controllers/webhooks_controller.py | 73 ++++++------------- doc/controllers/component-price-points.md | 4 +- doc/controllers/webhooks.md | 41 +++-------- 4 files changed, 37 insertions(+), 84 deletions(-) diff --git a/advancedbilling/controllers/component_price_points_controller.py b/advancedbilling/controllers/component_price_points_controller.py index d9db4853..cdc3bde7 100644 --- a/advancedbilling/controllers/component_price_points_controller.py +++ b/advancedbilling/controllers/component_price_points_controller.py @@ -92,8 +92,7 @@ def create_component_price_point(self, body=None): """Does a POST request to /components/{component_id}/price_points.json. - This endpoint can be used to create a new price point for an existing - component. + Creates a price point for an existing component. Args: component_id (int): The Advanced Billing id of the component diff --git a/advancedbilling/controllers/webhooks_controller.py b/advancedbilling/controllers/webhooks_controller.py index c8a6a4d6..b4452af1 100644 --- a/advancedbilling/controllers/webhooks_controller.py +++ b/advancedbilling/controllers/webhooks_controller.py @@ -34,31 +34,10 @@ def list_webhooks(self, options=dict()): """Does a GET request to /webhooks.json. - ## Webhooks Intro - The Webhooks API allows you to view a list of all webhooks and to - selectively resend individual or groups of webhooks. Webhooks will be - sent on endpoints specified by you. Endpoints can be added via API or - Web UI. There is also an option to enable / disable webhooks via API - request. - We recommend that you review Advanced Billing's webhook documentation - located in our help site. The following resources will help guide you - on how to use webhooks in Advanced Billing, in addition to these - webhook endpoints: - + [Adding/editing new - webhooks](https://maxio.zendesk.com/hc/en-us/articles/24286723085197-We - bhooks#configure-webhook-url) - + [Webhooks introduction and delivery - information](https://maxio.zendesk.com/hc/en-us/articles/24266143173901 - -Webhooks-Overview) - + [Main webhook - reference](https://maxio.zendesk.com/hc/en-us/articles/24266136649869-W - ebhooks-Reference) - + [Available webhooks and - payloads](https://maxio.zendesk.com/hc/en-us/articles/24266136649869-We - bhooks-Reference#events) - ## List Webhooks for a Site - This method allows you to fetch data about webhooks. You can pass - query parameters if you want to filter webhooks. + Allows you to view a list of webhooks. You can pass query parameters + if you want to filter webhooks. See the + [Webhooks](page:introduction/webhooks/webhooks) documentation for more + information. Args: options (dict, optional): Key-value pairs for any of the @@ -144,7 +123,7 @@ def enable_webhooks(self, body=None): """Does a PUT request to /webhooks/settings.json. - This method allows you to enable webhooks via API for your site + Allows you to enable webhooks for your site Args: body (EnableWebhooksRequest, optional): The request body parameter. @@ -184,11 +163,10 @@ def replay_webhooks(self, body=None): """Does a POST request to /webhooks/replay.json. - Posting to the replay endpoint does not immediately resend the - webhooks. They are added to a queue and will be sent as soon as - possible, depending on available system resources. - You may submit an array of up to 1000 webhook IDs to replay in the - request. + Replays webhooks. Posting to this endpoint does not immediately resend + the webhooks. They are added to a queue and sent as soon as possible, + depending on available system resources. You can submit an array of up + to 1000 webhook IDs in the replay request. Args: body (ReplayWebhooksRequest, optional): The request body parameter. @@ -228,12 +206,11 @@ def create_endpoint(self, body=None): """Does a POST request to /endpoints.json. - The Chargify API allows you to create an endpoint and assign a list of - webhooks subscriptions (events) to it. - You can check available events here. - [Event - keys](https://maxio.zendesk.com/hc/en-us/articles/24266136649869-Webhoo - ks-Reference#events) + Creates an endpoint and assigns a list of webhooks subscriptions + (events) to it. + See the [Webhooks + Reference](page:introduction/webhooks/webhooks-reference#events) page + for available events. Args: body (CreateOrUpdateEndpointRequest, optional): The request body @@ -274,7 +251,7 @@ def create_endpoint(self, def list_endpoints(self): """Does a GET request to /endpoints.json. - This method returns created endpoints for site. + Returns created endpoints for a site. Returns: List[Endpoint]: Response from the API. OK @@ -306,17 +283,15 @@ def update_endpoint(self, body=None): """Does a PUT request to /endpoints/{endpoint_id}.json. - You can update an Endpoint via the API with a PUT request to the - resource endpoint. - You can change the `url` of your endpoint which consumes webhooks or - list of `webhook_subscriptions`. - Check available [Event - keys](https://maxio.zendesk.com/hc/en-us/articles/24266136649869-Webhoo - ks-Reference#events). - Always send a complete list of events which you want subscribe/watch. - Sending an PUT request for existing endpoint with empty list of - `webhook_subscriptions` will end with unsubscribe from all events. - If you want unsubscribe from specific event, just send a list of + Updates an Endpoint. You can change the `url` of your endpoint or the + list of `webhook_subscriptions` to which you are subscribed. See the + [Webhooks + Reference](page:introduction/webhooks/webhooks-reference#events) page + for available events. + Always send a complete list of events to which you want to subscribe. + Sending a PUT request for an existing endpoint with an empty list of + `webhook_subscriptions` will unsubscribe all events. + If you want unsubscribe from a specific event, send a list of `webhook_subscriptions` without the specific event key. Args: diff --git a/doc/controllers/component-price-points.md b/doc/controllers/component-price-points.md index 577c169d..434c5cc8 100644 --- a/doc/controllers/component-price-points.md +++ b/doc/controllers/component-price-points.md @@ -98,7 +98,7 @@ print(result) # Create Component Price Point -This endpoint can be used to create a new price point for an existing component. +Creates a price point for an existing component. ```python def create_component_price_point(self, @@ -135,7 +135,7 @@ body = CreateComponentPricePointRequest( Price( starting_quantity='101', unit_price='4.00', - ending_quantity=None + ending_quantity='200' ) ], handle='wholesale-handle', diff --git a/doc/controllers/webhooks.md b/doc/controllers/webhooks.md index 6532f47a..a42b79c7 100644 --- a/doc/controllers/webhooks.md +++ b/doc/controllers/webhooks.md @@ -20,20 +20,7 @@ webhooks_controller = client.webhooks # List Webhooks -## Webhooks Intro - -The Webhooks API allows you to view a list of all webhooks and to selectively resend individual or groups of webhooks. Webhooks will be sent on endpoints specified by you. Endpoints can be added via API or Web UI. There is also an option to enable / disable webhooks via API request. - -We recommend that you review Advanced Billing's webhook documentation located in our help site. The following resources will help guide you on how to use webhooks in Advanced Billing, in addition to these webhook endpoints: - -+ [Adding/editing new webhooks](https://maxio.zendesk.com/hc/en-us/articles/24286723085197-Webhooks#configure-webhook-url) -+ [Webhooks introduction and delivery information](https://maxio.zendesk.com/hc/en-us/articles/24266143173901-Webhooks-Overview) -+ [Main webhook reference](https://maxio.zendesk.com/hc/en-us/articles/24266136649869-Webhooks-Reference) -+ [Available webhooks and payloads](https://maxio.zendesk.com/hc/en-us/articles/24266136649869-Webhooks-Reference#events) - -## List Webhooks for a Site - -This method allows you to fetch data about webhooks. You can pass query parameters if you want to filter webhooks. +Allows you to view a list of webhooks. You can pass query parameters if you want to filter webhooks. See the [Webhooks](page:introduction/webhooks/webhooks) documentation for more information. ```python def list_webhooks(self, @@ -109,7 +96,7 @@ print(result) # Enable Webhooks -This method allows you to enable webhooks via API for your site +Allows you to enable webhooks for your site ```python def enable_webhooks(self, @@ -150,9 +137,7 @@ print(result) # Replay Webhooks -Posting to the replay endpoint does not immediately resend the webhooks. They are added to a queue and will be sent as soon as possible, depending on available system resources. - -You may submit an array of up to 1000 webhook IDs to replay in the request. +Replays webhooks. Posting to this endpoint does not immediately resend the webhooks. They are added to a queue and sent as soon as possible, depending on available system resources. You can submit an array of up to 1000 webhook IDs in the replay request. ```python def replay_webhooks(self, @@ -196,10 +181,8 @@ print(result) # Create Endpoint -The Chargify API allows you to create an endpoint and assign a list of webhooks subscriptions (events) to it. - -You can check available events here. -[Event keys](https://maxio.zendesk.com/hc/en-us/articles/24266136649869-Webhooks-Reference#events) +Creates an endpoint and assigns a list of webhooks subscriptions (events) to it. +See the [Webhooks Reference](page:introduction/webhooks/webhooks-reference#events) page for available events. ```python def create_endpoint(self, @@ -261,7 +244,7 @@ print(result) # List Endpoints -This method returns created endpoints for site. +Returns created endpoints for a site. ```python def list_endpoints(self) @@ -309,15 +292,11 @@ print(result) # Update Endpoint -You can update an Endpoint via the API with a PUT request to the resource endpoint. - -You can change the `url` of your endpoint which consumes webhooks or list of `webhook_subscriptions`. -Check available [Event keys](https://maxio.zendesk.com/hc/en-us/articles/24266136649869-Webhooks-Reference#events). +Updates an Endpoint. You can change the `url` of your endpoint or the list of `webhook_subscriptions` to which you are subscribed. See the [Webhooks Reference](page:introduction/webhooks/webhooks-reference#events) page for available events. -Always send a complete list of events which you want subscribe/watch. -Sending an PUT request for existing endpoint with empty list of `webhook_subscriptions` will end with unsubscribe from all events. +Always send a complete list of events to which you want to subscribe. Sending a PUT request for an existing endpoint with an empty list of `webhook_subscriptions` will unsubscribe all events. -If you want unsubscribe from specific event, just send a list of `webhook_subscriptions` without the specific event key. +If you want unsubscribe from a specific event, send a list of `webhook_subscriptions` without the specific event key. ```python def update_endpoint(self, @@ -343,7 +322,7 @@ endpoint_id = 42 body = CreateOrUpdateEndpointRequest( endpoint=CreateOrUpdateEndpoint( - url='https://yout.site/webhooks/1/json.', + url='https://your.site/webhooks/1/json.', webhook_subscriptions=[ WebhookSubscription.PAYMENT_FAILURE, WebhookSubscription.PAYMENT_SUCCESS,