From e822575fe336e9057bbe9bf1595a1a8ceff51bbe Mon Sep 17 00:00:00 2001 From: maxio-sdk Date: Wed, 10 Jan 2024 14:08:15 +0000 Subject: [PATCH] Automated commit message --- LICENSE | 2 +- README.md | 16 ++-- advancedbilling/advanced_billing_client.py | 44 +++++------ advancedbilling/configuration.py | 74 +++++++++++++------ .../controllers/advance_invoice_controller.py | 6 +- .../controllers/api_exports_controller.py | 26 +++---- .../controllers/base_controller.py | 8 +- .../controllers/billing_portal_controller.py | 8 +- .../controllers/components_controller.py | 36 ++++----- .../controllers/coupons_controller.py | 28 +++---- .../controllers/custom_fields_controller.py | 39 ++++------ .../controllers/customers_controller.py | 14 ++-- ...vents_based_billing_segments_controller.py | 12 +-- .../controllers/events_controller.py | 6 +- .../controllers/insights_controller.py | 8 +- .../controllers/invoices_controller.py | 34 ++++----- .../controllers/offers_controller.py | 10 +-- .../payment_profiles_controller.py | 24 +++--- .../product_families_controller.py | 10 ++- .../product_price_points_controller.py | 22 +++--- .../controllers/products_controller.py | 12 +-- .../proforma_invoices_controller.py | 18 ++--- .../controllers/reason_codes_controller.py | 10 +-- .../controllers/referral_codes_controller.py | 2 +- .../sales_commissions_controller.py | 6 +- .../controllers/sites_controller.py | 6 +- .../subscription_components_controller.py | 39 +++++----- ...iption_group_invoice_account_controller.py | 8 +- .../subscription_group_status_controller.py | 8 +- .../subscription_groups_controller.py | 18 ++--- ...subscription_invoice_account_controller.py | 12 +-- .../subscription_notes_controller.py | 10 +-- .../subscription_products_controller.py | 4 +- .../subscription_status_controller.py | 20 ++--- .../controllers/subscriptions_controller.py | 30 ++++---- .../controllers/webhooks_controller.py | 12 +-- advancedbilling/exceptions/__init__.py | 2 +- ....py => single_error_response_exception.py} | 6 +- advancedbilling/http/auth/basic_auth.py | 34 +++++++-- advancedbilling/models/__init__.py | 7 +- advancedbilling/models/allocate_components.py | 37 ++++++---- advancedbilling/models/allocation.py | 65 ++++++++++++---- advancedbilling/models/allocation_preview.py | 2 +- .../models/allocation_preview_direction.py | 25 +++++++ .../models/allocation_preview_item.py | 31 ++++++-- .../models/allocation_preview_line_item.py | 9 ++- .../allocation_preview_line_item_kind.py | 31 ++++++++ .../models/billing_manifest_item.py | 6 +- .../models/billing_manifest_line_item_kind.py | 37 ++++++++++ advancedbilling/models/create_allocation.py | 11 +++ advancedbilling/models/create_metafield.py | 10 +-- .../create_or_update_flat_amount_coupon.py | 18 ++--- .../create_or_update_percentage_coupon.py | 18 ++--- advancedbilling/models/event.py | 1 + .../models/invoice_line_item_event_data.py | 7 +- .../models/invoice_previous_balance.py | 16 ++-- advancedbilling/models/line_item_kind.py | 49 ++++++++++++ .../models/line_item_transaction_type.py | 40 ++++++++++ advancedbilling/models/metafields.py | 10 +-- advancedbilling/models/offer_item.py | 27 ++++++- ...n_payment.py => payment_for_allocation.py} | 6 +- .../models/preview_allocations_request.py | 39 ++++++++-- .../models/renewal_preview_line_item.py | 5 +- .../models/subscription_component.py | 27 ++++++- advancedbilling/models/usage.py | 6 +- .../utilities/union_type_lookup.py | 42 ++++++++++- doc/auth/basic-authentication.md | 34 +++++++++ doc/client.md | 12 ++- doc/controllers/api-exports.md | 18 ++--- doc/controllers/components.md | 22 +++--- doc/controllers/coupons.md | 34 ++++----- doc/controllers/custom-fields.md | 48 +++++++----- doc/controllers/customers.md | 4 +- .../events-based-billing-segments.md | 4 +- doc/controllers/events.md | 18 ++--- doc/controllers/insights.md | 8 +- doc/controllers/invoices.md | 50 ++++++------- doc/controllers/offers.md | 4 +- doc/controllers/payment-profiles.md | 4 +- doc/controllers/product-families.md | 10 ++- doc/controllers/product-price-points.md | 8 +- doc/controllers/products.md | 4 +- doc/controllers/proforma-invoices.md | 18 ++--- doc/controllers/reason-codes.md | 4 +- doc/controllers/sales-commissions.md | 18 ++--- doc/controllers/sites.md | 6 +- doc/controllers/subscription-components.md | 46 ++++++------ .../subscription-group-invoice-account.md | 4 +- doc/controllers/subscription-groups.md | 4 +- .../subscription-invoice-account.md | 4 +- doc/controllers/subscription-notes.md | 4 +- doc/controllers/subscription-status.md | 2 +- doc/controllers/subscriptions.md | 8 +- doc/controllers/webhooks.md | 4 +- doc/models/allocate-components.md | 39 +++++----- doc/models/allocation-preview-direction.md | 14 ++++ doc/models/allocation-preview-item.md | 10 ++- .../allocation-preview-line-item-kind.md | 18 +++++ doc/models/allocation-preview-line-item.md | 10 +-- doc/models/allocation-preview.md | 2 +- doc/models/allocation-response.md | 6 +- doc/models/allocation.md | 18 +++-- doc/models/billing-manifest-item.md | 8 +- doc/models/billing-manifest-line-item-kind.md | 20 +++++ doc/models/billing-manifest.md | 12 +-- doc/models/containers/allocation-payment-2.md | 13 ---- doc/models/containers/allocation-payment.md | 13 ++++ ...location-preview-item-previous-quantity.md | 14 ++++ .../allocation-preview-item-quantity.md | 14 ++++ .../allocation-previous-quantity.md | 14 ++++ doc/models/containers/allocation-quantity.md | 14 ++++ doc/models/create-allocation.md | 1 + doc/models/create-metafield.md | 2 - doc/models/create-metafields-request.md | 1 - doc/models/create-or-update-coupon.md | 6 +- .../create-or-update-flat-amount-coupon.md | 14 ++-- .../create-or-update-percentage-coupon.md | 14 ++-- doc/models/invoice-previous-balance.md | 4 +- doc/models/line-item-kind.md | 24 ++++++ doc/models/line-item-transaction-type.md | 21 ++++++ doc/models/metafields.md | 2 - doc/models/offer-item.md | 2 + ...n-payment.md => payment-for-allocation.md} | 10 +-- doc/models/preview-allocations-request.md | 8 +- doc/models/renewal-preview-line-item.md | 8 +- ....md => single-error-response-exception.md} | 6 +- doc/models/subscription-component.md | 2 + doc/models/subscription-preview-response.md | 16 ++-- doc/models/subscription-preview.md | 16 ++-- doc/models/usage-response.md | 2 +- doc/models/usage.md | 4 +- 131 files changed, 1339 insertions(+), 733 deletions(-) rename advancedbilling/exceptions/{single_error_response_error_exception.py => single_error_response_exception.py} (81%) create mode 100644 advancedbilling/models/allocation_preview_direction.py create mode 100644 advancedbilling/models/allocation_preview_line_item_kind.py create mode 100644 advancedbilling/models/billing_manifest_line_item_kind.py create mode 100644 advancedbilling/models/line_item_kind.py create mode 100644 advancedbilling/models/line_item_transaction_type.py rename advancedbilling/models/{allocation_payment.py => payment_for_allocation.py} (95%) create mode 100644 doc/auth/basic-authentication.md create mode 100644 doc/models/allocation-preview-direction.md create mode 100644 doc/models/allocation-preview-line-item-kind.md create mode 100644 doc/models/billing-manifest-line-item-kind.md delete mode 100644 doc/models/containers/allocation-payment-2.md create mode 100644 doc/models/containers/allocation-payment.md create mode 100644 doc/models/containers/allocation-preview-item-previous-quantity.md create mode 100644 doc/models/containers/allocation-preview-item-quantity.md create mode 100644 doc/models/containers/allocation-previous-quantity.md create mode 100644 doc/models/containers/allocation-quantity.md create mode 100644 doc/models/line-item-kind.md create mode 100644 doc/models/line-item-transaction-type.md rename doc/models/{allocation-payment.md => payment-for-allocation.md} (77%) rename doc/models/{single-error-response-error-exception.md => single-error-response-exception.md} (63%) diff --git a/LICENSE b/LICENSE index 97125893..b9181f72 100644 --- a/LICENSE +++ b/LICENSE @@ -3,7 +3,7 @@ License: The MIT License (MIT) http://opensource.org/licenses/MIT -Copyright (c) 2014 - 2023 APIMATIC Limited +Copyright (c) 2014 - 2024 APIMATIC Limited Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index ffa34dbb..e4c56974 100644 --- a/README.md +++ b/README.md @@ -297,18 +297,16 @@ 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_user_name` | `str` | The username to use with basic authentication | -| `basic_auth_password` | `str` | The password to use with basic authentication | +| `basic_auth_credentials` | [`BasicAuthCredentials`](https://www.github.com/maxio-com/ab-python-sdk/tree/0.0.4/doc/$a/https://www.github.com/maxio-com/ab-python-sdk/tree/0.0.4/basic-authentication.md) | The credential object for Basic Authentication | The API client can be initialized as follows: ```python -from advancedbilling.advanced_billing_client import AdvancedBillingClient -from advancedbilling.configuration import Environment - client = AdvancedBillingClient( - basic_auth_user_name='BasicAuthUserName', - basic_auth_password='BasicAuthPassword' + basic_auth_credentials=BasicAuthCredentials( + username='BasicAuthUserName', + password='BasicAuthPassword' + ) ) ``` @@ -325,7 +323,9 @@ The SDK can be configured to use a different environment for making API calls. A ## Authorization -This API uses `Basic Authentication`. +This API uses the following authentication schemes. + +* [`BasicAuth (Basic Authentication)`](https://www.github.com/maxio-com/ab-python-sdk/tree/0.0.4/doc/$a/https://www.github.com/maxio-com/ab-python-sdk/tree/0.0.4/basic-authentication.md) ## List of APIs diff --git a/advancedbilling/advanced_billing_client.py b/advancedbilling/advanced_billing_client.py index f025288a..8677f941 100644 --- a/advancedbilling/advanced_billing_client.py +++ b/advancedbilling/advanced_billing_client.py @@ -70,7 +70,6 @@ class AdvancedBillingClient(object): - @LazyProperty def api_exports(self): return APIExportsController(self.global_configuration) @@ -198,38 +197,29 @@ def webhooks(self): def __init__(self, http_client_instance=None, override_http_client_configuration=False, http_call_back=None, timeout=30, max_retries=0, backoff_factor=2, - retry_statuses=[408, 413, 429, 500, 502, 503, 504, 521, 522, 524], - retry_methods=['GET', 'PUT'], + retry_statuses=None, retry_methods=None, environment=Environment.PRODUCTION, subdomain='subdomain', - domain='chargify.com', basic_auth_user_name='TODO: Replace', - basic_auth_password='TODO: Replace', config=None): - if config is None: - self.config = Configuration( - 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, - environment=environment, - subdomain=subdomain, domain=domain, - basic_auth_user_name=basic_auth_user_name, - basic_auth_password=basic_auth_password) - else: - self.config = config + domain='chargify.com', basic_auth_user_name=None, + basic_auth_password=None, basic_auth_credentials=None, + config=None): + self.config = config or Configuration( + 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, + environment=environment, subdomain=subdomain, domain=domain, + basic_auth_user_name=basic_auth_user_name, + basic_auth_password=basic_auth_password, + basic_auth_credentials=basic_auth_credentials) self.global_configuration = GlobalConfiguration(self.config)\ .global_errors(BaseController.global_errors())\ .base_uri_executor(self.config.get_base_uri)\ .user_agent(BaseController.user_agent(), BaseController.user_agent_parameters()) - self.initialize_auth_managers(self.global_configuration) + self.auth_managers = {key: None for key in ['BasicAuth']} + self.auth_managers['BasicAuth'] = BasicAuth( + self.config.basic_auth_credentials) self.global_configuration = self.global_configuration.auth_managers(self.auth_managers) - def initialize_auth_managers(self, global_config): - http_client_config = global_config.get_http_client_configuration() - self.auth_managers = { key: None for key in ['global']} - self.auth_managers['global'] = BasicAuth(http_client_config.basic_auth_user_name, http_client_config.basic_auth_password) - return self.auth_managers diff --git a/advancedbilling/configuration.py b/advancedbilling/configuration.py index c7bfa7d1..cf576f79 100644 --- a/advancedbilling/configuration.py +++ b/advancedbilling/configuration.py @@ -7,6 +7,7 @@ https://www.apimatic.io ). """ +import warnings from enum import Enum from advancedbilling.api_helper import APIHelper from apimatic_core.http.configurations.http_client_configuration import HttpClientConfiguration @@ -44,24 +45,32 @@ def domain(self): @property def basic_auth_user_name(self): - return self._basic_auth_user_name + return self._basic_auth_credentials.username @property def basic_auth_password(self): - return self._basic_auth_password - - def __init__( - self, http_client_instance=None, - override_http_client_configuration=False, http_call_back=None, - timeout=30, max_retries=0, backoff_factor=2, - retry_statuses=[408, 413, 429, 500, 502, 503, 504, 521, 522, 524], - retry_methods=['GET', 'PUT'], environment=Environment.PRODUCTION, - subdomain='subdomain', domain='chargify.com', - basic_auth_user_name='TODO: Replace', - basic_auth_password='TODO: Replace' - ): + return self._basic_auth_credentials.password + + @property + def basic_auth_credentials(self): + return self._basic_auth_credentials + + def __init__(self, http_client_instance=None, + override_http_client_configuration=False, http_call_back=None, + timeout=30, max_retries=0, backoff_factor=2, + retry_statuses=None, retry_methods=None, + environment=Environment.PRODUCTION, subdomain='subdomain', + domain='chargify.com', basic_auth_user_name=None, + basic_auth_password=None, basic_auth_credentials=None): + if retry_methods is None: + retry_methods = ['GET', 'PUT'] + + 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) + # Current API environment self._environment = environment @@ -71,11 +80,8 @@ def __init__( # The Chargify server domain. self._domain = domain - # The username to use with basic authentication - self._basic_auth_user_name = basic_auth_user_name - - # The password to use with basic authentication - self._basic_auth_password = basic_auth_password + self._basic_auth_credentials = self.create_auth_credentials_object( + basic_auth_user_name, basic_auth_password, basic_auth_credentials) # The Http Client to use for making requests. self.set_http_client(self.create_http_client()) @@ -85,7 +91,7 @@ def clone_with(self, http_client_instance=None, timeout=None, max_retries=None, backoff_factor=None, retry_statuses=None, retry_methods=None, environment=None, subdomain=None, domain=None, basic_auth_user_name=None, - basic_auth_password=None): + basic_auth_password=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 @@ -97,8 +103,10 @@ def clone_with(self, http_client_instance=None, environment = environment or self.environment subdomain = subdomain or self.subdomain domain = domain or self.domain - basic_auth_user_name = basic_auth_user_name or self.basic_auth_user_name - basic_auth_password = basic_auth_password or self.basic_auth_password + basic_auth_credentials = self.create_auth_credentials_object( + basic_auth_user_name, basic_auth_password, + basic_auth_credentials or self.basic_auth_credentials, + stack_level=3) return Configuration( http_client_instance=http_client_instance, override_http_client_configuration=override_http_client_configuration, @@ -106,8 +114,7 @@ def clone_with(self, http_client_instance=None, max_retries=max_retries, backoff_factor=backoff_factor, retry_statuses=retry_statuses, retry_methods=retry_methods, environment=environment, subdomain=subdomain, domain=domain, - basic_auth_user_name=basic_auth_user_name, - basic_auth_password=basic_auth_password + basic_auth_credentials=basic_auth_credentials ) def create_http_client(self): @@ -150,3 +157,24 @@ def get_base_uri(self, server=Server.DEFAULT): return APIHelper.append_url_with_template_parameters( self.environments[self.environment][server], parameters ) + + @staticmethod + def create_auth_credentials_object(basic_auth_user_name, + basic_auth_password, + basic_auth_credentials, stack_level=4): + if basic_auth_user_name is None \ + and basic_auth_password is None: + return basic_auth_credentials + + warnings.warn(message=('The \'basic_auth_user_name\', \'basic_auth_pass' + 'word\' params are deprecated. Use \'basic_auth_' + 'credentials\' param instead.'), + category=DeprecationWarning, + stacklevel=stack_level) + + if basic_auth_credentials is not None: + return basic_auth_credentials.clone_with(basic_auth_user_name, + basic_auth_password) + + from advancedbilling.http.auth.basic_auth import BasicAuthCredentials + return BasicAuthCredentials(basic_auth_user_name, basic_auth_password) diff --git a/advancedbilling/controllers/advance_invoice_controller.py b/advancedbilling/controllers/advance_invoice_controller.py index e9b4193d..40362d39 100644 --- a/advancedbilling/controllers/advance_invoice_controller.py +++ b/advancedbilling/controllers/advance_invoice_controller.py @@ -85,7 +85,7 @@ def issue_advance_invoice(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -129,7 +129,7 @@ def read_advance_invoice(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -184,7 +184,7 @@ def void_advance_invoice(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) diff --git a/advancedbilling/controllers/api_exports_controller.py b/advancedbilling/controllers/api_exports_controller.py index 1c46966d..c30ba0e5 100644 --- a/advancedbilling/controllers/api_exports_controller.py +++ b/advancedbilling/controllers/api_exports_controller.py @@ -22,7 +22,7 @@ from advancedbilling.models.subscription import Subscription from advancedbilling.models.batch_job_response import BatchJobResponse from advancedbilling.exceptions.api_exception import APIException -from advancedbilling.exceptions.single_error_response_error_exception import SingleErrorResponseErrorException +from advancedbilling.exceptions.single_error_response_exception import SingleErrorResponseException class APIExportsController(BaseController): @@ -93,7 +93,7 @@ def list_exported_proforma_invoices(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -163,7 +163,7 @@ def list_exported_invoices(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -233,7 +233,7 @@ def list_exported_subscriptions(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -266,13 +266,13 @@ def export_proforma_invoices(self): .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(BatchJobResponse.from_dictionary) .local_error('404', 'Not Found', APIException) - .local_error('409', 'Conflict', SingleErrorResponseErrorException) + .local_error('409', 'Conflict', SingleErrorResponseException) ).execute() def export_invoices(self): @@ -298,13 +298,13 @@ def export_invoices(self): .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(BatchJobResponse.from_dictionary) .local_error('404', 'Not Found', APIException) - .local_error('409', 'Conflict', SingleErrorResponseErrorException) + .local_error('409', 'Conflict', SingleErrorResponseException) ).execute() def export_subscriptions(self): @@ -331,12 +331,12 @@ def export_subscriptions(self): .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(BatchJobResponse.from_dictionary) - .local_error('409', 'Conflict', SingleErrorResponseErrorException) + .local_error('409', 'Conflict', SingleErrorResponseException) ).execute() def read_proforma_invoices_export(self, @@ -371,7 +371,7 @@ def read_proforma_invoices_export(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -411,7 +411,7 @@ def read_invoices_export(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -451,7 +451,7 @@ def read_subscriptions_export(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) diff --git a/advancedbilling/controllers/base_controller.py b/advancedbilling/controllers/base_controller.py index 6280963c..9fb8ebcd 100644 --- a/advancedbilling/controllers/base_controller.py +++ b/advancedbilling/controllers/base_controller.py @@ -25,7 +25,6 @@ class BaseController(object): http_call_back (HttpCallBack): An object which holds call back methods to be called before and after the execution of an HttpRequest. new_api_call_builder (APICall): Returns the API Call builder instance. - auth_managers (dict): A dictionary which holds the instances of authentication managers. """ @@ -46,8 +45,7 @@ def global_errors(): } def __init__(self, config): - self._global_config = config - self._config = self._global_config.get_http_client_configuration() + self._config = config.get_http_client_configuration() self._http_call_back = self.config.http_callback self.api_call = ApiCall(config) @@ -62,7 +60,3 @@ def http_call_back(self): @property def new_api_call_builder(self): return self.api_call.new_builder - - @property - def auth_managers(self): - return self._global_config.get_auth_managers() diff --git a/advancedbilling/controllers/billing_portal_controller.py b/advancedbilling/controllers/billing_portal_controller.py index be52dd0b..c22e0cb9 100644 --- a/advancedbilling/controllers/billing_portal_controller.py +++ b/advancedbilling/controllers/billing_portal_controller.py @@ -96,7 +96,7 @@ def enable_billing_portal_for_customer(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -147,7 +147,7 @@ def read_billing_portal_link(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -200,7 +200,7 @@ def resend_billing_portal_invitation(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -246,7 +246,7 @@ def revoke_billing_portal_access(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) diff --git a/advancedbilling/controllers/components_controller.py b/advancedbilling/controllers/components_controller.py index ee19adc3..c2c1a0d4 100644 --- a/advancedbilling/controllers/components_controller.py +++ b/advancedbilling/controllers/components_controller.py @@ -108,7 +108,7 @@ def create_component(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -149,7 +149,7 @@ def read_component_by_handle(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -200,7 +200,7 @@ def read_component_by_id(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -259,7 +259,7 @@ def update_product_family_component(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -310,7 +310,7 @@ def archive_component(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -428,7 +428,7 @@ def list_components(self, .key('accept') .value('application/json')) .array_serialization_format(SerializationFormats.CSV) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -478,7 +478,7 @@ def update_component(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -534,7 +534,7 @@ def update_default_price_point_for_component(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -660,7 +660,7 @@ def list_components_for_product_family(self, .key('accept') .value('application/json')) .array_serialization_format(SerializationFormats.CSV) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -709,7 +709,7 @@ def create_component_price_point(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -795,7 +795,7 @@ def list_component_price_points(self, .key('accept') .value('application/json')) .array_serialization_format(SerializationFormats.CSV) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -845,7 +845,7 @@ def create_component_price_points(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -909,7 +909,7 @@ def update_component_price_point(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -958,7 +958,7 @@ def archive_component_price_point(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -1005,7 +1005,7 @@ def unarchive_component_price_point(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -1060,7 +1060,7 @@ def create_currency_prices(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -1111,7 +1111,7 @@ def update_currency_prices(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -1244,7 +1244,7 @@ def list_all_component_price_points(self, .key('accept') .value('application/json')) .array_serialization_format(SerializationFormats.CSV) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) diff --git a/advancedbilling/controllers/coupons_controller.py b/advancedbilling/controllers/coupons_controller.py index 35d19ff8..cc39f485 100644 --- a/advancedbilling/controllers/coupons_controller.py +++ b/advancedbilling/controllers/coupons_controller.py @@ -94,7 +94,7 @@ def create_coupon(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -238,7 +238,7 @@ def list_coupons_for_product_family(self, .key('accept') .value('application/json')) .array_serialization_format(SerializationFormats.CSV) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -287,7 +287,7 @@ def read_coupon_by_code(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -344,7 +344,7 @@ def read_coupon(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -406,7 +406,7 @@ def update_coupon(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -457,7 +457,7 @@ def archive_coupon(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -647,7 +647,7 @@ def list_coupons(self, .key('accept') .value('application/json')) .array_serialization_format(SerializationFormats.CSV) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -695,7 +695,7 @@ def read_coupon_usage(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -764,7 +764,7 @@ def validate_coupon(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -820,7 +820,7 @@ def update_coupon_currency_prices(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -906,7 +906,7 @@ def create_coupon_subcodes(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -972,7 +972,7 @@ def list_coupon_subcodes(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -1027,7 +1027,7 @@ def update_coupon_subcodes(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -1091,5 +1091,5 @@ def delete_coupon_subcode(self, .value(subcode) .is_required(True) .should_encode(True)) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).execute() diff --git a/advancedbilling/controllers/custom_fields_controller.py b/advancedbilling/controllers/custom_fields_controller.py index 55add908..1737e8de 100644 --- a/advancedbilling/controllers/custom_fields_controller.py +++ b/advancedbilling/controllers/custom_fields_controller.py @@ -22,6 +22,7 @@ from advancedbilling.models.list_metafields_response import ListMetafieldsResponse from advancedbilling.models.metadata import Metadata from advancedbilling.models.paginated_metadata import PaginatedMetadata +from advancedbilling.exceptions.single_error_response_exception import SingleErrorResponseException from advancedbilling.exceptions.api_exception import APIException @@ -108,11 +109,12 @@ def create_metafields(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(Metafield.from_dictionary) + .local_error('422', 'Unprocessable Entity (WebDAV)', SingleErrorResponseException) ).execute() def list_metafields(self, @@ -185,7 +187,7 @@ def list_metafields(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -249,7 +251,7 @@ def update_metafield(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -294,13 +296,12 @@ def delete_metafield(self, .query_param(Parameter() .key('name') .value(name)) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).execute() def create_metadata(self, resource_type, resource_id, - value=None, body=None): """Does a POST request to /{resource_type}/{resource_id}/metadata.json. @@ -338,7 +339,6 @@ def create_metadata(self, metafields belong resource_id (str): The Chargify id of the customer or the subscription for which the metadata applies - value (str, optional): Can be a single item or a list of metadata body (CreateMetadataRequest, optional): TODO: type description here. @@ -370,23 +370,21 @@ def create_metadata(self, .header_param(Parameter() .key('Content-Type') .value('application/json')) - .query_param(Parameter() - .key('value') - .value(value)) .body_param(Parameter() .value(body)) .header_param(Parameter() .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(Metadata.from_dictionary) + .local_error('422', 'Unprocessable Entity (WebDAV)', SingleErrorResponseException) ).execute() - def read_metadata(self, + def list_metadata(self, options=dict()): """Does a GET request to /{resource_type}/{resource_id}/metadata.json. @@ -456,7 +454,7 @@ def read_metadata(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -466,7 +464,6 @@ def read_metadata(self, def update_metadata(self, resource_type, resource_id, - value=None, body=None): """Does a PUT request to /{resource_type}/{resource_id}/metadata.json. @@ -478,7 +475,6 @@ def update_metadata(self, metafields belong resource_id (str): The Chargify id of the customer or the subscription for which the metadata applies - value (str, optional): Can be a single item or a list of metadata body (UpdateMetadataRequest, optional): TODO: type description here. @@ -510,16 +506,13 @@ def update_metadata(self, .header_param(Parameter() .key('Content-Type') .value('application/json')) - .query_param(Parameter() - .key('value') - .value(value)) .body_param(Parameter() .value(body)) .header_param(Parameter() .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -594,12 +587,12 @@ def delete_metadata(self, .query_param(Parameter() .key('names[]') .value(names)) - .array_serialization_format(SerializationFormats.CSV) - .auth(Single('global')) + .array_serialization_format(SerializationFormats.PLAIN) + .auth(Single('BasicAuth')) ).execute() - def list_metadata(self, - options=dict()): + def list_metadata_for_resource_type(self, + options=dict()): """Does a GET request to /{resource_type}/metadata.json. This method will provide you information on usage of metadata across @@ -724,7 +717,7 @@ def list_metadata(self, .key('accept') .value('application/json')) .array_serialization_format(SerializationFormats.CSV) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) diff --git a/advancedbilling/controllers/customers_controller.py b/advancedbilling/controllers/customers_controller.py index 1b9d1356..0f000634 100644 --- a/advancedbilling/controllers/customers_controller.py +++ b/advancedbilling/controllers/customers_controller.py @@ -97,7 +97,7 @@ def create_customer(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -221,7 +221,7 @@ def list_customers(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -261,7 +261,7 @@ def read_customer(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -309,7 +309,7 @@ def update_customer(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -347,7 +347,7 @@ def delete_customer(self, .value(id) .is_required(True) .should_encode(True)) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).execute() def read_customer_by_reference(self, @@ -383,7 +383,7 @@ def read_customer_by_reference(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -422,7 +422,7 @@ def list_customer_subscriptions(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) diff --git a/advancedbilling/controllers/events_based_billing_segments_controller.py b/advancedbilling/controllers/events_based_billing_segments_controller.py index 56c07365..f76d8806 100644 --- a/advancedbilling/controllers/events_based_billing_segments_controller.py +++ b/advancedbilling/controllers/events_based_billing_segments_controller.py @@ -85,7 +85,7 @@ def create_segment(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -199,7 +199,7 @@ def list_segments_for_price_point(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -270,7 +270,7 @@ def update_segment(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -327,7 +327,7 @@ def delete_segment(self, .value(id) .is_required(True) .should_encode(True)) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).execute() def create_segments(self, @@ -385,7 +385,7 @@ def create_segments(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -451,7 +451,7 @@ def update_segments(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) diff --git a/advancedbilling/controllers/events_controller.py b/advancedbilling/controllers/events_controller.py index 1d015e4c..290caa42 100644 --- a/advancedbilling/controllers/events_controller.py +++ b/advancedbilling/controllers/events_controller.py @@ -200,7 +200,7 @@ def list_events(self, .key('accept') .value('application/json')) .array_serialization_format(SerializationFormats.CSV) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -290,7 +290,7 @@ def list_subscription_events(self, .key('accept') .value('application/json')) .array_serialization_format(SerializationFormats.CSV) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -371,7 +371,7 @@ def read_events_count(self, .key('accept') .value('application/json')) .array_serialization_format(SerializationFormats.CSV) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) diff --git a/advancedbilling/controllers/insights_controller.py b/advancedbilling/controllers/insights_controller.py index 02edfaa3..c8407fd3 100644 --- a/advancedbilling/controllers/insights_controller.py +++ b/advancedbilling/controllers/insights_controller.py @@ -64,7 +64,7 @@ def read_site_stats(self): .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -110,7 +110,7 @@ def read_mrr(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -203,7 +203,7 @@ def read_mrr_movements(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -284,7 +284,7 @@ def list_mrr_per_subscription(self, .key('accept') .value('application/json')) .array_serialization_format(SerializationFormats.CSV) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) diff --git a/advancedbilling/controllers/invoices_controller.py b/advancedbilling/controllers/invoices_controller.py index b24908de..1fe69740 100644 --- a/advancedbilling/controllers/invoices_controller.py +++ b/advancedbilling/controllers/invoices_controller.py @@ -87,7 +87,7 @@ def refund_invoice(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -267,7 +267,7 @@ def list_invoices(self, .key('accept') .value('application/json')) .array_serialization_format(SerializationFormats.CSV) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -307,7 +307,7 @@ def read_invoice(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -424,7 +424,7 @@ def list_invoice_events(self, .key('accept') .value('application/json')) .array_serialization_format(SerializationFormats.CSV) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -520,7 +520,7 @@ def record_payment_for_invoice(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -587,7 +587,7 @@ def record_external_payment_for_invoices(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -676,7 +676,7 @@ def list_credit_notes(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -715,7 +715,7 @@ def read_credit_note(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -771,7 +771,7 @@ def record_payment_for_subscription(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -829,7 +829,7 @@ def reopen_invoice(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -881,7 +881,7 @@ def void_invoice(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -956,7 +956,7 @@ def list_invoice_segments(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -1172,7 +1172,7 @@ def create_invoice(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -1234,7 +1234,7 @@ def send_invoice(self, .body_param(Parameter() .value(body)) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).execute() def preview_customer_information_changes(self, @@ -1275,7 +1275,7 @@ def preview_customer_information_changes(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -1322,7 +1322,7 @@ def update_customer_information(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -1400,7 +1400,7 @@ def issue_invoice(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) diff --git a/advancedbilling/controllers/offers_controller.py b/advancedbilling/controllers/offers_controller.py index 689eca4e..ec0a61d9 100644 --- a/advancedbilling/controllers/offers_controller.py +++ b/advancedbilling/controllers/offers_controller.py @@ -76,7 +76,7 @@ def create_offer(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -141,7 +141,7 @@ def list_offers(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -182,7 +182,7 @@ def read_offers(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -220,7 +220,7 @@ def archive_offer(self, .value(offer_id) .is_required(True) .should_encode(True)) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).execute() def unarchive_offer(self, @@ -253,5 +253,5 @@ def unarchive_offer(self, .value(offer_id) .is_required(True) .should_encode(True)) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).execute() diff --git a/advancedbilling/controllers/payment_profiles_controller.py b/advancedbilling/controllers/payment_profiles_controller.py index d858049d..0654f031 100644 --- a/advancedbilling/controllers/payment_profiles_controller.py +++ b/advancedbilling/controllers/payment_profiles_controller.py @@ -370,7 +370,7 @@ def create_payment_profile(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -437,7 +437,7 @@ def list_payment_profiles(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -508,7 +508,7 @@ def read_payment_profile(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -597,7 +597,7 @@ def update_payment_profile(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -635,7 +635,7 @@ def delete_unused_payment_profile(self, .value(payment_profile_id) .is_required(True) .should_encode(True)) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).execute() def delete_subscriptions_payment_profile(self, @@ -684,7 +684,7 @@ def delete_subscriptions_payment_profile(self, .value(payment_profile_id) .is_required(True) .should_encode(True)) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).execute() def verify_bank_account(self, @@ -730,7 +730,7 @@ def verify_bank_account(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -777,7 +777,7 @@ def delete_subscription_group_payment_profile(self, .value(payment_profile_id) .is_required(True) .should_encode(True)) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).execute() def update_subscription_default_payment_profile(self, @@ -823,7 +823,7 @@ def update_subscription_default_payment_profile(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -876,7 +876,7 @@ def update_subscription_group_default_payment_profile(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -923,7 +923,7 @@ def read_one_time_token(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -974,5 +974,5 @@ def send_request_update_payment_email(self, .value(subscription_id) .is_required(True) .should_encode(True)) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).execute() diff --git a/advancedbilling/controllers/product_families_controller.py b/advancedbilling/controllers/product_families_controller.py index bd0a6731..58d6b4d3 100644 --- a/advancedbilling/controllers/product_families_controller.py +++ b/advancedbilling/controllers/product_families_controller.py @@ -20,6 +20,7 @@ from advancedbilling.models.product_response import ProductResponse from advancedbilling.models.product_family_response import ProductFamilyResponse from advancedbilling.exceptions.api_exception import APIException +from advancedbilling.exceptions.error_list_response_exception import ErrorListResponseException class ProductFamiliesController(BaseController): @@ -156,7 +157,7 @@ def list_products_for_product_family(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -204,11 +205,12 @@ def create_product_family(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(ProductFamilyResponse.from_dictionary) + .local_error('422', 'Unprocessable Entity (WebDAV)', ErrorListResponseException) ).execute() def list_product_families(self, @@ -283,7 +285,7 @@ def list_product_families(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -326,7 +328,7 @@ def read_product_family(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) diff --git a/advancedbilling/controllers/product_price_points_controller.py b/advancedbilling/controllers/product_price_points_controller.py index eb63898a..878e3c25 100644 --- a/advancedbilling/controllers/product_price_points_controller.py +++ b/advancedbilling/controllers/product_price_points_controller.py @@ -81,7 +81,7 @@ def create_product_price_point(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -167,7 +167,7 @@ def list_product_price_points(self, .key('accept') .value('application/json')) .array_serialization_format(SerializationFormats.CSV) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -227,7 +227,7 @@ def update_product_price_point(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -290,7 +290,7 @@ def read_product_price_point(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -340,7 +340,7 @@ def archive_product_price_point(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -388,7 +388,7 @@ def unarchive_product_price_point(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -438,7 +438,7 @@ def promote_product_price_point_to_default(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -489,7 +489,7 @@ def create_product_price_points(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -546,7 +546,7 @@ def create_product_currency_prices(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -602,7 +602,7 @@ def update_product_currency_prices(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -736,7 +736,7 @@ def list_all_product_price_points(self, .key('accept') .value('application/json')) .array_serialization_format(SerializationFormats.CSV) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) diff --git a/advancedbilling/controllers/products_controller.py b/advancedbilling/controllers/products_controller.py index 06e7443a..93fcebf3 100644 --- a/advancedbilling/controllers/products_controller.py +++ b/advancedbilling/controllers/products_controller.py @@ -75,7 +75,7 @@ def create_product(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -116,7 +116,7 @@ def read_product(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -172,7 +172,7 @@ def update_product(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -217,7 +217,7 @@ def archive_product(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -257,7 +257,7 @@ def read_product_by_handle(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -386,7 +386,7 @@ def list_products(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) diff --git a/advancedbilling/controllers/proforma_invoices_controller.py b/advancedbilling/controllers/proforma_invoices_controller.py index 23a2996c..9bf7d2c0 100644 --- a/advancedbilling/controllers/proforma_invoices_controller.py +++ b/advancedbilling/controllers/proforma_invoices_controller.py @@ -72,7 +72,7 @@ def create_consolidated_proforma_invoice(self, .value(uid) .is_required(True) .should_encode(True)) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).execute() def list_subscription_group_proforma_invoices(self, @@ -113,7 +113,7 @@ def list_subscription_group_proforma_invoices(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -157,7 +157,7 @@ def read_proforma_invoice(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -207,7 +207,7 @@ def create_proforma_invoice(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -324,7 +324,7 @@ def list_proforma_invoices(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -381,7 +381,7 @@ def void_proforma_invoice(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -439,7 +439,7 @@ def preview_proforma_invoice(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -496,7 +496,7 @@ def create_signup_proforma_invoice(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -558,7 +558,7 @@ def preview_signup_proforma_invoice(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) diff --git a/advancedbilling/controllers/reason_codes_controller.py b/advancedbilling/controllers/reason_codes_controller.py index ac9122e9..9bf7869f 100644 --- a/advancedbilling/controllers/reason_codes_controller.py +++ b/advancedbilling/controllers/reason_codes_controller.py @@ -77,7 +77,7 @@ def create_reason_code(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -138,7 +138,7 @@ def list_reason_codes(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -179,7 +179,7 @@ def read_reason_code(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -229,7 +229,7 @@ def update_reason_code(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -271,7 +271,7 @@ def delete_reason_code(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) diff --git a/advancedbilling/controllers/referral_codes_controller.py b/advancedbilling/controllers/referral_codes_controller.py index dff4ca46..2082211e 100644 --- a/advancedbilling/controllers/referral_codes_controller.py +++ b/advancedbilling/controllers/referral_codes_controller.py @@ -68,7 +68,7 @@ def validate_referral_code(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) diff --git a/advancedbilling/controllers/sales_commissions_controller.py b/advancedbilling/controllers/sales_commissions_controller.py index aaa4cc09..8daf2cc9 100644 --- a/advancedbilling/controllers/sales_commissions_controller.py +++ b/advancedbilling/controllers/sales_commissions_controller.py @@ -115,7 +115,7 @@ def list_sales_commission_settings(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -209,7 +209,7 @@ def list_sales_reps(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -304,7 +304,7 @@ def read_sales_rep(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) diff --git a/advancedbilling/controllers/sites_controller.py b/advancedbilling/controllers/sites_controller.py index 1dd995b0..8f172b57 100644 --- a/advancedbilling/controllers/sites_controller.py +++ b/advancedbilling/controllers/sites_controller.py @@ -65,7 +65,7 @@ def read_site(self): .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -110,7 +110,7 @@ def clear_site(self, .query_param(Parameter() .key('cleanup_scope') .value(cleanup_scope)) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).execute() def list_chargify_js_public_keys(self, @@ -165,7 +165,7 @@ def list_chargify_js_public_keys(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) diff --git a/advancedbilling/controllers/subscription_components_controller.py b/advancedbilling/controllers/subscription_components_controller.py index 475dd867..e52481f1 100644 --- a/advancedbilling/controllers/subscription_components_controller.py +++ b/advancedbilling/controllers/subscription_components_controller.py @@ -80,7 +80,7 @@ def read_subscription_component(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -217,7 +217,7 @@ def list_subscription_components(self, .key('accept') .value('application/json')) .array_serialization_format(SerializationFormats.CSV) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -271,7 +271,7 @@ def update_subscription_components_price_points(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -314,7 +314,7 @@ def reset_subscription_components_price_points(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -440,11 +440,12 @@ def allocate_component(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(AllocationResponse.from_dictionary) + .local_error('422', 'Unprocessable Entity (WebDAV)', ErrorListResponseException) ).execute() def list_allocations(self, @@ -515,14 +516,14 @@ def list_allocations(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(AllocationResponse.from_dictionary) .local_error('401', 'Unauthorized', APIException) .local_error('404', 'Not Found', APIException) - .local_error('422', 'Unprocessable Entity (WebDAV)', APIException) + .local_error('422', 'Unprocessable Entity (WebDAV)', ErrorListResponseException) ).execute() def allocate_components(self, @@ -572,7 +573,7 @@ def allocate_components(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -598,7 +599,7 @@ def preview_allocations(self, or `downgrade_credit`s, the Allocation is viewed as an Allocation which uses "Fine-Grained Component Control". As a result, the response will not include `direction` and `proration` within the - `allocation_preview` at the `line_items` and `allocations` level + `allocation_preview`, but at the `line_items` and `allocations` level respectfully. See example below for Fine-Grained Component Control response. @@ -636,7 +637,7 @@ def preview_allocations(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -712,7 +713,7 @@ def update_prepaid_usage_allocation(self, .body_param(Parameter() .value(body)) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).execute() def delete_prepaid_usage_allocation(self, @@ -781,7 +782,7 @@ def delete_prepaid_usage_allocation(self, .body_param(Parameter() .value(body)) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).execute() def create_usage(self, @@ -902,7 +903,7 @@ def create_usage(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -1015,7 +1016,7 @@ def list_usages(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -1070,7 +1071,7 @@ def activate_event_based_component(self, .value(component_id) .is_required(True) .should_encode(True)) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).execute() def deactivate_event_based_component(self, @@ -1111,7 +1112,7 @@ def deactivate_event_based_component(self, .value(component_id) .is_required(True) .should_encode(True)) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).execute() def record_event(self, @@ -1185,7 +1186,7 @@ def record_event(self, .body_param(Parameter() .value(body)) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).execute() def record_events(self, @@ -1245,7 +1246,7 @@ def record_events(self, .body_param(Parameter() .value(body)) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).execute() def list_subscription_components_for_site(self, @@ -1464,7 +1465,7 @@ def list_subscription_components_for_site(self, .key('accept') .value('application/json')) .array_serialization_format(SerializationFormats.CSV) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) diff --git a/advancedbilling/controllers/subscription_group_invoice_account_controller.py b/advancedbilling/controllers/subscription_group_invoice_account_controller.py index a2cf4d7c..db0f5fb9 100644 --- a/advancedbilling/controllers/subscription_group_invoice_account_controller.py +++ b/advancedbilling/controllers/subscription_group_invoice_account_controller.py @@ -75,7 +75,7 @@ def create_subscription_group_prepayment(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -167,7 +167,7 @@ def list_prepayments_for_subscription_group(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -221,7 +221,7 @@ def issue_subscription_group_service_credits(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -272,7 +272,7 @@ def deduct_subscription_group_service_credits(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) diff --git a/advancedbilling/controllers/subscription_group_status_controller.py b/advancedbilling/controllers/subscription_group_status_controller.py index 8f49f649..c463b0fc 100644 --- a/advancedbilling/controllers/subscription_group_status_controller.py +++ b/advancedbilling/controllers/subscription_group_status_controller.py @@ -73,7 +73,7 @@ def cancel_subscriptions_in_group(self, .body_param(Parameter() .value(body)) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).execute() def initiate_delayed_cancellation_for_group(self, @@ -110,7 +110,7 @@ def initiate_delayed_cancellation_for_group(self, .value(uid) .is_required(True) .should_encode(True)) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).execute() def stop_delayed_cancellation_for_group(self, @@ -145,7 +145,7 @@ def stop_delayed_cancellation_for_group(self, .value(uid) .is_required(True) .should_encode(True)) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).execute() def reactivate_subscription_group(self, @@ -224,7 +224,7 @@ def reactivate_subscription_group(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) diff --git a/advancedbilling/controllers/subscription_groups_controller.py b/advancedbilling/controllers/subscription_groups_controller.py index 2ec74a7f..a6bd10a2 100644 --- a/advancedbilling/controllers/subscription_groups_controller.py +++ b/advancedbilling/controllers/subscription_groups_controller.py @@ -81,7 +81,7 @@ def signup_with_subscription_group(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -123,7 +123,7 @@ def create_subscription_group(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -197,7 +197,7 @@ def list_subscription_groups(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -241,7 +241,7 @@ def read_subscription_group(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -293,7 +293,7 @@ def update_subscription_group_members(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -334,7 +334,7 @@ def delete_subscription_group(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -376,7 +376,7 @@ def read_subscription_group_by_subscription_id(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -454,7 +454,7 @@ def create_subscription_group_hierarchy(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -495,5 +495,5 @@ def remove_subscription_from_group(self, .value(subscription_id) .is_required(True) .should_encode(True)) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).execute() diff --git a/advancedbilling/controllers/subscription_invoice_account_controller.py b/advancedbilling/controllers/subscription_invoice_account_controller.py index c17e62f7..7ecd7d5e 100644 --- a/advancedbilling/controllers/subscription_invoice_account_controller.py +++ b/advancedbilling/controllers/subscription_invoice_account_controller.py @@ -68,7 +68,7 @@ def read_account_balances(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -123,7 +123,7 @@ def create_prepayment(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -215,7 +215,7 @@ def list_prepayments(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -268,7 +268,7 @@ def issue_service_credit(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -315,7 +315,7 @@ def deduct_service_credit(self, .body_param(Parameter() .value(body)) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).execute() def refund_prepayment(self, @@ -371,7 +371,7 @@ def refund_prepayment(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) diff --git a/advancedbilling/controllers/subscription_notes_controller.py b/advancedbilling/controllers/subscription_notes_controller.py index 9afb7e2c..9b5522a9 100644 --- a/advancedbilling/controllers/subscription_notes_controller.py +++ b/advancedbilling/controllers/subscription_notes_controller.py @@ -77,7 +77,7 @@ def create_subscription_note(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -144,7 +144,7 @@ def list_subscription_notes(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -191,7 +191,7 @@ def read_subscription_note(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -246,7 +246,7 @@ def update_subscription_note(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -289,5 +289,5 @@ def delete_subscription_note(self, .value(note_id) .is_required(True) .should_encode(True)) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).execute() diff --git a/advancedbilling/controllers/subscription_products_controller.py b/advancedbilling/controllers/subscription_products_controller.py index 9dc7d87d..e13ccb15 100644 --- a/advancedbilling/controllers/subscription_products_controller.py +++ b/advancedbilling/controllers/subscription_products_controller.py @@ -162,7 +162,7 @@ def migrate_subscription_product(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -218,7 +218,7 @@ def preview_subscription_product_migration(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) diff --git a/advancedbilling/controllers/subscription_status_controller.py b/advancedbilling/controllers/subscription_status_controller.py index d2a45509..84f13232 100644 --- a/advancedbilling/controllers/subscription_status_controller.py +++ b/advancedbilling/controllers/subscription_status_controller.py @@ -67,7 +67,7 @@ def retry_subscription(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -117,7 +117,7 @@ def cancel_subscription(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -168,7 +168,7 @@ def resume_subscription(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -220,7 +220,7 @@ def pause_subscription(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -274,7 +274,7 @@ def update_automatic_subscription_resumption(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -463,7 +463,7 @@ def reactivate_subscription(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -517,7 +517,7 @@ def initiate_delayed_cancellation(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -562,7 +562,7 @@ def stop_delayed_cancellation(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -603,7 +603,7 @@ def cancel_dunning(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -682,7 +682,7 @@ def preview_renewal(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) diff --git a/advancedbilling/controllers/subscriptions_controller.py b/advancedbilling/controllers/subscriptions_controller.py index 00d672f0..30218bbd 100644 --- a/advancedbilling/controllers/subscriptions_controller.py +++ b/advancedbilling/controllers/subscriptions_controller.py @@ -23,7 +23,7 @@ from advancedbilling.models.subscription_preview_response import SubscriptionPreviewResponse from advancedbilling.exceptions.error_list_response_exception import ErrorListResponseException from advancedbilling.exceptions.api_exception import APIException -from advancedbilling.exceptions.single_error_response_error_exception import SingleErrorResponseErrorException +from advancedbilling.exceptions.single_error_response_exception import SingleErrorResponseException from advancedbilling.exceptions.subscription_add_coupon_error_exception import SubscriptionAddCouponErrorException from advancedbilling.exceptions.subscription_remove_coupon_errors_exception import SubscriptionRemoveCouponErrorsException from advancedbilling.exceptions.nested_error_response_exception import NestedErrorResponseException @@ -843,7 +843,7 @@ def create_subscription(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -1006,7 +1006,7 @@ def list_subscriptions(self, .key('accept') .value('application/json')) .array_serialization_format(SerializationFormats.CSV) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -1118,7 +1118,7 @@ def update_subscription(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -1170,8 +1170,8 @@ def read_subscription(self, .header_param(Parameter() .key('accept') .value('application/json')) - .array_serialization_format(SerializationFormats.CSV) - .auth(Single('global')) + .array_serialization_format(SerializationFormats.PLAIN) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -1248,7 +1248,7 @@ def override_subscription(self, .body_param(Parameter() .value(body)) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).execute() def read_subscription_by_reference(self, @@ -1281,7 +1281,7 @@ def read_subscription_by_reference(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -1340,8 +1340,8 @@ def purge_subscription(self, .query_param(Parameter() .key('cascade[]') .value(cascade)) - .array_serialization_format(SerializationFormats.CSV) - .auth(Single('global')) + .array_serialization_format(SerializationFormats.PLAIN) + .auth(Single('BasicAuth')) ).execute() def create_prepaid_subscription(self, @@ -1385,7 +1385,7 @@ def create_prepaid_subscription(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -1461,7 +1461,7 @@ def preview_subscription(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -1527,7 +1527,7 @@ def apply_coupon_to_subscription(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -1573,7 +1573,7 @@ def delete_coupon_from_subscription(self, .query_param(Parameter() .key('coupon_code') .value(coupon_code)) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -1671,7 +1671,7 @@ def activate_subscription(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) diff --git a/advancedbilling/controllers/webhooks_controller.py b/advancedbilling/controllers/webhooks_controller.py index ddb2f705..2ed785a9 100644 --- a/advancedbilling/controllers/webhooks_controller.py +++ b/advancedbilling/controllers/webhooks_controller.py @@ -134,7 +134,7 @@ def list_webhooks(self, .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -175,7 +175,7 @@ def enable_webhooks(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -220,7 +220,7 @@ def replay_webhooks(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -266,7 +266,7 @@ def create_endpoint(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -297,7 +297,7 @@ def list_endpoints(self): .header_param(Parameter() .key('accept') .value('application/json')) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) @@ -357,7 +357,7 @@ def update_endpoint(self, .key('accept') .value('application/json')) .body_serializer(APIHelper.json_serialize) - .auth(Single('global')) + .auth(Single('BasicAuth')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) diff --git a/advancedbilling/exceptions/__init__.py b/advancedbilling/exceptions/__init__.py index 4829891b..f3bb430f 100644 --- a/advancedbilling/exceptions/__init__.py +++ b/advancedbilling/exceptions/__init__.py @@ -4,12 +4,12 @@ 'customer_error_response_exception', 'too_many_management_link_requests_error_exception', 'single_string_error_response_exception', + 'single_error_response_exception', 'product_price_point_error_response_exception', 'error_map_response_exception', 'component_price_point_error_exception', 'component_allocation_error_exception', 'subscription_component_allocation_error_exception', - 'single_error_response_error_exception', 'nested_error_response_exception', 'subscription_group_signup_error_response_exception', 'subscription_group_update_error_response_exception', diff --git a/advancedbilling/exceptions/single_error_response_error_exception.py b/advancedbilling/exceptions/single_error_response_exception.py similarity index 81% rename from advancedbilling/exceptions/single_error_response_error_exception.py rename to advancedbilling/exceptions/single_error_response_exception.py index 2b61e9c0..48861db2 100644 --- a/advancedbilling/exceptions/single_error_response_error_exception.py +++ b/advancedbilling/exceptions/single_error_response_exception.py @@ -11,9 +11,9 @@ import advancedbilling.exceptions.api_exception -class SingleErrorResponseErrorException(advancedbilling.exceptions.api_exception.APIException): +class SingleErrorResponseException(advancedbilling.exceptions.api_exception.APIException): def __init__(self, reason, response): - """Constructor for the SingleErrorResponseErrorException class + """Constructor for the SingleErrorResponseException class Args: reason (string): The reason (or error message) for the Exception @@ -21,7 +21,7 @@ def __init__(self, reason, response): response (HttpResponse): The HttpResponse of the API call. """ - super(SingleErrorResponseErrorException, self).__init__(reason, response) + super(SingleErrorResponseException, self).__init__(reason, response) dictionary = APIHelper.json_deserialize(self.response.text) if isinstance(dictionary, dict): self.unbox(dictionary) diff --git a/advancedbilling/http/auth/basic_auth.py b/advancedbilling/http/auth/basic_auth.py index b6541b92..db579b3c 100644 --- a/advancedbilling/http/auth/basic_auth.py +++ b/advancedbilling/http/auth/basic_auth.py @@ -15,17 +15,39 @@ class BasicAuth(HeaderAuth): @property def error_message(self): - """Display error message on occurrence of authentication faliure + """Display error message on occurrence of authentication failure in BasicAuth """ return "BasicAuth: BasicAuthUserName or BasicAuthPassword is undefined." - def __init__(self, basic_auth_user_name, basic_auth_password): + def __init__(self, basic_auth_credentials): auth_params = {} - if basic_auth_user_name and basic_auth_password: + if basic_auth_credentials is not None \ + and basic_auth_credentials.username and basic_auth_credentials.password: auth_params = {"Authorization": "Basic {}".format( - AuthHelper.get_base64_encoded_value(basic_auth_user_name, basic_auth_password))} + AuthHelper.get_base64_encoded_value(basic_auth_credentials.username, basic_auth_credentials.password))} super().__init__(auth_params=auth_params) - self._basic_auth_user_name = basic_auth_user_name - self._basic_auth_password = basic_auth_password + + +class BasicAuthCredentials: + + @property + def username(self): + return self._username + + @property + def password(self): + return self._password + + def __init__(self, username, password): + if username is None: + raise ValueError('username cannot be None') + self._username = username + if password is None: + raise ValueError('password cannot be None') + self._password = password + + def clone_with(self, username=None, password=None): + return BasicAuthCredentials(username or self.username, + password or self.password) diff --git a/advancedbilling/models/__init__.py b/advancedbilling/models/__init__.py index f51cdad6..562ddcf7 100644 --- a/advancedbilling/models/__init__.py +++ b/advancedbilling/models/__init__.py @@ -283,7 +283,7 @@ 'billing_schedule', 'allocation_response', 'allocation', - 'allocation_payment', + 'payment_for_allocation', 'allocate_components', 'preview_allocations_request', 'allocation_preview_response', @@ -521,6 +521,9 @@ 'list_subscription_components_sort', 'list_subscription_components_include', 'payment_collection_method_1', + 'allocation_preview_direction', + 'line_item_transaction_type', + 'allocation_preview_line_item_kind', 'credit_scheme', 'group_target_type', 'subscription_state_filter', @@ -531,12 +534,14 @@ 'subscription_include', 'resumption_charge', 'reactivation_charge', + 'line_item_kind', 'create_invoice_status', 'prepayment_method', 'service_credit_type', 'subscription_group_prepayment_method', 'list_subscription_group_prepayment_date_field', 'subscription_purge_type', + 'billing_manifest_line_item_kind', 'failed_payment_action', 'list_components_price_points_include', 'list_products_price_points_include', diff --git a/advancedbilling/models/allocate_components.py b/advancedbilling/models/allocate_components.py index ef65f0bd..cdffe55b 100644 --- a/advancedbilling/models/allocate_components.py +++ b/advancedbilling/models/allocate_components.py @@ -7,7 +7,7 @@ https://www.apimatic.io ). """ from advancedbilling.api_helper import APIHelper -from advancedbilling.models.create_allocation_request import CreateAllocationRequest +from advancedbilling.models.create_allocation import CreateAllocation class AllocateComponents(object): @@ -19,8 +19,7 @@ class AllocateComponents(object): Attributes: proration_upgrade_scheme (str): TODO: type description here. proration_downgrade_scheme (str): TODO: type description here. - allocations (List[CreateAllocationRequest]): TODO: type description - here. + allocations (List[CreateAllocation]): TODO: type description here. accrue_charge (bool): TODO: type description here. upgrade_charge (CreditType): The type of credit to be created when upgrading/downgrading. Defaults to the component and then site @@ -33,6 +32,9 @@ class AllocateComponents(object): payment_collection_method (PaymentCollectionMethod1): (Optional) If not passed, the allocation(s) will use the payment collection method on the subscription + initiate_dunning (bool): If true, if the immediate component payment + fails, initiate dunning for the subscription. Otherwise, leave + the charges on the subscription to pay for at renewal. """ @@ -44,7 +46,8 @@ class AllocateComponents(object): "accrue_charge": 'accrue_charge', "upgrade_charge": 'upgrade_charge', "downgrade_credit": 'downgrade_credit', - "payment_collection_method": 'payment_collection_method' + "payment_collection_method": 'payment_collection_method', + "initiate_dunning": 'initiate_dunning' } _optionals = [ @@ -55,6 +58,7 @@ class AllocateComponents(object): 'upgrade_charge', 'downgrade_credit', 'payment_collection_method', + 'initiate_dunning', ] _nullables = [ @@ -63,18 +67,21 @@ class AllocateComponents(object): ] def __init__(self, - proration_upgrade_scheme='no-prorate', - proration_downgrade_scheme='no-prorate', + proration_upgrade_scheme=APIHelper.SKIP, + proration_downgrade_scheme=APIHelper.SKIP, allocations=APIHelper.SKIP, accrue_charge=APIHelper.SKIP, upgrade_charge=APIHelper.SKIP, downgrade_credit=APIHelper.SKIP, - payment_collection_method='automatic'): + payment_collection_method='automatic', + initiate_dunning=APIHelper.SKIP): """Constructor for the AllocateComponents class""" # Initialize members of the class - self.proration_upgrade_scheme = proration_upgrade_scheme - self.proration_downgrade_scheme = proration_downgrade_scheme + if proration_upgrade_scheme is not APIHelper.SKIP: + self.proration_upgrade_scheme = proration_upgrade_scheme + if proration_downgrade_scheme is not APIHelper.SKIP: + self.proration_downgrade_scheme = proration_downgrade_scheme if allocations is not APIHelper.SKIP: self.allocations = allocations if accrue_charge is not APIHelper.SKIP: @@ -84,6 +91,8 @@ def __init__(self, if downgrade_credit is not APIHelper.SKIP: self.downgrade_credit = downgrade_credit self.payment_collection_method = payment_collection_method + if initiate_dunning is not APIHelper.SKIP: + self.initiate_dunning = initiate_dunning @classmethod def from_dictionary(cls, @@ -103,17 +112,18 @@ def from_dictionary(cls, return None # Extract variables from the dictionary - proration_upgrade_scheme = dictionary.get("proration_upgrade_scheme") if dictionary.get("proration_upgrade_scheme") else 'no-prorate' - proration_downgrade_scheme = dictionary.get("proration_downgrade_scheme") if dictionary.get("proration_downgrade_scheme") else 'no-prorate' + proration_upgrade_scheme = dictionary.get("proration_upgrade_scheme") if dictionary.get("proration_upgrade_scheme") else APIHelper.SKIP + proration_downgrade_scheme = dictionary.get("proration_downgrade_scheme") if dictionary.get("proration_downgrade_scheme") else APIHelper.SKIP allocations = None if dictionary.get('allocations') is not None: - allocations = [CreateAllocationRequest.from_dictionary(x) for x in dictionary.get('allocations')] + allocations = [CreateAllocation.from_dictionary(x) for x in dictionary.get('allocations')] else: allocations = APIHelper.SKIP accrue_charge = dictionary.get("accrue_charge") if "accrue_charge" in dictionary.keys() else APIHelper.SKIP upgrade_charge = dictionary.get("upgrade_charge") if "upgrade_charge" in dictionary.keys() else APIHelper.SKIP downgrade_credit = dictionary.get("downgrade_credit") if "downgrade_credit" in dictionary.keys() else APIHelper.SKIP payment_collection_method = dictionary.get("payment_collection_method") if dictionary.get("payment_collection_method") else 'automatic' + initiate_dunning = dictionary.get("initiate_dunning") if "initiate_dunning" in dictionary.keys() else APIHelper.SKIP # Return an object of this model return cls(proration_upgrade_scheme, proration_downgrade_scheme, @@ -121,4 +131,5 @@ def from_dictionary(cls, accrue_charge, upgrade_charge, downgrade_credit, - payment_collection_method) + payment_collection_method, + initiate_dunning) diff --git a/advancedbilling/models/allocation.py b/advancedbilling/models/allocation.py index 43f41523..f491ea66 100644 --- a/advancedbilling/models/allocation.py +++ b/advancedbilling/models/allocation.py @@ -16,18 +16,25 @@ class Allocation(object): TODO: type model description here. Attributes: + allocation_id (int): The allocation unique id component_id (int): The integer component ID for the allocation. This references a component that you have created in your Product setup + component_handle (str): The handle of the component. This references a + component that you have created in your Product setup subscription_id (int): The integer subscription ID for the allocation. This references a unique subscription in your Site - quantity (int): The allocated quantity set in to effect by the - allocation - previous_quantity (int): The allocated quantity that was in effect - before this allocation was created + quantity (int | str | None): The allocated quantity set in to effect + by the allocation. String for components supporting fractional + quantities + previous_quantity (int | str | None): The allocated quantity that was + in effect before this allocation was created. String for + components supporting fractional quantities memo (str): The memo passed when the allocation was created - timestamp (str): The time that the allocation was recorded, in format - and UTC timezone, i.e. 2012-11-20T22:00:37Z + timestamp (datetime): The time that the allocation was recorded, in + format and UTC timezone, i.e. 2012-11-20T22:00:37Z + created_at (datetime): Timestamp indicating when this allocation was + created proration_upgrade_scheme (str): The scheme used if the proration was an upgrade. This is only present when the allocation was created mid-period. @@ -41,6 +48,9 @@ class Allocation(object): accrue_charge (bool): If the change in cost is an upgrade, this determines if the charge should accrue to the next renewal or if capture should be attempted immediately. + initiate_dunning (bool): If true, if the immediate component payment + fails, initiate dunning for the subscription. Otherwise, leave + the charges on the subscription to pay for at renewal. upgrade_charge (CreditType): The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. Available values: `full`, @@ -49,18 +59,21 @@ class Allocation(object): upgrading/downgrading. Defaults to the component and then site setting if one is not provided. Available values: `full`, `prorated`, `none`. - payment (AllocationPayment | None): TODO: type description here. + payment (PaymentForAllocation | None): TODO: type description here. """ # Create a mapping from Model property names to API property names _names = { + "allocation_id": 'allocation_id', "component_id": 'component_id', + "component_handle": 'component_handle', "subscription_id": 'subscription_id', "quantity": 'quantity', "previous_quantity": 'previous_quantity', "memo": 'memo', "timestamp": 'timestamp', + "created_at": 'created_at', "proration_upgrade_scheme": 'proration_upgrade_scheme', "proration_downgrade_scheme": 'proration_downgrade_scheme', "price_point_id": 'price_point_id', @@ -68,18 +81,22 @@ class Allocation(object): "price_point_handle": 'price_point_handle', "previous_price_point_id": 'previous_price_point_id', "accrue_charge": 'accrue_charge', + "initiate_dunning": 'initiate_dunning', "upgrade_charge": 'upgrade_charge', "downgrade_credit": 'downgrade_credit', "payment": 'payment' } _optionals = [ + 'allocation_id', 'component_id', + 'component_handle', 'subscription_id', 'quantity', 'previous_quantity', 'memo', 'timestamp', + 'created_at', 'proration_upgrade_scheme', 'proration_downgrade_scheme', 'price_point_id', @@ -87,12 +104,14 @@ class Allocation(object): 'price_point_handle', 'previous_price_point_id', 'accrue_charge', + 'initiate_dunning', 'upgrade_charge', 'downgrade_credit', 'payment', ] _nullables = [ + 'component_handle', 'memo', 'upgrade_charge', 'downgrade_credit', @@ -100,12 +119,15 @@ class Allocation(object): ] def __init__(self, + allocation_id=APIHelper.SKIP, component_id=APIHelper.SKIP, + component_handle=APIHelper.SKIP, subscription_id=APIHelper.SKIP, quantity=APIHelper.SKIP, previous_quantity=APIHelper.SKIP, memo=APIHelper.SKIP, timestamp=APIHelper.SKIP, + created_at=APIHelper.SKIP, proration_upgrade_scheme=APIHelper.SKIP, proration_downgrade_scheme=APIHelper.SKIP, price_point_id=APIHelper.SKIP, @@ -113,14 +135,19 @@ def __init__(self, price_point_handle=APIHelper.SKIP, previous_price_point_id=APIHelper.SKIP, accrue_charge=APIHelper.SKIP, + initiate_dunning=APIHelper.SKIP, upgrade_charge=APIHelper.SKIP, downgrade_credit=APIHelper.SKIP, payment=APIHelper.SKIP): """Constructor for the Allocation class""" # Initialize members of the class + if allocation_id is not APIHelper.SKIP: + self.allocation_id = allocation_id if component_id is not APIHelper.SKIP: self.component_id = component_id + if component_handle is not APIHelper.SKIP: + self.component_handle = component_handle if subscription_id is not APIHelper.SKIP: self.subscription_id = subscription_id if quantity is not APIHelper.SKIP: @@ -130,7 +157,9 @@ def __init__(self, if memo is not APIHelper.SKIP: self.memo = memo if timestamp is not APIHelper.SKIP: - self.timestamp = timestamp + self.timestamp = APIHelper.apply_datetime_converter(timestamp, APIHelper.RFC3339DateTime) if timestamp else None + if created_at is not APIHelper.SKIP: + self.created_at = APIHelper.apply_datetime_converter(created_at, APIHelper.RFC3339DateTime) if created_at else None if proration_upgrade_scheme is not APIHelper.SKIP: self.proration_upgrade_scheme = proration_upgrade_scheme if proration_downgrade_scheme is not APIHelper.SKIP: @@ -145,6 +174,8 @@ def __init__(self, self.previous_price_point_id = previous_price_point_id if accrue_charge is not APIHelper.SKIP: self.accrue_charge = accrue_charge + if initiate_dunning is not APIHelper.SKIP: + self.initiate_dunning = initiate_dunning if upgrade_charge is not APIHelper.SKIP: self.upgrade_charge = upgrade_charge if downgrade_credit is not APIHelper.SKIP: @@ -171,12 +202,15 @@ def from_dictionary(cls, return None # Extract variables from the dictionary + allocation_id = dictionary.get("allocation_id") if dictionary.get("allocation_id") else APIHelper.SKIP component_id = dictionary.get("component_id") if dictionary.get("component_id") else APIHelper.SKIP + component_handle = dictionary.get("component_handle") if "component_handle" in dictionary.keys() else APIHelper.SKIP subscription_id = dictionary.get("subscription_id") if dictionary.get("subscription_id") else APIHelper.SKIP - quantity = dictionary.get("quantity") if dictionary.get("quantity") else APIHelper.SKIP - previous_quantity = dictionary.get("previous_quantity") if dictionary.get("previous_quantity") else APIHelper.SKIP + quantity = APIHelper.deserialize_union_type(UnionTypeLookUp.get('AllocationQuantity'), dictionary.get('quantity'), False) if dictionary.get('quantity') is not None else APIHelper.SKIP + previous_quantity = APIHelper.deserialize_union_type(UnionTypeLookUp.get('AllocationPreviousQuantity'), dictionary.get('previous_quantity'), False) if dictionary.get('previous_quantity') is not None else APIHelper.SKIP memo = dictionary.get("memo") if "memo" in dictionary.keys() else APIHelper.SKIP - timestamp = dictionary.get("timestamp") if dictionary.get("timestamp") else APIHelper.SKIP + timestamp = APIHelper.RFC3339DateTime.from_value(dictionary.get("timestamp")).datetime if dictionary.get("timestamp") else APIHelper.SKIP + created_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("created_at")).datetime if dictionary.get("created_at") else APIHelper.SKIP proration_upgrade_scheme = dictionary.get("proration_upgrade_scheme") if dictionary.get("proration_upgrade_scheme") else APIHelper.SKIP proration_downgrade_scheme = dictionary.get("proration_downgrade_scheme") if dictionary.get("proration_downgrade_scheme") else APIHelper.SKIP price_point_id = dictionary.get("price_point_id") if dictionary.get("price_point_id") else APIHelper.SKIP @@ -184,19 +218,23 @@ def from_dictionary(cls, price_point_handle = dictionary.get("price_point_handle") if dictionary.get("price_point_handle") else APIHelper.SKIP previous_price_point_id = dictionary.get("previous_price_point_id") if dictionary.get("previous_price_point_id") else APIHelper.SKIP accrue_charge = dictionary.get("accrue_charge") if "accrue_charge" in dictionary.keys() else APIHelper.SKIP + initiate_dunning = dictionary.get("initiate_dunning") if "initiate_dunning" in dictionary.keys() else APIHelper.SKIP upgrade_charge = dictionary.get("upgrade_charge") if "upgrade_charge" in dictionary.keys() else APIHelper.SKIP downgrade_credit = dictionary.get("downgrade_credit") if "downgrade_credit" in dictionary.keys() else APIHelper.SKIP if 'payment' in dictionary.keys(): - payment = APIHelper.deserialize_union_type(UnionTypeLookUp.get('AllocationPayment2'), dictionary.get('payment'), False) if dictionary.get('payment') is not None else None + payment = APIHelper.deserialize_union_type(UnionTypeLookUp.get('AllocationPayment'), dictionary.get('payment'), False) if dictionary.get('payment') is not None else None else: payment = APIHelper.SKIP # Return an object of this model - return cls(component_id, + return cls(allocation_id, + component_id, + component_handle, subscription_id, quantity, previous_quantity, memo, timestamp, + created_at, proration_upgrade_scheme, proration_downgrade_scheme, price_point_id, @@ -204,6 +242,7 @@ def from_dictionary(cls, price_point_handle, previous_price_point_id, accrue_charge, + initiate_dunning, upgrade_charge, downgrade_credit, payment) diff --git a/advancedbilling/models/allocation_preview.py b/advancedbilling/models/allocation_preview.py index 943b2147..ed4d8380 100644 --- a/advancedbilling/models/allocation_preview.py +++ b/advancedbilling/models/allocation_preview.py @@ -24,7 +24,7 @@ class AllocationPreview(object): total_tax_in_cents (long|int): TODO: type description here. total_discount_in_cents (long|int): TODO: type description here. total_in_cents (long|int): TODO: type description here. - direction (str): TODO: type description here. + direction (AllocationPreviewDirection): TODO: type description here. proration_scheme (str): TODO: type description here. line_items (List[AllocationPreviewLineItem]): TODO: type description here. diff --git a/advancedbilling/models/allocation_preview_direction.py b/advancedbilling/models/allocation_preview_direction.py new file mode 100644 index 00000000..ad8c1a67 --- /dev/null +++ b/advancedbilling/models/allocation_preview_direction.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- + +""" +advanced_billing + +This file was automatically generated for Maxio by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + + +class AllocationPreviewDirection(object): + + """Implementation of the 'Allocation Preview Direction' enum. + + TODO: type enum description here. + + Attributes: + UPGRADE: TODO: type description here. + DOWNGRADE: TODO: type description here. + + """ + UPGRADE = 'upgrade' + + DOWNGRADE = 'downgrade' + diff --git a/advancedbilling/models/allocation_preview_item.py b/advancedbilling/models/allocation_preview_item.py index 015f2c10..02ae107f 100644 --- a/advancedbilling/models/allocation_preview_item.py +++ b/advancedbilling/models/allocation_preview_item.py @@ -18,8 +18,8 @@ class AllocationPreviewItem(object): Attributes: component_id (int): TODO: type description here. subscription_id (int): TODO: type description here. - quantity (float): TODO: type description here. - previous_quantity (int): TODO: type description here. + quantity (int | str | None): TODO: type description here. + previous_quantity (int | str | None): TODO: type description here. memo (str): TODO: type description here. timestamp (str): TODO: type description here. proration_upgrade_scheme (str): TODO: type description here. @@ -35,6 +35,8 @@ class AllocationPreviewItem(object): `prorated`, `none`. price_point_id (int): TODO: type description here. previous_price_point_id (int): TODO: type description here. + price_point_handle (str): TODO: type description here. + price_point_name (str): TODO: type description here. component_handle (str): TODO: type description here. """ @@ -54,6 +56,8 @@ class AllocationPreviewItem(object): "downgrade_credit": 'downgrade_credit', "price_point_id": 'price_point_id', "previous_price_point_id": 'previous_price_point_id', + "price_point_handle": 'price_point_handle', + "price_point_name": 'price_point_name', "component_handle": 'component_handle' } @@ -71,13 +75,17 @@ class AllocationPreviewItem(object): 'downgrade_credit', 'price_point_id', 'previous_price_point_id', + 'price_point_handle', + 'price_point_name', 'component_handle', ] _nullables = [ + 'memo', 'timestamp', 'upgrade_charge', 'downgrade_credit', + 'component_handle', ] def __init__(self, @@ -94,6 +102,8 @@ def __init__(self, downgrade_credit=APIHelper.SKIP, price_point_id=APIHelper.SKIP, previous_price_point_id=APIHelper.SKIP, + price_point_handle=APIHelper.SKIP, + price_point_name=APIHelper.SKIP, component_handle=APIHelper.SKIP): """Constructor for the AllocationPreviewItem class""" @@ -124,6 +134,10 @@ def __init__(self, self.price_point_id = price_point_id if previous_price_point_id is not APIHelper.SKIP: self.previous_price_point_id = previous_price_point_id + if price_point_handle is not APIHelper.SKIP: + self.price_point_handle = price_point_handle + if price_point_name is not APIHelper.SKIP: + self.price_point_name = price_point_name if component_handle is not APIHelper.SKIP: self.component_handle = component_handle @@ -141,15 +155,16 @@ def from_dictionary(cls, object: An instance of this structure class. """ + from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp if dictionary is None: return None # Extract variables from the dictionary component_id = dictionary.get("component_id") if dictionary.get("component_id") else APIHelper.SKIP subscription_id = dictionary.get("subscription_id") if dictionary.get("subscription_id") else APIHelper.SKIP - quantity = dictionary.get("quantity") if dictionary.get("quantity") else APIHelper.SKIP - previous_quantity = dictionary.get("previous_quantity") if dictionary.get("previous_quantity") else APIHelper.SKIP - memo = dictionary.get("memo") if dictionary.get("memo") else APIHelper.SKIP + quantity = APIHelper.deserialize_union_type(UnionTypeLookUp.get('AllocationPreviewItemQuantity'), dictionary.get('quantity'), False) if dictionary.get('quantity') is not None else APIHelper.SKIP + previous_quantity = APIHelper.deserialize_union_type(UnionTypeLookUp.get('AllocationPreviewItemPreviousQuantity'), dictionary.get('previous_quantity'), False) if dictionary.get('previous_quantity') is not None else APIHelper.SKIP + memo = dictionary.get("memo") if "memo" in dictionary.keys() else APIHelper.SKIP timestamp = dictionary.get("timestamp") if "timestamp" in dictionary.keys() else APIHelper.SKIP proration_upgrade_scheme = dictionary.get("proration_upgrade_scheme") if dictionary.get("proration_upgrade_scheme") else APIHelper.SKIP proration_downgrade_scheme = dictionary.get("proration_downgrade_scheme") if dictionary.get("proration_downgrade_scheme") else APIHelper.SKIP @@ -158,7 +173,9 @@ def from_dictionary(cls, downgrade_credit = dictionary.get("downgrade_credit") if "downgrade_credit" in dictionary.keys() else APIHelper.SKIP price_point_id = dictionary.get("price_point_id") if dictionary.get("price_point_id") else APIHelper.SKIP previous_price_point_id = dictionary.get("previous_price_point_id") if dictionary.get("previous_price_point_id") else APIHelper.SKIP - component_handle = dictionary.get("component_handle") if dictionary.get("component_handle") else APIHelper.SKIP + price_point_handle = dictionary.get("price_point_handle") if dictionary.get("price_point_handle") else APIHelper.SKIP + price_point_name = dictionary.get("price_point_name") if dictionary.get("price_point_name") else APIHelper.SKIP + component_handle = dictionary.get("component_handle") if "component_handle" in dictionary.keys() else APIHelper.SKIP # Return an object of this model return cls(component_id, subscription_id, @@ -173,4 +190,6 @@ def from_dictionary(cls, downgrade_credit, price_point_id, previous_price_point_id, + price_point_handle, + price_point_name, component_handle) diff --git a/advancedbilling/models/allocation_preview_line_item.py b/advancedbilling/models/allocation_preview_line_item.py index 5a0fbf81..4318a62c 100644 --- a/advancedbilling/models/allocation_preview_line_item.py +++ b/advancedbilling/models/allocation_preview_line_item.py @@ -16,15 +16,18 @@ class AllocationPreviewLineItem(object): TODO: type model description here. Attributes: - transaction_type (str): TODO: type description here. - kind (str): TODO: type description here. + transaction_type (LineItemTransactionType): A handle for the line item + transaction type + kind (AllocationPreviewLineItemKind): A handle for the line item kind + for allocation preview amount_in_cents (long|int): TODO: type description here. memo (str): TODO: type description here. discount_amount_in_cents (long|int): TODO: type description here. taxable_amount_in_cents (long|int): TODO: type description here. component_id (int): TODO: type description here. component_handle (str): TODO: type description here. - direction (str): TODO: type description here. + direction (AllocationPreviewDirection): Visible when using + Fine-grained Component Control """ diff --git a/advancedbilling/models/allocation_preview_line_item_kind.py b/advancedbilling/models/allocation_preview_line_item_kind.py new file mode 100644 index 00000000..3b169dff --- /dev/null +++ b/advancedbilling/models/allocation_preview_line_item_kind.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- + +""" +advanced_billing + +This file was automatically generated for Maxio by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + + +class AllocationPreviewLineItemKind(object): + + """Implementation of the 'Allocation Preview Line Item Kind' enum. + + A handle for the line item kind for allocation preview + + Attributes: + QUANTITY_BASED_COMPONENT: TODO: type description here. + ON_OFF_COMPONENT: TODO: type description here. + COUPON: TODO: type description here. + TAX: TODO: type description here. + + """ + QUANTITY_BASED_COMPONENT = 'quantity_based_component' + + ON_OFF_COMPONENT = 'on_off_component' + + COUPON = 'coupon' + + TAX = 'tax' + diff --git a/advancedbilling/models/billing_manifest_item.py b/advancedbilling/models/billing_manifest_item.py index b587ff8c..a1f3672d 100644 --- a/advancedbilling/models/billing_manifest_item.py +++ b/advancedbilling/models/billing_manifest_item.py @@ -16,8 +16,10 @@ class BillingManifestItem(object): TODO: type model description here. Attributes: - transaction_type (str): TODO: type description here. - kind (str): TODO: type description here. + transaction_type (LineItemTransactionType): A handle for the line item + transaction type + kind (BillingManifestLineItemKind): A handle for the billing manifest + line item kind amount_in_cents (long|int): TODO: type description here. memo (str): TODO: type description here. discount_amount_in_cents (long|int): TODO: type description here. diff --git a/advancedbilling/models/billing_manifest_line_item_kind.py b/advancedbilling/models/billing_manifest_line_item_kind.py new file mode 100644 index 00000000..00a43157 --- /dev/null +++ b/advancedbilling/models/billing_manifest_line_item_kind.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- + +""" +advanced_billing + +This file was automatically generated for Maxio by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + + +class BillingManifestLineItemKind(object): + + """Implementation of the 'Billing Manifest Line Item Kind' enum. + + A handle for the billing manifest line item kind + + Attributes: + BASELINE: TODO: type description here. + INITIAL: TODO: type description here. + TRIAL: TODO: type description here. + COUPON: TODO: type description here. + COMPONENT: TODO: type description here. + TAX: TODO: type description here. + + """ + BASELINE = 'baseline' + + INITIAL = 'initial' + + TRIAL = 'trial' + + COUPON = 'coupon' + + COMPONENT = 'component' + + TAX = 'tax' + diff --git a/advancedbilling/models/create_allocation.py b/advancedbilling/models/create_allocation.py index 3c303778..079f096e 100644 --- a/advancedbilling/models/create_allocation.py +++ b/advancedbilling/models/create_allocation.py @@ -41,6 +41,10 @@ class CreateAllocation(object): upgrading/downgrading. Defaults to the component and then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + initiate_dunning (bool): If set to true, if the immediate component + payment fails, initiate dunning for the subscription. Otherwise, + leave the charges on the subscription to pay for at renewal. + Defaults to false. price_point_id (str | int | None): Price point that the allocation should be charged at. Accepts either the price point's id (integer) or handle (string). When not specified, the default @@ -62,6 +66,7 @@ class CreateAllocation(object): "accrue_charge": 'accrue_charge', "downgrade_credit": 'downgrade_credit', "upgrade_charge": 'upgrade_charge', + "initiate_dunning": 'initiate_dunning', "price_point_id": 'price_point_id', "billing_schedule": 'billing_schedule' } @@ -74,6 +79,7 @@ class CreateAllocation(object): 'accrue_charge', 'downgrade_credit', 'upgrade_charge', + 'initiate_dunning', 'price_point_id', 'billing_schedule', ] @@ -93,6 +99,7 @@ def __init__(self, accrue_charge=APIHelper.SKIP, downgrade_credit=APIHelper.SKIP, upgrade_charge=APIHelper.SKIP, + initiate_dunning=APIHelper.SKIP, price_point_id=APIHelper.SKIP, billing_schedule=APIHelper.SKIP): """Constructor for the CreateAllocation class""" @@ -113,6 +120,8 @@ def __init__(self, self.downgrade_credit = downgrade_credit if upgrade_charge is not APIHelper.SKIP: self.upgrade_charge = upgrade_charge + if initiate_dunning is not APIHelper.SKIP: + self.initiate_dunning = initiate_dunning if price_point_id is not APIHelper.SKIP: self.price_point_id = price_point_id if billing_schedule is not APIHelper.SKIP: @@ -145,6 +154,7 @@ def from_dictionary(cls, accrue_charge = dictionary.get("accrue_charge") if "accrue_charge" in dictionary.keys() else APIHelper.SKIP downgrade_credit = dictionary.get("downgrade_credit") if "downgrade_credit" in dictionary.keys() else APIHelper.SKIP upgrade_charge = dictionary.get("upgrade_charge") if "upgrade_charge" in dictionary.keys() else APIHelper.SKIP + initiate_dunning = dictionary.get("initiate_dunning") if "initiate_dunning" in dictionary.keys() else APIHelper.SKIP if 'price_point_id' in dictionary.keys(): price_point_id = APIHelper.deserialize_union_type(UnionTypeLookUp.get('CreateAllocationPricePointId'), dictionary.get('price_point_id'), False) if dictionary.get('price_point_id') is not None else None else: @@ -159,5 +169,6 @@ def from_dictionary(cls, accrue_charge, downgrade_credit, upgrade_charge, + initiate_dunning, price_point_id, billing_schedule) diff --git a/advancedbilling/models/create_metafield.py b/advancedbilling/models/create_metafield.py index 97f0280f..3ed292fa 100644 --- a/advancedbilling/models/create_metafield.py +++ b/advancedbilling/models/create_metafield.py @@ -17,7 +17,6 @@ class CreateMetafield(object): TODO: type model description here. Attributes: - id (int): TODO: type description here. name (str): TODO: type description here. scope (MetafieldScope): Warning: When updating a metafield's scope attribute, all scope attributes must be passed. Partially complete @@ -34,7 +33,6 @@ class CreateMetafield(object): # Create a mapping from Model property names to API property names _names = { - "id": 'id', "name": 'name', "scope": 'scope', "input_type": 'input_type', @@ -42,7 +40,6 @@ class CreateMetafield(object): } _optionals = [ - 'id', 'name', 'scope', 'input_type', @@ -50,7 +47,6 @@ class CreateMetafield(object): ] def __init__(self, - id=APIHelper.SKIP, name=APIHelper.SKIP, scope=APIHelper.SKIP, input_type='text', @@ -58,8 +54,6 @@ def __init__(self, """Constructor for the CreateMetafield class""" # Initialize members of the class - if id is not APIHelper.SKIP: - self.id = id if name is not APIHelper.SKIP: self.name = name if scope is not APIHelper.SKIP: @@ -86,14 +80,12 @@ def from_dictionary(cls, return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP name = dictionary.get("name") if dictionary.get("name") else APIHelper.SKIP scope = MetafieldScope.from_dictionary(dictionary.get('scope')) if 'scope' in dictionary.keys() else APIHelper.SKIP input_type = dictionary.get("input_type") if dictionary.get("input_type") else 'text' enum = dictionary.get("enum") if dictionary.get("enum") else APIHelper.SKIP # Return an object of this model - return cls(id, - name, + return cls(name, scope, input_type, enum) diff --git a/advancedbilling/models/create_or_update_flat_amount_coupon.py b/advancedbilling/models/create_or_update_flat_amount_coupon.py index a1207d0e..cb2278ac 100644 --- a/advancedbilling/models/create_or_update_flat_amount_coupon.py +++ b/advancedbilling/models/create_or_update_flat_amount_coupon.py @@ -22,11 +22,11 @@ class CreateOrUpdateFlatAmountCoupon(object): “%”, “@”, “+”, “-”, “_”, and “.” description (str): TODO: type description here. amount_in_cents (long|int): TODO: type description here. - allow_negative_balance (str): TODO: type description here. - recurring (str): TODO: type description here. - end_date (str): TODO: type description here. + allow_negative_balance (bool): TODO: type description here. + recurring (bool): TODO: type description here. + end_date (datetime): TODO: type description here. product_family_id (str): TODO: type description here. - stackable (str): TODO: type description here. + stackable (bool): TODO: type description here. compounding_strategy (CompoundingStrategy): TODO: type description here. exclude_mid_period_allocations (bool): TODO: type description here. @@ -88,7 +88,7 @@ def __init__(self, if recurring is not APIHelper.SKIP: self.recurring = recurring if end_date is not APIHelper.SKIP: - self.end_date = end_date + self.end_date = APIHelper.apply_datetime_converter(end_date, APIHelper.RFC3339DateTime) if end_date else None if product_family_id is not APIHelper.SKIP: self.product_family_id = product_family_id if stackable is not APIHelper.SKIP: @@ -122,11 +122,11 @@ def from_dictionary(cls, code = dictionary.get("code") if dictionary.get("code") else None amount_in_cents = dictionary.get("amount_in_cents") if dictionary.get("amount_in_cents") else None description = dictionary.get("description") if dictionary.get("description") else APIHelper.SKIP - allow_negative_balance = dictionary.get("allow_negative_balance") if dictionary.get("allow_negative_balance") else APIHelper.SKIP - recurring = dictionary.get("recurring") if dictionary.get("recurring") else APIHelper.SKIP - end_date = dictionary.get("end_date") if dictionary.get("end_date") else APIHelper.SKIP + allow_negative_balance = dictionary.get("allow_negative_balance") if "allow_negative_balance" in dictionary.keys() else APIHelper.SKIP + recurring = dictionary.get("recurring") if "recurring" in dictionary.keys() else APIHelper.SKIP + end_date = APIHelper.RFC3339DateTime.from_value(dictionary.get("end_date")).datetime if dictionary.get("end_date") else APIHelper.SKIP product_family_id = dictionary.get("product_family_id") if dictionary.get("product_family_id") else APIHelper.SKIP - stackable = dictionary.get("stackable") if dictionary.get("stackable") else APIHelper.SKIP + stackable = dictionary.get("stackable") if "stackable" in dictionary.keys() else APIHelper.SKIP compounding_strategy = dictionary.get("compounding_strategy") if dictionary.get("compounding_strategy") else APIHelper.SKIP exclude_mid_period_allocations = dictionary.get("exclude_mid_period_allocations") if "exclude_mid_period_allocations" in dictionary.keys() else APIHelper.SKIP apply_on_cancel_at_end_of_period = dictionary.get("apply_on_cancel_at_end_of_period") if "apply_on_cancel_at_end_of_period" in dictionary.keys() else APIHelper.SKIP diff --git a/advancedbilling/models/create_or_update_percentage_coupon.py b/advancedbilling/models/create_or_update_percentage_coupon.py index 1ec73136..8ebc5e70 100644 --- a/advancedbilling/models/create_or_update_percentage_coupon.py +++ b/advancedbilling/models/create_or_update_percentage_coupon.py @@ -22,11 +22,11 @@ class CreateOrUpdatePercentageCoupon(object): “%”, “@”, “+”, “-”, “_”, and “.” description (str): TODO: type description here. percentage (float | str): TODO: type description here. - allow_negative_balance (str): TODO: type description here. - recurring (str): TODO: type description here. - end_date (str): TODO: type description here. + allow_negative_balance (bool): TODO: type description here. + recurring (bool): TODO: type description here. + end_date (datetime): TODO: type description here. product_family_id (str): TODO: type description here. - stackable (str): TODO: type description here. + stackable (bool): TODO: type description here. compounding_strategy (CompoundingStrategy): TODO: type description here. exclude_mid_period_allocations (bool): TODO: type description here. @@ -88,7 +88,7 @@ def __init__(self, if recurring is not APIHelper.SKIP: self.recurring = recurring if end_date is not APIHelper.SKIP: - self.end_date = end_date + self.end_date = APIHelper.apply_datetime_converter(end_date, APIHelper.RFC3339DateTime) if end_date else None if product_family_id is not APIHelper.SKIP: self.product_family_id = product_family_id if stackable is not APIHelper.SKIP: @@ -123,11 +123,11 @@ def from_dictionary(cls, code = dictionary.get("code") if dictionary.get("code") else None percentage = APIHelper.deserialize_union_type(UnionTypeLookUp.get('CreateOrUpdatePercentageCouponPercentage'), dictionary.get('percentage'), False) if dictionary.get('percentage') is not None else None description = dictionary.get("description") if dictionary.get("description") else APIHelper.SKIP - allow_negative_balance = dictionary.get("allow_negative_balance") if dictionary.get("allow_negative_balance") else APIHelper.SKIP - recurring = dictionary.get("recurring") if dictionary.get("recurring") else APIHelper.SKIP - end_date = dictionary.get("end_date") if dictionary.get("end_date") else APIHelper.SKIP + allow_negative_balance = dictionary.get("allow_negative_balance") if "allow_negative_balance" in dictionary.keys() else APIHelper.SKIP + recurring = dictionary.get("recurring") if "recurring" in dictionary.keys() else APIHelper.SKIP + end_date = APIHelper.RFC3339DateTime.from_value(dictionary.get("end_date")).datetime if dictionary.get("end_date") else APIHelper.SKIP product_family_id = dictionary.get("product_family_id") if dictionary.get("product_family_id") else APIHelper.SKIP - stackable = dictionary.get("stackable") if dictionary.get("stackable") else APIHelper.SKIP + stackable = dictionary.get("stackable") if "stackable" in dictionary.keys() else APIHelper.SKIP compounding_strategy = dictionary.get("compounding_strategy") if dictionary.get("compounding_strategy") else APIHelper.SKIP exclude_mid_period_allocations = dictionary.get("exclude_mid_period_allocations") if "exclude_mid_period_allocations" in dictionary.keys() else APIHelper.SKIP apply_on_cancel_at_end_of_period = dictionary.get("apply_on_cancel_at_end_of_period") if "apply_on_cancel_at_end_of_period" in dictionary.keys() else APIHelper.SKIP diff --git a/advancedbilling/models/event.py b/advancedbilling/models/event.py index 5f274dee..a14e8b88 100644 --- a/advancedbilling/models/event.py +++ b/advancedbilling/models/event.py @@ -46,6 +46,7 @@ class Event(object): } _nullables = [ + 'subscription_id', 'event_specific_data', ] diff --git a/advancedbilling/models/invoice_line_item_event_data.py b/advancedbilling/models/invoice_line_item_event_data.py index 4b44fa64..82a30a11 100644 --- a/advancedbilling/models/invoice_line_item_event_data.py +++ b/advancedbilling/models/invoice_line_item_event_data.py @@ -91,9 +91,12 @@ class InvoiceLineItemEventData(object): _nullables = [ 'quantity_delta', 'pricing_details_index', + 'tax_code', + 'product_price_point_id', 'price_point_id', 'component_id', 'billing_schedule_item_id', + 'custom_item', ] def __init__(self, @@ -195,10 +198,10 @@ def from_dictionary(cls, pricing_details = [InvoiceLineItemPricingDetail.from_dictionary(x) for x in dictionary.get('pricing_details')] else: pricing_details = APIHelper.SKIP - tax_code = dictionary.get("tax_code") if dictionary.get("tax_code") else APIHelper.SKIP + tax_code = dictionary.get("tax_code") if "tax_code" in dictionary.keys() else APIHelper.SKIP tax_amount = dictionary.get("tax_amount") if dictionary.get("tax_amount") else APIHelper.SKIP product_id = dictionary.get("product_id") if dictionary.get("product_id") else APIHelper.SKIP - product_price_point_id = dictionary.get("product_price_point_id") if dictionary.get("product_price_point_id") else APIHelper.SKIP + product_price_point_id = dictionary.get("product_price_point_id") if "product_price_point_id" in dictionary.keys() else APIHelper.SKIP price_point_id = dictionary.get("price_point_id") if "price_point_id" in dictionary.keys() else APIHelper.SKIP component_id = dictionary.get("component_id") if "component_id" in dictionary.keys() else APIHelper.SKIP billing_schedule_item_id = dictionary.get("billing_schedule_item_id") if "billing_schedule_item_id" in dictionary.keys() else APIHelper.SKIP diff --git a/advancedbilling/models/invoice_previous_balance.py b/advancedbilling/models/invoice_previous_balance.py index 07f03bcc..676628e3 100644 --- a/advancedbilling/models/invoice_previous_balance.py +++ b/advancedbilling/models/invoice_previous_balance.py @@ -17,30 +17,30 @@ class InvoicePreviousBalance(object): TODO: type model description here. Attributes: - capture_date (str): TODO: type description here. + captured_at (datetime): TODO: type description here. invoices (List[InvoiceBalanceItem]): TODO: type description here. """ # Create a mapping from Model property names to API property names _names = { - "capture_date": 'capture_date', + "captured_at": 'captured_at', "invoices": 'invoices' } _optionals = [ - 'capture_date', + 'captured_at', 'invoices', ] def __init__(self, - capture_date=APIHelper.SKIP, + captured_at=APIHelper.SKIP, invoices=APIHelper.SKIP): """Constructor for the InvoicePreviousBalance class""" # Initialize members of the class - if capture_date is not APIHelper.SKIP: - self.capture_date = capture_date + if captured_at is not APIHelper.SKIP: + self.captured_at = APIHelper.apply_datetime_converter(captured_at, APIHelper.RFC3339DateTime) if captured_at else None if invoices is not APIHelper.SKIP: self.invoices = invoices @@ -62,14 +62,14 @@ def from_dictionary(cls, return None # Extract variables from the dictionary - capture_date = dictionary.get("capture_date") if dictionary.get("capture_date") else APIHelper.SKIP + captured_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("captured_at")).datetime if dictionary.get("captured_at") else APIHelper.SKIP invoices = None if dictionary.get('invoices') is not None: invoices = [InvoiceBalanceItem.from_dictionary(x) for x in dictionary.get('invoices')] else: invoices = APIHelper.SKIP # Return an object of this model - return cls(capture_date, + return cls(captured_at, invoices) @classmethod diff --git a/advancedbilling/models/line_item_kind.py b/advancedbilling/models/line_item_kind.py new file mode 100644 index 00000000..122ac84f --- /dev/null +++ b/advancedbilling/models/line_item_kind.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- + +""" +advanced_billing + +This file was automatically generated for Maxio by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + + +class LineItemKind(object): + + """Implementation of the 'Line Item Kind' enum. + + A handle for the line item kind + + Attributes: + BASELINE: TODO: type description here. + INITIAL: TODO: type description here. + TRIAL: TODO: type description here. + QUANTITY_BASED_COMPONENT: TODO: type description here. + PREPAID_USAGE_COMPONENT: TODO: type description here. + ON_OFF_COMPONENT: TODO: type description here. + METERED_COMPONENT: TODO: type description here. + EVENT_BASED_COMPONENT: TODO: type description here. + COUPON: TODO: type description here. + TAX: TODO: type description here. + + """ + BASELINE = 'baseline' + + INITIAL = 'initial' + + TRIAL = 'trial' + + QUANTITY_BASED_COMPONENT = 'quantity_based_component' + + PREPAID_USAGE_COMPONENT = 'prepaid_usage_component' + + ON_OFF_COMPONENT = 'on_off_component' + + METERED_COMPONENT = 'metered_component' + + EVENT_BASED_COMPONENT = 'event_based_component' + + COUPON = 'coupon' + + TAX = 'tax' + diff --git a/advancedbilling/models/line_item_transaction_type.py b/advancedbilling/models/line_item_transaction_type.py new file mode 100644 index 00000000..18362502 --- /dev/null +++ b/advancedbilling/models/line_item_transaction_type.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- + +""" +advanced_billing + +This file was automatically generated for Maxio by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + + +class LineItemTransactionType(object): + + """Implementation of the 'Line Item Transaction Type' enum. + + A handle for the line item transaction type + + Attributes: + CHARGE: TODO: type description here. + CREDIT: TODO: type description here. + ADJUSTMENT: TODO: type description here. + PAYMENT: TODO: type description here. + REFUND: TODO: type description here. + INFO_TRANSACTION: TODO: type description here. + PAYMENT_AUTHORIZATION: TODO: type description here. + + """ + CHARGE = 'charge' + + CREDIT = 'credit' + + ADJUSTMENT = 'adjustment' + + PAYMENT = 'payment' + + REFUND = 'refund' + + INFO_TRANSACTION = 'info_transaction' + + PAYMENT_AUTHORIZATION = 'payment_authorization' + diff --git a/advancedbilling/models/metafields.py b/advancedbilling/models/metafields.py index d754a3c5..97c15ba9 100644 --- a/advancedbilling/models/metafields.py +++ b/advancedbilling/models/metafields.py @@ -17,7 +17,6 @@ class Metafields(object): TODO: type model description here. Attributes: - id (int): TODO: type description here. name (str): TODO: type description here. scope (MetafieldScope): Warning: When updating a metafield's scope attribute, all scope attributes must be passed. Partially complete @@ -34,7 +33,6 @@ class Metafields(object): # Create a mapping from Model property names to API property names _names = { - "id": 'id', "name": 'name', "scope": 'scope', "input_type": 'input_type', @@ -42,7 +40,6 @@ class Metafields(object): } _optionals = [ - 'id', 'name', 'scope', 'input_type', @@ -50,7 +47,6 @@ class Metafields(object): ] def __init__(self, - id=APIHelper.SKIP, name=APIHelper.SKIP, scope=APIHelper.SKIP, input_type='text', @@ -58,8 +54,6 @@ def __init__(self, """Constructor for the Metafields class""" # Initialize members of the class - if id is not APIHelper.SKIP: - self.id = id if name is not APIHelper.SKIP: self.name = name if scope is not APIHelper.SKIP: @@ -86,14 +80,12 @@ def from_dictionary(cls, return None # Extract variables from the dictionary - id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP name = dictionary.get("name") if dictionary.get("name") else APIHelper.SKIP scope = MetafieldScope.from_dictionary(dictionary.get('scope')) if 'scope' in dictionary.keys() else APIHelper.SKIP input_type = dictionary.get("input_type") if dictionary.get("input_type") else 'text' enum = dictionary.get("enum") if dictionary.get("enum") else APIHelper.SKIP # Return an object of this model - return cls(id, - name, + return cls(name, scope, input_type, enum) diff --git a/advancedbilling/models/offer_item.py b/advancedbilling/models/offer_item.py index 033316f1..01231881 100644 --- a/advancedbilling/models/offer_item.py +++ b/advancedbilling/models/offer_item.py @@ -25,6 +25,13 @@ class OfferItem(object): component_name (str): TODO: type description here. price_point_name (str): TODO: type description here. currency_prices (List[CurrencyPrice]): TODO: type description here. + interval (int): The numerical interval. i.e. an interval of '30' + coupled with an interval_unit of day would mean this component + price point would renew every 30 days. This property is only + available for sites with Multifrequency enabled. + interval_unit (IntervalUnit): A string representing the interval unit + for this component price point, either month or day. This property + is only available for sites with Multifrequency enabled. """ @@ -37,7 +44,9 @@ class OfferItem(object): "component_unit_price": 'component_unit_price', "component_name": 'component_name', "price_point_name": 'price_point_name', - "currency_prices": 'currency_prices' + "currency_prices": 'currency_prices', + "interval": 'interval', + "interval_unit": 'interval_unit' } _optionals = [ @@ -49,6 +58,8 @@ class OfferItem(object): 'component_name', 'price_point_name', 'currency_prices', + 'interval', + 'interval_unit', ] def __init__(self, @@ -59,7 +70,9 @@ def __init__(self, component_unit_price=APIHelper.SKIP, component_name=APIHelper.SKIP, price_point_name=APIHelper.SKIP, - currency_prices=APIHelper.SKIP): + currency_prices=APIHelper.SKIP, + interval=APIHelper.SKIP, + interval_unit=APIHelper.SKIP): """Constructor for the OfferItem class""" # Initialize members of the class @@ -79,6 +92,10 @@ def __init__(self, self.price_point_name = price_point_name if currency_prices is not APIHelper.SKIP: self.currency_prices = currency_prices + if interval is not APIHelper.SKIP: + self.interval = interval + if interval_unit is not APIHelper.SKIP: + self.interval_unit = interval_unit @classmethod def from_dictionary(cls, @@ -110,6 +127,8 @@ def from_dictionary(cls, currency_prices = [CurrencyPrice.from_dictionary(x) for x in dictionary.get('currency_prices')] else: currency_prices = APIHelper.SKIP + interval = dictionary.get("interval") if dictionary.get("interval") else APIHelper.SKIP + interval_unit = dictionary.get("interval_unit") if dictionary.get("interval_unit") else APIHelper.SKIP # Return an object of this model return cls(component_id, price_point_id, @@ -118,4 +137,6 @@ def from_dictionary(cls, component_unit_price, component_name, price_point_name, - currency_prices) + currency_prices, + interval, + interval_unit) diff --git a/advancedbilling/models/allocation_payment.py b/advancedbilling/models/payment_for_allocation.py similarity index 95% rename from advancedbilling/models/allocation_payment.py rename to advancedbilling/models/payment_for_allocation.py index 828cd806..347dece0 100644 --- a/advancedbilling/models/allocation_payment.py +++ b/advancedbilling/models/payment_for_allocation.py @@ -9,9 +9,9 @@ from advancedbilling.api_helper import APIHelper -class AllocationPayment(object): +class PaymentForAllocation(object): - """Implementation of the 'Allocation Payment' model. + """Implementation of the 'Payment for Allocation' model. Information for captured payment, if applicable @@ -43,7 +43,7 @@ def __init__(self, amount_in_cents=APIHelper.SKIP, success=APIHelper.SKIP, memo=APIHelper.SKIP): - """Constructor for the AllocationPayment class""" + """Constructor for the PaymentForAllocation class""" # Initialize members of the class if id is not APIHelper.SKIP: diff --git a/advancedbilling/models/preview_allocations_request.py b/advancedbilling/models/preview_allocations_request.py index 9439c329..1f94bf1c 100644 --- a/advancedbilling/models/preview_allocations_request.py +++ b/advancedbilling/models/preview_allocations_request.py @@ -6,6 +6,8 @@ This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +import dateutil.parser + from advancedbilling.api_helper import APIHelper from advancedbilling.models.create_allocation import CreateAllocation @@ -18,31 +20,54 @@ class PreviewAllocationsRequest(object): Attributes: allocations (List[CreateAllocation]): TODO: type description here. - effective_proration_date (str): To calculate proration amounts for a + effective_proration_date (date): To calculate proration amounts for a future time. Only within a current subscription period. Only ISO8601 format is supported. + upgrade_charge (CreditType): The type of credit to be created when + upgrading/downgrading. Defaults to the component and then site + setting if one is not provided. Available values: `full`, + `prorated`, `none`. + downgrade_credit (CreditType): The type of credit to be created when + upgrading/downgrading. Defaults to the component and then site + setting if one is not provided. Available values: `full`, + `prorated`, `none`. """ # Create a mapping from Model property names to API property names _names = { "allocations": 'allocations', - "effective_proration_date": 'effective_proration_date' + "effective_proration_date": 'effective_proration_date', + "upgrade_charge": 'upgrade_charge', + "downgrade_credit": 'downgrade_credit' } _optionals = [ 'effective_proration_date', + 'upgrade_charge', + 'downgrade_credit', + ] + + _nullables = [ + 'upgrade_charge', + 'downgrade_credit', ] def __init__(self, allocations=None, - effective_proration_date=APIHelper.SKIP): + effective_proration_date=APIHelper.SKIP, + upgrade_charge=APIHelper.SKIP, + downgrade_credit=APIHelper.SKIP): """Constructor for the PreviewAllocationsRequest class""" # Initialize members of the class self.allocations = allocations if effective_proration_date is not APIHelper.SKIP: self.effective_proration_date = effective_proration_date + if upgrade_charge is not APIHelper.SKIP: + self.upgrade_charge = upgrade_charge + if downgrade_credit is not APIHelper.SKIP: + self.downgrade_credit = downgrade_credit @classmethod def from_dictionary(cls, @@ -65,7 +90,11 @@ def from_dictionary(cls, allocations = None if dictionary.get('allocations') is not None: allocations = [CreateAllocation.from_dictionary(x) for x in dictionary.get('allocations')] - effective_proration_date = dictionary.get("effective_proration_date") if dictionary.get("effective_proration_date") else APIHelper.SKIP + effective_proration_date = dateutil.parser.parse(dictionary.get('effective_proration_date')).date() if dictionary.get('effective_proration_date') else APIHelper.SKIP + upgrade_charge = dictionary.get("upgrade_charge") if "upgrade_charge" in dictionary.keys() else APIHelper.SKIP + downgrade_credit = dictionary.get("downgrade_credit") if "downgrade_credit" in dictionary.keys() else APIHelper.SKIP # Return an object of this model return cls(allocations, - effective_proration_date) + effective_proration_date, + upgrade_charge, + downgrade_credit) diff --git a/advancedbilling/models/renewal_preview_line_item.py b/advancedbilling/models/renewal_preview_line_item.py index f0c34bab..f0248825 100644 --- a/advancedbilling/models/renewal_preview_line_item.py +++ b/advancedbilling/models/renewal_preview_line_item.py @@ -16,8 +16,9 @@ class RenewalPreviewLineItem(object): TODO: type model description here. Attributes: - transaction_type (str): TODO: type description here. - kind (str): TODO: type description here. + transaction_type (LineItemTransactionType): A handle for the line item + transaction type + kind (LineItemKind): A handle for the line item kind amount_in_cents (long|int): TODO: type description here. memo (str): TODO: type description here. discount_amount_in_cents (long|int): TODO: type description here. diff --git a/advancedbilling/models/subscription_component.py b/advancedbilling/models/subscription_component.py index f861e429..976eeb9b 100644 --- a/advancedbilling/models/subscription_component.py +++ b/advancedbilling/models/subscription_component.py @@ -57,6 +57,13 @@ class SubscriptionComponent(object): subscription (SubscriptionComponentSubscription): An optional object, will be returned if provided `include=subscription` query param. display_on_hosted_page (bool): TODO: type description here. + interval (int): The numerical interval. i.e. an interval of '30' + coupled with an interval_unit of day would mean this component + price point would renew every 30 days. This property is only + available for sites with Multifrequency enabled. + interval_unit (IntervalUnit): A string representing the interval unit + for this component price point, either month or day. This property + is only available for sites with Multifrequency enabled. """ @@ -90,7 +97,9 @@ class SubscriptionComponent(object): "description": 'description', "allow_fractional_quantities": 'allow_fractional_quantities', "subscription": 'subscription', - "display_on_hosted_page": 'display_on_hosted_page' + "display_on_hosted_page": 'display_on_hosted_page', + "interval": 'interval', + "interval_unit": 'interval_unit' } _optionals = [ @@ -123,6 +132,8 @@ class SubscriptionComponent(object): 'allow_fractional_quantities', 'subscription', 'display_on_hosted_page', + 'interval', + 'interval_unit', ] _nullables = [ @@ -167,7 +178,9 @@ def __init__(self, description=APIHelper.SKIP, allow_fractional_quantities=APIHelper.SKIP, subscription=APIHelper.SKIP, - display_on_hosted_page=APIHelper.SKIP): + display_on_hosted_page=APIHelper.SKIP, + interval=APIHelper.SKIP, + interval_unit=APIHelper.SKIP): """Constructor for the SubscriptionComponent class""" # Initialize members of the class @@ -229,6 +242,10 @@ def __init__(self, self.subscription = subscription if display_on_hosted_page is not APIHelper.SKIP: self.display_on_hosted_page = display_on_hosted_page + if interval is not APIHelper.SKIP: + self.interval = interval + if interval_unit is not APIHelper.SKIP: + self.interval_unit = interval_unit @classmethod def from_dictionary(cls, @@ -281,6 +298,8 @@ def from_dictionary(cls, allow_fractional_quantities = dictionary.get("allow_fractional_quantities") if "allow_fractional_quantities" in dictionary.keys() else APIHelper.SKIP subscription = SubscriptionComponentSubscription.from_dictionary(dictionary.get('subscription')) if 'subscription' in dictionary.keys() else APIHelper.SKIP display_on_hosted_page = dictionary.get("display_on_hosted_page") if "display_on_hosted_page" in dictionary.keys() else APIHelper.SKIP + interval = dictionary.get("interval") if dictionary.get("interval") else APIHelper.SKIP + interval_unit = dictionary.get("interval_unit") if dictionary.get("interval_unit") else APIHelper.SKIP # Return an object of this model return cls(id, name, @@ -310,4 +329,6 @@ def from_dictionary(cls, description, allow_fractional_quantities, subscription, - display_on_hosted_page) + display_on_hosted_page, + interval, + interval_unit) diff --git a/advancedbilling/models/usage.py b/advancedbilling/models/usage.py index af5204b8..9c66a08d 100644 --- a/advancedbilling/models/usage.py +++ b/advancedbilling/models/usage.py @@ -18,7 +18,7 @@ class Usage(object): Attributes: id (int): TODO: type description here. memo (str): TODO: type description here. - created_at (str): TODO: type description here. + created_at (datetime): TODO: type description here. price_point_id (int): TODO: type description here. quantity (int | str | None): TODO: type description here. overage_quantity (int): TODO: type description here. @@ -71,7 +71,7 @@ def __init__(self, if memo is not APIHelper.SKIP: self.memo = memo if created_at is not APIHelper.SKIP: - self.created_at = created_at + self.created_at = APIHelper.apply_datetime_converter(created_at, APIHelper.RFC3339DateTime) if created_at else None if price_point_id is not APIHelper.SKIP: self.price_point_id = price_point_id if quantity is not APIHelper.SKIP: @@ -106,7 +106,7 @@ def from_dictionary(cls, # Extract variables from the dictionary id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP memo = dictionary.get("memo") if dictionary.get("memo") else APIHelper.SKIP - created_at = dictionary.get("created_at") if dictionary.get("created_at") else APIHelper.SKIP + created_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("created_at")).datetime if dictionary.get("created_at") else APIHelper.SKIP price_point_id = dictionary.get("price_point_id") if dictionary.get("price_point_id") else APIHelper.SKIP quantity = APIHelper.deserialize_union_type(UnionTypeLookUp.get('UsageQuantity'), dictionary.get('quantity'), False) if dictionary.get('quantity') is not None else APIHelper.SKIP overage_quantity = dictionary.get("overage_quantity") if dictionary.get("overage_quantity") else APIHelper.SKIP diff --git a/advancedbilling/utilities/union_type_lookup.py b/advancedbilling/utilities/union_type_lookup.py index b019cd1a..6aca1836 100644 --- a/advancedbilling/utilities/union_type_lookup.py +++ b/advancedbilling/utilities/union_type_lookup.py @@ -7,7 +7,6 @@ https://www.apimatic.io ). """ -from advancedbilling.models.allocation_payment import AllocationPayment from advancedbilling.models.apply_credit_note_event_data import ApplyCreditNoteEventData from advancedbilling.models.apply_debit_note_event_data import ApplyDebitNoteEventData from advancedbilling.models.apply_payment_event_data import ApplyPaymentEventData @@ -40,6 +39,7 @@ from advancedbilling.models.metered_usage import MeteredUsage from advancedbilling.models.nested_subscription_group import NestedSubscriptionGroup from advancedbilling.models.payment_collection_method_changed import PaymentCollectionMethodChanged +from advancedbilling.models.payment_for_allocation import PaymentForAllocation from advancedbilling.models.payment_method_apple_pay_type import PaymentMethodApplePayType from advancedbilling.models.payment_method_bank_account_type import PaymentMethodBankAccountType from advancedbilling.models.payment_method_credit_card_type import PaymentMethodCreditCardType @@ -667,15 +667,51 @@ class UnionTypeLookUp: is_nullable=True ) ), - 'AllocationPayment2': OneOf( + 'AllocationQuantity': OneOf( [ - LeafType(AllocationPayment) + LeafType(int), + LeafType(str) + ], + Context.create( + is_optional=True + ) + ), + 'AllocationPreviousQuantity': OneOf( + [ + LeafType(int), + LeafType(str) + ], + Context.create( + is_optional=True + ) + ), + 'AllocationPayment': OneOf( + [ + LeafType(PaymentForAllocation) ], Context.create( is_optional=True, is_nullable=True ) ), + 'AllocationPreviewItemQuantity': OneOf( + [ + LeafType(int), + LeafType(str) + ], + Context.create( + is_optional=True + ) + ), + 'AllocationPreviewItemPreviousQuantity': OneOf( + [ + LeafType(int), + LeafType(str) + ], + Context.create( + is_optional=True + ) + ), 'UsageQuantity': OneOf( [ LeafType(int), diff --git a/doc/auth/basic-authentication.md b/doc/auth/basic-authentication.md new file mode 100644 index 00000000..7be9845f --- /dev/null +++ b/doc/auth/basic-authentication.md @@ -0,0 +1,34 @@ + +# Basic Authentication + + + +Documentation for accessing and setting credentials for BasicAuth. + +## Auth Credentials + +| Name | Type | Description | Getter | +| --- | --- | --- | --- | +| BasicAuthUserName | `str` | The username to use with basic authentication | `username` | +| BasicAuthPassword | `str` | The password to use with basic authentication | `password` | + + + +**Note:** Auth credentials can be set using `BasicAuthCredentials` object, passed in as named parameter `basic_auth_credentials` in the client initialization. + +## Usage Example + +### Client Initialization + +You must provide credentials in the client as shown in the following code snippet. + +```python +client = AdvancedBillingClient( + basic_auth_credentials=BasicAuthCredentials( + username='BasicAuthUserName', + password='BasicAuthPassword' + ) +) +``` + + diff --git a/doc/client.md b/doc/client.md index a3f1afb3..b3ab6adf 100644 --- a/doc/client.md +++ b/doc/client.md @@ -16,18 +16,16 @@ 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_user_name` | `str` | The username to use with basic authentication | -| `basic_auth_password` | `str` | The password to use with basic authentication | +| `basic_auth_credentials` | [`BasicAuthCredentials`]($a/basic-authentication.md) | The credential object for Basic Authentication | The API client can be initialized as follows: ```python -from advancedbilling.advanced_billing_client import AdvancedBillingClient -from advancedbilling.configuration import Environment - client = AdvancedBillingClient( - basic_auth_user_name='BasicAuthUserName', - basic_auth_password='BasicAuthPassword' + basic_auth_credentials=BasicAuthCredentials( + username='BasicAuthUserName', + password='BasicAuthPassword' + ) ) ``` diff --git a/doc/controllers/api-exports.md b/doc/controllers/api-exports.md index 9713c49d..3c7217bc 100644 --- a/doc/controllers/api-exports.md +++ b/doc/controllers/api-exports.md @@ -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.
Default value is 100.
The maximum allowed values is 10000; any per_page value over 10000 will be changed to 10000.
**Default**: `100`
**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.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | +| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request.
Default value is 100.
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.
Use in query `page=1`. | ## Response Type @@ -79,8 +79,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.
Default value is 100.
The maximum allowed values is 10000; any per_page value over 10000 will be changed to 10000.
**Default**: `100`
**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.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | +| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request.
Default value is 100.
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.
Use in query `page=1`. | ## Response Type @@ -121,8 +121,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.
Default value is 100.
The maximum allowed values is 10000; any per_page value over 10000 will be changed to 10000.
**Default**: `100`
**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.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | +| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request.
Default value is 100.
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.
Use in query `page=1`. | ## Response Type @@ -173,7 +173,7 @@ print(result) | HTTP Status Code | Error Description | Exception Class | | --- | --- | --- | | 404 | Not Found | `APIException` | -| 409 | Conflict | [`SingleErrorResponseErrorException`](../../doc/models/single-error-response-error-exception.md) | +| 409 | Conflict | [`SingleErrorResponseException`](../../doc/models/single-error-response-exception.md) | # Export Invoices @@ -200,7 +200,7 @@ print(result) | HTTP Status Code | Error Description | Exception Class | | --- | --- | --- | | 404 | Not Found | `APIException` | -| 409 | Conflict | [`SingleErrorResponseErrorException`](../../doc/models/single-error-response-error-exception.md) | +| 409 | Conflict | [`SingleErrorResponseException`](../../doc/models/single-error-response-exception.md) | # Export Subscriptions @@ -226,7 +226,7 @@ print(result) | HTTP Status Code | Error Description | Exception Class | | --- | --- | --- | -| 409 | Conflict | [`SingleErrorResponseErrorException`](../../doc/models/single-error-response-error-exception.md) | +| 409 | Conflict | [`SingleErrorResponseException`](../../doc/models/single-error-response-exception.md) | # Read Proforma Invoices Export diff --git a/doc/controllers/components.md b/doc/controllers/components.md index fddcd1f2..c0d42b75 100644 --- a/doc/controllers/components.md +++ b/doc/controllers/components.md @@ -214,7 +214,7 @@ def read_component_by_id(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `product_family_id` | `int` | Template, Required | The Chargify id of the product family to which the component belongs | -| `component_id` | `str` | Template, Required | Either the Chargify id of the component or the handle for the component prefixed with `handle:`
**Constraints**: *Pattern*: `/\A(?:\d+\|handle:(?:uuid:\|[a-z])(?:\w\|-)+)\z/` | +| `component_id` | `str` | Template, Required | Either the Chargify id of the component or the handle for the component prefixed with `handle:` | ## Response Type @@ -283,7 +283,7 @@ def update_product_family_component(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `product_family_id` | `int` | Template, Required | The Chargify id of the product family to which the component belongs | -| `component_id` | `str` | Template, Required | Either the Chargify id of the component or the handle for the component prefixed with `handle:`
**Constraints**: *Pattern*: `/\A(?:\d+\|handle:(?:uuid:\|[a-z])(?:\w\|-)+)\z/` | +| `component_id` | `str` | Template, Required | Either the Chargify id of the component or the handle for the component prefixed with `handle:` | | `body` | [`UpdateComponentRequest`](../../doc/models/update-component-request.md) | Body, Optional | - | ## Response Type @@ -363,7 +363,7 @@ def archive_component(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `product_family_id` | `int` | Template, Required | The Chargify id of the product family to which the component belongs | -| `component_id` | `str` | Template, Required | Either the Chargify id of the component or the handle for the component prefixed with `handle:`
**Constraints**: *Pattern*: `/\A(?:\d+\|handle:(?:uuid:\|[a-z])(?:\w\|-)+)\z/` | +| `component_id` | `str` | Template, Required | Either the Chargify id of the component or the handle for the component prefixed with `handle:` | ## Response Type @@ -435,8 +435,8 @@ def list_components(self, | `start_datetime` | `str` | Query, Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of start_date. | | `end_datetime` | `str` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. optional | | `include_archived` | `bool` | Query, Optional | Include archived items | -| `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.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `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.
Use in query `page=1`. | +| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`. | | `filter_ids` | `List[str]` | Query, Optional | Allows fetching components with matching id based on provided value. Use in query `filter[ids]=1,2,3`. | | `filter_use_site_exchange_rate` | `bool` | Query, Optional | Allows fetching components with matching use_site_exchange_rate based on provided value (refers to default price point). Use in query `filter[use_site_exchange_rate]=true`. | @@ -720,8 +720,8 @@ def list_components_for_product_family(self, | `product_family_id` | `int` | Template, Required | The Chargify id of the product family | | `include_archived` | `bool` | Query, Optional | Include archived items. | | `filter_ids` | `List[int]` | Query, Optional | Allows fetching components with matching id based on provided value. Use in query `filter[ids]=1,2`. | -| `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.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `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.
Use in query `page=1`. | +| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`. | | `date_field` | [`BasicDateField`](../../doc/models/basic-date-field.md) | Query, Optional | The type of filter you would like to apply to your search. Use in query `date_field=created_at`. | | `end_date` | `str` | Query, Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns components with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. | | `end_datetime` | `str` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. optional. | @@ -917,8 +917,8 @@ def list_component_price_points(self, | --- | --- | --- | --- | | `component_id` | `int` | Template, Required | The Chargify id of the component | | `currency_prices` | `bool` | Query, Optional | Include an array of currency price data | -| `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.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `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.
Use in query `page=1`. | +| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`. | | `filter_type` | [`List[PricePointType]`](../../doc/models/price-point-type.md) | Query, Optional | Use in query: `filter[type]=catalog,default`. | ## Response Type @@ -1433,8 +1433,8 @@ def list_all_component_price_points(self, | `filter_end_date` | `date` | Query, Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns price points with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. | | `filter_end_datetime` | `datetime` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns price points with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. | | `include` | [`ListComponentsPricePointsInclude`](../../doc/models/list-components-price-points-include.md) | Query, Optional | Allows including additional data in the response. Use in query: `include=currency_prices`. | -| `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.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `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.
Use in query `page=1`. | +| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`. | | `filter_start_date` | `date` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns price points with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. | | `filter_start_datetime` | `datetime` | Query, Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns price points with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of start_date. | | `filter_type` | [`List[PricePointType]`](../../doc/models/price-point-type.md) | Query, Optional | Allows fetching price points with matching type. Use in query: `filter[type]=custom,catalog`. | diff --git a/doc/controllers/coupons.md b/doc/controllers/coupons.md index db39dc4d..43c897ff 100644 --- a/doc/controllers/coupons.md +++ b/doc/controllers/coupons.md @@ -71,11 +71,11 @@ body = CreateOrUpdateCoupon( code='15OFF', percentage='15', description='15% off for life', - allow_negative_balance='false', - recurring='false', - end_date='2012-08-29T12:00:00-04:00', + allow_negative_balance=False, + recurring=False, + end_date=dateutil.parser.parse('2012-08-29T12:00:00-04:00'), product_family_id='2', - stackable='true', + stackable=True, compounding_strategy=CompoundingStrategy.COMPOUND, exclude_mid_period_allocations=True, apply_on_cancel_at_end_of_period=True @@ -119,14 +119,14 @@ def list_coupons_for_product_family(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `product_family_id` | `int` | Template, Required | The Chargify id of the product family to which the coupon belongs | -| `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.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 30. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `30`
**Constraints**: `<= 200` | +| `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.
Use in query `page=1`. | +| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 30. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`. | | `filter_date_field` | [`BasicDateField`](../../doc/models/basic-date-field.md) | Query, Optional | The type of filter you would like to apply to your search. Use in query `filter[date_field]=created_at`. | | `filter_end_date` | `date` | Query, Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns coupons with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. Use in query `filter[date_field]=2011-12-15`. | | `filter_end_datetime` | `datetime` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns coupons with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. Use in query `?filter[end_datetime]=2011-12-1T10:15:30+01:00`. | | `filter_start_date` | `date` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns coupons with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. Use in query `filter[start_date]=2011-12-17`. | | `filter_start_datetime` | `datetime` | Query, Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns coupons with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of start_date. Use in query `filter[start_datetime]=2011-12-19T10:15:30+01:00`. | -| `filter_ids` | `List[int]` | Query, Optional | Allows fetching coupons with matching id based on provided values. Use in query `filter[ids]=1,2,3`.
**Constraints**: *Minimum Items*: `1` | +| `filter_ids` | `List[int]` | Query, Optional | Allows fetching coupons with matching id based on provided values. Use in query `filter[ids]=1,2,3`. | | `filter_codes` | `List[str]` | Query, Optional | Allows fetching coupons with matching codes based on provided values. Use in query `filter[codes]=free,free_trial`. | | `currency_prices` | `bool` | Query, Optional | When fetching coupons, if you have defined multiple currencies at the site level, you can optionally pass the `?currency_prices=true` query param to include an array of currency price data in the response. Use in query `currency_prices=true`. | | `filter_use_site_exchange_rate` | `bool` | Query, Optional | Allows fetching coupons with matching use_site_exchange_rate based on provided value. Use in query `filter[use_site_exchange_rate]=true`. | @@ -385,11 +385,11 @@ body = CreateOrUpdateCoupon( code='15OFF', percentage='15', description='15% off for life', - allow_negative_balance='false', - recurring='false', - end_date='2012-08-29T12:00:00-04:00', + allow_negative_balance=False, + recurring=False, + end_date=dateutil.parser.parse('2012-08-29T12:00:00-04:00'), product_family_id='2', - stackable='true', + stackable=True, compounding_strategy=CompoundingStrategy.COMPOUND ), restricted_products={ @@ -523,15 +523,15 @@ def list_coupons(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `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.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 30. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `30`
**Constraints**: `<= 200` | +| `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.
Use in query `page=1`. | +| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 30. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`. | | `date_field` | [`BasicDateField`](../../doc/models/basic-date-field.md) | Query, Optional | The field was deprecated: on January 20, 2022. We recommend using filter[date_field] instead to achieve the same result. The type of filter you would like to apply to your search. | | `start_date` | `date` | Query, Optional | The field was deprecated: on January 20, 2022. We recommend using filter[start_date] instead to achieve the same result. The start date (format YYYY-MM-DD) with which to filter the date_field. Returns coupons with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. | | `end_date` | `date` | Query, Optional | The field was deprecated: on January 20, 2022. We recommend using filter[end_date] instead to achieve the same result. The end date (format YYYY-MM-DD) with which to filter the date_field. Returns coupons with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. | | `start_datetime` | `datetime` | Query, Optional | The field was deprecated: on January 20, 2022. We recommend using filter[start_datetime] instead to achieve the same result. The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns coupons with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of start_date. | | `end_datetime` | `datetime` | Query, Optional | The field was deprecated: on January 20, 2022. We recommend using filter[end_datetime] instead to achieve the same result. The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns coupons with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. | -| `filter_ids` | `List[int]` | Query, Optional | Allows fetching coupons with matching id based on provided values. Use in query `filter[ids]=1,2,3`.
**Constraints**: *Minimum Items*: `1` | -| `filter_codes` | `List[str]` | Query, Optional | Allows fetching coupons with matching code based on provided values. Use in query `filter[ids]=1,2,3`.
**Constraints**: *Minimum Items*: `1` | +| `filter_ids` | `List[int]` | Query, Optional | Allows fetching coupons with matching id based on provided values. Use in query `filter[ids]=1,2,3`. | +| `filter_codes` | `List[str]` | Query, Optional | Allows fetching coupons with matching code based on provided values. Use in query `filter[ids]=1,2,3`. | | `currency_prices` | `bool` | Query, Optional | When fetching coupons, if you have defined multiple currencies at the site level, you can optionally pass the `?currency_prices=true` query param to include an array of currency price data in the response. Use in query `currency_prices=true`. | | `filter_end_date` | `date` | Query, Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns coupons with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. Use in query `filter[end_date]=2011-12-17`. | | `filter_end_datetime` | `datetime` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns coupons with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. Use in query `filter[end_datetime]=2011-12-19T10:15:30+01:00`. | @@ -924,8 +924,8 @@ def list_coupon_subcodes(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `coupon_id` | `int` | Template, Required | The Chargify id of the coupon | -| `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.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `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.
Use in query `page=1`. | +| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`. | ## Response Type diff --git a/doc/controllers/custom-fields.md b/doc/controllers/custom-fields.md index 8544ceea..3b9302b9 100644 --- a/doc/controllers/custom-fields.md +++ b/doc/controllers/custom-fields.md @@ -15,10 +15,10 @@ custom_fields_controller = client.custom_fields * [Update Metafield](../../doc/controllers/custom-fields.md#update-metafield) * [Delete Metafield](../../doc/controllers/custom-fields.md#delete-metafield) * [Create Metadata](../../doc/controllers/custom-fields.md#create-metadata) -* [Read Metadata](../../doc/controllers/custom-fields.md#read-metadata) +* [List Metadata](../../doc/controllers/custom-fields.md#list-metadata) * [Update Metadata](../../doc/controllers/custom-fields.md#update-metadata) * [Delete Metadata](../../doc/controllers/custom-fields.md#delete-metadata) -* [List Metadata](../../doc/controllers/custom-fields.md#list-metadata) +* [List Metadata for Resource Type](../../doc/controllers/custom-fields.md#list-metadata-for-resource-type) # Create Metafields @@ -125,6 +125,12 @@ print(result) ] ``` +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`SingleErrorResponseException`](../../doc/models/single-error-response-exception.md) | + # List Metafields @@ -141,8 +147,8 @@ def list_metafields(self, | --- | --- | --- | --- | | `resource_type` | [`ResourceType`](../../doc/models/resource-type.md) | Template, Required | the resource type to which the metafields belong | | `name` | `str` | Query, Optional | filter by the name of the metafield | -| `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.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `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.
Use in query `page=1`. | +| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`. | | `direction` | [`SortingDirection`](../../doc/models/sorting-direction.md) | Query, Optional | Controls the order in which results are returned.
Use in query `direction=asc`. | ## Response Type @@ -298,7 +304,6 @@ Please pay special attention to the resource you use when creating metadata. def create_metadata(self, resource_type, resource_id, - value=None, body=None) ``` @@ -308,7 +313,6 @@ def create_metadata(self, | --- | --- | --- | --- | | `resource_type` | [`ResourceType`](../../doc/models/resource-type.md) | Template, Required | the resource type to which the metafields belong | | `resource_id` | `str` | Template, Required | The Chargify id of the customer or the subscription for which the metadata applies | -| `value` | `str` | Query, Optional | Can be a single item or a list of metadata | | `body` | [`CreateMetadataRequest`](../../doc/models/create-metadata-request.md) | Body, Optional | - | ## Response Type @@ -343,8 +347,14 @@ result = custom_fields_controller.create_metadata( print(result) ``` +## Errors -# Read Metadata +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`SingleErrorResponseException`](../../doc/models/single-error-response-exception.md) | + + +# List Metadata This request will list all of the metadata belonging to a particular resource (ie. subscription, customer) that is specified. @@ -353,7 +363,7 @@ This request will list all of the metadata belonging to a particular resource (i This endpoint will also display the current stats of your metadata to use as a tool for pagination. ```python -def read_metadata(self, +def list_metadata(self, options=dict()) ``` @@ -363,8 +373,8 @@ def read_metadata(self, | --- | --- | --- | --- | | `resource_type` | [`ResourceType`](../../doc/models/resource-type.md) | Template, Required | the resource type to which the metafields belong | | `resource_id` | `str` | Template, Required | The Chargify id of the customer or the subscription for which the metadata applies | -| `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.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `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.
Use in query `page=1`. | +| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`. | ## Response Type @@ -379,7 +389,7 @@ collect = { 'page': 2, 'per_page': 50 } -result = custom_fields_controller.read_metadata(collect) +result = custom_fields_controller.list_metadata(collect) print(result) ``` @@ -392,7 +402,6 @@ This method allows you to update the existing metadata associated with a subscri def update_metadata(self, resource_type, resource_id, - value=None, body=None) ``` @@ -402,7 +411,6 @@ def update_metadata(self, | --- | --- | --- | --- | | `resource_type` | [`ResourceType`](../../doc/models/resource-type.md) | Template, Required | the resource type to which the metafields belong | | `resource_id` | `str` | Template, Required | The Chargify id of the customer or the subscription for which the metadata applies | -| `value` | `str` | Query, Optional | Can be a single item or a list of metadata | | `body` | [`UpdateMetadataRequest`](../../doc/models/update-metadata-request.md) | Body, Optional | - | ## Response Type @@ -492,7 +500,7 @@ print(result) | 404 | Not Found | `APIException` | -# List Metadata +# List Metadata for Resource Type This method will provide you information on usage of metadata across your selected resource (ie. subscriptions, customers) @@ -509,8 +517,8 @@ This endpoint will also display the current stats of your metadata to use as a t This endpoint will list the number of pages of metadata information that are contained within a site. ```python -def list_metadata(self, - options=dict()) +def list_metadata_for_resource_type(self, + options=dict()) ``` ## Parameters @@ -518,15 +526,15 @@ def list_metadata(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `resource_type` | [`ResourceType`](../../doc/models/resource-type.md) | Template, Required | the resource type to which the metafields belong | -| `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.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `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.
Use in query `page=1`. | +| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`. | | `date_field` | [`BasicDateField`](../../doc/models/basic-date-field.md) | Query, Optional | The type of filter you would like to apply to your search. | | `start_date` | `str` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns metadata with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. | | `end_date` | `str` | Query, Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns metadata with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. | | `start_datetime` | `str` | Query, Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns metadata with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of start_date. | | `end_datetime` | `str` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns metadata with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. | | `with_deleted` | `bool` | Query, Optional | Allow to fetch deleted metadata. | -| `resource_ids` | `List[int]` | Query, Optional | Allow to fetch metadata for multiple records based on provided ids. Use in query: `resource_ids[]=122&resource_ids[]=123&resource_ids[]=124`.
**Constraints**: *Maximum Items*: `50` | +| `resource_ids` | `List[int]` | Query, Optional | Allow to fetch metadata for multiple records based on provided ids. Use in query: `resource_ids[]=122&resource_ids[]=123&resource_ids[]=124`. | | `direction` | [`SortingDirection`](../../doc/models/sorting-direction.md) | Query, Optional | Controls the order in which results are returned.
Use in query `direction=asc`. | ## Response Type @@ -542,7 +550,7 @@ collect = {Liquid error: Value cannot be null. (Parameter 'key') 'per_page': 50, 'date_field': BasicDateField.UPDATED_AT } -result = custom_fields_controller.list_metadata(collect) +result = custom_fields_controller.list_metadata_for_resource_type(collect) print(result) ``` diff --git a/doc/controllers/customers.md b/doc/controllers/customers.md index 3e0a8d28..5bb1e177 100644 --- a/doc/controllers/customers.md +++ b/doc/controllers/customers.md @@ -159,8 +159,8 @@ def list_customers(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `direction` | [`SortingDirection`](../../doc/models/sorting-direction.md) | Query, Optional | Direction to sort customers by time of creation | -| `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.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 50. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `50`
**Constraints**: `<= 200` | +| `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.
Use in query `page=1`. | +| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 50. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`. | | `date_field` | [`BasicDateField`](../../doc/models/basic-date-field.md) | Query, Optional | The type of filter you would like to apply to your search.
Use in query: `date_field=created_at`. | | `start_date` | `str` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns subscriptions with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. | | `end_date` | `str` | Query, Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns subscriptions with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. | diff --git a/doc/controllers/events-based-billing-segments.md b/doc/controllers/events-based-billing-segments.md index c988ba7e..5b144195 100644 --- a/doc/controllers/events-based-billing-segments.md +++ b/doc/controllers/events-based-billing-segments.md @@ -106,8 +106,8 @@ def list_segments_for_price_point(self, | --- | --- | --- | --- | | `component_id` | `str` | Template, Required | ID or Handle for the Component | | `price_point_id` | `str` | Template, Required | ID or Handle for the Price Point belonging to the Component | -| `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.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 30. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `30`
**Constraints**: `<= 200` | +| `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.
Use in query `page=1`. | +| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 30. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`. | | `filter_segment_property_1_value` | `str` | Query, Optional | The value passed here would be used to filter segments. Pass a value related to `segment_property_1` on attached Metric. If empty string is passed, this filter would be rejected. Use in query `filter[segment_property_1_value]=EU`. | | `filter_segment_property_2_value` | `str` | Query, Optional | The value passed here would be used to filter segments. Pass a value related to `segment_property_2` on attached Metric. If empty string is passed, this filter would be rejected. | | `filter_segment_property_3_value` | `str` | Query, Optional | The value passed here would be used to filter segments. Pass a value related to `segment_property_3` on attached Metric. If empty string is passed, this filter would be rejected. | diff --git a/doc/controllers/events.md b/doc/controllers/events.md index 0168513e..9a805c6f 100644 --- a/doc/controllers/events.md +++ b/doc/controllers/events.md @@ -89,11 +89,11 @@ def list_events(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `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.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `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.
Use in query `page=1`. | +| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`. | | `since_id` | `int` | Query, Optional | Returns events with an id greater than or equal to the one specified | | `max_id` | `int` | Query, Optional | Returns events with an id less than or equal to the one specified | -| `direction` | [`Direction`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned events.
**Default**: `'desc'` | +| `direction` | [`Direction`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned events. | | `filter` | [`List[EventType]`](../../doc/models/event-type.md) | Query, Optional | You can pass multiple event keys after comma.
Use in query `filter=signup_success,payment_success`. | | `date_field` | [`ListEventsDateField`](../../doc/models/list-events-date-field.md) | Query, Optional | The type of filter you would like to apply to your search. | | `start_date` | `str` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns components with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. | @@ -201,11 +201,11 @@ def list_subscription_events(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | -| `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.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `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.
Use in query `page=1`. | +| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`. | | `since_id` | `int` | Query, Optional | Returns events with an id greater than or equal to the one specified | | `max_id` | `int` | Query, Optional | Returns events with an id less than or equal to the one specified | -| `direction` | [`Direction`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned events.
**Default**: `'desc'` | +| `direction` | [`Direction`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned events. | | `filter` | [`List[EventType]`](../../doc/models/event-type.md) | Query, Optional | You can pass multiple event keys after comma.
Use in query `filter=signup_success,payment_success`. | ## Response Type @@ -286,11 +286,11 @@ def read_events_count(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `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.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `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.
Use in query `page=1`. | +| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`. | | `since_id` | `int` | Query, Optional | Returns events with an id greater than or equal to the one specified | | `max_id` | `int` | Query, Optional | Returns events with an id less than or equal to the one specified | -| `direction` | [`Direction`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned events.
**Default**: `'desc'` | +| `direction` | [`Direction`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned events. | | `filter` | [`List[EventType]`](../../doc/models/event-type.md) | Query, Optional | You can pass multiple event keys after comma.
Use in query `filter=signup_success,payment_success`. | ## Response Type diff --git a/doc/controllers/insights.md b/doc/controllers/insights.md index 11e02df2..19357bff 100644 --- a/doc/controllers/insights.md +++ b/doc/controllers/insights.md @@ -153,8 +153,8 @@ def read_mrr_movements(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `subscription_id` | `int` | Query, Optional | optionally filter results by subscription | -| `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.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 10. The maximum allowed values is 50; any per_page value over 50 will be changed to 50.
Use in query `per_page=20`.
**Default**: `10`
**Constraints**: `<= 50` | +| `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.
Use in query `page=1`. | +| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 10. The maximum allowed values is 50; any per_page value over 50 will be changed to 50.
Use in query `per_page=20`. | | `direction` | [`SortingDirection`](../../doc/models/sorting-direction.md) | Query, Optional | Controls the order in which results are returned.
Use in query `direction=asc`. | ## Response Type @@ -242,8 +242,8 @@ def list_mrr_per_subscription(self, | --- | --- | --- | --- | | `filter_subscription_ids` | `List[int]` | Query, Optional | Submit ids in order to limit results. Use in query: `filter[subscription_ids]=1,2,3`. | | `at_time` | `str` | Query, Optional | Submit a timestamp in ISO8601 format to request MRR for a historic time. Use in query: `at_time=2022-01-10T10:00:00-05:00`. | -| `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.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `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.
Use in query `page=1`. | +| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`. | | `direction` | [`Direction`](../../doc/models/direction.md) | Query, Optional | Controls the order in which results are returned. Records are ordered by subscription_id in ascending order by default. Use in query `direction=desc`. | ## Response Type diff --git a/doc/controllers/invoices.md b/doc/controllers/invoices.md index 2c653770..f5074106 100644 --- a/doc/controllers/invoices.md +++ b/doc/controllers/invoices.md @@ -98,23 +98,23 @@ def list_invoices(self, | `status` | [`InvoiceStatus`](../../doc/models/invoice-status.md) | Query, Optional | The current status of the invoice. Allowed Values: draft, open, paid, pending, voided | | `subscription_id` | `int` | Query, Optional | The subscription's ID. | | `subscription_group_uid` | `str` | Query, Optional | The UID of the subscription group you want to fetch consolidated invoices for. This will return a paginated list of consolidated invoices for the specified group. | -| `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.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | -| `direction` | [`Direction`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned invoices.
**Default**: `'desc'` | -| `line_items` | `bool` | Query, Optional | Include line items data
**Default**: `False` | -| `discounts` | `bool` | Query, Optional | Include discounts data
**Default**: `False` | -| `taxes` | `bool` | Query, Optional | Include taxes data
**Default**: `False` | -| `credits` | `bool` | Query, Optional | Include credits data
**Default**: `False` | -| `payments` | `bool` | Query, Optional | Include payments data
**Default**: `False` | -| `custom_fields` | `bool` | Query, Optional | Include custom fields data
**Default**: `False` | -| `refunds` | `bool` | Query, Optional | Include refunds data
**Default**: `False` | -| `date_field` | [`InvoiceDateField`](../../doc/models/invoice-date-field.md) | Query, Optional | The type of filter you would like to apply to your search. Use in query `date_field=issue_date`.
**Default**: `'due_date'` | +| `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.
Use in query `page=1`. | +| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`. | +| `direction` | [`Direction`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned invoices. | +| `line_items` | `bool` | Query, Optional | Include line items data | +| `discounts` | `bool` | Query, Optional | Include discounts data | +| `taxes` | `bool` | Query, Optional | Include taxes data | +| `credits` | `bool` | Query, Optional | Include credits data | +| `payments` | `bool` | Query, Optional | Include payments data | +| `custom_fields` | `bool` | Query, Optional | Include custom fields data | +| `refunds` | `bool` | Query, Optional | Include refunds data | +| `date_field` | [`InvoiceDateField`](../../doc/models/invoice-date-field.md) | Query, Optional | The type of filter you would like to apply to your search. Use in query `date_field=issue_date`. | | `start_datetime` | `str` | Query, Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns invoices with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of start_date. Allowed to be used only along with date_field set to created_at or updated_at. | | `end_datetime` | `str` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns invoices with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. Allowed to be used only along with date_field set to created_at or updated_at. | | `customer_ids` | `List[int]` | Query, Optional | Allows fetching invoices with matching customer id based on provided values. Use in query `customer_ids=1,2,3`. | | `number` | `List[str]` | Query, Optional | Allows fetching invoices with matching invoice number based on provided values. Use in query `number=1234,1235`. | | `product_ids` | `List[int]` | Query, Optional | Allows fetching invoices with matching line items product ids based on provided values. Use in query `product_ids=23,34`. | -| `sort` | [`InvoiceSortField`](../../doc/models/invoice-sort-field.md) | Query, Optional | Allows specification of the order of the returned list. Use in query `sort=total_amount`.
**Default**: `'number'` | +| `sort` | [`InvoiceSortField`](../../doc/models/invoice-sort-field.md) | Query, Optional | Allows specification of the order of the returned list. Use in query `sort=total_amount`. | ## Response Type @@ -608,8 +608,8 @@ def list_invoice_events(self, | --- | --- | --- | --- | | `since_date` | `str` | Query, Optional | The timestamp in a format `YYYY-MM-DD T HH:MM:SS Z`, or `YYYY-MM-DD`(in this case, it returns data from the beginning of the day). of the event from which you want to start the search. All the events before the `since_date` timestamp are not returned in the response. | | `since_id` | `int` | Query, Optional | The ID of the event from which you want to start the search(ID is not included. e.g. if ID is set to 2, then all events with ID 3 and more will be shown) This parameter is not used if since_date is defined. | -| `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.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 100. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
**Default**: `100` | +| `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.
Use in query `page=1`. | +| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 100. The maximum allowed values is 200; any per_page value over 200 will be changed to 200. | | `invoice_uid` | `str` | Query, Optional | Providing an invoice_uid allows for scoping of the invoice events to a single invoice or credit note. | | `with_change_invoice_status` | `str` | Query, Optional | Use this parameter if you want to fetch also invoice events with change_invoice_status type. | | `event_types` | [`List[InvoiceEventType]`](../../doc/models/invoice-event-type.md) | Query, Optional | Filter results by event_type. Supply a comma separated list of event types (listed above). Use in query: `event_types=void_invoice,void_remainder`. | @@ -1210,13 +1210,13 @@ def list_credit_notes(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `subscription_id` | `int` | Query, Optional | The subscription's Chargify id | -| `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.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | -| `line_items` | `bool` | Query, Optional | Include line items data
**Default**: `False` | -| `discounts` | `bool` | Query, Optional | Include discounts data
**Default**: `False` | -| `taxes` | `bool` | Query, Optional | Include taxes data
**Default**: `False` | -| `refunds` | `bool` | Query, Optional | Include refunds data
**Default**: `False` | -| `applications` | `bool` | Query, Optional | Include applications data
**Default**: `False` | +| `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.
Use in query `page=1`. | +| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`. | +| `line_items` | `bool` | Query, Optional | Include line items data | +| `discounts` | `bool` | Query, Optional | Include discounts data | +| `taxes` | `bool` | Query, Optional | Include taxes data | +| `refunds` | `bool` | Query, Optional | Include refunds data | +| `applications` | `bool` | Query, Optional | Include applications data | ## Response Type @@ -2013,9 +2013,9 @@ def list_invoice_segments(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `invoice_uid` | `str` | Template, Required | The unique identifier of the consolidated invoice | -| `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.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | -| `direction` | [`Direction`](../../doc/models/direction.md) | Query, Optional | Sort direction of the returned segments.
**Default**: `'asc'` | +| `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.
Use in query `page=1`. | +| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`. | +| `direction` | [`Direction`](../../doc/models/direction.md) | Query, Optional | Sort direction of the returned segments. | ## Response Type @@ -2981,7 +2981,7 @@ print(result) ], "public_url": "dolo", "previous_balance_data": { - "capture_date": "aliqua velit quis voluptate", + "captured_at": "2024-01-09T11:22:23-05:00", "invoices": [ { "number": "veniam dolore labore ipsum cupidatat", diff --git a/doc/controllers/offers.md b/doc/controllers/offers.md index 63d84822..3412c96d 100644 --- a/doc/controllers/offers.md +++ b/doc/controllers/offers.md @@ -138,8 +138,8 @@ def list_offers(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `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.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `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.
Use in query `page=1`. | +| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`. | | `include_archived` | `bool` | Query, Optional | Include archived products. Use in query: `include_archived=true`. | ## Response Type diff --git a/doc/controllers/payment-profiles.md b/doc/controllers/payment-profiles.md index 54dd39dd..1f058278 100644 --- a/doc/controllers/payment-profiles.md +++ b/doc/controllers/payment-profiles.md @@ -354,8 +354,8 @@ def list_payment_profiles(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `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.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `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.
Use in query `page=1`. | +| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`. | | `customer_id` | `int` | Query, Optional | The ID of the customer for which you wish to list payment profiles | ## Response Type diff --git a/doc/controllers/product-families.md b/doc/controllers/product-families.md index 654178c0..57d40567 100644 --- a/doc/controllers/product-families.md +++ b/doc/controllers/product-families.md @@ -30,8 +30,8 @@ def list_products_for_product_family(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `product_family_id` | `int` | Template, Required | The Chargify id of the product family to which the product belongs | -| `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.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `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.
Use in query `page=1`. | +| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`. | | `date_field` | [`BasicDateField`](../../doc/models/basic-date-field.md) | Query, Optional | The type of filter you would like to apply to your search.
Use in query: `date_field=created_at`. | | `start_date` | `str` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns products with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. | | `end_date` | `str` | Query, Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns products with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. | @@ -217,6 +217,12 @@ print(result) } ``` +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + # List Product Families diff --git a/doc/controllers/product-price-points.md b/doc/controllers/product-price-points.md index 253ec78a..baa7237e 100644 --- a/doc/controllers/product-price-points.md +++ b/doc/controllers/product-price-points.md @@ -122,8 +122,8 @@ def list_product_price_points(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `product_id` | int \| str | Template, Required | This is a container for one-of cases. | -| `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.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 10. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
**Default**: `10`
**Constraints**: `<= 200` | +| `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.
Use in query `page=1`. | +| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 10. The maximum allowed values is 200; any per_page value over 200 will be changed to 200. | | `currency_prices` | `bool` | Query, Optional | When fetching a product's price points, if you have defined multiple currencies at the site level, you can optionally pass the ?currency_prices=true query param to include an array of currency price data in the response. If the product price point is set to use_site_exchange_rate: true, it will return pricing based on the current exchange rate. If the flag is set to false, it will return all of the defined prices for each currency. | | `filter_type` | [`List[PricePointType]`](../../doc/models/price-point-type.md) | Query, Optional | Use in query: `filter[type]=catalog,default`. | @@ -819,8 +819,8 @@ def list_all_product_price_points(self, | `filter_start_datetime` | `datetime` | Query, Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns price points with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of start_date. | | `filter_type` | [`List[PricePointType]`](../../doc/models/price-point-type.md) | Query, Optional | Allows fetching price points with matching type. Use in query: `filter[type]=catalog,custom`. | | `include` | [`ListProductsPricePointsInclude`](../../doc/models/list-products-price-points-include.md) | Query, Optional | Allows including additional data in the response. Use in query: `include=currency_prices`. | -| `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.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `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.
Use in query `page=1`. | +| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`. | ## Response Type diff --git a/doc/controllers/products.md b/doc/controllers/products.md index 955dd53e..4585ff2c 100644 --- a/doc/controllers/products.md +++ b/doc/controllers/products.md @@ -487,8 +487,8 @@ def list_products(self, | `end_datetime` | `datetime` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns products with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site''s time zone will be used. If provided, this parameter will be used instead of end_date. | | `start_date` | `date` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns products with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. | | `start_datetime` | `datetime` | Query, Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns products with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site''s time zone will be used. If provided, this parameter will be used instead of start_date. | -| `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.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `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.
Use in query `page=1`. | +| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`. | | `include_archived` | `bool` | Query, Optional | Include archived products. Use in query: `include_archived=true`. | | `include` | [`ListProductsInclude`](../../doc/models/list-products-include.md) | Query, Optional | Allows including additional data in the response. Use in query `include=prepaid_product_price_point`. | | `filter_prepaid_product_price_point_product_price_point_id` | [`IncludeNotNull`](../../doc/models/include-not-null.md) | Query, Optional | 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 param in the request `include=prepaid_product_price_point`. Use in query `filter[prepaid_product_price_point][product_price_point_id]=not_null`. | diff --git a/doc/controllers/proforma-invoices.md b/doc/controllers/proforma-invoices.md index 3441511f..9184ec67 100644 --- a/doc/controllers/proforma-invoices.md +++ b/doc/controllers/proforma-invoices.md @@ -199,15 +199,15 @@ def list_proforma_invoices(self, | `start_date` | `str` | Query, Optional | The beginning date range for the invoice's Due Date, in the YYYY-MM-DD format. | | `end_date` | `str` | Query, Optional | The ending date range for the invoice's Due Date, in the YYYY-MM-DD format. | | `status` | [`InvoiceStatus`](../../doc/models/invoice-status.md) | Query, Optional | The current status of the invoice. Allowed Values: draft, open, paid, pending, voided | -| `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.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | -| `direction` | [`Direction`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned invoices.
**Default**: `'desc'` | -| `line_items` | `bool` | Query, Optional | Include line items data
**Default**: `False` | -| `discounts` | `bool` | Query, Optional | Include discounts data
**Default**: `False` | -| `taxes` | `bool` | Query, Optional | Include taxes data
**Default**: `False` | -| `credits` | `bool` | Query, Optional | Include credits data
**Default**: `False` | -| `payments` | `bool` | Query, Optional | Include payments data
**Default**: `False` | -| `custom_fields` | `bool` | Query, Optional | Include custom fields data
**Default**: `False` | +| `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.
Use in query `page=1`. | +| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`. | +| `direction` | [`Direction`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned invoices. | +| `line_items` | `bool` | Query, Optional | Include line items data | +| `discounts` | `bool` | Query, Optional | Include discounts data | +| `taxes` | `bool` | Query, Optional | Include taxes data | +| `credits` | `bool` | Query, Optional | Include credits data | +| `payments` | `bool` | Query, Optional | Include payments data | +| `custom_fields` | `bool` | Query, Optional | Include custom fields data | ## Response Type diff --git a/doc/controllers/reason-codes.md b/doc/controllers/reason-codes.md index de00a8a6..6779fbb0 100644 --- a/doc/controllers/reason-codes.md +++ b/doc/controllers/reason-codes.md @@ -87,8 +87,8 @@ def list_reason_codes(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `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.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `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.
Use in query `page=1`. | +| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`. | ## Response Type diff --git a/doc/controllers/sales-commissions.md b/doc/controllers/sales-commissions.md index 5b19f4e5..6bb051b6 100644 --- a/doc/controllers/sales-commissions.md +++ b/doc/controllers/sales-commissions.md @@ -37,10 +37,10 @@ def list_sales_commission_settings(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `seller_id` | `str` | Template, Required | The Chargify id of your seller account | -| `authorization` | `str` | Header, Optional | For authorization use user API key. See details [here](https://developers.chargify.com/docs/developer-docs/ZG9jOjMyNzk5NTg0-2020-04-20-new-api-authentication).
**Default**: `'Bearer <>'` | +| `authorization` | `str` | Header, Optional | For authorization use user API key. See details [here](https://developers.chargify.com/docs/developer-docs/ZG9jOjMyNzk5NTg0-2020-04-20-new-api-authentication). | | `live_mode` | `bool` | Query, Optional | This parameter indicates if records should be fetched from live mode sites. Default value is true. | -| `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.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 100.
**Default**: `100` | +| `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.
Use in query `page=1`. | +| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 100. | ## Response Type @@ -116,10 +116,10 @@ def list_sales_reps(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `seller_id` | `str` | Template, Required | The Chargify id of your seller account | -| `authorization` | `str` | Header, Optional | For authorization use user API key. See details [here](https://developers.chargify.com/docs/developer-docs/ZG9jOjMyNzk5NTg0-2020-04-20-new-api-authentication).
**Default**: `'Bearer <>'` | +| `authorization` | `str` | Header, Optional | For authorization use user API key. See details [here](https://developers.chargify.com/docs/developer-docs/ZG9jOjMyNzk5NTg0-2020-04-20-new-api-authentication). | | `live_mode` | `bool` | Query, Optional | This parameter indicates if records should be fetched from live mode sites. Default value is true. | -| `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.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 100.
**Default**: `100` | +| `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.
Use in query `page=1`. | +| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 100. | ## Response Type @@ -250,10 +250,10 @@ def read_sales_rep(self, | --- | --- | --- | --- | | `seller_id` | `str` | Template, Required | The Chargify id of your seller account | | `sales_rep_id` | `str` | Template, Required | The Chargify id of sales rep. | -| `authorization` | `str` | Header, Optional | For authorization use user API key. See details [here](https://developers.chargify.com/docs/developer-docs/ZG9jOjMyNzk5NTg0-2020-04-20-new-api-authentication).
**Default**: `'Bearer <>'` | +| `authorization` | `str` | Header, Optional | For authorization use user API key. See details [here](https://developers.chargify.com/docs/developer-docs/ZG9jOjMyNzk5NTg0-2020-04-20-new-api-authentication). | | `live_mode` | `bool` | Query, Optional | This parameter indicates if records should be fetched from live mode sites. Default value is true. | -| `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.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 100.
**Default**: `100` | +| `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.
Use in query `page=1`. | +| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 100. | ## Response Type diff --git a/doc/controllers/sites.md b/doc/controllers/sites.md index 010c69bb..76b907b1 100644 --- a/doc/controllers/sites.md +++ b/doc/controllers/sites.md @@ -110,7 +110,7 @@ def clear_site(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `cleanup_scope` | [`CleanupScope`](../../doc/models/cleanup-scope.md) | Query, Optional | `all`: Will clear all products, customers, and related subscriptions from the site.
`customers`: Will clear only customers and related subscriptions (leaving the products untouched) for the site.
Revenue will also be reset to 0.
Use in query `cleanup_scope=all`.
**Default**: `'all'` | +| `cleanup_scope` | [`CleanupScope`](../../doc/models/cleanup-scope.md) | Query, Optional | `all`: Will clear all products, customers, and related subscriptions from the site.
`customers`: Will clear only customers and related subscriptions (leaving the products untouched) for the site.
Revenue will also be reset to 0.
Use in query `cleanup_scope=all`. | ## Response Type @@ -147,8 +147,8 @@ def list_chargify_js_public_keys(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `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.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `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.
Use in query `page=1`. | +| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`. | ## Response Type diff --git a/doc/controllers/subscription-components.md b/doc/controllers/subscription-components.md index d85426fe..edff2906 100644 --- a/doc/controllers/subscription-components.md +++ b/doc/controllers/subscription-components.md @@ -489,7 +489,7 @@ print(result) "quantity": 3, "previous_quantity": 2, "memo": "dolore cupidatat elit", - "timestamp": "ex proident dolor i", + "timestamp": "2022-11-23T10:28:34-05:00", "proration_upgrade_scheme": "laboris ipsum dolore", "proration_downgrade_scheme": "eiusmod dolore", "price_point_id": -69720370, @@ -507,6 +507,12 @@ print(result) } ``` +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + # List Allocations @@ -544,7 +550,7 @@ def list_allocations(self, | --- | --- | --- | --- | | `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | | `component_id` | `int` | Template, Required | The Chargify id of the component | -| `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.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | +| `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.
Use in query `page=1`. | ## Response Type @@ -604,7 +610,7 @@ print(result) | --- | --- | --- | | 401 | Unauthorized | `APIException` | | 404 | Not Found | `APIException` | -| 422 | Unprocessable Entity (WebDAV) | `APIException` | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | # Allocate Components @@ -641,19 +647,15 @@ body = AllocateComponents( proration_upgrade_scheme='prorate-attempt-capture', proration_downgrade_scheme='no-prorate', allocations=[ - CreateAllocationRequest( - allocation=CreateAllocation( - quantity=10, - component_id=123, - memo='foo' - ) + CreateAllocation( + quantity=10, + component_id=123, + memo='foo' ), - CreateAllocationRequest( - allocation=CreateAllocation( - quantity=5, - component_id=456, - memo='bar' - ) + CreateAllocation( + quantity=5, + component_id=456, + memo='bar' ) ] ) @@ -723,7 +725,7 @@ Chargify offers the ability to preview a potential subscription's **quantity-bas ## Fine-grained Component Control: Use with multiple `upgrade_charge`s or `downgrade_credits` -When the allocation uses multiple different types of `upgrade_charge`s or `downgrade_credit`s, the Allocation is viewed as an Allocation which uses "Fine-Grained Component Control". As a result, the response will not include `direction` and `proration` within the `allocation_preview` at the `line_items` and `allocations` level respectfully. +When the allocation uses multiple different types of `upgrade_charge`s or `downgrade_credit`s, the Allocation is viewed as an Allocation which uses "Fine-Grained Component Control". As a result, the response will not include `direction` and `proration` within the `allocation_preview`, but at the `line_items` and `allocations` level respectfully. See example below for Fine-Grained Component Control response. @@ -760,7 +762,7 @@ body = PreviewAllocationsRequest( price_point_id=325826 ) ], - effective_proration_date='2023-11-01' + effective_proration_date=dateutil.parser.parse('2023-11-01').date() ) result = subscription_components_controller.preview_allocations( @@ -1166,8 +1168,8 @@ def list_usages(self, | `max_id` | `int` | Query, Optional | Returns usages with an id less than or equal to the one specified | | `since_date` | `date` | Query, Optional | Returns usages with a created_at date greater than or equal to midnight (12:00 AM) on the date specified. | | `until_date` | `date` | Query, Optional | Returns usages with a created_at date less than or equal to midnight (12:00 AM) on the date specified. | -| `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.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `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.
Use in query `page=1`. | +| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`. | ## Response Type @@ -1429,8 +1431,8 @@ def list_subscription_components_for_site(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `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.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `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.
Use in query `page=1`. | +| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`. | | `sort` | [`ListSubscriptionComponentsSort`](../../doc/models/list-subscription-components-sort.md) | Query, Optional | The attribute by which to sort. Use in query: `sort=updated_at`. | | `direction` | [`SortingDirection`](../../doc/models/sorting-direction.md) | Query, Optional | Controls the order in which results are returned.
Use in query `direction=asc`. | | `date_field` | [`SubscriptionListDateField`](../../doc/models/subscription-list-date-field.md) | Query, Optional | The type of filter you'd like to apply to your search. Use in query: `date_field=updated_at`. | @@ -1438,7 +1440,7 @@ def list_subscription_components_for_site(self, | `start_datetime` | `str` | Query, Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site''s time zone will be used. If provided, this parameter will be used instead of start_date. Use in query `start_datetime=2022-07-01 09:00:05`. | | `end_date` | `str` | Query, Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns components with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. Use in query `end_date=2011-12-16`. | | `end_datetime` | `str` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site''s time zone will be used. If provided, this parameter will be used instead of end_date. Use in query `end_datetime=2022-07-01 09:00:05`. | -| `subscription_ids` | `List[int]` | Query, Optional | Allows fetching components allocation with matching subscription id based on provided ids. Use in query `subscription_ids=1,2,3`.
**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `200` | +| `subscription_ids` | `List[int]` | Query, Optional | Allows fetching components allocation with matching subscription id based on provided ids. Use in query `subscription_ids=1,2,3`. | | `price_point_ids` | [`IncludeNotNull`](../../doc/models/include-not-null.md) | Query, Optional | Allows fetching components allocation only if price point id is present. Use in query `price_point_ids=not_null`. | | `product_family_ids` | `List[int]` | Query, Optional | Allows fetching components allocation with matching product family id based on provided ids. Use in query `product_family_ids=1,2,3`. | | `include` | [`ListSubscriptionComponentsInclude`](../../doc/models/list-subscription-components-include.md) | Query, Optional | Allows including additional data in the response. Use in query `include=subscription`. | diff --git a/doc/controllers/subscription-group-invoice-account.md b/doc/controllers/subscription-group-invoice-account.md index e6e941d2..a3782fb4 100644 --- a/doc/controllers/subscription-group-invoice-account.md +++ b/doc/controllers/subscription-group-invoice-account.md @@ -82,8 +82,8 @@ def list_prepayments_for_subscription_group(self, | `filter_date_field` | [`ListSubscriptionGroupPrepaymentDateField`](../../doc/models/list-subscription-group-prepayment-date-field.md) | Query, Optional | The type of filter you would like to apply to your search.
Use in query: `filter[date_field]=created_at`. | | `filter_end_date` | `date` | Query, Optional | The end date (format YYYY-MM-DD) with which to filter the date_field.
Returns prepayments with a timestamp up to and including 11:59:59PM in your site's time zone on the date specified.
Use in query: `filter[end_date]=2011-12-15`. | | `filter_start_date` | `date` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field.
Returns prepayments with a timestamp at or after midnight (12:00:00 AM) in your site's time zone on the date specified.
Use in query: `filter[start_date]=2011-12-15`. | -| `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.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `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.
Use in query `page=1`. | +| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`. | ## Response Type diff --git a/doc/controllers/subscription-groups.md b/doc/controllers/subscription-groups.md index 017f0ac3..7b6db574 100644 --- a/doc/controllers/subscription-groups.md +++ b/doc/controllers/subscription-groups.md @@ -168,8 +168,8 @@ def list_subscription_groups(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `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.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `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.
Use in query `page=1`. | +| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`. | | `include` | `str` | Query, Optional | A list of additional information to include in the response. The following values are supported:

- `account_balances`: Account balance information for the subscription groups. Use in query: `include[]=account_balances` | ## Response Type diff --git a/doc/controllers/subscription-invoice-account.md b/doc/controllers/subscription-invoice-account.md index 31f4d146..d37cb777 100644 --- a/doc/controllers/subscription-invoice-account.md +++ b/doc/controllers/subscription-invoice-account.md @@ -126,8 +126,8 @@ def list_prepayments(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | -| `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.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `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.
Use in query `page=1`. | +| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`. | | `filter_date_field` | [`BasicDateField`](../../doc/models/basic-date-field.md) | Query, Optional | The type of filter you would like to apply to your search. created_at - Time when prepayment was created. application_at - Time when prepayment was applied to invoice. Use in query `filter[date_field]=created_at`. | | `filter_start_date` | `date` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns prepayments with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. Use in query `filter[start_date]=2011-12-15`. | | `filter_end_date` | `date` | Query, Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns prepayments with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. Use in query `filter[end_date]=2011-12-15`. | diff --git a/doc/controllers/subscription-notes.md b/doc/controllers/subscription-notes.md index c8de586e..f29504fa 100644 --- a/doc/controllers/subscription-notes.md +++ b/doc/controllers/subscription-notes.md @@ -80,8 +80,8 @@ def list_subscription_notes(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | -| `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.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `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.
Use in query `page=1`. | +| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`. | ## Response Type diff --git a/doc/controllers/subscription-status.md b/doc/controllers/subscription-status.md index a154d2c4..8b43da45 100644 --- a/doc/controllers/subscription-status.md +++ b/doc/controllers/subscription-status.md @@ -391,7 +391,7 @@ def resume_subscription(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `subscription_id` | `int` | Template, Required | The Chargify id of the subscription | -| `calendar_billing_resumption_charge` | [`ResumptionCharge`](../../doc/models/resumption-charge.md) | Query, Optional | (For calendar billing subscriptions only) The way that the resumed subscription's charge should be handled
**Default**: `'prorated'` | +| `calendar_billing_resumption_charge` | [`ResumptionCharge`](../../doc/models/resumption-charge.md) | Query, Optional | (For calendar billing subscriptions only) The way that the resumed subscription's charge should be handled | ## Response Type diff --git a/doc/controllers/subscriptions.md b/doc/controllers/subscriptions.md index a9e5ba67..93a2d3d2 100644 --- a/doc/controllers/subscriptions.md +++ b/doc/controllers/subscriptions.md @@ -862,8 +862,8 @@ def list_subscriptions(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `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.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `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.
Use in query `page=1`. | +| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`. | | `state` | [`SubscriptionStateFilter`](../../doc/models/subscription-state-filter.md) | Query, Optional | The current state of the subscription | | `product` | `int` | Query, Optional | The product id of the subscription. (Note that the product handle cannot be used.) | | `product_price_point_id` | `int` | Query, Optional | The ID of the product price point. If supplied, product is required | @@ -875,7 +875,7 @@ def list_subscriptions(self, | `end_datetime` | `datetime` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns subscriptions with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. Use in query `end_datetime=2022-08-01 10:00:05`. | | `metadata` | `Dict[str, str]` | Query, Optional | The value of the metadata field specified in the parameter. Use in query `metadata[my-field]=value&metadata[other-field]=another_value`. | | `direction` | [`SortingDirection`](../../doc/models/sorting-direction.md) | Query, Optional | Controls the order in which results are returned.
Use in query `direction=asc`. | -| `sort` | [`SubscriptionSort`](../../doc/models/subscription-sort.md) | Query, Optional | The attribute by which to sort
**Default**: `'signup_date'` | +| `sort` | [`SubscriptionSort`](../../doc/models/subscription-sort.md) | Query, Optional | The attribute by which to sort | | `include` | [`List[SubscriptionListInclude]`](../../doc/models/subscription-list-include.md) | Query, Optional | Allows including additional data in the response. Use in query: `include[]=self_service_page_token`. | ## Response Type @@ -1339,7 +1339,7 @@ print(result) | HTTP Status Code | Error Description | Exception Class | | --- | --- | --- | | 400 | Bad Request | `APIException` | -| 422 | Unprocessable Entity (WebDAV) | [`SingleErrorResponseErrorException`](../../doc/models/single-error-response-error-exception.md) | +| 422 | Unprocessable Entity (WebDAV) | [`SingleErrorResponseException`](../../doc/models/single-error-response-exception.md) | # Read Subscription by Reference diff --git a/doc/controllers/webhooks.md b/doc/controllers/webhooks.md index 7ba9b452..45f7886a 100644 --- a/doc/controllers/webhooks.md +++ b/doc/controllers/webhooks.md @@ -47,8 +47,8 @@ def list_webhooks(self, | `status` | [`WebhookStatus`](../../doc/models/webhook-status.md) | Query, Optional | Webhooks with matching status would be returned. | | `since_date` | `str` | Query, Optional | Format YYYY-MM-DD. Returns Webhooks with the created_at date greater than or equal to the one specified. | | `until_date` | `str` | Query, Optional | Format YYYY-MM-DD. Returns Webhooks with the created_at date less than or equal to the one specified. | -| `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.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `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.
Use in query `page=1`. | +| `per_page` | `int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`. | | `order` | [`WebhookOrder`](../../doc/models/webhook-order.md) | Query, Optional | The order in which the Webhooks are returned. | | `subscription` | `int` | Query, Optional | The Chargify id of a subscription you'd like to filter for | diff --git a/doc/models/allocate-components.md b/doc/models/allocate-components.md index 7053ff76..df23d087 100644 --- a/doc/models/allocate-components.md +++ b/doc/models/allocate-components.md @@ -9,41 +9,38 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `proration_upgrade_scheme` | `str` | Optional | **Default**: `'no-prorate'` | -| `proration_downgrade_scheme` | `str` | Optional | **Default**: `'no-prorate'` | -| `allocations` | [`List[CreateAllocationRequest]`](../../doc/models/create-allocation-request.md) | Optional | - | +| `proration_upgrade_scheme` | `str` | Optional | - | +| `proration_downgrade_scheme` | `str` | Optional | - | +| `allocations` | [`List[CreateAllocation]`](../../doc/models/create-allocation.md) | Optional | - | | `accrue_charge` | `bool` | Optional | - | | `upgrade_charge` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | | `downgrade_credit` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | | `payment_collection_method` | [`PaymentCollectionMethod1`](../../doc/models/payment-collection-method-1.md) | Optional | (Optional) If not passed, the allocation(s) will use the payment collection method on the subscription
**Default**: `'automatic'` | +| `initiate_dunning` | `bool` | Optional | If true, if the immediate component payment fails, initiate dunning for the subscription.
Otherwise, leave the charges on the subscription to pay for at renewal. | ## Example (as JSON) ```json { - "proration_upgrade_scheme": "no-prorate", - "proration_downgrade_scheme": "no-prorate", "payment_collection_method": "automatic", + "proration_upgrade_scheme": "proration_upgrade_scheme2", + "proration_downgrade_scheme": "proration_downgrade_scheme0", "allocations": [ { - "allocation": { - "quantity": 228.94, - "component_id": 8, - "memo": "memo2", - "proration_downgrade_scheme": "proration_downgrade_scheme4", - "proration_upgrade_scheme": "proration_upgrade_scheme6", - "accrue_charge": false - } + "quantity": 26.48, + "component_id": 242, + "memo": "memo6", + "proration_downgrade_scheme": "proration_downgrade_scheme0", + "proration_upgrade_scheme": "proration_upgrade_scheme2", + "accrue_charge": false }, { - "allocation": { - "quantity": 228.94, - "component_id": 8, - "memo": "memo2", - "proration_downgrade_scheme": "proration_downgrade_scheme4", - "proration_upgrade_scheme": "proration_upgrade_scheme6", - "accrue_charge": false - } + "quantity": 26.48, + "component_id": 242, + "memo": "memo6", + "proration_downgrade_scheme": "proration_downgrade_scheme0", + "proration_upgrade_scheme": "proration_upgrade_scheme2", + "accrue_charge": false } ], "accrue_charge": false, diff --git a/doc/models/allocation-preview-direction.md b/doc/models/allocation-preview-direction.md new file mode 100644 index 00000000..2e124430 --- /dev/null +++ b/doc/models/allocation-preview-direction.md @@ -0,0 +1,14 @@ + +# Allocation Preview Direction + +## Enumeration + +`AllocationPreviewDirection` + +## Fields + +| Name | +| --- | +| `UPGRADE` | +| `DOWNGRADE` | + diff --git a/doc/models/allocation-preview-item.md b/doc/models/allocation-preview-item.md index ff0534d0..8dc9a843 100644 --- a/doc/models/allocation-preview-item.md +++ b/doc/models/allocation-preview-item.md @@ -11,8 +11,8 @@ | --- | --- | --- | --- | | `component_id` | `int` | Optional | - | | `subscription_id` | `int` | Optional | - | -| `quantity` | `float` | Optional | - | -| `previous_quantity` | `int` | Optional | - | +| `quantity` | int \| str \| None | Optional | This is a container for one-of cases. | +| `previous_quantity` | int \| str \| None | Optional | This is a container for one-of cases. | | `memo` | `str` | Optional | - | | `timestamp` | `str` | Optional | - | | `proration_upgrade_scheme` | `str` | Optional | - | @@ -22,6 +22,8 @@ | `downgrade_credit` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | | `price_point_id` | `int` | Optional | - | | `previous_price_point_id` | `int` | Optional | - | +| `price_point_handle` | `str` | Optional | - | +| `price_point_name` | `str` | Optional | - | | `component_handle` | `str` | Optional | - | ## Example (as JSON) @@ -30,8 +32,8 @@ { "component_id": 54, "subscription_id": 54, - "quantity": 173.08, - "previous_quantity": 14, + "quantity": 78, + "previous_quantity": 192, "memo": "memo6" } ``` diff --git a/doc/models/allocation-preview-line-item-kind.md b/doc/models/allocation-preview-line-item-kind.md new file mode 100644 index 00000000..cc67eef1 --- /dev/null +++ b/doc/models/allocation-preview-line-item-kind.md @@ -0,0 +1,18 @@ + +# Allocation Preview Line Item Kind + +A handle for the line item kind for allocation preview + +## Enumeration + +`AllocationPreviewLineItemKind` + +## Fields + +| Name | +| --- | +| `QUANTITY_BASED_COMPONENT` | +| `ON_OFF_COMPONENT` | +| `COUPON` | +| `TAX` | + diff --git a/doc/models/allocation-preview-line-item.md b/doc/models/allocation-preview-line-item.md index 05d2ed67..cdca0acf 100644 --- a/doc/models/allocation-preview-line-item.md +++ b/doc/models/allocation-preview-line-item.md @@ -9,22 +9,22 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `transaction_type` | `str` | Optional | - | -| `kind` | `str` | Optional | - | +| `transaction_type` | [`LineItemTransactionType`](../../doc/models/line-item-transaction-type.md) | Optional | A handle for the line item transaction type | +| `kind` | [`AllocationPreviewLineItemKind`](../../doc/models/allocation-preview-line-item-kind.md) | Optional | A handle for the line item kind for allocation preview | | `amount_in_cents` | `long\|int` | Optional | - | | `memo` | `str` | Optional | - | | `discount_amount_in_cents` | `long\|int` | Optional | - | | `taxable_amount_in_cents` | `long\|int` | Optional | - | | `component_id` | `int` | Optional | - | | `component_handle` | `str` | Optional | - | -| `direction` | `str` | Optional | - | +| `direction` | [`AllocationPreviewDirection`](../../doc/models/allocation-preview-direction.md) | Optional | Visible when using Fine-grained Component Control | ## Example (as JSON) ```json { - "transaction_type": "transaction_type4", - "kind": "kind0", + "transaction_type": "credit", + "kind": "quantity_based_component", "amount_in_cents": 24, "memo": "memo6", "discount_amount_in_cents": 172 diff --git a/doc/models/allocation-preview.md b/doc/models/allocation-preview.md index 63ef03c4..5bd3d66e 100644 --- a/doc/models/allocation-preview.md +++ b/doc/models/allocation-preview.md @@ -15,7 +15,7 @@ | `total_tax_in_cents` | `long\|int` | Optional | - | | `total_discount_in_cents` | `long\|int` | Optional | - | | `total_in_cents` | `long\|int` | Optional | - | -| `direction` | `str` | Optional | - | +| `direction` | [`AllocationPreviewDirection`](../../doc/models/allocation-preview-direction.md) | Optional | - | | `proration_scheme` | `str` | Optional | - | | `line_items` | [`List[AllocationPreviewLineItem]`](../../doc/models/allocation-preview-line-item.md) | Optional | - | | `accrue_charge` | `bool` | Optional | - | diff --git a/doc/models/allocation-response.md b/doc/models/allocation-response.md index dd2bff3c..59d3e1ac 100644 --- a/doc/models/allocation-response.md +++ b/doc/models/allocation-response.md @@ -16,11 +16,11 @@ ```json { "allocation": { + "allocation_id": 238, "component_id": 8, + "component_handle": "component_handle8", "subscription_id": 8, - "quantity": 110, - "previous_quantity": 60, - "memo": "memo2" + "quantity": 32 } } ``` diff --git a/doc/models/allocation.md b/doc/models/allocation.md index d8f1b001..231d5c6c 100644 --- a/doc/models/allocation.md +++ b/doc/models/allocation.md @@ -9,12 +9,15 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | +| `allocation_id` | `int` | Optional | The allocation unique id | | `component_id` | `int` | Optional | The integer component ID for the allocation. This references a component that you have created in your Product setup | +| `component_handle` | `str` | Optional | The handle of the component. This references a component that you have created in your Product setup | | `subscription_id` | `int` | Optional | The integer subscription ID for the allocation. This references a unique subscription in your Site | -| `quantity` | `int` | Optional | The allocated quantity set in to effect by the allocation | -| `previous_quantity` | `int` | Optional | The allocated quantity that was in effect before this allocation was created | +| `quantity` | int \| str \| None | Optional | This is a container for one-of cases. | +| `previous_quantity` | int \| str \| None | Optional | This is a container for one-of cases. | | `memo` | `str` | Optional | The memo passed when the allocation was created | -| `timestamp` | `str` | Optional | The time that the allocation was recorded, in format and UTC timezone, i.e. 2012-11-20T22:00:37Z | +| `timestamp` | `datetime` | Optional | The time that the allocation was recorded, in format and UTC timezone, i.e. 2012-11-20T22:00:37Z | +| `created_at` | `datetime` | Optional | Timestamp indicating when this allocation was created | | `proration_upgrade_scheme` | `str` | Optional | The scheme used if the proration was an upgrade. This is only present when the allocation was created mid-period. | | `proration_downgrade_scheme` | `str` | Optional | The scheme used if the proration was a downgrade. This is only present when the allocation was created mid-period. | | `price_point_id` | `int` | Optional | - | @@ -22,19 +25,20 @@ | `price_point_handle` | `str` | Optional | - | | `previous_price_point_id` | `int` | Optional | - | | `accrue_charge` | `bool` | Optional | If the change in cost is an upgrade, this determines if the charge should accrue to the next renewal or if capture should be attempted immediately. | +| `initiate_dunning` | `bool` | Optional | If true, if the immediate component payment fails, initiate dunning for the subscription.
Otherwise, leave the charges on the subscription to pay for at renewal. | | `upgrade_charge` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | | `downgrade_credit` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | -| `payment` | [Allocation Payment](../../doc/models/allocation-payment.md) \| None | Optional | This is a container for one-of cases. | +| `payment` | [Payment for Allocation](../../doc/models/payment-for-allocation.md) \| None | Optional | This is a container for one-of cases. | ## Example (as JSON) ```json { + "allocation_id": 102, "component_id": 144, + "component_handle": "component_handle0", "subscription_id": 144, - "quantity": 246, - "previous_quantity": 180, - "memo": "memo4" + "quantity": 168 } ``` diff --git a/doc/models/billing-manifest-item.md b/doc/models/billing-manifest-item.md index 146a5b9b..abc2505c 100644 --- a/doc/models/billing-manifest-item.md +++ b/doc/models/billing-manifest-item.md @@ -9,8 +9,8 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `transaction_type` | `str` | Optional | - | -| `kind` | `str` | Optional | - | +| `transaction_type` | [`LineItemTransactionType`](../../doc/models/line-item-transaction-type.md) | Optional | A handle for the line item transaction type | +| `kind` | [`BillingManifestLineItemKind`](../../doc/models/billing-manifest-line-item-kind.md) | Optional | A handle for the billing manifest line item kind | | `amount_in_cents` | `long\|int` | Optional | - | | `memo` | `str` | Optional | - | | `discount_amount_in_cents` | `long\|int` | Optional | - | @@ -28,8 +28,8 @@ ```json { - "transaction_type": "transaction_type2", - "kind": "kind8", + "transaction_type": "info_transaction", + "kind": "baseline", "amount_in_cents": 216, "memo": "memo4", "discount_amount_in_cents": 236 diff --git a/doc/models/billing-manifest-line-item-kind.md b/doc/models/billing-manifest-line-item-kind.md new file mode 100644 index 00000000..1f99b4e3 --- /dev/null +++ b/doc/models/billing-manifest-line-item-kind.md @@ -0,0 +1,20 @@ + +# Billing Manifest Line Item Kind + +A handle for the billing manifest line item kind + +## Enumeration + +`BillingManifestLineItemKind` + +## Fields + +| Name | +| --- | +| `BASELINE` | +| `INITIAL` | +| `TRIAL` | +| `COUPON` | +| `COMPONENT` | +| `TAX` | + diff --git a/doc/models/billing-manifest.md b/doc/models/billing-manifest.md index 93b728b1..8d92f88d 100644 --- a/doc/models/billing-manifest.md +++ b/doc/models/billing-manifest.md @@ -25,22 +25,22 @@ { "line_items": [ { - "transaction_type": "transaction_type0", - "kind": "kind6", + "transaction_type": "credit", + "kind": "component", "amount_in_cents": 24, "memo": "memo2", "discount_amount_in_cents": 172 }, { - "transaction_type": "transaction_type0", - "kind": "kind6", + "transaction_type": "credit", + "kind": "component", "amount_in_cents": 24, "memo": "memo2", "discount_amount_in_cents": 172 }, { - "transaction_type": "transaction_type0", - "kind": "kind6", + "transaction_type": "credit", + "kind": "component", "amount_in_cents": 24, "memo": "memo2", "discount_amount_in_cents": 172 diff --git a/doc/models/containers/allocation-payment-2.md b/doc/models/containers/allocation-payment-2.md deleted file mode 100644 index 4115ad55..00000000 --- a/doc/models/containers/allocation-payment-2.md +++ /dev/null @@ -1,13 +0,0 @@ - -# Allocation Payment 2 - -## Data Type - -`AllocationPayment` - -## Cases - -| Type | -| --- | -| [`AllocationPayment`](../../../doc/models/allocation-payment.md) | - diff --git a/doc/models/containers/allocation-payment.md b/doc/models/containers/allocation-payment.md new file mode 100644 index 00000000..69130f95 --- /dev/null +++ b/doc/models/containers/allocation-payment.md @@ -0,0 +1,13 @@ + +# Allocation Payment + +## Data Type + +`PaymentForAllocation` + +## Cases + +| Type | +| --- | +| [`PaymentForAllocation`](../../../doc/models/payment-for-allocation.md) | + diff --git a/doc/models/containers/allocation-preview-item-previous-quantity.md b/doc/models/containers/allocation-preview-item-previous-quantity.md new file mode 100644 index 00000000..671cbe11 --- /dev/null +++ b/doc/models/containers/allocation-preview-item-previous-quantity.md @@ -0,0 +1,14 @@ + +# Allocation Preview Item Previous Quantity + +## Data Type + +`int | str` + +## Cases + +| Type | +| --- | +| `int` | +| `str` | + diff --git a/doc/models/containers/allocation-preview-item-quantity.md b/doc/models/containers/allocation-preview-item-quantity.md new file mode 100644 index 00000000..a6952a4d --- /dev/null +++ b/doc/models/containers/allocation-preview-item-quantity.md @@ -0,0 +1,14 @@ + +# Allocation Preview Item Quantity + +## Data Type + +`int | str` + +## Cases + +| Type | +| --- | +| `int` | +| `str` | + diff --git a/doc/models/containers/allocation-previous-quantity.md b/doc/models/containers/allocation-previous-quantity.md new file mode 100644 index 00000000..ff82f8d8 --- /dev/null +++ b/doc/models/containers/allocation-previous-quantity.md @@ -0,0 +1,14 @@ + +# Allocation Previous Quantity + +## Data Type + +`int | str` + +## Cases + +| Type | +| --- | +| `int` | +| `str` | + diff --git a/doc/models/containers/allocation-quantity.md b/doc/models/containers/allocation-quantity.md new file mode 100644 index 00000000..918a8a9d --- /dev/null +++ b/doc/models/containers/allocation-quantity.md @@ -0,0 +1,14 @@ + +# Allocation Quantity + +## Data Type + +`int | str` + +## Cases + +| Type | +| --- | +| `int` | +| `str` | + diff --git a/doc/models/create-allocation.md b/doc/models/create-allocation.md index 94ba06ad..768b643c 100644 --- a/doc/models/create-allocation.md +++ b/doc/models/create-allocation.md @@ -17,6 +17,7 @@ | `accrue_charge` | `bool` | Optional | If the change in cost is an upgrade, this determines if the charge should accrue to the next renewal or if capture should be attempted immediately. Defaults to the site setting if one is not provided. | | `downgrade_credit` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | | `upgrade_charge` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | +| `initiate_dunning` | `bool` | Optional | If set to true, if the immediate component payment fails, initiate dunning for the subscription.
Otherwise, leave the charges on the subscription to pay for at renewal. Defaults to false. | | `price_point_id` | str \| int \| None | Optional | This is a container for one-of cases. | | `billing_schedule` | [`BillingSchedule`](../../doc/models/billing-schedule.md) | Optional | This attribute is particularly useful when you need to align billing events for different components on distinct schedules within a subscription. Please note this only works for site with Multifrequency enabled | diff --git a/doc/models/create-metafield.md b/doc/models/create-metafield.md index 9fb38168..da22fc79 100644 --- a/doc/models/create-metafield.md +++ b/doc/models/create-metafield.md @@ -9,7 +9,6 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `id` | `int` | Optional | - | | `name` | `str` | Optional | - | | `scope` | [`MetafieldScope`](../../doc/models/metafield-scope.md) | Optional | Warning: When updating a metafield's scope attribute, all scope attributes must be passed. Partially complete scope attributes will override the existing settings. | | `input_type` | [`MetafieldInput`](../../doc/models/metafield-input.md) | Optional | Indicates how data should be added to the metafield. For example, a text type is just a string, so a given metafield of this type can have any value attached. On the other hand, dropdown and radio have a set of allowed values that can be input, and appear differently on a Public Signup Page.
**Default**: `'text'` | @@ -19,7 +18,6 @@ ```json { - "id": 0, "name": "my_field", "scope": { "csv": "0", diff --git a/doc/models/create-metafields-request.md b/doc/models/create-metafields-request.md index 5b3d0042..457538b5 100644 --- a/doc/models/create-metafields-request.md +++ b/doc/models/create-metafields-request.md @@ -16,7 +16,6 @@ ```json { "metafields": { - "id": 0, "name": "my_field", "scope": { "csv": "0", diff --git a/doc/models/create-or-update-coupon.md b/doc/models/create-or-update-coupon.md index 399e9f87..dd19ca4b 100644 --- a/doc/models/create-or-update-coupon.md +++ b/doc/models/create-or-update-coupon.md @@ -22,9 +22,9 @@ "code": "code8", "description": "description0", "percentage": 11.02, - "allow_negative_balance": "allow_negative_balance8", - "recurring": "recurring4", - "end_date": "end_date0", + "allow_negative_balance": false, + "recurring": false, + "end_date": "2016-03-13T12:52:32.123Z", "product_family_id": "product_family_id6" }, "restricted_products": { diff --git a/doc/models/create-or-update-flat-amount-coupon.md b/doc/models/create-or-update-flat-amount-coupon.md index 4bc25b96..fa27725b 100644 --- a/doc/models/create-or-update-flat-amount-coupon.md +++ b/doc/models/create-or-update-flat-amount-coupon.md @@ -13,11 +13,11 @@ | `code` | `str` | Required | may contain uppercase alphanumeric characters and these special characters (which allow for email addresses to be used): “%”, “@”, “+”, “-”, “_”, and “.” | | `description` | `str` | Optional | - | | `amount_in_cents` | `long\|int` | Required | - | -| `allow_negative_balance` | `str` | Optional | - | -| `recurring` | `str` | Optional | - | -| `end_date` | `str` | Optional | - | +| `allow_negative_balance` | `bool` | Optional | - | +| `recurring` | `bool` | Optional | - | +| `end_date` | `datetime` | Optional | - | | `product_family_id` | `str` | Optional | - | -| `stackable` | `str` | Optional | - | +| `stackable` | `bool` | Optional | - | | `compounding_strategy` | [`CompoundingStrategy`](../../doc/models/compounding-strategy.md) | Optional | - | | `exclude_mid_period_allocations` | `bool` | Optional | - | | `apply_on_cancel_at_end_of_period` | `bool` | Optional | - | @@ -30,9 +30,9 @@ "code": "code8", "description": "description0", "amount_in_cents": 120, - "allow_negative_balance": "allow_negative_balance2", - "recurring": "recurring6", - "end_date": "end_date0", + "allow_negative_balance": false, + "recurring": false, + "end_date": "2016-03-13T12:52:32.123Z", "product_family_id": "product_family_id4" } ``` diff --git a/doc/models/create-or-update-percentage-coupon.md b/doc/models/create-or-update-percentage-coupon.md index 76a85f38..315c31c4 100644 --- a/doc/models/create-or-update-percentage-coupon.md +++ b/doc/models/create-or-update-percentage-coupon.md @@ -13,11 +13,11 @@ | `code` | `str` | Required | may contain uppercase alphanumeric characters and these special characters (which allow for email addresses to be used): “%”, “@”, “+”, “-”, “_”, and “.” | | `description` | `str` | Optional | - | | `percentage` | float \| str | Required | This is a container for one-of cases. | -| `allow_negative_balance` | `str` | Optional | - | -| `recurring` | `str` | Optional | - | -| `end_date` | `str` | Optional | - | +| `allow_negative_balance` | `bool` | Optional | - | +| `recurring` | `bool` | Optional | - | +| `end_date` | `datetime` | Optional | - | | `product_family_id` | `str` | Optional | - | -| `stackable` | `str` | Optional | - | +| `stackable` | `bool` | Optional | - | | `compounding_strategy` | [`CompoundingStrategy`](../../doc/models/compounding-strategy.md) | Optional | - | | `exclude_mid_period_allocations` | `bool` | Optional | - | | `apply_on_cancel_at_end_of_period` | `bool` | Optional | - | @@ -30,9 +30,9 @@ "code": "code8", "description": "description0", "percentage": 11.02, - "allow_negative_balance": "allow_negative_balance8", - "recurring": "recurring4", - "end_date": "end_date0", + "allow_negative_balance": false, + "recurring": false, + "end_date": "2016-03-13T12:52:32.123Z", "product_family_id": "product_family_id6" } ``` diff --git a/doc/models/invoice-previous-balance.md b/doc/models/invoice-previous-balance.md index 6279f310..2e2d0f0a 100644 --- a/doc/models/invoice-previous-balance.md +++ b/doc/models/invoice-previous-balance.md @@ -9,14 +9,14 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `capture_date` | `str` | Optional | - | +| `captured_at` | `datetime` | Optional | - | | `invoices` | [`List[InvoiceBalanceItem]`](../../doc/models/invoice-balance-item.md) | Optional | - | ## Example (as JSON) ```json { - "capture_date": "capture_date2", + "captured_at": "2016-03-13T12:52:32.123Z", "invoices": [ { "uid": "uid6", diff --git a/doc/models/line-item-kind.md b/doc/models/line-item-kind.md new file mode 100644 index 00000000..380d29ea --- /dev/null +++ b/doc/models/line-item-kind.md @@ -0,0 +1,24 @@ + +# Line Item Kind + +A handle for the line item kind + +## Enumeration + +`LineItemKind` + +## Fields + +| Name | +| --- | +| `BASELINE` | +| `INITIAL` | +| `TRIAL` | +| `QUANTITY_BASED_COMPONENT` | +| `PREPAID_USAGE_COMPONENT` | +| `ON_OFF_COMPONENT` | +| `METERED_COMPONENT` | +| `EVENT_BASED_COMPONENT` | +| `COUPON` | +| `TAX` | + diff --git a/doc/models/line-item-transaction-type.md b/doc/models/line-item-transaction-type.md new file mode 100644 index 00000000..f5847f6b --- /dev/null +++ b/doc/models/line-item-transaction-type.md @@ -0,0 +1,21 @@ + +# Line Item Transaction Type + +A handle for the line item transaction type + +## Enumeration + +`LineItemTransactionType` + +## Fields + +| Name | +| --- | +| `CHARGE` | +| `CREDIT` | +| `ADJUSTMENT` | +| `PAYMENT` | +| `REFUND` | +| `INFO_TRANSACTION` | +| `PAYMENT_AUTHORIZATION` | + diff --git a/doc/models/metafields.md b/doc/models/metafields.md index 5413dfd1..f68026dd 100644 --- a/doc/models/metafields.md +++ b/doc/models/metafields.md @@ -9,7 +9,6 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `id` | `int` | Optional | - | | `name` | `str` | Optional | - | | `scope` | [`MetafieldScope`](../../doc/models/metafield-scope.md) | Optional | Warning: When updating a metafield's scope attribute, all scope attributes must be passed. Partially complete scope attributes will override the existing settings. | | `input_type` | [`MetafieldInput`](../../doc/models/metafield-input.md) | Optional | Indicates how data should be added to the metafield. For example, a text type is just a string, so a given metafield of this type can have any value attached. On the other hand, dropdown and radio have a set of allowed values that can be input, and appear differently on a Public Signup Page.
**Default**: `'text'` | @@ -20,7 +19,6 @@ ```json { "input_type": "text", - "id": 188, "name": "name0", "scope": { "csv": "0", diff --git a/doc/models/offer-item.md b/doc/models/offer-item.md index 32690335..1e4e9a8c 100644 --- a/doc/models/offer-item.md +++ b/doc/models/offer-item.md @@ -17,6 +17,8 @@ | `component_name` | `str` | Optional | - | | `price_point_name` | `str` | Optional | - | | `currency_prices` | [`List[CurrencyPrice]`](../../doc/models/currency-price.md) | Optional | - | +| `interval` | `int` | Optional | The numerical interval. i.e. an interval of '30' coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | +| `interval_unit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this component price point, either month or day. This property is only available for sites with Multifrequency enabled. | ## Example (as JSON) diff --git a/doc/models/allocation-payment.md b/doc/models/payment-for-allocation.md similarity index 77% rename from doc/models/allocation-payment.md rename to doc/models/payment-for-allocation.md index b5f27799..fa2ffc31 100644 --- a/doc/models/allocation-payment.md +++ b/doc/models/payment-for-allocation.md @@ -1,11 +1,11 @@ -# Allocation Payment +# Payment for Allocation Information for captured payment, if applicable ## Structure -`AllocationPayment` +`PaymentForAllocation` ## Fields @@ -20,10 +20,10 @@ Information for captured payment, if applicable ```json { - "id": 146, - "amount_in_cents": 232, + "id": 72, + "amount_in_cents": 158, "success": false, - "memo": "memo2" + "memo": "memo6" } ``` diff --git a/doc/models/preview-allocations-request.md b/doc/models/preview-allocations-request.md index 32a0324a..f33944e1 100644 --- a/doc/models/preview-allocations-request.md +++ b/doc/models/preview-allocations-request.md @@ -10,7 +10,9 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | | `allocations` | [`List[CreateAllocation]`](../../doc/models/create-allocation.md) | Required | - | -| `effective_proration_date` | `str` | Optional | To calculate proration amounts for a future time. Only within a current subscription period. Only ISO8601 format is supported. | +| `effective_proration_date` | `date` | Optional | To calculate proration amounts for a future time. Only within a current subscription period. Only ISO8601 format is supported. | +| `upgrade_charge` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | +| `downgrade_credit` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | ## Example (as JSON) @@ -26,7 +28,9 @@ "accrue_charge": false } ], - "effective_proration_date": "2023-12-01" + "effective_proration_date": "2023-12-01", + "upgrade_charge": "none", + "downgrade_credit": "prorated" } ``` diff --git a/doc/models/renewal-preview-line-item.md b/doc/models/renewal-preview-line-item.md index e23b898d..4bad4136 100644 --- a/doc/models/renewal-preview-line-item.md +++ b/doc/models/renewal-preview-line-item.md @@ -9,8 +9,8 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `transaction_type` | `str` | Optional | - | -| `kind` | `str` | Optional | - | +| `transaction_type` | [`LineItemTransactionType`](../../doc/models/line-item-transaction-type.md) | Optional | A handle for the line item transaction type | +| `kind` | [`LineItemKind`](../../doc/models/line-item-kind.md) | Optional | A handle for the line item kind | | `amount_in_cents` | `long\|int` | Optional | - | | `memo` | `str` | Optional | - | | `discount_amount_in_cents` | `long\|int` | Optional | - | @@ -28,8 +28,8 @@ ```json { - "transaction_type": "transaction_type8", - "kind": "kind4", + "transaction_type": "charge", + "kind": "prepaid_usage_component", "amount_in_cents": 154, "memo": "memo0", "discount_amount_in_cents": 214 diff --git a/doc/models/single-error-response-error-exception.md b/doc/models/single-error-response-exception.md similarity index 63% rename from doc/models/single-error-response-error-exception.md rename to doc/models/single-error-response-exception.md index c890e381..9b38d823 100644 --- a/doc/models/single-error-response-error-exception.md +++ b/doc/models/single-error-response-exception.md @@ -1,9 +1,9 @@ -# Single Error Response Error Exception +# Single Error Response Exception ## Structure -`SingleErrorResponseErrorException` +`SingleErrorResponseException` ## Fields @@ -15,7 +15,7 @@ ```json { - "error": "error8" + "error": "error2" } ``` diff --git a/doc/models/subscription-component.md b/doc/models/subscription-component.md index 9d02c81b..bd474677 100644 --- a/doc/models/subscription-component.md +++ b/doc/models/subscription-component.md @@ -38,6 +38,8 @@ | `allow_fractional_quantities` | `bool` | Optional | - | | `subscription` | [`SubscriptionComponentSubscription`](../../doc/models/subscription-component-subscription.md) | Optional | An optional object, will be returned if provided `include=subscription` query param. | | `display_on_hosted_page` | `bool` | Optional | - | +| `interval` | `int` | Optional | The numerical interval. i.e. an interval of '30' coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | +| `interval_unit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this component price point, either month or day. This property is only available for sites with Multifrequency enabled. | ## Example (as JSON) diff --git a/doc/models/subscription-preview-response.md b/doc/models/subscription-preview-response.md index 2d81a849..cb4ea150 100644 --- a/doc/models/subscription-preview-response.md +++ b/doc/models/subscription-preview-response.md @@ -19,8 +19,8 @@ "current_billing_manifest": { "line_items": [ { - "transaction_type": "transaction_type0", - "kind": "kind6", + "transaction_type": "credit", + "kind": "component", "amount_in_cents": 24, "memo": "memo2", "discount_amount_in_cents": 172 @@ -34,22 +34,22 @@ "next_billing_manifest": { "line_items": [ { - "transaction_type": "transaction_type0", - "kind": "kind6", + "transaction_type": "credit", + "kind": "component", "amount_in_cents": 24, "memo": "memo2", "discount_amount_in_cents": 172 }, { - "transaction_type": "transaction_type0", - "kind": "kind6", + "transaction_type": "credit", + "kind": "component", "amount_in_cents": 24, "memo": "memo2", "discount_amount_in_cents": 172 }, { - "transaction_type": "transaction_type0", - "kind": "kind6", + "transaction_type": "credit", + "kind": "component", "amount_in_cents": 24, "memo": "memo2", "discount_amount_in_cents": 172 diff --git a/doc/models/subscription-preview.md b/doc/models/subscription-preview.md index 2685a8ac..0ceb3da4 100644 --- a/doc/models/subscription-preview.md +++ b/doc/models/subscription-preview.md @@ -19,8 +19,8 @@ "current_billing_manifest": { "line_items": [ { - "transaction_type": "transaction_type0", - "kind": "kind6", + "transaction_type": "credit", + "kind": "component", "amount_in_cents": 24, "memo": "memo2", "discount_amount_in_cents": 172 @@ -34,22 +34,22 @@ "next_billing_manifest": { "line_items": [ { - "transaction_type": "transaction_type0", - "kind": "kind6", + "transaction_type": "credit", + "kind": "component", "amount_in_cents": 24, "memo": "memo2", "discount_amount_in_cents": 172 }, { - "transaction_type": "transaction_type0", - "kind": "kind6", + "transaction_type": "credit", + "kind": "component", "amount_in_cents": 24, "memo": "memo2", "discount_amount_in_cents": 172 }, { - "transaction_type": "transaction_type0", - "kind": "kind6", + "transaction_type": "credit", + "kind": "component", "amount_in_cents": 24, "memo": "memo2", "discount_amount_in_cents": 172 diff --git a/doc/models/usage-response.md b/doc/models/usage-response.md index e5658ee4..6afbae64 100644 --- a/doc/models/usage-response.md +++ b/doc/models/usage-response.md @@ -18,7 +18,7 @@ "usage": { "id": 150, "memo": "memo2", - "created_at": "created_at6", + "created_at": "2016-03-13T12:52:32.123Z", "price_point_id": 28, "quantity": 28 } diff --git a/doc/models/usage.md b/doc/models/usage.md index ac4892ed..4b71b7c6 100644 --- a/doc/models/usage.md +++ b/doc/models/usage.md @@ -11,7 +11,7 @@ | --- | --- | --- | --- | | `id` | `int` | Optional | - | | `memo` | `str` | Optional | - | -| `created_at` | `str` | Optional | - | +| `created_at` | `datetime` | Optional | - | | `price_point_id` | `int` | Optional | - | | `quantity` | int \| str \| None | Optional | This is a container for one-of cases. | | `overage_quantity` | `int` | Optional | - | @@ -25,7 +25,7 @@ { "id": 252, "memo": "memo8", - "created_at": "created_at2", + "created_at": "2016-03-13T12:52:32.123Z", "price_point_id": 126, "quantity": 130 }