From 03b058d6125ca84365fe4622432a9ada74aa288f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 1 Mar 2025 20:19:17 +0000 Subject: [PATCH 1/4] chore(internal): codegen related update (#564) --- SECURITY.md | 4 ++-- src/orb/_client.py | 4 ++-- tests/api_resources/test_customers.py | 24 ++++++++++++------------ tests/test_client.py | 16 ++++++++-------- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/SECURITY.md b/SECURITY.md index b32391b3..6f64d22c 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -2,9 +2,9 @@ ## Reporting Security Issues -This SDK is generated by [Stainless Software Inc](http://stainlessapi.com). Stainless takes security seriously, and encourages you to report any security vulnerability promptly so that appropriate action can be taken. +This SDK is generated by [Stainless Software Inc](http://stainless.com). Stainless takes security seriously, and encourages you to report any security vulnerability promptly so that appropriate action can be taken. -To report a security issue, please contact the Stainless team at security@stainlessapi.com. +To report a security issue, please contact the Stainless team at security@stainless.com. ## Responsible Disclosure diff --git a/src/orb/_client.py b/src/orb/_client.py index 2a1f1497..d9737190 100644 --- a/src/orb/_client.py +++ b/src/orb/_client.py @@ -100,7 +100,7 @@ def __init__( # part of our public interface in the future. _strict_response_validation: bool = False, ) -> None: - """Construct a new synchronous orb client instance. + """Construct a new synchronous Orb client instance. This automatically infers the following arguments from their corresponding environment variables if they are not provided: - `api_key` from `ORB_API_KEY` @@ -356,7 +356,7 @@ def __init__( # part of our public interface in the future. _strict_response_validation: bool = False, ) -> None: - """Construct a new async orb client instance. + """Construct a new async AsyncOrb client instance. This automatically infers the following arguments from their corresponding environment variables if they are not provided: - `api_key` from `ORB_API_KEY` diff --git a/tests/api_resources/test_customers.py b/tests/api_resources/test_customers.py index 257fbd98..1e87e427 100644 --- a/tests/api_resources/test_customers.py +++ b/tests/api_resources/test_customers.py @@ -24,7 +24,7 @@ class TestCustomers: @parametrize def test_method_create(self, client: Orb) -> None: customer = client.customers.create( - email="dev@stainlessapi.com", + email="dev@stainless.com", name="x", ) assert_matches_type(Customer, customer, path=["response"]) @@ -32,7 +32,7 @@ def test_method_create(self, client: Orb) -> None: @parametrize def test_method_create_with_all_params(self, client: Orb) -> None: customer = client.customers.create( - email="dev@stainlessapi.com", + email="dev@stainless.com", name="x", accounting_sync_configuration={ "accounting_providers": [ @@ -89,7 +89,7 @@ def test_method_create_with_all_params(self, client: Orb) -> None: @parametrize def test_raw_response_create(self, client: Orb) -> None: response = client.customers.with_raw_response.create( - email="dev@stainlessapi.com", + email="dev@stainless.com", name="x", ) @@ -101,7 +101,7 @@ def test_raw_response_create(self, client: Orb) -> None: @parametrize def test_streaming_response_create(self, client: Orb) -> None: with client.customers.with_streaming_response.create( - email="dev@stainlessapi.com", + email="dev@stainless.com", name="x", ) as response: assert not response.is_closed @@ -143,7 +143,7 @@ def test_method_update_with_all_params(self, client: Orb) -> None: "state": "state", }, currency="currency", - email="dev@stainlessapi.com", + email="dev@stainless.com", email_delivery=True, external_customer_id="external_customer_id", hierarchy={ @@ -465,7 +465,7 @@ def test_method_update_by_external_id_with_all_params(self, client: Orb) -> None "state": "state", }, currency="currency", - email="dev@stainlessapi.com", + email="dev@stainless.com", email_delivery=True, external_customer_id="external_customer_id", hierarchy={ @@ -537,7 +537,7 @@ class TestAsyncCustomers: @parametrize async def test_method_create(self, async_client: AsyncOrb) -> None: customer = await async_client.customers.create( - email="dev@stainlessapi.com", + email="dev@stainless.com", name="x", ) assert_matches_type(Customer, customer, path=["response"]) @@ -545,7 +545,7 @@ async def test_method_create(self, async_client: AsyncOrb) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> None: customer = await async_client.customers.create( - email="dev@stainlessapi.com", + email="dev@stainless.com", name="x", accounting_sync_configuration={ "accounting_providers": [ @@ -602,7 +602,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No @parametrize async def test_raw_response_create(self, async_client: AsyncOrb) -> None: response = await async_client.customers.with_raw_response.create( - email="dev@stainlessapi.com", + email="dev@stainless.com", name="x", ) @@ -614,7 +614,7 @@ async def test_raw_response_create(self, async_client: AsyncOrb) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: async with async_client.customers.with_streaming_response.create( - email="dev@stainlessapi.com", + email="dev@stainless.com", name="x", ) as response: assert not response.is_closed @@ -656,7 +656,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncOrb) -> No "state": "state", }, currency="currency", - email="dev@stainlessapi.com", + email="dev@stainless.com", email_delivery=True, external_customer_id="external_customer_id", hierarchy={ @@ -990,7 +990,7 @@ async def test_method_update_by_external_id_with_all_params(self, async_client: "state": "state", }, currency="currency", - email="dev@stainlessapi.com", + email="dev@stainless.com", email_delivery=True, external_customer_id="external_customer_id", hierarchy={ diff --git a/tests/test_client.py b/tests/test_client.py index fbcbf29a..621ef788 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -793,7 +793,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: respx_mock.post("/customers").mock(side_effect=retry_handler) - response = client.customers.with_raw_response.create(email="dev@stainlessapi.com", name="x") + response = client.customers.with_raw_response.create(email="dev@stainless.com", name="x") assert response.retries_taken == failures_before_success assert int(response.http_request.headers.get("x-stainless-retry-count")) == failures_before_success @@ -816,7 +816,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: respx_mock.post("/customers").mock(side_effect=retry_handler) response = client.customers.with_raw_response.create( - email="dev@stainlessapi.com", name="x", extra_headers={"x-stainless-retry-count": Omit()} + email="dev@stainless.com", name="x", extra_headers={"x-stainless-retry-count": Omit()} ) assert len(response.http_request.headers.get_list("x-stainless-retry-count")) == 0 @@ -841,7 +841,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: respx_mock.post("/customers").mock(side_effect=retry_handler) response = client.customers.with_raw_response.create( - email="dev@stainlessapi.com", name="x", extra_headers={"x-stainless-retry-count": "42"} + email="dev@stainless.com", name="x", extra_headers={"x-stainless-retry-count": "42"} ) assert response.http_request.headers.get("x-stainless-retry-count") == "42" @@ -865,7 +865,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: respx_mock.post("/customers").mock(side_effect=retry_handler) - with client.customers.with_streaming_response.create(email="dev@stainlessapi.com", name="x") as response: + with client.customers.with_streaming_response.create(email="dev@stainless.com", name="x") as response: assert response.retries_taken == failures_before_success assert int(response.http_request.headers.get("x-stainless-retry-count")) == failures_before_success @@ -1626,7 +1626,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: respx_mock.post("/customers").mock(side_effect=retry_handler) - response = await client.customers.with_raw_response.create(email="dev@stainlessapi.com", name="x") + response = await client.customers.with_raw_response.create(email="dev@stainless.com", name="x") assert response.retries_taken == failures_before_success assert int(response.http_request.headers.get("x-stainless-retry-count")) == failures_before_success @@ -1652,7 +1652,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: respx_mock.post("/customers").mock(side_effect=retry_handler) response = await client.customers.with_raw_response.create( - email="dev@stainlessapi.com", name="x", extra_headers={"x-stainless-retry-count": Omit()} + email="dev@stainless.com", name="x", extra_headers={"x-stainless-retry-count": Omit()} ) assert len(response.http_request.headers.get_list("x-stainless-retry-count")) == 0 @@ -1678,7 +1678,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: respx_mock.post("/customers").mock(side_effect=retry_handler) response = await client.customers.with_raw_response.create( - email="dev@stainlessapi.com", name="x", extra_headers={"x-stainless-retry-count": "42"} + email="dev@stainless.com", name="x", extra_headers={"x-stainless-retry-count": "42"} ) assert response.http_request.headers.get("x-stainless-retry-count") == "42" @@ -1703,7 +1703,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: respx_mock.post("/customers").mock(side_effect=retry_handler) - async with client.customers.with_streaming_response.create(email="dev@stainlessapi.com", name="x") as response: + async with client.customers.with_streaming_response.create(email="dev@stainless.com", name="x") as response: assert response.retries_taken == failures_before_success assert int(response.http_request.headers.get("x-stainless-retry-count")) == failures_before_success From aa7b3cf321a322150f12014674d914f2aa4a3c1e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 3 Mar 2025 20:35:50 +0000 Subject: [PATCH 2/4] chore(internal): remove unused http client options forwarding (#566) --- src/orb/_base_client.py | 97 +---------------------------------------- 1 file changed, 1 insertion(+), 96 deletions(-) diff --git a/src/orb/_base_client.py b/src/orb/_base_client.py index 1cace52d..c6cf6500 100644 --- a/src/orb/_base_client.py +++ b/src/orb/_base_client.py @@ -9,7 +9,6 @@ import inspect import logging import platform -import warnings import email.utils from types import TracebackType from random import random @@ -36,7 +35,7 @@ import httpx import distro import pydantic -from httpx import URL, Limits +from httpx import URL from pydantic import PrivateAttr from . import _exceptions @@ -51,13 +50,10 @@ Timeout, NotGiven, ResponseT, - Transport, AnyMapping, PostParser, - ProxiesTypes, RequestFiles, HttpxSendArgs, - AsyncTransport, RequestOptions, HttpxRequestFiles, ModelBuilderProtocol, @@ -338,9 +334,6 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]): _base_url: URL max_retries: int timeout: Union[float, Timeout, None] - _limits: httpx.Limits - _proxies: ProxiesTypes | None - _transport: Transport | AsyncTransport | None _strict_response_validation: bool _idempotency_header: str | None _default_stream_cls: type[_DefaultStreamT] | None = None @@ -353,9 +346,6 @@ def __init__( _strict_response_validation: bool, max_retries: int = DEFAULT_MAX_RETRIES, timeout: float | Timeout | None = DEFAULT_TIMEOUT, - limits: httpx.Limits, - transport: Transport | AsyncTransport | None, - proxies: ProxiesTypes | None, custom_headers: Mapping[str, str] | None = None, custom_query: Mapping[str, object] | None = None, ) -> None: @@ -363,9 +353,6 @@ def __init__( self._base_url = self._enforce_trailing_slash(URL(base_url)) self.max_retries = max_retries self.timeout = timeout - self._limits = limits - self._proxies = proxies - self._transport = transport self._custom_headers = custom_headers or {} self._custom_query = custom_query or {} self._strict_response_validation = _strict_response_validation @@ -801,46 +788,11 @@ def __init__( base_url: str | URL, max_retries: int = DEFAULT_MAX_RETRIES, timeout: float | Timeout | None | NotGiven = NOT_GIVEN, - transport: Transport | None = None, - proxies: ProxiesTypes | None = None, - limits: Limits | None = None, http_client: httpx.Client | None = None, custom_headers: Mapping[str, str] | None = None, custom_query: Mapping[str, object] | None = None, _strict_response_validation: bool, ) -> None: - kwargs: dict[str, Any] = {} - if limits is not None: - warnings.warn( - "The `connection_pool_limits` argument is deprecated. The `http_client` argument should be passed instead", - category=DeprecationWarning, - stacklevel=3, - ) - if http_client is not None: - raise ValueError("The `http_client` argument is mutually exclusive with `connection_pool_limits`") - else: - limits = DEFAULT_CONNECTION_LIMITS - - if transport is not None: - kwargs["transport"] = transport - warnings.warn( - "The `transport` argument is deprecated. The `http_client` argument should be passed instead", - category=DeprecationWarning, - stacklevel=3, - ) - if http_client is not None: - raise ValueError("The `http_client` argument is mutually exclusive with `transport`") - - if proxies is not None: - kwargs["proxies"] = proxies - warnings.warn( - "The `proxies` argument is deprecated. The `http_client` argument should be passed instead", - category=DeprecationWarning, - stacklevel=3, - ) - if http_client is not None: - raise ValueError("The `http_client` argument is mutually exclusive with `proxies`") - if not is_given(timeout): # if the user passed in a custom http client with a non-default # timeout set then we use that timeout. @@ -861,12 +813,9 @@ def __init__( super().__init__( version=version, - limits=limits, # cast to a valid type because mypy doesn't understand our type narrowing timeout=cast(Timeout, timeout), - proxies=proxies, base_url=base_url, - transport=transport, max_retries=max_retries, custom_query=custom_query, custom_headers=custom_headers, @@ -876,9 +825,6 @@ def __init__( base_url=base_url, # cast to a valid type because mypy doesn't understand our type narrowing timeout=cast(Timeout, timeout), - limits=limits, - follow_redirects=True, - **kwargs, # type: ignore ) def is_closed(self) -> bool: @@ -1387,45 +1333,10 @@ def __init__( _strict_response_validation: bool, max_retries: int = DEFAULT_MAX_RETRIES, timeout: float | Timeout | None | NotGiven = NOT_GIVEN, - transport: AsyncTransport | None = None, - proxies: ProxiesTypes | None = None, - limits: Limits | None = None, http_client: httpx.AsyncClient | None = None, custom_headers: Mapping[str, str] | None = None, custom_query: Mapping[str, object] | None = None, ) -> None: - kwargs: dict[str, Any] = {} - if limits is not None: - warnings.warn( - "The `connection_pool_limits` argument is deprecated. The `http_client` argument should be passed instead", - category=DeprecationWarning, - stacklevel=3, - ) - if http_client is not None: - raise ValueError("The `http_client` argument is mutually exclusive with `connection_pool_limits`") - else: - limits = DEFAULT_CONNECTION_LIMITS - - if transport is not None: - kwargs["transport"] = transport - warnings.warn( - "The `transport` argument is deprecated. The `http_client` argument should be passed instead", - category=DeprecationWarning, - stacklevel=3, - ) - if http_client is not None: - raise ValueError("The `http_client` argument is mutually exclusive with `transport`") - - if proxies is not None: - kwargs["proxies"] = proxies - warnings.warn( - "The `proxies` argument is deprecated. The `http_client` argument should be passed instead", - category=DeprecationWarning, - stacklevel=3, - ) - if http_client is not None: - raise ValueError("The `http_client` argument is mutually exclusive with `proxies`") - if not is_given(timeout): # if the user passed in a custom http client with a non-default # timeout set then we use that timeout. @@ -1447,11 +1358,8 @@ def __init__( super().__init__( version=version, base_url=base_url, - limits=limits, # cast to a valid type because mypy doesn't understand our type narrowing timeout=cast(Timeout, timeout), - proxies=proxies, - transport=transport, max_retries=max_retries, custom_query=custom_query, custom_headers=custom_headers, @@ -1461,9 +1369,6 @@ def __init__( base_url=base_url, # cast to a valid type because mypy doesn't understand our type narrowing timeout=cast(Timeout, timeout), - limits=limits, - follow_redirects=True, - **kwargs, # type: ignore ) def is_closed(self) -> bool: From 247a81c8582c9aebb0787789426b1454d16f1134 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 5 Mar 2025 02:51:07 +0000 Subject: [PATCH 3/4] feat(api): api update (#567) --- .stats.yml | 2 +- README.md | 12 +- api.md | 341 +- src/orb/resources/alerts.py | 87 +- src/orb/resources/coupons/coupons.py | 38 +- src/orb/resources/coupons/subscriptions.py | 14 +- src/orb/resources/credit_notes.py | 30 +- .../customers/balance_transactions.py | 23 +- src/orb/resources/customers/costs.py | 19 +- .../resources/customers/credits/credits.py | 27 +- src/orb/resources/customers/credits/ledger.py | 99 +- .../resources/customers/credits/top_ups.py | 45 +- src/orb/resources/customers/customers.py | 152 +- .../dimensional_price_groups.py | 30 +- .../external_dimensional_price_group_id.py | 10 +- src/orb/resources/events/backfills.py | 50 +- src/orb/resources/invoice_line_items.py | 10 +- src/orb/resources/invoices.py | 70 +- src/orb/resources/items.py | 43 +- src/orb/resources/metrics.py | 38 +- src/orb/resources/plans/external_plan_id.py | 18 +- src/orb/resources/plans/plans.py | 38 +- src/orb/resources/prices/external_price_id.py | 26 +- src/orb/resources/prices/prices.py | 918 ++-- src/orb/resources/subscriptions.py | 204 +- src/orb/types/__init__.py | 134 +- .../types/alert_create_for_customer_params.py | 15 +- ...ert_create_for_external_customer_params.py | 15 +- .../alert_create_for_subscription_params.py | 15 +- src/orb/types/alert_update_params.py | 15 +- src/orb/types/customer_create_params.py | 277 +- .../customer_update_by_external_id_params.py | 277 +- src/orb/types/customer_update_params.py | 277 +- src/orb/types/customers/__init__.py | 6 - .../balance_transaction_create_response.py | 63 - .../cost_list_by_external_id_response.py | 44 - .../credit_list_by_external_id_response.py | 25 - src/orb/types/customers/credits/__init__.py | 10 - ...er_create_entry_by_external_id_response.py | 401 -- .../credits/ledger_create_entry_response.py | 401 -- .../ledger_list_by_external_id_response.py | 401 -- .../credits/top_up_create_response.py | 67 - .../top_up_list_by_external_id_response.py | 67 - .../dimensional_price_groups.py | 4 +- src/orb/types/events/__init__.py | 5 - .../types/events/backfill_close_response.py | 54 - .../types/events/backfill_create_response.py | 54 - .../types/events/backfill_fetch_response.py | 54 - .../types/events/backfill_revert_response.py | 54 - src/orb/types/invoice_create_params.py | 10 +- .../types/invoice_fetch_upcoming_response.py | 781 +--- src/orb/types/item.py | 25 - src/orb/types/item_update_params.py | 16 +- src/orb/types/plan.py | 370 -- src/orb/types/plan_create_params.py | 744 +-- src/orb/types/price.py | 3597 -------------- src/orb/types/price_create_params.py | 845 +--- src/orb/types/shared/__init__.py | 115 + .../shared/add_credit_ledger_entry_request.py | 258 + .../add_credit_top_up_request.py} | 15 +- .../add_subscription_adjustment_params.py | 32 + .../shared/add_subscription_price_params.py | 60 + src/orb/types/shared/address_input_model.py | 21 + src/orb/types/shared/address_model.py | 21 + .../types/shared/adjustment_interval_model.py | 24 + src/orb/types/shared/adjustment_model.py | 166 + src/orb/types/shared/affected_block_model.py | 16 + .../aggregated_cost_model.py} | 16 +- .../types/{alert.py => shared/alert_model.py} | 34 +- src/orb/types/shared/allocation_model.py | 12 + .../shared/amount_discount_interval_model.py | 28 + src/orb/types/shared/amount_discount_model.py | 23 + src/orb/types/shared/auto_collection_model.py | 33 + .../backfill_model.py} | 4 +- .../billable_metric_model.py} | 10 +- .../shared/billable_metric_simple_model.py | 12 + .../shared/billable_metric_tiny_model.py | 10 + ...illing_cycle_anchor_configuration_model.py | 31 + .../billing_cycle_configuration_model.py | 13 + src/orb/types/shared/bps_config_model.py | 15 + src/orb/types/shared/bulk_bps_config_model.py | 26 + src/orb/types/shared/bulk_config_model.py | 20 + .../{coupon.py => shared/coupon_model.py} | 12 +- .../types/shared/coupon_redemption_model.py | 16 + .../shared/create_customer_alert_request.py | 26 + .../shared/credit_ledger_entries_model.py | 15 + .../credit_ledger_entry_model.py} | 150 +- .../shared/credit_note_discount_model.py | 26 + .../credit_note_model.py} | 80 +- .../types/shared/credit_note_summary_model.py | 29 + .../custom_rating_function_config_model.py | 8 + .../customer_balance_transaction_model.py} | 4 +- src/orb/types/shared/customer_costs_model.py | 12 + .../customer_credit_balances_model.py} | 13 +- .../shared/customer_hierarchy_config_model.py | 21 + .../types/shared/customer_minified_model.py | 13 + .../{customer.py => shared/customer_model.py} | 225 +- src/orb/types/shared/customer_tax_id_model.py | 166 + .../dimensional_price_configuration_model.py | 13 + .../dimensional_price_group_model.py} | 6 +- src/orb/types/shared/discount_model.py | 35 + .../types/shared/discount_override_model.py | 27 + src/orb/types/shared/edit_customer_model.py | 196 + src/orb/types/shared/edit_plan_model.py | 23 + ...fixed_fee_quantity_schedule_entry_model.py | 18 + .../shared/invoice_level_discount_model.py | 15 + .../invoice_line_item_model.py} | 90 +- .../{invoice.py => shared/invoice_model.py} | 795 +--- .../shared/item_external_connection_model.py | 13 + src/orb/types/shared/item_model.py | 19 + src/orb/types/shared/item_slim_model.py | 12 + src/orb/types/shared/matrix_config_model.py | 19 + src/orb/types/shared/matrix_value_model.py | 19 + .../matrix_with_allocation_config_model.py | 22 + .../types/shared/maximum_interval_model.py | 28 + src/orb/types/shared/maximum_model.py | 18 + .../types/shared/minimum_interval_model.py | 28 + src/orb/types/shared/minimum_model.py | 18 + .../shared/mutated_subscription_model.py | 154 + ...new_accounting_sync_configuration_model.py | 19 + src/orb/types/shared/new_adjustment_model.py | 100 + .../shared/new_allocation_price_model.py | 27 + .../new_billing_cycle_configuration_model.py | 15 + .../types/shared/new_floating_price_model.py | 1879 ++++++++ .../new_reporting_configuration_model.py | 10 + .../shared/new_subscription_price_model.py | 1905 ++++++++ .../shared/new_tax_configuration_model.py | 28 + src/orb/types/shared/package_config_model.py | 18 + .../types/shared/pagination_metadata_model.py | 13 + src/orb/types/shared/payment_attempt_model.py | 29 + .../percentage_discount_interval_model.py | 31 + .../types/shared/percentage_discount_model.py | 26 + src/orb/types/shared/plan_minified_model.py | 20 + src/orb/types/shared/plan_model.py | 150 + ...val_fixed_fee_quantity_transition_model.py | 15 + src/orb/types/shared/price_interval_model.py | 80 + src/orb/types/shared/price_model.py | 1663 +++++++ .../remove_subscription_adjustment_params.py | 11 + .../remove_subscription_price_params.py | 15 + .../replace_subscription_adjustment_params.py | 15 + .../replace_subscription_price_params.py | 48 + .../shared/sub_line_item_grouping_model.py | 14 + .../shared/subscription_minified_model.py | 10 + src/orb/types/shared/subscription_model.py | 154 + .../shared/subscription_trial_info_model.py | 12 + src/orb/types/shared/subscriptions_model.py | 15 + src/orb/types/shared/tax_amount_model.py | 18 + src/orb/types/shared/threshold_model.py | 15 + .../types/shared/tiered_bps_config_model.py | 29 + src/orb/types/shared/tiered_config_model.py | 23 + .../top_up_model.py} | 6 +- src/orb/types/shared/top_ups_model.py | 15 + src/orb/types/shared/trial_discount_model.py | 26 + src/orb/types/shared/unit_config_model.py | 11 + .../shared/update_price_request_params.py | 16 + .../shared/usage_discount_interval_model.py | 31 + src/orb/types/shared/usage_model.py | 15 + src/orb/types/shared_params/__init__.py | 46 + .../add_credit_ledger_entry_request.py | 256 + .../add_subscription_adjustment_params.py | 35 + .../add_subscription_price_params.py | 63 + .../shared_params/address_input_model.py | 22 + ...illing_cycle_anchor_configuration_model.py | 32 + .../types/shared_params/bps_config_model.py | 16 + .../shared_params/bulk_bps_config_model.py | 27 + .../types/shared_params/bulk_config_model.py | 21 + .../custom_rating_function_config_model.py | 10 + .../customer_hierarchy_config_model.py | 22 + .../shared_params/customer_tax_id_model.py | 170 + .../shared_params/discount_override_model.py | 27 + .../item_external_connection_model.py | 15 + .../shared_params/matrix_config_model.py | 21 + .../types/shared_params/matrix_value_model.py | 20 + .../matrix_with_allocation_config_model.py | 24 + ...new_accounting_sync_configuration_model.py | 20 + .../shared_params/new_adjustment_model.py | 98 + .../new_allocation_price_model.py | 27 + .../new_billing_cycle_configuration_model.py | 15 + .../shared_params/new_floating_price_model.py | 1874 ++++++++ .../new_reporting_configuration_model.py | 11 + .../new_subscription_price_model.py | 1900 ++++++++ .../new_tax_configuration_model.py | 25 + .../shared_params/package_config_model.py | 19 + ...val_fixed_fee_quantity_transition_model.py | 19 + .../remove_subscription_adjustment_params.py | 12 + .../remove_subscription_price_params.py | 16 + .../replace_subscription_adjustment_params.py | 17 + .../replace_subscription_price_params.py | 50 + .../types/shared_params/threshold_model.py | 16 + .../shared_params/tiered_bps_config_model.py | 30 + .../shared_params/tiered_config_model.py | 24 + .../types/shared_params/unit_config_model.py | 12 + src/orb/types/subscription.py | 555 --- src/orb/types/subscription_cancel_response.py | 555 --- src/orb/types/subscription_create_params.py | 4137 +--------------- src/orb/types/subscription_create_response.py | 555 --- .../subscription_fetch_costs_response.py | 40 +- .../subscription_fetch_schedule_response.py | 18 +- .../subscription_price_intervals_params.py | 2714 +---------- .../subscription_price_intervals_response.py | 555 --- ...ubscription_schedule_plan_change_params.py | 4139 +---------------- ...scription_schedule_plan_change_response.py | 555 --- .../subscription_trigger_phase_response.py | 555 --- ...iption_unschedule_cancellation_response.py | 555 --- ...ule_fixed_fee_quantity_updates_response.py | 555 --- ...nschedule_pending_plan_changes_response.py | 555 --- ...tion_update_fixed_fee_quantity_response.py | 555 --- .../subscription_update_trial_response.py | 555 --- src/orb/types/subscription_usage.py | 43 +- src/orb/types/subscriptions.py | 4 +- .../coupons/test_subscriptions.py | 18 +- .../customers/credits/test_ledger.py | 199 +- .../customers/credits/test_top_ups.py | 71 +- .../customers/test_balance_transactions.py | 37 +- tests/api_resources/customers/test_costs.py | 37 +- tests/api_resources/customers/test_credits.py | 37 +- ...est_external_dimensional_price_group_id.py | 14 +- tests/api_resources/events/test_backfills.py | 76 +- .../plans/test_external_plan_id.py | 30 +- .../prices/test_external_price_id.py | 30 +- tests/api_resources/test_alerts.py | 124 +- tests/api_resources/test_coupons.py | 58 +- tests/api_resources/test_credit_notes.py | 46 +- tests/api_resources/test_customers.py | 92 +- .../test_dimensional_price_groups.py | 46 +- .../api_resources/test_invoice_line_items.py | 14 +- tests/api_resources/test_invoices.py | 118 +- tests/api_resources/test_items.py | 58 +- tests/api_resources/test_metrics.py | 62 +- tests/api_resources/test_plans.py | 62 +- tests/api_resources/test_prices.py | 494 +- tests/api_resources/test_subscriptions.py | 204 +- 232 files changed, 16068 insertions(+), 29464 deletions(-) delete mode 100644 src/orb/types/customers/balance_transaction_create_response.py delete mode 100644 src/orb/types/customers/cost_list_by_external_id_response.py delete mode 100644 src/orb/types/customers/credit_list_by_external_id_response.py delete mode 100644 src/orb/types/customers/credits/ledger_create_entry_by_external_id_response.py delete mode 100644 src/orb/types/customers/credits/ledger_create_entry_response.py delete mode 100644 src/orb/types/customers/credits/ledger_list_by_external_id_response.py delete mode 100644 src/orb/types/customers/credits/top_up_create_response.py delete mode 100644 src/orb/types/customers/credits/top_up_list_by_external_id_response.py delete mode 100644 src/orb/types/events/backfill_close_response.py delete mode 100644 src/orb/types/events/backfill_create_response.py delete mode 100644 src/orb/types/events/backfill_fetch_response.py delete mode 100644 src/orb/types/events/backfill_revert_response.py delete mode 100644 src/orb/types/item.py delete mode 100644 src/orb/types/plan.py delete mode 100644 src/orb/types/price.py create mode 100644 src/orb/types/shared/add_credit_ledger_entry_request.py rename src/orb/types/{customers/credits/top_up_create_by_external_id_response.py => shared/add_credit_top_up_request.py} (84%) create mode 100644 src/orb/types/shared/add_subscription_adjustment_params.py create mode 100644 src/orb/types/shared/add_subscription_price_params.py create mode 100644 src/orb/types/shared/address_input_model.py create mode 100644 src/orb/types/shared/address_model.py create mode 100644 src/orb/types/shared/adjustment_interval_model.py create mode 100644 src/orb/types/shared/adjustment_model.py create mode 100644 src/orb/types/shared/affected_block_model.py rename src/orb/types/{customers/cost_list_response.py => shared/aggregated_cost_model.py} (76%) rename src/orb/types/{alert.py => shared/alert_model.py} (70%) create mode 100644 src/orb/types/shared/allocation_model.py create mode 100644 src/orb/types/shared/amount_discount_interval_model.py create mode 100644 src/orb/types/shared/amount_discount_model.py create mode 100644 src/orb/types/shared/auto_collection_model.py rename src/orb/types/{events/backfill_list_response.py => shared/backfill_model.py} (95%) rename src/orb/types/{billable_metric.py => shared/billable_metric_model.py} (83%) create mode 100644 src/orb/types/shared/billable_metric_simple_model.py create mode 100644 src/orb/types/shared/billable_metric_tiny_model.py create mode 100644 src/orb/types/shared/billing_cycle_anchor_configuration_model.py create mode 100644 src/orb/types/shared/billing_cycle_configuration_model.py create mode 100644 src/orb/types/shared/bps_config_model.py create mode 100644 src/orb/types/shared/bulk_bps_config_model.py create mode 100644 src/orb/types/shared/bulk_config_model.py rename src/orb/types/{coupon.py => shared/coupon_model.py} (83%) create mode 100644 src/orb/types/shared/coupon_redemption_model.py create mode 100644 src/orb/types/shared/create_customer_alert_request.py create mode 100644 src/orb/types/shared/credit_ledger_entries_model.py rename src/orb/types/{customers/credits/ledger_list_response.py => shared/credit_ledger_entry_model.py} (63%) create mode 100644 src/orb/types/shared/credit_note_discount_model.py rename src/orb/types/{credit_note.py => shared/credit_note_model.py} (61%) create mode 100644 src/orb/types/shared/credit_note_summary_model.py create mode 100644 src/orb/types/shared/custom_rating_function_config_model.py rename src/orb/types/{customers/balance_transaction_list_response.py => shared/customer_balance_transaction_model.py} (92%) create mode 100644 src/orb/types/shared/customer_costs_model.py rename src/orb/types/{customers/credit_list_response.py => shared/customer_credit_balances_model.py} (63%) create mode 100644 src/orb/types/shared/customer_hierarchy_config_model.py create mode 100644 src/orb/types/shared/customer_minified_model.py rename src/orb/types/{customer.py => shared/customer_model.py} (83%) create mode 100644 src/orb/types/shared/customer_tax_id_model.py create mode 100644 src/orb/types/shared/dimensional_price_configuration_model.py rename src/orb/types/{dimensional_price_group.py => shared/dimensional_price_group_model.py} (88%) create mode 100644 src/orb/types/shared/discount_model.py create mode 100644 src/orb/types/shared/discount_override_model.py create mode 100644 src/orb/types/shared/edit_customer_model.py create mode 100644 src/orb/types/shared/edit_plan_model.py create mode 100644 src/orb/types/shared/fixed_fee_quantity_schedule_entry_model.py create mode 100644 src/orb/types/shared/invoice_level_discount_model.py rename src/orb/types/{invoice_line_item_create_response.py => shared/invoice_line_item_model.py} (80%) rename src/orb/types/{invoice.py => shared/invoice_model.py} (51%) create mode 100644 src/orb/types/shared/item_external_connection_model.py create mode 100644 src/orb/types/shared/item_model.py create mode 100644 src/orb/types/shared/item_slim_model.py create mode 100644 src/orb/types/shared/matrix_config_model.py create mode 100644 src/orb/types/shared/matrix_value_model.py create mode 100644 src/orb/types/shared/matrix_with_allocation_config_model.py create mode 100644 src/orb/types/shared/maximum_interval_model.py create mode 100644 src/orb/types/shared/maximum_model.py create mode 100644 src/orb/types/shared/minimum_interval_model.py create mode 100644 src/orb/types/shared/minimum_model.py create mode 100644 src/orb/types/shared/mutated_subscription_model.py create mode 100644 src/orb/types/shared/new_accounting_sync_configuration_model.py create mode 100644 src/orb/types/shared/new_adjustment_model.py create mode 100644 src/orb/types/shared/new_allocation_price_model.py create mode 100644 src/orb/types/shared/new_billing_cycle_configuration_model.py create mode 100644 src/orb/types/shared/new_floating_price_model.py create mode 100644 src/orb/types/shared/new_reporting_configuration_model.py create mode 100644 src/orb/types/shared/new_subscription_price_model.py create mode 100644 src/orb/types/shared/new_tax_configuration_model.py create mode 100644 src/orb/types/shared/package_config_model.py create mode 100644 src/orb/types/shared/pagination_metadata_model.py create mode 100644 src/orb/types/shared/payment_attempt_model.py create mode 100644 src/orb/types/shared/percentage_discount_interval_model.py create mode 100644 src/orb/types/shared/percentage_discount_model.py create mode 100644 src/orb/types/shared/plan_minified_model.py create mode 100644 src/orb/types/shared/plan_model.py create mode 100644 src/orb/types/shared/price_interval_fixed_fee_quantity_transition_model.py create mode 100644 src/orb/types/shared/price_interval_model.py create mode 100644 src/orb/types/shared/price_model.py create mode 100644 src/orb/types/shared/remove_subscription_adjustment_params.py create mode 100644 src/orb/types/shared/remove_subscription_price_params.py create mode 100644 src/orb/types/shared/replace_subscription_adjustment_params.py create mode 100644 src/orb/types/shared/replace_subscription_price_params.py create mode 100644 src/orb/types/shared/sub_line_item_grouping_model.py create mode 100644 src/orb/types/shared/subscription_minified_model.py create mode 100644 src/orb/types/shared/subscription_model.py create mode 100644 src/orb/types/shared/subscription_trial_info_model.py create mode 100644 src/orb/types/shared/subscriptions_model.py create mode 100644 src/orb/types/shared/tax_amount_model.py create mode 100644 src/orb/types/shared/threshold_model.py create mode 100644 src/orb/types/shared/tiered_bps_config_model.py create mode 100644 src/orb/types/shared/tiered_config_model.py rename src/orb/types/{customers/credits/top_up_list_response.py => shared/top_up_model.py} (93%) create mode 100644 src/orb/types/shared/top_ups_model.py create mode 100644 src/orb/types/shared/trial_discount_model.py create mode 100644 src/orb/types/shared/unit_config_model.py create mode 100644 src/orb/types/shared/update_price_request_params.py create mode 100644 src/orb/types/shared/usage_discount_interval_model.py create mode 100644 src/orb/types/shared/usage_model.py create mode 100644 src/orb/types/shared_params/add_credit_ledger_entry_request.py create mode 100644 src/orb/types/shared_params/add_subscription_adjustment_params.py create mode 100644 src/orb/types/shared_params/add_subscription_price_params.py create mode 100644 src/orb/types/shared_params/address_input_model.py create mode 100644 src/orb/types/shared_params/billing_cycle_anchor_configuration_model.py create mode 100644 src/orb/types/shared_params/bps_config_model.py create mode 100644 src/orb/types/shared_params/bulk_bps_config_model.py create mode 100644 src/orb/types/shared_params/bulk_config_model.py create mode 100644 src/orb/types/shared_params/custom_rating_function_config_model.py create mode 100644 src/orb/types/shared_params/customer_hierarchy_config_model.py create mode 100644 src/orb/types/shared_params/customer_tax_id_model.py create mode 100644 src/orb/types/shared_params/discount_override_model.py create mode 100644 src/orb/types/shared_params/item_external_connection_model.py create mode 100644 src/orb/types/shared_params/matrix_config_model.py create mode 100644 src/orb/types/shared_params/matrix_value_model.py create mode 100644 src/orb/types/shared_params/matrix_with_allocation_config_model.py create mode 100644 src/orb/types/shared_params/new_accounting_sync_configuration_model.py create mode 100644 src/orb/types/shared_params/new_adjustment_model.py create mode 100644 src/orb/types/shared_params/new_allocation_price_model.py create mode 100644 src/orb/types/shared_params/new_billing_cycle_configuration_model.py create mode 100644 src/orb/types/shared_params/new_floating_price_model.py create mode 100644 src/orb/types/shared_params/new_reporting_configuration_model.py create mode 100644 src/orb/types/shared_params/new_subscription_price_model.py create mode 100644 src/orb/types/shared_params/new_tax_configuration_model.py create mode 100644 src/orb/types/shared_params/package_config_model.py create mode 100644 src/orb/types/shared_params/price_interval_fixed_fee_quantity_transition_model.py create mode 100644 src/orb/types/shared_params/remove_subscription_adjustment_params.py create mode 100644 src/orb/types/shared_params/remove_subscription_price_params.py create mode 100644 src/orb/types/shared_params/replace_subscription_adjustment_params.py create mode 100644 src/orb/types/shared_params/replace_subscription_price_params.py create mode 100644 src/orb/types/shared_params/threshold_model.py create mode 100644 src/orb/types/shared_params/tiered_bps_config_model.py create mode 100644 src/orb/types/shared_params/tiered_config_model.py create mode 100644 src/orb/types/shared_params/unit_config_model.py delete mode 100644 src/orb/types/subscription.py delete mode 100644 src/orb/types/subscription_cancel_response.py delete mode 100644 src/orb/types/subscription_create_response.py delete mode 100644 src/orb/types/subscription_price_intervals_response.py delete mode 100644 src/orb/types/subscription_schedule_plan_change_response.py delete mode 100644 src/orb/types/subscription_trigger_phase_response.py delete mode 100644 src/orb/types/subscription_unschedule_cancellation_response.py delete mode 100644 src/orb/types/subscription_unschedule_fixed_fee_quantity_updates_response.py delete mode 100644 src/orb/types/subscription_unschedule_pending_plan_changes_response.py delete mode 100644 src/orb/types/subscription_update_fixed_fee_quantity_response.py delete mode 100644 src/orb/types/subscription_update_trial_response.py diff --git a/.stats.yml b/.stats.yml index 5776427f..715ea230 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 103 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-c8fc7d0bf70bf7ed91a141f346a02929e4d25a6fac7b59f58b68136ed6ff024f.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-48084a007f009b4358484f09a3a7b74a990c402669f9d15adfbb60e4f835f951.yml diff --git a/README.md b/README.md index b141afdf..cade6566 100644 --- a/README.md +++ b/README.md @@ -29,11 +29,11 @@ client = Orb( api_key=os.environ.get("ORB_API_KEY"), # This is the default and can be omitted ) -customer = client.customers.create( +customer_model = client.customers.create( email="example-customer@withorb.com", name="My Customer", ) -print(customer.id) +print(customer_model.id) ``` While you can provide an `api_key` keyword argument, @@ -56,11 +56,11 @@ client = AsyncOrb( async def main() -> None: - customer = await client.customers.create( + customer_model = await client.customers.create( email="example-customer@withorb.com", name="My Customer", ) - print(customer.id) + print(customer_model.id) asyncio.run(main()) @@ -151,7 +151,7 @@ from orb import Orb client = Orb() -customer = client.customers.create( +customer_model = client.customers.create( email="example-customer@withorb.com", name="My Customer", billing_address={ @@ -160,7 +160,7 @@ customer = client.customers.create( "line1": "123 Example Street", }, ) -print(customer.id) +print(customer_model.id) ``` ## Webhook Verification diff --git a/api.md b/api.md index be3ecaf3..cad1623b 100644 --- a/api.md +++ b/api.md @@ -2,13 +2,112 @@ ```python from orb.types import ( + AddCreditLedgerEntryRequest, + AddCreditTopUpRequest, + AddSubscriptionAdjustmentParams, + AddSubscriptionPriceParams, + AddressInputModel, + AddressModel, + AdjustmentIntervalModel, + AdjustmentModel, + AffectedBlockModel, + AggregatedCostModel, + AlertModel, + AllocationModel, AmountDiscount, + AmountDiscountIntervalModel, + AmountDiscountModel, + AutoCollectionModel, + BackfillModel, + BillableMetricModel, + BillableMetricSimpleModel, + BillableMetricTinyModel, + BillingCycleAnchorConfigurationModel, + BillingCycleConfigurationModel, BillingCycleRelativeDate, + BpsConfigModel, + BulkBpsConfigModel, + BulkConfigModel, + CouponModel, + CouponRedemptionModel, + CreateCustomerAlertRequest, + CreditLedgerEntriesModel, + CreditLedgerEntryModel, + CreditNoteDiscountModel, + CreditNoteModel, + CreditNoteSummaryModel, + CustomRatingFunctionConfigModel, + CustomerBalanceTransactionModel, + CustomerCostsModel, + CustomerCreditBalancesModel, + CustomerHierarchyConfigModel, + CustomerMinifiedModel, + CustomerModel, + CustomerTaxIDModel, + DimensionalPriceConfigurationModel, + DimensionalPriceGroupModel, Discount, + DiscountModel, + DiscountOverrideModel, + EditCustomerModel, + EditPlanModel, + FixedFeeQuantityScheduleEntryModel, InvoiceLevelDiscount, + InvoiceLevelDiscountModel, + InvoiceLineItemModel, + InvoiceModel, + ItemExternalConnectionModel, + ItemModel, + ItemSlimModel, + MatrixConfigModel, + MatrixValueModel, + MatrixWithAllocationConfigModel, + MaximumIntervalModel, + MaximumModel, + MinimumIntervalModel, + MinimumModel, + MutatedSubscriptionModel, + NewAccountingSyncConfigurationModel, + NewAdjustmentModel, + NewAllocationPriceModel, + NewBillingCycleConfigurationModel, + NewFloatingPriceModel, + NewReportingConfigurationModel, + NewSubscriptionPriceModel, + NewTaxConfigurationModel, + PackageConfigModel, PaginationMetadata, + PaginationMetadataModel, + PaymentAttemptModel, PercentageDiscount, + PercentageDiscountIntervalModel, + PercentageDiscountModel, + PlanMinifiedModel, + PlanModel, + PriceIntervalFixedFeeQuantityTransitionModel, + PriceIntervalModel, + PriceModel, + RemoveSubscriptionAdjustmentParams, + RemoveSubscriptionPriceParams, + ReplaceSubscriptionAdjustmentParams, + ReplaceSubscriptionPriceParams, + SubLineItemGroupingModel, + SubscriptionMinifiedModel, + SubscriptionModel, + SubscriptionTrialInfoModel, + SubscriptionsModel, + TaxAmountModel, + ThresholdModel, + TieredBpsConfigModel, + TieredConfigModel, + TopUpModel, + TopUpsModel, TrialDiscount, + TrialDiscountModel, + UnitConfigModel, + UpdatePriceRequestParams, + UsageDiscountIntervalModel, + UsageModel, ) ``` @@ -34,16 +133,16 @@ from orb.types import Coupon Methods: -- client.coupons.create(\*\*params) -> Coupon -- client.coupons.list(\*\*params) -> SyncPage[Coupon] -- client.coupons.archive(coupon_id) -> Coupon -- client.coupons.fetch(coupon_id) -> Coupon +- client.coupons.create(\*\*params) -> CouponModel +- client.coupons.list(\*\*params) -> SyncPage[CouponModel] +- client.coupons.archive(coupon_id) -> CouponModel +- client.coupons.fetch(coupon_id) -> CouponModel ## Subscriptions Methods: -- client.coupons.subscriptions.list(coupon_id, \*\*params) -> SyncPage[Subscription] +- client.coupons.subscriptions.list(coupon_id, \*\*params) -> SyncPage[SubscriptionModel] # CreditNotes @@ -55,9 +154,9 @@ from orb.types import CreditNote Methods: -- client.credit_notes.create(\*\*params) -> CreditNote -- client.credit_notes.list(\*\*params) -> SyncPage[CreditNote] -- client.credit_notes.fetch(credit_note_id) -> CreditNote +- client.credit_notes.create(\*\*params) -> CreditNoteModel +- client.credit_notes.list(\*\*params) -> SyncPage[CreditNoteModel] +- client.credit_notes.fetch(credit_note_id) -> CreditNoteModel # Customers @@ -69,96 +168,56 @@ from orb.types import Customer Methods: -- client.customers.create(\*\*params) -> Customer -- client.customers.update(customer_id, \*\*params) -> Customer -- client.customers.list(\*\*params) -> SyncPage[Customer] +- client.customers.create(\*\*params) -> CustomerModel +- client.customers.update(customer_id, \*\*params) -> CustomerModel +- client.customers.list(\*\*params) -> SyncPage[CustomerModel] - client.customers.delete(customer_id) -> None -- client.customers.fetch(customer_id) -> Customer -- client.customers.fetch_by_external_id(external_customer_id) -> Customer +- client.customers.fetch(customer_id) -> CustomerModel +- client.customers.fetch_by_external_id(external_customer_id) -> CustomerModel - client.customers.sync_payment_methods_from_gateway(external_customer_id) -> None - client.customers.sync_payment_methods_from_gateway_by_external_customer_id(customer_id) -> None -- client.customers.update_by_external_id(id, \*\*params) -> Customer +- client.customers.update_by_external_id(id, \*\*params) -> CustomerModel ## Costs -Types: - -```python -from orb.types.customers import CostListResponse, CostListByExternalIDResponse -``` - Methods: -- client.customers.costs.list(customer_id, \*\*params) -> CostListResponse -- client.customers.costs.list_by_external_id(external_customer_id, \*\*params) -> CostListByExternalIDResponse +- client.customers.costs.list(customer_id, \*\*params) -> CustomerCostsModel +- client.customers.costs.list_by_external_id(external_customer_id, \*\*params) -> CustomerCostsModel ## Credits -Types: - -```python -from orb.types.customers import CreditListResponse, CreditListByExternalIDResponse -``` - Methods: -- client.customers.credits.list(customer_id, \*\*params) -> SyncPage[CreditListResponse] -- client.customers.credits.list_by_external_id(external_customer_id, \*\*params) -> SyncPage[CreditListByExternalIDResponse] +- client.customers.credits.list(customer_id, \*\*params) -> SyncPage[Data] +- client.customers.credits.list_by_external_id(external_customer_id, \*\*params) -> SyncPage[Data] ### Ledger -Types: - -```python -from orb.types.customers.credits import ( - LedgerListResponse, - LedgerCreateEntryResponse, - LedgerCreateEntryByExternalIDResponse, - LedgerListByExternalIDResponse, -) -``` - Methods: -- client.customers.credits.ledger.list(customer_id, \*\*params) -> SyncPage[LedgerListResponse] -- client.customers.credits.ledger.create_entry(customer_id, \*\*params) -> LedgerCreateEntryResponse -- client.customers.credits.ledger.create_entry_by_external_id(external_customer_id, \*\*params) -> LedgerCreateEntryByExternalIDResponse -- client.customers.credits.ledger.list_by_external_id(external_customer_id, \*\*params) -> SyncPage[LedgerListByExternalIDResponse] +- client.customers.credits.ledger.list(customer_id, \*\*params) -> SyncPage[CreditLedgerEntryModel] +- client.customers.credits.ledger.create_entry(customer_id, \*\*params) -> CreditLedgerEntryModel +- client.customers.credits.ledger.create_entry_by_external_id(external_customer_id, \*\*params) -> CreditLedgerEntryModel +- client.customers.credits.ledger.list_by_external_id(external_customer_id, \*\*params) -> SyncPage[CreditLedgerEntryModel] ### TopUps -Types: - -```python -from orb.types.customers.credits import ( - TopUpCreateResponse, - TopUpListResponse, - TopUpCreateByExternalIDResponse, - TopUpListByExternalIDResponse, -) -``` - Methods: -- client.customers.credits.top_ups.create(customer_id, \*\*params) -> TopUpCreateResponse -- client.customers.credits.top_ups.list(customer_id, \*\*params) -> SyncPage[TopUpListResponse] +- client.customers.credits.top_ups.create(customer_id, \*\*params) -> TopUpModel +- client.customers.credits.top_ups.list(customer_id, \*\*params) -> SyncPage[TopUpModel] - client.customers.credits.top_ups.delete(top_up_id, \*, customer_id) -> None -- client.customers.credits.top_ups.create_by_external_id(external_customer_id, \*\*params) -> TopUpCreateByExternalIDResponse +- client.customers.credits.top_ups.create_by_external_id(external_customer_id, \*\*params) -> TopUpModel - client.customers.credits.top_ups.delete_by_external_id(top_up_id, \*, external_customer_id) -> None -- client.customers.credits.top_ups.list_by_external_id(external_customer_id, \*\*params) -> SyncPage[TopUpListByExternalIDResponse] +- client.customers.credits.top_ups.list_by_external_id(external_customer_id, \*\*params) -> SyncPage[TopUpModel] ## BalanceTransactions -Types: - -```python -from orb.types.customers import BalanceTransactionCreateResponse, BalanceTransactionListResponse -``` - Methods: -- client.customers.balance_transactions.create(customer_id, \*\*params) -> BalanceTransactionCreateResponse -- client.customers.balance_transactions.list(customer_id, \*\*params) -> SyncPage[BalanceTransactionListResponse] +- client.customers.balance_transactions.create(customer_id, \*\*params) -> CustomerBalanceTransactionModel +- client.customers.balance_transactions.list(customer_id, \*\*params) -> SyncPage[CustomerBalanceTransactionModel] # Events @@ -182,25 +241,13 @@ Methods: ## Backfills -Types: - -```python -from orb.types.events import ( - BackfillCreateResponse, - BackfillListResponse, - BackfillCloseResponse, - BackfillFetchResponse, - BackfillRevertResponse, -) -``` - Methods: -- client.events.backfills.create(\*\*params) -> BackfillCreateResponse -- client.events.backfills.list(\*\*params) -> SyncPage[BackfillListResponse] -- client.events.backfills.close(backfill_id) -> BackfillCloseResponse -- client.events.backfills.fetch(backfill_id) -> BackfillFetchResponse -- client.events.backfills.revert(backfill_id) -> BackfillRevertResponse +- client.events.backfills.create(\*\*params) -> BackfillModel +- client.events.backfills.list(\*\*params) -> SyncPage[BackfillModel] +- client.events.backfills.close(backfill_id) -> BackfillModel +- client.events.backfills.fetch(backfill_id) -> BackfillModel +- client.events.backfills.revert(backfill_id) -> BackfillModel ## Volume @@ -216,15 +263,9 @@ Methods: # InvoiceLineItems -Types: - -```python -from orb.types import InvoiceLineItemCreateResponse -``` - Methods: -- client.invoice_line_items.create(\*\*params) -> InvoiceLineItemCreateResponse +- client.invoice_line_items.create(\*\*params) -> InvoiceLineItemModel # Invoices @@ -236,15 +277,15 @@ from orb.types import Invoice, InvoiceFetchUpcomingResponse Methods: -- client.invoices.create(\*\*params) -> Invoice -- client.invoices.update(invoice_id, \*\*params) -> Invoice -- client.invoices.list(\*\*params) -> SyncPage[Invoice] -- client.invoices.fetch(invoice_id) -> Invoice +- client.invoices.create(\*\*params) -> InvoiceModel +- client.invoices.update(invoice_id, \*\*params) -> InvoiceModel +- client.invoices.list(\*\*params) -> SyncPage[InvoiceModel] +- client.invoices.fetch(invoice_id) -> InvoiceModel - client.invoices.fetch_upcoming(\*\*params) -> InvoiceFetchUpcomingResponse -- client.invoices.issue(invoice_id, \*\*params) -> Invoice -- client.invoices.mark_paid(invoice_id, \*\*params) -> Invoice -- client.invoices.pay(invoice_id) -> Invoice -- client.invoices.void(invoice_id) -> Invoice +- client.invoices.issue(invoice_id, \*\*params) -> InvoiceModel +- client.invoices.mark_paid(invoice_id, \*\*params) -> InvoiceModel +- client.invoices.pay(invoice_id) -> InvoiceModel +- client.invoices.void(invoice_id) -> InvoiceModel # Items @@ -256,10 +297,10 @@ from orb.types import Item Methods: -- client.items.create(\*\*params) -> Item -- client.items.update(item_id, \*\*params) -> Item -- client.items.list(\*\*params) -> SyncPage[Item] -- client.items.fetch(item_id) -> Item +- client.items.create(\*\*params) -> ItemModel +- client.items.update(item_id, \*\*params) -> ItemModel +- client.items.list(\*\*params) -> SyncPage[ItemModel] +- client.items.fetch(item_id) -> ItemModel # Metrics @@ -271,10 +312,10 @@ from orb.types import BillableMetric Methods: -- client.metrics.create(\*\*params) -> BillableMetric -- client.metrics.update(metric_id, \*\*params) -> BillableMetric -- client.metrics.list(\*\*params) -> SyncPage[BillableMetric] -- client.metrics.fetch(metric_id) -> BillableMetric +- client.metrics.create(\*\*params) -> BillableMetricModel +- client.metrics.update(metric_id, \*\*params) -> BillableMetricModel +- client.metrics.list(\*\*params) -> SyncPage[BillableMetricModel] +- client.metrics.fetch(metric_id) -> BillableMetricModel # Plans @@ -286,17 +327,17 @@ from orb.types import Plan Methods: -- client.plans.create(\*\*params) -> Plan -- client.plans.update(plan_id, \*\*params) -> Plan -- client.plans.list(\*\*params) -> SyncPage[Plan] -- client.plans.fetch(plan_id) -> Plan +- client.plans.create(\*\*params) -> PlanModel +- client.plans.update(plan_id, \*\*params) -> PlanModel +- client.plans.list(\*\*params) -> SyncPage[PlanModel] +- client.plans.fetch(plan_id) -> PlanModel ## ExternalPlanID Methods: -- client.plans.external_plan_id.update(other_external_plan_id, \*\*params) -> Plan -- client.plans.external_plan_id.fetch(external_plan_id) -> Plan +- client.plans.external_plan_id.update(other_external_plan_id, \*\*params) -> PlanModel +- client.plans.external_plan_id.fetch(external_plan_id) -> PlanModel # Prices @@ -308,18 +349,18 @@ from orb.types import EvaluatePriceGroup, Price, PriceEvaluateResponse Methods: -- client.prices.create(\*\*params) -> Price -- client.prices.update(price_id, \*\*params) -> Price -- client.prices.list(\*\*params) -> SyncPage[Price] +- client.prices.create(\*\*params) -> PriceModel +- client.prices.update(price_id, \*\*params) -> PriceModel +- client.prices.list(\*\*params) -> SyncPage[PriceModel] - client.prices.evaluate(price_id, \*\*params) -> PriceEvaluateResponse -- client.prices.fetch(price_id) -> Price +- client.prices.fetch(price_id) -> PriceModel ## ExternalPriceID Methods: -- client.prices.external_price_id.update(external_price_id, \*\*params) -> Price -- client.prices.external_price_id.fetch(external_price_id) -> Price +- client.prices.external_price_id.update(external_price_id, \*\*params) -> PriceModel +- client.prices.external_price_id.fetch(external_price_id) -> PriceModel # Subscriptions @@ -330,39 +371,29 @@ from orb.types import ( Subscription, SubscriptionUsage, Subscriptions, - SubscriptionCreateResponse, - SubscriptionCancelResponse, SubscriptionFetchCostsResponse, SubscriptionFetchScheduleResponse, - SubscriptionPriceIntervalsResponse, - SubscriptionSchedulePlanChangeResponse, - SubscriptionTriggerPhaseResponse, - SubscriptionUnscheduleCancellationResponse, - SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse, - SubscriptionUnschedulePendingPlanChangesResponse, - SubscriptionUpdateFixedFeeQuantityResponse, - SubscriptionUpdateTrialResponse, ) ``` Methods: -- client.subscriptions.create(\*\*params) -> SubscriptionCreateResponse -- client.subscriptions.update(subscription_id, \*\*params) -> Subscription -- client.subscriptions.list(\*\*params) -> SyncPage[Subscription] -- client.subscriptions.cancel(subscription_id, \*\*params) -> SubscriptionCancelResponse -- client.subscriptions.fetch(subscription_id) -> Subscription +- client.subscriptions.create(\*\*params) -> MutatedSubscriptionModel +- client.subscriptions.update(subscription_id, \*\*params) -> SubscriptionModel +- client.subscriptions.list(\*\*params) -> SyncPage[SubscriptionModel] +- client.subscriptions.cancel(subscription_id, \*\*params) -> MutatedSubscriptionModel +- client.subscriptions.fetch(subscription_id) -> SubscriptionModel - client.subscriptions.fetch_costs(subscription_id, \*\*params) -> SubscriptionFetchCostsResponse - client.subscriptions.fetch_schedule(subscription_id, \*\*params) -> SyncPage[SubscriptionFetchScheduleResponse] - client.subscriptions.fetch_usage(subscription_id, \*\*params) -> SubscriptionUsage -- client.subscriptions.price_intervals(subscription_id, \*\*params) -> SubscriptionPriceIntervalsResponse -- client.subscriptions.schedule_plan_change(subscription_id, \*\*params) -> SubscriptionSchedulePlanChangeResponse -- client.subscriptions.trigger_phase(subscription_id, \*\*params) -> SubscriptionTriggerPhaseResponse -- client.subscriptions.unschedule_cancellation(subscription_id) -> SubscriptionUnscheduleCancellationResponse -- client.subscriptions.unschedule_fixed_fee_quantity_updates(subscription_id, \*\*params) -> SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse -- client.subscriptions.unschedule_pending_plan_changes(subscription_id) -> SubscriptionUnschedulePendingPlanChangesResponse -- client.subscriptions.update_fixed_fee_quantity(subscription_id, \*\*params) -> SubscriptionUpdateFixedFeeQuantityResponse -- client.subscriptions.update_trial(subscription_id, \*\*params) -> SubscriptionUpdateTrialResponse +- client.subscriptions.price_intervals(subscription_id, \*\*params) -> MutatedSubscriptionModel +- client.subscriptions.schedule_plan_change(subscription_id, \*\*params) -> MutatedSubscriptionModel +- client.subscriptions.trigger_phase(subscription_id, \*\*params) -> MutatedSubscriptionModel +- client.subscriptions.unschedule_cancellation(subscription_id) -> MutatedSubscriptionModel +- client.subscriptions.unschedule_fixed_fee_quantity_updates(subscription_id, \*\*params) -> MutatedSubscriptionModel +- client.subscriptions.unschedule_pending_plan_changes(subscription_id) -> MutatedSubscriptionModel +- client.subscriptions.update_fixed_fee_quantity(subscription_id, \*\*params) -> MutatedSubscriptionModel +- client.subscriptions.update_trial(subscription_id, \*\*params) -> MutatedSubscriptionModel # Webhooks @@ -381,14 +412,14 @@ from orb.types import Alert Methods: -- client.alerts.retrieve(alert_id) -> Alert -- client.alerts.update(alert_configuration_id, \*\*params) -> Alert -- client.alerts.list(\*\*params) -> SyncPage[Alert] -- client.alerts.create_for_customer(customer_id, \*\*params) -> Alert -- client.alerts.create_for_external_customer(external_customer_id, \*\*params) -> Alert -- client.alerts.create_for_subscription(subscription_id, \*\*params) -> Alert -- client.alerts.disable(alert_configuration_id, \*\*params) -> Alert -- client.alerts.enable(alert_configuration_id, \*\*params) -> Alert +- client.alerts.retrieve(alert_id) -> AlertModel +- client.alerts.update(alert_configuration_id, \*\*params) -> AlertModel +- client.alerts.list(\*\*params) -> SyncPage[AlertModel] +- client.alerts.create_for_customer(customer_id, \*\*params) -> AlertModel +- client.alerts.create_for_external_customer(external_customer_id, \*\*params) -> AlertModel +- client.alerts.create_for_subscription(subscription_id, \*\*params) -> AlertModel +- client.alerts.disable(alert_configuration_id, \*\*params) -> AlertModel +- client.alerts.enable(alert_configuration_id, \*\*params) -> AlertModel # DimensionalPriceGroups @@ -400,12 +431,12 @@ from orb.types import DimensionalPriceGroup, DimensionalPriceGroups Methods: -- client.dimensional_price_groups.create(\*\*params) -> DimensionalPriceGroup -- client.dimensional_price_groups.retrieve(dimensional_price_group_id) -> DimensionalPriceGroup -- client.dimensional_price_groups.list(\*\*params) -> SyncPage[DimensionalPriceGroup] +- client.dimensional_price_groups.create(\*\*params) -> DimensionalPriceGroupModel +- client.dimensional_price_groups.retrieve(dimensional_price_group_id) -> DimensionalPriceGroupModel +- client.dimensional_price_groups.list(\*\*params) -> SyncPage[DimensionalPriceGroupModel] ## ExternalDimensionalPriceGroupID Methods: -- client.dimensional_price_groups.external_dimensional_price_group_id.retrieve(external_dimensional_price_group_id) -> DimensionalPriceGroup +- client.dimensional_price_groups.external_dimensional_price_group_id.retrieve(external_dimensional_price_group_id) -> DimensionalPriceGroupModel diff --git a/src/orb/resources/alerts.py b/src/orb/resources/alerts.py index 4a38058d..38c61310 100644 --- a/src/orb/resources/alerts.py +++ b/src/orb/resources/alerts.py @@ -27,8 +27,9 @@ from .._resource import SyncAPIResource, AsyncAPIResource from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper from ..pagination import SyncPage, AsyncPage -from ..types.alert import Alert from .._base_client import AsyncPaginator, make_request_options +from ..types.shared.alert_model import AlertModel +from ..types.shared_params.threshold_model import ThresholdModel __all__ = ["Alerts", "AsyncAlerts"] @@ -63,7 +64,7 @@ def retrieve( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Alert: + ) -> AlertModel: """ This endpoint retrieves an alert by its ID. @@ -83,14 +84,14 @@ def retrieve( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=Alert, + cast_to=AlertModel, ) def update( self, alert_configuration_id: str, *, - thresholds: Iterable[alert_update_params.Threshold], + thresholds: Iterable[ThresholdModel], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -98,7 +99,7 @@ def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Alert: + ) -> AlertModel: """ This endpoint updates the thresholds of an alert. @@ -129,7 +130,7 @@ def update( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=Alert, + cast_to=AlertModel, ) def list( @@ -150,7 +151,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPage[Alert]: + ) -> SyncPage[AlertModel]: """ This endpoint returns a list of alerts within Orb. @@ -186,7 +187,7 @@ def list( """ return self._get_api_list( "/alerts", - page=SyncPage[Alert], + page=SyncPage[AlertModel], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -207,7 +208,7 @@ def list( alert_list_params.AlertListParams, ), ), - model=Alert, + model=AlertModel, ) def create_for_customer( @@ -222,7 +223,7 @@ def create_for_customer( "credit_balance_dropped", "credit_balance_recovered", ], - thresholds: Optional[Iterable[alert_create_for_customer_params.Threshold]] | NotGiven = NOT_GIVEN, + thresholds: Optional[Iterable[ThresholdModel]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -230,7 +231,7 @@ def create_for_customer( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Alert: + ) -> AlertModel: """This endpoint creates a new alert to monitor a customer's credit balance. There @@ -278,7 +279,7 @@ def create_for_customer( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=Alert, + cast_to=AlertModel, ) def create_for_external_customer( @@ -293,7 +294,7 @@ def create_for_external_customer( "credit_balance_dropped", "credit_balance_recovered", ], - thresholds: Optional[Iterable[alert_create_for_external_customer_params.Threshold]] | NotGiven = NOT_GIVEN, + thresholds: Optional[Iterable[ThresholdModel]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -301,7 +302,7 @@ def create_for_external_customer( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Alert: + ) -> AlertModel: """This endpoint creates a new alert to monitor a customer's credit balance. There @@ -351,14 +352,14 @@ def create_for_external_customer( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=Alert, + cast_to=AlertModel, ) def create_for_subscription( self, subscription_id: str, *, - thresholds: Iterable[alert_create_for_subscription_params.Threshold], + thresholds: Iterable[ThresholdModel], type: Literal[ "usage_exceeded", "cost_exceeded", @@ -374,7 +375,7 @@ def create_for_subscription( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Alert: + ) -> AlertModel: """ This endpoint is used to create alerts at the subscription level. @@ -424,7 +425,7 @@ def create_for_subscription( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=Alert, + cast_to=AlertModel, ) def disable( @@ -439,7 +440,7 @@ def disable( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Alert: + ) -> AlertModel: """This endpoint allows you to disable an alert. To disable a plan-level alert for @@ -473,7 +474,7 @@ def disable( idempotency_key=idempotency_key, query=maybe_transform({"subscription_id": subscription_id}, alert_disable_params.AlertDisableParams), ), - cast_to=Alert, + cast_to=AlertModel, ) def enable( @@ -488,7 +489,7 @@ def enable( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Alert: + ) -> AlertModel: """This endpoint allows you to enable an alert. To enable a plan-level alert for a @@ -522,7 +523,7 @@ def enable( idempotency_key=idempotency_key, query=maybe_transform({"subscription_id": subscription_id}, alert_enable_params.AlertEnableParams), ), - cast_to=Alert, + cast_to=AlertModel, ) @@ -556,7 +557,7 @@ async def retrieve( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Alert: + ) -> AlertModel: """ This endpoint retrieves an alert by its ID. @@ -576,14 +577,14 @@ async def retrieve( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=Alert, + cast_to=AlertModel, ) async def update( self, alert_configuration_id: str, *, - thresholds: Iterable[alert_update_params.Threshold], + thresholds: Iterable[ThresholdModel], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -591,7 +592,7 @@ async def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Alert: + ) -> AlertModel: """ This endpoint updates the thresholds of an alert. @@ -622,7 +623,7 @@ async def update( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=Alert, + cast_to=AlertModel, ) def list( @@ -643,7 +644,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[Alert, AsyncPage[Alert]]: + ) -> AsyncPaginator[AlertModel, AsyncPage[AlertModel]]: """ This endpoint returns a list of alerts within Orb. @@ -679,7 +680,7 @@ def list( """ return self._get_api_list( "/alerts", - page=AsyncPage[Alert], + page=AsyncPage[AlertModel], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -700,7 +701,7 @@ def list( alert_list_params.AlertListParams, ), ), - model=Alert, + model=AlertModel, ) async def create_for_customer( @@ -715,7 +716,7 @@ async def create_for_customer( "credit_balance_dropped", "credit_balance_recovered", ], - thresholds: Optional[Iterable[alert_create_for_customer_params.Threshold]] | NotGiven = NOT_GIVEN, + thresholds: Optional[Iterable[ThresholdModel]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -723,7 +724,7 @@ async def create_for_customer( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Alert: + ) -> AlertModel: """This endpoint creates a new alert to monitor a customer's credit balance. There @@ -771,7 +772,7 @@ async def create_for_customer( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=Alert, + cast_to=AlertModel, ) async def create_for_external_customer( @@ -786,7 +787,7 @@ async def create_for_external_customer( "credit_balance_dropped", "credit_balance_recovered", ], - thresholds: Optional[Iterable[alert_create_for_external_customer_params.Threshold]] | NotGiven = NOT_GIVEN, + thresholds: Optional[Iterable[ThresholdModel]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -794,7 +795,7 @@ async def create_for_external_customer( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Alert: + ) -> AlertModel: """This endpoint creates a new alert to monitor a customer's credit balance. There @@ -844,14 +845,14 @@ async def create_for_external_customer( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=Alert, + cast_to=AlertModel, ) async def create_for_subscription( self, subscription_id: str, *, - thresholds: Iterable[alert_create_for_subscription_params.Threshold], + thresholds: Iterable[ThresholdModel], type: Literal[ "usage_exceeded", "cost_exceeded", @@ -867,7 +868,7 @@ async def create_for_subscription( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Alert: + ) -> AlertModel: """ This endpoint is used to create alerts at the subscription level. @@ -917,7 +918,7 @@ async def create_for_subscription( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=Alert, + cast_to=AlertModel, ) async def disable( @@ -932,7 +933,7 @@ async def disable( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Alert: + ) -> AlertModel: """This endpoint allows you to disable an alert. To disable a plan-level alert for @@ -968,7 +969,7 @@ async def disable( {"subscription_id": subscription_id}, alert_disable_params.AlertDisableParams ), ), - cast_to=Alert, + cast_to=AlertModel, ) async def enable( @@ -983,7 +984,7 @@ async def enable( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Alert: + ) -> AlertModel: """This endpoint allows you to enable an alert. To enable a plan-level alert for a @@ -1019,7 +1020,7 @@ async def enable( {"subscription_id": subscription_id}, alert_enable_params.AlertEnableParams ), ), - cast_to=Alert, + cast_to=AlertModel, ) diff --git a/src/orb/resources/coupons/coupons.py b/src/orb/resources/coupons/coupons.py index 3deb9fce..2a972137 100644 --- a/src/orb/resources/coupons/coupons.py +++ b/src/orb/resources/coupons/coupons.py @@ -26,7 +26,7 @@ AsyncSubscriptionsWithStreamingResponse, ) from ..._base_client import AsyncPaginator, make_request_options -from ...types.coupon import Coupon +from ...types.shared.coupon_model import CouponModel __all__ = ["Coupons", "AsyncCoupons"] @@ -69,7 +69,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Coupon: + ) -> CouponModel: """ This endpoint allows the creation of coupons, which can then be redeemed at subscription creation or plan change. @@ -111,7 +111,7 @@ def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=Coupon, + cast_to=CouponModel, ) def list( @@ -127,7 +127,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPage[Coupon]: + ) -> SyncPage[CouponModel]: """ This endpoint returns a list of all coupons for an account in a list format. @@ -157,7 +157,7 @@ def list( """ return self._get_api_list( "/coupons", - page=SyncPage[Coupon], + page=SyncPage[CouponModel], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -173,7 +173,7 @@ def list( coupon_list_params.CouponListParams, ), ), - model=Coupon, + model=CouponModel, ) def archive( @@ -187,7 +187,7 @@ def archive( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Coupon: + ) -> CouponModel: """This endpoint allows a coupon to be archived. Archived coupons can no longer be @@ -216,7 +216,7 @@ def archive( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=Coupon, + cast_to=CouponModel, ) def fetch( @@ -229,7 +229,7 @@ def fetch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Coupon: + ) -> CouponModel: """This endpoint retrieves a coupon by its ID. To fetch coupons by their redemption @@ -252,7 +252,7 @@ def fetch( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=Coupon, + cast_to=CouponModel, ) @@ -294,7 +294,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Coupon: + ) -> CouponModel: """ This endpoint allows the creation of coupons, which can then be redeemed at subscription creation or plan change. @@ -336,7 +336,7 @@ async def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=Coupon, + cast_to=CouponModel, ) def list( @@ -352,7 +352,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[Coupon, AsyncPage[Coupon]]: + ) -> AsyncPaginator[CouponModel, AsyncPage[CouponModel]]: """ This endpoint returns a list of all coupons for an account in a list format. @@ -382,7 +382,7 @@ def list( """ return self._get_api_list( "/coupons", - page=AsyncPage[Coupon], + page=AsyncPage[CouponModel], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -398,7 +398,7 @@ def list( coupon_list_params.CouponListParams, ), ), - model=Coupon, + model=CouponModel, ) async def archive( @@ -412,7 +412,7 @@ async def archive( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Coupon: + ) -> CouponModel: """This endpoint allows a coupon to be archived. Archived coupons can no longer be @@ -441,7 +441,7 @@ async def archive( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=Coupon, + cast_to=CouponModel, ) async def fetch( @@ -454,7 +454,7 @@ async def fetch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Coupon: + ) -> CouponModel: """This endpoint retrieves a coupon by its ID. To fetch coupons by their redemption @@ -477,7 +477,7 @@ async def fetch( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=Coupon, + cast_to=CouponModel, ) diff --git a/src/orb/resources/coupons/subscriptions.py b/src/orb/resources/coupons/subscriptions.py index 442fe33d..af3e0133 100644 --- a/src/orb/resources/coupons/subscriptions.py +++ b/src/orb/resources/coupons/subscriptions.py @@ -15,7 +15,7 @@ from ...pagination import SyncPage, AsyncPage from ..._base_client import AsyncPaginator, make_request_options from ...types.coupons import subscription_list_params -from ...types.subscription import Subscription +from ...types.shared.subscription_model import SubscriptionModel __all__ = ["Subscriptions", "AsyncSubscriptions"] @@ -52,7 +52,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPage[Subscription]: + ) -> SyncPage[SubscriptionModel]: """ This endpoint returns a list of all subscriptions that have redeemed a given coupon as a [paginated](/api-reference/pagination) list, ordered starting from @@ -77,7 +77,7 @@ def list( raise ValueError(f"Expected a non-empty value for `coupon_id` but received {coupon_id!r}") return self._get_api_list( f"/coupons/{coupon_id}/subscriptions", - page=SyncPage[Subscription], + page=SyncPage[SubscriptionModel], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -91,7 +91,7 @@ def list( subscription_list_params.SubscriptionListParams, ), ), - model=Subscription, + model=SubscriptionModel, ) @@ -127,7 +127,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[Subscription, AsyncPage[Subscription]]: + ) -> AsyncPaginator[SubscriptionModel, AsyncPage[SubscriptionModel]]: """ This endpoint returns a list of all subscriptions that have redeemed a given coupon as a [paginated](/api-reference/pagination) list, ordered starting from @@ -152,7 +152,7 @@ def list( raise ValueError(f"Expected a non-empty value for `coupon_id` but received {coupon_id!r}") return self._get_api_list( f"/coupons/{coupon_id}/subscriptions", - page=AsyncPage[Subscription], + page=AsyncPage[SubscriptionModel], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -166,7 +166,7 @@ def list( subscription_list_params.SubscriptionListParams, ), ), - model=Subscription, + model=SubscriptionModel, ) diff --git a/src/orb/resources/credit_notes.py b/src/orb/resources/credit_notes.py index cba989c3..88cbad35 100644 --- a/src/orb/resources/credit_notes.py +++ b/src/orb/resources/credit_notes.py @@ -19,7 +19,7 @@ from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper from ..pagination import SyncPage, AsyncPage from .._base_client import AsyncPaginator, make_request_options -from ..types.credit_note import CreditNote +from ..types.shared.credit_note_model import CreditNoteModel __all__ = ["CreditNotes", "AsyncCreditNotes"] @@ -58,7 +58,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> CreditNote: + ) -> CreditNoteModel: """ This endpoint is used to create a single [`Credit Note`](/invoicing/credit-notes). @@ -95,7 +95,7 @@ def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=CreditNote, + cast_to=CreditNoteModel, ) def list( @@ -109,7 +109,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPage[CreditNote]: + ) -> SyncPage[CreditNoteModel]: """Get a paginated list of CreditNotes. Users can also filter by customer_id, @@ -132,7 +132,7 @@ def list( """ return self._get_api_list( "/credit_notes", - page=SyncPage[CreditNote], + page=SyncPage[CreditNoteModel], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -146,7 +146,7 @@ def list( credit_note_list_params.CreditNoteListParams, ), ), - model=CreditNote, + model=CreditNoteModel, ) def fetch( @@ -159,7 +159,7 @@ def fetch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CreditNote: + ) -> CreditNoteModel: """ This endpoint is used to fetch a single [`Credit Note`](/invoicing/credit-notes) given an identifier. @@ -180,7 +180,7 @@ def fetch( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=CreditNote, + cast_to=CreditNoteModel, ) @@ -218,7 +218,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> CreditNote: + ) -> CreditNoteModel: """ This endpoint is used to create a single [`Credit Note`](/invoicing/credit-notes). @@ -255,7 +255,7 @@ async def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=CreditNote, + cast_to=CreditNoteModel, ) def list( @@ -269,7 +269,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[CreditNote, AsyncPage[CreditNote]]: + ) -> AsyncPaginator[CreditNoteModel, AsyncPage[CreditNoteModel]]: """Get a paginated list of CreditNotes. Users can also filter by customer_id, @@ -292,7 +292,7 @@ def list( """ return self._get_api_list( "/credit_notes", - page=AsyncPage[CreditNote], + page=AsyncPage[CreditNoteModel], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -306,7 +306,7 @@ def list( credit_note_list_params.CreditNoteListParams, ), ), - model=CreditNote, + model=CreditNoteModel, ) async def fetch( @@ -319,7 +319,7 @@ async def fetch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CreditNote: + ) -> CreditNoteModel: """ This endpoint is used to fetch a single [`Credit Note`](/invoicing/credit-notes) given an identifier. @@ -340,7 +340,7 @@ async def fetch( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=CreditNote, + cast_to=CreditNoteModel, ) diff --git a/src/orb/resources/customers/balance_transactions.py b/src/orb/resources/customers/balance_transactions.py index 5da3caf7..d93f20e2 100644 --- a/src/orb/resources/customers/balance_transactions.py +++ b/src/orb/resources/customers/balance_transactions.py @@ -20,8 +20,7 @@ from ...pagination import SyncPage, AsyncPage from ..._base_client import AsyncPaginator, make_request_options from ...types.customers import balance_transaction_list_params, balance_transaction_create_params -from ...types.customers.balance_transaction_list_response import BalanceTransactionListResponse -from ...types.customers.balance_transaction_create_response import BalanceTransactionCreateResponse +from ...types.shared.customer_balance_transaction_model import CustomerBalanceTransactionModel __all__ = ["BalanceTransactions", "AsyncBalanceTransactions"] @@ -60,7 +59,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> BalanceTransactionCreateResponse: + ) -> CustomerBalanceTransactionModel: """ Creates an immutable balance transaction that updates the customer's balance and returns back the newly created transaction. @@ -97,7 +96,7 @@ def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=BalanceTransactionCreateResponse, + cast_to=CustomerBalanceTransactionModel, ) def list( @@ -116,7 +115,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPage[BalanceTransactionListResponse]: + ) -> SyncPage[CustomerBalanceTransactionModel]: """ ## The customer balance @@ -165,7 +164,7 @@ def list( raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}") return self._get_api_list( f"/customers/{customer_id}/balance_transactions", - page=SyncPage[BalanceTransactionListResponse], + page=SyncPage[CustomerBalanceTransactionModel], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -183,7 +182,7 @@ def list( balance_transaction_list_params.BalanceTransactionListParams, ), ), - model=BalanceTransactionListResponse, + model=CustomerBalanceTransactionModel, ) @@ -221,7 +220,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> BalanceTransactionCreateResponse: + ) -> CustomerBalanceTransactionModel: """ Creates an immutable balance transaction that updates the customer's balance and returns back the newly created transaction. @@ -258,7 +257,7 @@ async def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=BalanceTransactionCreateResponse, + cast_to=CustomerBalanceTransactionModel, ) def list( @@ -277,7 +276,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[BalanceTransactionListResponse, AsyncPage[BalanceTransactionListResponse]]: + ) -> AsyncPaginator[CustomerBalanceTransactionModel, AsyncPage[CustomerBalanceTransactionModel]]: """ ## The customer balance @@ -326,7 +325,7 @@ def list( raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}") return self._get_api_list( f"/customers/{customer_id}/balance_transactions", - page=AsyncPage[BalanceTransactionListResponse], + page=AsyncPage[CustomerBalanceTransactionModel], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -344,7 +343,7 @@ def list( balance_transaction_list_params.BalanceTransactionListParams, ), ), - model=BalanceTransactionListResponse, + model=CustomerBalanceTransactionModel, ) diff --git a/src/orb/resources/customers/costs.py b/src/orb/resources/customers/costs.py index eb349997..6ecf7ce3 100644 --- a/src/orb/resources/customers/costs.py +++ b/src/orb/resources/customers/costs.py @@ -19,8 +19,7 @@ from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper from ..._base_client import make_request_options from ...types.customers import cost_list_params, cost_list_by_external_id_params -from ...types.customers.cost_list_response import CostListResponse -from ...types.customers.cost_list_by_external_id_response import CostListByExternalIDResponse +from ...types.shared.customer_costs_model import CustomerCostsModel __all__ = ["Costs", "AsyncCosts"] @@ -59,7 +58,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CostListResponse: + ) -> CustomerCostsModel: """ This endpoint is used to fetch a day-by-day snapshot of a customer's costs in Orb, calculated by applying pricing information to the underlying usage (see the @@ -218,7 +217,7 @@ def list( cost_list_params.CostListParams, ), ), - cast_to=CostListResponse, + cast_to=CustomerCostsModel, ) def list_by_external_id( @@ -235,7 +234,7 @@ def list_by_external_id( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CostListByExternalIDResponse: + ) -> CustomerCostsModel: """ This endpoint is used to fetch a day-by-day snapshot of a customer's costs in Orb, calculated by applying pricing information to the underlying usage (see the @@ -396,7 +395,7 @@ def list_by_external_id( cost_list_by_external_id_params.CostListByExternalIDParams, ), ), - cast_to=CostListByExternalIDResponse, + cast_to=CustomerCostsModel, ) @@ -434,7 +433,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CostListResponse: + ) -> CustomerCostsModel: """ This endpoint is used to fetch a day-by-day snapshot of a customer's costs in Orb, calculated by applying pricing information to the underlying usage (see the @@ -593,7 +592,7 @@ async def list( cost_list_params.CostListParams, ), ), - cast_to=CostListResponse, + cast_to=CustomerCostsModel, ) async def list_by_external_id( @@ -610,7 +609,7 @@ async def list_by_external_id( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CostListByExternalIDResponse: + ) -> CustomerCostsModel: """ This endpoint is used to fetch a day-by-day snapshot of a customer's costs in Orb, calculated by applying pricing information to the underlying usage (see the @@ -771,7 +770,7 @@ async def list_by_external_id( cost_list_by_external_id_params.CostListByExternalIDParams, ), ), - cast_to=CostListByExternalIDResponse, + cast_to=CustomerCostsModel, ) diff --git a/src/orb/resources/customers/credits/credits.py b/src/orb/resources/customers/credits/credits.py index 73e13681..f4b5afa8 100644 --- a/src/orb/resources/customers/credits/credits.py +++ b/src/orb/resources/customers/credits/credits.py @@ -31,8 +31,7 @@ from ....pagination import SyncPage, AsyncPage from ...._base_client import AsyncPaginator, make_request_options from ....types.customers import credit_list_params, credit_list_by_external_id_params -from ....types.customers.credit_list_response import CreditListResponse -from ....types.customers.credit_list_by_external_id_response import CreditListByExternalIDResponse +from ....types.shared.customer_credit_balances_model import Data __all__ = ["Credits", "AsyncCredits"] @@ -79,7 +78,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPage[CreditListResponse]: + ) -> SyncPage[Data]: """ Returns a paginated list of unexpired, non-zero credit blocks for a customer. @@ -112,7 +111,7 @@ def list( raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}") return self._get_api_list( f"/customers/{customer_id}/credits", - page=SyncPage[CreditListResponse], + page=SyncPage[Data], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -128,7 +127,7 @@ def list( credit_list_params.CreditListParams, ), ), - model=CreditListResponse, + model=Data, ) def list_by_external_id( @@ -145,7 +144,7 @@ def list_by_external_id( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPage[CreditListByExternalIDResponse]: + ) -> SyncPage[Data]: """ Returns a paginated list of unexpired, non-zero credit blocks for a customer. @@ -180,7 +179,7 @@ def list_by_external_id( ) return self._get_api_list( f"/customers/external_customer_id/{external_customer_id}/credits", - page=SyncPage[CreditListByExternalIDResponse], + page=SyncPage[Data], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -196,7 +195,7 @@ def list_by_external_id( credit_list_by_external_id_params.CreditListByExternalIDParams, ), ), - model=CreditListByExternalIDResponse, + model=Data, ) @@ -242,7 +241,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[CreditListResponse, AsyncPage[CreditListResponse]]: + ) -> AsyncPaginator[Data, AsyncPage[Data]]: """ Returns a paginated list of unexpired, non-zero credit blocks for a customer. @@ -275,7 +274,7 @@ def list( raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}") return self._get_api_list( f"/customers/{customer_id}/credits", - page=AsyncPage[CreditListResponse], + page=AsyncPage[Data], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -291,7 +290,7 @@ def list( credit_list_params.CreditListParams, ), ), - model=CreditListResponse, + model=Data, ) def list_by_external_id( @@ -308,7 +307,7 @@ def list_by_external_id( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[CreditListByExternalIDResponse, AsyncPage[CreditListByExternalIDResponse]]: + ) -> AsyncPaginator[Data, AsyncPage[Data]]: """ Returns a paginated list of unexpired, non-zero credit blocks for a customer. @@ -343,7 +342,7 @@ def list_by_external_id( ) return self._get_api_list( f"/customers/external_customer_id/{external_customer_id}/credits", - page=AsyncPage[CreditListByExternalIDResponse], + page=AsyncPage[Data], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -359,7 +358,7 @@ def list_by_external_id( credit_list_by_external_id_params.CreditListByExternalIDParams, ), ), - model=CreditListByExternalIDResponse, + model=Data, ) diff --git a/src/orb/resources/customers/credits/ledger.py b/src/orb/resources/customers/credits/ledger.py index 60462510..2e9e3e7e 100644 --- a/src/orb/resources/customers/credits/ledger.py +++ b/src/orb/resources/customers/credits/ledger.py @@ -26,12 +26,7 @@ ledger_list_by_external_id_params, ledger_create_entry_by_external_id_params, ) -from ....types.customers.credits.ledger_list_response import LedgerListResponse -from ....types.customers.credits.ledger_create_entry_response import LedgerCreateEntryResponse -from ....types.customers.credits.ledger_list_by_external_id_response import LedgerListByExternalIDResponse -from ....types.customers.credits.ledger_create_entry_by_external_id_response import ( - LedgerCreateEntryByExternalIDResponse, -) +from ....types.shared.credit_ledger_entry_model import CreditLedgerEntryModel __all__ = ["Ledger", "AsyncLedger"] @@ -87,7 +82,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPage[LedgerListResponse]: + ) -> SyncPage[CreditLedgerEntryModel]: """ The credits ledger provides _auditing_ functionality over Orb's credits system with a list of actions that have taken place to modify a customer's credit @@ -191,7 +186,7 @@ def list( raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}") return self._get_api_list( f"/customers/{customer_id}/credits/ledger", - page=SyncPage[LedgerListResponse], + page=SyncPage[CreditLedgerEntryModel], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -213,7 +208,7 @@ def list( ledger_list_params.LedgerListParams, ), ), - model=cast(Any, LedgerListResponse), # Union types cannot be passed in as arguments in the type system + model=cast(Any, CreditLedgerEntryModel), # Union types cannot be passed in as arguments in the type system ) @overload @@ -238,7 +233,7 @@ def create_entry( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> LedgerCreateEntryResponse: + ) -> CreditLedgerEntryModel: """ This endpoint allows you to create a new ledger entry for a specified customer's balance. This can be used to increment balance, deduct credits, and change the @@ -408,7 +403,7 @@ def create_entry( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> LedgerCreateEntryResponse: + ) -> CreditLedgerEntryModel: """ This endpoint allows you to create a new ledger entry for a specified customer's balance. This can be used to increment balance, deduct credits, and change the @@ -568,7 +563,7 @@ def create_entry( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> LedgerCreateEntryResponse: + ) -> CreditLedgerEntryModel: """ This endpoint allows you to create a new ledger entry for a specified customer's balance. This can be used to increment balance, deduct credits, and change the @@ -736,7 +731,7 @@ def create_entry( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> LedgerCreateEntryResponse: + ) -> CreditLedgerEntryModel: """ This endpoint allows you to create a new ledger entry for a specified customer's balance. This can be used to increment balance, deduct credits, and change the @@ -898,7 +893,7 @@ def create_entry( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> LedgerCreateEntryResponse: + ) -> CreditLedgerEntryModel: """ This endpoint allows you to create a new ledger entry for a specified customer's balance. This can be used to increment balance, deduct credits, and change the @@ -1073,11 +1068,11 @@ def create_entry( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> LedgerCreateEntryResponse: + ) -> CreditLedgerEntryModel: if not customer_id: raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}") return cast( - LedgerCreateEntryResponse, + CreditLedgerEntryModel, self._post( f"/customers/{customer_id}/credits/ledger_entry", body=maybe_transform( @@ -1105,7 +1100,7 @@ def create_entry( idempotency_key=idempotency_key, ), cast_to=cast( - Any, LedgerCreateEntryResponse + Any, CreditLedgerEntryModel ), # Union types cannot be passed in as arguments in the type system ), ) @@ -1134,7 +1129,7 @@ def create_entry_by_external_id( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> LedgerCreateEntryByExternalIDResponse: + ) -> CreditLedgerEntryModel: """ This endpoint allows you to create a new ledger entry for a specified customer's balance. This can be used to increment balance, deduct credits, and change the @@ -1304,7 +1299,7 @@ def create_entry_by_external_id( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> LedgerCreateEntryByExternalIDResponse: + ) -> CreditLedgerEntryModel: """ This endpoint allows you to create a new ledger entry for a specified customer's balance. This can be used to increment balance, deduct credits, and change the @@ -1464,7 +1459,7 @@ def create_entry_by_external_id( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> LedgerCreateEntryByExternalIDResponse: + ) -> CreditLedgerEntryModel: """ This endpoint allows you to create a new ledger entry for a specified customer's balance. This can be used to increment balance, deduct credits, and change the @@ -1632,7 +1627,7 @@ def create_entry_by_external_id( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> LedgerCreateEntryByExternalIDResponse: + ) -> CreditLedgerEntryModel: """ This endpoint allows you to create a new ledger entry for a specified customer's balance. This can be used to increment balance, deduct credits, and change the @@ -1794,7 +1789,7 @@ def create_entry_by_external_id( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> LedgerCreateEntryByExternalIDResponse: + ) -> CreditLedgerEntryModel: """ This endpoint allows you to create a new ledger entry for a specified customer's balance. This can be used to increment balance, deduct credits, and change the @@ -1971,13 +1966,13 @@ def create_entry_by_external_id( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> LedgerCreateEntryByExternalIDResponse: + ) -> CreditLedgerEntryModel: if not external_customer_id: raise ValueError( f"Expected a non-empty value for `external_customer_id` but received {external_customer_id!r}" ) return cast( - LedgerCreateEntryByExternalIDResponse, + CreditLedgerEntryModel, self._post( f"/customers/external_customer_id/{external_customer_id}/credits/ledger_entry", body=maybe_transform( @@ -2005,7 +2000,7 @@ def create_entry_by_external_id( idempotency_key=idempotency_key, ), cast_to=cast( - Any, LedgerCreateEntryByExternalIDResponse + Any, CreditLedgerEntryModel ), # Union types cannot be passed in as arguments in the type system ), ) @@ -2041,7 +2036,7 @@ def list_by_external_id( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPage[LedgerListByExternalIDResponse]: + ) -> SyncPage[CreditLedgerEntryModel]: """ The credits ledger provides _auditing_ functionality over Orb's credits system with a list of actions that have taken place to modify a customer's credit @@ -2147,7 +2142,7 @@ def list_by_external_id( ) return self._get_api_list( f"/customers/external_customer_id/{external_customer_id}/credits/ledger", - page=SyncPage[LedgerListByExternalIDResponse], + page=SyncPage[CreditLedgerEntryModel], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -2169,9 +2164,7 @@ def list_by_external_id( ledger_list_by_external_id_params.LedgerListByExternalIDParams, ), ), - model=cast( - Any, LedgerListByExternalIDResponse - ), # Union types cannot be passed in as arguments in the type system + model=cast(Any, CreditLedgerEntryModel), # Union types cannot be passed in as arguments in the type system ) @@ -2226,7 +2219,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[LedgerListResponse, AsyncPage[LedgerListResponse]]: + ) -> AsyncPaginator[CreditLedgerEntryModel, AsyncPage[CreditLedgerEntryModel]]: """ The credits ledger provides _auditing_ functionality over Orb's credits system with a list of actions that have taken place to modify a customer's credit @@ -2330,7 +2323,7 @@ def list( raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}") return self._get_api_list( f"/customers/{customer_id}/credits/ledger", - page=AsyncPage[LedgerListResponse], + page=AsyncPage[CreditLedgerEntryModel], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -2352,7 +2345,7 @@ def list( ledger_list_params.LedgerListParams, ), ), - model=cast(Any, LedgerListResponse), # Union types cannot be passed in as arguments in the type system + model=cast(Any, CreditLedgerEntryModel), # Union types cannot be passed in as arguments in the type system ) @overload @@ -2377,7 +2370,7 @@ async def create_entry( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> LedgerCreateEntryResponse: + ) -> CreditLedgerEntryModel: """ This endpoint allows you to create a new ledger entry for a specified customer's balance. This can be used to increment balance, deduct credits, and change the @@ -2547,7 +2540,7 @@ async def create_entry( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> LedgerCreateEntryResponse: + ) -> CreditLedgerEntryModel: """ This endpoint allows you to create a new ledger entry for a specified customer's balance. This can be used to increment balance, deduct credits, and change the @@ -2707,7 +2700,7 @@ async def create_entry( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> LedgerCreateEntryResponse: + ) -> CreditLedgerEntryModel: """ This endpoint allows you to create a new ledger entry for a specified customer's balance. This can be used to increment balance, deduct credits, and change the @@ -2875,7 +2868,7 @@ async def create_entry( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> LedgerCreateEntryResponse: + ) -> CreditLedgerEntryModel: """ This endpoint allows you to create a new ledger entry for a specified customer's balance. This can be used to increment balance, deduct credits, and change the @@ -3037,7 +3030,7 @@ async def create_entry( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> LedgerCreateEntryResponse: + ) -> CreditLedgerEntryModel: """ This endpoint allows you to create a new ledger entry for a specified customer's balance. This can be used to increment balance, deduct credits, and change the @@ -3212,11 +3205,11 @@ async def create_entry( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> LedgerCreateEntryResponse: + ) -> CreditLedgerEntryModel: if not customer_id: raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}") return cast( - LedgerCreateEntryResponse, + CreditLedgerEntryModel, await self._post( f"/customers/{customer_id}/credits/ledger_entry", body=await async_maybe_transform( @@ -3244,7 +3237,7 @@ async def create_entry( idempotency_key=idempotency_key, ), cast_to=cast( - Any, LedgerCreateEntryResponse + Any, CreditLedgerEntryModel ), # Union types cannot be passed in as arguments in the type system ), ) @@ -3273,7 +3266,7 @@ async def create_entry_by_external_id( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> LedgerCreateEntryByExternalIDResponse: + ) -> CreditLedgerEntryModel: """ This endpoint allows you to create a new ledger entry for a specified customer's balance. This can be used to increment balance, deduct credits, and change the @@ -3443,7 +3436,7 @@ async def create_entry_by_external_id( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> LedgerCreateEntryByExternalIDResponse: + ) -> CreditLedgerEntryModel: """ This endpoint allows you to create a new ledger entry for a specified customer's balance. This can be used to increment balance, deduct credits, and change the @@ -3603,7 +3596,7 @@ async def create_entry_by_external_id( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> LedgerCreateEntryByExternalIDResponse: + ) -> CreditLedgerEntryModel: """ This endpoint allows you to create a new ledger entry for a specified customer's balance. This can be used to increment balance, deduct credits, and change the @@ -3771,7 +3764,7 @@ async def create_entry_by_external_id( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> LedgerCreateEntryByExternalIDResponse: + ) -> CreditLedgerEntryModel: """ This endpoint allows you to create a new ledger entry for a specified customer's balance. This can be used to increment balance, deduct credits, and change the @@ -3933,7 +3926,7 @@ async def create_entry_by_external_id( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> LedgerCreateEntryByExternalIDResponse: + ) -> CreditLedgerEntryModel: """ This endpoint allows you to create a new ledger entry for a specified customer's balance. This can be used to increment balance, deduct credits, and change the @@ -4110,13 +4103,13 @@ async def create_entry_by_external_id( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> LedgerCreateEntryByExternalIDResponse: + ) -> CreditLedgerEntryModel: if not external_customer_id: raise ValueError( f"Expected a non-empty value for `external_customer_id` but received {external_customer_id!r}" ) return cast( - LedgerCreateEntryByExternalIDResponse, + CreditLedgerEntryModel, await self._post( f"/customers/external_customer_id/{external_customer_id}/credits/ledger_entry", body=await async_maybe_transform( @@ -4144,7 +4137,7 @@ async def create_entry_by_external_id( idempotency_key=idempotency_key, ), cast_to=cast( - Any, LedgerCreateEntryByExternalIDResponse + Any, CreditLedgerEntryModel ), # Union types cannot be passed in as arguments in the type system ), ) @@ -4180,7 +4173,7 @@ def list_by_external_id( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[LedgerListByExternalIDResponse, AsyncPage[LedgerListByExternalIDResponse]]: + ) -> AsyncPaginator[CreditLedgerEntryModel, AsyncPage[CreditLedgerEntryModel]]: """ The credits ledger provides _auditing_ functionality over Orb's credits system with a list of actions that have taken place to modify a customer's credit @@ -4286,7 +4279,7 @@ def list_by_external_id( ) return self._get_api_list( f"/customers/external_customer_id/{external_customer_id}/credits/ledger", - page=AsyncPage[LedgerListByExternalIDResponse], + page=AsyncPage[CreditLedgerEntryModel], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -4308,9 +4301,7 @@ def list_by_external_id( ledger_list_by_external_id_params.LedgerListByExternalIDParams, ), ), - model=cast( - Any, LedgerListByExternalIDResponse - ), # Union types cannot be passed in as arguments in the type system + model=cast(Any, CreditLedgerEntryModel), # Union types cannot be passed in as arguments in the type system ) diff --git a/src/orb/resources/customers/credits/top_ups.py b/src/orb/resources/customers/credits/top_ups.py index e9792791..57bd5783 100644 --- a/src/orb/resources/customers/credits/top_ups.py +++ b/src/orb/resources/customers/credits/top_ups.py @@ -25,10 +25,7 @@ top_up_list_by_external_id_params, top_up_create_by_external_id_params, ) -from ....types.customers.credits.top_up_list_response import TopUpListResponse -from ....types.customers.credits.top_up_create_response import TopUpCreateResponse -from ....types.customers.credits.top_up_list_by_external_id_response import TopUpListByExternalIDResponse -from ....types.customers.credits.top_up_create_by_external_id_response import TopUpCreateByExternalIDResponse +from ....types.shared.top_up_model import TopUpModel __all__ = ["TopUps", "AsyncTopUps"] @@ -72,7 +69,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> TopUpCreateResponse: + ) -> TopUpModel: """ This endpoint allows you to create a new top-up for a specified customer's balance. While this top-up is active, the customer's balance will added in @@ -137,7 +134,7 @@ def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=TopUpCreateResponse, + cast_to=TopUpModel, ) def list( @@ -152,7 +149,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPage[TopUpListResponse]: + ) -> SyncPage[TopUpModel]: """List top-ups Args: @@ -175,7 +172,7 @@ def list( raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}") return self._get_api_list( f"/customers/{customer_id}/credits/top_ups", - page=SyncPage[TopUpListResponse], + page=SyncPage[TopUpModel], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -189,7 +186,7 @@ def list( top_up_list_params.TopUpListParams, ), ), - model=TopUpListResponse, + model=TopUpModel, ) def delete( @@ -256,7 +253,7 @@ def create_by_external_id( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> TopUpCreateByExternalIDResponse: + ) -> TopUpModel: """ This endpoint allows you to create a new top-up for a specified customer's balance. While this top-up is active, the customer's balance will added in @@ -323,7 +320,7 @@ def create_by_external_id( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=TopUpCreateByExternalIDResponse, + cast_to=TopUpModel, ) def delete_by_external_id( @@ -385,7 +382,7 @@ def list_by_external_id( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPage[TopUpListByExternalIDResponse]: + ) -> SyncPage[TopUpModel]: """List top-ups by external ID Args: @@ -410,7 +407,7 @@ def list_by_external_id( ) return self._get_api_list( f"/customers/external_customer_id/{external_customer_id}/credits/top_ups", - page=SyncPage[TopUpListByExternalIDResponse], + page=SyncPage[TopUpModel], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -424,7 +421,7 @@ def list_by_external_id( top_up_list_by_external_id_params.TopUpListByExternalIDParams, ), ), - model=TopUpListByExternalIDResponse, + model=TopUpModel, ) @@ -467,7 +464,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> TopUpCreateResponse: + ) -> TopUpModel: """ This endpoint allows you to create a new top-up for a specified customer's balance. While this top-up is active, the customer's balance will added in @@ -532,7 +529,7 @@ async def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=TopUpCreateResponse, + cast_to=TopUpModel, ) def list( @@ -547,7 +544,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[TopUpListResponse, AsyncPage[TopUpListResponse]]: + ) -> AsyncPaginator[TopUpModel, AsyncPage[TopUpModel]]: """List top-ups Args: @@ -570,7 +567,7 @@ def list( raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}") return self._get_api_list( f"/customers/{customer_id}/credits/top_ups", - page=AsyncPage[TopUpListResponse], + page=AsyncPage[TopUpModel], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -584,7 +581,7 @@ def list( top_up_list_params.TopUpListParams, ), ), - model=TopUpListResponse, + model=TopUpModel, ) async def delete( @@ -651,7 +648,7 @@ async def create_by_external_id( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> TopUpCreateByExternalIDResponse: + ) -> TopUpModel: """ This endpoint allows you to create a new top-up for a specified customer's balance. While this top-up is active, the customer's balance will added in @@ -718,7 +715,7 @@ async def create_by_external_id( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=TopUpCreateByExternalIDResponse, + cast_to=TopUpModel, ) async def delete_by_external_id( @@ -780,7 +777,7 @@ def list_by_external_id( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[TopUpListByExternalIDResponse, AsyncPage[TopUpListByExternalIDResponse]]: + ) -> AsyncPaginator[TopUpModel, AsyncPage[TopUpModel]]: """List top-ups by external ID Args: @@ -805,7 +802,7 @@ def list_by_external_id( ) return self._get_api_list( f"/customers/external_customer_id/{external_customer_id}/credits/top_ups", - page=AsyncPage[TopUpListByExternalIDResponse], + page=AsyncPage[TopUpModel], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -819,7 +816,7 @@ def list_by_external_id( top_up_list_by_external_id_params.TopUpListByExternalIDParams, ), ), - model=TopUpListByExternalIDResponse, + model=TopUpModel, ) diff --git a/src/orb/resources/customers/customers.py b/src/orb/resources/customers/customers.py index bd33194f..563cdbf0 100644 --- a/src/orb/resources/customers/customers.py +++ b/src/orb/resources/customers/customers.py @@ -41,7 +41,6 @@ CreditsWithStreamingResponse, AsyncCreditsWithStreamingResponse, ) -from ...types.customer import Customer from .balance_transactions import ( BalanceTransactions, AsyncBalanceTransactions, @@ -50,6 +49,13 @@ BalanceTransactionsWithStreamingResponse, AsyncBalanceTransactionsWithStreamingResponse, ) +from ...types.shared.customer_model import CustomerModel +from ...types.shared_params.address_input_model import AddressInputModel +from ...types.shared_params.customer_tax_id_model import CustomerTaxIDModel +from ...types.shared_params.new_tax_configuration_model import NewTaxConfigurationModel +from ...types.shared_params.customer_hierarchy_config_model import CustomerHierarchyConfigModel +from ...types.shared_params.new_reporting_configuration_model import NewReportingConfigurationModel +from ...types.shared_params.new_accounting_sync_configuration_model import NewAccountingSyncConfigurationModel __all__ = ["Customers", "AsyncCustomers"] @@ -91,23 +97,22 @@ def create( *, email: str, name: str, - accounting_sync_configuration: Optional[customer_create_params.AccountingSyncConfiguration] - | NotGiven = NOT_GIVEN, + accounting_sync_configuration: Optional[NewAccountingSyncConfigurationModel] | NotGiven = NOT_GIVEN, additional_emails: Optional[List[str]] | NotGiven = NOT_GIVEN, auto_collection: Optional[bool] | NotGiven = NOT_GIVEN, - billing_address: Optional[customer_create_params.BillingAddress] | NotGiven = NOT_GIVEN, + billing_address: Optional[AddressInputModel] | NotGiven = NOT_GIVEN, currency: Optional[str] | NotGiven = NOT_GIVEN, email_delivery: Optional[bool] | NotGiven = NOT_GIVEN, external_customer_id: Optional[str] | NotGiven = NOT_GIVEN, - hierarchy: Optional[customer_create_params.Hierarchy] | NotGiven = NOT_GIVEN, + hierarchy: Optional[CustomerHierarchyConfigModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, payment_provider: Optional[Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite"]] | NotGiven = NOT_GIVEN, payment_provider_id: Optional[str] | NotGiven = NOT_GIVEN, - reporting_configuration: Optional[customer_create_params.ReportingConfiguration] | NotGiven = NOT_GIVEN, - shipping_address: Optional[customer_create_params.ShippingAddress] | NotGiven = NOT_GIVEN, - tax_configuration: Optional[customer_create_params.TaxConfiguration] | NotGiven = NOT_GIVEN, - tax_id: Optional[customer_create_params.TaxID] | NotGiven = NOT_GIVEN, + reporting_configuration: Optional[NewReportingConfigurationModel] | NotGiven = NOT_GIVEN, + shipping_address: Optional[AddressInputModel] | NotGiven = NOT_GIVEN, + tax_configuration: Optional[NewTaxConfigurationModel] | NotGiven = NOT_GIVEN, + tax_id: Optional[CustomerTaxIDModel] | NotGiven = NOT_GIVEN, timezone: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -116,7 +121,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Customer: + ) -> CustomerModel: """ This operation is used to create an Orb customer, who is party to the core billing relationship. See [Customer](/core-concepts##customer) for an overview @@ -317,32 +322,31 @@ def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=Customer, + cast_to=CustomerModel, ) def update( self, customer_id: str, *, - accounting_sync_configuration: Optional[customer_update_params.AccountingSyncConfiguration] - | NotGiven = NOT_GIVEN, + accounting_sync_configuration: Optional[NewAccountingSyncConfigurationModel] | NotGiven = NOT_GIVEN, additional_emails: Optional[List[str]] | NotGiven = NOT_GIVEN, auto_collection: Optional[bool] | NotGiven = NOT_GIVEN, - billing_address: Optional[customer_update_params.BillingAddress] | NotGiven = NOT_GIVEN, + billing_address: Optional[AddressInputModel] | NotGiven = NOT_GIVEN, currency: Optional[str] | NotGiven = NOT_GIVEN, email: Optional[str] | NotGiven = NOT_GIVEN, email_delivery: Optional[bool] | NotGiven = NOT_GIVEN, external_customer_id: Optional[str] | NotGiven = NOT_GIVEN, - hierarchy: Optional[customer_update_params.Hierarchy] | NotGiven = NOT_GIVEN, + hierarchy: Optional[CustomerHierarchyConfigModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, name: Optional[str] | NotGiven = NOT_GIVEN, payment_provider: Optional[Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite"]] | NotGiven = NOT_GIVEN, payment_provider_id: Optional[str] | NotGiven = NOT_GIVEN, - reporting_configuration: Optional[customer_update_params.ReportingConfiguration] | NotGiven = NOT_GIVEN, - shipping_address: Optional[customer_update_params.ShippingAddress] | NotGiven = NOT_GIVEN, - tax_configuration: Optional[customer_update_params.TaxConfiguration] | NotGiven = NOT_GIVEN, - tax_id: Optional[customer_update_params.TaxID] | NotGiven = NOT_GIVEN, + reporting_configuration: Optional[NewReportingConfigurationModel] | NotGiven = NOT_GIVEN, + shipping_address: Optional[AddressInputModel] | NotGiven = NOT_GIVEN, + tax_configuration: Optional[NewTaxConfigurationModel] | NotGiven = NOT_GIVEN, + tax_id: Optional[CustomerTaxIDModel] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -350,7 +354,7 @@ def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Customer: + ) -> CustomerModel: """ This endpoint can be used to update the `payment_provider`, `payment_provider_id`, `name`, `email`, `email_delivery`, `tax_id`, @@ -542,7 +546,7 @@ def update( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=Customer, + cast_to=CustomerModel, ) def list( @@ -560,7 +564,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPage[Customer]: + ) -> SyncPage[CustomerModel]: """This endpoint returns a list of all customers for an account. The list of @@ -586,7 +590,7 @@ def list( """ return self._get_api_list( "/customers", - page=SyncPage[Customer], + page=SyncPage[CustomerModel], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -604,7 +608,7 @@ def list( customer_list_params.CustomerListParams, ), ), - model=Customer, + model=CustomerModel, ) def delete( @@ -672,7 +676,7 @@ def fetch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Customer: + ) -> CustomerModel: """This endpoint is used to fetch customer details given an identifier. If the @@ -698,7 +702,7 @@ def fetch( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=Customer, + cast_to=CustomerModel, ) def fetch_by_external_id( @@ -711,7 +715,7 @@ def fetch_by_external_id( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Customer: + ) -> CustomerModel: """ This endpoint is used to fetch customer details given an `external_customer_id` (see [Customer ID Aliases](/events-and-metrics/customer-aliases)). @@ -737,7 +741,7 @@ def fetch_by_external_id( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=Customer, + cast_to=CustomerModel, ) def sync_payment_methods_from_gateway( @@ -838,26 +842,24 @@ def update_by_external_id( self, id: str, *, - accounting_sync_configuration: Optional[customer_update_by_external_id_params.AccountingSyncConfiguration] - | NotGiven = NOT_GIVEN, + accounting_sync_configuration: Optional[NewAccountingSyncConfigurationModel] | NotGiven = NOT_GIVEN, additional_emails: Optional[List[str]] | NotGiven = NOT_GIVEN, auto_collection: Optional[bool] | NotGiven = NOT_GIVEN, - billing_address: Optional[customer_update_by_external_id_params.BillingAddress] | NotGiven = NOT_GIVEN, + billing_address: Optional[AddressInputModel] | NotGiven = NOT_GIVEN, currency: Optional[str] | NotGiven = NOT_GIVEN, email: Optional[str] | NotGiven = NOT_GIVEN, email_delivery: Optional[bool] | NotGiven = NOT_GIVEN, external_customer_id: Optional[str] | NotGiven = NOT_GIVEN, - hierarchy: Optional[customer_update_by_external_id_params.Hierarchy] | NotGiven = NOT_GIVEN, + hierarchy: Optional[CustomerHierarchyConfigModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, name: Optional[str] | NotGiven = NOT_GIVEN, payment_provider: Optional[Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite"]] | NotGiven = NOT_GIVEN, payment_provider_id: Optional[str] | NotGiven = NOT_GIVEN, - reporting_configuration: Optional[customer_update_by_external_id_params.ReportingConfiguration] - | NotGiven = NOT_GIVEN, - shipping_address: Optional[customer_update_by_external_id_params.ShippingAddress] | NotGiven = NOT_GIVEN, - tax_configuration: Optional[customer_update_by_external_id_params.TaxConfiguration] | NotGiven = NOT_GIVEN, - tax_id: Optional[customer_update_by_external_id_params.TaxID] | NotGiven = NOT_GIVEN, + reporting_configuration: Optional[NewReportingConfigurationModel] | NotGiven = NOT_GIVEN, + shipping_address: Optional[AddressInputModel] | NotGiven = NOT_GIVEN, + tax_configuration: Optional[NewTaxConfigurationModel] | NotGiven = NOT_GIVEN, + tax_id: Optional[CustomerTaxIDModel] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -865,7 +867,7 @@ def update_by_external_id( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Customer: + ) -> CustomerModel: """ This endpoint is used to update customer details given an `external_customer_id` (see [Customer ID Aliases](/events-and-metrics/customer-aliases)). Note that the @@ -1056,7 +1058,7 @@ def update_by_external_id( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=Customer, + cast_to=CustomerModel, ) @@ -1097,23 +1099,22 @@ async def create( *, email: str, name: str, - accounting_sync_configuration: Optional[customer_create_params.AccountingSyncConfiguration] - | NotGiven = NOT_GIVEN, + accounting_sync_configuration: Optional[NewAccountingSyncConfigurationModel] | NotGiven = NOT_GIVEN, additional_emails: Optional[List[str]] | NotGiven = NOT_GIVEN, auto_collection: Optional[bool] | NotGiven = NOT_GIVEN, - billing_address: Optional[customer_create_params.BillingAddress] | NotGiven = NOT_GIVEN, + billing_address: Optional[AddressInputModel] | NotGiven = NOT_GIVEN, currency: Optional[str] | NotGiven = NOT_GIVEN, email_delivery: Optional[bool] | NotGiven = NOT_GIVEN, external_customer_id: Optional[str] | NotGiven = NOT_GIVEN, - hierarchy: Optional[customer_create_params.Hierarchy] | NotGiven = NOT_GIVEN, + hierarchy: Optional[CustomerHierarchyConfigModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, payment_provider: Optional[Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite"]] | NotGiven = NOT_GIVEN, payment_provider_id: Optional[str] | NotGiven = NOT_GIVEN, - reporting_configuration: Optional[customer_create_params.ReportingConfiguration] | NotGiven = NOT_GIVEN, - shipping_address: Optional[customer_create_params.ShippingAddress] | NotGiven = NOT_GIVEN, - tax_configuration: Optional[customer_create_params.TaxConfiguration] | NotGiven = NOT_GIVEN, - tax_id: Optional[customer_create_params.TaxID] | NotGiven = NOT_GIVEN, + reporting_configuration: Optional[NewReportingConfigurationModel] | NotGiven = NOT_GIVEN, + shipping_address: Optional[AddressInputModel] | NotGiven = NOT_GIVEN, + tax_configuration: Optional[NewTaxConfigurationModel] | NotGiven = NOT_GIVEN, + tax_id: Optional[CustomerTaxIDModel] | NotGiven = NOT_GIVEN, timezone: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1122,7 +1123,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Customer: + ) -> CustomerModel: """ This operation is used to create an Orb customer, who is party to the core billing relationship. See [Customer](/core-concepts##customer) for an overview @@ -1323,32 +1324,31 @@ async def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=Customer, + cast_to=CustomerModel, ) async def update( self, customer_id: str, *, - accounting_sync_configuration: Optional[customer_update_params.AccountingSyncConfiguration] - | NotGiven = NOT_GIVEN, + accounting_sync_configuration: Optional[NewAccountingSyncConfigurationModel] | NotGiven = NOT_GIVEN, additional_emails: Optional[List[str]] | NotGiven = NOT_GIVEN, auto_collection: Optional[bool] | NotGiven = NOT_GIVEN, - billing_address: Optional[customer_update_params.BillingAddress] | NotGiven = NOT_GIVEN, + billing_address: Optional[AddressInputModel] | NotGiven = NOT_GIVEN, currency: Optional[str] | NotGiven = NOT_GIVEN, email: Optional[str] | NotGiven = NOT_GIVEN, email_delivery: Optional[bool] | NotGiven = NOT_GIVEN, external_customer_id: Optional[str] | NotGiven = NOT_GIVEN, - hierarchy: Optional[customer_update_params.Hierarchy] | NotGiven = NOT_GIVEN, + hierarchy: Optional[CustomerHierarchyConfigModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, name: Optional[str] | NotGiven = NOT_GIVEN, payment_provider: Optional[Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite"]] | NotGiven = NOT_GIVEN, payment_provider_id: Optional[str] | NotGiven = NOT_GIVEN, - reporting_configuration: Optional[customer_update_params.ReportingConfiguration] | NotGiven = NOT_GIVEN, - shipping_address: Optional[customer_update_params.ShippingAddress] | NotGiven = NOT_GIVEN, - tax_configuration: Optional[customer_update_params.TaxConfiguration] | NotGiven = NOT_GIVEN, - tax_id: Optional[customer_update_params.TaxID] | NotGiven = NOT_GIVEN, + reporting_configuration: Optional[NewReportingConfigurationModel] | NotGiven = NOT_GIVEN, + shipping_address: Optional[AddressInputModel] | NotGiven = NOT_GIVEN, + tax_configuration: Optional[NewTaxConfigurationModel] | NotGiven = NOT_GIVEN, + tax_id: Optional[CustomerTaxIDModel] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1356,7 +1356,7 @@ async def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Customer: + ) -> CustomerModel: """ This endpoint can be used to update the `payment_provider`, `payment_provider_id`, `name`, `email`, `email_delivery`, `tax_id`, @@ -1548,7 +1548,7 @@ async def update( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=Customer, + cast_to=CustomerModel, ) def list( @@ -1566,7 +1566,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[Customer, AsyncPage[Customer]]: + ) -> AsyncPaginator[CustomerModel, AsyncPage[CustomerModel]]: """This endpoint returns a list of all customers for an account. The list of @@ -1592,7 +1592,7 @@ def list( """ return self._get_api_list( "/customers", - page=AsyncPage[Customer], + page=AsyncPage[CustomerModel], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -1610,7 +1610,7 @@ def list( customer_list_params.CustomerListParams, ), ), - model=Customer, + model=CustomerModel, ) async def delete( @@ -1678,7 +1678,7 @@ async def fetch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Customer: + ) -> CustomerModel: """This endpoint is used to fetch customer details given an identifier. If the @@ -1704,7 +1704,7 @@ async def fetch( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=Customer, + cast_to=CustomerModel, ) async def fetch_by_external_id( @@ -1717,7 +1717,7 @@ async def fetch_by_external_id( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Customer: + ) -> CustomerModel: """ This endpoint is used to fetch customer details given an `external_customer_id` (see [Customer ID Aliases](/events-and-metrics/customer-aliases)). @@ -1743,7 +1743,7 @@ async def fetch_by_external_id( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=Customer, + cast_to=CustomerModel, ) async def sync_payment_methods_from_gateway( @@ -1844,26 +1844,24 @@ async def update_by_external_id( self, id: str, *, - accounting_sync_configuration: Optional[customer_update_by_external_id_params.AccountingSyncConfiguration] - | NotGiven = NOT_GIVEN, + accounting_sync_configuration: Optional[NewAccountingSyncConfigurationModel] | NotGiven = NOT_GIVEN, additional_emails: Optional[List[str]] | NotGiven = NOT_GIVEN, auto_collection: Optional[bool] | NotGiven = NOT_GIVEN, - billing_address: Optional[customer_update_by_external_id_params.BillingAddress] | NotGiven = NOT_GIVEN, + billing_address: Optional[AddressInputModel] | NotGiven = NOT_GIVEN, currency: Optional[str] | NotGiven = NOT_GIVEN, email: Optional[str] | NotGiven = NOT_GIVEN, email_delivery: Optional[bool] | NotGiven = NOT_GIVEN, external_customer_id: Optional[str] | NotGiven = NOT_GIVEN, - hierarchy: Optional[customer_update_by_external_id_params.Hierarchy] | NotGiven = NOT_GIVEN, + hierarchy: Optional[CustomerHierarchyConfigModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, name: Optional[str] | NotGiven = NOT_GIVEN, payment_provider: Optional[Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite"]] | NotGiven = NOT_GIVEN, payment_provider_id: Optional[str] | NotGiven = NOT_GIVEN, - reporting_configuration: Optional[customer_update_by_external_id_params.ReportingConfiguration] - | NotGiven = NOT_GIVEN, - shipping_address: Optional[customer_update_by_external_id_params.ShippingAddress] | NotGiven = NOT_GIVEN, - tax_configuration: Optional[customer_update_by_external_id_params.TaxConfiguration] | NotGiven = NOT_GIVEN, - tax_id: Optional[customer_update_by_external_id_params.TaxID] | NotGiven = NOT_GIVEN, + reporting_configuration: Optional[NewReportingConfigurationModel] | NotGiven = NOT_GIVEN, + shipping_address: Optional[AddressInputModel] | NotGiven = NOT_GIVEN, + tax_configuration: Optional[NewTaxConfigurationModel] | NotGiven = NOT_GIVEN, + tax_id: Optional[CustomerTaxIDModel] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1871,7 +1869,7 @@ async def update_by_external_id( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Customer: + ) -> CustomerModel: """ This endpoint is used to update customer details given an `external_customer_id` (see [Customer ID Aliases](/events-and-metrics/customer-aliases)). Note that the @@ -2062,7 +2060,7 @@ async def update_by_external_id( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=Customer, + cast_to=CustomerModel, ) diff --git a/src/orb/resources/dimensional_price_groups/dimensional_price_groups.py b/src/orb/resources/dimensional_price_groups/dimensional_price_groups.py index 45ccfd75..982a717d 100644 --- a/src/orb/resources/dimensional_price_groups/dimensional_price_groups.py +++ b/src/orb/resources/dimensional_price_groups/dimensional_price_groups.py @@ -18,7 +18,6 @@ from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper from ...pagination import SyncPage, AsyncPage from ..._base_client import AsyncPaginator, make_request_options -from ...types.dimensional_price_group import DimensionalPriceGroup from .external_dimensional_price_group_id import ( ExternalDimensionalPriceGroupID, AsyncExternalDimensionalPriceGroupID, @@ -27,6 +26,7 @@ ExternalDimensionalPriceGroupIDWithStreamingResponse, AsyncExternalDimensionalPriceGroupIDWithStreamingResponse, ) +from ...types.shared.dimensional_price_group_model import DimensionalPriceGroupModel __all__ = ["DimensionalPriceGroups", "AsyncDimensionalPriceGroups"] @@ -70,7 +70,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> DimensionalPriceGroup: + ) -> DimensionalPriceGroupModel: """ A dimensional price group is used to partition the result of a billable metric by a set of dimensions. Prices in a price group must specify the parition used @@ -117,7 +117,7 @@ def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=DimensionalPriceGroup, + cast_to=DimensionalPriceGroupModel, ) def retrieve( @@ -130,7 +130,7 @@ def retrieve( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DimensionalPriceGroup: + ) -> DimensionalPriceGroupModel: """ Fetch dimensional price group @@ -152,7 +152,7 @@ def retrieve( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=DimensionalPriceGroup, + cast_to=DimensionalPriceGroupModel, ) def list( @@ -166,7 +166,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPage[DimensionalPriceGroup]: + ) -> SyncPage[DimensionalPriceGroupModel]: """List dimensional price groups Args: @@ -187,7 +187,7 @@ def list( """ return self._get_api_list( "/dimensional_price_groups", - page=SyncPage[DimensionalPriceGroup], + page=SyncPage[DimensionalPriceGroupModel], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -201,7 +201,7 @@ def list( dimensional_price_group_list_params.DimensionalPriceGroupListParams, ), ), - model=DimensionalPriceGroup, + model=DimensionalPriceGroupModel, ) @@ -244,7 +244,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> DimensionalPriceGroup: + ) -> DimensionalPriceGroupModel: """ A dimensional price group is used to partition the result of a billable metric by a set of dimensions. Prices in a price group must specify the parition used @@ -291,7 +291,7 @@ async def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=DimensionalPriceGroup, + cast_to=DimensionalPriceGroupModel, ) async def retrieve( @@ -304,7 +304,7 @@ async def retrieve( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DimensionalPriceGroup: + ) -> DimensionalPriceGroupModel: """ Fetch dimensional price group @@ -326,7 +326,7 @@ async def retrieve( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=DimensionalPriceGroup, + cast_to=DimensionalPriceGroupModel, ) def list( @@ -340,7 +340,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[DimensionalPriceGroup, AsyncPage[DimensionalPriceGroup]]: + ) -> AsyncPaginator[DimensionalPriceGroupModel, AsyncPage[DimensionalPriceGroupModel]]: """List dimensional price groups Args: @@ -361,7 +361,7 @@ def list( """ return self._get_api_list( "/dimensional_price_groups", - page=AsyncPage[DimensionalPriceGroup], + page=AsyncPage[DimensionalPriceGroupModel], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -375,7 +375,7 @@ def list( dimensional_price_group_list_params.DimensionalPriceGroupListParams, ), ), - model=DimensionalPriceGroup, + model=DimensionalPriceGroupModel, ) diff --git a/src/orb/resources/dimensional_price_groups/external_dimensional_price_group_id.py b/src/orb/resources/dimensional_price_groups/external_dimensional_price_group_id.py index ac6fd830..a51d6e0b 100644 --- a/src/orb/resources/dimensional_price_groups/external_dimensional_price_group_id.py +++ b/src/orb/resources/dimensional_price_groups/external_dimensional_price_group_id.py @@ -10,7 +10,7 @@ from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper from ..._base_client import make_request_options -from ...types.dimensional_price_group import DimensionalPriceGroup +from ...types.shared.dimensional_price_group_model import DimensionalPriceGroupModel __all__ = ["ExternalDimensionalPriceGroupID", "AsyncExternalDimensionalPriceGroupID"] @@ -45,7 +45,7 @@ def retrieve( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DimensionalPriceGroup: + ) -> DimensionalPriceGroupModel: """ Fetch dimensional price group by external ID @@ -67,7 +67,7 @@ def retrieve( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=DimensionalPriceGroup, + cast_to=DimensionalPriceGroupModel, ) @@ -101,7 +101,7 @@ async def retrieve( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DimensionalPriceGroup: + ) -> DimensionalPriceGroupModel: """ Fetch dimensional price group by external ID @@ -123,7 +123,7 @@ async def retrieve( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=DimensionalPriceGroup, + cast_to=DimensionalPriceGroupModel, ) diff --git a/src/orb/resources/events/backfills.py b/src/orb/resources/events/backfills.py index b3beb23d..46a0089f 100644 --- a/src/orb/resources/events/backfills.py +++ b/src/orb/resources/events/backfills.py @@ -19,11 +19,7 @@ from ...pagination import SyncPage, AsyncPage from ..._base_client import AsyncPaginator, make_request_options from ...types.events import backfill_list_params, backfill_create_params -from ...types.events.backfill_list_response import BackfillListResponse -from ...types.events.backfill_close_response import BackfillCloseResponse -from ...types.events.backfill_fetch_response import BackfillFetchResponse -from ...types.events.backfill_create_response import BackfillCreateResponse -from ...types.events.backfill_revert_response import BackfillRevertResponse +from ...types.shared.backfill_model import BackfillModel __all__ = ["Backfills", "AsyncBackfills"] @@ -65,7 +61,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> BackfillCreateResponse: + ) -> BackfillModel: """ Creating the backfill enables adding or replacing past events, even those that are older than the ingestion grace period. Performing a backfill in Orb involves @@ -158,7 +154,7 @@ def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=BackfillCreateResponse, + cast_to=BackfillModel, ) def list( @@ -172,7 +168,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPage[BackfillListResponse]: + ) -> SyncPage[BackfillModel]: """ This endpoint returns a list of all backfills in a list format. @@ -198,7 +194,7 @@ def list( """ return self._get_api_list( "/events/backfills", - page=SyncPage[BackfillListResponse], + page=SyncPage[BackfillModel], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -212,7 +208,7 @@ def list( backfill_list_params.BackfillListParams, ), ), - model=BackfillListResponse, + model=BackfillModel, ) def close( @@ -226,7 +222,7 @@ def close( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> BackfillCloseResponse: + ) -> BackfillModel: """Closing a backfill makes the updated usage visible in Orb. Upon closing a @@ -256,7 +252,7 @@ def close( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=BackfillCloseResponse, + cast_to=BackfillModel, ) def fetch( @@ -269,7 +265,7 @@ def fetch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BackfillFetchResponse: + ) -> BackfillModel: """ This endpoint is used to fetch a backfill given an identifier. @@ -289,7 +285,7 @@ def fetch( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=BackfillFetchResponse, + cast_to=BackfillModel, ) def revert( @@ -303,7 +299,7 @@ def revert( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> BackfillRevertResponse: + ) -> BackfillModel: """Reverting a backfill undoes all the effects of closing the backfill. If the @@ -336,7 +332,7 @@ def revert( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=BackfillRevertResponse, + cast_to=BackfillModel, ) @@ -377,7 +373,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> BackfillCreateResponse: + ) -> BackfillModel: """ Creating the backfill enables adding or replacing past events, even those that are older than the ingestion grace period. Performing a backfill in Orb involves @@ -470,7 +466,7 @@ async def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=BackfillCreateResponse, + cast_to=BackfillModel, ) def list( @@ -484,7 +480,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[BackfillListResponse, AsyncPage[BackfillListResponse]]: + ) -> AsyncPaginator[BackfillModel, AsyncPage[BackfillModel]]: """ This endpoint returns a list of all backfills in a list format. @@ -510,7 +506,7 @@ def list( """ return self._get_api_list( "/events/backfills", - page=AsyncPage[BackfillListResponse], + page=AsyncPage[BackfillModel], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -524,7 +520,7 @@ def list( backfill_list_params.BackfillListParams, ), ), - model=BackfillListResponse, + model=BackfillModel, ) async def close( @@ -538,7 +534,7 @@ async def close( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> BackfillCloseResponse: + ) -> BackfillModel: """Closing a backfill makes the updated usage visible in Orb. Upon closing a @@ -568,7 +564,7 @@ async def close( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=BackfillCloseResponse, + cast_to=BackfillModel, ) async def fetch( @@ -581,7 +577,7 @@ async def fetch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BackfillFetchResponse: + ) -> BackfillModel: """ This endpoint is used to fetch a backfill given an identifier. @@ -601,7 +597,7 @@ async def fetch( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=BackfillFetchResponse, + cast_to=BackfillModel, ) async def revert( @@ -615,7 +611,7 @@ async def revert( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> BackfillRevertResponse: + ) -> BackfillModel: """Reverting a backfill undoes all the effects of closing the backfill. If the @@ -648,7 +644,7 @@ async def revert( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=BackfillRevertResponse, + cast_to=BackfillModel, ) diff --git a/src/orb/resources/invoice_line_items.py b/src/orb/resources/invoice_line_items.py index 82c25b94..43a22c7d 100644 --- a/src/orb/resources/invoice_line_items.py +++ b/src/orb/resources/invoice_line_items.py @@ -18,7 +18,7 @@ from .._resource import SyncAPIResource, AsyncAPIResource from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper from .._base_client import make_request_options -from ..types.invoice_line_item_create_response import InvoiceLineItemCreateResponse +from ..types.shared.invoice_line_item_model import InvoiceLineItemModel __all__ = ["InvoiceLineItems", "AsyncInvoiceLineItems"] @@ -59,7 +59,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> InvoiceLineItemCreateResponse: + ) -> InvoiceLineItemModel: """This creates a one-off fixed fee invoice line item on an Invoice. This can only @@ -109,7 +109,7 @@ def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=InvoiceLineItemCreateResponse, + cast_to=InvoiceLineItemModel, ) @@ -149,7 +149,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> InvoiceLineItemCreateResponse: + ) -> InvoiceLineItemModel: """This creates a one-off fixed fee invoice line item on an Invoice. This can only @@ -199,7 +199,7 @@ async def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=InvoiceLineItemCreateResponse, + cast_to=InvoiceLineItemModel, ) diff --git a/src/orb/resources/invoices.py b/src/orb/resources/invoices.py index 22c82be0..93e6d0a2 100644 --- a/src/orb/resources/invoices.py +++ b/src/orb/resources/invoices.py @@ -27,7 +27,7 @@ from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper from ..pagination import SyncPage, AsyncPage from .._base_client import AsyncPaginator, make_request_options -from ..types.invoice import Invoice +from ..types.shared.invoice_model import InvoiceModel from ..types.shared_params.discount import Discount from ..types.invoice_fetch_upcoming_response import InvoiceFetchUpcomingResponse @@ -74,7 +74,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Invoice: + ) -> InvoiceModel: """ This endpoint is used to create a one-off invoice for a customer. @@ -141,7 +141,7 @@ def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=Invoice, + cast_to=InvoiceModel, ) def update( @@ -156,7 +156,7 @@ def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Invoice: + ) -> InvoiceModel: """This endpoint allows you to update the `metadata` property on an invoice. If you @@ -192,7 +192,7 @@ def update( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=Invoice, + cast_to=InvoiceModel, ) def list( @@ -223,7 +223,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPage[Invoice]: + ) -> SyncPage[InvoiceModel]: """ This endpoint returns a list of all [`Invoice`](/core-concepts#invoice)s for an account in a list format. @@ -260,7 +260,7 @@ def list( """ return self._get_api_list( "/invoices", - page=SyncPage[Invoice], + page=SyncPage[InvoiceModel], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -291,7 +291,7 @@ def list( invoice_list_params.InvoiceListParams, ), ), - model=Invoice, + model=InvoiceModel, ) def fetch( @@ -304,7 +304,7 @@ def fetch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Invoice: + ) -> InvoiceModel: """ This endpoint is used to fetch an [`Invoice`](/core-concepts#invoice) given an identifier. @@ -325,7 +325,7 @@ def fetch( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=Invoice, + cast_to=InvoiceModel, ) def fetch_upcoming( @@ -379,7 +379,7 @@ def issue( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Invoice: + ) -> InvoiceModel: """This endpoint allows an eligible invoice to be issued manually. This is only @@ -418,7 +418,7 @@ def issue( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=Invoice, + cast_to=InvoiceModel, ) def mark_paid( @@ -435,7 +435,7 @@ def mark_paid( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Invoice: + ) -> InvoiceModel: """This endpoint allows an invoice's status to be set the `paid` status. This can @@ -477,7 +477,7 @@ def mark_paid( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=Invoice, + cast_to=InvoiceModel, ) def pay( @@ -491,7 +491,7 @@ def pay( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Invoice: + ) -> InvoiceModel: """ This endpoint collects payment for an invoice using the customer's default payment method. This action can only be taken on invoices with status "issued". @@ -518,7 +518,7 @@ def pay( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=Invoice, + cast_to=InvoiceModel, ) def void( @@ -532,7 +532,7 @@ def void( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Invoice: + ) -> InvoiceModel: """This endpoint allows an invoice's status to be set the `void` status. This can @@ -569,7 +569,7 @@ def void( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=Invoice, + cast_to=InvoiceModel, ) @@ -613,7 +613,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Invoice: + ) -> InvoiceModel: """ This endpoint is used to create a one-off invoice for a customer. @@ -680,7 +680,7 @@ async def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=Invoice, + cast_to=InvoiceModel, ) async def update( @@ -695,7 +695,7 @@ async def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Invoice: + ) -> InvoiceModel: """This endpoint allows you to update the `metadata` property on an invoice. If you @@ -731,7 +731,7 @@ async def update( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=Invoice, + cast_to=InvoiceModel, ) def list( @@ -762,7 +762,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[Invoice, AsyncPage[Invoice]]: + ) -> AsyncPaginator[InvoiceModel, AsyncPage[InvoiceModel]]: """ This endpoint returns a list of all [`Invoice`](/core-concepts#invoice)s for an account in a list format. @@ -799,7 +799,7 @@ def list( """ return self._get_api_list( "/invoices", - page=AsyncPage[Invoice], + page=AsyncPage[InvoiceModel], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -830,7 +830,7 @@ def list( invoice_list_params.InvoiceListParams, ), ), - model=Invoice, + model=InvoiceModel, ) async def fetch( @@ -843,7 +843,7 @@ async def fetch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Invoice: + ) -> InvoiceModel: """ This endpoint is used to fetch an [`Invoice`](/core-concepts#invoice) given an identifier. @@ -864,7 +864,7 @@ async def fetch( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=Invoice, + cast_to=InvoiceModel, ) async def fetch_upcoming( @@ -918,7 +918,7 @@ async def issue( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Invoice: + ) -> InvoiceModel: """This endpoint allows an eligible invoice to be issued manually. This is only @@ -957,7 +957,7 @@ async def issue( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=Invoice, + cast_to=InvoiceModel, ) async def mark_paid( @@ -974,7 +974,7 @@ async def mark_paid( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Invoice: + ) -> InvoiceModel: """This endpoint allows an invoice's status to be set the `paid` status. This can @@ -1016,7 +1016,7 @@ async def mark_paid( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=Invoice, + cast_to=InvoiceModel, ) async def pay( @@ -1030,7 +1030,7 @@ async def pay( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Invoice: + ) -> InvoiceModel: """ This endpoint collects payment for an invoice using the customer's default payment method. This action can only be taken on invoices with status "issued". @@ -1057,7 +1057,7 @@ async def pay( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=Invoice, + cast_to=InvoiceModel, ) async def void( @@ -1071,7 +1071,7 @@ async def void( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Invoice: + ) -> InvoiceModel: """This endpoint allows an invoice's status to be set the `void` status. This can @@ -1108,7 +1108,7 @@ async def void( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=Invoice, + cast_to=InvoiceModel, ) diff --git a/src/orb/resources/items.py b/src/orb/resources/items.py index 8e584391..c5834c6d 100644 --- a/src/orb/resources/items.py +++ b/src/orb/resources/items.py @@ -17,8 +17,9 @@ from .._resource import SyncAPIResource, AsyncAPIResource from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper from ..pagination import SyncPage, AsyncPage -from ..types.item import Item from .._base_client import AsyncPaginator, make_request_options +from ..types.shared.item_model import ItemModel +from ..types.shared_params.item_external_connection_model import ItemExternalConnectionModel __all__ = ["Items", "AsyncItems"] @@ -54,7 +55,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Item: + ) -> ItemModel: """ This endpoint is used to create an [Item](/core-concepts#item). @@ -81,14 +82,14 @@ def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=Item, + cast_to=ItemModel, ) def update( self, item_id: str, *, - external_connections: Optional[Iterable[item_update_params.ExternalConnection]] | NotGiven = NOT_GIVEN, + external_connections: Optional[Iterable[ItemExternalConnectionModel]] | NotGiven = NOT_GIVEN, name: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -97,7 +98,7 @@ def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Item: + ) -> ItemModel: """ This endpoint can be used to update properties on the Item. @@ -130,7 +131,7 @@ def update( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=Item, + cast_to=ItemModel, ) def list( @@ -144,7 +145,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPage[Item]: + ) -> SyncPage[ItemModel]: """ This endpoint returns a list of all Items, ordered in descending order by creation time. @@ -165,7 +166,7 @@ def list( """ return self._get_api_list( "/items", - page=SyncPage[Item], + page=SyncPage[ItemModel], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -179,7 +180,7 @@ def list( item_list_params.ItemListParams, ), ), - model=Item, + model=ItemModel, ) def fetch( @@ -192,7 +193,7 @@ def fetch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Item: + ) -> ItemModel: """ This endpoint returns an item identified by its item_id. @@ -212,7 +213,7 @@ def fetch( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=Item, + cast_to=ItemModel, ) @@ -247,7 +248,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Item: + ) -> ItemModel: """ This endpoint is used to create an [Item](/core-concepts#item). @@ -274,14 +275,14 @@ async def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=Item, + cast_to=ItemModel, ) async def update( self, item_id: str, *, - external_connections: Optional[Iterable[item_update_params.ExternalConnection]] | NotGiven = NOT_GIVEN, + external_connections: Optional[Iterable[ItemExternalConnectionModel]] | NotGiven = NOT_GIVEN, name: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -290,7 +291,7 @@ async def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Item: + ) -> ItemModel: """ This endpoint can be used to update properties on the Item. @@ -323,7 +324,7 @@ async def update( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=Item, + cast_to=ItemModel, ) def list( @@ -337,7 +338,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[Item, AsyncPage[Item]]: + ) -> AsyncPaginator[ItemModel, AsyncPage[ItemModel]]: """ This endpoint returns a list of all Items, ordered in descending order by creation time. @@ -358,7 +359,7 @@ def list( """ return self._get_api_list( "/items", - page=AsyncPage[Item], + page=AsyncPage[ItemModel], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -372,7 +373,7 @@ def list( item_list_params.ItemListParams, ), ), - model=Item, + model=ItemModel, ) async def fetch( @@ -385,7 +386,7 @@ async def fetch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Item: + ) -> ItemModel: """ This endpoint returns an item identified by its item_id. @@ -405,7 +406,7 @@ async def fetch( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=Item, + cast_to=ItemModel, ) diff --git a/src/orb/resources/metrics.py b/src/orb/resources/metrics.py index 8b78b8c4..f6be3792 100644 --- a/src/orb/resources/metrics.py +++ b/src/orb/resources/metrics.py @@ -19,7 +19,7 @@ from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper from ..pagination import SyncPage, AsyncPage from .._base_client import AsyncPaginator, make_request_options -from ..types.billable_metric import BillableMetric +from ..types.shared.billable_metric_model import BillableMetricModel __all__ = ["Metrics", "AsyncMetrics"] @@ -59,7 +59,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> BillableMetric: + ) -> BillableMetricModel: """ This endpoint is used to create a [metric](/core-concepts###metric) using a SQL string. See [SQL support](/extensibility/advanced-metrics#sql-support) for a @@ -107,7 +107,7 @@ def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=BillableMetric, + cast_to=BillableMetricModel, ) def update( @@ -122,7 +122,7 @@ def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> BillableMetric: + ) -> BillableMetricModel: """This endpoint allows you to update the `metadata` property on a metric. If you @@ -156,7 +156,7 @@ def update( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=BillableMetric, + cast_to=BillableMetricModel, ) def list( @@ -174,7 +174,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPage[BillableMetric]: + ) -> SyncPage[BillableMetricModel]: """ This endpoint is used to fetch [metric](/core-concepts##metric) details given a metric identifier. It returns information about the metrics including its name, @@ -196,7 +196,7 @@ def list( """ return self._get_api_list( "/metrics", - page=SyncPage[BillableMetric], + page=SyncPage[BillableMetricModel], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -214,7 +214,7 @@ def list( metric_list_params.MetricListParams, ), ), - model=BillableMetric, + model=BillableMetricModel, ) def fetch( @@ -227,7 +227,7 @@ def fetch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BillableMetric: + ) -> BillableMetricModel: """This endpoint is used to list [metrics](/core-concepts#metric). It returns @@ -249,7 +249,7 @@ def fetch( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=BillableMetric, + cast_to=BillableMetricModel, ) @@ -288,7 +288,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> BillableMetric: + ) -> BillableMetricModel: """ This endpoint is used to create a [metric](/core-concepts###metric) using a SQL string. See [SQL support](/extensibility/advanced-metrics#sql-support) for a @@ -336,7 +336,7 @@ async def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=BillableMetric, + cast_to=BillableMetricModel, ) async def update( @@ -351,7 +351,7 @@ async def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> BillableMetric: + ) -> BillableMetricModel: """This endpoint allows you to update the `metadata` property on a metric. If you @@ -385,7 +385,7 @@ async def update( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=BillableMetric, + cast_to=BillableMetricModel, ) def list( @@ -403,7 +403,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[BillableMetric, AsyncPage[BillableMetric]]: + ) -> AsyncPaginator[BillableMetricModel, AsyncPage[BillableMetricModel]]: """ This endpoint is used to fetch [metric](/core-concepts##metric) details given a metric identifier. It returns information about the metrics including its name, @@ -425,7 +425,7 @@ def list( """ return self._get_api_list( "/metrics", - page=AsyncPage[BillableMetric], + page=AsyncPage[BillableMetricModel], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -443,7 +443,7 @@ def list( metric_list_params.MetricListParams, ), ), - model=BillableMetric, + model=BillableMetricModel, ) async def fetch( @@ -456,7 +456,7 @@ async def fetch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BillableMetric: + ) -> BillableMetricModel: """This endpoint is used to list [metrics](/core-concepts#metric). It returns @@ -478,7 +478,7 @@ async def fetch( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=BillableMetric, + cast_to=BillableMetricModel, ) diff --git a/src/orb/resources/plans/external_plan_id.py b/src/orb/resources/plans/external_plan_id.py index 69d7b5b0..a8db29ef 100644 --- a/src/orb/resources/plans/external_plan_id.py +++ b/src/orb/resources/plans/external_plan_id.py @@ -15,9 +15,9 @@ from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper -from ...types.plan import Plan from ...types.plans import external_plan_id_update_params from ..._base_client import make_request_options +from ...types.shared.plan_model import PlanModel __all__ = ["ExternalPlanID", "AsyncExternalPlanID"] @@ -55,7 +55,7 @@ def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Plan: + ) -> PlanModel: """ This endpoint can be used to update the `external_plan_id`, and `metadata` of an existing plan. @@ -101,7 +101,7 @@ def update( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=Plan, + cast_to=PlanModel, ) def fetch( @@ -114,7 +114,7 @@ def fetch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Plan: + ) -> PlanModel: """ This endpoint is used to fetch [plan](/core-concepts##plan-and-price) details given an external_plan_id identifier. It returns information about the prices @@ -149,7 +149,7 @@ def fetch( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=Plan, + cast_to=PlanModel, ) @@ -186,7 +186,7 @@ async def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Plan: + ) -> PlanModel: """ This endpoint can be used to update the `external_plan_id`, and `metadata` of an existing plan. @@ -232,7 +232,7 @@ async def update( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=Plan, + cast_to=PlanModel, ) async def fetch( @@ -245,7 +245,7 @@ async def fetch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Plan: + ) -> PlanModel: """ This endpoint is used to fetch [plan](/core-concepts##plan-and-price) details given an external_plan_id identifier. It returns information about the prices @@ -280,7 +280,7 @@ async def fetch( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=Plan, + cast_to=PlanModel, ) diff --git a/src/orb/resources/plans/plans.py b/src/orb/resources/plans/plans.py index c1ad4691..8f979a71 100644 --- a/src/orb/resources/plans/plans.py +++ b/src/orb/resources/plans/plans.py @@ -19,7 +19,6 @@ from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper from ...pagination import SyncPage, AsyncPage -from ...types.plan import Plan from ..._base_client import AsyncPaginator, make_request_options from .external_plan_id import ( ExternalPlanID, @@ -29,6 +28,7 @@ ExternalPlanIDWithStreamingResponse, AsyncExternalPlanIDWithStreamingResponse, ) +from ...types.shared.plan_model import PlanModel __all__ = ["Plans", "AsyncPlans"] @@ -75,7 +75,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Plan: + ) -> PlanModel: """ This endpoint allows creation of plans including their prices. @@ -131,7 +131,7 @@ def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=Plan, + cast_to=PlanModel, ) def update( @@ -147,7 +147,7 @@ def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Plan: + ) -> PlanModel: """ This endpoint can be used to update the `external_plan_id`, and `metadata` of an existing plan. @@ -191,7 +191,7 @@ def update( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=Plan, + cast_to=PlanModel, ) def list( @@ -210,7 +210,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPage[Plan]: + ) -> SyncPage[PlanModel]: """ This endpoint returns a list of all [plans](/core-concepts#plan-and-price) for an account in a list format. The list of plans is ordered starting from the most @@ -236,7 +236,7 @@ def list( """ return self._get_api_list( "/plans", - page=SyncPage[Plan], + page=SyncPage[PlanModel], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -255,7 +255,7 @@ def list( plan_list_params.PlanListParams, ), ), - model=Plan, + model=PlanModel, ) def fetch( @@ -268,7 +268,7 @@ def fetch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Plan: + ) -> PlanModel: """ This endpoint is used to fetch [plan](/core-concepts#plan-and-price) details given a plan identifier. It returns information about the prices included in the @@ -304,7 +304,7 @@ def fetch( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=Plan, + cast_to=PlanModel, ) @@ -350,7 +350,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Plan: + ) -> PlanModel: """ This endpoint allows creation of plans including their prices. @@ -406,7 +406,7 @@ async def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=Plan, + cast_to=PlanModel, ) async def update( @@ -422,7 +422,7 @@ async def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Plan: + ) -> PlanModel: """ This endpoint can be used to update the `external_plan_id`, and `metadata` of an existing plan. @@ -466,7 +466,7 @@ async def update( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=Plan, + cast_to=PlanModel, ) def list( @@ -485,7 +485,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[Plan, AsyncPage[Plan]]: + ) -> AsyncPaginator[PlanModel, AsyncPage[PlanModel]]: """ This endpoint returns a list of all [plans](/core-concepts#plan-and-price) for an account in a list format. The list of plans is ordered starting from the most @@ -511,7 +511,7 @@ def list( """ return self._get_api_list( "/plans", - page=AsyncPage[Plan], + page=AsyncPage[PlanModel], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -530,7 +530,7 @@ def list( plan_list_params.PlanListParams, ), ), - model=Plan, + model=PlanModel, ) async def fetch( @@ -543,7 +543,7 @@ async def fetch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Plan: + ) -> PlanModel: """ This endpoint is used to fetch [plan](/core-concepts#plan-and-price) details given a plan identifier. It returns information about the prices included in the @@ -579,7 +579,7 @@ async def fetch( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=Plan, + cast_to=PlanModel, ) diff --git a/src/orb/resources/prices/external_price_id.py b/src/orb/resources/prices/external_price_id.py index 4fbfe25e..8d1408a5 100644 --- a/src/orb/resources/prices/external_price_id.py +++ b/src/orb/resources/prices/external_price_id.py @@ -15,9 +15,9 @@ from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper -from ...types.price import Price from ..._base_client import make_request_options from ...types.prices import external_price_id_update_params +from ...types.shared.price_model import PriceModel __all__ = ["ExternalPriceID", "AsyncExternalPriceID"] @@ -54,7 +54,7 @@ def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """This endpoint allows you to update the `metadata` property on a price. If you @@ -79,7 +79,7 @@ def update( if not external_price_id: raise ValueError(f"Expected a non-empty value for `external_price_id` but received {external_price_id!r}") return cast( - Price, + PriceModel, self._put( f"/prices/external_price_id/{external_price_id}", body=maybe_transform( @@ -92,7 +92,7 @@ def update( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=cast(Any, Price), # Union types cannot be passed in as arguments in the type system + cast_to=cast(Any, PriceModel), # Union types cannot be passed in as arguments in the type system ), ) @@ -106,7 +106,7 @@ def fetch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Price: + ) -> PriceModel: """This endpoint returns a price given an external price id. See the @@ -125,13 +125,13 @@ def fetch( if not external_price_id: raise ValueError(f"Expected a non-empty value for `external_price_id` but received {external_price_id!r}") return cast( - Price, + PriceModel, self._get( f"/prices/external_price_id/{external_price_id}", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Any, Price), # Union types cannot be passed in as arguments in the type system + cast_to=cast(Any, PriceModel), # Union types cannot be passed in as arguments in the type system ), ) @@ -168,7 +168,7 @@ async def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """This endpoint allows you to update the `metadata` property on a price. If you @@ -193,7 +193,7 @@ async def update( if not external_price_id: raise ValueError(f"Expected a non-empty value for `external_price_id` but received {external_price_id!r}") return cast( - Price, + PriceModel, await self._put( f"/prices/external_price_id/{external_price_id}", body=await async_maybe_transform( @@ -206,7 +206,7 @@ async def update( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=cast(Any, Price), # Union types cannot be passed in as arguments in the type system + cast_to=cast(Any, PriceModel), # Union types cannot be passed in as arguments in the type system ), ) @@ -220,7 +220,7 @@ async def fetch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Price: + ) -> PriceModel: """This endpoint returns a price given an external price id. See the @@ -239,13 +239,13 @@ async def fetch( if not external_price_id: raise ValueError(f"Expected a non-empty value for `external_price_id` but received {external_price_id!r}") return cast( - Price, + PriceModel, await self._get( f"/prices/external_price_id/{external_price_id}", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Any, Price), # Union types cannot be passed in as arguments in the type system + cast_to=cast(Any, PriceModel), # Union types cannot be passed in as arguments in the type system ), ) diff --git a/src/orb/resources/prices/prices.py b/src/orb/resources/prices/prices.py index 608900f9..f750b5b6 100644 --- a/src/orb/resources/prices/prices.py +++ b/src/orb/resources/prices/prices.py @@ -9,7 +9,12 @@ import httpx from ... import _legacy_response -from ...types import price_list_params, price_create_params, price_update_params, price_evaluate_params +from ...types import ( + price_list_params, + price_create_params, + price_update_params, + price_evaluate_params, +) from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( required_args, @@ -20,7 +25,6 @@ from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper from ...pagination import SyncPage, AsyncPage -from ...types.price import Price from ..._base_client import AsyncPaginator, make_request_options from .external_price_id import ( ExternalPriceID, @@ -30,7 +34,19 @@ ExternalPriceIDWithStreamingResponse, AsyncExternalPriceIDWithStreamingResponse, ) +from ...types.shared.price_model import PriceModel from ...types.price_evaluate_response import PriceEvaluateResponse +from ...types.shared_params.bps_config_model import BpsConfigModel +from ...types.shared_params.bulk_config_model import BulkConfigModel +from ...types.shared_params.unit_config_model import UnitConfigModel +from ...types.shared_params.matrix_config_model import MatrixConfigModel +from ...types.shared_params.tiered_config_model import TieredConfigModel +from ...types.shared_params.package_config_model import PackageConfigModel +from ...types.shared_params.bulk_bps_config_model import BulkBpsConfigModel +from ...types.shared_params.tiered_bps_config_model import TieredBpsConfigModel +from ...types.shared_params.custom_rating_function_config_model import CustomRatingFunctionConfigModel +from ...types.shared_params.matrix_with_allocation_config_model import MatrixWithAllocationConfigModel +from ...types.shared_params.new_billing_cycle_configuration_model import NewBillingCycleConfigurationModel __all__ = ["Prices", "AsyncPrices"] @@ -68,17 +84,15 @@ def create( item_id: str, model_type: Literal["unit"], name: str, - unit_config: price_create_params.NewFloatingUnitPriceUnitConfig, + unit_config: UnitConfigModel, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[price_create_params.NewFloatingUnitPriceBillingCycleConfiguration] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[price_create_params.NewFloatingUnitPriceInvoicingCycleConfiguration] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -87,7 +101,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -155,17 +169,15 @@ def create( item_id: str, model_type: Literal["package"], name: str, - package_config: price_create_params.NewFloatingPackagePricePackageConfig, + package_config: PackageConfigModel, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[price_create_params.NewFloatingPackagePriceBillingCycleConfiguration] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[price_create_params.NewFloatingPackagePriceInvoicingCycleConfiguration] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -174,7 +186,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -240,19 +252,17 @@ def create( cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, item_id: str, - matrix_config: price_create_params.NewFloatingMatrixPriceMatrixConfig, + matrix_config: MatrixConfigModel, model_type: Literal["matrix"], name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[price_create_params.NewFloatingMatrixPriceBillingCycleConfiguration] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[price_create_params.NewFloatingMatrixPriceInvoicingCycleConfiguration] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -261,7 +271,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -327,23 +337,17 @@ def create( cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, item_id: str, - matrix_with_allocation_config: price_create_params.NewFloatingMatrixWithAllocationPriceMatrixWithAllocationConfig, + matrix_with_allocation_config: MatrixWithAllocationConfigModel, model_type: Literal["matrix_with_allocation"], name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[ - price_create_params.NewFloatingMatrixWithAllocationPriceBillingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[ - price_create_params.NewFloatingMatrixWithAllocationPriceInvoicingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -352,7 +356,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -420,17 +424,15 @@ def create( item_id: str, model_type: Literal["tiered"], name: str, - tiered_config: price_create_params.NewFloatingTieredPriceTieredConfig, + tiered_config: TieredConfigModel, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[price_create_params.NewFloatingTieredPriceBillingCycleConfiguration] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[price_create_params.NewFloatingTieredPriceInvoicingCycleConfiguration] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -439,7 +441,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -507,19 +509,15 @@ def create( item_id: str, model_type: Literal["tiered_bps"], name: str, - tiered_bps_config: price_create_params.NewFloatingTieredBpsPriceTieredBpsConfig, + tiered_bps_config: TieredBpsConfigModel, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[price_create_params.NewFloatingTieredBpsPriceBillingCycleConfiguration] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[ - price_create_params.NewFloatingTieredBpsPriceInvoicingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -528,7 +526,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -591,7 +589,7 @@ def create( def create( self, *, - bps_config: price_create_params.NewFloatingBpsPriceBpsConfig, + bps_config: BpsConfigModel, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, item_id: str, @@ -599,14 +597,12 @@ def create( name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[price_create_params.NewFloatingBpsPriceBillingCycleConfiguration] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[price_create_params.NewFloatingBpsPriceInvoicingCycleConfiguration] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -615,7 +611,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -678,7 +674,7 @@ def create( def create( self, *, - bulk_bps_config: price_create_params.NewFloatingBulkBpsPriceBulkBpsConfig, + bulk_bps_config: BulkBpsConfigModel, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, item_id: str, @@ -686,14 +682,12 @@ def create( name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[price_create_params.NewFloatingBulkBpsPriceBillingCycleConfiguration] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[price_create_params.NewFloatingBulkBpsPriceInvoicingCycleConfiguration] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -702,7 +696,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -765,7 +759,7 @@ def create( def create( self, *, - bulk_config: price_create_params.NewFloatingBulkPriceBulkConfig, + bulk_config: BulkConfigModel, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, item_id: str, @@ -773,14 +767,12 @@ def create( name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[price_create_params.NewFloatingBulkPriceBillingCycleConfiguration] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[price_create_params.NewFloatingBulkPriceInvoicingCycleConfiguration] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -789,7 +781,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -857,21 +849,15 @@ def create( item_id: str, model_type: Literal["threshold_total_amount"], name: str, - threshold_total_amount_config: Dict[str, object], + threshold_total_amount_config: CustomRatingFunctionConfigModel, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[ - price_create_params.NewFloatingThresholdTotalAmountPriceBillingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[ - price_create_params.NewFloatingThresholdTotalAmountPriceInvoicingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -880,7 +866,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -948,21 +934,15 @@ def create( item_id: str, model_type: Literal["tiered_package"], name: str, - tiered_package_config: Dict[str, object], + tiered_package_config: CustomRatingFunctionConfigModel, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[ - price_create_params.NewFloatingTieredPackagePriceBillingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[ - price_create_params.NewFloatingTieredPackagePriceInvoicingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -971,7 +951,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -1036,24 +1016,18 @@ def create( *, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, - grouped_tiered_config: Dict[str, object], + grouped_tiered_config: CustomRatingFunctionConfigModel, item_id: str, model_type: Literal["grouped_tiered"], name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[ - price_create_params.NewFloatingGroupedTieredPriceBillingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[ - price_create_params.NewFloatingGroupedTieredPriceInvoicingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1062,7 +1036,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -1128,23 +1102,17 @@ def create( cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, item_id: str, - max_group_tiered_package_config: Dict[str, object], + max_group_tiered_package_config: CustomRatingFunctionConfigModel, model_type: Literal["max_group_tiered_package"], name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[ - price_create_params.NewFloatingMaxGroupTieredPackagePriceBillingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[ - price_create_params.NewFloatingMaxGroupTieredPackagePriceInvoicingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1153,7 +1121,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -1221,21 +1189,15 @@ def create( item_id: str, model_type: Literal["tiered_with_minimum"], name: str, - tiered_with_minimum_config: Dict[str, object], + tiered_with_minimum_config: CustomRatingFunctionConfigModel, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[ - price_create_params.NewFloatingTieredWithMinimumPriceBillingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[ - price_create_params.NewFloatingTieredWithMinimumPriceInvoicingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1244,7 +1206,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -1312,21 +1274,15 @@ def create( item_id: str, model_type: Literal["package_with_allocation"], name: str, - package_with_allocation_config: Dict[str, object], + package_with_allocation_config: CustomRatingFunctionConfigModel, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[ - price_create_params.NewFloatingPackageWithAllocationPriceBillingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[ - price_create_params.NewFloatingPackageWithAllocationPriceInvoicingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1335,7 +1291,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -1403,21 +1359,15 @@ def create( item_id: str, model_type: Literal["tiered_package_with_minimum"], name: str, - tiered_package_with_minimum_config: Dict[str, object], + tiered_package_with_minimum_config: CustomRatingFunctionConfigModel, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[ - price_create_params.NewFloatingTieredPackageWithMinimumPriceBillingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[ - price_create_params.NewFloatingTieredPackageWithMinimumPriceInvoicingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1426,7 +1376,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -1494,21 +1444,15 @@ def create( item_id: str, model_type: Literal["unit_with_percent"], name: str, - unit_with_percent_config: Dict[str, object], + unit_with_percent_config: CustomRatingFunctionConfigModel, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[ - price_create_params.NewFloatingUnitWithPercentPriceBillingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[ - price_create_params.NewFloatingUnitWithPercentPriceInvoicingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1517,7 +1461,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -1585,21 +1529,15 @@ def create( item_id: str, model_type: Literal["tiered_with_proration"], name: str, - tiered_with_proration_config: Dict[str, object], + tiered_with_proration_config: CustomRatingFunctionConfigModel, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[ - price_create_params.NewFloatingTieredWithProrationPriceBillingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[ - price_create_params.NewFloatingTieredWithProrationPriceInvoicingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1608,7 +1546,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -1676,21 +1614,15 @@ def create( item_id: str, model_type: Literal["unit_with_proration"], name: str, - unit_with_proration_config: Dict[str, object], + unit_with_proration_config: CustomRatingFunctionConfigModel, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[ - price_create_params.NewFloatingUnitWithProrationPriceBillingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[ - price_create_params.NewFloatingUnitWithProrationPriceInvoicingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1699,7 +1631,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -1764,24 +1696,18 @@ def create( *, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, - grouped_allocation_config: Dict[str, object], + grouped_allocation_config: CustomRatingFunctionConfigModel, item_id: str, model_type: Literal["grouped_allocation"], name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[ - price_create_params.NewFloatingGroupedAllocationPriceBillingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[ - price_create_params.NewFloatingGroupedAllocationPriceInvoicingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1790,7 +1716,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -1855,24 +1781,18 @@ def create( *, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, - grouped_with_prorated_minimum_config: Dict[str, object], + grouped_with_prorated_minimum_config: CustomRatingFunctionConfigModel, item_id: str, model_type: Literal["grouped_with_prorated_minimum"], name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[ - price_create_params.NewFloatingGroupedWithProratedMinimumPriceBillingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[ - price_create_params.NewFloatingGroupedWithProratedMinimumPriceInvoicingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1881,7 +1801,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -1946,24 +1866,18 @@ def create( *, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, - grouped_with_metered_minimum_config: Dict[str, object], + grouped_with_metered_minimum_config: CustomRatingFunctionConfigModel, item_id: str, model_type: Literal["grouped_with_metered_minimum"], name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[ - price_create_params.NewFloatingGroupedWithMeteredMinimumPriceBillingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[ - price_create_params.NewFloatingGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1972,7 +1886,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -2038,23 +1952,17 @@ def create( cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, item_id: str, - matrix_with_display_name_config: Dict[str, object], + matrix_with_display_name_config: CustomRatingFunctionConfigModel, model_type: Literal["matrix_with_display_name"], name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[ - price_create_params.NewFloatingMatrixWithDisplayNamePriceBillingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[ - price_create_params.NewFloatingMatrixWithDisplayNamePriceInvoicingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -2063,7 +1971,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -2126,7 +2034,7 @@ def create( def create( self, *, - bulk_with_proration_config: Dict[str, object], + bulk_with_proration_config: CustomRatingFunctionConfigModel, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, item_id: str, @@ -2134,18 +2042,12 @@ def create( name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[ - price_create_params.NewFloatingBulkWithProrationPriceBillingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[ - price_create_params.NewFloatingBulkWithProrationPriceInvoicingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -2154,7 +2056,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -2219,24 +2121,18 @@ def create( *, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, - grouped_tiered_package_config: Dict[str, object], + grouped_tiered_package_config: CustomRatingFunctionConfigModel, item_id: str, model_type: Literal["grouped_tiered_package"], name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[ - price_create_params.NewFloatingGroupedTieredPackagePriceBillingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[ - price_create_params.NewFloatingGroupedTieredPackagePriceInvoicingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -2245,7 +2141,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -2313,21 +2209,15 @@ def create( item_id: str, model_type: Literal["scalable_matrix_with_unit_pricing"], name: str, - scalable_matrix_with_unit_pricing_config: Dict[str, object], + scalable_matrix_with_unit_pricing_config: CustomRatingFunctionConfigModel, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[ - price_create_params.NewFloatingScalableMatrixWithUnitPricingPriceBillingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[ - price_create_params.NewFloatingScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -2336,7 +2226,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -2404,21 +2294,15 @@ def create( item_id: str, model_type: Literal["scalable_matrix_with_tiered_pricing"], name: str, - scalable_matrix_with_tiered_pricing_config: Dict[str, object], + scalable_matrix_with_tiered_pricing_config: CustomRatingFunctionConfigModel, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[ - price_create_params.NewFloatingScalableMatrixWithTieredPricingPriceBillingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[ - price_create_params.NewFloatingScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -2427,7 +2311,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -2491,25 +2375,19 @@ def create( self, *, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], - cumulative_grouped_bulk_config: Dict[str, object], + cumulative_grouped_bulk_config: CustomRatingFunctionConfigModel, currency: str, item_id: str, model_type: Literal["cumulative_grouped_bulk"], name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[ - price_create_params.NewFloatingCumulativeGroupedBulkPriceBillingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[ - price_create_params.NewFloatingCumulativeGroupedBulkPriceInvoicingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -2518,7 +2396,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -2642,46 +2520,43 @@ def create( | Literal["scalable_matrix_with_tiered_pricing"] | Literal["cumulative_grouped_bulk"], name: str, - unit_config: price_create_params.NewFloatingUnitPriceUnitConfig | NotGiven = NOT_GIVEN, + unit_config: UnitConfigModel | NotGiven = NOT_GIVEN, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[price_create_params.NewFloatingUnitPriceBillingCycleConfiguration] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[price_create_params.NewFloatingUnitPriceInvoicingCycleConfiguration] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, - package_config: price_create_params.NewFloatingPackagePricePackageConfig | NotGiven = NOT_GIVEN, - matrix_config: price_create_params.NewFloatingMatrixPriceMatrixConfig | NotGiven = NOT_GIVEN, - matrix_with_allocation_config: price_create_params.NewFloatingMatrixWithAllocationPriceMatrixWithAllocationConfig - | NotGiven = NOT_GIVEN, - tiered_config: price_create_params.NewFloatingTieredPriceTieredConfig | NotGiven = NOT_GIVEN, - tiered_bps_config: price_create_params.NewFloatingTieredBpsPriceTieredBpsConfig | NotGiven = NOT_GIVEN, - bps_config: price_create_params.NewFloatingBpsPriceBpsConfig | NotGiven = NOT_GIVEN, - bulk_bps_config: price_create_params.NewFloatingBulkBpsPriceBulkBpsConfig | NotGiven = NOT_GIVEN, - bulk_config: price_create_params.NewFloatingBulkPriceBulkConfig | NotGiven = NOT_GIVEN, - threshold_total_amount_config: Dict[str, object] | NotGiven = NOT_GIVEN, - tiered_package_config: Dict[str, object] | NotGiven = NOT_GIVEN, - grouped_tiered_config: Dict[str, object] | NotGiven = NOT_GIVEN, - max_group_tiered_package_config: Dict[str, object] | NotGiven = NOT_GIVEN, - tiered_with_minimum_config: Dict[str, object] | NotGiven = NOT_GIVEN, - package_with_allocation_config: Dict[str, object] | NotGiven = NOT_GIVEN, - tiered_package_with_minimum_config: Dict[str, object] | NotGiven = NOT_GIVEN, - unit_with_percent_config: Dict[str, object] | NotGiven = NOT_GIVEN, - tiered_with_proration_config: Dict[str, object] | NotGiven = NOT_GIVEN, - unit_with_proration_config: Dict[str, object] | NotGiven = NOT_GIVEN, - grouped_allocation_config: Dict[str, object] | NotGiven = NOT_GIVEN, - grouped_with_prorated_minimum_config: Dict[str, object] | NotGiven = NOT_GIVEN, - grouped_with_metered_minimum_config: Dict[str, object] | NotGiven = NOT_GIVEN, - matrix_with_display_name_config: Dict[str, object] | NotGiven = NOT_GIVEN, - bulk_with_proration_config: Dict[str, object] | NotGiven = NOT_GIVEN, - grouped_tiered_package_config: Dict[str, object] | NotGiven = NOT_GIVEN, - scalable_matrix_with_unit_pricing_config: Dict[str, object] | NotGiven = NOT_GIVEN, - scalable_matrix_with_tiered_pricing_config: Dict[str, object] | NotGiven = NOT_GIVEN, - cumulative_grouped_bulk_config: Dict[str, object] | NotGiven = NOT_GIVEN, + package_config: PackageConfigModel | NotGiven = NOT_GIVEN, + matrix_config: MatrixConfigModel | NotGiven = NOT_GIVEN, + matrix_with_allocation_config: MatrixWithAllocationConfigModel | NotGiven = NOT_GIVEN, + tiered_config: TieredConfigModel | NotGiven = NOT_GIVEN, + tiered_bps_config: TieredBpsConfigModel | NotGiven = NOT_GIVEN, + bps_config: BpsConfigModel | NotGiven = NOT_GIVEN, + bulk_bps_config: BulkBpsConfigModel | NotGiven = NOT_GIVEN, + bulk_config: BulkConfigModel | NotGiven = NOT_GIVEN, + threshold_total_amount_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, + tiered_package_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, + grouped_tiered_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, + max_group_tiered_package_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, + tiered_with_minimum_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, + package_with_allocation_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, + tiered_package_with_minimum_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, + unit_with_percent_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, + tiered_with_proration_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, + unit_with_proration_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, + grouped_allocation_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, + grouped_with_prorated_minimum_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, + grouped_with_metered_minimum_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, + matrix_with_display_name_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, + bulk_with_proration_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, + grouped_tiered_package_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, + scalable_matrix_with_unit_pricing_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, + scalable_matrix_with_tiered_pricing_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, + cumulative_grouped_bulk_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -2689,9 +2564,9 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: return cast( - Price, + PriceModel, self._post( "/prices", body=maybe_transform( @@ -2748,7 +2623,7 @@ def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=cast(Any, Price), # Union types cannot be passed in as arguments in the type system + cast_to=cast(Any, PriceModel), # Union types cannot be passed in as arguments in the type system ), ) @@ -2764,7 +2639,7 @@ def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """This endpoint allows you to update the `metadata` property on a price. If you @@ -2789,7 +2664,7 @@ def update( if not price_id: raise ValueError(f"Expected a non-empty value for `price_id` but received {price_id!r}") return cast( - Price, + PriceModel, self._put( f"/prices/{price_id}", body=maybe_transform({"metadata": metadata}, price_update_params.PriceUpdateParams), @@ -2800,7 +2675,7 @@ def update( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=cast(Any, Price), # Union types cannot be passed in as arguments in the type system + cast_to=cast(Any, PriceModel), # Union types cannot be passed in as arguments in the type system ), ) @@ -2815,7 +2690,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPage[Price]: + ) -> SyncPage[PriceModel]: """ This endpoint is used to list all add-on prices created using the [price creation endpoint](/api-reference/price/create-price). @@ -2836,7 +2711,7 @@ def list( """ return self._get_api_list( "/prices", - page=SyncPage[Price], + page=SyncPage[PriceModel], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -2850,7 +2725,7 @@ def list( price_list_params.PriceListParams, ), ), - model=cast(Any, Price), # Union types cannot be passed in as arguments in the type system + model=cast(Any, PriceModel), # Union types cannot be passed in as arguments in the type system ) def evaluate( @@ -2956,7 +2831,7 @@ def fetch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Price: + ) -> PriceModel: """ This endpoint returns a price given an identifier. @@ -2972,13 +2847,13 @@ def fetch( if not price_id: raise ValueError(f"Expected a non-empty value for `price_id` but received {price_id!r}") return cast( - Price, + PriceModel, self._get( f"/prices/{price_id}", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Any, Price), # Union types cannot be passed in as arguments in the type system + cast_to=cast(Any, PriceModel), # Union types cannot be passed in as arguments in the type system ), ) @@ -3016,17 +2891,15 @@ async def create( item_id: str, model_type: Literal["unit"], name: str, - unit_config: price_create_params.NewFloatingUnitPriceUnitConfig, + unit_config: UnitConfigModel, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[price_create_params.NewFloatingUnitPriceBillingCycleConfiguration] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[price_create_params.NewFloatingUnitPriceInvoicingCycleConfiguration] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -3035,7 +2908,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -3103,17 +2976,15 @@ async def create( item_id: str, model_type: Literal["package"], name: str, - package_config: price_create_params.NewFloatingPackagePricePackageConfig, + package_config: PackageConfigModel, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[price_create_params.NewFloatingPackagePriceBillingCycleConfiguration] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[price_create_params.NewFloatingPackagePriceInvoicingCycleConfiguration] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -3122,7 +2993,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -3188,19 +3059,17 @@ async def create( cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, item_id: str, - matrix_config: price_create_params.NewFloatingMatrixPriceMatrixConfig, + matrix_config: MatrixConfigModel, model_type: Literal["matrix"], name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[price_create_params.NewFloatingMatrixPriceBillingCycleConfiguration] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[price_create_params.NewFloatingMatrixPriceInvoicingCycleConfiguration] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -3209,7 +3078,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -3275,23 +3144,17 @@ async def create( cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, item_id: str, - matrix_with_allocation_config: price_create_params.NewFloatingMatrixWithAllocationPriceMatrixWithAllocationConfig, + matrix_with_allocation_config: MatrixWithAllocationConfigModel, model_type: Literal["matrix_with_allocation"], name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[ - price_create_params.NewFloatingMatrixWithAllocationPriceBillingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[ - price_create_params.NewFloatingMatrixWithAllocationPriceInvoicingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -3300,7 +3163,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -3368,17 +3231,15 @@ async def create( item_id: str, model_type: Literal["tiered"], name: str, - tiered_config: price_create_params.NewFloatingTieredPriceTieredConfig, + tiered_config: TieredConfigModel, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[price_create_params.NewFloatingTieredPriceBillingCycleConfiguration] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[price_create_params.NewFloatingTieredPriceInvoicingCycleConfiguration] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -3387,7 +3248,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -3455,19 +3316,15 @@ async def create( item_id: str, model_type: Literal["tiered_bps"], name: str, - tiered_bps_config: price_create_params.NewFloatingTieredBpsPriceTieredBpsConfig, + tiered_bps_config: TieredBpsConfigModel, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[price_create_params.NewFloatingTieredBpsPriceBillingCycleConfiguration] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[ - price_create_params.NewFloatingTieredBpsPriceInvoicingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -3476,7 +3333,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -3539,7 +3396,7 @@ async def create( async def create( self, *, - bps_config: price_create_params.NewFloatingBpsPriceBpsConfig, + bps_config: BpsConfigModel, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, item_id: str, @@ -3547,14 +3404,12 @@ async def create( name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[price_create_params.NewFloatingBpsPriceBillingCycleConfiguration] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[price_create_params.NewFloatingBpsPriceInvoicingCycleConfiguration] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -3563,7 +3418,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -3626,7 +3481,7 @@ async def create( async def create( self, *, - bulk_bps_config: price_create_params.NewFloatingBulkBpsPriceBulkBpsConfig, + bulk_bps_config: BulkBpsConfigModel, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, item_id: str, @@ -3634,14 +3489,12 @@ async def create( name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[price_create_params.NewFloatingBulkBpsPriceBillingCycleConfiguration] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[price_create_params.NewFloatingBulkBpsPriceInvoicingCycleConfiguration] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -3650,7 +3503,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -3713,7 +3566,7 @@ async def create( async def create( self, *, - bulk_config: price_create_params.NewFloatingBulkPriceBulkConfig, + bulk_config: BulkConfigModel, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, item_id: str, @@ -3721,14 +3574,12 @@ async def create( name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[price_create_params.NewFloatingBulkPriceBillingCycleConfiguration] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[price_create_params.NewFloatingBulkPriceInvoicingCycleConfiguration] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -3737,7 +3588,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -3805,21 +3656,15 @@ async def create( item_id: str, model_type: Literal["threshold_total_amount"], name: str, - threshold_total_amount_config: Dict[str, object], + threshold_total_amount_config: CustomRatingFunctionConfigModel, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[ - price_create_params.NewFloatingThresholdTotalAmountPriceBillingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[ - price_create_params.NewFloatingThresholdTotalAmountPriceInvoicingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -3828,7 +3673,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -3896,21 +3741,15 @@ async def create( item_id: str, model_type: Literal["tiered_package"], name: str, - tiered_package_config: Dict[str, object], + tiered_package_config: CustomRatingFunctionConfigModel, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[ - price_create_params.NewFloatingTieredPackagePriceBillingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[ - price_create_params.NewFloatingTieredPackagePriceInvoicingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -3919,7 +3758,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -3984,24 +3823,18 @@ async def create( *, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, - grouped_tiered_config: Dict[str, object], + grouped_tiered_config: CustomRatingFunctionConfigModel, item_id: str, model_type: Literal["grouped_tiered"], name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[ - price_create_params.NewFloatingGroupedTieredPriceBillingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[ - price_create_params.NewFloatingGroupedTieredPriceInvoicingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -4010,7 +3843,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -4076,23 +3909,17 @@ async def create( cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, item_id: str, - max_group_tiered_package_config: Dict[str, object], + max_group_tiered_package_config: CustomRatingFunctionConfigModel, model_type: Literal["max_group_tiered_package"], name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[ - price_create_params.NewFloatingMaxGroupTieredPackagePriceBillingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[ - price_create_params.NewFloatingMaxGroupTieredPackagePriceInvoicingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -4101,7 +3928,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -4169,21 +3996,15 @@ async def create( item_id: str, model_type: Literal["tiered_with_minimum"], name: str, - tiered_with_minimum_config: Dict[str, object], + tiered_with_minimum_config: CustomRatingFunctionConfigModel, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[ - price_create_params.NewFloatingTieredWithMinimumPriceBillingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[ - price_create_params.NewFloatingTieredWithMinimumPriceInvoicingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -4192,7 +4013,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -4260,21 +4081,15 @@ async def create( item_id: str, model_type: Literal["package_with_allocation"], name: str, - package_with_allocation_config: Dict[str, object], + package_with_allocation_config: CustomRatingFunctionConfigModel, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[ - price_create_params.NewFloatingPackageWithAllocationPriceBillingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[ - price_create_params.NewFloatingPackageWithAllocationPriceInvoicingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -4283,7 +4098,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -4351,21 +4166,15 @@ async def create( item_id: str, model_type: Literal["tiered_package_with_minimum"], name: str, - tiered_package_with_minimum_config: Dict[str, object], + tiered_package_with_minimum_config: CustomRatingFunctionConfigModel, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[ - price_create_params.NewFloatingTieredPackageWithMinimumPriceBillingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[ - price_create_params.NewFloatingTieredPackageWithMinimumPriceInvoicingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -4374,7 +4183,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -4442,21 +4251,15 @@ async def create( item_id: str, model_type: Literal["unit_with_percent"], name: str, - unit_with_percent_config: Dict[str, object], + unit_with_percent_config: CustomRatingFunctionConfigModel, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[ - price_create_params.NewFloatingUnitWithPercentPriceBillingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[ - price_create_params.NewFloatingUnitWithPercentPriceInvoicingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -4465,7 +4268,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -4533,21 +4336,15 @@ async def create( item_id: str, model_type: Literal["tiered_with_proration"], name: str, - tiered_with_proration_config: Dict[str, object], + tiered_with_proration_config: CustomRatingFunctionConfigModel, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[ - price_create_params.NewFloatingTieredWithProrationPriceBillingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[ - price_create_params.NewFloatingTieredWithProrationPriceInvoicingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -4556,7 +4353,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -4624,21 +4421,15 @@ async def create( item_id: str, model_type: Literal["unit_with_proration"], name: str, - unit_with_proration_config: Dict[str, object], + unit_with_proration_config: CustomRatingFunctionConfigModel, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[ - price_create_params.NewFloatingUnitWithProrationPriceBillingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[ - price_create_params.NewFloatingUnitWithProrationPriceInvoicingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -4647,7 +4438,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -4712,24 +4503,18 @@ async def create( *, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, - grouped_allocation_config: Dict[str, object], + grouped_allocation_config: CustomRatingFunctionConfigModel, item_id: str, model_type: Literal["grouped_allocation"], name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[ - price_create_params.NewFloatingGroupedAllocationPriceBillingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[ - price_create_params.NewFloatingGroupedAllocationPriceInvoicingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -4738,7 +4523,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -4803,24 +4588,18 @@ async def create( *, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, - grouped_with_prorated_minimum_config: Dict[str, object], + grouped_with_prorated_minimum_config: CustomRatingFunctionConfigModel, item_id: str, model_type: Literal["grouped_with_prorated_minimum"], name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[ - price_create_params.NewFloatingGroupedWithProratedMinimumPriceBillingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[ - price_create_params.NewFloatingGroupedWithProratedMinimumPriceInvoicingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -4829,7 +4608,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -4894,24 +4673,18 @@ async def create( *, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, - grouped_with_metered_minimum_config: Dict[str, object], + grouped_with_metered_minimum_config: CustomRatingFunctionConfigModel, item_id: str, model_type: Literal["grouped_with_metered_minimum"], name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[ - price_create_params.NewFloatingGroupedWithMeteredMinimumPriceBillingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[ - price_create_params.NewFloatingGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -4920,7 +4693,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -4986,23 +4759,17 @@ async def create( cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, item_id: str, - matrix_with_display_name_config: Dict[str, object], + matrix_with_display_name_config: CustomRatingFunctionConfigModel, model_type: Literal["matrix_with_display_name"], name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[ - price_create_params.NewFloatingMatrixWithDisplayNamePriceBillingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[ - price_create_params.NewFloatingMatrixWithDisplayNamePriceInvoicingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -5011,7 +4778,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -5074,7 +4841,7 @@ async def create( async def create( self, *, - bulk_with_proration_config: Dict[str, object], + bulk_with_proration_config: CustomRatingFunctionConfigModel, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, item_id: str, @@ -5082,18 +4849,12 @@ async def create( name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[ - price_create_params.NewFloatingBulkWithProrationPriceBillingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[ - price_create_params.NewFloatingBulkWithProrationPriceInvoicingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -5102,7 +4863,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -5167,24 +4928,18 @@ async def create( *, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, - grouped_tiered_package_config: Dict[str, object], + grouped_tiered_package_config: CustomRatingFunctionConfigModel, item_id: str, model_type: Literal["grouped_tiered_package"], name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[ - price_create_params.NewFloatingGroupedTieredPackagePriceBillingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[ - price_create_params.NewFloatingGroupedTieredPackagePriceInvoicingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -5193,7 +4948,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -5261,21 +5016,15 @@ async def create( item_id: str, model_type: Literal["scalable_matrix_with_unit_pricing"], name: str, - scalable_matrix_with_unit_pricing_config: Dict[str, object], + scalable_matrix_with_unit_pricing_config: CustomRatingFunctionConfigModel, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[ - price_create_params.NewFloatingScalableMatrixWithUnitPricingPriceBillingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[ - price_create_params.NewFloatingScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -5284,7 +5033,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -5352,21 +5101,15 @@ async def create( item_id: str, model_type: Literal["scalable_matrix_with_tiered_pricing"], name: str, - scalable_matrix_with_tiered_pricing_config: Dict[str, object], + scalable_matrix_with_tiered_pricing_config: CustomRatingFunctionConfigModel, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[ - price_create_params.NewFloatingScalableMatrixWithTieredPricingPriceBillingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[ - price_create_params.NewFloatingScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -5375,7 +5118,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -5439,25 +5182,19 @@ async def create( self, *, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], - cumulative_grouped_bulk_config: Dict[str, object], + cumulative_grouped_bulk_config: CustomRatingFunctionConfigModel, currency: str, item_id: str, model_type: Literal["cumulative_grouped_bulk"], name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[ - price_create_params.NewFloatingCumulativeGroupedBulkPriceBillingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[ - price_create_params.NewFloatingCumulativeGroupedBulkPriceInvoicingCycleConfiguration - ] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -5466,7 +5203,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """ This endpoint is used to create a [price](/product-catalog/price-configuration). A price created using this endpoint is always an add-on, meaning that it’s not @@ -5590,46 +5327,43 @@ async def create( | Literal["scalable_matrix_with_tiered_pricing"] | Literal["cumulative_grouped_bulk"], name: str, - unit_config: price_create_params.NewFloatingUnitPriceUnitConfig | NotGiven = NOT_GIVEN, + unit_config: UnitConfigModel | NotGiven = NOT_GIVEN, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[price_create_params.NewFloatingUnitPriceBillingCycleConfiguration] - | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_cycle_configuration: Optional[price_create_params.NewFloatingUnitPriceInvoicingCycleConfiguration] - | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, - package_config: price_create_params.NewFloatingPackagePricePackageConfig | NotGiven = NOT_GIVEN, - matrix_config: price_create_params.NewFloatingMatrixPriceMatrixConfig | NotGiven = NOT_GIVEN, - matrix_with_allocation_config: price_create_params.NewFloatingMatrixWithAllocationPriceMatrixWithAllocationConfig - | NotGiven = NOT_GIVEN, - tiered_config: price_create_params.NewFloatingTieredPriceTieredConfig | NotGiven = NOT_GIVEN, - tiered_bps_config: price_create_params.NewFloatingTieredBpsPriceTieredBpsConfig | NotGiven = NOT_GIVEN, - bps_config: price_create_params.NewFloatingBpsPriceBpsConfig | NotGiven = NOT_GIVEN, - bulk_bps_config: price_create_params.NewFloatingBulkBpsPriceBulkBpsConfig | NotGiven = NOT_GIVEN, - bulk_config: price_create_params.NewFloatingBulkPriceBulkConfig | NotGiven = NOT_GIVEN, - threshold_total_amount_config: Dict[str, object] | NotGiven = NOT_GIVEN, - tiered_package_config: Dict[str, object] | NotGiven = NOT_GIVEN, - grouped_tiered_config: Dict[str, object] | NotGiven = NOT_GIVEN, - max_group_tiered_package_config: Dict[str, object] | NotGiven = NOT_GIVEN, - tiered_with_minimum_config: Dict[str, object] | NotGiven = NOT_GIVEN, - package_with_allocation_config: Dict[str, object] | NotGiven = NOT_GIVEN, - tiered_package_with_minimum_config: Dict[str, object] | NotGiven = NOT_GIVEN, - unit_with_percent_config: Dict[str, object] | NotGiven = NOT_GIVEN, - tiered_with_proration_config: Dict[str, object] | NotGiven = NOT_GIVEN, - unit_with_proration_config: Dict[str, object] | NotGiven = NOT_GIVEN, - grouped_allocation_config: Dict[str, object] | NotGiven = NOT_GIVEN, - grouped_with_prorated_minimum_config: Dict[str, object] | NotGiven = NOT_GIVEN, - grouped_with_metered_minimum_config: Dict[str, object] | NotGiven = NOT_GIVEN, - matrix_with_display_name_config: Dict[str, object] | NotGiven = NOT_GIVEN, - bulk_with_proration_config: Dict[str, object] | NotGiven = NOT_GIVEN, - grouped_tiered_package_config: Dict[str, object] | NotGiven = NOT_GIVEN, - scalable_matrix_with_unit_pricing_config: Dict[str, object] | NotGiven = NOT_GIVEN, - scalable_matrix_with_tiered_pricing_config: Dict[str, object] | NotGiven = NOT_GIVEN, - cumulative_grouped_bulk_config: Dict[str, object] | NotGiven = NOT_GIVEN, + package_config: PackageConfigModel | NotGiven = NOT_GIVEN, + matrix_config: MatrixConfigModel | NotGiven = NOT_GIVEN, + matrix_with_allocation_config: MatrixWithAllocationConfigModel | NotGiven = NOT_GIVEN, + tiered_config: TieredConfigModel | NotGiven = NOT_GIVEN, + tiered_bps_config: TieredBpsConfigModel | NotGiven = NOT_GIVEN, + bps_config: BpsConfigModel | NotGiven = NOT_GIVEN, + bulk_bps_config: BulkBpsConfigModel | NotGiven = NOT_GIVEN, + bulk_config: BulkConfigModel | NotGiven = NOT_GIVEN, + threshold_total_amount_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, + tiered_package_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, + grouped_tiered_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, + max_group_tiered_package_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, + tiered_with_minimum_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, + package_with_allocation_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, + tiered_package_with_minimum_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, + unit_with_percent_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, + tiered_with_proration_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, + unit_with_proration_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, + grouped_allocation_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, + grouped_with_prorated_minimum_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, + grouped_with_metered_minimum_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, + matrix_with_display_name_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, + bulk_with_proration_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, + grouped_tiered_package_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, + scalable_matrix_with_unit_pricing_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, + scalable_matrix_with_tiered_pricing_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, + cumulative_grouped_bulk_config: CustomRatingFunctionConfigModel | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -5637,9 +5371,9 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: return cast( - Price, + PriceModel, await self._post( "/prices", body=await async_maybe_transform( @@ -5696,7 +5430,7 @@ async def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=cast(Any, Price), # Union types cannot be passed in as arguments in the type system + cast_to=cast(Any, PriceModel), # Union types cannot be passed in as arguments in the type system ), ) @@ -5712,7 +5446,7 @@ async def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Price: + ) -> PriceModel: """This endpoint allows you to update the `metadata` property on a price. If you @@ -5737,7 +5471,7 @@ async def update( if not price_id: raise ValueError(f"Expected a non-empty value for `price_id` but received {price_id!r}") return cast( - Price, + PriceModel, await self._put( f"/prices/{price_id}", body=await async_maybe_transform({"metadata": metadata}, price_update_params.PriceUpdateParams), @@ -5748,7 +5482,7 @@ async def update( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=cast(Any, Price), # Union types cannot be passed in as arguments in the type system + cast_to=cast(Any, PriceModel), # Union types cannot be passed in as arguments in the type system ), ) @@ -5763,7 +5497,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[Price, AsyncPage[Price]]: + ) -> AsyncPaginator[PriceModel, AsyncPage[PriceModel]]: """ This endpoint is used to list all add-on prices created using the [price creation endpoint](/api-reference/price/create-price). @@ -5784,7 +5518,7 @@ def list( """ return self._get_api_list( "/prices", - page=AsyncPage[Price], + page=AsyncPage[PriceModel], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -5798,7 +5532,7 @@ def list( price_list_params.PriceListParams, ), ), - model=cast(Any, Price), # Union types cannot be passed in as arguments in the type system + model=cast(Any, PriceModel), # Union types cannot be passed in as arguments in the type system ) async def evaluate( @@ -5904,7 +5638,7 @@ async def fetch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Price: + ) -> PriceModel: """ This endpoint returns a price given an identifier. @@ -5920,13 +5654,13 @@ async def fetch( if not price_id: raise ValueError(f"Expected a non-empty value for `price_id` but received {price_id!r}") return cast( - Price, + PriceModel, await self._get( f"/prices/{price_id}", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Any, Price), # Union types cannot be passed in as arguments in the type system + cast_to=cast(Any, PriceModel), # Union types cannot be passed in as arguments in the type system ), ) diff --git a/src/orb/resources/subscriptions.py b/src/orb/resources/subscriptions.py index 83422a37..34291afc 100644 --- a/src/orb/resources/subscriptions.py +++ b/src/orb/resources/subscriptions.py @@ -34,24 +34,18 @@ from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper from ..pagination import SyncPage, AsyncPage from .._base_client import AsyncPaginator, make_request_options -from ..types.subscription import Subscription from ..types.subscription_usage import SubscriptionUsage -from ..types.subscription_cancel_response import SubscriptionCancelResponse -from ..types.subscription_create_response import SubscriptionCreateResponse +from ..types.shared.subscription_model import SubscriptionModel +from ..types.shared.mutated_subscription_model import MutatedSubscriptionModel from ..types.subscription_fetch_costs_response import SubscriptionFetchCostsResponse -from ..types.subscription_update_trial_response import SubscriptionUpdateTrialResponse -from ..types.subscription_trigger_phase_response import SubscriptionTriggerPhaseResponse from ..types.subscription_fetch_schedule_response import SubscriptionFetchScheduleResponse -from ..types.subscription_price_intervals_response import SubscriptionPriceIntervalsResponse -from ..types.subscription_schedule_plan_change_response import SubscriptionSchedulePlanChangeResponse -from ..types.subscription_unschedule_cancellation_response import SubscriptionUnscheduleCancellationResponse -from ..types.subscription_update_fixed_fee_quantity_response import SubscriptionUpdateFixedFeeQuantityResponse -from ..types.subscription_unschedule_pending_plan_changes_response import ( - SubscriptionUnschedulePendingPlanChangesResponse, -) -from ..types.subscription_unschedule_fixed_fee_quantity_updates_response import ( - SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse, -) +from ..types.shared_params.add_subscription_price_params import AddSubscriptionPriceParams +from ..types.shared_params.remove_subscription_price_params import RemoveSubscriptionPriceParams +from ..types.shared_params.replace_subscription_price_params import ReplaceSubscriptionPriceParams +from ..types.shared_params.add_subscription_adjustment_params import AddSubscriptionAdjustmentParams +from ..types.shared_params.remove_subscription_adjustment_params import RemoveSubscriptionAdjustmentParams +from ..types.shared_params.replace_subscription_adjustment_params import ReplaceSubscriptionAdjustmentParams +from ..types.shared_params.billing_cycle_anchor_configuration_model import BillingCycleAnchorConfigurationModel __all__ = ["Subscriptions", "AsyncSubscriptions"] @@ -79,13 +73,12 @@ def with_streaming_response(self) -> SubscriptionsWithStreamingResponse: def create( self, *, - add_adjustments: Optional[Iterable[subscription_create_params.AddAdjustment]] | NotGiven = NOT_GIVEN, - add_prices: Optional[Iterable[subscription_create_params.AddPrice]] | NotGiven = NOT_GIVEN, + add_adjustments: Optional[Iterable[AddSubscriptionAdjustmentParams]] | NotGiven = NOT_GIVEN, + add_prices: Optional[Iterable[AddSubscriptionPriceParams]] | NotGiven = NOT_GIVEN, align_billing_with_subscription_start_date: bool | NotGiven = NOT_GIVEN, auto_collection: Optional[bool] | NotGiven = NOT_GIVEN, aws_region: Optional[str] | NotGiven = NOT_GIVEN, - billing_cycle_anchor_configuration: Optional[subscription_create_params.BillingCycleAnchorConfiguration] - | NotGiven = NOT_GIVEN, + billing_cycle_anchor_configuration: Optional[BillingCycleAnchorConfigurationModel] | NotGiven = NOT_GIVEN, coupon_redemption_code: Optional[str] | NotGiven = NOT_GIVEN, credits_overage_rate: Optional[float] | NotGiven = NOT_GIVEN, customer_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -104,10 +97,10 @@ def create( plan_id: Optional[str] | NotGiven = NOT_GIVEN, plan_version_number: Optional[int] | NotGiven = NOT_GIVEN, price_overrides: Optional[Iterable[object]] | NotGiven = NOT_GIVEN, - remove_adjustments: Optional[Iterable[subscription_create_params.RemoveAdjustment]] | NotGiven = NOT_GIVEN, - remove_prices: Optional[Iterable[subscription_create_params.RemovePrice]] | NotGiven = NOT_GIVEN, - replace_adjustments: Optional[Iterable[subscription_create_params.ReplaceAdjustment]] | NotGiven = NOT_GIVEN, - replace_prices: Optional[Iterable[subscription_create_params.ReplacePrice]] | NotGiven = NOT_GIVEN, + remove_adjustments: Optional[Iterable[RemoveSubscriptionAdjustmentParams]] | NotGiven = NOT_GIVEN, + remove_prices: Optional[Iterable[RemoveSubscriptionPriceParams]] | NotGiven = NOT_GIVEN, + replace_adjustments: Optional[Iterable[ReplaceSubscriptionAdjustmentParams]] | NotGiven = NOT_GIVEN, + replace_prices: Optional[Iterable[ReplaceSubscriptionPriceParams]] | NotGiven = NOT_GIVEN, start_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN, trial_duration_days: Optional[int] | NotGiven = NOT_GIVEN, usage_customer_ids: Optional[List[str]] | NotGiven = NOT_GIVEN, @@ -118,7 +111,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> SubscriptionCreateResponse: + ) -> MutatedSubscriptionModel: """A subscription represents the purchase of a plan by a customer. The customer is @@ -505,7 +498,7 @@ def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=SubscriptionCreateResponse, + cast_to=MutatedSubscriptionModel, ) def update( @@ -524,7 +517,7 @@ def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Subscription: + ) -> SubscriptionModel: """ This endpoint can be used to update the `metadata`, `net terms`, `auto_collection`, `invoicing_threshold`, and `default_invoice_memo` properties @@ -582,7 +575,7 @@ def update( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=Subscription, + cast_to=SubscriptionModel, ) def list( @@ -603,7 +596,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncPage[Subscription]: + ) -> SyncPage[SubscriptionModel]: """ This endpoint returns a list of all subscriptions for an account as a [paginated](/api-reference/pagination) list, ordered starting from the most @@ -631,7 +624,7 @@ def list( """ return self._get_api_list( "/subscriptions", - page=SyncPage[Subscription], + page=SyncPage[SubscriptionModel], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -652,7 +645,7 @@ def list( subscription_list_params.SubscriptionListParams, ), ), - model=Subscription, + model=SubscriptionModel, ) def cancel( @@ -669,7 +662,7 @@ def cancel( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> SubscriptionCancelResponse: + ) -> MutatedSubscriptionModel: """This endpoint can be used to cancel an existing subscription. It returns the @@ -773,7 +766,7 @@ def cancel( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=SubscriptionCancelResponse, + cast_to=MutatedSubscriptionModel, ) def fetch( @@ -786,7 +779,7 @@ def fetch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Subscription: + ) -> SubscriptionModel: """ This endpoint is used to fetch a [Subscription](/core-concepts##subscription) given an identifier. @@ -807,7 +800,7 @@ def fetch( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=Subscription, + cast_to=SubscriptionModel, ) def fetch_costs( @@ -1232,7 +1225,7 @@ def price_intervals( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> SubscriptionPriceIntervalsResponse: + ) -> MutatedSubscriptionModel: """ This endpoint is used to add and edit subscription [price intervals](/api-reference/price-interval/add-or-edit-price-intervals). By @@ -1351,7 +1344,7 @@ def price_intervals( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=SubscriptionPriceIntervalsResponse, + cast_to=MutatedSubscriptionModel, ) def schedule_plan_change( @@ -1359,17 +1352,13 @@ def schedule_plan_change( subscription_id: str, *, change_option: Literal["requested_date", "end_of_subscription_term", "immediate"], - add_adjustments: Optional[Iterable[subscription_schedule_plan_change_params.AddAdjustment]] - | NotGiven = NOT_GIVEN, - add_prices: Optional[Iterable[subscription_schedule_plan_change_params.AddPrice]] | NotGiven = NOT_GIVEN, + add_adjustments: Optional[Iterable[AddSubscriptionAdjustmentParams]] | NotGiven = NOT_GIVEN, + add_prices: Optional[Iterable[AddSubscriptionPriceParams]] | NotGiven = NOT_GIVEN, align_billing_with_plan_change_date: Optional[bool] | NotGiven = NOT_GIVEN, auto_collection: Optional[bool] | NotGiven = NOT_GIVEN, billing_cycle_alignment: Optional[Literal["unchanged", "plan_change_date", "start_of_month"]] | NotGiven = NOT_GIVEN, - billing_cycle_anchor_configuration: Optional[ - subscription_schedule_plan_change_params.BillingCycleAnchorConfiguration - ] - | NotGiven = NOT_GIVEN, + billing_cycle_anchor_configuration: Optional[BillingCycleAnchorConfigurationModel] | NotGiven = NOT_GIVEN, change_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN, coupon_redemption_code: Optional[str] | NotGiven = NOT_GIVEN, credits_overage_rate: Optional[float] | NotGiven = NOT_GIVEN, @@ -1383,13 +1372,10 @@ def schedule_plan_change( plan_id: Optional[str] | NotGiven = NOT_GIVEN, plan_version_number: Optional[int] | NotGiven = NOT_GIVEN, price_overrides: Optional[Iterable[object]] | NotGiven = NOT_GIVEN, - remove_adjustments: Optional[Iterable[subscription_schedule_plan_change_params.RemoveAdjustment]] - | NotGiven = NOT_GIVEN, - remove_prices: Optional[Iterable[subscription_schedule_plan_change_params.RemovePrice]] | NotGiven = NOT_GIVEN, - replace_adjustments: Optional[Iterable[subscription_schedule_plan_change_params.ReplaceAdjustment]] - | NotGiven = NOT_GIVEN, - replace_prices: Optional[Iterable[subscription_schedule_plan_change_params.ReplacePrice]] - | NotGiven = NOT_GIVEN, + remove_adjustments: Optional[Iterable[RemoveSubscriptionAdjustmentParams]] | NotGiven = NOT_GIVEN, + remove_prices: Optional[Iterable[RemoveSubscriptionPriceParams]] | NotGiven = NOT_GIVEN, + replace_adjustments: Optional[Iterable[ReplaceSubscriptionAdjustmentParams]] | NotGiven = NOT_GIVEN, + replace_prices: Optional[Iterable[ReplaceSubscriptionPriceParams]] | NotGiven = NOT_GIVEN, trial_duration_days: Optional[int] | NotGiven = NOT_GIVEN, usage_customer_ids: Optional[List[str]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1399,7 +1385,7 @@ def schedule_plan_change( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> SubscriptionSchedulePlanChangeResponse: + ) -> MutatedSubscriptionModel: """This endpoint can be used to change an existing subscription's plan. It returns @@ -1717,7 +1703,7 @@ def schedule_plan_change( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=SubscriptionSchedulePlanChangeResponse, + cast_to=MutatedSubscriptionModel, ) def trigger_phase( @@ -1733,7 +1719,7 @@ def trigger_phase( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> SubscriptionTriggerPhaseResponse: + ) -> MutatedSubscriptionModel: """ Manually trigger a phase, effective the given date (or the current time, if not specified). @@ -1774,7 +1760,7 @@ def trigger_phase( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=SubscriptionTriggerPhaseResponse, + cast_to=MutatedSubscriptionModel, ) def unschedule_cancellation( @@ -1788,7 +1774,7 @@ def unschedule_cancellation( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> SubscriptionUnscheduleCancellationResponse: + ) -> MutatedSubscriptionModel: """ This endpoint can be used to unschedule any pending cancellations for a subscription. @@ -1819,7 +1805,7 @@ def unschedule_cancellation( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=SubscriptionUnscheduleCancellationResponse, + cast_to=MutatedSubscriptionModel, ) def unschedule_fixed_fee_quantity_updates( @@ -1834,7 +1820,7 @@ def unschedule_fixed_fee_quantity_updates( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse: + ) -> MutatedSubscriptionModel: """ This endpoint can be used to clear scheduled updates to the quantity for a fixed fee. @@ -1870,7 +1856,7 @@ def unschedule_fixed_fee_quantity_updates( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse, + cast_to=MutatedSubscriptionModel, ) def unschedule_pending_plan_changes( @@ -1884,7 +1870,7 @@ def unschedule_pending_plan_changes( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> SubscriptionUnschedulePendingPlanChangesResponse: + ) -> MutatedSubscriptionModel: """ This endpoint can be used to unschedule any pending plan changes on an existing subscription. @@ -1911,7 +1897,7 @@ def unschedule_pending_plan_changes( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=SubscriptionUnschedulePendingPlanChangesResponse, + cast_to=MutatedSubscriptionModel, ) def update_fixed_fee_quantity( @@ -1930,7 +1916,7 @@ def update_fixed_fee_quantity( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> SubscriptionUpdateFixedFeeQuantityResponse: + ) -> MutatedSubscriptionModel: """ This endpoint can be used to update the quantity for a fixed fee. @@ -1993,7 +1979,7 @@ def update_fixed_fee_quantity( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=SubscriptionUpdateFixedFeeQuantityResponse, + cast_to=MutatedSubscriptionModel, ) def update_trial( @@ -2009,7 +1995,7 @@ def update_trial( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> SubscriptionUpdateTrialResponse: + ) -> MutatedSubscriptionModel: """This endpoint is used to update the trial end date for a subscription. The new @@ -2066,7 +2052,7 @@ def update_trial( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=SubscriptionUpdateTrialResponse, + cast_to=MutatedSubscriptionModel, ) @@ -2093,13 +2079,12 @@ def with_streaming_response(self) -> AsyncSubscriptionsWithStreamingResponse: async def create( self, *, - add_adjustments: Optional[Iterable[subscription_create_params.AddAdjustment]] | NotGiven = NOT_GIVEN, - add_prices: Optional[Iterable[subscription_create_params.AddPrice]] | NotGiven = NOT_GIVEN, + add_adjustments: Optional[Iterable[AddSubscriptionAdjustmentParams]] | NotGiven = NOT_GIVEN, + add_prices: Optional[Iterable[AddSubscriptionPriceParams]] | NotGiven = NOT_GIVEN, align_billing_with_subscription_start_date: bool | NotGiven = NOT_GIVEN, auto_collection: Optional[bool] | NotGiven = NOT_GIVEN, aws_region: Optional[str] | NotGiven = NOT_GIVEN, - billing_cycle_anchor_configuration: Optional[subscription_create_params.BillingCycleAnchorConfiguration] - | NotGiven = NOT_GIVEN, + billing_cycle_anchor_configuration: Optional[BillingCycleAnchorConfigurationModel] | NotGiven = NOT_GIVEN, coupon_redemption_code: Optional[str] | NotGiven = NOT_GIVEN, credits_overage_rate: Optional[float] | NotGiven = NOT_GIVEN, customer_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -2118,10 +2103,10 @@ async def create( plan_id: Optional[str] | NotGiven = NOT_GIVEN, plan_version_number: Optional[int] | NotGiven = NOT_GIVEN, price_overrides: Optional[Iterable[object]] | NotGiven = NOT_GIVEN, - remove_adjustments: Optional[Iterable[subscription_create_params.RemoveAdjustment]] | NotGiven = NOT_GIVEN, - remove_prices: Optional[Iterable[subscription_create_params.RemovePrice]] | NotGiven = NOT_GIVEN, - replace_adjustments: Optional[Iterable[subscription_create_params.ReplaceAdjustment]] | NotGiven = NOT_GIVEN, - replace_prices: Optional[Iterable[subscription_create_params.ReplacePrice]] | NotGiven = NOT_GIVEN, + remove_adjustments: Optional[Iterable[RemoveSubscriptionAdjustmentParams]] | NotGiven = NOT_GIVEN, + remove_prices: Optional[Iterable[RemoveSubscriptionPriceParams]] | NotGiven = NOT_GIVEN, + replace_adjustments: Optional[Iterable[ReplaceSubscriptionAdjustmentParams]] | NotGiven = NOT_GIVEN, + replace_prices: Optional[Iterable[ReplaceSubscriptionPriceParams]] | NotGiven = NOT_GIVEN, start_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN, trial_duration_days: Optional[int] | NotGiven = NOT_GIVEN, usage_customer_ids: Optional[List[str]] | NotGiven = NOT_GIVEN, @@ -2132,7 +2117,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> SubscriptionCreateResponse: + ) -> MutatedSubscriptionModel: """A subscription represents the purchase of a plan by a customer. The customer is @@ -2519,7 +2504,7 @@ async def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=SubscriptionCreateResponse, + cast_to=MutatedSubscriptionModel, ) async def update( @@ -2538,7 +2523,7 @@ async def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> Subscription: + ) -> SubscriptionModel: """ This endpoint can be used to update the `metadata`, `net terms`, `auto_collection`, `invoicing_threshold`, and `default_invoice_memo` properties @@ -2596,7 +2581,7 @@ async def update( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=Subscription, + cast_to=SubscriptionModel, ) def list( @@ -2617,7 +2602,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[Subscription, AsyncPage[Subscription]]: + ) -> AsyncPaginator[SubscriptionModel, AsyncPage[SubscriptionModel]]: """ This endpoint returns a list of all subscriptions for an account as a [paginated](/api-reference/pagination) list, ordered starting from the most @@ -2645,7 +2630,7 @@ def list( """ return self._get_api_list( "/subscriptions", - page=AsyncPage[Subscription], + page=AsyncPage[SubscriptionModel], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -2666,7 +2651,7 @@ def list( subscription_list_params.SubscriptionListParams, ), ), - model=Subscription, + model=SubscriptionModel, ) async def cancel( @@ -2683,7 +2668,7 @@ async def cancel( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> SubscriptionCancelResponse: + ) -> MutatedSubscriptionModel: """This endpoint can be used to cancel an existing subscription. It returns the @@ -2787,7 +2772,7 @@ async def cancel( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=SubscriptionCancelResponse, + cast_to=MutatedSubscriptionModel, ) async def fetch( @@ -2800,7 +2785,7 @@ async def fetch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Subscription: + ) -> SubscriptionModel: """ This endpoint is used to fetch a [Subscription](/core-concepts##subscription) given an identifier. @@ -2821,7 +2806,7 @@ async def fetch( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=Subscription, + cast_to=SubscriptionModel, ) async def fetch_costs( @@ -3246,7 +3231,7 @@ async def price_intervals( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> SubscriptionPriceIntervalsResponse: + ) -> MutatedSubscriptionModel: """ This endpoint is used to add and edit subscription [price intervals](/api-reference/price-interval/add-or-edit-price-intervals). By @@ -3365,7 +3350,7 @@ async def price_intervals( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=SubscriptionPriceIntervalsResponse, + cast_to=MutatedSubscriptionModel, ) async def schedule_plan_change( @@ -3373,17 +3358,13 @@ async def schedule_plan_change( subscription_id: str, *, change_option: Literal["requested_date", "end_of_subscription_term", "immediate"], - add_adjustments: Optional[Iterable[subscription_schedule_plan_change_params.AddAdjustment]] - | NotGiven = NOT_GIVEN, - add_prices: Optional[Iterable[subscription_schedule_plan_change_params.AddPrice]] | NotGiven = NOT_GIVEN, + add_adjustments: Optional[Iterable[AddSubscriptionAdjustmentParams]] | NotGiven = NOT_GIVEN, + add_prices: Optional[Iterable[AddSubscriptionPriceParams]] | NotGiven = NOT_GIVEN, align_billing_with_plan_change_date: Optional[bool] | NotGiven = NOT_GIVEN, auto_collection: Optional[bool] | NotGiven = NOT_GIVEN, billing_cycle_alignment: Optional[Literal["unchanged", "plan_change_date", "start_of_month"]] | NotGiven = NOT_GIVEN, - billing_cycle_anchor_configuration: Optional[ - subscription_schedule_plan_change_params.BillingCycleAnchorConfiguration - ] - | NotGiven = NOT_GIVEN, + billing_cycle_anchor_configuration: Optional[BillingCycleAnchorConfigurationModel] | NotGiven = NOT_GIVEN, change_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN, coupon_redemption_code: Optional[str] | NotGiven = NOT_GIVEN, credits_overage_rate: Optional[float] | NotGiven = NOT_GIVEN, @@ -3397,13 +3378,10 @@ async def schedule_plan_change( plan_id: Optional[str] | NotGiven = NOT_GIVEN, plan_version_number: Optional[int] | NotGiven = NOT_GIVEN, price_overrides: Optional[Iterable[object]] | NotGiven = NOT_GIVEN, - remove_adjustments: Optional[Iterable[subscription_schedule_plan_change_params.RemoveAdjustment]] - | NotGiven = NOT_GIVEN, - remove_prices: Optional[Iterable[subscription_schedule_plan_change_params.RemovePrice]] | NotGiven = NOT_GIVEN, - replace_adjustments: Optional[Iterable[subscription_schedule_plan_change_params.ReplaceAdjustment]] - | NotGiven = NOT_GIVEN, - replace_prices: Optional[Iterable[subscription_schedule_plan_change_params.ReplacePrice]] - | NotGiven = NOT_GIVEN, + remove_adjustments: Optional[Iterable[RemoveSubscriptionAdjustmentParams]] | NotGiven = NOT_GIVEN, + remove_prices: Optional[Iterable[RemoveSubscriptionPriceParams]] | NotGiven = NOT_GIVEN, + replace_adjustments: Optional[Iterable[ReplaceSubscriptionAdjustmentParams]] | NotGiven = NOT_GIVEN, + replace_prices: Optional[Iterable[ReplaceSubscriptionPriceParams]] | NotGiven = NOT_GIVEN, trial_duration_days: Optional[int] | NotGiven = NOT_GIVEN, usage_customer_ids: Optional[List[str]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -3413,7 +3391,7 @@ async def schedule_plan_change( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> SubscriptionSchedulePlanChangeResponse: + ) -> MutatedSubscriptionModel: """This endpoint can be used to change an existing subscription's plan. It returns @@ -3731,7 +3709,7 @@ async def schedule_plan_change( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=SubscriptionSchedulePlanChangeResponse, + cast_to=MutatedSubscriptionModel, ) async def trigger_phase( @@ -3747,7 +3725,7 @@ async def trigger_phase( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> SubscriptionTriggerPhaseResponse: + ) -> MutatedSubscriptionModel: """ Manually trigger a phase, effective the given date (or the current time, if not specified). @@ -3788,7 +3766,7 @@ async def trigger_phase( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=SubscriptionTriggerPhaseResponse, + cast_to=MutatedSubscriptionModel, ) async def unschedule_cancellation( @@ -3802,7 +3780,7 @@ async def unschedule_cancellation( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> SubscriptionUnscheduleCancellationResponse: + ) -> MutatedSubscriptionModel: """ This endpoint can be used to unschedule any pending cancellations for a subscription. @@ -3833,7 +3811,7 @@ async def unschedule_cancellation( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=SubscriptionUnscheduleCancellationResponse, + cast_to=MutatedSubscriptionModel, ) async def unschedule_fixed_fee_quantity_updates( @@ -3848,7 +3826,7 @@ async def unschedule_fixed_fee_quantity_updates( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse: + ) -> MutatedSubscriptionModel: """ This endpoint can be used to clear scheduled updates to the quantity for a fixed fee. @@ -3884,7 +3862,7 @@ async def unschedule_fixed_fee_quantity_updates( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse, + cast_to=MutatedSubscriptionModel, ) async def unschedule_pending_plan_changes( @@ -3898,7 +3876,7 @@ async def unschedule_pending_plan_changes( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> SubscriptionUnschedulePendingPlanChangesResponse: + ) -> MutatedSubscriptionModel: """ This endpoint can be used to unschedule any pending plan changes on an existing subscription. @@ -3925,7 +3903,7 @@ async def unschedule_pending_plan_changes( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=SubscriptionUnschedulePendingPlanChangesResponse, + cast_to=MutatedSubscriptionModel, ) async def update_fixed_fee_quantity( @@ -3944,7 +3922,7 @@ async def update_fixed_fee_quantity( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> SubscriptionUpdateFixedFeeQuantityResponse: + ) -> MutatedSubscriptionModel: """ This endpoint can be used to update the quantity for a fixed fee. @@ -4007,7 +3985,7 @@ async def update_fixed_fee_quantity( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=SubscriptionUpdateFixedFeeQuantityResponse, + cast_to=MutatedSubscriptionModel, ) async def update_trial( @@ -4023,7 +4001,7 @@ async def update_trial( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> SubscriptionUpdateTrialResponse: + ) -> MutatedSubscriptionModel: """This endpoint is used to update the trial end date for a subscription. The new @@ -4080,7 +4058,7 @@ async def update_trial( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=SubscriptionUpdateTrialResponse, + cast_to=MutatedSubscriptionModel, ) diff --git a/src/orb/types/__init__.py b/src/orb/types/__init__.py index c7eb0152..40f00195 100644 --- a/src/orb/types/__init__.py +++ b/src/orb/types/__init__.py @@ -2,26 +2,114 @@ from __future__ import annotations -from .item import Item as Item -from .plan import Plan as Plan -from .alert import Alert as Alert -from .price import Price as Price -from .coupon import Coupon as Coupon from .shared import ( Discount as Discount, + ItemModel as ItemModel, + PlanModel as PlanModel, + AlertModel as AlertModel, + PriceModel as PriceModel, + TopUpModel as TopUpModel, + UsageModel as UsageModel, + CouponModel as CouponModel, + TopUpsModel as TopUpsModel, + AddressModel as AddressModel, + InvoiceModel as InvoiceModel, + MaximumModel as MaximumModel, + MinimumModel as MinimumModel, + BackfillModel as BackfillModel, + CustomerModel as CustomerModel, + DiscountModel as DiscountModel, + EditPlanModel as EditPlanModel, + ItemSlimModel as ItemSlimModel, TrialDiscount as TrialDiscount, AmountDiscount as AmountDiscount, + BpsConfigModel as BpsConfigModel, + TaxAmountModel as TaxAmountModel, + ThresholdModel as ThresholdModel, + AdjustmentModel as AdjustmentModel, + AllocationModel as AllocationModel, + BulkConfigModel as BulkConfigModel, + CreditNoteModel as CreditNoteModel, + UnitConfigModel as UnitConfigModel, + MatrixValueModel as MatrixValueModel, + AddressInputModel as AddressInputModel, + EditCustomerModel as EditCustomerModel, + MatrixConfigModel as MatrixConfigModel, + PlanMinifiedModel as PlanMinifiedModel, + SubscriptionModel as SubscriptionModel, + TieredConfigModel as TieredConfigModel, + AffectedBlockModel as AffectedBlockModel, + BulkBpsConfigModel as BulkBpsConfigModel, + CustomerCostsModel as CustomerCostsModel, + CustomerTaxIDModel as CustomerTaxIDModel, + NewAdjustmentModel as NewAdjustmentModel, + PackageConfigModel as PackageConfigModel, PaginationMetadata as PaginationMetadata, PercentageDiscount as PercentageDiscount, + PriceIntervalModel as PriceIntervalModel, + SubscriptionsModel as SubscriptionsModel, + TrialDiscountModel as TrialDiscountModel, + AggregatedCostModel as AggregatedCostModel, + AmountDiscountModel as AmountDiscountModel, + AutoCollectionModel as AutoCollectionModel, + BillableMetricModel as BillableMetricModel, + PaymentAttemptModel as PaymentAttemptModel, InvoiceLevelDiscount as InvoiceLevelDiscount, + InvoiceLineItemModel as InvoiceLineItemModel, + MaximumIntervalModel as MaximumIntervalModel, + MinimumIntervalModel as MinimumIntervalModel, + TieredBpsConfigModel as TieredBpsConfigModel, + AddCreditTopUpRequest as AddCreditTopUpRequest, + CouponRedemptionModel as CouponRedemptionModel, + CustomerMinifiedModel as CustomerMinifiedModel, + DiscountOverrideModel as DiscountOverrideModel, + NewFloatingPriceModel as NewFloatingPriceModel, + CreditLedgerEntryModel as CreditLedgerEntryModel, + CreditNoteSummaryModel as CreditNoteSummaryModel, + AdjustmentIntervalModel as AdjustmentIntervalModel, + BillableMetricTinyModel as BillableMetricTinyModel, + CreditNoteDiscountModel as CreditNoteDiscountModel, + NewAllocationPriceModel as NewAllocationPriceModel, + PaginationMetadataModel as PaginationMetadataModel, + PercentageDiscountModel as PercentageDiscountModel, BillingCycleRelativeDate as BillingCycleRelativeDate, + CreditLedgerEntriesModel as CreditLedgerEntriesModel, + MutatedSubscriptionModel as MutatedSubscriptionModel, + NewTaxConfigurationModel as NewTaxConfigurationModel, + SubLineItemGroupingModel as SubLineItemGroupingModel, + UpdatePriceRequestParams as UpdatePriceRequestParams, + BillableMetricSimpleModel as BillableMetricSimpleModel, + InvoiceLevelDiscountModel as InvoiceLevelDiscountModel, + NewSubscriptionPriceModel as NewSubscriptionPriceModel, + SubscriptionMinifiedModel as SubscriptionMinifiedModel, + AddSubscriptionPriceParams as AddSubscriptionPriceParams, + CreateCustomerAlertRequest as CreateCustomerAlertRequest, + DimensionalPriceGroupModel as DimensionalPriceGroupModel, + SubscriptionTrialInfoModel as SubscriptionTrialInfoModel, + UsageDiscountIntervalModel as UsageDiscountIntervalModel, + AddCreditLedgerEntryRequest as AddCreditLedgerEntryRequest, + AmountDiscountIntervalModel as AmountDiscountIntervalModel, + CustomerCreditBalancesModel as CustomerCreditBalancesModel, + ItemExternalConnectionModel as ItemExternalConnectionModel, + CustomerHierarchyConfigModel as CustomerHierarchyConfigModel, + RemoveSubscriptionPriceParams as RemoveSubscriptionPriceParams, + BillingCycleConfigurationModel as BillingCycleConfigurationModel, + NewReportingConfigurationModel as NewReportingConfigurationModel, + ReplaceSubscriptionPriceParams as ReplaceSubscriptionPriceParams, + AddSubscriptionAdjustmentParams as AddSubscriptionAdjustmentParams, + CustomerBalanceTransactionModel as CustomerBalanceTransactionModel, + CustomRatingFunctionConfigModel as CustomRatingFunctionConfigModel, + MatrixWithAllocationConfigModel as MatrixWithAllocationConfigModel, + PercentageDiscountIntervalModel as PercentageDiscountIntervalModel, + NewBillingCycleConfigurationModel as NewBillingCycleConfigurationModel, + DimensionalPriceConfigurationModel as DimensionalPriceConfigurationModel, + FixedFeeQuantityScheduleEntryModel as FixedFeeQuantityScheduleEntryModel, + RemoveSubscriptionAdjustmentParams as RemoveSubscriptionAdjustmentParams, + NewAccountingSyncConfigurationModel as NewAccountingSyncConfigurationModel, + ReplaceSubscriptionAdjustmentParams as ReplaceSubscriptionAdjustmentParams, + BillingCycleAnchorConfigurationModel as BillingCycleAnchorConfigurationModel, + PriceIntervalFixedFeeQuantityTransitionModel as PriceIntervalFixedFeeQuantityTransitionModel, ) -from .invoice import Invoice as Invoice -from .customer import Customer as Customer -from .credit_note import CreditNote as CreditNote -from .subscription import Subscription as Subscription -from .subscriptions import Subscriptions as Subscriptions -from .billable_metric import BillableMetric as BillableMetric from .item_list_params import ItemListParams as ItemListParams from .plan_list_params import PlanListParams as PlanListParams from .alert_list_params import AlertListParams as AlertListParams @@ -57,7 +145,6 @@ from .customer_create_params import CustomerCreateParams as CustomerCreateParams from .customer_update_params import CustomerUpdateParams as CustomerUpdateParams from .credit_note_list_params import CreditNoteListParams as CreditNoteListParams -from .dimensional_price_group import DimensionalPriceGroup as DimensionalPriceGroup from .price_evaluate_response import PriceEvaluateResponse as PriceEvaluateResponse from .top_level_ping_response import TopLevelPingResponse as TopLevelPingResponse from .dimensional_price_groups import DimensionalPriceGroups as DimensionalPriceGroups @@ -68,8 +155,6 @@ from .subscription_cancel_params import SubscriptionCancelParams as SubscriptionCancelParams from .subscription_create_params import SubscriptionCreateParams as SubscriptionCreateParams from .subscription_update_params import SubscriptionUpdateParams as SubscriptionUpdateParams -from .subscription_cancel_response import SubscriptionCancelResponse as SubscriptionCancelResponse -from .subscription_create_response import SubscriptionCreateResponse as SubscriptionCreateResponse from .invoice_fetch_upcoming_params import InvoiceFetchUpcomingParams as InvoiceFetchUpcomingParams from .invoice_fetch_upcoming_response import InvoiceFetchUpcomingResponse as InvoiceFetchUpcomingResponse from .invoice_line_item_create_params import InvoiceLineItemCreateParams as InvoiceLineItemCreateParams @@ -77,47 +162,26 @@ from .subscription_fetch_usage_params import SubscriptionFetchUsageParams as SubscriptionFetchUsageParams from .alert_create_for_customer_params import AlertCreateForCustomerParams as AlertCreateForCustomerParams from .subscription_update_trial_params import SubscriptionUpdateTrialParams as SubscriptionUpdateTrialParams -from .invoice_line_item_create_response import InvoiceLineItemCreateResponse as InvoiceLineItemCreateResponse from .subscription_fetch_costs_response import SubscriptionFetchCostsResponse as SubscriptionFetchCostsResponse from .subscription_trigger_phase_params import SubscriptionTriggerPhaseParams as SubscriptionTriggerPhaseParams from .subscription_fetch_schedule_params import SubscriptionFetchScheduleParams as SubscriptionFetchScheduleParams -from .subscription_update_trial_response import SubscriptionUpdateTrialResponse as SubscriptionUpdateTrialResponse from .dimensional_price_group_list_params import DimensionalPriceGroupListParams as DimensionalPriceGroupListParams from .subscription_price_intervals_params import SubscriptionPriceIntervalsParams as SubscriptionPriceIntervalsParams -from .subscription_trigger_phase_response import SubscriptionTriggerPhaseResponse as SubscriptionTriggerPhaseResponse from .alert_create_for_subscription_params import AlertCreateForSubscriptionParams as AlertCreateForSubscriptionParams from .subscription_fetch_schedule_response import SubscriptionFetchScheduleResponse as SubscriptionFetchScheduleResponse from .customer_update_by_external_id_params import CustomerUpdateByExternalIDParams as CustomerUpdateByExternalIDParams from .dimensional_price_group_create_params import ( DimensionalPriceGroupCreateParams as DimensionalPriceGroupCreateParams, ) -from .subscription_price_intervals_response import ( - SubscriptionPriceIntervalsResponse as SubscriptionPriceIntervalsResponse, -) from .subscription_schedule_plan_change_params import ( SubscriptionSchedulePlanChangeParams as SubscriptionSchedulePlanChangeParams, ) from .alert_create_for_external_customer_params import ( AlertCreateForExternalCustomerParams as AlertCreateForExternalCustomerParams, ) -from .subscription_schedule_plan_change_response import ( - SubscriptionSchedulePlanChangeResponse as SubscriptionSchedulePlanChangeResponse, -) -from .subscription_unschedule_cancellation_response import ( - SubscriptionUnscheduleCancellationResponse as SubscriptionUnscheduleCancellationResponse, -) from .subscription_update_fixed_fee_quantity_params import ( SubscriptionUpdateFixedFeeQuantityParams as SubscriptionUpdateFixedFeeQuantityParams, ) -from .subscription_update_fixed_fee_quantity_response import ( - SubscriptionUpdateFixedFeeQuantityResponse as SubscriptionUpdateFixedFeeQuantityResponse, -) -from .subscription_unschedule_pending_plan_changes_response import ( - SubscriptionUnschedulePendingPlanChangesResponse as SubscriptionUnschedulePendingPlanChangesResponse, -) from .subscription_unschedule_fixed_fee_quantity_updates_params import ( SubscriptionUnscheduleFixedFeeQuantityUpdatesParams as SubscriptionUnscheduleFixedFeeQuantityUpdatesParams, ) -from .subscription_unschedule_fixed_fee_quantity_updates_response import ( - SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse as SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse, -) diff --git a/src/orb/types/alert_create_for_customer_params.py b/src/orb/types/alert_create_for_customer_params.py index 5eeec557..9543c95d 100644 --- a/src/orb/types/alert_create_for_customer_params.py +++ b/src/orb/types/alert_create_for_customer_params.py @@ -5,7 +5,9 @@ from typing import Iterable, Optional from typing_extensions import Literal, Required, TypedDict -__all__ = ["AlertCreateForCustomerParams", "Threshold"] +from .shared_params.threshold_model import ThresholdModel + +__all__ = ["AlertCreateForCustomerParams"] class AlertCreateForCustomerParams(TypedDict, total=False): @@ -23,14 +25,5 @@ class AlertCreateForCustomerParams(TypedDict, total=False): ] """The type of alert to create. This must be a valid alert type.""" - thresholds: Optional[Iterable[Threshold]] + thresholds: Optional[Iterable[ThresholdModel]] """The thresholds that define the values at which the alert will be triggered.""" - - -class Threshold(TypedDict, total=False): - value: Required[float] - """The value at which an alert will fire. - - For credit balance alerts, the alert will fire at or below this value. For usage - and cost alerts, the alert will fire at or above this value. - """ diff --git a/src/orb/types/alert_create_for_external_customer_params.py b/src/orb/types/alert_create_for_external_customer_params.py index 6732f61c..404a1c49 100644 --- a/src/orb/types/alert_create_for_external_customer_params.py +++ b/src/orb/types/alert_create_for_external_customer_params.py @@ -5,7 +5,9 @@ from typing import Iterable, Optional from typing_extensions import Literal, Required, TypedDict -__all__ = ["AlertCreateForExternalCustomerParams", "Threshold"] +from .shared_params.threshold_model import ThresholdModel + +__all__ = ["AlertCreateForExternalCustomerParams"] class AlertCreateForExternalCustomerParams(TypedDict, total=False): @@ -23,14 +25,5 @@ class AlertCreateForExternalCustomerParams(TypedDict, total=False): ] """The type of alert to create. This must be a valid alert type.""" - thresholds: Optional[Iterable[Threshold]] + thresholds: Optional[Iterable[ThresholdModel]] """The thresholds that define the values at which the alert will be triggered.""" - - -class Threshold(TypedDict, total=False): - value: Required[float] - """The value at which an alert will fire. - - For credit balance alerts, the alert will fire at or below this value. For usage - and cost alerts, the alert will fire at or above this value. - """ diff --git a/src/orb/types/alert_create_for_subscription_params.py b/src/orb/types/alert_create_for_subscription_params.py index 767408dc..84a76254 100644 --- a/src/orb/types/alert_create_for_subscription_params.py +++ b/src/orb/types/alert_create_for_subscription_params.py @@ -5,11 +5,13 @@ from typing import Iterable, Optional from typing_extensions import Literal, Required, TypedDict -__all__ = ["AlertCreateForSubscriptionParams", "Threshold"] +from .shared_params.threshold_model import ThresholdModel + +__all__ = ["AlertCreateForSubscriptionParams"] class AlertCreateForSubscriptionParams(TypedDict, total=False): - thresholds: Required[Iterable[Threshold]] + thresholds: Required[Iterable[ThresholdModel]] """The thresholds that define the values at which the alert will be triggered.""" type: Required[ @@ -25,12 +27,3 @@ class AlertCreateForSubscriptionParams(TypedDict, total=False): metric_id: Optional[str] """The metric to track usage for.""" - - -class Threshold(TypedDict, total=False): - value: Required[float] - """The value at which an alert will fire. - - For credit balance alerts, the alert will fire at or below this value. For usage - and cost alerts, the alert will fire at or above this value. - """ diff --git a/src/orb/types/alert_update_params.py b/src/orb/types/alert_update_params.py index 6be6b1d2..85c76599 100644 --- a/src/orb/types/alert_update_params.py +++ b/src/orb/types/alert_update_params.py @@ -5,18 +5,11 @@ from typing import Iterable from typing_extensions import Required, TypedDict -__all__ = ["AlertUpdateParams", "Threshold"] +from .shared_params.threshold_model import ThresholdModel + +__all__ = ["AlertUpdateParams"] class AlertUpdateParams(TypedDict, total=False): - thresholds: Required[Iterable[Threshold]] + thresholds: Required[Iterable[ThresholdModel]] """The thresholds that define the values at which the alert will be triggered.""" - - -class Threshold(TypedDict, total=False): - value: Required[float] - """The value at which an alert will fire. - - For credit balance alerts, the alert will fire at or below this value. For usage - and cost alerts, the alert will fire at or above this value. - """ diff --git a/src/orb/types/customer_create_params.py b/src/orb/types/customer_create_params.py index 7e1c1732..5330c6d7 100644 --- a/src/orb/types/customer_create_params.py +++ b/src/orb/types/customer_create_params.py @@ -2,22 +2,17 @@ from __future__ import annotations -from typing import Dict, List, Union, Iterable, Optional -from typing_extensions import Literal, Required, TypeAlias, TypedDict +from typing import Dict, List, Optional +from typing_extensions import Literal, Required, TypedDict -__all__ = [ - "CustomerCreateParams", - "AccountingSyncConfiguration", - "AccountingSyncConfigurationAccountingProvider", - "BillingAddress", - "Hierarchy", - "ReportingConfiguration", - "ShippingAddress", - "TaxConfiguration", - "TaxConfigurationNewAvalaraTaxConfiguration", - "TaxConfigurationNewTaxJarConfiguration", - "TaxID", -] +from .shared_params.address_input_model import AddressInputModel +from .shared_params.customer_tax_id_model import CustomerTaxIDModel +from .shared_params.new_tax_configuration_model import NewTaxConfigurationModel +from .shared_params.customer_hierarchy_config_model import CustomerHierarchyConfigModel +from .shared_params.new_reporting_configuration_model import NewReportingConfigurationModel +from .shared_params.new_accounting_sync_configuration_model import NewAccountingSyncConfigurationModel + +__all__ = ["CustomerCreateParams"] class CustomerCreateParams(TypedDict, total=False): @@ -31,7 +26,7 @@ class CustomerCreateParams(TypedDict, total=False): name: Required[str] """The full name of the customer""" - accounting_sync_configuration: Optional[AccountingSyncConfiguration] + accounting_sync_configuration: Optional[NewAccountingSyncConfigurationModel] additional_emails: Optional[List[str]] """Additional email addresses for this customer. @@ -46,7 +41,7 @@ class CustomerCreateParams(TypedDict, total=False): when a payment provider is provided on customer creation. """ - billing_address: Optional[BillingAddress] + billing_address: Optional[AddressInputModel] currency: Optional[str] """An ISO 4217 currency string used for the customer's invoices and balance. @@ -63,7 +58,7 @@ class CustomerCreateParams(TypedDict, total=False): an existing identifier in your system. """ - hierarchy: Optional[Hierarchy] + hierarchy: Optional[CustomerHierarchyConfigModel] """The hierarchical relationships for this customer.""" metadata: Optional[Dict[str, Optional[str]]] @@ -86,13 +81,13 @@ class CustomerCreateParams(TypedDict, total=False): This is used for creating charges or invoices in the external system via Orb. """ - reporting_configuration: Optional[ReportingConfiguration] + reporting_configuration: Optional[NewReportingConfigurationModel] - shipping_address: Optional[ShippingAddress] + shipping_address: Optional[AddressInputModel] - tax_configuration: Optional[TaxConfiguration] + tax_configuration: Optional[NewTaxConfigurationModel] - tax_id: Optional[TaxID] + tax_id: Optional[CustomerTaxIDModel] """ Tax IDs are commonly required to be displayed on customer invoices, which are added to the headers of invoices. @@ -207,241 +202,3 @@ class CustomerCreateParams(TypedDict, total=False): `"America/Los_Angeles"`. This defaults to your account's timezone if not set. This cannot be changed after customer creation. """ - - -class AccountingSyncConfigurationAccountingProvider(TypedDict, total=False): - external_provider_id: Required[str] - - provider_type: Required[str] - - -class AccountingSyncConfiguration(TypedDict, total=False): - accounting_providers: Optional[Iterable[AccountingSyncConfigurationAccountingProvider]] - - excluded: Optional[bool] - - -class BillingAddress(TypedDict, total=False): - city: Optional[str] - - country: Optional[str] - - line1: Optional[str] - - line2: Optional[str] - - postal_code: Optional[str] - - state: Optional[str] - - -class Hierarchy(TypedDict, total=False): - child_customer_ids: List[str] - """A list of child customer IDs to add to the hierarchy. - - The desired child customers must not already be part of another hierarchy. - """ - - parent_customer_id: Optional[str] - """The ID of the parent customer in the hierarchy. - - The desired parent customer must not be a child of another customer. - """ - - -class ReportingConfiguration(TypedDict, total=False): - exempt: Required[bool] - - -class ShippingAddress(TypedDict, total=False): - city: Optional[str] - - country: Optional[str] - - line1: Optional[str] - - line2: Optional[str] - - postal_code: Optional[str] - - state: Optional[str] - - -class TaxConfigurationNewAvalaraTaxConfiguration(TypedDict, total=False): - tax_exempt: Required[bool] - - tax_provider: Required[Literal["avalara"]] - - tax_exemption_code: Optional[str] - - -class TaxConfigurationNewTaxJarConfiguration(TypedDict, total=False): - tax_exempt: Required[bool] - - tax_provider: Required[Literal["taxjar"]] - - -TaxConfiguration: TypeAlias = Union[TaxConfigurationNewAvalaraTaxConfiguration, TaxConfigurationNewTaxJarConfiguration] - - -class TaxID(TypedDict, total=False): - country: Required[ - Literal[ - "AD", - "AE", - "AR", - "AT", - "AU", - "BE", - "BG", - "BH", - "BO", - "BR", - "CA", - "CH", - "CL", - "CN", - "CO", - "CR", - "CY", - "CZ", - "DE", - "DK", - "EE", - "DO", - "EC", - "EG", - "ES", - "EU", - "FI", - "FR", - "GB", - "GE", - "GR", - "HK", - "HR", - "HU", - "ID", - "IE", - "IL", - "IN", - "IS", - "IT", - "JP", - "KE", - "KR", - "KZ", - "LI", - "LT", - "LU", - "LV", - "MT", - "MX", - "MY", - "NG", - "NL", - "NO", - "NZ", - "OM", - "PE", - "PH", - "PL", - "PT", - "RO", - "RS", - "RU", - "SA", - "SE", - "SG", - "SI", - "SK", - "SV", - "TH", - "TR", - "TW", - "UA", - "US", - "UY", - "VE", - "VN", - "ZA", - ] - ] - - type: Required[ - Literal[ - "ad_nrt", - "ae_trn", - "ar_cuit", - "eu_vat", - "au_abn", - "au_arn", - "bg_uic", - "bh_vat", - "bo_tin", - "br_cnpj", - "br_cpf", - "ca_bn", - "ca_gst_hst", - "ca_pst_bc", - "ca_pst_mb", - "ca_pst_sk", - "ca_qst", - "ch_vat", - "cl_tin", - "cn_tin", - "co_nit", - "cr_tin", - "do_rcn", - "ec_ruc", - "eg_tin", - "es_cif", - "eu_oss_vat", - "gb_vat", - "ge_vat", - "hk_br", - "hu_tin", - "id_npwp", - "il_vat", - "in_gst", - "is_vat", - "jp_cn", - "jp_rn", - "jp_trn", - "ke_pin", - "kr_brn", - "kz_bin", - "li_uid", - "mx_rfc", - "my_frp", - "my_itn", - "my_sst", - "ng_tin", - "no_vat", - "no_voec", - "nz_gst", - "om_vat", - "pe_ruc", - "ph_tin", - "ro_tin", - "rs_pib", - "ru_inn", - "ru_kpp", - "sa_vat", - "sg_gst", - "sg_uen", - "si_tin", - "sv_nit", - "th_vat", - "tr_tin", - "tw_vat", - "ua_vat", - "us_ein", - "uy_ruc", - "ve_rif", - "vn_tin", - "za_vat", - ] - ] - - value: Required[str] diff --git a/src/orb/types/customer_update_by_external_id_params.py b/src/orb/types/customer_update_by_external_id_params.py index cb1dfd2d..4e50c365 100644 --- a/src/orb/types/customer_update_by_external_id_params.py +++ b/src/orb/types/customer_update_by_external_id_params.py @@ -2,26 +2,21 @@ from __future__ import annotations -from typing import Dict, List, Union, Iterable, Optional -from typing_extensions import Literal, Required, TypeAlias, TypedDict +from typing import Dict, List, Optional +from typing_extensions import Literal, TypedDict -__all__ = [ - "CustomerUpdateByExternalIDParams", - "AccountingSyncConfiguration", - "AccountingSyncConfigurationAccountingProvider", - "BillingAddress", - "Hierarchy", - "ReportingConfiguration", - "ShippingAddress", - "TaxConfiguration", - "TaxConfigurationNewAvalaraTaxConfiguration", - "TaxConfigurationNewTaxJarConfiguration", - "TaxID", -] +from .shared_params.address_input_model import AddressInputModel +from .shared_params.customer_tax_id_model import CustomerTaxIDModel +from .shared_params.new_tax_configuration_model import NewTaxConfigurationModel +from .shared_params.customer_hierarchy_config_model import CustomerHierarchyConfigModel +from .shared_params.new_reporting_configuration_model import NewReportingConfigurationModel +from .shared_params.new_accounting_sync_configuration_model import NewAccountingSyncConfigurationModel + +__all__ = ["CustomerUpdateByExternalIDParams"] class CustomerUpdateByExternalIDParams(TypedDict, total=False): - accounting_sync_configuration: Optional[AccountingSyncConfiguration] + accounting_sync_configuration: Optional[NewAccountingSyncConfigurationModel] additional_emails: Optional[List[str]] """Additional email addresses for this customer. @@ -36,7 +31,7 @@ class CustomerUpdateByExternalIDParams(TypedDict, total=False): when a payment provider is provided on customer creation. """ - billing_address: Optional[BillingAddress] + billing_address: Optional[AddressInputModel] currency: Optional[str] """An ISO 4217 currency string used for the customer's invoices and balance. @@ -56,7 +51,7 @@ class CustomerUpdateByExternalIDParams(TypedDict, total=False): subscriptions. """ - hierarchy: Optional[Hierarchy] + hierarchy: Optional[CustomerHierarchyConfigModel] """The hierarchical relationships for this customer.""" metadata: Optional[Dict[str, Optional[str]]] @@ -86,13 +81,13 @@ class CustomerUpdateByExternalIDParams(TypedDict, total=False): This is used for creating charges or invoices in the external system via Orb. """ - reporting_configuration: Optional[ReportingConfiguration] + reporting_configuration: Optional[NewReportingConfigurationModel] - shipping_address: Optional[ShippingAddress] + shipping_address: Optional[AddressInputModel] - tax_configuration: Optional[TaxConfiguration] + tax_configuration: Optional[NewTaxConfigurationModel] - tax_id: Optional[TaxID] + tax_id: Optional[CustomerTaxIDModel] """ Tax IDs are commonly required to be displayed on customer invoices, which are added to the headers of invoices. @@ -200,241 +195,3 @@ class CustomerUpdateByExternalIDParams(TypedDict, total=False): | Venezuela | `ve_rif` | Venezuelan RIF Number | | Vietnam | `vn_tin` | Vietnamese Tax ID Number | """ - - -class AccountingSyncConfigurationAccountingProvider(TypedDict, total=False): - external_provider_id: Required[str] - - provider_type: Required[str] - - -class AccountingSyncConfiguration(TypedDict, total=False): - accounting_providers: Optional[Iterable[AccountingSyncConfigurationAccountingProvider]] - - excluded: Optional[bool] - - -class BillingAddress(TypedDict, total=False): - city: Optional[str] - - country: Optional[str] - - line1: Optional[str] - - line2: Optional[str] - - postal_code: Optional[str] - - state: Optional[str] - - -class Hierarchy(TypedDict, total=False): - child_customer_ids: List[str] - """A list of child customer IDs to add to the hierarchy. - - The desired child customers must not already be part of another hierarchy. - """ - - parent_customer_id: Optional[str] - """The ID of the parent customer in the hierarchy. - - The desired parent customer must not be a child of another customer. - """ - - -class ReportingConfiguration(TypedDict, total=False): - exempt: Required[bool] - - -class ShippingAddress(TypedDict, total=False): - city: Optional[str] - - country: Optional[str] - - line1: Optional[str] - - line2: Optional[str] - - postal_code: Optional[str] - - state: Optional[str] - - -class TaxConfigurationNewAvalaraTaxConfiguration(TypedDict, total=False): - tax_exempt: Required[bool] - - tax_provider: Required[Literal["avalara"]] - - tax_exemption_code: Optional[str] - - -class TaxConfigurationNewTaxJarConfiguration(TypedDict, total=False): - tax_exempt: Required[bool] - - tax_provider: Required[Literal["taxjar"]] - - -TaxConfiguration: TypeAlias = Union[TaxConfigurationNewAvalaraTaxConfiguration, TaxConfigurationNewTaxJarConfiguration] - - -class TaxID(TypedDict, total=False): - country: Required[ - Literal[ - "AD", - "AE", - "AR", - "AT", - "AU", - "BE", - "BG", - "BH", - "BO", - "BR", - "CA", - "CH", - "CL", - "CN", - "CO", - "CR", - "CY", - "CZ", - "DE", - "DK", - "EE", - "DO", - "EC", - "EG", - "ES", - "EU", - "FI", - "FR", - "GB", - "GE", - "GR", - "HK", - "HR", - "HU", - "ID", - "IE", - "IL", - "IN", - "IS", - "IT", - "JP", - "KE", - "KR", - "KZ", - "LI", - "LT", - "LU", - "LV", - "MT", - "MX", - "MY", - "NG", - "NL", - "NO", - "NZ", - "OM", - "PE", - "PH", - "PL", - "PT", - "RO", - "RS", - "RU", - "SA", - "SE", - "SG", - "SI", - "SK", - "SV", - "TH", - "TR", - "TW", - "UA", - "US", - "UY", - "VE", - "VN", - "ZA", - ] - ] - - type: Required[ - Literal[ - "ad_nrt", - "ae_trn", - "ar_cuit", - "eu_vat", - "au_abn", - "au_arn", - "bg_uic", - "bh_vat", - "bo_tin", - "br_cnpj", - "br_cpf", - "ca_bn", - "ca_gst_hst", - "ca_pst_bc", - "ca_pst_mb", - "ca_pst_sk", - "ca_qst", - "ch_vat", - "cl_tin", - "cn_tin", - "co_nit", - "cr_tin", - "do_rcn", - "ec_ruc", - "eg_tin", - "es_cif", - "eu_oss_vat", - "gb_vat", - "ge_vat", - "hk_br", - "hu_tin", - "id_npwp", - "il_vat", - "in_gst", - "is_vat", - "jp_cn", - "jp_rn", - "jp_trn", - "ke_pin", - "kr_brn", - "kz_bin", - "li_uid", - "mx_rfc", - "my_frp", - "my_itn", - "my_sst", - "ng_tin", - "no_vat", - "no_voec", - "nz_gst", - "om_vat", - "pe_ruc", - "ph_tin", - "ro_tin", - "rs_pib", - "ru_inn", - "ru_kpp", - "sa_vat", - "sg_gst", - "sg_uen", - "si_tin", - "sv_nit", - "th_vat", - "tr_tin", - "tw_vat", - "ua_vat", - "us_ein", - "uy_ruc", - "ve_rif", - "vn_tin", - "za_vat", - ] - ] - - value: Required[str] diff --git a/src/orb/types/customer_update_params.py b/src/orb/types/customer_update_params.py index 886737d6..30c224ab 100644 --- a/src/orb/types/customer_update_params.py +++ b/src/orb/types/customer_update_params.py @@ -2,26 +2,21 @@ from __future__ import annotations -from typing import Dict, List, Union, Iterable, Optional -from typing_extensions import Literal, Required, TypeAlias, TypedDict +from typing import Dict, List, Optional +from typing_extensions import Literal, TypedDict -__all__ = [ - "CustomerUpdateParams", - "AccountingSyncConfiguration", - "AccountingSyncConfigurationAccountingProvider", - "BillingAddress", - "Hierarchy", - "ReportingConfiguration", - "ShippingAddress", - "TaxConfiguration", - "TaxConfigurationNewAvalaraTaxConfiguration", - "TaxConfigurationNewTaxJarConfiguration", - "TaxID", -] +from .shared_params.address_input_model import AddressInputModel +from .shared_params.customer_tax_id_model import CustomerTaxIDModel +from .shared_params.new_tax_configuration_model import NewTaxConfigurationModel +from .shared_params.customer_hierarchy_config_model import CustomerHierarchyConfigModel +from .shared_params.new_reporting_configuration_model import NewReportingConfigurationModel +from .shared_params.new_accounting_sync_configuration_model import NewAccountingSyncConfigurationModel + +__all__ = ["CustomerUpdateParams"] class CustomerUpdateParams(TypedDict, total=False): - accounting_sync_configuration: Optional[AccountingSyncConfiguration] + accounting_sync_configuration: Optional[NewAccountingSyncConfigurationModel] additional_emails: Optional[List[str]] """Additional email addresses for this customer. @@ -36,7 +31,7 @@ class CustomerUpdateParams(TypedDict, total=False): when a payment provider is provided on customer creation. """ - billing_address: Optional[BillingAddress] + billing_address: Optional[AddressInputModel] currency: Optional[str] """An ISO 4217 currency string used for the customer's invoices and balance. @@ -56,7 +51,7 @@ class CustomerUpdateParams(TypedDict, total=False): subscriptions. """ - hierarchy: Optional[Hierarchy] + hierarchy: Optional[CustomerHierarchyConfigModel] """The hierarchical relationships for this customer.""" metadata: Optional[Dict[str, Optional[str]]] @@ -86,13 +81,13 @@ class CustomerUpdateParams(TypedDict, total=False): This is used for creating charges or invoices in the external system via Orb. """ - reporting_configuration: Optional[ReportingConfiguration] + reporting_configuration: Optional[NewReportingConfigurationModel] - shipping_address: Optional[ShippingAddress] + shipping_address: Optional[AddressInputModel] - tax_configuration: Optional[TaxConfiguration] + tax_configuration: Optional[NewTaxConfigurationModel] - tax_id: Optional[TaxID] + tax_id: Optional[CustomerTaxIDModel] """ Tax IDs are commonly required to be displayed on customer invoices, which are added to the headers of invoices. @@ -200,241 +195,3 @@ class CustomerUpdateParams(TypedDict, total=False): | Venezuela | `ve_rif` | Venezuelan RIF Number | | Vietnam | `vn_tin` | Vietnamese Tax ID Number | """ - - -class AccountingSyncConfigurationAccountingProvider(TypedDict, total=False): - external_provider_id: Required[str] - - provider_type: Required[str] - - -class AccountingSyncConfiguration(TypedDict, total=False): - accounting_providers: Optional[Iterable[AccountingSyncConfigurationAccountingProvider]] - - excluded: Optional[bool] - - -class BillingAddress(TypedDict, total=False): - city: Optional[str] - - country: Optional[str] - - line1: Optional[str] - - line2: Optional[str] - - postal_code: Optional[str] - - state: Optional[str] - - -class Hierarchy(TypedDict, total=False): - child_customer_ids: List[str] - """A list of child customer IDs to add to the hierarchy. - - The desired child customers must not already be part of another hierarchy. - """ - - parent_customer_id: Optional[str] - """The ID of the parent customer in the hierarchy. - - The desired parent customer must not be a child of another customer. - """ - - -class ReportingConfiguration(TypedDict, total=False): - exempt: Required[bool] - - -class ShippingAddress(TypedDict, total=False): - city: Optional[str] - - country: Optional[str] - - line1: Optional[str] - - line2: Optional[str] - - postal_code: Optional[str] - - state: Optional[str] - - -class TaxConfigurationNewAvalaraTaxConfiguration(TypedDict, total=False): - tax_exempt: Required[bool] - - tax_provider: Required[Literal["avalara"]] - - tax_exemption_code: Optional[str] - - -class TaxConfigurationNewTaxJarConfiguration(TypedDict, total=False): - tax_exempt: Required[bool] - - tax_provider: Required[Literal["taxjar"]] - - -TaxConfiguration: TypeAlias = Union[TaxConfigurationNewAvalaraTaxConfiguration, TaxConfigurationNewTaxJarConfiguration] - - -class TaxID(TypedDict, total=False): - country: Required[ - Literal[ - "AD", - "AE", - "AR", - "AT", - "AU", - "BE", - "BG", - "BH", - "BO", - "BR", - "CA", - "CH", - "CL", - "CN", - "CO", - "CR", - "CY", - "CZ", - "DE", - "DK", - "EE", - "DO", - "EC", - "EG", - "ES", - "EU", - "FI", - "FR", - "GB", - "GE", - "GR", - "HK", - "HR", - "HU", - "ID", - "IE", - "IL", - "IN", - "IS", - "IT", - "JP", - "KE", - "KR", - "KZ", - "LI", - "LT", - "LU", - "LV", - "MT", - "MX", - "MY", - "NG", - "NL", - "NO", - "NZ", - "OM", - "PE", - "PH", - "PL", - "PT", - "RO", - "RS", - "RU", - "SA", - "SE", - "SG", - "SI", - "SK", - "SV", - "TH", - "TR", - "TW", - "UA", - "US", - "UY", - "VE", - "VN", - "ZA", - ] - ] - - type: Required[ - Literal[ - "ad_nrt", - "ae_trn", - "ar_cuit", - "eu_vat", - "au_abn", - "au_arn", - "bg_uic", - "bh_vat", - "bo_tin", - "br_cnpj", - "br_cpf", - "ca_bn", - "ca_gst_hst", - "ca_pst_bc", - "ca_pst_mb", - "ca_pst_sk", - "ca_qst", - "ch_vat", - "cl_tin", - "cn_tin", - "co_nit", - "cr_tin", - "do_rcn", - "ec_ruc", - "eg_tin", - "es_cif", - "eu_oss_vat", - "gb_vat", - "ge_vat", - "hk_br", - "hu_tin", - "id_npwp", - "il_vat", - "in_gst", - "is_vat", - "jp_cn", - "jp_rn", - "jp_trn", - "ke_pin", - "kr_brn", - "kz_bin", - "li_uid", - "mx_rfc", - "my_frp", - "my_itn", - "my_sst", - "ng_tin", - "no_vat", - "no_voec", - "nz_gst", - "om_vat", - "pe_ruc", - "ph_tin", - "ro_tin", - "rs_pib", - "ru_inn", - "ru_kpp", - "sa_vat", - "sg_gst", - "sg_uen", - "si_tin", - "sv_nit", - "th_vat", - "tr_tin", - "tw_vat", - "ua_vat", - "us_ein", - "uy_ruc", - "ve_rif", - "vn_tin", - "za_vat", - ] - ] - - value: Required[str] diff --git a/src/orb/types/customers/__init__.py b/src/orb/types/customers/__init__.py index ba43a9b2..ce40c42f 100644 --- a/src/orb/types/customers/__init__.py +++ b/src/orb/types/customers/__init__.py @@ -3,14 +3,8 @@ from __future__ import annotations from .cost_list_params import CostListParams as CostListParams -from .cost_list_response import CostListResponse as CostListResponse from .credit_list_params import CreditListParams as CreditListParams -from .credit_list_response import CreditListResponse as CreditListResponse from .balance_transaction_list_params import BalanceTransactionListParams as BalanceTransactionListParams from .cost_list_by_external_id_params import CostListByExternalIDParams as CostListByExternalIDParams from .balance_transaction_create_params import BalanceTransactionCreateParams as BalanceTransactionCreateParams -from .balance_transaction_list_response import BalanceTransactionListResponse as BalanceTransactionListResponse -from .cost_list_by_external_id_response import CostListByExternalIDResponse as CostListByExternalIDResponse from .credit_list_by_external_id_params import CreditListByExternalIDParams as CreditListByExternalIDParams -from .balance_transaction_create_response import BalanceTransactionCreateResponse as BalanceTransactionCreateResponse -from .credit_list_by_external_id_response import CreditListByExternalIDResponse as CreditListByExternalIDResponse diff --git a/src/orb/types/customers/balance_transaction_create_response.py b/src/orb/types/customers/balance_transaction_create_response.py deleted file mode 100644 index 37b07da1..00000000 --- a/src/orb/types/customers/balance_transaction_create_response.py +++ /dev/null @@ -1,63 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from datetime import datetime -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["BalanceTransactionCreateResponse", "CreditNote", "Invoice"] - - -class CreditNote(BaseModel): - id: str - """The id of the Credit note""" - - -class Invoice(BaseModel): - id: str - """The Invoice id""" - - -class BalanceTransactionCreateResponse(BaseModel): - id: str - """A unique id for this transaction.""" - - action: Literal[ - "applied_to_invoice", - "manual_adjustment", - "prorated_refund", - "revert_prorated_refund", - "return_from_voiding", - "credit_note_applied", - "credit_note_voided", - "overpayment_refund", - "external_payment", - ] - - amount: str - """The value of the amount changed in the transaction.""" - - created_at: datetime - """The creation time of this transaction.""" - - credit_note: Optional[CreditNote] = None - - description: Optional[str] = None - """An optional description provided for manual customer balance adjustments.""" - - ending_balance: str - """ - The new value of the customer's balance prior to the transaction, in the - customer's currency. - """ - - invoice: Optional[Invoice] = None - - starting_balance: str - """ - The original value of the customer's balance prior to the transaction, in the - customer's currency. - """ - - type: Literal["increment", "decrement"] diff --git a/src/orb/types/customers/cost_list_by_external_id_response.py b/src/orb/types/customers/cost_list_by_external_id_response.py deleted file mode 100644 index ff23d144..00000000 --- a/src/orb/types/customers/cost_list_by_external_id_response.py +++ /dev/null @@ -1,44 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional -from datetime import datetime - -from ..price import Price -from ..._models import BaseModel - -__all__ = ["CostListByExternalIDResponse", "Data", "DataPerPriceCost"] - - -class DataPerPriceCost(BaseModel): - price: Price - """The price object""" - - price_id: str - """The price the cost is associated with""" - - subtotal: str - """Price's contributions for the timeframe, excluding any minimums and discounts.""" - - total: str - """Price's contributions for the timeframe, including minimums and discounts.""" - - quantity: Optional[float] = None - """The price's quantity for the timeframe""" - - -class Data(BaseModel): - per_price_costs: List[DataPerPriceCost] - - subtotal: str - """Total costs for the timeframe, excluding any minimums and discounts.""" - - timeframe_end: datetime - - timeframe_start: datetime - - total: str - """Total costs for the timeframe, including any minimums and discounts.""" - - -class CostListByExternalIDResponse(BaseModel): - data: List[Data] diff --git a/src/orb/types/customers/credit_list_by_external_id_response.py b/src/orb/types/customers/credit_list_by_external_id_response.py deleted file mode 100644 index d88e900b..00000000 --- a/src/orb/types/customers/credit_list_by_external_id_response.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from datetime import datetime -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["CreditListByExternalIDResponse"] - - -class CreditListByExternalIDResponse(BaseModel): - id: str - - balance: float - - effective_date: Optional[datetime] = None - - expiry_date: Optional[datetime] = None - - maximum_initial_balance: Optional[float] = None - - per_unit_cost_basis: Optional[str] = None - - status: Literal["active", "pending_payment"] diff --git a/src/orb/types/customers/credits/__init__.py b/src/orb/types/customers/credits/__init__.py index 9baa17d8..5784e8f4 100644 --- a/src/orb/types/customers/credits/__init__.py +++ b/src/orb/types/customers/credits/__init__.py @@ -4,21 +4,11 @@ from .ledger_list_params import LedgerListParams as LedgerListParams from .top_up_list_params import TopUpListParams as TopUpListParams -from .ledger_list_response import LedgerListResponse as LedgerListResponse from .top_up_create_params import TopUpCreateParams as TopUpCreateParams -from .top_up_list_response import TopUpListResponse as TopUpListResponse -from .top_up_create_response import TopUpCreateResponse as TopUpCreateResponse from .ledger_create_entry_params import LedgerCreateEntryParams as LedgerCreateEntryParams -from .ledger_create_entry_response import LedgerCreateEntryResponse as LedgerCreateEntryResponse from .ledger_list_by_external_id_params import LedgerListByExternalIDParams as LedgerListByExternalIDParams from .top_up_list_by_external_id_params import TopUpListByExternalIDParams as TopUpListByExternalIDParams -from .ledger_list_by_external_id_response import LedgerListByExternalIDResponse as LedgerListByExternalIDResponse from .top_up_create_by_external_id_params import TopUpCreateByExternalIDParams as TopUpCreateByExternalIDParams -from .top_up_list_by_external_id_response import TopUpListByExternalIDResponse as TopUpListByExternalIDResponse -from .top_up_create_by_external_id_response import TopUpCreateByExternalIDResponse as TopUpCreateByExternalIDResponse from .ledger_create_entry_by_external_id_params import ( LedgerCreateEntryByExternalIDParams as LedgerCreateEntryByExternalIDParams, ) -from .ledger_create_entry_by_external_id_response import ( - LedgerCreateEntryByExternalIDResponse as LedgerCreateEntryByExternalIDResponse, -) diff --git a/src/orb/types/customers/credits/ledger_create_entry_by_external_id_response.py b/src/orb/types/customers/credits/ledger_create_entry_by_external_id_response.py deleted file mode 100644 index 903d95f3..00000000 --- a/src/orb/types/customers/credits/ledger_create_entry_by_external_id_response.py +++ /dev/null @@ -1,401 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, Union, Optional -from datetime import datetime -from typing_extensions import Literal, Annotated, TypeAlias - -from ...._utils import PropertyInfo -from ...._models import BaseModel - -__all__ = [ - "LedgerCreateEntryByExternalIDResponse", - "IncrementLedgerEntry", - "IncrementLedgerEntryCreditBlock", - "IncrementLedgerEntryCustomer", - "DecrementLedgerEntry", - "DecrementLedgerEntryCreditBlock", - "DecrementLedgerEntryCustomer", - "ExpirationChangeLedgerEntry", - "ExpirationChangeLedgerEntryCreditBlock", - "ExpirationChangeLedgerEntryCustomer", - "CreditBlockExpiryLedgerEntry", - "CreditBlockExpiryLedgerEntryCreditBlock", - "CreditBlockExpiryLedgerEntryCustomer", - "VoidLedgerEntry", - "VoidLedgerEntryCreditBlock", - "VoidLedgerEntryCustomer", - "VoidInitiatedLedgerEntry", - "VoidInitiatedLedgerEntryCreditBlock", - "VoidInitiatedLedgerEntryCustomer", - "AmendmentLedgerEntry", - "AmendmentLedgerEntryCreditBlock", - "AmendmentLedgerEntryCustomer", -] - - -class IncrementLedgerEntryCreditBlock(BaseModel): - id: str - - expiry_date: Optional[datetime] = None - - per_unit_cost_basis: Optional[str] = None - - -class IncrementLedgerEntryCustomer(BaseModel): - id: str - - external_customer_id: Optional[str] = None - - -class IncrementLedgerEntry(BaseModel): - id: str - - amount: float - - created_at: datetime - - credit_block: IncrementLedgerEntryCreditBlock - - currency: str - - customer: IncrementLedgerEntryCustomer - - description: Optional[str] = None - - ending_balance: float - - entry_status: Literal["committed", "pending"] - - entry_type: Literal["increment"] - - ledger_sequence_number: int - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - starting_balance: float - - -class DecrementLedgerEntryCreditBlock(BaseModel): - id: str - - expiry_date: Optional[datetime] = None - - per_unit_cost_basis: Optional[str] = None - - -class DecrementLedgerEntryCustomer(BaseModel): - id: str - - external_customer_id: Optional[str] = None - - -class DecrementLedgerEntry(BaseModel): - id: str - - amount: float - - created_at: datetime - - credit_block: DecrementLedgerEntryCreditBlock - - currency: str - - customer: DecrementLedgerEntryCustomer - - description: Optional[str] = None - - ending_balance: float - - entry_status: Literal["committed", "pending"] - - entry_type: Literal["decrement"] - - ledger_sequence_number: int - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - starting_balance: float - - event_id: Optional[str] = None - - invoice_id: Optional[str] = None - - price_id: Optional[str] = None - - -class ExpirationChangeLedgerEntryCreditBlock(BaseModel): - id: str - - expiry_date: Optional[datetime] = None - - per_unit_cost_basis: Optional[str] = None - - -class ExpirationChangeLedgerEntryCustomer(BaseModel): - id: str - - external_customer_id: Optional[str] = None - - -class ExpirationChangeLedgerEntry(BaseModel): - id: str - - amount: float - - created_at: datetime - - credit_block: ExpirationChangeLedgerEntryCreditBlock - - currency: str - - customer: ExpirationChangeLedgerEntryCustomer - - description: Optional[str] = None - - ending_balance: float - - entry_status: Literal["committed", "pending"] - - entry_type: Literal["expiration_change"] - - ledger_sequence_number: int - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - new_block_expiry_date: Optional[datetime] = None - - starting_balance: float - - -class CreditBlockExpiryLedgerEntryCreditBlock(BaseModel): - id: str - - expiry_date: Optional[datetime] = None - - per_unit_cost_basis: Optional[str] = None - - -class CreditBlockExpiryLedgerEntryCustomer(BaseModel): - id: str - - external_customer_id: Optional[str] = None - - -class CreditBlockExpiryLedgerEntry(BaseModel): - id: str - - amount: float - - created_at: datetime - - credit_block: CreditBlockExpiryLedgerEntryCreditBlock - - currency: str - - customer: CreditBlockExpiryLedgerEntryCustomer - - description: Optional[str] = None - - ending_balance: float - - entry_status: Literal["committed", "pending"] - - entry_type: Literal["credit_block_expiry"] - - ledger_sequence_number: int - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - starting_balance: float - - -class VoidLedgerEntryCreditBlock(BaseModel): - id: str - - expiry_date: Optional[datetime] = None - - per_unit_cost_basis: Optional[str] = None - - -class VoidLedgerEntryCustomer(BaseModel): - id: str - - external_customer_id: Optional[str] = None - - -class VoidLedgerEntry(BaseModel): - id: str - - amount: float - - created_at: datetime - - credit_block: VoidLedgerEntryCreditBlock - - currency: str - - customer: VoidLedgerEntryCustomer - - description: Optional[str] = None - - ending_balance: float - - entry_status: Literal["committed", "pending"] - - entry_type: Literal["void"] - - ledger_sequence_number: int - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - starting_balance: float - - void_amount: float - - void_reason: Optional[str] = None - - -class VoidInitiatedLedgerEntryCreditBlock(BaseModel): - id: str - - expiry_date: Optional[datetime] = None - - per_unit_cost_basis: Optional[str] = None - - -class VoidInitiatedLedgerEntryCustomer(BaseModel): - id: str - - external_customer_id: Optional[str] = None - - -class VoidInitiatedLedgerEntry(BaseModel): - id: str - - amount: float - - created_at: datetime - - credit_block: VoidInitiatedLedgerEntryCreditBlock - - currency: str - - customer: VoidInitiatedLedgerEntryCustomer - - description: Optional[str] = None - - ending_balance: float - - entry_status: Literal["committed", "pending"] - - entry_type: Literal["void_initiated"] - - ledger_sequence_number: int - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - new_block_expiry_date: datetime - - starting_balance: float - - void_amount: float - - void_reason: Optional[str] = None - - -class AmendmentLedgerEntryCreditBlock(BaseModel): - id: str - - expiry_date: Optional[datetime] = None - - per_unit_cost_basis: Optional[str] = None - - -class AmendmentLedgerEntryCustomer(BaseModel): - id: str - - external_customer_id: Optional[str] = None - - -class AmendmentLedgerEntry(BaseModel): - id: str - - amount: float - - created_at: datetime - - credit_block: AmendmentLedgerEntryCreditBlock - - currency: str - - customer: AmendmentLedgerEntryCustomer - - description: Optional[str] = None - - ending_balance: float - - entry_status: Literal["committed", "pending"] - - entry_type: Literal["amendment"] - - ledger_sequence_number: int - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - starting_balance: float - - -LedgerCreateEntryByExternalIDResponse: TypeAlias = Annotated[ - Union[ - IncrementLedgerEntry, - DecrementLedgerEntry, - ExpirationChangeLedgerEntry, - CreditBlockExpiryLedgerEntry, - VoidLedgerEntry, - VoidInitiatedLedgerEntry, - AmendmentLedgerEntry, - ], - PropertyInfo(discriminator="entry_type"), -] diff --git a/src/orb/types/customers/credits/ledger_create_entry_response.py b/src/orb/types/customers/credits/ledger_create_entry_response.py deleted file mode 100644 index f21c2562..00000000 --- a/src/orb/types/customers/credits/ledger_create_entry_response.py +++ /dev/null @@ -1,401 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, Union, Optional -from datetime import datetime -from typing_extensions import Literal, Annotated, TypeAlias - -from ...._utils import PropertyInfo -from ...._models import BaseModel - -__all__ = [ - "LedgerCreateEntryResponse", - "IncrementLedgerEntry", - "IncrementLedgerEntryCreditBlock", - "IncrementLedgerEntryCustomer", - "DecrementLedgerEntry", - "DecrementLedgerEntryCreditBlock", - "DecrementLedgerEntryCustomer", - "ExpirationChangeLedgerEntry", - "ExpirationChangeLedgerEntryCreditBlock", - "ExpirationChangeLedgerEntryCustomer", - "CreditBlockExpiryLedgerEntry", - "CreditBlockExpiryLedgerEntryCreditBlock", - "CreditBlockExpiryLedgerEntryCustomer", - "VoidLedgerEntry", - "VoidLedgerEntryCreditBlock", - "VoidLedgerEntryCustomer", - "VoidInitiatedLedgerEntry", - "VoidInitiatedLedgerEntryCreditBlock", - "VoidInitiatedLedgerEntryCustomer", - "AmendmentLedgerEntry", - "AmendmentLedgerEntryCreditBlock", - "AmendmentLedgerEntryCustomer", -] - - -class IncrementLedgerEntryCreditBlock(BaseModel): - id: str - - expiry_date: Optional[datetime] = None - - per_unit_cost_basis: Optional[str] = None - - -class IncrementLedgerEntryCustomer(BaseModel): - id: str - - external_customer_id: Optional[str] = None - - -class IncrementLedgerEntry(BaseModel): - id: str - - amount: float - - created_at: datetime - - credit_block: IncrementLedgerEntryCreditBlock - - currency: str - - customer: IncrementLedgerEntryCustomer - - description: Optional[str] = None - - ending_balance: float - - entry_status: Literal["committed", "pending"] - - entry_type: Literal["increment"] - - ledger_sequence_number: int - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - starting_balance: float - - -class DecrementLedgerEntryCreditBlock(BaseModel): - id: str - - expiry_date: Optional[datetime] = None - - per_unit_cost_basis: Optional[str] = None - - -class DecrementLedgerEntryCustomer(BaseModel): - id: str - - external_customer_id: Optional[str] = None - - -class DecrementLedgerEntry(BaseModel): - id: str - - amount: float - - created_at: datetime - - credit_block: DecrementLedgerEntryCreditBlock - - currency: str - - customer: DecrementLedgerEntryCustomer - - description: Optional[str] = None - - ending_balance: float - - entry_status: Literal["committed", "pending"] - - entry_type: Literal["decrement"] - - ledger_sequence_number: int - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - starting_balance: float - - event_id: Optional[str] = None - - invoice_id: Optional[str] = None - - price_id: Optional[str] = None - - -class ExpirationChangeLedgerEntryCreditBlock(BaseModel): - id: str - - expiry_date: Optional[datetime] = None - - per_unit_cost_basis: Optional[str] = None - - -class ExpirationChangeLedgerEntryCustomer(BaseModel): - id: str - - external_customer_id: Optional[str] = None - - -class ExpirationChangeLedgerEntry(BaseModel): - id: str - - amount: float - - created_at: datetime - - credit_block: ExpirationChangeLedgerEntryCreditBlock - - currency: str - - customer: ExpirationChangeLedgerEntryCustomer - - description: Optional[str] = None - - ending_balance: float - - entry_status: Literal["committed", "pending"] - - entry_type: Literal["expiration_change"] - - ledger_sequence_number: int - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - new_block_expiry_date: Optional[datetime] = None - - starting_balance: float - - -class CreditBlockExpiryLedgerEntryCreditBlock(BaseModel): - id: str - - expiry_date: Optional[datetime] = None - - per_unit_cost_basis: Optional[str] = None - - -class CreditBlockExpiryLedgerEntryCustomer(BaseModel): - id: str - - external_customer_id: Optional[str] = None - - -class CreditBlockExpiryLedgerEntry(BaseModel): - id: str - - amount: float - - created_at: datetime - - credit_block: CreditBlockExpiryLedgerEntryCreditBlock - - currency: str - - customer: CreditBlockExpiryLedgerEntryCustomer - - description: Optional[str] = None - - ending_balance: float - - entry_status: Literal["committed", "pending"] - - entry_type: Literal["credit_block_expiry"] - - ledger_sequence_number: int - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - starting_balance: float - - -class VoidLedgerEntryCreditBlock(BaseModel): - id: str - - expiry_date: Optional[datetime] = None - - per_unit_cost_basis: Optional[str] = None - - -class VoidLedgerEntryCustomer(BaseModel): - id: str - - external_customer_id: Optional[str] = None - - -class VoidLedgerEntry(BaseModel): - id: str - - amount: float - - created_at: datetime - - credit_block: VoidLedgerEntryCreditBlock - - currency: str - - customer: VoidLedgerEntryCustomer - - description: Optional[str] = None - - ending_balance: float - - entry_status: Literal["committed", "pending"] - - entry_type: Literal["void"] - - ledger_sequence_number: int - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - starting_balance: float - - void_amount: float - - void_reason: Optional[str] = None - - -class VoidInitiatedLedgerEntryCreditBlock(BaseModel): - id: str - - expiry_date: Optional[datetime] = None - - per_unit_cost_basis: Optional[str] = None - - -class VoidInitiatedLedgerEntryCustomer(BaseModel): - id: str - - external_customer_id: Optional[str] = None - - -class VoidInitiatedLedgerEntry(BaseModel): - id: str - - amount: float - - created_at: datetime - - credit_block: VoidInitiatedLedgerEntryCreditBlock - - currency: str - - customer: VoidInitiatedLedgerEntryCustomer - - description: Optional[str] = None - - ending_balance: float - - entry_status: Literal["committed", "pending"] - - entry_type: Literal["void_initiated"] - - ledger_sequence_number: int - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - new_block_expiry_date: datetime - - starting_balance: float - - void_amount: float - - void_reason: Optional[str] = None - - -class AmendmentLedgerEntryCreditBlock(BaseModel): - id: str - - expiry_date: Optional[datetime] = None - - per_unit_cost_basis: Optional[str] = None - - -class AmendmentLedgerEntryCustomer(BaseModel): - id: str - - external_customer_id: Optional[str] = None - - -class AmendmentLedgerEntry(BaseModel): - id: str - - amount: float - - created_at: datetime - - credit_block: AmendmentLedgerEntryCreditBlock - - currency: str - - customer: AmendmentLedgerEntryCustomer - - description: Optional[str] = None - - ending_balance: float - - entry_status: Literal["committed", "pending"] - - entry_type: Literal["amendment"] - - ledger_sequence_number: int - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - starting_balance: float - - -LedgerCreateEntryResponse: TypeAlias = Annotated[ - Union[ - IncrementLedgerEntry, - DecrementLedgerEntry, - ExpirationChangeLedgerEntry, - CreditBlockExpiryLedgerEntry, - VoidLedgerEntry, - VoidInitiatedLedgerEntry, - AmendmentLedgerEntry, - ], - PropertyInfo(discriminator="entry_type"), -] diff --git a/src/orb/types/customers/credits/ledger_list_by_external_id_response.py b/src/orb/types/customers/credits/ledger_list_by_external_id_response.py deleted file mode 100644 index e7b515fd..00000000 --- a/src/orb/types/customers/credits/ledger_list_by_external_id_response.py +++ /dev/null @@ -1,401 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, Union, Optional -from datetime import datetime -from typing_extensions import Literal, Annotated, TypeAlias - -from ...._utils import PropertyInfo -from ...._models import BaseModel - -__all__ = [ - "LedgerListByExternalIDResponse", - "IncrementLedgerEntry", - "IncrementLedgerEntryCreditBlock", - "IncrementLedgerEntryCustomer", - "DecrementLedgerEntry", - "DecrementLedgerEntryCreditBlock", - "DecrementLedgerEntryCustomer", - "ExpirationChangeLedgerEntry", - "ExpirationChangeLedgerEntryCreditBlock", - "ExpirationChangeLedgerEntryCustomer", - "CreditBlockExpiryLedgerEntry", - "CreditBlockExpiryLedgerEntryCreditBlock", - "CreditBlockExpiryLedgerEntryCustomer", - "VoidLedgerEntry", - "VoidLedgerEntryCreditBlock", - "VoidLedgerEntryCustomer", - "VoidInitiatedLedgerEntry", - "VoidInitiatedLedgerEntryCreditBlock", - "VoidInitiatedLedgerEntryCustomer", - "AmendmentLedgerEntry", - "AmendmentLedgerEntryCreditBlock", - "AmendmentLedgerEntryCustomer", -] - - -class IncrementLedgerEntryCreditBlock(BaseModel): - id: str - - expiry_date: Optional[datetime] = None - - per_unit_cost_basis: Optional[str] = None - - -class IncrementLedgerEntryCustomer(BaseModel): - id: str - - external_customer_id: Optional[str] = None - - -class IncrementLedgerEntry(BaseModel): - id: str - - amount: float - - created_at: datetime - - credit_block: IncrementLedgerEntryCreditBlock - - currency: str - - customer: IncrementLedgerEntryCustomer - - description: Optional[str] = None - - ending_balance: float - - entry_status: Literal["committed", "pending"] - - entry_type: Literal["increment"] - - ledger_sequence_number: int - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - starting_balance: float - - -class DecrementLedgerEntryCreditBlock(BaseModel): - id: str - - expiry_date: Optional[datetime] = None - - per_unit_cost_basis: Optional[str] = None - - -class DecrementLedgerEntryCustomer(BaseModel): - id: str - - external_customer_id: Optional[str] = None - - -class DecrementLedgerEntry(BaseModel): - id: str - - amount: float - - created_at: datetime - - credit_block: DecrementLedgerEntryCreditBlock - - currency: str - - customer: DecrementLedgerEntryCustomer - - description: Optional[str] = None - - ending_balance: float - - entry_status: Literal["committed", "pending"] - - entry_type: Literal["decrement"] - - ledger_sequence_number: int - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - starting_balance: float - - event_id: Optional[str] = None - - invoice_id: Optional[str] = None - - price_id: Optional[str] = None - - -class ExpirationChangeLedgerEntryCreditBlock(BaseModel): - id: str - - expiry_date: Optional[datetime] = None - - per_unit_cost_basis: Optional[str] = None - - -class ExpirationChangeLedgerEntryCustomer(BaseModel): - id: str - - external_customer_id: Optional[str] = None - - -class ExpirationChangeLedgerEntry(BaseModel): - id: str - - amount: float - - created_at: datetime - - credit_block: ExpirationChangeLedgerEntryCreditBlock - - currency: str - - customer: ExpirationChangeLedgerEntryCustomer - - description: Optional[str] = None - - ending_balance: float - - entry_status: Literal["committed", "pending"] - - entry_type: Literal["expiration_change"] - - ledger_sequence_number: int - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - new_block_expiry_date: Optional[datetime] = None - - starting_balance: float - - -class CreditBlockExpiryLedgerEntryCreditBlock(BaseModel): - id: str - - expiry_date: Optional[datetime] = None - - per_unit_cost_basis: Optional[str] = None - - -class CreditBlockExpiryLedgerEntryCustomer(BaseModel): - id: str - - external_customer_id: Optional[str] = None - - -class CreditBlockExpiryLedgerEntry(BaseModel): - id: str - - amount: float - - created_at: datetime - - credit_block: CreditBlockExpiryLedgerEntryCreditBlock - - currency: str - - customer: CreditBlockExpiryLedgerEntryCustomer - - description: Optional[str] = None - - ending_balance: float - - entry_status: Literal["committed", "pending"] - - entry_type: Literal["credit_block_expiry"] - - ledger_sequence_number: int - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - starting_balance: float - - -class VoidLedgerEntryCreditBlock(BaseModel): - id: str - - expiry_date: Optional[datetime] = None - - per_unit_cost_basis: Optional[str] = None - - -class VoidLedgerEntryCustomer(BaseModel): - id: str - - external_customer_id: Optional[str] = None - - -class VoidLedgerEntry(BaseModel): - id: str - - amount: float - - created_at: datetime - - credit_block: VoidLedgerEntryCreditBlock - - currency: str - - customer: VoidLedgerEntryCustomer - - description: Optional[str] = None - - ending_balance: float - - entry_status: Literal["committed", "pending"] - - entry_type: Literal["void"] - - ledger_sequence_number: int - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - starting_balance: float - - void_amount: float - - void_reason: Optional[str] = None - - -class VoidInitiatedLedgerEntryCreditBlock(BaseModel): - id: str - - expiry_date: Optional[datetime] = None - - per_unit_cost_basis: Optional[str] = None - - -class VoidInitiatedLedgerEntryCustomer(BaseModel): - id: str - - external_customer_id: Optional[str] = None - - -class VoidInitiatedLedgerEntry(BaseModel): - id: str - - amount: float - - created_at: datetime - - credit_block: VoidInitiatedLedgerEntryCreditBlock - - currency: str - - customer: VoidInitiatedLedgerEntryCustomer - - description: Optional[str] = None - - ending_balance: float - - entry_status: Literal["committed", "pending"] - - entry_type: Literal["void_initiated"] - - ledger_sequence_number: int - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - new_block_expiry_date: datetime - - starting_balance: float - - void_amount: float - - void_reason: Optional[str] = None - - -class AmendmentLedgerEntryCreditBlock(BaseModel): - id: str - - expiry_date: Optional[datetime] = None - - per_unit_cost_basis: Optional[str] = None - - -class AmendmentLedgerEntryCustomer(BaseModel): - id: str - - external_customer_id: Optional[str] = None - - -class AmendmentLedgerEntry(BaseModel): - id: str - - amount: float - - created_at: datetime - - credit_block: AmendmentLedgerEntryCreditBlock - - currency: str - - customer: AmendmentLedgerEntryCustomer - - description: Optional[str] = None - - ending_balance: float - - entry_status: Literal["committed", "pending"] - - entry_type: Literal["amendment"] - - ledger_sequence_number: int - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - starting_balance: float - - -LedgerListByExternalIDResponse: TypeAlias = Annotated[ - Union[ - IncrementLedgerEntry, - DecrementLedgerEntry, - ExpirationChangeLedgerEntry, - CreditBlockExpiryLedgerEntry, - VoidLedgerEntry, - VoidInitiatedLedgerEntry, - AmendmentLedgerEntry, - ], - PropertyInfo(discriminator="entry_type"), -] diff --git a/src/orb/types/customers/credits/top_up_create_response.py b/src/orb/types/customers/credits/top_up_create_response.py deleted file mode 100644 index d9497888..00000000 --- a/src/orb/types/customers/credits/top_up_create_response.py +++ /dev/null @@ -1,67 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from typing_extensions import Literal - -from ...._models import BaseModel - -__all__ = ["TopUpCreateResponse", "InvoiceSettings"] - - -class InvoiceSettings(BaseModel): - auto_collection: bool - """ - Whether the credits purchase invoice should auto collect with the customer's - saved payment method. - """ - - net_terms: int - """ - The net terms determines the difference between the invoice date and the issue - date for the invoice. If you intend the invoice to be due on issue, set this - to 0. - """ - - memo: Optional[str] = None - """An optional memo to display on the invoice.""" - - require_successful_payment: Optional[bool] = None - """ - If true, new credit blocks created by this top-up will require that the - corresponding invoice is paid before they can be drawn down from. - """ - - -class TopUpCreateResponse(BaseModel): - id: str - - amount: str - """The amount to increment when the threshold is reached.""" - - currency: str - """The currency or custom pricing unit to use for this top-up. - - If this is a real-world currency, it must match the customer's invoicing - currency. - """ - - invoice_settings: InvoiceSettings - """Settings for invoices generated by triggered top-ups.""" - - per_unit_cost_basis: str - """How much, in the customer's currency, to charge for each unit.""" - - threshold: str - """The threshold at which to trigger the top-up. - - If the balance is at or below this threshold, the top-up will be triggered. - """ - - expires_after: Optional[int] = None - """The number of days or months after which the top-up expires. - - If unspecified, it does not expire. - """ - - expires_after_unit: Optional[Literal["day", "month"]] = None - """The unit of expires_after.""" diff --git a/src/orb/types/customers/credits/top_up_list_by_external_id_response.py b/src/orb/types/customers/credits/top_up_list_by_external_id_response.py deleted file mode 100644 index fc3088ad..00000000 --- a/src/orb/types/customers/credits/top_up_list_by_external_id_response.py +++ /dev/null @@ -1,67 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from typing_extensions import Literal - -from ...._models import BaseModel - -__all__ = ["TopUpListByExternalIDResponse", "InvoiceSettings"] - - -class InvoiceSettings(BaseModel): - auto_collection: bool - """ - Whether the credits purchase invoice should auto collect with the customer's - saved payment method. - """ - - net_terms: int - """ - The net terms determines the difference between the invoice date and the issue - date for the invoice. If you intend the invoice to be due on issue, set this - to 0. - """ - - memo: Optional[str] = None - """An optional memo to display on the invoice.""" - - require_successful_payment: Optional[bool] = None - """ - If true, new credit blocks created by this top-up will require that the - corresponding invoice is paid before they can be drawn down from. - """ - - -class TopUpListByExternalIDResponse(BaseModel): - id: str - - amount: str - """The amount to increment when the threshold is reached.""" - - currency: str - """The currency or custom pricing unit to use for this top-up. - - If this is a real-world currency, it must match the customer's invoicing - currency. - """ - - invoice_settings: InvoiceSettings - """Settings for invoices generated by triggered top-ups.""" - - per_unit_cost_basis: str - """How much, in the customer's currency, to charge for each unit.""" - - threshold: str - """The threshold at which to trigger the top-up. - - If the balance is at or below this threshold, the top-up will be triggered. - """ - - expires_after: Optional[int] = None - """The number of days or months after which the top-up expires. - - If unspecified, it does not expire. - """ - - expires_after_unit: Optional[Literal["day", "month"]] = None - """The unit of expires_after.""" diff --git a/src/orb/types/dimensional_price_groups/dimensional_price_groups.py b/src/orb/types/dimensional_price_groups/dimensional_price_groups.py index 78893603..21272dad 100644 --- a/src/orb/types/dimensional_price_groups/dimensional_price_groups.py +++ b/src/orb/types/dimensional_price_groups/dimensional_price_groups.py @@ -3,13 +3,13 @@ from typing import List from ..._models import BaseModel -from ..dimensional_price_group import DimensionalPriceGroup from ..shared.pagination_metadata import PaginationMetadata +from ..shared.dimensional_price_group_model import DimensionalPriceGroupModel __all__ = ["DimensionalPriceGroups"] class DimensionalPriceGroups(BaseModel): - data: List[DimensionalPriceGroup] + data: List[DimensionalPriceGroupModel] pagination_metadata: PaginationMetadata diff --git a/src/orb/types/events/__init__.py b/src/orb/types/events/__init__.py index 554bf2a0..e28a527f 100644 --- a/src/orb/types/events/__init__.py +++ b/src/orb/types/events/__init__.py @@ -6,8 +6,3 @@ from .volume_list_params import VolumeListParams as VolumeListParams from .backfill_list_params import BackfillListParams as BackfillListParams from .backfill_create_params import BackfillCreateParams as BackfillCreateParams -from .backfill_list_response import BackfillListResponse as BackfillListResponse -from .backfill_close_response import BackfillCloseResponse as BackfillCloseResponse -from .backfill_fetch_response import BackfillFetchResponse as BackfillFetchResponse -from .backfill_create_response import BackfillCreateResponse as BackfillCreateResponse -from .backfill_revert_response import BackfillRevertResponse as BackfillRevertResponse diff --git a/src/orb/types/events/backfill_close_response.py b/src/orb/types/events/backfill_close_response.py deleted file mode 100644 index 058edebe..00000000 --- a/src/orb/types/events/backfill_close_response.py +++ /dev/null @@ -1,54 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from datetime import datetime -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["BackfillCloseResponse"] - - -class BackfillCloseResponse(BaseModel): - id: str - - close_time: Optional[datetime] = None - """If in the future, the time at which the backfill will automatically close. - - If in the past, the time at which the backfill was closed. - """ - - created_at: datetime - - customer_id: Optional[str] = None - """The Orb-generated ID of the customer to which this backfill is scoped. - - If `null`, this backfill is scoped to all customers. - """ - - events_ingested: int - """The number of events ingested in this backfill.""" - - replace_existing_events: bool - """ - If `true`, existing events in the backfill's timeframe will be replaced with the - newly ingested events associated with the backfill. If `false`, newly ingested - events will be added to the existing events. - """ - - reverted_at: Optional[datetime] = None - """The time at which this backfill was reverted.""" - - status: Literal["pending", "reflected", "pending_revert", "reverted"] - """The status of the backfill.""" - - timeframe_end: datetime - - timeframe_start: datetime - - deprecation_filter: Optional[str] = None - """ - A boolean - [computed property](/extensibility/advanced-metrics#computed-properties) used to - filter the set of events to deprecate - """ diff --git a/src/orb/types/events/backfill_create_response.py b/src/orb/types/events/backfill_create_response.py deleted file mode 100644 index 90e185d5..00000000 --- a/src/orb/types/events/backfill_create_response.py +++ /dev/null @@ -1,54 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from datetime import datetime -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["BackfillCreateResponse"] - - -class BackfillCreateResponse(BaseModel): - id: str - - close_time: Optional[datetime] = None - """If in the future, the time at which the backfill will automatically close. - - If in the past, the time at which the backfill was closed. - """ - - created_at: datetime - - customer_id: Optional[str] = None - """The Orb-generated ID of the customer to which this backfill is scoped. - - If `null`, this backfill is scoped to all customers. - """ - - events_ingested: int - """The number of events ingested in this backfill.""" - - replace_existing_events: bool - """ - If `true`, existing events in the backfill's timeframe will be replaced with the - newly ingested events associated with the backfill. If `false`, newly ingested - events will be added to the existing events. - """ - - reverted_at: Optional[datetime] = None - """The time at which this backfill was reverted.""" - - status: Literal["pending", "reflected", "pending_revert", "reverted"] - """The status of the backfill.""" - - timeframe_end: datetime - - timeframe_start: datetime - - deprecation_filter: Optional[str] = None - """ - A boolean - [computed property](/extensibility/advanced-metrics#computed-properties) used to - filter the set of events to deprecate - """ diff --git a/src/orb/types/events/backfill_fetch_response.py b/src/orb/types/events/backfill_fetch_response.py deleted file mode 100644 index 2c253373..00000000 --- a/src/orb/types/events/backfill_fetch_response.py +++ /dev/null @@ -1,54 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from datetime import datetime -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["BackfillFetchResponse"] - - -class BackfillFetchResponse(BaseModel): - id: str - - close_time: Optional[datetime] = None - """If in the future, the time at which the backfill will automatically close. - - If in the past, the time at which the backfill was closed. - """ - - created_at: datetime - - customer_id: Optional[str] = None - """The Orb-generated ID of the customer to which this backfill is scoped. - - If `null`, this backfill is scoped to all customers. - """ - - events_ingested: int - """The number of events ingested in this backfill.""" - - replace_existing_events: bool - """ - If `true`, existing events in the backfill's timeframe will be replaced with the - newly ingested events associated with the backfill. If `false`, newly ingested - events will be added to the existing events. - """ - - reverted_at: Optional[datetime] = None - """The time at which this backfill was reverted.""" - - status: Literal["pending", "reflected", "pending_revert", "reverted"] - """The status of the backfill.""" - - timeframe_end: datetime - - timeframe_start: datetime - - deprecation_filter: Optional[str] = None - """ - A boolean - [computed property](/extensibility/advanced-metrics#computed-properties) used to - filter the set of events to deprecate - """ diff --git a/src/orb/types/events/backfill_revert_response.py b/src/orb/types/events/backfill_revert_response.py deleted file mode 100644 index 52ec1314..00000000 --- a/src/orb/types/events/backfill_revert_response.py +++ /dev/null @@ -1,54 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from datetime import datetime -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["BackfillRevertResponse"] - - -class BackfillRevertResponse(BaseModel): - id: str - - close_time: Optional[datetime] = None - """If in the future, the time at which the backfill will automatically close. - - If in the past, the time at which the backfill was closed. - """ - - created_at: datetime - - customer_id: Optional[str] = None - """The Orb-generated ID of the customer to which this backfill is scoped. - - If `null`, this backfill is scoped to all customers. - """ - - events_ingested: int - """The number of events ingested in this backfill.""" - - replace_existing_events: bool - """ - If `true`, existing events in the backfill's timeframe will be replaced with the - newly ingested events associated with the backfill. If `false`, newly ingested - events will be added to the existing events. - """ - - reverted_at: Optional[datetime] = None - """The time at which this backfill was reverted.""" - - status: Literal["pending", "reflected", "pending_revert", "reverted"] - """The status of the backfill.""" - - timeframe_end: datetime - - timeframe_start: datetime - - deprecation_filter: Optional[str] = None - """ - A boolean - [computed property](/extensibility/advanced-metrics#computed-properties) used to - filter the set of events to deprecate - """ diff --git a/src/orb/types/invoice_create_params.py b/src/orb/types/invoice_create_params.py index 78e22ea8..417e04c5 100644 --- a/src/orb/types/invoice_create_params.py +++ b/src/orb/types/invoice_create_params.py @@ -8,8 +8,9 @@ from .._utils import PropertyInfo from .shared_params.discount import Discount +from .shared_params.unit_config_model import UnitConfigModel -__all__ = ["InvoiceCreateParams", "LineItem", "LineItemUnitConfig"] +__all__ = ["InvoiceCreateParams", "LineItem"] class InvoiceCreateParams(TypedDict, total=False): @@ -69,11 +70,6 @@ class InvoiceCreateParams(TypedDict, total=False): """ -class LineItemUnitConfig(TypedDict, total=False): - unit_amount: Required[str] - """Rate per unit of usage""" - - class LineItem(TypedDict, total=False): end_date: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]] """A date string to specify the line item's end date in the customer's timezone.""" @@ -91,4 +87,4 @@ class LineItem(TypedDict, total=False): start_date: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]] """A date string to specify the line item's start date in the customer's timezone.""" - unit_config: Required[LineItemUnitConfig] + unit_config: Required[UnitConfigModel] diff --git a/src/orb/types/invoice_fetch_upcoming_response.py b/src/orb/types/invoice_fetch_upcoming_response.py index ca7af8dc..ac680775 100644 --- a/src/orb/types/invoice_fetch_upcoming_response.py +++ b/src/orb/types/invoice_fetch_upcoming_response.py @@ -1,753 +1,24 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, List, Union, Optional +from typing import Dict, List, Optional from datetime import datetime -from typing_extensions import Literal, Annotated, TypeAlias +from typing_extensions import Literal -from .price import Price -from .._utils import PropertyInfo from .._models import BaseModel -from .shared.discount import Discount +from .shared.address_model import AddressModel +from .shared.maximum_model import MaximumModel +from .shared.minimum_model import MinimumModel +from .shared.auto_collection_model import AutoCollectionModel +from .shared.customer_tax_id_model import CustomerTaxIDModel +from .shared.payment_attempt_model import PaymentAttemptModel from .shared.invoice_level_discount import InvoiceLevelDiscount +from .shared.customer_minified_model import CustomerMinifiedModel +from .shared.invoice_line_item_model import InvoiceLineItemModel +from .shared.credit_note_summary_model import CreditNoteSummaryModel +from .shared.subscription_minified_model import SubscriptionMinifiedModel +from .shared.customer_balance_transaction_model import CustomerBalanceTransactionModel -__all__ = [ - "InvoiceFetchUpcomingResponse", - "AutoCollection", - "BillingAddress", - "CreditNote", - "Customer", - "CustomerBalanceTransaction", - "CustomerBalanceTransactionCreditNote", - "CustomerBalanceTransactionInvoice", - "CustomerTaxID", - "LineItem", - "LineItemAdjustment", - "LineItemAdjustmentMonetaryUsageDiscountAdjustment", - "LineItemAdjustmentMonetaryAmountDiscountAdjustment", - "LineItemAdjustmentMonetaryPercentageDiscountAdjustment", - "LineItemAdjustmentMonetaryMinimumAdjustment", - "LineItemAdjustmentMonetaryMaximumAdjustment", - "LineItemMaximum", - "LineItemMinimum", - "LineItemSubLineItem", - "LineItemSubLineItemMatrixSubLineItem", - "LineItemSubLineItemMatrixSubLineItemGrouping", - "LineItemSubLineItemMatrixSubLineItemMatrixConfig", - "LineItemSubLineItemTierSubLineItem", - "LineItemSubLineItemTierSubLineItemGrouping", - "LineItemSubLineItemTierSubLineItemTierConfig", - "LineItemSubLineItemOtherSubLineItem", - "LineItemSubLineItemOtherSubLineItemGrouping", - "LineItemTaxAmount", - "Maximum", - "Minimum", - "PaymentAttempt", - "ShippingAddress", - "Subscription", -] - - -class AutoCollection(BaseModel): - enabled: Optional[bool] = None - """True only if auto-collection is enabled for this invoice.""" - - next_attempt_at: Optional[datetime] = None - """ - If the invoice is scheduled for auto-collection, this field will reflect when - the next attempt will occur. If dunning has been exhausted, or auto-collection - is not enabled for this invoice, this field will be `null`. - """ - - num_attempts: Optional[int] = None - """Number of auto-collection payment attempts.""" - - previously_attempted_at: Optional[datetime] = None - """ - If Orb has ever attempted payment auto-collection for this invoice, this field - will reflect when that attempt occurred. In conjunction with `next_attempt_at`, - this can be used to tell whether the invoice is currently in dunning (that is, - `previously_attempted_at` is non-null, and `next_attempt_time` is non-null), or - if dunning has been exhausted (`previously_attempted_at` is non-null, but - `next_attempt_time` is null). - """ - - -class BillingAddress(BaseModel): - city: Optional[str] = None - - country: Optional[str] = None - - line1: Optional[str] = None - - line2: Optional[str] = None - - postal_code: Optional[str] = None - - state: Optional[str] = None - - -class CreditNote(BaseModel): - id: str - - credit_note_number: str - - memo: Optional[str] = None - """An optional memo supplied on the credit note.""" - - reason: str - - total: str - - type: str - - voided_at: Optional[datetime] = None - """ - If the credit note has a status of `void`, this gives a timestamp when the - credit note was voided. - """ - - -class Customer(BaseModel): - id: str - - external_customer_id: Optional[str] = None - - -class CustomerBalanceTransactionCreditNote(BaseModel): - id: str - """The id of the Credit note""" - - -class CustomerBalanceTransactionInvoice(BaseModel): - id: str - """The Invoice id""" - - -class CustomerBalanceTransaction(BaseModel): - id: str - """A unique id for this transaction.""" - - action: Literal[ - "applied_to_invoice", - "manual_adjustment", - "prorated_refund", - "revert_prorated_refund", - "return_from_voiding", - "credit_note_applied", - "credit_note_voided", - "overpayment_refund", - "external_payment", - ] - - amount: str - """The value of the amount changed in the transaction.""" - - created_at: datetime - """The creation time of this transaction.""" - - credit_note: Optional[CustomerBalanceTransactionCreditNote] = None - - description: Optional[str] = None - """An optional description provided for manual customer balance adjustments.""" - - ending_balance: str - """ - The new value of the customer's balance prior to the transaction, in the - customer's currency. - """ - - invoice: Optional[CustomerBalanceTransactionInvoice] = None - - starting_balance: str - """ - The original value of the customer's balance prior to the transaction, in the - customer's currency. - """ - - type: Literal["increment", "decrement"] - - -class CustomerTaxID(BaseModel): - country: Literal[ - "AD", - "AE", - "AR", - "AT", - "AU", - "BE", - "BG", - "BH", - "BO", - "BR", - "CA", - "CH", - "CL", - "CN", - "CO", - "CR", - "CY", - "CZ", - "DE", - "DK", - "EE", - "DO", - "EC", - "EG", - "ES", - "EU", - "FI", - "FR", - "GB", - "GE", - "GR", - "HK", - "HR", - "HU", - "ID", - "IE", - "IL", - "IN", - "IS", - "IT", - "JP", - "KE", - "KR", - "KZ", - "LI", - "LT", - "LU", - "LV", - "MT", - "MX", - "MY", - "NG", - "NL", - "NO", - "NZ", - "OM", - "PE", - "PH", - "PL", - "PT", - "RO", - "RS", - "RU", - "SA", - "SE", - "SG", - "SI", - "SK", - "SV", - "TH", - "TR", - "TW", - "UA", - "US", - "UY", - "VE", - "VN", - "ZA", - ] - - type: Literal[ - "ad_nrt", - "ae_trn", - "ar_cuit", - "eu_vat", - "au_abn", - "au_arn", - "bg_uic", - "bh_vat", - "bo_tin", - "br_cnpj", - "br_cpf", - "ca_bn", - "ca_gst_hst", - "ca_pst_bc", - "ca_pst_mb", - "ca_pst_sk", - "ca_qst", - "ch_vat", - "cl_tin", - "cn_tin", - "co_nit", - "cr_tin", - "do_rcn", - "ec_ruc", - "eg_tin", - "es_cif", - "eu_oss_vat", - "gb_vat", - "ge_vat", - "hk_br", - "hu_tin", - "id_npwp", - "il_vat", - "in_gst", - "is_vat", - "jp_cn", - "jp_rn", - "jp_trn", - "ke_pin", - "kr_brn", - "kz_bin", - "li_uid", - "mx_rfc", - "my_frp", - "my_itn", - "my_sst", - "ng_tin", - "no_vat", - "no_voec", - "nz_gst", - "om_vat", - "pe_ruc", - "ph_tin", - "ro_tin", - "rs_pib", - "ru_inn", - "ru_kpp", - "sa_vat", - "sg_gst", - "sg_uen", - "si_tin", - "sv_nit", - "th_vat", - "tr_tin", - "tw_vat", - "ua_vat", - "us_ein", - "uy_ruc", - "ve_rif", - "vn_tin", - "za_vat", - ] - - value: str - - -class LineItemAdjustmentMonetaryUsageDiscountAdjustment(BaseModel): - id: str - - adjustment_type: Literal["usage_discount"] - - amount: str - """The value applied by an adjustment.""" - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - reason: Optional[str] = None - """The reason for the adjustment.""" - - usage_discount: float - """ - The number of usage units by which to discount the price this adjustment applies - to in a given billing period. - """ - - -class LineItemAdjustmentMonetaryAmountDiscountAdjustment(BaseModel): - id: str - - adjustment_type: Literal["amount_discount"] - - amount: str - """The value applied by an adjustment.""" - - amount_discount: str - """ - The amount by which to discount the prices this adjustment applies to in a given - billing period. - """ - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -class LineItemAdjustmentMonetaryPercentageDiscountAdjustment(BaseModel): - id: str - - adjustment_type: Literal["percentage_discount"] - - amount: str - """The value applied by an adjustment.""" - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - percentage_discount: float - """ - The percentage (as a value between 0 and 1) by which to discount the price - intervals this adjustment applies to in a given billing period. - """ - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -class LineItemAdjustmentMonetaryMinimumAdjustment(BaseModel): - id: str - - adjustment_type: Literal["minimum"] - - amount: str - """The value applied by an adjustment.""" - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - item_id: str - """The item ID that revenue from this minimum will be attributed to.""" - - minimum_amount: str - """ - The minimum amount to charge in a given billing period for the prices this - adjustment applies to. - """ - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -class LineItemAdjustmentMonetaryMaximumAdjustment(BaseModel): - id: str - - adjustment_type: Literal["maximum"] - - amount: str - """The value applied by an adjustment.""" - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - maximum_amount: str - """ - The maximum amount to charge in a given billing period for the prices this - adjustment applies to. - """ - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -LineItemAdjustment: TypeAlias = Annotated[ - Union[ - LineItemAdjustmentMonetaryUsageDiscountAdjustment, - LineItemAdjustmentMonetaryAmountDiscountAdjustment, - LineItemAdjustmentMonetaryPercentageDiscountAdjustment, - LineItemAdjustmentMonetaryMinimumAdjustment, - LineItemAdjustmentMonetaryMaximumAdjustment, - ], - PropertyInfo(discriminator="adjustment_type"), -] - - -class LineItemMaximum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this maximum amount applies to. - - For plan/plan phase maximums, this can be a subset of prices. - """ - - maximum_amount: str - """Maximum amount applied""" - - -class LineItemMinimum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this minimum amount applies to. - - For plan/plan phase minimums, this can be a subset of prices. - """ - - minimum_amount: str - """Minimum amount applied""" - - -class LineItemSubLineItemMatrixSubLineItemGrouping(BaseModel): - key: str - - value: Optional[str] = None - """No value indicates the default group""" - - -class LineItemSubLineItemMatrixSubLineItemMatrixConfig(BaseModel): - dimension_values: List[Optional[str]] - """The ordered dimension values for this line item.""" - - -class LineItemSubLineItemMatrixSubLineItem(BaseModel): - amount: str - """The total amount for this sub line item.""" - - grouping: Optional[LineItemSubLineItemMatrixSubLineItemGrouping] = None - - matrix_config: LineItemSubLineItemMatrixSubLineItemMatrixConfig - - name: str - - quantity: float - - type: Literal["matrix"] - - -class LineItemSubLineItemTierSubLineItemGrouping(BaseModel): - key: str - - value: Optional[str] = None - """No value indicates the default group""" - - -class LineItemSubLineItemTierSubLineItemTierConfig(BaseModel): - first_unit: float - - last_unit: Optional[float] = None - - unit_amount: str - - -class LineItemSubLineItemTierSubLineItem(BaseModel): - amount: str - """The total amount for this sub line item.""" - - grouping: Optional[LineItemSubLineItemTierSubLineItemGrouping] = None - - name: str - - quantity: float - - tier_config: LineItemSubLineItemTierSubLineItemTierConfig - - type: Literal["tier"] - - -class LineItemSubLineItemOtherSubLineItemGrouping(BaseModel): - key: str - - value: Optional[str] = None - """No value indicates the default group""" - - -class LineItemSubLineItemOtherSubLineItem(BaseModel): - amount: str - """The total amount for this sub line item.""" - - grouping: Optional[LineItemSubLineItemOtherSubLineItemGrouping] = None - - name: str - - quantity: float - - type: Literal["'null'"] - - -LineItemSubLineItem: TypeAlias = Annotated[ - Union[ - LineItemSubLineItemMatrixSubLineItem, LineItemSubLineItemTierSubLineItem, LineItemSubLineItemOtherSubLineItem - ], - PropertyInfo(discriminator="type"), -] - - -class LineItemTaxAmount(BaseModel): - amount: str - """The amount of additional tax incurred by this tax rate.""" - - tax_rate_description: str - """The human-readable description of the applied tax rate.""" - - tax_rate_percentage: Optional[str] = None - """The tax rate percentage, out of 100.""" - - -class LineItem(BaseModel): - id: str - """A unique ID for this line item.""" - - adjusted_subtotal: str - """ - The line amount after any adjustments and before overage conversion, credits and - partial invoicing. - """ - - adjustments: List[LineItemAdjustment] - """All adjustments (ie. maximums, minimums, discounts) applied to the line item.""" - - amount: str - """ - The final amount for a line item after all adjustments and pre paid credits have - been applied. - """ - - credits_applied: str - """The number of prepaid credits applied.""" - - discount: Optional[Discount] = None - - end_date: datetime - """The end date of the range of time applied for this line item's price.""" - - filter: Optional[str] = None - """An additional filter that was used to calculate the usage for this line item.""" - - grouping: Optional[str] = None - """ - [DEPRECATED] For configured prices that are split by a grouping key, this will - be populated with the key and a value. The `amount` and `subtotal` will be the - values for this particular grouping. - """ - - maximum: Optional[LineItemMaximum] = None - """This field is deprecated in favor of `adjustments`.""" - - maximum_amount: Optional[str] = None - """This field is deprecated in favor of `adjustments`.""" - - minimum: Optional[LineItemMinimum] = None - """This field is deprecated in favor of `adjustments`.""" - - minimum_amount: Optional[str] = None - """This field is deprecated in favor of `adjustments`.""" - - name: str - """The name of the price associated with this line item.""" - - partially_invoiced_amount: str - """Any amount applied from a partial invoice""" - - price: Optional[Price] = None - """ - The Price resource represents a price that can be billed on a subscription, - resulting in a charge on an invoice in the form of an invoice line item. Prices - take a quantity and determine an amount to bill. - - Orb supports a few different pricing models out of the box. Each of these models - is serialized differently in a given Price object. The model_type field - determines the key for the configuration object that is present. - - For more on the types of prices, see - [the core concepts documentation](/core-concepts#plan-and-price) - """ - - quantity: float - """Either the fixed fee quantity or the usage during the service period.""" - - start_date: datetime - """The start date of the range of time applied for this line item's price.""" - - sub_line_items: List[LineItemSubLineItem] - """ - For complex pricing structures, the line item can be broken down further in - `sub_line_items`. - """ - - subtotal: str - """The line amount before before any adjustments.""" - - tax_amounts: List[LineItemTaxAmount] - """An array of tax rates and their incurred tax amounts. - - Empty if no tax integration is configured. - """ - - usage_customer_ids: Optional[List[str]] = None - """ - A list of customer ids that were used to calculate the usage for this line item. - """ - - -class Maximum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this maximum amount applies to. - - For plan/plan phase maximums, this can be a subset of prices. - """ - - maximum_amount: str - """Maximum amount applied""" - - -class Minimum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this minimum amount applies to. - - For plan/plan phase minimums, this can be a subset of prices. - """ - - minimum_amount: str - """Minimum amount applied""" - - -class PaymentAttempt(BaseModel): - id: str - """The ID of the payment attempt.""" - - amount: str - """The amount of the payment attempt.""" - - created_at: datetime - """The time at which the payment attempt was created.""" - - payment_provider: Optional[Literal["stripe"]] = None - """The payment provider that attempted to collect the payment.""" - - payment_provider_id: Optional[str] = None - """The ID of the payment attempt in the payment provider.""" - - succeeded: bool - """Whether the payment attempt succeeded.""" - - -class ShippingAddress(BaseModel): - city: Optional[str] = None - - country: Optional[str] = None - - line1: Optional[str] = None - - line2: Optional[str] = None - - postal_code: Optional[str] = None - - state: Optional[str] = None - - -class Subscription(BaseModel): - id: str +__all__ = ["InvoiceFetchUpcomingResponse"] class InvoiceFetchUpcomingResponse(BaseModel): @@ -759,24 +30,24 @@ class InvoiceFetchUpcomingResponse(BaseModel): application of the customer balance to the `total` of the invoice. """ - auto_collection: AutoCollection + auto_collection: AutoCollectionModel - billing_address: Optional[BillingAddress] = None + billing_address: Optional[AddressModel] = None created_at: datetime """The creation time of the resource in Orb.""" - credit_notes: List[CreditNote] + credit_notes: List[CreditNoteSummaryModel] """A list of credit notes associated with the invoice""" currency: str """An ISO 4217 currency string or `credits`""" - customer: Customer + customer: CustomerMinifiedModel - customer_balance_transactions: List[CustomerBalanceTransaction] + customer_balance_transactions: List[CustomerBalanceTransactionModel] - customer_tax_id: Optional[CustomerTaxID] = None + customer_tax_id: Optional[CustomerTaxIDModel] = None """ Tax IDs are commonly required to be displayed on customer invoices, which are added to the headers of invoices. @@ -938,10 +209,10 @@ class InvoiceFetchUpcomingResponse(BaseModel): `issued` (even if it is now in a different state.) """ - line_items: List[LineItem] + line_items: List[InvoiceLineItemModel] """The breakdown of prices in this invoice.""" - maximum: Optional[Maximum] = None + maximum: Optional[MaximumModel] = None maximum_amount: Optional[str] = None @@ -958,7 +229,7 @@ class InvoiceFetchUpcomingResponse(BaseModel): cleared by setting `metadata` to `null`. """ - minimum: Optional[Minimum] = None + minimum: Optional[MinimumModel] = None minimum_amount: Optional[str] = None @@ -968,7 +239,7 @@ class InvoiceFetchUpcomingResponse(BaseModel): was paid. """ - payment_attempts: List[PaymentAttempt] + payment_attempts: List[PaymentAttemptModel] """A list of payment attempts associated with the invoice""" payment_failed_at: Optional[datetime] = None @@ -990,11 +261,11 @@ class InvoiceFetchUpcomingResponse(BaseModel): scheduled to be issued. """ - shipping_address: Optional[ShippingAddress] = None + shipping_address: Optional[AddressModel] = None status: Literal["issued", "paid", "synced", "void", "draft"] - subscription: Optional[Subscription] = None + subscription: Optional[SubscriptionMinifiedModel] = None subtotal: str """The total before any discounts and minimums are applied.""" diff --git a/src/orb/types/item.py b/src/orb/types/item.py deleted file mode 100644 index ad22a1dd..00000000 --- a/src/orb/types/item.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from datetime import datetime -from typing_extensions import Literal - -from .._models import BaseModel - -__all__ = ["Item", "ExternalConnection"] - - -class ExternalConnection(BaseModel): - external_connection_name: Literal["stripe", "quickbooks", "bill.com", "netsuite", "taxjar", "avalara", "anrok"] - - external_entity_id: str - - -class Item(BaseModel): - id: str - - created_at: datetime - - external_connections: List[ExternalConnection] - - name: str diff --git a/src/orb/types/item_update_params.py b/src/orb/types/item_update_params.py index a94f7c59..83156dcf 100644 --- a/src/orb/types/item_update_params.py +++ b/src/orb/types/item_update_params.py @@ -3,20 +3,14 @@ from __future__ import annotations from typing import Iterable, Optional -from typing_extensions import Literal, Required, TypedDict +from typing_extensions import TypedDict -__all__ = ["ItemUpdateParams", "ExternalConnection"] +from .shared_params.item_external_connection_model import ItemExternalConnectionModel + +__all__ = ["ItemUpdateParams"] class ItemUpdateParams(TypedDict, total=False): - external_connections: Optional[Iterable[ExternalConnection]] + external_connections: Optional[Iterable[ItemExternalConnectionModel]] name: Optional[str] - - -class ExternalConnection(TypedDict, total=False): - external_connection_name: Required[ - Literal["stripe", "quickbooks", "bill.com", "netsuite", "taxjar", "avalara", "anrok"] - ] - - external_entity_id: Required[str] diff --git a/src/orb/types/plan.py b/src/orb/types/plan.py deleted file mode 100644 index a4b43d96..00000000 --- a/src/orb/types/plan.py +++ /dev/null @@ -1,370 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List, Union, Optional -from datetime import datetime -from typing_extensions import Literal, Annotated, TypeAlias - -from .price import Price -from .._utils import PropertyInfo -from .._models import BaseModel -from .shared.discount import Discount - -__all__ = [ - "Plan", - "Adjustment", - "AdjustmentPlanPhaseUsageDiscountAdjustment", - "AdjustmentPlanPhaseAmountDiscountAdjustment", - "AdjustmentPlanPhasePercentageDiscountAdjustment", - "AdjustmentPlanPhaseMinimumAdjustment", - "AdjustmentPlanPhaseMaximumAdjustment", - "BasePlan", - "Maximum", - "Minimum", - "PlanPhase", - "PlanPhaseMaximum", - "PlanPhaseMinimum", - "Product", - "TrialConfig", -] - - -class AdjustmentPlanPhaseUsageDiscountAdjustment(BaseModel): - id: str - - adjustment_type: Literal["usage_discount"] - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - usage_discount: float - """ - The number of usage units by which to discount the price this adjustment applies - to in a given billing period. - """ - - -class AdjustmentPlanPhaseAmountDiscountAdjustment(BaseModel): - id: str - - adjustment_type: Literal["amount_discount"] - - amount_discount: str - """ - The amount by which to discount the prices this adjustment applies to in a given - billing period. - """ - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -class AdjustmentPlanPhasePercentageDiscountAdjustment(BaseModel): - id: str - - adjustment_type: Literal["percentage_discount"] - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - percentage_discount: float - """ - The percentage (as a value between 0 and 1) by which to discount the price - intervals this adjustment applies to in a given billing period. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -class AdjustmentPlanPhaseMinimumAdjustment(BaseModel): - id: str - - adjustment_type: Literal["minimum"] - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - item_id: str - """The item ID that revenue from this minimum will be attributed to.""" - - minimum_amount: str - """ - The minimum amount to charge in a given billing period for the prices this - adjustment applies to. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -class AdjustmentPlanPhaseMaximumAdjustment(BaseModel): - id: str - - adjustment_type: Literal["maximum"] - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - maximum_amount: str - """ - The maximum amount to charge in a given billing period for the prices this - adjustment applies to. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -Adjustment: TypeAlias = Annotated[ - Union[ - AdjustmentPlanPhaseUsageDiscountAdjustment, - AdjustmentPlanPhaseAmountDiscountAdjustment, - AdjustmentPlanPhasePercentageDiscountAdjustment, - AdjustmentPlanPhaseMinimumAdjustment, - AdjustmentPlanPhaseMaximumAdjustment, - ], - PropertyInfo(discriminator="adjustment_type"), -] - - -class BasePlan(BaseModel): - id: Optional[str] = None - - external_plan_id: Optional[str] = None - """ - An optional user-defined ID for this plan resource, used throughout the system - as an alias for this Plan. Use this field to identify a plan by an existing - identifier in your system. - """ - - name: Optional[str] = None - - -class Maximum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this maximum amount applies to. - - For plan/plan phase maximums, this can be a subset of prices. - """ - - maximum_amount: str - """Maximum amount applied""" - - -class Minimum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this minimum amount applies to. - - For plan/plan phase minimums, this can be a subset of prices. - """ - - minimum_amount: str - """Minimum amount applied""" - - -class PlanPhaseMaximum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this maximum amount applies to. - - For plan/plan phase maximums, this can be a subset of prices. - """ - - maximum_amount: str - """Maximum amount applied""" - - -class PlanPhaseMinimum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this minimum amount applies to. - - For plan/plan phase minimums, this can be a subset of prices. - """ - - minimum_amount: str - """Minimum amount applied""" - - -class PlanPhase(BaseModel): - id: str - - description: Optional[str] = None - - discount: Optional[Discount] = None - - duration: Optional[int] = None - """How many terms of length `duration_unit` this phase is active for. - - If null, this phase is evergreen and active indefinitely - """ - - duration_unit: Optional[Literal["daily", "monthly", "quarterly", "semi_annual", "annual"]] = None - - maximum: Optional[PlanPhaseMaximum] = None - - maximum_amount: Optional[str] = None - - minimum: Optional[PlanPhaseMinimum] = None - - minimum_amount: Optional[str] = None - - name: str - - order: int - """Determines the ordering of the phase in a plan's lifecycle. 1 = first phase.""" - - -class Product(BaseModel): - id: str - - created_at: datetime - - name: str - - -class TrialConfig(BaseModel): - trial_period: Optional[int] = None - - trial_period_unit: Literal["days"] - - -class Plan(BaseModel): - id: str - - adjustments: List[Adjustment] - """Adjustments for this plan. - - If the plan has phases, this includes adjustments across all phases of the plan. - """ - - base_plan: Optional[BasePlan] = None - - base_plan_id: Optional[str] = None - """ - The parent plan id if the given plan was created by overriding one or more of - the parent's prices - """ - - created_at: datetime - - currency: str - """ - An ISO 4217 currency string or custom pricing unit (`credits`) for this plan's - prices. - """ - - default_invoice_memo: Optional[str] = None - """ - The default memo text on the invoices corresponding to subscriptions on this - plan. Note that each subscription may configure its own memo. - """ - - description: str - - discount: Optional[Discount] = None - - external_plan_id: Optional[str] = None - """ - An optional user-defined ID for this plan resource, used throughout the system - as an alias for this Plan. Use this field to identify a plan by an existing - identifier in your system. - """ - - invoicing_currency: str - """An ISO 4217 currency string for which this plan is billed in. - - Matches `currency` unless `currency` is a custom pricing unit. - """ - - maximum: Optional[Maximum] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[Minimum] = None - - minimum_amount: Optional[str] = None - - name: str - - net_terms: Optional[int] = None - """Determines the difference between the invoice issue date and the due date. - - A value of "0" here signifies that invoices are due on issue, whereas a value of - "30" means that the customer has a month to pay the invoice before its overdue. - Note that individual subscriptions or invoices may set a different net terms - configuration. - """ - - plan_phases: Optional[List[PlanPhase]] = None - - prices: List[Price] - """Prices for this plan. - - If the plan has phases, this includes prices across all phases of the plan. - """ - - product: Product - - status: Literal["active", "archived", "draft"] - - trial_config: TrialConfig - - version: int diff --git a/src/orb/types/plan_create_params.py b/src/orb/types/plan_create_params.py index 817ea7f3..6c133e4a 100644 --- a/src/orb/types/plan_create_params.py +++ b/src/orb/types/plan_create_params.py @@ -2,100 +2,48 @@ from __future__ import annotations -from typing import Dict, List, Union, Iterable, Optional +from typing import Dict, Union, Iterable, Optional from typing_extensions import Literal, Required, TypeAlias, TypedDict +from .shared_params.bps_config_model import BpsConfigModel +from .shared_params.bulk_config_model import BulkConfigModel +from .shared_params.unit_config_model import UnitConfigModel +from .shared_params.matrix_config_model import MatrixConfigModel +from .shared_params.tiered_config_model import TieredConfigModel +from .shared_params.package_config_model import PackageConfigModel +from .shared_params.bulk_bps_config_model import BulkBpsConfigModel +from .shared_params.tiered_bps_config_model import TieredBpsConfigModel +from .shared_params.custom_rating_function_config_model import CustomRatingFunctionConfigModel +from .shared_params.new_billing_cycle_configuration_model import NewBillingCycleConfigurationModel + __all__ = [ "PlanCreateParams", "Price", "PriceNewPlanUnitPrice", - "PriceNewPlanUnitPriceUnitConfig", - "PriceNewPlanUnitPriceBillingCycleConfiguration", - "PriceNewPlanUnitPriceInvoicingCycleConfiguration", "PriceNewPlanPackagePrice", - "PriceNewPlanPackagePricePackageConfig", - "PriceNewPlanPackagePriceBillingCycleConfiguration", - "PriceNewPlanPackagePriceInvoicingCycleConfiguration", "PriceNewPlanMatrixPrice", - "PriceNewPlanMatrixPriceMatrixConfig", - "PriceNewPlanMatrixPriceMatrixConfigMatrixValue", - "PriceNewPlanMatrixPriceBillingCycleConfiguration", - "PriceNewPlanMatrixPriceInvoicingCycleConfiguration", "PriceNewPlanTieredPrice", - "PriceNewPlanTieredPriceTieredConfig", - "PriceNewPlanTieredPriceTieredConfigTier", - "PriceNewPlanTieredPriceBillingCycleConfiguration", - "PriceNewPlanTieredPriceInvoicingCycleConfiguration", "PriceNewPlanTieredBpsPrice", - "PriceNewPlanTieredBpsPriceTieredBpsConfig", - "PriceNewPlanTieredBpsPriceTieredBpsConfigTier", - "PriceNewPlanTieredBpsPriceBillingCycleConfiguration", - "PriceNewPlanTieredBpsPriceInvoicingCycleConfiguration", "PriceNewPlanBpsPrice", - "PriceNewPlanBpsPriceBpsConfig", - "PriceNewPlanBpsPriceBillingCycleConfiguration", - "PriceNewPlanBpsPriceInvoicingCycleConfiguration", "PriceNewPlanBulkBpsPrice", - "PriceNewPlanBulkBpsPriceBulkBpsConfig", - "PriceNewPlanBulkBpsPriceBulkBpsConfigTier", - "PriceNewPlanBulkBpsPriceBillingCycleConfiguration", - "PriceNewPlanBulkBpsPriceInvoicingCycleConfiguration", "PriceNewPlanBulkPrice", - "PriceNewPlanBulkPriceBulkConfig", - "PriceNewPlanBulkPriceBulkConfigTier", - "PriceNewPlanBulkPriceBillingCycleConfiguration", - "PriceNewPlanBulkPriceInvoicingCycleConfiguration", "PriceNewPlanThresholdTotalAmountPrice", - "PriceNewPlanThresholdTotalAmountPriceBillingCycleConfiguration", - "PriceNewPlanThresholdTotalAmountPriceInvoicingCycleConfiguration", "PriceNewPlanTieredPackagePrice", - "PriceNewPlanTieredPackagePriceBillingCycleConfiguration", - "PriceNewPlanTieredPackagePriceInvoicingCycleConfiguration", "PriceNewPlanTieredWithMinimumPrice", - "PriceNewPlanTieredWithMinimumPriceBillingCycleConfiguration", - "PriceNewPlanTieredWithMinimumPriceInvoicingCycleConfiguration", "PriceNewPlanUnitWithPercentPrice", - "PriceNewPlanUnitWithPercentPriceBillingCycleConfiguration", - "PriceNewPlanUnitWithPercentPriceInvoicingCycleConfiguration", "PriceNewPlanPackageWithAllocationPrice", - "PriceNewPlanPackageWithAllocationPriceBillingCycleConfiguration", - "PriceNewPlanPackageWithAllocationPriceInvoicingCycleConfiguration", "PriceNewPlanTierWithProrationPrice", - "PriceNewPlanTierWithProrationPriceBillingCycleConfiguration", - "PriceNewPlanTierWithProrationPriceInvoicingCycleConfiguration", "PriceNewPlanUnitWithProrationPrice", - "PriceNewPlanUnitWithProrationPriceBillingCycleConfiguration", - "PriceNewPlanUnitWithProrationPriceInvoicingCycleConfiguration", "PriceNewPlanGroupedAllocationPrice", - "PriceNewPlanGroupedAllocationPriceBillingCycleConfiguration", - "PriceNewPlanGroupedAllocationPriceInvoicingCycleConfiguration", "PriceNewPlanGroupedWithProratedMinimumPrice", - "PriceNewPlanGroupedWithProratedMinimumPriceBillingCycleConfiguration", - "PriceNewPlanGroupedWithProratedMinimumPriceInvoicingCycleConfiguration", "PriceNewPlanGroupedWithMeteredMinimumPrice", - "PriceNewPlanGroupedWithMeteredMinimumPriceBillingCycleConfiguration", - "PriceNewPlanGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration", "PriceNewPlanMatrixWithDisplayNamePrice", - "PriceNewPlanMatrixWithDisplayNamePriceBillingCycleConfiguration", - "PriceNewPlanMatrixWithDisplayNamePriceInvoicingCycleConfiguration", "PriceNewPlanBulkWithProrationPrice", - "PriceNewPlanBulkWithProrationPriceBillingCycleConfiguration", - "PriceNewPlanBulkWithProrationPriceInvoicingCycleConfiguration", "PriceNewPlanGroupedTieredPackagePrice", - "PriceNewPlanGroupedTieredPackagePriceBillingCycleConfiguration", - "PriceNewPlanGroupedTieredPackagePriceInvoicingCycleConfiguration", "PriceNewPlanMaxGroupTieredPackagePrice", - "PriceNewPlanMaxGroupTieredPackagePriceBillingCycleConfiguration", - "PriceNewPlanMaxGroupTieredPackagePriceInvoicingCycleConfiguration", "PriceNewPlanScalableMatrixWithUnitPricingPrice", - "PriceNewPlanScalableMatrixWithUnitPricingPriceBillingCycleConfiguration", - "PriceNewPlanScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration", "PriceNewPlanScalableMatrixWithTieredPricingPrice", - "PriceNewPlanScalableMatrixWithTieredPricingPriceBillingCycleConfiguration", - "PriceNewPlanScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration", "PriceNewPlanCumulativeGroupedBulkPrice", - "PriceNewPlanCumulativeGroupedBulkPriceBillingCycleConfiguration", - "PriceNewPlanCumulativeGroupedBulkPriceInvoicingCycleConfiguration", ] @@ -142,27 +90,6 @@ class PlanCreateParams(TypedDict, total=False): """ -class PriceNewPlanUnitPriceUnitConfig(TypedDict, total=False): - unit_amount: Required[str] - """Rate per unit of usage""" - - -class PriceNewPlanUnitPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewPlanUnitPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - class PriceNewPlanUnitPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -175,7 +102,7 @@ class PriceNewPlanUnitPrice(TypedDict, total=False): name: Required[str] """The name of the price.""" - unit_config: Required[PriceNewPlanUnitPriceUnitConfig] + unit_config: Required[UnitConfigModel] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -189,7 +116,7 @@ class PriceNewPlanUnitPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[PriceNewPlanUnitPriceBillingCycleConfiguration] + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -216,7 +143,7 @@ class PriceNewPlanUnitPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[PriceNewPlanUnitPriceInvoicingCycleConfiguration] + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -230,34 +157,6 @@ class PriceNewPlanUnitPrice(TypedDict, total=False): """ -class PriceNewPlanPackagePricePackageConfig(TypedDict, total=False): - package_amount: Required[str] - """A currency amount to rate usage by""" - - package_size: Required[int] - """An integer amount to represent package size. - - For example, 1000 here would divide usage by 1000 before multiplying by - package_amount in rating - """ - - -class PriceNewPlanPackagePriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewPlanPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - class PriceNewPlanPackagePrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -270,7 +169,7 @@ class PriceNewPlanPackagePrice(TypedDict, total=False): name: Required[str] """The name of the price.""" - package_config: Required[PriceNewPlanPackagePricePackageConfig] + package_config: Required[PackageConfigModel] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -284,7 +183,7 @@ class PriceNewPlanPackagePrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[PriceNewPlanPackagePriceBillingCycleConfiguration] + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -311,7 +210,7 @@ class PriceNewPlanPackagePrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[PriceNewPlanPackagePriceInvoicingCycleConfiguration] + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -325,45 +224,6 @@ class PriceNewPlanPackagePrice(TypedDict, total=False): """ -class PriceNewPlanMatrixPriceMatrixConfigMatrixValue(TypedDict, total=False): - dimension_values: Required[List[Optional[str]]] - """One or two matrix keys to filter usage to this Matrix value by. - - For example, ["region", "tier"] could be used to filter cloud usage by a cloud - region and an instance tier. - """ - - unit_amount: Required[str] - """Unit price for the specified dimension_values""" - - -class PriceNewPlanMatrixPriceMatrixConfig(TypedDict, total=False): - default_unit_amount: Required[str] - """Default per unit rate for any usage not bucketed into a specified matrix_value""" - - dimensions: Required[List[Optional[str]]] - """One or two event property values to evaluate matrix groups by""" - - matrix_values: Required[Iterable[PriceNewPlanMatrixPriceMatrixConfigMatrixValue]] - """Matrix values for specified matrix grouping keys""" - - -class PriceNewPlanMatrixPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewPlanMatrixPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - class PriceNewPlanMatrixPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -371,7 +231,7 @@ class PriceNewPlanMatrixPrice(TypedDict, total=False): item_id: Required[str] """The id of the item the price will be associated with.""" - matrix_config: Required[PriceNewPlanMatrixPriceMatrixConfig] + matrix_config: Required[MatrixConfigModel] model_type: Required[Literal["matrix"]] @@ -390,7 +250,7 @@ class PriceNewPlanMatrixPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[PriceNewPlanMatrixPriceBillingCycleConfiguration] + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -417,7 +277,7 @@ class PriceNewPlanMatrixPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[PriceNewPlanMatrixPriceInvoicingCycleConfiguration] + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -431,38 +291,6 @@ class PriceNewPlanMatrixPrice(TypedDict, total=False): """ -class PriceNewPlanTieredPriceTieredConfigTier(TypedDict, total=False): - first_unit: Required[float] - """Inclusive tier starting value""" - - unit_amount: Required[str] - """Amount per unit""" - - last_unit: Optional[float] - """Exclusive tier ending value. If null, this is treated as the last tier""" - - -class PriceNewPlanTieredPriceTieredConfig(TypedDict, total=False): - tiers: Required[Iterable[PriceNewPlanTieredPriceTieredConfigTier]] - """Tiers for rating based on total usage quantities into the specified tier""" - - -class PriceNewPlanTieredPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewPlanTieredPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - class PriceNewPlanTieredPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -475,7 +303,7 @@ class PriceNewPlanTieredPrice(TypedDict, total=False): name: Required[str] """The name of the price.""" - tiered_config: Required[PriceNewPlanTieredPriceTieredConfig] + tiered_config: Required[TieredConfigModel] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -489,7 +317,7 @@ class PriceNewPlanTieredPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[PriceNewPlanTieredPriceBillingCycleConfiguration] + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -516,7 +344,7 @@ class PriceNewPlanTieredPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[PriceNewPlanTieredPriceInvoicingCycleConfiguration] + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -530,44 +358,6 @@ class PriceNewPlanTieredPrice(TypedDict, total=False): """ -class PriceNewPlanTieredBpsPriceTieredBpsConfigTier(TypedDict, total=False): - bps: Required[float] - """Per-event basis point rate""" - - minimum_amount: Required[str] - """Inclusive tier starting value""" - - maximum_amount: Optional[str] - """Exclusive tier ending value""" - - per_unit_maximum: Optional[str] - """Per unit maximum to charge""" - - -class PriceNewPlanTieredBpsPriceTieredBpsConfig(TypedDict, total=False): - tiers: Required[Iterable[PriceNewPlanTieredBpsPriceTieredBpsConfigTier]] - """ - Tiers for a Graduated BPS pricing model, where usage is bucketed into specified - tiers - """ - - -class PriceNewPlanTieredBpsPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewPlanTieredBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - class PriceNewPlanTieredBpsPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -580,7 +370,7 @@ class PriceNewPlanTieredBpsPrice(TypedDict, total=False): name: Required[str] """The name of the price.""" - tiered_bps_config: Required[PriceNewPlanTieredBpsPriceTieredBpsConfig] + tiered_bps_config: Required[TieredBpsConfigModel] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -594,7 +384,7 @@ class PriceNewPlanTieredBpsPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[PriceNewPlanTieredBpsPriceBillingCycleConfiguration] + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -621,7 +411,7 @@ class PriceNewPlanTieredBpsPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[PriceNewPlanTieredBpsPriceInvoicingCycleConfiguration] + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -635,32 +425,8 @@ class PriceNewPlanTieredBpsPrice(TypedDict, total=False): """ -class PriceNewPlanBpsPriceBpsConfig(TypedDict, total=False): - bps: Required[float] - """Basis point take rate per event""" - - per_unit_maximum: Optional[str] - """Optional currency amount maximum to cap spend per event""" - - -class PriceNewPlanBpsPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewPlanBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - class PriceNewPlanBpsPrice(TypedDict, total=False): - bps_config: Required[PriceNewPlanBpsPriceBpsConfig] + bps_config: Required[BpsConfigModel] cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -685,7 +451,7 @@ class PriceNewPlanBpsPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[PriceNewPlanBpsPriceBillingCycleConfiguration] + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -712,7 +478,7 @@ class PriceNewPlanBpsPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[PriceNewPlanBpsPriceInvoicingCycleConfiguration] + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -726,43 +492,8 @@ class PriceNewPlanBpsPrice(TypedDict, total=False): """ -class PriceNewPlanBulkBpsPriceBulkBpsConfigTier(TypedDict, total=False): - bps: Required[float] - """Basis points to rate on""" - - maximum_amount: Optional[str] - """Upper bound for tier""" - - per_unit_maximum: Optional[str] - """The maximum amount to charge for any one event""" - - -class PriceNewPlanBulkBpsPriceBulkBpsConfig(TypedDict, total=False): - tiers: Required[Iterable[PriceNewPlanBulkBpsPriceBulkBpsConfigTier]] - """ - Tiers for a bulk BPS pricing model where all usage is aggregated to a single - tier based on total volume - """ - - -class PriceNewPlanBulkBpsPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewPlanBulkBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - class PriceNewPlanBulkBpsPrice(TypedDict, total=False): - bulk_bps_config: Required[PriceNewPlanBulkBpsPriceBulkBpsConfig] + bulk_bps_config: Required[BulkBpsConfigModel] cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -787,7 +518,7 @@ class PriceNewPlanBulkBpsPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[PriceNewPlanBulkBpsPriceBillingCycleConfiguration] + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -814,7 +545,7 @@ class PriceNewPlanBulkBpsPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[PriceNewPlanBulkBpsPriceInvoicingCycleConfiguration] + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -828,37 +559,8 @@ class PriceNewPlanBulkBpsPrice(TypedDict, total=False): """ -class PriceNewPlanBulkPriceBulkConfigTier(TypedDict, total=False): - unit_amount: Required[str] - """Amount per unit""" - - maximum_units: Optional[float] - """Upper bound for this tier""" - - -class PriceNewPlanBulkPriceBulkConfig(TypedDict, total=False): - tiers: Required[Iterable[PriceNewPlanBulkPriceBulkConfigTier]] - """Bulk tiers for rating based on total usage volume""" - - -class PriceNewPlanBulkPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewPlanBulkPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - class PriceNewPlanBulkPrice(TypedDict, total=False): - bulk_config: Required[PriceNewPlanBulkPriceBulkConfig] + bulk_config: Required[BulkConfigModel] cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -883,7 +585,7 @@ class PriceNewPlanBulkPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[PriceNewPlanBulkPriceBillingCycleConfiguration] + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -910,7 +612,7 @@ class PriceNewPlanBulkPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[PriceNewPlanBulkPriceInvoicingCycleConfiguration] + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -924,22 +626,6 @@ class PriceNewPlanBulkPrice(TypedDict, total=False): """ -class PriceNewPlanThresholdTotalAmountPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewPlanThresholdTotalAmountPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - class PriceNewPlanThresholdTotalAmountPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -952,7 +638,7 @@ class PriceNewPlanThresholdTotalAmountPrice(TypedDict, total=False): name: Required[str] """The name of the price.""" - threshold_total_amount_config: Required[Dict[str, object]] + threshold_total_amount_config: Required[CustomRatingFunctionConfigModel] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -966,7 +652,7 @@ class PriceNewPlanThresholdTotalAmountPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[PriceNewPlanThresholdTotalAmountPriceBillingCycleConfiguration] + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -993,7 +679,7 @@ class PriceNewPlanThresholdTotalAmountPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[PriceNewPlanThresholdTotalAmountPriceInvoicingCycleConfiguration] + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -1007,22 +693,6 @@ class PriceNewPlanThresholdTotalAmountPrice(TypedDict, total=False): """ -class PriceNewPlanTieredPackagePriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewPlanTieredPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - class PriceNewPlanTieredPackagePrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -1035,7 +705,7 @@ class PriceNewPlanTieredPackagePrice(TypedDict, total=False): name: Required[str] """The name of the price.""" - tiered_package_config: Required[Dict[str, object]] + tiered_package_config: Required[CustomRatingFunctionConfigModel] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -1049,7 +719,7 @@ class PriceNewPlanTieredPackagePrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[PriceNewPlanTieredPackagePriceBillingCycleConfiguration] + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -1076,7 +746,7 @@ class PriceNewPlanTieredPackagePrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[PriceNewPlanTieredPackagePriceInvoicingCycleConfiguration] + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -1090,22 +760,6 @@ class PriceNewPlanTieredPackagePrice(TypedDict, total=False): """ -class PriceNewPlanTieredWithMinimumPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewPlanTieredWithMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - class PriceNewPlanTieredWithMinimumPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -1118,7 +772,7 @@ class PriceNewPlanTieredWithMinimumPrice(TypedDict, total=False): name: Required[str] """The name of the price.""" - tiered_with_minimum_config: Required[Dict[str, object]] + tiered_with_minimum_config: Required[CustomRatingFunctionConfigModel] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -1132,7 +786,7 @@ class PriceNewPlanTieredWithMinimumPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[PriceNewPlanTieredWithMinimumPriceBillingCycleConfiguration] + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -1159,7 +813,7 @@ class PriceNewPlanTieredWithMinimumPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[PriceNewPlanTieredWithMinimumPriceInvoicingCycleConfiguration] + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -1173,22 +827,6 @@ class PriceNewPlanTieredWithMinimumPrice(TypedDict, total=False): """ -class PriceNewPlanUnitWithPercentPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewPlanUnitWithPercentPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - class PriceNewPlanUnitWithPercentPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -1201,7 +839,7 @@ class PriceNewPlanUnitWithPercentPrice(TypedDict, total=False): name: Required[str] """The name of the price.""" - unit_with_percent_config: Required[Dict[str, object]] + unit_with_percent_config: Required[CustomRatingFunctionConfigModel] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -1215,7 +853,7 @@ class PriceNewPlanUnitWithPercentPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[PriceNewPlanUnitWithPercentPriceBillingCycleConfiguration] + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -1242,7 +880,7 @@ class PriceNewPlanUnitWithPercentPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[PriceNewPlanUnitWithPercentPriceInvoicingCycleConfiguration] + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -1256,22 +894,6 @@ class PriceNewPlanUnitWithPercentPrice(TypedDict, total=False): """ -class PriceNewPlanPackageWithAllocationPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewPlanPackageWithAllocationPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - class PriceNewPlanPackageWithAllocationPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -1284,7 +906,7 @@ class PriceNewPlanPackageWithAllocationPrice(TypedDict, total=False): name: Required[str] """The name of the price.""" - package_with_allocation_config: Required[Dict[str, object]] + package_with_allocation_config: Required[CustomRatingFunctionConfigModel] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -1298,7 +920,7 @@ class PriceNewPlanPackageWithAllocationPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[PriceNewPlanPackageWithAllocationPriceBillingCycleConfiguration] + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -1325,7 +947,7 @@ class PriceNewPlanPackageWithAllocationPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[PriceNewPlanPackageWithAllocationPriceInvoicingCycleConfiguration] + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -1339,22 +961,6 @@ class PriceNewPlanPackageWithAllocationPrice(TypedDict, total=False): """ -class PriceNewPlanTierWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewPlanTierWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - class PriceNewPlanTierWithProrationPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -1367,7 +973,7 @@ class PriceNewPlanTierWithProrationPrice(TypedDict, total=False): name: Required[str] """The name of the price.""" - tiered_with_proration_config: Required[Dict[str, object]] + tiered_with_proration_config: Required[CustomRatingFunctionConfigModel] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -1381,7 +987,7 @@ class PriceNewPlanTierWithProrationPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[PriceNewPlanTierWithProrationPriceBillingCycleConfiguration] + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -1408,7 +1014,7 @@ class PriceNewPlanTierWithProrationPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[PriceNewPlanTierWithProrationPriceInvoicingCycleConfiguration] + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -1422,22 +1028,6 @@ class PriceNewPlanTierWithProrationPrice(TypedDict, total=False): """ -class PriceNewPlanUnitWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewPlanUnitWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - class PriceNewPlanUnitWithProrationPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -1450,7 +1040,7 @@ class PriceNewPlanUnitWithProrationPrice(TypedDict, total=False): name: Required[str] """The name of the price.""" - unit_with_proration_config: Required[Dict[str, object]] + unit_with_proration_config: Required[CustomRatingFunctionConfigModel] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -1464,7 +1054,7 @@ class PriceNewPlanUnitWithProrationPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[PriceNewPlanUnitWithProrationPriceBillingCycleConfiguration] + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -1491,7 +1081,7 @@ class PriceNewPlanUnitWithProrationPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[PriceNewPlanUnitWithProrationPriceInvoicingCycleConfiguration] + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -1505,27 +1095,11 @@ class PriceNewPlanUnitWithProrationPrice(TypedDict, total=False): """ -class PriceNewPlanGroupedAllocationPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewPlanGroupedAllocationPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - class PriceNewPlanGroupedAllocationPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" - grouped_allocation_config: Required[Dict[str, object]] + grouped_allocation_config: Required[CustomRatingFunctionConfigModel] item_id: Required[str] """The id of the item the price will be associated with.""" @@ -1547,7 +1121,7 @@ class PriceNewPlanGroupedAllocationPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[PriceNewPlanGroupedAllocationPriceBillingCycleConfiguration] + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -1574,7 +1148,7 @@ class PriceNewPlanGroupedAllocationPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[PriceNewPlanGroupedAllocationPriceInvoicingCycleConfiguration] + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -1588,27 +1162,11 @@ class PriceNewPlanGroupedAllocationPrice(TypedDict, total=False): """ -class PriceNewPlanGroupedWithProratedMinimumPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewPlanGroupedWithProratedMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - class PriceNewPlanGroupedWithProratedMinimumPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" - grouped_with_prorated_minimum_config: Required[Dict[str, object]] + grouped_with_prorated_minimum_config: Required[CustomRatingFunctionConfigModel] item_id: Required[str] """The id of the item the price will be associated with.""" @@ -1630,7 +1188,7 @@ class PriceNewPlanGroupedWithProratedMinimumPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[PriceNewPlanGroupedWithProratedMinimumPriceBillingCycleConfiguration] + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -1657,7 +1215,7 @@ class PriceNewPlanGroupedWithProratedMinimumPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[PriceNewPlanGroupedWithProratedMinimumPriceInvoicingCycleConfiguration] + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -1671,27 +1229,11 @@ class PriceNewPlanGroupedWithProratedMinimumPrice(TypedDict, total=False): """ -class PriceNewPlanGroupedWithMeteredMinimumPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewPlanGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - class PriceNewPlanGroupedWithMeteredMinimumPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" - grouped_with_metered_minimum_config: Required[Dict[str, object]] + grouped_with_metered_minimum_config: Required[CustomRatingFunctionConfigModel] item_id: Required[str] """The id of the item the price will be associated with.""" @@ -1713,7 +1255,7 @@ class PriceNewPlanGroupedWithMeteredMinimumPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[PriceNewPlanGroupedWithMeteredMinimumPriceBillingCycleConfiguration] + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -1740,7 +1282,7 @@ class PriceNewPlanGroupedWithMeteredMinimumPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[PriceNewPlanGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration] + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -1754,22 +1296,6 @@ class PriceNewPlanGroupedWithMeteredMinimumPrice(TypedDict, total=False): """ -class PriceNewPlanMatrixWithDisplayNamePriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewPlanMatrixWithDisplayNamePriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - class PriceNewPlanMatrixWithDisplayNamePrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -1777,7 +1303,7 @@ class PriceNewPlanMatrixWithDisplayNamePrice(TypedDict, total=False): item_id: Required[str] """The id of the item the price will be associated with.""" - matrix_with_display_name_config: Required[Dict[str, object]] + matrix_with_display_name_config: Required[CustomRatingFunctionConfigModel] model_type: Required[Literal["matrix_with_display_name"]] @@ -1796,7 +1322,7 @@ class PriceNewPlanMatrixWithDisplayNamePrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[PriceNewPlanMatrixWithDisplayNamePriceBillingCycleConfiguration] + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -1823,7 +1349,7 @@ class PriceNewPlanMatrixWithDisplayNamePrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[PriceNewPlanMatrixWithDisplayNamePriceInvoicingCycleConfiguration] + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -1837,24 +1363,8 @@ class PriceNewPlanMatrixWithDisplayNamePrice(TypedDict, total=False): """ -class PriceNewPlanBulkWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewPlanBulkWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - class PriceNewPlanBulkWithProrationPrice(TypedDict, total=False): - bulk_with_proration_config: Required[Dict[str, object]] + bulk_with_proration_config: Required[CustomRatingFunctionConfigModel] cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -1879,7 +1389,7 @@ class PriceNewPlanBulkWithProrationPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[PriceNewPlanBulkWithProrationPriceBillingCycleConfiguration] + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -1906,7 +1416,7 @@ class PriceNewPlanBulkWithProrationPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[PriceNewPlanBulkWithProrationPriceInvoicingCycleConfiguration] + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -1920,27 +1430,11 @@ class PriceNewPlanBulkWithProrationPrice(TypedDict, total=False): """ -class PriceNewPlanGroupedTieredPackagePriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewPlanGroupedTieredPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - class PriceNewPlanGroupedTieredPackagePrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" - grouped_tiered_package_config: Required[Dict[str, object]] + grouped_tiered_package_config: Required[CustomRatingFunctionConfigModel] item_id: Required[str] """The id of the item the price will be associated with.""" @@ -1962,7 +1456,7 @@ class PriceNewPlanGroupedTieredPackagePrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[PriceNewPlanGroupedTieredPackagePriceBillingCycleConfiguration] + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -1989,7 +1483,7 @@ class PriceNewPlanGroupedTieredPackagePrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[PriceNewPlanGroupedTieredPackagePriceInvoicingCycleConfiguration] + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -2003,22 +1497,6 @@ class PriceNewPlanGroupedTieredPackagePrice(TypedDict, total=False): """ -class PriceNewPlanMaxGroupTieredPackagePriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewPlanMaxGroupTieredPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - class PriceNewPlanMaxGroupTieredPackagePrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -2026,7 +1504,7 @@ class PriceNewPlanMaxGroupTieredPackagePrice(TypedDict, total=False): item_id: Required[str] """The id of the item the price will be associated with.""" - max_group_tiered_package_config: Required[Dict[str, object]] + max_group_tiered_package_config: Required[CustomRatingFunctionConfigModel] model_type: Required[Literal["max_group_tiered_package"]] @@ -2045,7 +1523,7 @@ class PriceNewPlanMaxGroupTieredPackagePrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[PriceNewPlanMaxGroupTieredPackagePriceBillingCycleConfiguration] + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -2072,7 +1550,7 @@ class PriceNewPlanMaxGroupTieredPackagePrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[PriceNewPlanMaxGroupTieredPackagePriceInvoicingCycleConfiguration] + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -2086,22 +1564,6 @@ class PriceNewPlanMaxGroupTieredPackagePrice(TypedDict, total=False): """ -class PriceNewPlanScalableMatrixWithUnitPricingPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewPlanScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - class PriceNewPlanScalableMatrixWithUnitPricingPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -2114,7 +1576,7 @@ class PriceNewPlanScalableMatrixWithUnitPricingPrice(TypedDict, total=False): name: Required[str] """The name of the price.""" - scalable_matrix_with_unit_pricing_config: Required[Dict[str, object]] + scalable_matrix_with_unit_pricing_config: Required[CustomRatingFunctionConfigModel] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -2128,7 +1590,7 @@ class PriceNewPlanScalableMatrixWithUnitPricingPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[PriceNewPlanScalableMatrixWithUnitPricingPriceBillingCycleConfiguration] + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -2155,7 +1617,7 @@ class PriceNewPlanScalableMatrixWithUnitPricingPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[PriceNewPlanScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration] + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -2169,22 +1631,6 @@ class PriceNewPlanScalableMatrixWithUnitPricingPrice(TypedDict, total=False): """ -class PriceNewPlanScalableMatrixWithTieredPricingPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewPlanScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - class PriceNewPlanScalableMatrixWithTieredPricingPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -2197,7 +1643,7 @@ class PriceNewPlanScalableMatrixWithTieredPricingPrice(TypedDict, total=False): name: Required[str] """The name of the price.""" - scalable_matrix_with_tiered_pricing_config: Required[Dict[str, object]] + scalable_matrix_with_tiered_pricing_config: Required[CustomRatingFunctionConfigModel] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -2211,7 +1657,7 @@ class PriceNewPlanScalableMatrixWithTieredPricingPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[PriceNewPlanScalableMatrixWithTieredPricingPriceBillingCycleConfiguration] + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -2238,7 +1684,7 @@ class PriceNewPlanScalableMatrixWithTieredPricingPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[PriceNewPlanScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration] + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -2252,27 +1698,11 @@ class PriceNewPlanScalableMatrixWithTieredPricingPrice(TypedDict, total=False): """ -class PriceNewPlanCumulativeGroupedBulkPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewPlanCumulativeGroupedBulkPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - class PriceNewPlanCumulativeGroupedBulkPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" - cumulative_grouped_bulk_config: Required[Dict[str, object]] + cumulative_grouped_bulk_config: Required[CustomRatingFunctionConfigModel] item_id: Required[str] """The id of the item the price will be associated with.""" @@ -2294,7 +1724,7 @@ class PriceNewPlanCumulativeGroupedBulkPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[PriceNewPlanCumulativeGroupedBulkPriceBillingCycleConfiguration] + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -2321,7 +1751,7 @@ class PriceNewPlanCumulativeGroupedBulkPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[PriceNewPlanCumulativeGroupedBulkPriceInvoicingCycleConfiguration] + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. diff --git a/src/orb/types/price.py b/src/orb/types/price.py deleted file mode 100644 index f04b2874..00000000 --- a/src/orb/types/price.py +++ /dev/null @@ -1,3597 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List, Union, Optional -from datetime import datetime -from typing_extensions import Literal, Annotated, TypeAlias - -from pydantic import Field as FieldInfo - -from .._utils import PropertyInfo -from .._models import BaseModel -from .shared.discount import Discount - -__all__ = [ - "Price", - "UnitPrice", - "UnitPriceBillableMetric", - "UnitPriceBillingCycleConfiguration", - "UnitPriceCreditAllocation", - "UnitPriceInvoicingCycleConfiguration", - "UnitPriceItem", - "UnitPriceMaximum", - "UnitPriceMinimum", - "UnitPriceUnitConfig", - "UnitPriceDimensionalPriceConfiguration", - "PackagePrice", - "PackagePriceBillableMetric", - "PackagePriceBillingCycleConfiguration", - "PackagePriceCreditAllocation", - "PackagePriceInvoicingCycleConfiguration", - "PackagePriceItem", - "PackagePriceMaximum", - "PackagePriceMinimum", - "PackagePricePackageConfig", - "PackagePriceDimensionalPriceConfiguration", - "MatrixPrice", - "MatrixPriceBillableMetric", - "MatrixPriceBillingCycleConfiguration", - "MatrixPriceCreditAllocation", - "MatrixPriceInvoicingCycleConfiguration", - "MatrixPriceItem", - "MatrixPriceMatrixConfig", - "MatrixPriceMatrixConfigMatrixValue", - "MatrixPriceMaximum", - "MatrixPriceMinimum", - "MatrixPriceDimensionalPriceConfiguration", - "TieredPrice", - "TieredPriceBillableMetric", - "TieredPriceBillingCycleConfiguration", - "TieredPriceCreditAllocation", - "TieredPriceInvoicingCycleConfiguration", - "TieredPriceItem", - "TieredPriceMaximum", - "TieredPriceMinimum", - "TieredPriceTieredConfig", - "TieredPriceTieredConfigTier", - "TieredPriceDimensionalPriceConfiguration", - "TieredBpsPrice", - "TieredBpsPriceBillableMetric", - "TieredBpsPriceBillingCycleConfiguration", - "TieredBpsPriceCreditAllocation", - "TieredBpsPriceInvoicingCycleConfiguration", - "TieredBpsPriceItem", - "TieredBpsPriceMaximum", - "TieredBpsPriceMinimum", - "TieredBpsPriceTieredBpsConfig", - "TieredBpsPriceTieredBpsConfigTier", - "TieredBpsPriceDimensionalPriceConfiguration", - "BpsPrice", - "BpsPriceBillableMetric", - "BpsPriceBillingCycleConfiguration", - "BpsPriceBpsConfig", - "BpsPriceCreditAllocation", - "BpsPriceInvoicingCycleConfiguration", - "BpsPriceItem", - "BpsPriceMaximum", - "BpsPriceMinimum", - "BpsPriceDimensionalPriceConfiguration", - "BulkBpsPrice", - "BulkBpsPriceBillableMetric", - "BulkBpsPriceBillingCycleConfiguration", - "BulkBpsPriceBulkBpsConfig", - "BulkBpsPriceBulkBpsConfigTier", - "BulkBpsPriceCreditAllocation", - "BulkBpsPriceInvoicingCycleConfiguration", - "BulkBpsPriceItem", - "BulkBpsPriceMaximum", - "BulkBpsPriceMinimum", - "BulkBpsPriceDimensionalPriceConfiguration", - "BulkPrice", - "BulkPriceBillableMetric", - "BulkPriceBillingCycleConfiguration", - "BulkPriceBulkConfig", - "BulkPriceBulkConfigTier", - "BulkPriceCreditAllocation", - "BulkPriceInvoicingCycleConfiguration", - "BulkPriceItem", - "BulkPriceMaximum", - "BulkPriceMinimum", - "BulkPriceDimensionalPriceConfiguration", - "ThresholdTotalAmountPrice", - "ThresholdTotalAmountPriceBillableMetric", - "ThresholdTotalAmountPriceBillingCycleConfiguration", - "ThresholdTotalAmountPriceCreditAllocation", - "ThresholdTotalAmountPriceInvoicingCycleConfiguration", - "ThresholdTotalAmountPriceItem", - "ThresholdTotalAmountPriceMaximum", - "ThresholdTotalAmountPriceMinimum", - "ThresholdTotalAmountPriceDimensionalPriceConfiguration", - "TieredPackagePrice", - "TieredPackagePriceBillableMetric", - "TieredPackagePriceBillingCycleConfiguration", - "TieredPackagePriceCreditAllocation", - "TieredPackagePriceInvoicingCycleConfiguration", - "TieredPackagePriceItem", - "TieredPackagePriceMaximum", - "TieredPackagePriceMinimum", - "TieredPackagePriceDimensionalPriceConfiguration", - "GroupedTieredPrice", - "GroupedTieredPriceBillableMetric", - "GroupedTieredPriceBillingCycleConfiguration", - "GroupedTieredPriceCreditAllocation", - "GroupedTieredPriceInvoicingCycleConfiguration", - "GroupedTieredPriceItem", - "GroupedTieredPriceMaximum", - "GroupedTieredPriceMinimum", - "GroupedTieredPriceDimensionalPriceConfiguration", - "TieredWithMinimumPrice", - "TieredWithMinimumPriceBillableMetric", - "TieredWithMinimumPriceBillingCycleConfiguration", - "TieredWithMinimumPriceCreditAllocation", - "TieredWithMinimumPriceInvoicingCycleConfiguration", - "TieredWithMinimumPriceItem", - "TieredWithMinimumPriceMaximum", - "TieredWithMinimumPriceMinimum", - "TieredWithMinimumPriceDimensionalPriceConfiguration", - "TieredPackageWithMinimumPrice", - "TieredPackageWithMinimumPriceBillableMetric", - "TieredPackageWithMinimumPriceBillingCycleConfiguration", - "TieredPackageWithMinimumPriceCreditAllocation", - "TieredPackageWithMinimumPriceInvoicingCycleConfiguration", - "TieredPackageWithMinimumPriceItem", - "TieredPackageWithMinimumPriceMaximum", - "TieredPackageWithMinimumPriceMinimum", - "TieredPackageWithMinimumPriceDimensionalPriceConfiguration", - "PackageWithAllocationPrice", - "PackageWithAllocationPriceBillableMetric", - "PackageWithAllocationPriceBillingCycleConfiguration", - "PackageWithAllocationPriceCreditAllocation", - "PackageWithAllocationPriceInvoicingCycleConfiguration", - "PackageWithAllocationPriceItem", - "PackageWithAllocationPriceMaximum", - "PackageWithAllocationPriceMinimum", - "PackageWithAllocationPriceDimensionalPriceConfiguration", - "UnitWithPercentPrice", - "UnitWithPercentPriceBillableMetric", - "UnitWithPercentPriceBillingCycleConfiguration", - "UnitWithPercentPriceCreditAllocation", - "UnitWithPercentPriceInvoicingCycleConfiguration", - "UnitWithPercentPriceItem", - "UnitWithPercentPriceMaximum", - "UnitWithPercentPriceMinimum", - "UnitWithPercentPriceDimensionalPriceConfiguration", - "MatrixWithAllocationPrice", - "MatrixWithAllocationPriceBillableMetric", - "MatrixWithAllocationPriceBillingCycleConfiguration", - "MatrixWithAllocationPriceCreditAllocation", - "MatrixWithAllocationPriceInvoicingCycleConfiguration", - "MatrixWithAllocationPriceItem", - "MatrixWithAllocationPriceMatrixWithAllocationConfig", - "MatrixWithAllocationPriceMatrixWithAllocationConfigMatrixValue", - "MatrixWithAllocationPriceMaximum", - "MatrixWithAllocationPriceMinimum", - "MatrixWithAllocationPriceDimensionalPriceConfiguration", - "TieredWithProrationPrice", - "TieredWithProrationPriceBillableMetric", - "TieredWithProrationPriceBillingCycleConfiguration", - "TieredWithProrationPriceCreditAllocation", - "TieredWithProrationPriceInvoicingCycleConfiguration", - "TieredWithProrationPriceItem", - "TieredWithProrationPriceMaximum", - "TieredWithProrationPriceMinimum", - "TieredWithProrationPriceDimensionalPriceConfiguration", - "UnitWithProrationPrice", - "UnitWithProrationPriceBillableMetric", - "UnitWithProrationPriceBillingCycleConfiguration", - "UnitWithProrationPriceCreditAllocation", - "UnitWithProrationPriceInvoicingCycleConfiguration", - "UnitWithProrationPriceItem", - "UnitWithProrationPriceMaximum", - "UnitWithProrationPriceMinimum", - "UnitWithProrationPriceDimensionalPriceConfiguration", - "GroupedAllocationPrice", - "GroupedAllocationPriceBillableMetric", - "GroupedAllocationPriceBillingCycleConfiguration", - "GroupedAllocationPriceCreditAllocation", - "GroupedAllocationPriceInvoicingCycleConfiguration", - "GroupedAllocationPriceItem", - "GroupedAllocationPriceMaximum", - "GroupedAllocationPriceMinimum", - "GroupedAllocationPriceDimensionalPriceConfiguration", - "GroupedWithProratedMinimumPrice", - "GroupedWithProratedMinimumPriceBillableMetric", - "GroupedWithProratedMinimumPriceBillingCycleConfiguration", - "GroupedWithProratedMinimumPriceCreditAllocation", - "GroupedWithProratedMinimumPriceInvoicingCycleConfiguration", - "GroupedWithProratedMinimumPriceItem", - "GroupedWithProratedMinimumPriceMaximum", - "GroupedWithProratedMinimumPriceMinimum", - "GroupedWithProratedMinimumPriceDimensionalPriceConfiguration", - "GroupedWithMeteredMinimumPrice", - "GroupedWithMeteredMinimumPriceBillableMetric", - "GroupedWithMeteredMinimumPriceBillingCycleConfiguration", - "GroupedWithMeteredMinimumPriceCreditAllocation", - "GroupedWithMeteredMinimumPriceInvoicingCycleConfiguration", - "GroupedWithMeteredMinimumPriceItem", - "GroupedWithMeteredMinimumPriceMaximum", - "GroupedWithMeteredMinimumPriceMinimum", - "GroupedWithMeteredMinimumPriceDimensionalPriceConfiguration", - "MatrixWithDisplayNamePrice", - "MatrixWithDisplayNamePriceBillableMetric", - "MatrixWithDisplayNamePriceBillingCycleConfiguration", - "MatrixWithDisplayNamePriceCreditAllocation", - "MatrixWithDisplayNamePriceInvoicingCycleConfiguration", - "MatrixWithDisplayNamePriceItem", - "MatrixWithDisplayNamePriceMaximum", - "MatrixWithDisplayNamePriceMinimum", - "MatrixWithDisplayNamePriceDimensionalPriceConfiguration", - "BulkWithProrationPrice", - "BulkWithProrationPriceBillableMetric", - "BulkWithProrationPriceBillingCycleConfiguration", - "BulkWithProrationPriceCreditAllocation", - "BulkWithProrationPriceInvoicingCycleConfiguration", - "BulkWithProrationPriceItem", - "BulkWithProrationPriceMaximum", - "BulkWithProrationPriceMinimum", - "BulkWithProrationPriceDimensionalPriceConfiguration", - "GroupedTieredPackagePrice", - "GroupedTieredPackagePriceBillableMetric", - "GroupedTieredPackagePriceBillingCycleConfiguration", - "GroupedTieredPackagePriceCreditAllocation", - "GroupedTieredPackagePriceInvoicingCycleConfiguration", - "GroupedTieredPackagePriceItem", - "GroupedTieredPackagePriceMaximum", - "GroupedTieredPackagePriceMinimum", - "GroupedTieredPackagePriceDimensionalPriceConfiguration", - "MaxGroupTieredPackagePrice", - "MaxGroupTieredPackagePriceBillableMetric", - "MaxGroupTieredPackagePriceBillingCycleConfiguration", - "MaxGroupTieredPackagePriceCreditAllocation", - "MaxGroupTieredPackagePriceInvoicingCycleConfiguration", - "MaxGroupTieredPackagePriceItem", - "MaxGroupTieredPackagePriceMaximum", - "MaxGroupTieredPackagePriceMinimum", - "MaxGroupTieredPackagePriceDimensionalPriceConfiguration", - "ScalableMatrixWithUnitPricingPrice", - "ScalableMatrixWithUnitPricingPriceBillableMetric", - "ScalableMatrixWithUnitPricingPriceBillingCycleConfiguration", - "ScalableMatrixWithUnitPricingPriceCreditAllocation", - "ScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration", - "ScalableMatrixWithUnitPricingPriceItem", - "ScalableMatrixWithUnitPricingPriceMaximum", - "ScalableMatrixWithUnitPricingPriceMinimum", - "ScalableMatrixWithUnitPricingPriceDimensionalPriceConfiguration", - "ScalableMatrixWithTieredPricingPrice", - "ScalableMatrixWithTieredPricingPriceBillableMetric", - "ScalableMatrixWithTieredPricingPriceBillingCycleConfiguration", - "ScalableMatrixWithTieredPricingPriceCreditAllocation", - "ScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration", - "ScalableMatrixWithTieredPricingPriceItem", - "ScalableMatrixWithTieredPricingPriceMaximum", - "ScalableMatrixWithTieredPricingPriceMinimum", - "ScalableMatrixWithTieredPricingPriceDimensionalPriceConfiguration", - "CumulativeGroupedBulkPrice", - "CumulativeGroupedBulkPriceBillableMetric", - "CumulativeGroupedBulkPriceBillingCycleConfiguration", - "CumulativeGroupedBulkPriceCreditAllocation", - "CumulativeGroupedBulkPriceInvoicingCycleConfiguration", - "CumulativeGroupedBulkPriceItem", - "CumulativeGroupedBulkPriceMaximum", - "CumulativeGroupedBulkPriceMinimum", - "CumulativeGroupedBulkPriceDimensionalPriceConfiguration", -] - - -class UnitPriceBillableMetric(BaseModel): - id: str - - -class UnitPriceBillingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class UnitPriceCreditAllocation(BaseModel): - allows_rollover: bool - - currency: str - - -class UnitPriceInvoicingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class UnitPriceItem(BaseModel): - id: str - - name: str - - -class UnitPriceMaximum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this maximum amount applies to. - - For plan/plan phase maximums, this can be a subset of prices. - """ - - maximum_amount: str - """Maximum amount applied""" - - -class UnitPriceMinimum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this minimum amount applies to. - - For plan/plan phase minimums, this can be a subset of prices. - """ - - minimum_amount: str - """Minimum amount applied""" - - -class UnitPriceUnitConfig(BaseModel): - unit_amount: str - """Rate per unit of usage""" - - -class UnitPriceDimensionalPriceConfiguration(BaseModel): - dimension_values: List[str] - - dimensional_price_group_id: str - - -class UnitPrice(BaseModel): - id: str - - billable_metric: Optional[UnitPriceBillableMetric] = None - - billing_cycle_configuration: UnitPriceBillingCycleConfiguration - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[UnitPriceCreditAllocation] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - invoicing_cycle_configuration: Optional[UnitPriceInvoicingCycleConfiguration] = None - - item: UnitPriceItem - - maximum: Optional[UnitPriceMaximum] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[UnitPriceMinimum] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["unit"] = FieldInfo(alias="model_type") - - name: str - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - unit_config: UnitPriceUnitConfig - - dimensional_price_configuration: Optional[UnitPriceDimensionalPriceConfiguration] = None - - -class PackagePriceBillableMetric(BaseModel): - id: str - - -class PackagePriceBillingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class PackagePriceCreditAllocation(BaseModel): - allows_rollover: bool - - currency: str - - -class PackagePriceInvoicingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class PackagePriceItem(BaseModel): - id: str - - name: str - - -class PackagePriceMaximum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this maximum amount applies to. - - For plan/plan phase maximums, this can be a subset of prices. - """ - - maximum_amount: str - """Maximum amount applied""" - - -class PackagePriceMinimum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this minimum amount applies to. - - For plan/plan phase minimums, this can be a subset of prices. - """ - - minimum_amount: str - """Minimum amount applied""" - - -class PackagePricePackageConfig(BaseModel): - package_amount: str - """A currency amount to rate usage by""" - - package_size: int - """An integer amount to represent package size. - - For example, 1000 here would divide usage by 1000 before multiplying by - package_amount in rating - """ - - -class PackagePriceDimensionalPriceConfiguration(BaseModel): - dimension_values: List[str] - - dimensional_price_group_id: str - - -class PackagePrice(BaseModel): - id: str - - billable_metric: Optional[PackagePriceBillableMetric] = None - - billing_cycle_configuration: PackagePriceBillingCycleConfiguration - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[PackagePriceCreditAllocation] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - invoicing_cycle_configuration: Optional[PackagePriceInvoicingCycleConfiguration] = None - - item: PackagePriceItem - - maximum: Optional[PackagePriceMaximum] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[PackagePriceMinimum] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["package"] = FieldInfo(alias="model_type") - - name: str - - package_config: PackagePricePackageConfig - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - dimensional_price_configuration: Optional[PackagePriceDimensionalPriceConfiguration] = None - - -class MatrixPriceBillableMetric(BaseModel): - id: str - - -class MatrixPriceBillingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class MatrixPriceCreditAllocation(BaseModel): - allows_rollover: bool - - currency: str - - -class MatrixPriceInvoicingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class MatrixPriceItem(BaseModel): - id: str - - name: str - - -class MatrixPriceMatrixConfigMatrixValue(BaseModel): - dimension_values: List[Optional[str]] - """One or two matrix keys to filter usage to this Matrix value by. - - For example, ["region", "tier"] could be used to filter cloud usage by a cloud - region and an instance tier. - """ - - unit_amount: str - """Unit price for the specified dimension_values""" - - -class MatrixPriceMatrixConfig(BaseModel): - default_unit_amount: str - """Default per unit rate for any usage not bucketed into a specified matrix_value""" - - dimensions: List[Optional[str]] - """One or two event property values to evaluate matrix groups by""" - - matrix_values: List[MatrixPriceMatrixConfigMatrixValue] - """Matrix values for specified matrix grouping keys""" - - -class MatrixPriceMaximum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this maximum amount applies to. - - For plan/plan phase maximums, this can be a subset of prices. - """ - - maximum_amount: str - """Maximum amount applied""" - - -class MatrixPriceMinimum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this minimum amount applies to. - - For plan/plan phase minimums, this can be a subset of prices. - """ - - minimum_amount: str - """Minimum amount applied""" - - -class MatrixPriceDimensionalPriceConfiguration(BaseModel): - dimension_values: List[str] - - dimensional_price_group_id: str - - -class MatrixPrice(BaseModel): - id: str - - billable_metric: Optional[MatrixPriceBillableMetric] = None - - billing_cycle_configuration: MatrixPriceBillingCycleConfiguration - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[MatrixPriceCreditAllocation] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - invoicing_cycle_configuration: Optional[MatrixPriceInvoicingCycleConfiguration] = None - - item: MatrixPriceItem - - matrix_config: MatrixPriceMatrixConfig - - maximum: Optional[MatrixPriceMaximum] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[MatrixPriceMinimum] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["matrix"] = FieldInfo(alias="model_type") - - name: str - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - dimensional_price_configuration: Optional[MatrixPriceDimensionalPriceConfiguration] = None - - -class TieredPriceBillableMetric(BaseModel): - id: str - - -class TieredPriceBillingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class TieredPriceCreditAllocation(BaseModel): - allows_rollover: bool - - currency: str - - -class TieredPriceInvoicingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class TieredPriceItem(BaseModel): - id: str - - name: str - - -class TieredPriceMaximum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this maximum amount applies to. - - For plan/plan phase maximums, this can be a subset of prices. - """ - - maximum_amount: str - """Maximum amount applied""" - - -class TieredPriceMinimum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this minimum amount applies to. - - For plan/plan phase minimums, this can be a subset of prices. - """ - - minimum_amount: str - """Minimum amount applied""" - - -class TieredPriceTieredConfigTier(BaseModel): - first_unit: float - """Inclusive tier starting value""" - - unit_amount: str - """Amount per unit""" - - last_unit: Optional[float] = None - """Exclusive tier ending value. If null, this is treated as the last tier""" - - -class TieredPriceTieredConfig(BaseModel): - tiers: List[TieredPriceTieredConfigTier] - """Tiers for rating based on total usage quantities into the specified tier""" - - -class TieredPriceDimensionalPriceConfiguration(BaseModel): - dimension_values: List[str] - - dimensional_price_group_id: str - - -class TieredPrice(BaseModel): - id: str - - billable_metric: Optional[TieredPriceBillableMetric] = None - - billing_cycle_configuration: TieredPriceBillingCycleConfiguration - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[TieredPriceCreditAllocation] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - invoicing_cycle_configuration: Optional[TieredPriceInvoicingCycleConfiguration] = None - - item: TieredPriceItem - - maximum: Optional[TieredPriceMaximum] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[TieredPriceMinimum] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["tiered"] = FieldInfo(alias="model_type") - - name: str - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - tiered_config: TieredPriceTieredConfig - - dimensional_price_configuration: Optional[TieredPriceDimensionalPriceConfiguration] = None - - -class TieredBpsPriceBillableMetric(BaseModel): - id: str - - -class TieredBpsPriceBillingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class TieredBpsPriceCreditAllocation(BaseModel): - allows_rollover: bool - - currency: str - - -class TieredBpsPriceInvoicingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class TieredBpsPriceItem(BaseModel): - id: str - - name: str - - -class TieredBpsPriceMaximum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this maximum amount applies to. - - For plan/plan phase maximums, this can be a subset of prices. - """ - - maximum_amount: str - """Maximum amount applied""" - - -class TieredBpsPriceMinimum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this minimum amount applies to. - - For plan/plan phase minimums, this can be a subset of prices. - """ - - minimum_amount: str - """Minimum amount applied""" - - -class TieredBpsPriceTieredBpsConfigTier(BaseModel): - bps: float - """Per-event basis point rate""" - - minimum_amount: str - """Inclusive tier starting value""" - - maximum_amount: Optional[str] = None - """Exclusive tier ending value""" - - per_unit_maximum: Optional[str] = None - """Per unit maximum to charge""" - - -class TieredBpsPriceTieredBpsConfig(BaseModel): - tiers: List[TieredBpsPriceTieredBpsConfigTier] - """ - Tiers for a Graduated BPS pricing model, where usage is bucketed into specified - tiers - """ - - -class TieredBpsPriceDimensionalPriceConfiguration(BaseModel): - dimension_values: List[str] - - dimensional_price_group_id: str - - -class TieredBpsPrice(BaseModel): - id: str - - billable_metric: Optional[TieredBpsPriceBillableMetric] = None - - billing_cycle_configuration: TieredBpsPriceBillingCycleConfiguration - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[TieredBpsPriceCreditAllocation] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - invoicing_cycle_configuration: Optional[TieredBpsPriceInvoicingCycleConfiguration] = None - - item: TieredBpsPriceItem - - maximum: Optional[TieredBpsPriceMaximum] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[TieredBpsPriceMinimum] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["tiered_bps"] = FieldInfo(alias="model_type") - - name: str - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - tiered_bps_config: TieredBpsPriceTieredBpsConfig - - dimensional_price_configuration: Optional[TieredBpsPriceDimensionalPriceConfiguration] = None - - -class BpsPriceBillableMetric(BaseModel): - id: str - - -class BpsPriceBillingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class BpsPriceBpsConfig(BaseModel): - bps: float - """Basis point take rate per event""" - - per_unit_maximum: Optional[str] = None - """Optional currency amount maximum to cap spend per event""" - - -class BpsPriceCreditAllocation(BaseModel): - allows_rollover: bool - - currency: str - - -class BpsPriceInvoicingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class BpsPriceItem(BaseModel): - id: str - - name: str - - -class BpsPriceMaximum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this maximum amount applies to. - - For plan/plan phase maximums, this can be a subset of prices. - """ - - maximum_amount: str - """Maximum amount applied""" - - -class BpsPriceMinimum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this minimum amount applies to. - - For plan/plan phase minimums, this can be a subset of prices. - """ - - minimum_amount: str - """Minimum amount applied""" - - -class BpsPriceDimensionalPriceConfiguration(BaseModel): - dimension_values: List[str] - - dimensional_price_group_id: str - - -class BpsPrice(BaseModel): - id: str - - billable_metric: Optional[BpsPriceBillableMetric] = None - - billing_cycle_configuration: BpsPriceBillingCycleConfiguration - - bps_config: BpsPriceBpsConfig - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[BpsPriceCreditAllocation] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - invoicing_cycle_configuration: Optional[BpsPriceInvoicingCycleConfiguration] = None - - item: BpsPriceItem - - maximum: Optional[BpsPriceMaximum] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[BpsPriceMinimum] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["bps"] = FieldInfo(alias="model_type") - - name: str - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - dimensional_price_configuration: Optional[BpsPriceDimensionalPriceConfiguration] = None - - -class BulkBpsPriceBillableMetric(BaseModel): - id: str - - -class BulkBpsPriceBillingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class BulkBpsPriceBulkBpsConfigTier(BaseModel): - bps: float - """Basis points to rate on""" - - maximum_amount: Optional[str] = None - """Upper bound for tier""" - - per_unit_maximum: Optional[str] = None - """The maximum amount to charge for any one event""" - - -class BulkBpsPriceBulkBpsConfig(BaseModel): - tiers: List[BulkBpsPriceBulkBpsConfigTier] - """ - Tiers for a bulk BPS pricing model where all usage is aggregated to a single - tier based on total volume - """ - - -class BulkBpsPriceCreditAllocation(BaseModel): - allows_rollover: bool - - currency: str - - -class BulkBpsPriceInvoicingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class BulkBpsPriceItem(BaseModel): - id: str - - name: str - - -class BulkBpsPriceMaximum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this maximum amount applies to. - - For plan/plan phase maximums, this can be a subset of prices. - """ - - maximum_amount: str - """Maximum amount applied""" - - -class BulkBpsPriceMinimum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this minimum amount applies to. - - For plan/plan phase minimums, this can be a subset of prices. - """ - - minimum_amount: str - """Minimum amount applied""" - - -class BulkBpsPriceDimensionalPriceConfiguration(BaseModel): - dimension_values: List[str] - - dimensional_price_group_id: str - - -class BulkBpsPrice(BaseModel): - id: str - - billable_metric: Optional[BulkBpsPriceBillableMetric] = None - - billing_cycle_configuration: BulkBpsPriceBillingCycleConfiguration - - bulk_bps_config: BulkBpsPriceBulkBpsConfig - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[BulkBpsPriceCreditAllocation] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - invoicing_cycle_configuration: Optional[BulkBpsPriceInvoicingCycleConfiguration] = None - - item: BulkBpsPriceItem - - maximum: Optional[BulkBpsPriceMaximum] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[BulkBpsPriceMinimum] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["bulk_bps"] = FieldInfo(alias="model_type") - - name: str - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - dimensional_price_configuration: Optional[BulkBpsPriceDimensionalPriceConfiguration] = None - - -class BulkPriceBillableMetric(BaseModel): - id: str - - -class BulkPriceBillingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class BulkPriceBulkConfigTier(BaseModel): - unit_amount: str - """Amount per unit""" - - maximum_units: Optional[float] = None - """Upper bound for this tier""" - - -class BulkPriceBulkConfig(BaseModel): - tiers: List[BulkPriceBulkConfigTier] - """Bulk tiers for rating based on total usage volume""" - - -class BulkPriceCreditAllocation(BaseModel): - allows_rollover: bool - - currency: str - - -class BulkPriceInvoicingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class BulkPriceItem(BaseModel): - id: str - - name: str - - -class BulkPriceMaximum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this maximum amount applies to. - - For plan/plan phase maximums, this can be a subset of prices. - """ - - maximum_amount: str - """Maximum amount applied""" - - -class BulkPriceMinimum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this minimum amount applies to. - - For plan/plan phase minimums, this can be a subset of prices. - """ - - minimum_amount: str - """Minimum amount applied""" - - -class BulkPriceDimensionalPriceConfiguration(BaseModel): - dimension_values: List[str] - - dimensional_price_group_id: str - - -class BulkPrice(BaseModel): - id: str - - billable_metric: Optional[BulkPriceBillableMetric] = None - - billing_cycle_configuration: BulkPriceBillingCycleConfiguration - - bulk_config: BulkPriceBulkConfig - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[BulkPriceCreditAllocation] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - invoicing_cycle_configuration: Optional[BulkPriceInvoicingCycleConfiguration] = None - - item: BulkPriceItem - - maximum: Optional[BulkPriceMaximum] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[BulkPriceMinimum] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["bulk"] = FieldInfo(alias="model_type") - - name: str - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - dimensional_price_configuration: Optional[BulkPriceDimensionalPriceConfiguration] = None - - -class ThresholdTotalAmountPriceBillableMetric(BaseModel): - id: str - - -class ThresholdTotalAmountPriceBillingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class ThresholdTotalAmountPriceCreditAllocation(BaseModel): - allows_rollover: bool - - currency: str - - -class ThresholdTotalAmountPriceInvoicingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class ThresholdTotalAmountPriceItem(BaseModel): - id: str - - name: str - - -class ThresholdTotalAmountPriceMaximum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this maximum amount applies to. - - For plan/plan phase maximums, this can be a subset of prices. - """ - - maximum_amount: str - """Maximum amount applied""" - - -class ThresholdTotalAmountPriceMinimum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this minimum amount applies to. - - For plan/plan phase minimums, this can be a subset of prices. - """ - - minimum_amount: str - """Minimum amount applied""" - - -class ThresholdTotalAmountPriceDimensionalPriceConfiguration(BaseModel): - dimension_values: List[str] - - dimensional_price_group_id: str - - -class ThresholdTotalAmountPrice(BaseModel): - id: str - - billable_metric: Optional[ThresholdTotalAmountPriceBillableMetric] = None - - billing_cycle_configuration: ThresholdTotalAmountPriceBillingCycleConfiguration - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[ThresholdTotalAmountPriceCreditAllocation] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - invoicing_cycle_configuration: Optional[ThresholdTotalAmountPriceInvoicingCycleConfiguration] = None - - item: ThresholdTotalAmountPriceItem - - maximum: Optional[ThresholdTotalAmountPriceMaximum] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[ThresholdTotalAmountPriceMinimum] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["threshold_total_amount"] = FieldInfo(alias="model_type") - - name: str - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - threshold_total_amount_config: Dict[str, object] - - dimensional_price_configuration: Optional[ThresholdTotalAmountPriceDimensionalPriceConfiguration] = None - - -class TieredPackagePriceBillableMetric(BaseModel): - id: str - - -class TieredPackagePriceBillingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class TieredPackagePriceCreditAllocation(BaseModel): - allows_rollover: bool - - currency: str - - -class TieredPackagePriceInvoicingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class TieredPackagePriceItem(BaseModel): - id: str - - name: str - - -class TieredPackagePriceMaximum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this maximum amount applies to. - - For plan/plan phase maximums, this can be a subset of prices. - """ - - maximum_amount: str - """Maximum amount applied""" - - -class TieredPackagePriceMinimum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this minimum amount applies to. - - For plan/plan phase minimums, this can be a subset of prices. - """ - - minimum_amount: str - """Minimum amount applied""" - - -class TieredPackagePriceDimensionalPriceConfiguration(BaseModel): - dimension_values: List[str] - - dimensional_price_group_id: str - - -class TieredPackagePrice(BaseModel): - id: str - - billable_metric: Optional[TieredPackagePriceBillableMetric] = None - - billing_cycle_configuration: TieredPackagePriceBillingCycleConfiguration - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[TieredPackagePriceCreditAllocation] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - invoicing_cycle_configuration: Optional[TieredPackagePriceInvoicingCycleConfiguration] = None - - item: TieredPackagePriceItem - - maximum: Optional[TieredPackagePriceMaximum] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[TieredPackagePriceMinimum] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["tiered_package"] = FieldInfo(alias="model_type") - - name: str - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - tiered_package_config: Dict[str, object] - - dimensional_price_configuration: Optional[TieredPackagePriceDimensionalPriceConfiguration] = None - - -class GroupedTieredPriceBillableMetric(BaseModel): - id: str - - -class GroupedTieredPriceBillingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class GroupedTieredPriceCreditAllocation(BaseModel): - allows_rollover: bool - - currency: str - - -class GroupedTieredPriceInvoicingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class GroupedTieredPriceItem(BaseModel): - id: str - - name: str - - -class GroupedTieredPriceMaximum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this maximum amount applies to. - - For plan/plan phase maximums, this can be a subset of prices. - """ - - maximum_amount: str - """Maximum amount applied""" - - -class GroupedTieredPriceMinimum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this minimum amount applies to. - - For plan/plan phase minimums, this can be a subset of prices. - """ - - minimum_amount: str - """Minimum amount applied""" - - -class GroupedTieredPriceDimensionalPriceConfiguration(BaseModel): - dimension_values: List[str] - - dimensional_price_group_id: str - - -class GroupedTieredPrice(BaseModel): - id: str - - billable_metric: Optional[GroupedTieredPriceBillableMetric] = None - - billing_cycle_configuration: GroupedTieredPriceBillingCycleConfiguration - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[GroupedTieredPriceCreditAllocation] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - grouped_tiered_config: Dict[str, object] - - invoicing_cycle_configuration: Optional[GroupedTieredPriceInvoicingCycleConfiguration] = None - - item: GroupedTieredPriceItem - - maximum: Optional[GroupedTieredPriceMaximum] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[GroupedTieredPriceMinimum] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["grouped_tiered"] = FieldInfo(alias="model_type") - - name: str - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - dimensional_price_configuration: Optional[GroupedTieredPriceDimensionalPriceConfiguration] = None - - -class TieredWithMinimumPriceBillableMetric(BaseModel): - id: str - - -class TieredWithMinimumPriceBillingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class TieredWithMinimumPriceCreditAllocation(BaseModel): - allows_rollover: bool - - currency: str - - -class TieredWithMinimumPriceInvoicingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class TieredWithMinimumPriceItem(BaseModel): - id: str - - name: str - - -class TieredWithMinimumPriceMaximum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this maximum amount applies to. - - For plan/plan phase maximums, this can be a subset of prices. - """ - - maximum_amount: str - """Maximum amount applied""" - - -class TieredWithMinimumPriceMinimum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this minimum amount applies to. - - For plan/plan phase minimums, this can be a subset of prices. - """ - - minimum_amount: str - """Minimum amount applied""" - - -class TieredWithMinimumPriceDimensionalPriceConfiguration(BaseModel): - dimension_values: List[str] - - dimensional_price_group_id: str - - -class TieredWithMinimumPrice(BaseModel): - id: str - - billable_metric: Optional[TieredWithMinimumPriceBillableMetric] = None - - billing_cycle_configuration: TieredWithMinimumPriceBillingCycleConfiguration - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[TieredWithMinimumPriceCreditAllocation] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - invoicing_cycle_configuration: Optional[TieredWithMinimumPriceInvoicingCycleConfiguration] = None - - item: TieredWithMinimumPriceItem - - maximum: Optional[TieredWithMinimumPriceMaximum] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[TieredWithMinimumPriceMinimum] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["tiered_with_minimum"] = FieldInfo(alias="model_type") - - name: str - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - tiered_with_minimum_config: Dict[str, object] - - dimensional_price_configuration: Optional[TieredWithMinimumPriceDimensionalPriceConfiguration] = None - - -class TieredPackageWithMinimumPriceBillableMetric(BaseModel): - id: str - - -class TieredPackageWithMinimumPriceBillingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class TieredPackageWithMinimumPriceCreditAllocation(BaseModel): - allows_rollover: bool - - currency: str - - -class TieredPackageWithMinimumPriceInvoicingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class TieredPackageWithMinimumPriceItem(BaseModel): - id: str - - name: str - - -class TieredPackageWithMinimumPriceMaximum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this maximum amount applies to. - - For plan/plan phase maximums, this can be a subset of prices. - """ - - maximum_amount: str - """Maximum amount applied""" - - -class TieredPackageWithMinimumPriceMinimum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this minimum amount applies to. - - For plan/plan phase minimums, this can be a subset of prices. - """ - - minimum_amount: str - """Minimum amount applied""" - - -class TieredPackageWithMinimumPriceDimensionalPriceConfiguration(BaseModel): - dimension_values: List[str] - - dimensional_price_group_id: str - - -class TieredPackageWithMinimumPrice(BaseModel): - id: str - - billable_metric: Optional[TieredPackageWithMinimumPriceBillableMetric] = None - - billing_cycle_configuration: TieredPackageWithMinimumPriceBillingCycleConfiguration - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[TieredPackageWithMinimumPriceCreditAllocation] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - invoicing_cycle_configuration: Optional[TieredPackageWithMinimumPriceInvoicingCycleConfiguration] = None - - item: TieredPackageWithMinimumPriceItem - - maximum: Optional[TieredPackageWithMinimumPriceMaximum] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[TieredPackageWithMinimumPriceMinimum] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["tiered_package_with_minimum"] = FieldInfo(alias="model_type") - - name: str - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - tiered_package_with_minimum_config: Dict[str, object] - - dimensional_price_configuration: Optional[TieredPackageWithMinimumPriceDimensionalPriceConfiguration] = None - - -class PackageWithAllocationPriceBillableMetric(BaseModel): - id: str - - -class PackageWithAllocationPriceBillingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class PackageWithAllocationPriceCreditAllocation(BaseModel): - allows_rollover: bool - - currency: str - - -class PackageWithAllocationPriceInvoicingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class PackageWithAllocationPriceItem(BaseModel): - id: str - - name: str - - -class PackageWithAllocationPriceMaximum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this maximum amount applies to. - - For plan/plan phase maximums, this can be a subset of prices. - """ - - maximum_amount: str - """Maximum amount applied""" - - -class PackageWithAllocationPriceMinimum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this minimum amount applies to. - - For plan/plan phase minimums, this can be a subset of prices. - """ - - minimum_amount: str - """Minimum amount applied""" - - -class PackageWithAllocationPriceDimensionalPriceConfiguration(BaseModel): - dimension_values: List[str] - - dimensional_price_group_id: str - - -class PackageWithAllocationPrice(BaseModel): - id: str - - billable_metric: Optional[PackageWithAllocationPriceBillableMetric] = None - - billing_cycle_configuration: PackageWithAllocationPriceBillingCycleConfiguration - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[PackageWithAllocationPriceCreditAllocation] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - invoicing_cycle_configuration: Optional[PackageWithAllocationPriceInvoicingCycleConfiguration] = None - - item: PackageWithAllocationPriceItem - - maximum: Optional[PackageWithAllocationPriceMaximum] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[PackageWithAllocationPriceMinimum] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["package_with_allocation"] = FieldInfo(alias="model_type") - - name: str - - package_with_allocation_config: Dict[str, object] - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - dimensional_price_configuration: Optional[PackageWithAllocationPriceDimensionalPriceConfiguration] = None - - -class UnitWithPercentPriceBillableMetric(BaseModel): - id: str - - -class UnitWithPercentPriceBillingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class UnitWithPercentPriceCreditAllocation(BaseModel): - allows_rollover: bool - - currency: str - - -class UnitWithPercentPriceInvoicingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class UnitWithPercentPriceItem(BaseModel): - id: str - - name: str - - -class UnitWithPercentPriceMaximum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this maximum amount applies to. - - For plan/plan phase maximums, this can be a subset of prices. - """ - - maximum_amount: str - """Maximum amount applied""" - - -class UnitWithPercentPriceMinimum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this minimum amount applies to. - - For plan/plan phase minimums, this can be a subset of prices. - """ - - minimum_amount: str - """Minimum amount applied""" - - -class UnitWithPercentPriceDimensionalPriceConfiguration(BaseModel): - dimension_values: List[str] - - dimensional_price_group_id: str - - -class UnitWithPercentPrice(BaseModel): - id: str - - billable_metric: Optional[UnitWithPercentPriceBillableMetric] = None - - billing_cycle_configuration: UnitWithPercentPriceBillingCycleConfiguration - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[UnitWithPercentPriceCreditAllocation] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - invoicing_cycle_configuration: Optional[UnitWithPercentPriceInvoicingCycleConfiguration] = None - - item: UnitWithPercentPriceItem - - maximum: Optional[UnitWithPercentPriceMaximum] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[UnitWithPercentPriceMinimum] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["unit_with_percent"] = FieldInfo(alias="model_type") - - name: str - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - unit_with_percent_config: Dict[str, object] - - dimensional_price_configuration: Optional[UnitWithPercentPriceDimensionalPriceConfiguration] = None - - -class MatrixWithAllocationPriceBillableMetric(BaseModel): - id: str - - -class MatrixWithAllocationPriceBillingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class MatrixWithAllocationPriceCreditAllocation(BaseModel): - allows_rollover: bool - - currency: str - - -class MatrixWithAllocationPriceInvoicingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class MatrixWithAllocationPriceItem(BaseModel): - id: str - - name: str - - -class MatrixWithAllocationPriceMatrixWithAllocationConfigMatrixValue(BaseModel): - dimension_values: List[Optional[str]] - """One or two matrix keys to filter usage to this Matrix value by. - - For example, ["region", "tier"] could be used to filter cloud usage by a cloud - region and an instance tier. - """ - - unit_amount: str - """Unit price for the specified dimension_values""" - - -class MatrixWithAllocationPriceMatrixWithAllocationConfig(BaseModel): - allocation: float - """Allocation to be used to calculate the price""" - - default_unit_amount: str - """Default per unit rate for any usage not bucketed into a specified matrix_value""" - - dimensions: List[Optional[str]] - """One or two event property values to evaluate matrix groups by""" - - matrix_values: List[MatrixWithAllocationPriceMatrixWithAllocationConfigMatrixValue] - """Matrix values for specified matrix grouping keys""" - - -class MatrixWithAllocationPriceMaximum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this maximum amount applies to. - - For plan/plan phase maximums, this can be a subset of prices. - """ - - maximum_amount: str - """Maximum amount applied""" - - -class MatrixWithAllocationPriceMinimum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this minimum amount applies to. - - For plan/plan phase minimums, this can be a subset of prices. - """ - - minimum_amount: str - """Minimum amount applied""" - - -class MatrixWithAllocationPriceDimensionalPriceConfiguration(BaseModel): - dimension_values: List[str] - - dimensional_price_group_id: str - - -class MatrixWithAllocationPrice(BaseModel): - id: str - - billable_metric: Optional[MatrixWithAllocationPriceBillableMetric] = None - - billing_cycle_configuration: MatrixWithAllocationPriceBillingCycleConfiguration - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[MatrixWithAllocationPriceCreditAllocation] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - invoicing_cycle_configuration: Optional[MatrixWithAllocationPriceInvoicingCycleConfiguration] = None - - item: MatrixWithAllocationPriceItem - - matrix_with_allocation_config: MatrixWithAllocationPriceMatrixWithAllocationConfig - - maximum: Optional[MatrixWithAllocationPriceMaximum] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[MatrixWithAllocationPriceMinimum] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["matrix_with_allocation"] = FieldInfo(alias="model_type") - - name: str - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - dimensional_price_configuration: Optional[MatrixWithAllocationPriceDimensionalPriceConfiguration] = None - - -class TieredWithProrationPriceBillableMetric(BaseModel): - id: str - - -class TieredWithProrationPriceBillingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class TieredWithProrationPriceCreditAllocation(BaseModel): - allows_rollover: bool - - currency: str - - -class TieredWithProrationPriceInvoicingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class TieredWithProrationPriceItem(BaseModel): - id: str - - name: str - - -class TieredWithProrationPriceMaximum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this maximum amount applies to. - - For plan/plan phase maximums, this can be a subset of prices. - """ - - maximum_amount: str - """Maximum amount applied""" - - -class TieredWithProrationPriceMinimum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this minimum amount applies to. - - For plan/plan phase minimums, this can be a subset of prices. - """ - - minimum_amount: str - """Minimum amount applied""" - - -class TieredWithProrationPriceDimensionalPriceConfiguration(BaseModel): - dimension_values: List[str] - - dimensional_price_group_id: str - - -class TieredWithProrationPrice(BaseModel): - id: str - - billable_metric: Optional[TieredWithProrationPriceBillableMetric] = None - - billing_cycle_configuration: TieredWithProrationPriceBillingCycleConfiguration - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[TieredWithProrationPriceCreditAllocation] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - invoicing_cycle_configuration: Optional[TieredWithProrationPriceInvoicingCycleConfiguration] = None - - item: TieredWithProrationPriceItem - - maximum: Optional[TieredWithProrationPriceMaximum] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[TieredWithProrationPriceMinimum] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["tiered_with_proration"] = FieldInfo(alias="model_type") - - name: str - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - tiered_with_proration_config: Dict[str, object] - - dimensional_price_configuration: Optional[TieredWithProrationPriceDimensionalPriceConfiguration] = None - - -class UnitWithProrationPriceBillableMetric(BaseModel): - id: str - - -class UnitWithProrationPriceBillingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class UnitWithProrationPriceCreditAllocation(BaseModel): - allows_rollover: bool - - currency: str - - -class UnitWithProrationPriceInvoicingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class UnitWithProrationPriceItem(BaseModel): - id: str - - name: str - - -class UnitWithProrationPriceMaximum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this maximum amount applies to. - - For plan/plan phase maximums, this can be a subset of prices. - """ - - maximum_amount: str - """Maximum amount applied""" - - -class UnitWithProrationPriceMinimum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this minimum amount applies to. - - For plan/plan phase minimums, this can be a subset of prices. - """ - - minimum_amount: str - """Minimum amount applied""" - - -class UnitWithProrationPriceDimensionalPriceConfiguration(BaseModel): - dimension_values: List[str] - - dimensional_price_group_id: str - - -class UnitWithProrationPrice(BaseModel): - id: str - - billable_metric: Optional[UnitWithProrationPriceBillableMetric] = None - - billing_cycle_configuration: UnitWithProrationPriceBillingCycleConfiguration - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[UnitWithProrationPriceCreditAllocation] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - invoicing_cycle_configuration: Optional[UnitWithProrationPriceInvoicingCycleConfiguration] = None - - item: UnitWithProrationPriceItem - - maximum: Optional[UnitWithProrationPriceMaximum] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[UnitWithProrationPriceMinimum] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["unit_with_proration"] = FieldInfo(alias="model_type") - - name: str - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - unit_with_proration_config: Dict[str, object] - - dimensional_price_configuration: Optional[UnitWithProrationPriceDimensionalPriceConfiguration] = None - - -class GroupedAllocationPriceBillableMetric(BaseModel): - id: str - - -class GroupedAllocationPriceBillingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class GroupedAllocationPriceCreditAllocation(BaseModel): - allows_rollover: bool - - currency: str - - -class GroupedAllocationPriceInvoicingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class GroupedAllocationPriceItem(BaseModel): - id: str - - name: str - - -class GroupedAllocationPriceMaximum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this maximum amount applies to. - - For plan/plan phase maximums, this can be a subset of prices. - """ - - maximum_amount: str - """Maximum amount applied""" - - -class GroupedAllocationPriceMinimum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this minimum amount applies to. - - For plan/plan phase minimums, this can be a subset of prices. - """ - - minimum_amount: str - """Minimum amount applied""" - - -class GroupedAllocationPriceDimensionalPriceConfiguration(BaseModel): - dimension_values: List[str] - - dimensional_price_group_id: str - - -class GroupedAllocationPrice(BaseModel): - id: str - - billable_metric: Optional[GroupedAllocationPriceBillableMetric] = None - - billing_cycle_configuration: GroupedAllocationPriceBillingCycleConfiguration - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[GroupedAllocationPriceCreditAllocation] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - grouped_allocation_config: Dict[str, object] - - invoicing_cycle_configuration: Optional[GroupedAllocationPriceInvoicingCycleConfiguration] = None - - item: GroupedAllocationPriceItem - - maximum: Optional[GroupedAllocationPriceMaximum] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[GroupedAllocationPriceMinimum] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["grouped_allocation"] = FieldInfo(alias="model_type") - - name: str - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - dimensional_price_configuration: Optional[GroupedAllocationPriceDimensionalPriceConfiguration] = None - - -class GroupedWithProratedMinimumPriceBillableMetric(BaseModel): - id: str - - -class GroupedWithProratedMinimumPriceBillingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class GroupedWithProratedMinimumPriceCreditAllocation(BaseModel): - allows_rollover: bool - - currency: str - - -class GroupedWithProratedMinimumPriceInvoicingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class GroupedWithProratedMinimumPriceItem(BaseModel): - id: str - - name: str - - -class GroupedWithProratedMinimumPriceMaximum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this maximum amount applies to. - - For plan/plan phase maximums, this can be a subset of prices. - """ - - maximum_amount: str - """Maximum amount applied""" - - -class GroupedWithProratedMinimumPriceMinimum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this minimum amount applies to. - - For plan/plan phase minimums, this can be a subset of prices. - """ - - minimum_amount: str - """Minimum amount applied""" - - -class GroupedWithProratedMinimumPriceDimensionalPriceConfiguration(BaseModel): - dimension_values: List[str] - - dimensional_price_group_id: str - - -class GroupedWithProratedMinimumPrice(BaseModel): - id: str - - billable_metric: Optional[GroupedWithProratedMinimumPriceBillableMetric] = None - - billing_cycle_configuration: GroupedWithProratedMinimumPriceBillingCycleConfiguration - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[GroupedWithProratedMinimumPriceCreditAllocation] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - grouped_with_prorated_minimum_config: Dict[str, object] - - invoicing_cycle_configuration: Optional[GroupedWithProratedMinimumPriceInvoicingCycleConfiguration] = None - - item: GroupedWithProratedMinimumPriceItem - - maximum: Optional[GroupedWithProratedMinimumPriceMaximum] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[GroupedWithProratedMinimumPriceMinimum] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["grouped_with_prorated_minimum"] = FieldInfo(alias="model_type") - - name: str - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - dimensional_price_configuration: Optional[GroupedWithProratedMinimumPriceDimensionalPriceConfiguration] = None - - -class GroupedWithMeteredMinimumPriceBillableMetric(BaseModel): - id: str - - -class GroupedWithMeteredMinimumPriceBillingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class GroupedWithMeteredMinimumPriceCreditAllocation(BaseModel): - allows_rollover: bool - - currency: str - - -class GroupedWithMeteredMinimumPriceInvoicingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class GroupedWithMeteredMinimumPriceItem(BaseModel): - id: str - - name: str - - -class GroupedWithMeteredMinimumPriceMaximum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this maximum amount applies to. - - For plan/plan phase maximums, this can be a subset of prices. - """ - - maximum_amount: str - """Maximum amount applied""" - - -class GroupedWithMeteredMinimumPriceMinimum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this minimum amount applies to. - - For plan/plan phase minimums, this can be a subset of prices. - """ - - minimum_amount: str - """Minimum amount applied""" - - -class GroupedWithMeteredMinimumPriceDimensionalPriceConfiguration(BaseModel): - dimension_values: List[str] - - dimensional_price_group_id: str - - -class GroupedWithMeteredMinimumPrice(BaseModel): - id: str - - billable_metric: Optional[GroupedWithMeteredMinimumPriceBillableMetric] = None - - billing_cycle_configuration: GroupedWithMeteredMinimumPriceBillingCycleConfiguration - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[GroupedWithMeteredMinimumPriceCreditAllocation] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - grouped_with_metered_minimum_config: Dict[str, object] - - invoicing_cycle_configuration: Optional[GroupedWithMeteredMinimumPriceInvoicingCycleConfiguration] = None - - item: GroupedWithMeteredMinimumPriceItem - - maximum: Optional[GroupedWithMeteredMinimumPriceMaximum] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[GroupedWithMeteredMinimumPriceMinimum] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["grouped_with_metered_minimum"] = FieldInfo(alias="model_type") - - name: str - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - dimensional_price_configuration: Optional[GroupedWithMeteredMinimumPriceDimensionalPriceConfiguration] = None - - -class MatrixWithDisplayNamePriceBillableMetric(BaseModel): - id: str - - -class MatrixWithDisplayNamePriceBillingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class MatrixWithDisplayNamePriceCreditAllocation(BaseModel): - allows_rollover: bool - - currency: str - - -class MatrixWithDisplayNamePriceInvoicingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class MatrixWithDisplayNamePriceItem(BaseModel): - id: str - - name: str - - -class MatrixWithDisplayNamePriceMaximum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this maximum amount applies to. - - For plan/plan phase maximums, this can be a subset of prices. - """ - - maximum_amount: str - """Maximum amount applied""" - - -class MatrixWithDisplayNamePriceMinimum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this minimum amount applies to. - - For plan/plan phase minimums, this can be a subset of prices. - """ - - minimum_amount: str - """Minimum amount applied""" - - -class MatrixWithDisplayNamePriceDimensionalPriceConfiguration(BaseModel): - dimension_values: List[str] - - dimensional_price_group_id: str - - -class MatrixWithDisplayNamePrice(BaseModel): - id: str - - billable_metric: Optional[MatrixWithDisplayNamePriceBillableMetric] = None - - billing_cycle_configuration: MatrixWithDisplayNamePriceBillingCycleConfiguration - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[MatrixWithDisplayNamePriceCreditAllocation] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - invoicing_cycle_configuration: Optional[MatrixWithDisplayNamePriceInvoicingCycleConfiguration] = None - - item: MatrixWithDisplayNamePriceItem - - matrix_with_display_name_config: Dict[str, object] - - maximum: Optional[MatrixWithDisplayNamePriceMaximum] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[MatrixWithDisplayNamePriceMinimum] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["matrix_with_display_name"] = FieldInfo(alias="model_type") - - name: str - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - dimensional_price_configuration: Optional[MatrixWithDisplayNamePriceDimensionalPriceConfiguration] = None - - -class BulkWithProrationPriceBillableMetric(BaseModel): - id: str - - -class BulkWithProrationPriceBillingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class BulkWithProrationPriceCreditAllocation(BaseModel): - allows_rollover: bool - - currency: str - - -class BulkWithProrationPriceInvoicingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class BulkWithProrationPriceItem(BaseModel): - id: str - - name: str - - -class BulkWithProrationPriceMaximum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this maximum amount applies to. - - For plan/plan phase maximums, this can be a subset of prices. - """ - - maximum_amount: str - """Maximum amount applied""" - - -class BulkWithProrationPriceMinimum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this minimum amount applies to. - - For plan/plan phase minimums, this can be a subset of prices. - """ - - minimum_amount: str - """Minimum amount applied""" - - -class BulkWithProrationPriceDimensionalPriceConfiguration(BaseModel): - dimension_values: List[str] - - dimensional_price_group_id: str - - -class BulkWithProrationPrice(BaseModel): - id: str - - billable_metric: Optional[BulkWithProrationPriceBillableMetric] = None - - billing_cycle_configuration: BulkWithProrationPriceBillingCycleConfiguration - - bulk_with_proration_config: Dict[str, object] - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[BulkWithProrationPriceCreditAllocation] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - invoicing_cycle_configuration: Optional[BulkWithProrationPriceInvoicingCycleConfiguration] = None - - item: BulkWithProrationPriceItem - - maximum: Optional[BulkWithProrationPriceMaximum] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[BulkWithProrationPriceMinimum] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["bulk_with_proration"] = FieldInfo(alias="model_type") - - name: str - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - dimensional_price_configuration: Optional[BulkWithProrationPriceDimensionalPriceConfiguration] = None - - -class GroupedTieredPackagePriceBillableMetric(BaseModel): - id: str - - -class GroupedTieredPackagePriceBillingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class GroupedTieredPackagePriceCreditAllocation(BaseModel): - allows_rollover: bool - - currency: str - - -class GroupedTieredPackagePriceInvoicingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class GroupedTieredPackagePriceItem(BaseModel): - id: str - - name: str - - -class GroupedTieredPackagePriceMaximum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this maximum amount applies to. - - For plan/plan phase maximums, this can be a subset of prices. - """ - - maximum_amount: str - """Maximum amount applied""" - - -class GroupedTieredPackagePriceMinimum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this minimum amount applies to. - - For plan/plan phase minimums, this can be a subset of prices. - """ - - minimum_amount: str - """Minimum amount applied""" - - -class GroupedTieredPackagePriceDimensionalPriceConfiguration(BaseModel): - dimension_values: List[str] - - dimensional_price_group_id: str - - -class GroupedTieredPackagePrice(BaseModel): - id: str - - billable_metric: Optional[GroupedTieredPackagePriceBillableMetric] = None - - billing_cycle_configuration: GroupedTieredPackagePriceBillingCycleConfiguration - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[GroupedTieredPackagePriceCreditAllocation] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - grouped_tiered_package_config: Dict[str, object] - - invoicing_cycle_configuration: Optional[GroupedTieredPackagePriceInvoicingCycleConfiguration] = None - - item: GroupedTieredPackagePriceItem - - maximum: Optional[GroupedTieredPackagePriceMaximum] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[GroupedTieredPackagePriceMinimum] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["grouped_tiered_package"] = FieldInfo(alias="model_type") - - name: str - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - dimensional_price_configuration: Optional[GroupedTieredPackagePriceDimensionalPriceConfiguration] = None - - -class MaxGroupTieredPackagePriceBillableMetric(BaseModel): - id: str - - -class MaxGroupTieredPackagePriceBillingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class MaxGroupTieredPackagePriceCreditAllocation(BaseModel): - allows_rollover: bool - - currency: str - - -class MaxGroupTieredPackagePriceInvoicingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class MaxGroupTieredPackagePriceItem(BaseModel): - id: str - - name: str - - -class MaxGroupTieredPackagePriceMaximum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this maximum amount applies to. - - For plan/plan phase maximums, this can be a subset of prices. - """ - - maximum_amount: str - """Maximum amount applied""" - - -class MaxGroupTieredPackagePriceMinimum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this minimum amount applies to. - - For plan/plan phase minimums, this can be a subset of prices. - """ - - minimum_amount: str - """Minimum amount applied""" - - -class MaxGroupTieredPackagePriceDimensionalPriceConfiguration(BaseModel): - dimension_values: List[str] - - dimensional_price_group_id: str - - -class MaxGroupTieredPackagePrice(BaseModel): - id: str - - billable_metric: Optional[MaxGroupTieredPackagePriceBillableMetric] = None - - billing_cycle_configuration: MaxGroupTieredPackagePriceBillingCycleConfiguration - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[MaxGroupTieredPackagePriceCreditAllocation] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - invoicing_cycle_configuration: Optional[MaxGroupTieredPackagePriceInvoicingCycleConfiguration] = None - - item: MaxGroupTieredPackagePriceItem - - max_group_tiered_package_config: Dict[str, object] - - maximum: Optional[MaxGroupTieredPackagePriceMaximum] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[MaxGroupTieredPackagePriceMinimum] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["max_group_tiered_package"] = FieldInfo(alias="model_type") - - name: str - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - dimensional_price_configuration: Optional[MaxGroupTieredPackagePriceDimensionalPriceConfiguration] = None - - -class ScalableMatrixWithUnitPricingPriceBillableMetric(BaseModel): - id: str - - -class ScalableMatrixWithUnitPricingPriceBillingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class ScalableMatrixWithUnitPricingPriceCreditAllocation(BaseModel): - allows_rollover: bool - - currency: str - - -class ScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class ScalableMatrixWithUnitPricingPriceItem(BaseModel): - id: str - - name: str - - -class ScalableMatrixWithUnitPricingPriceMaximum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this maximum amount applies to. - - For plan/plan phase maximums, this can be a subset of prices. - """ - - maximum_amount: str - """Maximum amount applied""" - - -class ScalableMatrixWithUnitPricingPriceMinimum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this minimum amount applies to. - - For plan/plan phase minimums, this can be a subset of prices. - """ - - minimum_amount: str - """Minimum amount applied""" - - -class ScalableMatrixWithUnitPricingPriceDimensionalPriceConfiguration(BaseModel): - dimension_values: List[str] - - dimensional_price_group_id: str - - -class ScalableMatrixWithUnitPricingPrice(BaseModel): - id: str - - billable_metric: Optional[ScalableMatrixWithUnitPricingPriceBillableMetric] = None - - billing_cycle_configuration: ScalableMatrixWithUnitPricingPriceBillingCycleConfiguration - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[ScalableMatrixWithUnitPricingPriceCreditAllocation] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - invoicing_cycle_configuration: Optional[ScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration] = None - - item: ScalableMatrixWithUnitPricingPriceItem - - maximum: Optional[ScalableMatrixWithUnitPricingPriceMaximum] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[ScalableMatrixWithUnitPricingPriceMinimum] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["scalable_matrix_with_unit_pricing"] = FieldInfo(alias="model_type") - - name: str - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - scalable_matrix_with_unit_pricing_config: Dict[str, object] - - dimensional_price_configuration: Optional[ScalableMatrixWithUnitPricingPriceDimensionalPriceConfiguration] = None - - -class ScalableMatrixWithTieredPricingPriceBillableMetric(BaseModel): - id: str - - -class ScalableMatrixWithTieredPricingPriceBillingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class ScalableMatrixWithTieredPricingPriceCreditAllocation(BaseModel): - allows_rollover: bool - - currency: str - - -class ScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class ScalableMatrixWithTieredPricingPriceItem(BaseModel): - id: str - - name: str - - -class ScalableMatrixWithTieredPricingPriceMaximum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this maximum amount applies to. - - For plan/plan phase maximums, this can be a subset of prices. - """ - - maximum_amount: str - """Maximum amount applied""" - - -class ScalableMatrixWithTieredPricingPriceMinimum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this minimum amount applies to. - - For plan/plan phase minimums, this can be a subset of prices. - """ - - minimum_amount: str - """Minimum amount applied""" - - -class ScalableMatrixWithTieredPricingPriceDimensionalPriceConfiguration(BaseModel): - dimension_values: List[str] - - dimensional_price_group_id: str - - -class ScalableMatrixWithTieredPricingPrice(BaseModel): - id: str - - billable_metric: Optional[ScalableMatrixWithTieredPricingPriceBillableMetric] = None - - billing_cycle_configuration: ScalableMatrixWithTieredPricingPriceBillingCycleConfiguration - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[ScalableMatrixWithTieredPricingPriceCreditAllocation] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - invoicing_cycle_configuration: Optional[ScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration] = None - - item: ScalableMatrixWithTieredPricingPriceItem - - maximum: Optional[ScalableMatrixWithTieredPricingPriceMaximum] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[ScalableMatrixWithTieredPricingPriceMinimum] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["scalable_matrix_with_tiered_pricing"] = FieldInfo(alias="model_type") - - name: str - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - scalable_matrix_with_tiered_pricing_config: Dict[str, object] - - dimensional_price_configuration: Optional[ScalableMatrixWithTieredPricingPriceDimensionalPriceConfiguration] = None - - -class CumulativeGroupedBulkPriceBillableMetric(BaseModel): - id: str - - -class CumulativeGroupedBulkPriceBillingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class CumulativeGroupedBulkPriceCreditAllocation(BaseModel): - allows_rollover: bool - - currency: str - - -class CumulativeGroupedBulkPriceInvoicingCycleConfiguration(BaseModel): - duration: int - - duration_unit: Literal["day", "month"] - - -class CumulativeGroupedBulkPriceItem(BaseModel): - id: str - - name: str - - -class CumulativeGroupedBulkPriceMaximum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this maximum amount applies to. - - For plan/plan phase maximums, this can be a subset of prices. - """ - - maximum_amount: str - """Maximum amount applied""" - - -class CumulativeGroupedBulkPriceMinimum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this minimum amount applies to. - - For plan/plan phase minimums, this can be a subset of prices. - """ - - minimum_amount: str - """Minimum amount applied""" - - -class CumulativeGroupedBulkPriceDimensionalPriceConfiguration(BaseModel): - dimension_values: List[str] - - dimensional_price_group_id: str - - -class CumulativeGroupedBulkPrice(BaseModel): - id: str - - billable_metric: Optional[CumulativeGroupedBulkPriceBillableMetric] = None - - billing_cycle_configuration: CumulativeGroupedBulkPriceBillingCycleConfiguration - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - created_at: datetime - - credit_allocation: Optional[CumulativeGroupedBulkPriceCreditAllocation] = None - - cumulative_grouped_bulk_config: Dict[str, object] - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - invoicing_cycle_configuration: Optional[CumulativeGroupedBulkPriceInvoicingCycleConfiguration] = None - - item: CumulativeGroupedBulkPriceItem - - maximum: Optional[CumulativeGroupedBulkPriceMaximum] = None - - maximum_amount: Optional[str] = None - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum: Optional[CumulativeGroupedBulkPriceMinimum] = None - - minimum_amount: Optional[str] = None - - price_model_type: Literal["cumulative_grouped_bulk"] = FieldInfo(alias="model_type") - - name: str - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - dimensional_price_configuration: Optional[CumulativeGroupedBulkPriceDimensionalPriceConfiguration] = None - - -Price: TypeAlias = Annotated[ - Union[ - UnitPrice, - PackagePrice, - MatrixPrice, - TieredPrice, - TieredBpsPrice, - BpsPrice, - BulkBpsPrice, - BulkPrice, - ThresholdTotalAmountPrice, - TieredPackagePrice, - GroupedTieredPrice, - TieredWithMinimumPrice, - TieredPackageWithMinimumPrice, - PackageWithAllocationPrice, - UnitWithPercentPrice, - MatrixWithAllocationPrice, - TieredWithProrationPrice, - UnitWithProrationPrice, - GroupedAllocationPrice, - GroupedWithProratedMinimumPrice, - GroupedWithMeteredMinimumPrice, - MatrixWithDisplayNamePrice, - BulkWithProrationPrice, - GroupedTieredPackagePrice, - MaxGroupTieredPackagePrice, - ScalableMatrixWithUnitPricingPrice, - ScalableMatrixWithTieredPricingPrice, - CumulativeGroupedBulkPrice, - ], - PropertyInfo(discriminator="price_model_type"), -] diff --git a/src/orb/types/price_create_params.py b/src/orb/types/price_create_params.py index 3c41a7db..f4998dfb 100644 --- a/src/orb/types/price_create_params.py +++ b/src/orb/types/price_create_params.py @@ -2,110 +2,51 @@ from __future__ import annotations -from typing import Dict, List, Union, Iterable, Optional +from typing import Dict, Union, Optional from typing_extensions import Literal, Required, TypeAlias, TypedDict +from .shared_params.bps_config_model import BpsConfigModel +from .shared_params.bulk_config_model import BulkConfigModel +from .shared_params.unit_config_model import UnitConfigModel +from .shared_params.matrix_config_model import MatrixConfigModel +from .shared_params.tiered_config_model import TieredConfigModel +from .shared_params.package_config_model import PackageConfigModel +from .shared_params.bulk_bps_config_model import BulkBpsConfigModel +from .shared_params.tiered_bps_config_model import TieredBpsConfigModel +from .shared_params.custom_rating_function_config_model import CustomRatingFunctionConfigModel +from .shared_params.matrix_with_allocation_config_model import MatrixWithAllocationConfigModel +from .shared_params.new_billing_cycle_configuration_model import NewBillingCycleConfigurationModel + __all__ = [ "PriceCreateParams", "NewFloatingUnitPrice", - "NewFloatingUnitPriceUnitConfig", - "NewFloatingUnitPriceBillingCycleConfiguration", - "NewFloatingUnitPriceInvoicingCycleConfiguration", "NewFloatingPackagePrice", - "NewFloatingPackagePricePackageConfig", - "NewFloatingPackagePriceBillingCycleConfiguration", - "NewFloatingPackagePriceInvoicingCycleConfiguration", "NewFloatingMatrixPrice", - "NewFloatingMatrixPriceMatrixConfig", - "NewFloatingMatrixPriceMatrixConfigMatrixValue", - "NewFloatingMatrixPriceBillingCycleConfiguration", - "NewFloatingMatrixPriceInvoicingCycleConfiguration", "NewFloatingMatrixWithAllocationPrice", - "NewFloatingMatrixWithAllocationPriceMatrixWithAllocationConfig", - "NewFloatingMatrixWithAllocationPriceMatrixWithAllocationConfigMatrixValue", - "NewFloatingMatrixWithAllocationPriceBillingCycleConfiguration", - "NewFloatingMatrixWithAllocationPriceInvoicingCycleConfiguration", "NewFloatingTieredPrice", - "NewFloatingTieredPriceTieredConfig", - "NewFloatingTieredPriceTieredConfigTier", - "NewFloatingTieredPriceBillingCycleConfiguration", - "NewFloatingTieredPriceInvoicingCycleConfiguration", "NewFloatingTieredBpsPrice", - "NewFloatingTieredBpsPriceTieredBpsConfig", - "NewFloatingTieredBpsPriceTieredBpsConfigTier", - "NewFloatingTieredBpsPriceBillingCycleConfiguration", - "NewFloatingTieredBpsPriceInvoicingCycleConfiguration", "NewFloatingBpsPrice", - "NewFloatingBpsPriceBpsConfig", - "NewFloatingBpsPriceBillingCycleConfiguration", - "NewFloatingBpsPriceInvoicingCycleConfiguration", "NewFloatingBulkBpsPrice", - "NewFloatingBulkBpsPriceBulkBpsConfig", - "NewFloatingBulkBpsPriceBulkBpsConfigTier", - "NewFloatingBulkBpsPriceBillingCycleConfiguration", - "NewFloatingBulkBpsPriceInvoicingCycleConfiguration", "NewFloatingBulkPrice", - "NewFloatingBulkPriceBulkConfig", - "NewFloatingBulkPriceBulkConfigTier", - "NewFloatingBulkPriceBillingCycleConfiguration", - "NewFloatingBulkPriceInvoicingCycleConfiguration", "NewFloatingThresholdTotalAmountPrice", - "NewFloatingThresholdTotalAmountPriceBillingCycleConfiguration", - "NewFloatingThresholdTotalAmountPriceInvoicingCycleConfiguration", "NewFloatingTieredPackagePrice", - "NewFloatingTieredPackagePriceBillingCycleConfiguration", - "NewFloatingTieredPackagePriceInvoicingCycleConfiguration", "NewFloatingGroupedTieredPrice", - "NewFloatingGroupedTieredPriceBillingCycleConfiguration", - "NewFloatingGroupedTieredPriceInvoicingCycleConfiguration", "NewFloatingMaxGroupTieredPackagePrice", - "NewFloatingMaxGroupTieredPackagePriceBillingCycleConfiguration", - "NewFloatingMaxGroupTieredPackagePriceInvoicingCycleConfiguration", "NewFloatingTieredWithMinimumPrice", - "NewFloatingTieredWithMinimumPriceBillingCycleConfiguration", - "NewFloatingTieredWithMinimumPriceInvoicingCycleConfiguration", "NewFloatingPackageWithAllocationPrice", - "NewFloatingPackageWithAllocationPriceBillingCycleConfiguration", - "NewFloatingPackageWithAllocationPriceInvoicingCycleConfiguration", "NewFloatingTieredPackageWithMinimumPrice", - "NewFloatingTieredPackageWithMinimumPriceBillingCycleConfiguration", - "NewFloatingTieredPackageWithMinimumPriceInvoicingCycleConfiguration", "NewFloatingUnitWithPercentPrice", - "NewFloatingUnitWithPercentPriceBillingCycleConfiguration", - "NewFloatingUnitWithPercentPriceInvoicingCycleConfiguration", "NewFloatingTieredWithProrationPrice", - "NewFloatingTieredWithProrationPriceBillingCycleConfiguration", - "NewFloatingTieredWithProrationPriceInvoicingCycleConfiguration", "NewFloatingUnitWithProrationPrice", - "NewFloatingUnitWithProrationPriceBillingCycleConfiguration", - "NewFloatingUnitWithProrationPriceInvoicingCycleConfiguration", "NewFloatingGroupedAllocationPrice", - "NewFloatingGroupedAllocationPriceBillingCycleConfiguration", - "NewFloatingGroupedAllocationPriceInvoicingCycleConfiguration", "NewFloatingGroupedWithProratedMinimumPrice", - "NewFloatingGroupedWithProratedMinimumPriceBillingCycleConfiguration", - "NewFloatingGroupedWithProratedMinimumPriceInvoicingCycleConfiguration", "NewFloatingGroupedWithMeteredMinimumPrice", - "NewFloatingGroupedWithMeteredMinimumPriceBillingCycleConfiguration", - "NewFloatingGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration", "NewFloatingMatrixWithDisplayNamePrice", - "NewFloatingMatrixWithDisplayNamePriceBillingCycleConfiguration", - "NewFloatingMatrixWithDisplayNamePriceInvoicingCycleConfiguration", "NewFloatingBulkWithProrationPrice", - "NewFloatingBulkWithProrationPriceBillingCycleConfiguration", - "NewFloatingBulkWithProrationPriceInvoicingCycleConfiguration", "NewFloatingGroupedTieredPackagePrice", - "NewFloatingGroupedTieredPackagePriceBillingCycleConfiguration", - "NewFloatingGroupedTieredPackagePriceInvoicingCycleConfiguration", "NewFloatingScalableMatrixWithUnitPricingPrice", - "NewFloatingScalableMatrixWithUnitPricingPriceBillingCycleConfiguration", - "NewFloatingScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration", "NewFloatingScalableMatrixWithTieredPricingPrice", - "NewFloatingScalableMatrixWithTieredPricingPriceBillingCycleConfiguration", - "NewFloatingScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration", "NewFloatingCumulativeGroupedBulkPrice", - "NewFloatingCumulativeGroupedBulkPriceBillingCycleConfiguration", - "NewFloatingCumulativeGroupedBulkPriceInvoicingCycleConfiguration", ] @@ -124,7 +65,7 @@ class NewFloatingUnitPrice(TypedDict, total=False): name: Required[str] """The name of the price.""" - unit_config: Required[NewFloatingUnitPriceUnitConfig] + unit_config: Required[UnitConfigModel] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -138,7 +79,7 @@ class NewFloatingUnitPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewFloatingUnitPriceBillingCycleConfiguration] + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -159,7 +100,7 @@ class NewFloatingUnitPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewFloatingUnitPriceInvoicingCycleConfiguration] + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -173,27 +114,6 @@ class NewFloatingUnitPrice(TypedDict, total=False): """ -class NewFloatingUnitPriceUnitConfig(TypedDict, total=False): - unit_amount: Required[str] - """Rate per unit of usage""" - - -class NewFloatingUnitPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class NewFloatingUnitPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - class NewFloatingPackagePrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -209,7 +129,7 @@ class NewFloatingPackagePrice(TypedDict, total=False): name: Required[str] """The name of the price.""" - package_config: Required[NewFloatingPackagePricePackageConfig] + package_config: Required[PackageConfigModel] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -223,7 +143,7 @@ class NewFloatingPackagePrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewFloatingPackagePriceBillingCycleConfiguration] + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -244,7 +164,7 @@ class NewFloatingPackagePrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewFloatingPackagePriceInvoicingCycleConfiguration] + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -258,34 +178,6 @@ class NewFloatingPackagePrice(TypedDict, total=False): """ -class NewFloatingPackagePricePackageConfig(TypedDict, total=False): - package_amount: Required[str] - """A currency amount to rate usage by""" - - package_size: Required[int] - """An integer amount to represent package size. - - For example, 1000 here would divide usage by 1000 before multiplying by - package_amount in rating - """ - - -class NewFloatingPackagePriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class NewFloatingPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - class NewFloatingMatrixPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -296,7 +188,7 @@ class NewFloatingMatrixPrice(TypedDict, total=False): item_id: Required[str] """The id of the item the price will be associated with.""" - matrix_config: Required[NewFloatingMatrixPriceMatrixConfig] + matrix_config: Required[MatrixConfigModel] model_type: Required[Literal["matrix"]] @@ -315,7 +207,7 @@ class NewFloatingMatrixPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewFloatingMatrixPriceBillingCycleConfiguration] + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -336,7 +228,7 @@ class NewFloatingMatrixPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewFloatingMatrixPriceInvoicingCycleConfiguration] + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -350,45 +242,6 @@ class NewFloatingMatrixPrice(TypedDict, total=False): """ -class NewFloatingMatrixPriceMatrixConfigMatrixValue(TypedDict, total=False): - dimension_values: Required[List[Optional[str]]] - """One or two matrix keys to filter usage to this Matrix value by. - - For example, ["region", "tier"] could be used to filter cloud usage by a cloud - region and an instance tier. - """ - - unit_amount: Required[str] - """Unit price for the specified dimension_values""" - - -class NewFloatingMatrixPriceMatrixConfig(TypedDict, total=False): - default_unit_amount: Required[str] - """Default per unit rate for any usage not bucketed into a specified matrix_value""" - - dimensions: Required[List[Optional[str]]] - """One or two event property values to evaluate matrix groups by""" - - matrix_values: Required[Iterable[NewFloatingMatrixPriceMatrixConfigMatrixValue]] - """Matrix values for specified matrix grouping keys""" - - -class NewFloatingMatrixPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class NewFloatingMatrixPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - class NewFloatingMatrixWithAllocationPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -399,7 +252,7 @@ class NewFloatingMatrixWithAllocationPrice(TypedDict, total=False): item_id: Required[str] """The id of the item the price will be associated with.""" - matrix_with_allocation_config: Required[NewFloatingMatrixWithAllocationPriceMatrixWithAllocationConfig] + matrix_with_allocation_config: Required[MatrixWithAllocationConfigModel] model_type: Required[Literal["matrix_with_allocation"]] @@ -418,7 +271,7 @@ class NewFloatingMatrixWithAllocationPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewFloatingMatrixWithAllocationPriceBillingCycleConfiguration] + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -439,7 +292,7 @@ class NewFloatingMatrixWithAllocationPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewFloatingMatrixWithAllocationPriceInvoicingCycleConfiguration] + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -453,48 +306,6 @@ class NewFloatingMatrixWithAllocationPrice(TypedDict, total=False): """ -class NewFloatingMatrixWithAllocationPriceMatrixWithAllocationConfigMatrixValue(TypedDict, total=False): - dimension_values: Required[List[Optional[str]]] - """One or two matrix keys to filter usage to this Matrix value by. - - For example, ["region", "tier"] could be used to filter cloud usage by a cloud - region and an instance tier. - """ - - unit_amount: Required[str] - """Unit price for the specified dimension_values""" - - -class NewFloatingMatrixWithAllocationPriceMatrixWithAllocationConfig(TypedDict, total=False): - allocation: Required[float] - """Allocation to be used to calculate the price""" - - default_unit_amount: Required[str] - """Default per unit rate for any usage not bucketed into a specified matrix_value""" - - dimensions: Required[List[Optional[str]]] - """One or two event property values to evaluate matrix groups by""" - - matrix_values: Required[Iterable[NewFloatingMatrixWithAllocationPriceMatrixWithAllocationConfigMatrixValue]] - """Matrix values for specified matrix grouping keys""" - - -class NewFloatingMatrixWithAllocationPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class NewFloatingMatrixWithAllocationPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - class NewFloatingTieredPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -510,7 +321,7 @@ class NewFloatingTieredPrice(TypedDict, total=False): name: Required[str] """The name of the price.""" - tiered_config: Required[NewFloatingTieredPriceTieredConfig] + tiered_config: Required[TieredConfigModel] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -524,7 +335,7 @@ class NewFloatingTieredPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewFloatingTieredPriceBillingCycleConfiguration] + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -545,7 +356,7 @@ class NewFloatingTieredPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewFloatingTieredPriceInvoicingCycleConfiguration] + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -559,38 +370,6 @@ class NewFloatingTieredPrice(TypedDict, total=False): """ -class NewFloatingTieredPriceTieredConfigTier(TypedDict, total=False): - first_unit: Required[float] - """Inclusive tier starting value""" - - unit_amount: Required[str] - """Amount per unit""" - - last_unit: Optional[float] - """Exclusive tier ending value. If null, this is treated as the last tier""" - - -class NewFloatingTieredPriceTieredConfig(TypedDict, total=False): - tiers: Required[Iterable[NewFloatingTieredPriceTieredConfigTier]] - """Tiers for rating based on total usage quantities into the specified tier""" - - -class NewFloatingTieredPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class NewFloatingTieredPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - class NewFloatingTieredBpsPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -606,7 +385,7 @@ class NewFloatingTieredBpsPrice(TypedDict, total=False): name: Required[str] """The name of the price.""" - tiered_bps_config: Required[NewFloatingTieredBpsPriceTieredBpsConfig] + tiered_bps_config: Required[TieredBpsConfigModel] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -620,7 +399,7 @@ class NewFloatingTieredBpsPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewFloatingTieredBpsPriceBillingCycleConfiguration] + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -641,7 +420,7 @@ class NewFloatingTieredBpsPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewFloatingTieredBpsPriceInvoicingCycleConfiguration] + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -655,46 +434,8 @@ class NewFloatingTieredBpsPrice(TypedDict, total=False): """ -class NewFloatingTieredBpsPriceTieredBpsConfigTier(TypedDict, total=False): - bps: Required[float] - """Per-event basis point rate""" - - minimum_amount: Required[str] - """Inclusive tier starting value""" - - maximum_amount: Optional[str] - """Exclusive tier ending value""" - - per_unit_maximum: Optional[str] - """Per unit maximum to charge""" - - -class NewFloatingTieredBpsPriceTieredBpsConfig(TypedDict, total=False): - tiers: Required[Iterable[NewFloatingTieredBpsPriceTieredBpsConfigTier]] - """ - Tiers for a Graduated BPS pricing model, where usage is bucketed into specified - tiers - """ - - -class NewFloatingTieredBpsPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class NewFloatingTieredBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - class NewFloatingBpsPrice(TypedDict, total=False): - bps_config: Required[NewFloatingBpsPriceBpsConfig] + bps_config: Required[BpsConfigModel] cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -722,7 +463,7 @@ class NewFloatingBpsPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewFloatingBpsPriceBillingCycleConfiguration] + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -743,7 +484,7 @@ class NewFloatingBpsPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewFloatingBpsPriceInvoicingCycleConfiguration] + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -757,32 +498,8 @@ class NewFloatingBpsPrice(TypedDict, total=False): """ -class NewFloatingBpsPriceBpsConfig(TypedDict, total=False): - bps: Required[float] - """Basis point take rate per event""" - - per_unit_maximum: Optional[str] - """Optional currency amount maximum to cap spend per event""" - - -class NewFloatingBpsPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class NewFloatingBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - class NewFloatingBulkBpsPrice(TypedDict, total=False): - bulk_bps_config: Required[NewFloatingBulkBpsPriceBulkBpsConfig] + bulk_bps_config: Required[BulkBpsConfigModel] cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -810,7 +527,7 @@ class NewFloatingBulkBpsPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewFloatingBulkBpsPriceBillingCycleConfiguration] + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -831,7 +548,7 @@ class NewFloatingBulkBpsPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewFloatingBulkBpsPriceInvoicingCycleConfiguration] + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -845,43 +562,8 @@ class NewFloatingBulkBpsPrice(TypedDict, total=False): """ -class NewFloatingBulkBpsPriceBulkBpsConfigTier(TypedDict, total=False): - bps: Required[float] - """Basis points to rate on""" - - maximum_amount: Optional[str] - """Upper bound for tier""" - - per_unit_maximum: Optional[str] - """The maximum amount to charge for any one event""" - - -class NewFloatingBulkBpsPriceBulkBpsConfig(TypedDict, total=False): - tiers: Required[Iterable[NewFloatingBulkBpsPriceBulkBpsConfigTier]] - """ - Tiers for a bulk BPS pricing model where all usage is aggregated to a single - tier based on total volume - """ - - -class NewFloatingBulkBpsPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class NewFloatingBulkBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - class NewFloatingBulkPrice(TypedDict, total=False): - bulk_config: Required[NewFloatingBulkPriceBulkConfig] + bulk_config: Required[BulkConfigModel] cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -909,7 +591,7 @@ class NewFloatingBulkPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewFloatingBulkPriceBillingCycleConfiguration] + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -930,7 +612,7 @@ class NewFloatingBulkPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewFloatingBulkPriceInvoicingCycleConfiguration] + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -944,35 +626,6 @@ class NewFloatingBulkPrice(TypedDict, total=False): """ -class NewFloatingBulkPriceBulkConfigTier(TypedDict, total=False): - unit_amount: Required[str] - """Amount per unit""" - - maximum_units: Optional[float] - """Upper bound for this tier""" - - -class NewFloatingBulkPriceBulkConfig(TypedDict, total=False): - tiers: Required[Iterable[NewFloatingBulkPriceBulkConfigTier]] - """Bulk tiers for rating based on total usage volume""" - - -class NewFloatingBulkPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class NewFloatingBulkPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - class NewFloatingThresholdTotalAmountPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -988,7 +641,7 @@ class NewFloatingThresholdTotalAmountPrice(TypedDict, total=False): name: Required[str] """The name of the price.""" - threshold_total_amount_config: Required[Dict[str, object]] + threshold_total_amount_config: Required[CustomRatingFunctionConfigModel] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -1002,7 +655,7 @@ class NewFloatingThresholdTotalAmountPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewFloatingThresholdTotalAmountPriceBillingCycleConfiguration] + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -1023,7 +676,7 @@ class NewFloatingThresholdTotalAmountPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewFloatingThresholdTotalAmountPriceInvoicingCycleConfiguration] + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -1037,22 +690,6 @@ class NewFloatingThresholdTotalAmountPrice(TypedDict, total=False): """ -class NewFloatingThresholdTotalAmountPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class NewFloatingThresholdTotalAmountPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - class NewFloatingTieredPackagePrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -1068,7 +705,7 @@ class NewFloatingTieredPackagePrice(TypedDict, total=False): name: Required[str] """The name of the price.""" - tiered_package_config: Required[Dict[str, object]] + tiered_package_config: Required[CustomRatingFunctionConfigModel] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -1082,7 +719,7 @@ class NewFloatingTieredPackagePrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewFloatingTieredPackagePriceBillingCycleConfiguration] + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -1103,7 +740,7 @@ class NewFloatingTieredPackagePrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewFloatingTieredPackagePriceInvoicingCycleConfiguration] + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -1117,22 +754,6 @@ class NewFloatingTieredPackagePrice(TypedDict, total=False): """ -class NewFloatingTieredPackagePriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class NewFloatingTieredPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - class NewFloatingGroupedTieredPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -1140,7 +761,7 @@ class NewFloatingGroupedTieredPrice(TypedDict, total=False): currency: Required[str] """An ISO 4217 currency string for which this price is billed in.""" - grouped_tiered_config: Required[Dict[str, object]] + grouped_tiered_config: Required[CustomRatingFunctionConfigModel] item_id: Required[str] """The id of the item the price will be associated with.""" @@ -1162,7 +783,7 @@ class NewFloatingGroupedTieredPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewFloatingGroupedTieredPriceBillingCycleConfiguration] + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -1183,7 +804,7 @@ class NewFloatingGroupedTieredPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewFloatingGroupedTieredPriceInvoicingCycleConfiguration] + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -1197,22 +818,6 @@ class NewFloatingGroupedTieredPrice(TypedDict, total=False): """ -class NewFloatingGroupedTieredPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class NewFloatingGroupedTieredPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - class NewFloatingMaxGroupTieredPackagePrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -1223,7 +828,7 @@ class NewFloatingMaxGroupTieredPackagePrice(TypedDict, total=False): item_id: Required[str] """The id of the item the price will be associated with.""" - max_group_tiered_package_config: Required[Dict[str, object]] + max_group_tiered_package_config: Required[CustomRatingFunctionConfigModel] model_type: Required[Literal["max_group_tiered_package"]] @@ -1242,7 +847,7 @@ class NewFloatingMaxGroupTieredPackagePrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewFloatingMaxGroupTieredPackagePriceBillingCycleConfiguration] + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -1263,7 +868,7 @@ class NewFloatingMaxGroupTieredPackagePrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewFloatingMaxGroupTieredPackagePriceInvoicingCycleConfiguration] + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -1277,22 +882,6 @@ class NewFloatingMaxGroupTieredPackagePrice(TypedDict, total=False): """ -class NewFloatingMaxGroupTieredPackagePriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class NewFloatingMaxGroupTieredPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - class NewFloatingTieredWithMinimumPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -1308,7 +897,7 @@ class NewFloatingTieredWithMinimumPrice(TypedDict, total=False): name: Required[str] """The name of the price.""" - tiered_with_minimum_config: Required[Dict[str, object]] + tiered_with_minimum_config: Required[CustomRatingFunctionConfigModel] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -1322,7 +911,7 @@ class NewFloatingTieredWithMinimumPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewFloatingTieredWithMinimumPriceBillingCycleConfiguration] + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -1343,7 +932,7 @@ class NewFloatingTieredWithMinimumPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewFloatingTieredWithMinimumPriceInvoicingCycleConfiguration] + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -1357,22 +946,6 @@ class NewFloatingTieredWithMinimumPrice(TypedDict, total=False): """ -class NewFloatingTieredWithMinimumPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class NewFloatingTieredWithMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - class NewFloatingPackageWithAllocationPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -1388,7 +961,7 @@ class NewFloatingPackageWithAllocationPrice(TypedDict, total=False): name: Required[str] """The name of the price.""" - package_with_allocation_config: Required[Dict[str, object]] + package_with_allocation_config: Required[CustomRatingFunctionConfigModel] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -1402,7 +975,7 @@ class NewFloatingPackageWithAllocationPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewFloatingPackageWithAllocationPriceBillingCycleConfiguration] + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -1423,7 +996,7 @@ class NewFloatingPackageWithAllocationPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewFloatingPackageWithAllocationPriceInvoicingCycleConfiguration] + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -1437,22 +1010,6 @@ class NewFloatingPackageWithAllocationPrice(TypedDict, total=False): """ -class NewFloatingPackageWithAllocationPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class NewFloatingPackageWithAllocationPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - class NewFloatingTieredPackageWithMinimumPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -1468,7 +1025,7 @@ class NewFloatingTieredPackageWithMinimumPrice(TypedDict, total=False): name: Required[str] """The name of the price.""" - tiered_package_with_minimum_config: Required[Dict[str, object]] + tiered_package_with_minimum_config: Required[CustomRatingFunctionConfigModel] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -1482,7 +1039,7 @@ class NewFloatingTieredPackageWithMinimumPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewFloatingTieredPackageWithMinimumPriceBillingCycleConfiguration] + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -1503,7 +1060,7 @@ class NewFloatingTieredPackageWithMinimumPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewFloatingTieredPackageWithMinimumPriceInvoicingCycleConfiguration] + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -1517,22 +1074,6 @@ class NewFloatingTieredPackageWithMinimumPrice(TypedDict, total=False): """ -class NewFloatingTieredPackageWithMinimumPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class NewFloatingTieredPackageWithMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - class NewFloatingUnitWithPercentPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -1548,7 +1089,7 @@ class NewFloatingUnitWithPercentPrice(TypedDict, total=False): name: Required[str] """The name of the price.""" - unit_with_percent_config: Required[Dict[str, object]] + unit_with_percent_config: Required[CustomRatingFunctionConfigModel] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -1562,7 +1103,7 @@ class NewFloatingUnitWithPercentPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewFloatingUnitWithPercentPriceBillingCycleConfiguration] + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -1583,7 +1124,7 @@ class NewFloatingUnitWithPercentPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewFloatingUnitWithPercentPriceInvoicingCycleConfiguration] + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -1597,22 +1138,6 @@ class NewFloatingUnitWithPercentPrice(TypedDict, total=False): """ -class NewFloatingUnitWithPercentPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class NewFloatingUnitWithPercentPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - class NewFloatingTieredWithProrationPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -1628,7 +1153,7 @@ class NewFloatingTieredWithProrationPrice(TypedDict, total=False): name: Required[str] """The name of the price.""" - tiered_with_proration_config: Required[Dict[str, object]] + tiered_with_proration_config: Required[CustomRatingFunctionConfigModel] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -1642,7 +1167,7 @@ class NewFloatingTieredWithProrationPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewFloatingTieredWithProrationPriceBillingCycleConfiguration] + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -1663,7 +1188,7 @@ class NewFloatingTieredWithProrationPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewFloatingTieredWithProrationPriceInvoicingCycleConfiguration] + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -1677,22 +1202,6 @@ class NewFloatingTieredWithProrationPrice(TypedDict, total=False): """ -class NewFloatingTieredWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class NewFloatingTieredWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - class NewFloatingUnitWithProrationPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -1708,7 +1217,7 @@ class NewFloatingUnitWithProrationPrice(TypedDict, total=False): name: Required[str] """The name of the price.""" - unit_with_proration_config: Required[Dict[str, object]] + unit_with_proration_config: Required[CustomRatingFunctionConfigModel] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -1722,7 +1231,7 @@ class NewFloatingUnitWithProrationPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewFloatingUnitWithProrationPriceBillingCycleConfiguration] + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -1743,7 +1252,7 @@ class NewFloatingUnitWithProrationPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewFloatingUnitWithProrationPriceInvoicingCycleConfiguration] + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -1757,22 +1266,6 @@ class NewFloatingUnitWithProrationPrice(TypedDict, total=False): """ -class NewFloatingUnitWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class NewFloatingUnitWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - class NewFloatingGroupedAllocationPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -1780,7 +1273,7 @@ class NewFloatingGroupedAllocationPrice(TypedDict, total=False): currency: Required[str] """An ISO 4217 currency string for which this price is billed in.""" - grouped_allocation_config: Required[Dict[str, object]] + grouped_allocation_config: Required[CustomRatingFunctionConfigModel] item_id: Required[str] """The id of the item the price will be associated with.""" @@ -1802,7 +1295,7 @@ class NewFloatingGroupedAllocationPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewFloatingGroupedAllocationPriceBillingCycleConfiguration] + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -1823,7 +1316,7 @@ class NewFloatingGroupedAllocationPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewFloatingGroupedAllocationPriceInvoicingCycleConfiguration] + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -1837,22 +1330,6 @@ class NewFloatingGroupedAllocationPrice(TypedDict, total=False): """ -class NewFloatingGroupedAllocationPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class NewFloatingGroupedAllocationPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - class NewFloatingGroupedWithProratedMinimumPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -1860,7 +1337,7 @@ class NewFloatingGroupedWithProratedMinimumPrice(TypedDict, total=False): currency: Required[str] """An ISO 4217 currency string for which this price is billed in.""" - grouped_with_prorated_minimum_config: Required[Dict[str, object]] + grouped_with_prorated_minimum_config: Required[CustomRatingFunctionConfigModel] item_id: Required[str] """The id of the item the price will be associated with.""" @@ -1882,7 +1359,7 @@ class NewFloatingGroupedWithProratedMinimumPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewFloatingGroupedWithProratedMinimumPriceBillingCycleConfiguration] + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -1903,7 +1380,7 @@ class NewFloatingGroupedWithProratedMinimumPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewFloatingGroupedWithProratedMinimumPriceInvoicingCycleConfiguration] + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -1917,22 +1394,6 @@ class NewFloatingGroupedWithProratedMinimumPrice(TypedDict, total=False): """ -class NewFloatingGroupedWithProratedMinimumPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class NewFloatingGroupedWithProratedMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - class NewFloatingGroupedWithMeteredMinimumPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -1940,7 +1401,7 @@ class NewFloatingGroupedWithMeteredMinimumPrice(TypedDict, total=False): currency: Required[str] """An ISO 4217 currency string for which this price is billed in.""" - grouped_with_metered_minimum_config: Required[Dict[str, object]] + grouped_with_metered_minimum_config: Required[CustomRatingFunctionConfigModel] item_id: Required[str] """The id of the item the price will be associated with.""" @@ -1962,7 +1423,7 @@ class NewFloatingGroupedWithMeteredMinimumPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewFloatingGroupedWithMeteredMinimumPriceBillingCycleConfiguration] + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -1983,7 +1444,7 @@ class NewFloatingGroupedWithMeteredMinimumPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewFloatingGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration] + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -1997,22 +1458,6 @@ class NewFloatingGroupedWithMeteredMinimumPrice(TypedDict, total=False): """ -class NewFloatingGroupedWithMeteredMinimumPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class NewFloatingGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - class NewFloatingMatrixWithDisplayNamePrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -2023,7 +1468,7 @@ class NewFloatingMatrixWithDisplayNamePrice(TypedDict, total=False): item_id: Required[str] """The id of the item the price will be associated with.""" - matrix_with_display_name_config: Required[Dict[str, object]] + matrix_with_display_name_config: Required[CustomRatingFunctionConfigModel] model_type: Required[Literal["matrix_with_display_name"]] @@ -2042,7 +1487,7 @@ class NewFloatingMatrixWithDisplayNamePrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewFloatingMatrixWithDisplayNamePriceBillingCycleConfiguration] + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -2063,7 +1508,7 @@ class NewFloatingMatrixWithDisplayNamePrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewFloatingMatrixWithDisplayNamePriceInvoicingCycleConfiguration] + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -2077,24 +1522,8 @@ class NewFloatingMatrixWithDisplayNamePrice(TypedDict, total=False): """ -class NewFloatingMatrixWithDisplayNamePriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class NewFloatingMatrixWithDisplayNamePriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - class NewFloatingBulkWithProrationPrice(TypedDict, total=False): - bulk_with_proration_config: Required[Dict[str, object]] + bulk_with_proration_config: Required[CustomRatingFunctionConfigModel] cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -2122,7 +1551,7 @@ class NewFloatingBulkWithProrationPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewFloatingBulkWithProrationPriceBillingCycleConfiguration] + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -2143,7 +1572,7 @@ class NewFloatingBulkWithProrationPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewFloatingBulkWithProrationPriceInvoicingCycleConfiguration] + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -2157,22 +1586,6 @@ class NewFloatingBulkWithProrationPrice(TypedDict, total=False): """ -class NewFloatingBulkWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class NewFloatingBulkWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - class NewFloatingGroupedTieredPackagePrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -2180,7 +1593,7 @@ class NewFloatingGroupedTieredPackagePrice(TypedDict, total=False): currency: Required[str] """An ISO 4217 currency string for which this price is billed in.""" - grouped_tiered_package_config: Required[Dict[str, object]] + grouped_tiered_package_config: Required[CustomRatingFunctionConfigModel] item_id: Required[str] """The id of the item the price will be associated with.""" @@ -2202,7 +1615,7 @@ class NewFloatingGroupedTieredPackagePrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewFloatingGroupedTieredPackagePriceBillingCycleConfiguration] + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -2223,7 +1636,7 @@ class NewFloatingGroupedTieredPackagePrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewFloatingGroupedTieredPackagePriceInvoicingCycleConfiguration] + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -2237,22 +1650,6 @@ class NewFloatingGroupedTieredPackagePrice(TypedDict, total=False): """ -class NewFloatingGroupedTieredPackagePriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class NewFloatingGroupedTieredPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - class NewFloatingScalableMatrixWithUnitPricingPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -2268,7 +1665,7 @@ class NewFloatingScalableMatrixWithUnitPricingPrice(TypedDict, total=False): name: Required[str] """The name of the price.""" - scalable_matrix_with_unit_pricing_config: Required[Dict[str, object]] + scalable_matrix_with_unit_pricing_config: Required[CustomRatingFunctionConfigModel] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -2282,7 +1679,7 @@ class NewFloatingScalableMatrixWithUnitPricingPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewFloatingScalableMatrixWithUnitPricingPriceBillingCycleConfiguration] + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -2303,7 +1700,7 @@ class NewFloatingScalableMatrixWithUnitPricingPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewFloatingScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration] + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -2317,22 +1714,6 @@ class NewFloatingScalableMatrixWithUnitPricingPrice(TypedDict, total=False): """ -class NewFloatingScalableMatrixWithUnitPricingPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class NewFloatingScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - class NewFloatingScalableMatrixWithTieredPricingPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -2348,7 +1729,7 @@ class NewFloatingScalableMatrixWithTieredPricingPrice(TypedDict, total=False): name: Required[str] """The name of the price.""" - scalable_matrix_with_tiered_pricing_config: Required[Dict[str, object]] + scalable_matrix_with_tiered_pricing_config: Required[CustomRatingFunctionConfigModel] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -2362,7 +1743,7 @@ class NewFloatingScalableMatrixWithTieredPricingPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewFloatingScalableMatrixWithTieredPricingPriceBillingCycleConfiguration] + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -2383,7 +1764,7 @@ class NewFloatingScalableMatrixWithTieredPricingPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewFloatingScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration] + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -2397,27 +1778,11 @@ class NewFloatingScalableMatrixWithTieredPricingPrice(TypedDict, total=False): """ -class NewFloatingScalableMatrixWithTieredPricingPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class NewFloatingScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - class NewFloatingCumulativeGroupedBulkPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" - cumulative_grouped_bulk_config: Required[Dict[str, object]] + cumulative_grouped_bulk_config: Required[CustomRatingFunctionConfigModel] currency: Required[str] """An ISO 4217 currency string for which this price is billed in.""" @@ -2442,7 +1807,7 @@ class NewFloatingCumulativeGroupedBulkPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ - billing_cycle_configuration: Optional[NewFloatingCumulativeGroupedBulkPriceBillingCycleConfiguration] + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """ For custom cadence: specifies the duration of the billing period in days or months. @@ -2463,7 +1828,7 @@ class NewFloatingCumulativeGroupedBulkPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" - invoicing_cycle_configuration: Optional[NewFloatingCumulativeGroupedBulkPriceInvoicingCycleConfiguration] + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] """Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. @@ -2477,22 +1842,6 @@ class NewFloatingCumulativeGroupedBulkPrice(TypedDict, total=False): """ -class NewFloatingCumulativeGroupedBulkPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class NewFloatingCumulativeGroupedBulkPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - PriceCreateParams: TypeAlias = Union[ NewFloatingUnitPrice, NewFloatingPackagePrice, diff --git a/src/orb/types/shared/__init__.py b/src/orb/types/shared/__init__.py index 6089696e..46fc1f8e 100644 --- a/src/orb/types/shared/__init__.py +++ b/src/orb/types/shared/__init__.py @@ -1,9 +1,124 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from .discount import Discount as Discount +from .item_model import ItemModel as ItemModel +from .plan_model import PlanModel as PlanModel +from .alert_model import AlertModel as AlertModel +from .price_model import PriceModel as PriceModel +from .usage_model import UsageModel as UsageModel +from .coupon_model import CouponModel as CouponModel +from .top_up_model import TopUpModel as TopUpModel +from .address_model import AddressModel as AddressModel +from .invoice_model import InvoiceModel as InvoiceModel +from .maximum_model import MaximumModel as MaximumModel +from .minimum_model import MinimumModel as MinimumModel +from .top_ups_model import TopUpsModel as TopUpsModel +from .backfill_model import BackfillModel as BackfillModel +from .customer_model import CustomerModel as CustomerModel +from .discount_model import DiscountModel as DiscountModel from .trial_discount import TrialDiscount as TrialDiscount from .amount_discount import AmountDiscount as AmountDiscount +from .edit_plan_model import EditPlanModel as EditPlanModel +from .item_slim_model import ItemSlimModel as ItemSlimModel +from .threshold_model import ThresholdModel as ThresholdModel +from .adjustment_model import AdjustmentModel as AdjustmentModel +from .allocation_model import AllocationModel as AllocationModel +from .bps_config_model import BpsConfigModel as BpsConfigModel +from .tax_amount_model import TaxAmountModel as TaxAmountModel +from .bulk_config_model import BulkConfigModel as BulkConfigModel +from .credit_note_model import CreditNoteModel as CreditNoteModel +from .unit_config_model import UnitConfigModel as UnitConfigModel +from .matrix_value_model import MatrixValueModel as MatrixValueModel +from .subscription_model import SubscriptionModel as SubscriptionModel +from .address_input_model import AddressInputModel as AddressInputModel +from .edit_customer_model import EditCustomerModel as EditCustomerModel +from .matrix_config_model import MatrixConfigModel as MatrixConfigModel from .pagination_metadata import PaginationMetadata as PaginationMetadata from .percentage_discount import PercentageDiscount as PercentageDiscount +from .plan_minified_model import PlanMinifiedModel as PlanMinifiedModel +from .subscriptions_model import SubscriptionsModel as SubscriptionsModel +from .tiered_config_model import TieredConfigModel as TieredConfigModel +from .affected_block_model import AffectedBlockModel as AffectedBlockModel +from .customer_costs_model import CustomerCostsModel as CustomerCostsModel +from .new_adjustment_model import NewAdjustmentModel as NewAdjustmentModel +from .package_config_model import PackageConfigModel as PackageConfigModel +from .price_interval_model import PriceIntervalModel as PriceIntervalModel +from .trial_discount_model import TrialDiscountModel as TrialDiscountModel +from .aggregated_cost_model import AggregatedCostModel as AggregatedCostModel +from .amount_discount_model import AmountDiscountModel as AmountDiscountModel +from .auto_collection_model import AutoCollectionModel as AutoCollectionModel +from .billable_metric_model import BillableMetricModel as BillableMetricModel +from .bulk_bps_config_model import BulkBpsConfigModel as BulkBpsConfigModel +from .customer_tax_id_model import CustomerTaxIDModel as CustomerTaxIDModel +from .payment_attempt_model import PaymentAttemptModel as PaymentAttemptModel from .invoice_level_discount import InvoiceLevelDiscount as InvoiceLevelDiscount +from .maximum_interval_model import MaximumIntervalModel as MaximumIntervalModel +from .minimum_interval_model import MinimumIntervalModel as MinimumIntervalModel +from .coupon_redemption_model import CouponRedemptionModel as CouponRedemptionModel +from .customer_minified_model import CustomerMinifiedModel as CustomerMinifiedModel +from .discount_override_model import DiscountOverrideModel as DiscountOverrideModel +from .invoice_line_item_model import InvoiceLineItemModel as InvoiceLineItemModel +from .tiered_bps_config_model import TieredBpsConfigModel as TieredBpsConfigModel +from .new_floating_price_model import NewFloatingPriceModel as NewFloatingPriceModel +from .add_credit_top_up_request import AddCreditTopUpRequest as AddCreditTopUpRequest +from .adjustment_interval_model import AdjustmentIntervalModel as AdjustmentIntervalModel +from .credit_ledger_entry_model import CreditLedgerEntryModel as CreditLedgerEntryModel +from .credit_note_summary_model import CreditNoteSummaryModel as CreditNoteSummaryModel +from .pagination_metadata_model import PaginationMetadataModel as PaginationMetadataModel +from .percentage_discount_model import PercentageDiscountModel as PercentageDiscountModel +from .billable_metric_tiny_model import BillableMetricTinyModel as BillableMetricTinyModel +from .credit_note_discount_model import CreditNoteDiscountModel as CreditNoteDiscountModel +from .mutated_subscription_model import MutatedSubscriptionModel as MutatedSubscriptionModel +from .new_allocation_price_model import NewAllocationPriceModel as NewAllocationPriceModel from .billing_cycle_relative_date import BillingCycleRelativeDate as BillingCycleRelativeDate +from .credit_ledger_entries_model import CreditLedgerEntriesModel as CreditLedgerEntriesModel +from .new_tax_configuration_model import NewTaxConfigurationModel as NewTaxConfigurationModel +from .subscription_minified_model import SubscriptionMinifiedModel as SubscriptionMinifiedModel +from .update_price_request_params import UpdatePriceRequestParams as UpdatePriceRequestParams +from .billable_metric_simple_model import BillableMetricSimpleModel as BillableMetricSimpleModel +from .invoice_level_discount_model import InvoiceLevelDiscountModel as InvoiceLevelDiscountModel +from .new_subscription_price_model import NewSubscriptionPriceModel as NewSubscriptionPriceModel +from .sub_line_item_grouping_model import SubLineItemGroupingModel as SubLineItemGroupingModel +from .add_subscription_price_params import AddSubscriptionPriceParams as AddSubscriptionPriceParams +from .create_customer_alert_request import CreateCustomerAlertRequest as CreateCustomerAlertRequest +from .dimensional_price_group_model import DimensionalPriceGroupModel as DimensionalPriceGroupModel +from .subscription_trial_info_model import SubscriptionTrialInfoModel as SubscriptionTrialInfoModel +from .usage_discount_interval_model import UsageDiscountIntervalModel as UsageDiscountIntervalModel +from .amount_discount_interval_model import AmountDiscountIntervalModel as AmountDiscountIntervalModel +from .customer_credit_balances_model import CustomerCreditBalancesModel as CustomerCreditBalancesModel +from .item_external_connection_model import ItemExternalConnectionModel as ItemExternalConnectionModel +from .add_credit_ledger_entry_request import AddCreditLedgerEntryRequest as AddCreditLedgerEntryRequest +from .customer_hierarchy_config_model import CustomerHierarchyConfigModel as CustomerHierarchyConfigModel +from .remove_subscription_price_params import RemoveSubscriptionPriceParams as RemoveSubscriptionPriceParams +from .billing_cycle_configuration_model import BillingCycleConfigurationModel as BillingCycleConfigurationModel +from .new_reporting_configuration_model import NewReportingConfigurationModel as NewReportingConfigurationModel +from .replace_subscription_price_params import ReplaceSubscriptionPriceParams as ReplaceSubscriptionPriceParams +from .add_subscription_adjustment_params import AddSubscriptionAdjustmentParams as AddSubscriptionAdjustmentParams +from .customer_balance_transaction_model import CustomerBalanceTransactionModel as CustomerBalanceTransactionModel +from .percentage_discount_interval_model import PercentageDiscountIntervalModel as PercentageDiscountIntervalModel +from .custom_rating_function_config_model import CustomRatingFunctionConfigModel as CustomRatingFunctionConfigModel +from .matrix_with_allocation_config_model import MatrixWithAllocationConfigModel as MatrixWithAllocationConfigModel +from .dimensional_price_configuration_model import ( + DimensionalPriceConfigurationModel as DimensionalPriceConfigurationModel, +) +from .new_billing_cycle_configuration_model import ( + NewBillingCycleConfigurationModel as NewBillingCycleConfigurationModel, +) +from .remove_subscription_adjustment_params import ( + RemoveSubscriptionAdjustmentParams as RemoveSubscriptionAdjustmentParams, +) +from .replace_subscription_adjustment_params import ( + ReplaceSubscriptionAdjustmentParams as ReplaceSubscriptionAdjustmentParams, +) +from .fixed_fee_quantity_schedule_entry_model import ( + FixedFeeQuantityScheduleEntryModel as FixedFeeQuantityScheduleEntryModel, +) +from .new_accounting_sync_configuration_model import ( + NewAccountingSyncConfigurationModel as NewAccountingSyncConfigurationModel, +) +from .billing_cycle_anchor_configuration_model import ( + BillingCycleAnchorConfigurationModel as BillingCycleAnchorConfigurationModel, +) +from .price_interval_fixed_fee_quantity_transition_model import ( + PriceIntervalFixedFeeQuantityTransitionModel as PriceIntervalFixedFeeQuantityTransitionModel, +) diff --git a/src/orb/types/shared/add_credit_ledger_entry_request.py b/src/orb/types/shared/add_credit_ledger_entry_request.py new file mode 100644 index 00000000..c1cad6e9 --- /dev/null +++ b/src/orb/types/shared/add_credit_ledger_entry_request.py @@ -0,0 +1,258 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, Union, Optional +from datetime import date, datetime +from typing_extensions import Literal, Annotated, TypeAlias + +from ..._utils import PropertyInfo +from ..._models import BaseModel + +__all__ = [ + "AddCreditLedgerEntryRequest", + "AddIncrementCreditLedgerEntryRequestParams", + "AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings", + "AddDecrementCreditLedgerEntryRequestParams", + "AddExpirationChangeCreditLedgerEntryRequestParams", + "AddVoidCreditLedgerEntryRequestParams", + "AddAmendmentCreditLedgerEntryRequestParams", +] + + +class AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings(BaseModel): + auto_collection: bool + """ + Whether the credits purchase invoice should auto collect with the customer's + saved payment method. + """ + + net_terms: int + """ + The net terms determines the difference between the invoice date and the issue + date for the invoice. If you intend the invoice to be due on issue, set this + to 0. + """ + + memo: Optional[str] = None + """An optional memo to display on the invoice.""" + + require_successful_payment: Optional[bool] = None + """ + If true, the new credit block will require that the corresponding invoice is + paid before it can be drawn down from. + """ + + +class AddIncrementCreditLedgerEntryRequestParams(BaseModel): + amount: float + """The number of credits to effect. + + Note that this is required for increment, decrement, void, or undo operations. + """ + + entry_type: Literal["increment"] + + currency: Optional[str] = None + """The currency or custom pricing unit to use for this ledger entry. + + If this is a real-world currency, it must match the customer's invoicing + currency. + """ + + description: Optional[str] = None + """Optional metadata that can be specified when adding ledger results via the API. + + For example, this can be used to note an increment refers to trial credits, or + for noting corrections as a result of an incident, etc. + """ + + effective_date: Optional[datetime] = None + """ + An ISO 8601 format date that denotes when this credit balance should become + available for use. + """ + + expiry_date: Optional[datetime] = None + """An ISO 8601 format date that denotes when this credit balance should expire.""" + + invoice_settings: Optional[AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings] = None + """ + Passing `invoice_settings` automatically generates an invoice for the newly + added credits. If `invoice_settings` is passed, you must specify + per_unit_cost_basis, as the calculation of the invoice total is done on that + basis. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + per_unit_cost_basis: Optional[str] = None + """Can only be specified when entry_type=increment. + + How much, in the customer's currency, a customer paid for a single credit in + this block + """ + + +class AddDecrementCreditLedgerEntryRequestParams(BaseModel): + amount: float + """The number of credits to effect. + + Note that this is required for increment, decrement, void, or undo operations. + """ + + entry_type: Literal["decrement"] + + currency: Optional[str] = None + """The currency or custom pricing unit to use for this ledger entry. + + If this is a real-world currency, it must match the customer's invoicing + currency. + """ + + description: Optional[str] = None + """Optional metadata that can be specified when adding ledger results via the API. + + For example, this can be used to note an increment refers to trial credits, or + for noting corrections as a result of an incident, etc. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class AddExpirationChangeCreditLedgerEntryRequestParams(BaseModel): + entry_type: Literal["expiration_change"] + + expiry_date: Optional[datetime] = None + """An ISO 8601 format date that identifies the origination credit block to expire""" + + target_expiry_date: date + """ + A future date (specified in YYYY-MM-DD format) used for expiration change, + denoting when credits transferred (as part of a partial block expiration) should + expire. + """ + + amount: Optional[float] = None + """The number of credits to effect. + + Note that this is required for increment, decrement, void, or undo operations. + """ + + block_id: Optional[str] = None + """ + The ID of the block affected by an expiration_change, used to differentiate + between multiple blocks with the same `expiry_date`. + """ + + currency: Optional[str] = None + """The currency or custom pricing unit to use for this ledger entry. + + If this is a real-world currency, it must match the customer's invoicing + currency. + """ + + description: Optional[str] = None + """Optional metadata that can be specified when adding ledger results via the API. + + For example, this can be used to note an increment refers to trial credits, or + for noting corrections as a result of an incident, etc. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class AddVoidCreditLedgerEntryRequestParams(BaseModel): + amount: float + """The number of credits to effect. + + Note that this is required for increment, decrement, void, or undo operations. + """ + + block_id: str + """The ID of the block to void.""" + + entry_type: Literal["void"] + + currency: Optional[str] = None + """The currency or custom pricing unit to use for this ledger entry. + + If this is a real-world currency, it must match the customer's invoicing + currency. + """ + + description: Optional[str] = None + """Optional metadata that can be specified when adding ledger results via the API. + + For example, this can be used to note an increment refers to trial credits, or + for noting corrections as a result of an incident, etc. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + void_reason: Optional[Literal["refund"]] = None + """Can only be specified when `entry_type=void`. The reason for the void.""" + + +class AddAmendmentCreditLedgerEntryRequestParams(BaseModel): + amount: float + """The number of credits to effect. + + Note that this is required for increment, decrement or void operations. + """ + + block_id: str + """The ID of the block to reverse a decrement from.""" + + entry_type: Literal["amendment"] + + currency: Optional[str] = None + """The currency or custom pricing unit to use for this ledger entry. + + If this is a real-world currency, it must match the customer's invoicing + currency. + """ + + description: Optional[str] = None + """Optional metadata that can be specified when adding ledger results via the API. + + For example, this can be used to note an increment refers to trial credits, or + for noting corrections as a result of an incident, etc. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +AddCreditLedgerEntryRequest: TypeAlias = Annotated[ + Union[ + AddIncrementCreditLedgerEntryRequestParams, + AddDecrementCreditLedgerEntryRequestParams, + AddExpirationChangeCreditLedgerEntryRequestParams, + AddVoidCreditLedgerEntryRequestParams, + AddAmendmentCreditLedgerEntryRequestParams, + ], + PropertyInfo(discriminator="entry_type"), +] diff --git a/src/orb/types/customers/credits/top_up_create_by_external_id_response.py b/src/orb/types/shared/add_credit_top_up_request.py similarity index 84% rename from src/orb/types/customers/credits/top_up_create_by_external_id_response.py rename to src/orb/types/shared/add_credit_top_up_request.py index 9b889e61..f58f4063 100644 --- a/src/orb/types/customers/credits/top_up_create_by_external_id_response.py +++ b/src/orb/types/shared/add_credit_top_up_request.py @@ -1,11 +1,12 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional +from datetime import datetime from typing_extensions import Literal -from ...._models import BaseModel +from ..._models import BaseModel -__all__ = ["TopUpCreateByExternalIDResponse", "InvoiceSettings"] +__all__ = ["AddCreditTopUpRequest", "InvoiceSettings"] class InvoiceSettings(BaseModel): @@ -32,9 +33,7 @@ class InvoiceSettings(BaseModel): """ -class TopUpCreateByExternalIDResponse(BaseModel): - id: str - +class AddCreditTopUpRequest(BaseModel): amount: str """The amount to increment when the threshold is reached.""" @@ -57,6 +56,12 @@ class TopUpCreateByExternalIDResponse(BaseModel): If the balance is at or below this threshold, the top-up will be triggered. """ + active_from: Optional[datetime] = None + """The date from which the top-up is active. + + If unspecified, the top-up is active immediately. + """ + expires_after: Optional[int] = None """The number of days or months after which the top-up expires. diff --git a/src/orb/types/shared/add_subscription_adjustment_params.py b/src/orb/types/shared/add_subscription_adjustment_params.py new file mode 100644 index 00000000..435769c9 --- /dev/null +++ b/src/orb/types/shared/add_subscription_adjustment_params.py @@ -0,0 +1,32 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime + +from ..._models import BaseModel +from .new_adjustment_model import NewAdjustmentModel + +__all__ = ["AddSubscriptionAdjustmentParams"] + + +class AddSubscriptionAdjustmentParams(BaseModel): + adjustment: NewAdjustmentModel + """The definition of a new adjustment to create and add to the subscription.""" + + end_date: Optional[datetime] = None + """The end date of the adjustment interval. + + This is the date that the adjustment will stop affecting prices on the + subscription. + """ + + plan_phase_order: Optional[int] = None + """The phase to add this adjustment to.""" + + start_date: Optional[datetime] = None + """The start date of the adjustment interval. + + This is the date that the adjustment will start affecting prices on the + subscription. If null, the adjustment will start when the phase or subscription + starts. + """ diff --git a/src/orb/types/shared/add_subscription_price_params.py b/src/orb/types/shared/add_subscription_price_params.py new file mode 100644 index 00000000..152a934f --- /dev/null +++ b/src/orb/types/shared/add_subscription_price_params.py @@ -0,0 +1,60 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime + +from ..._models import BaseModel +from .discount_override_model import DiscountOverrideModel +from .new_allocation_price_model import NewAllocationPriceModel +from .new_subscription_price_model import NewSubscriptionPriceModel + +__all__ = ["AddSubscriptionPriceParams"] + + +class AddSubscriptionPriceParams(BaseModel): + allocation_price: Optional[NewAllocationPriceModel] = None + """The definition of a new allocation price to create and add to the subscription.""" + + discounts: Optional[List[DiscountOverrideModel]] = None + """[DEPRECATED] Use add_adjustments instead. + + The subscription's discounts for this price. + """ + + end_date: Optional[datetime] = None + """The end date of the price interval. + + This is the date that the price will stop billing on the subscription. If null, + billing will end when the phase or subscription ends. + """ + + external_price_id: Optional[str] = None + """The external price id of the price to add to the subscription.""" + + maximum_amount: Optional[str] = None + """[DEPRECATED] Use add_adjustments instead. + + The subscription's maximum amount for this price. + """ + + minimum_amount: Optional[str] = None + """[DEPRECATED] Use add_adjustments instead. + + The subscription's minimum amount for this price. + """ + + plan_phase_order: Optional[int] = None + """The phase to add this price to.""" + + price: Optional[NewSubscriptionPriceModel] = None + """The definition of a new price to create and add to the subscription.""" + + price_id: Optional[str] = None + """The id of the price to add to the subscription.""" + + start_date: Optional[datetime] = None + """The start date of the price interval. + + This is the date that the price will start billing on the subscription. If null, + billing will start when the phase or subscription starts. + """ diff --git a/src/orb/types/shared/address_input_model.py b/src/orb/types/shared/address_input_model.py new file mode 100644 index 00000000..69c45898 --- /dev/null +++ b/src/orb/types/shared/address_input_model.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel + +__all__ = ["AddressInputModel"] + + +class AddressInputModel(BaseModel): + city: Optional[str] = None + + country: Optional[str] = None + + line1: Optional[str] = None + + line2: Optional[str] = None + + postal_code: Optional[str] = None + + state: Optional[str] = None diff --git a/src/orb/types/shared/address_model.py b/src/orb/types/shared/address_model.py new file mode 100644 index 00000000..3d78ef22 --- /dev/null +++ b/src/orb/types/shared/address_model.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel + +__all__ = ["AddressModel"] + + +class AddressModel(BaseModel): + city: Optional[str] = None + + country: Optional[str] = None + + line1: Optional[str] = None + + line2: Optional[str] = None + + postal_code: Optional[str] = None + + state: Optional[str] = None diff --git a/src/orb/types/shared/adjustment_interval_model.py b/src/orb/types/shared/adjustment_interval_model.py new file mode 100644 index 00000000..0a89c4bd --- /dev/null +++ b/src/orb/types/shared/adjustment_interval_model.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime + +from ..._models import BaseModel +from .adjustment_model import AdjustmentModel + +__all__ = ["AdjustmentIntervalModel"] + + +class AdjustmentIntervalModel(BaseModel): + id: str + + adjustment: AdjustmentModel + + applies_to_price_interval_ids: List[str] + """The price interval IDs that this adjustment applies to.""" + + end_date: Optional[datetime] = None + """The end date of the adjustment interval.""" + + start_date: datetime + """The start date of the adjustment interval.""" diff --git a/src/orb/types/shared/adjustment_model.py b/src/orb/types/shared/adjustment_model.py new file mode 100644 index 00000000..a72f43a6 --- /dev/null +++ b/src/orb/types/shared/adjustment_model.py @@ -0,0 +1,166 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias + +from ..._utils import PropertyInfo +from ..._models import BaseModel + +__all__ = [ + "AdjustmentModel", + "PlanPhaseUsageDiscountAdjustment", + "PlanPhaseAmountDiscountAdjustment", + "PlanPhasePercentageDiscountAdjustment", + "PlanPhaseMinimumAdjustment", + "PlanPhaseMaximumAdjustment", +] + + +class PlanPhaseUsageDiscountAdjustment(BaseModel): + id: str + + adjustment_type: Literal["usage_discount"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + that apply to only one price. + """ + + plan_phase_order: Optional[int] = None + """The plan phase in which this adjustment is active.""" + + reason: Optional[str] = None + """The reason for the adjustment.""" + + usage_discount: float + """ + The number of usage units by which to discount the price this adjustment applies + to in a given billing period. + """ + + +class PlanPhaseAmountDiscountAdjustment(BaseModel): + id: str + + adjustment_type: Literal["amount_discount"] + + amount_discount: str + """ + The amount by which to discount the prices this adjustment applies to in a given + billing period. + """ + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + that apply to only one price. + """ + + plan_phase_order: Optional[int] = None + """The plan phase in which this adjustment is active.""" + + reason: Optional[str] = None + """The reason for the adjustment.""" + + +class PlanPhasePercentageDiscountAdjustment(BaseModel): + id: str + + adjustment_type: Literal["percentage_discount"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + that apply to only one price. + """ + + percentage_discount: float + """ + The percentage (as a value between 0 and 1) by which to discount the price + intervals this adjustment applies to in a given billing period. + """ + + plan_phase_order: Optional[int] = None + """The plan phase in which this adjustment is active.""" + + reason: Optional[str] = None + """The reason for the adjustment.""" + + +class PlanPhaseMinimumAdjustment(BaseModel): + id: str + + adjustment_type: Literal["minimum"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + that apply to only one price. + """ + + item_id: str + """The item ID that revenue from this minimum will be attributed to.""" + + minimum_amount: str + """ + The minimum amount to charge in a given billing period for the prices this + adjustment applies to. + """ + + plan_phase_order: Optional[int] = None + """The plan phase in which this adjustment is active.""" + + reason: Optional[str] = None + """The reason for the adjustment.""" + + +class PlanPhaseMaximumAdjustment(BaseModel): + id: str + + adjustment_type: Literal["maximum"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + that apply to only one price. + """ + + maximum_amount: str + """ + The maximum amount to charge in a given billing period for the prices this + adjustment applies to. + """ + + plan_phase_order: Optional[int] = None + """The plan phase in which this adjustment is active.""" + + reason: Optional[str] = None + """The reason for the adjustment.""" + + +AdjustmentModel: TypeAlias = Annotated[ + Union[ + PlanPhaseUsageDiscountAdjustment, + PlanPhaseAmountDiscountAdjustment, + PlanPhasePercentageDiscountAdjustment, + PlanPhaseMinimumAdjustment, + PlanPhaseMaximumAdjustment, + ], + PropertyInfo(discriminator="adjustment_type"), +] diff --git a/src/orb/types/shared/affected_block_model.py b/src/orb/types/shared/affected_block_model.py new file mode 100644 index 00000000..31e33f77 --- /dev/null +++ b/src/orb/types/shared/affected_block_model.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime + +from ..._models import BaseModel + +__all__ = ["AffectedBlockModel"] + + +class AffectedBlockModel(BaseModel): + id: str + + expiry_date: Optional[datetime] = None + + per_unit_cost_basis: Optional[str] = None diff --git a/src/orb/types/customers/cost_list_response.py b/src/orb/types/shared/aggregated_cost_model.py similarity index 76% rename from src/orb/types/customers/cost_list_response.py rename to src/orb/types/shared/aggregated_cost_model.py index 48921e0f..c0cbb2ec 100644 --- a/src/orb/types/customers/cost_list_response.py +++ b/src/orb/types/shared/aggregated_cost_model.py @@ -3,14 +3,14 @@ from typing import List, Optional from datetime import datetime -from ..price import Price from ..._models import BaseModel +from .price_model import PriceModel -__all__ = ["CostListResponse", "Data", "DataPerPriceCost"] +__all__ = ["AggregatedCostModel", "PerPriceCost"] -class DataPerPriceCost(BaseModel): - price: Price +class PerPriceCost(BaseModel): + price: PriceModel """The price object""" price_id: str @@ -26,8 +26,8 @@ class DataPerPriceCost(BaseModel): """The price's quantity for the timeframe""" -class Data(BaseModel): - per_price_costs: List[DataPerPriceCost] +class AggregatedCostModel(BaseModel): + per_price_costs: List[PerPriceCost] subtotal: str """Total costs for the timeframe, excluding any minimums and discounts.""" @@ -38,7 +38,3 @@ class Data(BaseModel): total: str """Total costs for the timeframe, including any minimums and discounts.""" - - -class CostListResponse(BaseModel): - data: List[Data] diff --git a/src/orb/types/alert.py b/src/orb/types/shared/alert_model.py similarity index 70% rename from src/orb/types/alert.py rename to src/orb/types/shared/alert_model.py index 0ef04360..63be322f 100644 --- a/src/orb/types/alert.py +++ b/src/orb/types/shared/alert_model.py @@ -4,15 +4,12 @@ from datetime import datetime from typing_extensions import Literal -from .._models import BaseModel +from ..._models import BaseModel +from .threshold_model import ThresholdModel +from .customer_minified_model import CustomerMinifiedModel +from .subscription_minified_model import SubscriptionMinifiedModel -__all__ = ["Alert", "Customer", "Metric", "Plan", "Subscription", "Threshold"] - - -class Customer(BaseModel): - id: str - - external_customer_id: Optional[str] = None +__all__ = ["AlertModel", "Metric", "Plan"] class Metric(BaseModel): @@ -34,20 +31,7 @@ class Plan(BaseModel): plan_version: str -class Subscription(BaseModel): - id: str - - -class Threshold(BaseModel): - value: float - """The value at which an alert will fire. - - For credit balance alerts, the alert will fire at or below this value. For usage - and cost alerts, the alert will fire at or above this value. - """ - - -class Alert(BaseModel): +class AlertModel(BaseModel): id: str """Also referred to as alert_id in this documentation.""" @@ -57,7 +41,7 @@ class Alert(BaseModel): currency: Optional[str] = None """The name of the currency the credit balance or invoice cost is denominated in.""" - customer: Optional[Customer] = None + customer: Optional[CustomerMinifiedModel] = None """The customer the alert applies to.""" enabled: bool @@ -69,10 +53,10 @@ class Alert(BaseModel): plan: Optional[Plan] = None """The plan the alert applies to.""" - subscription: Optional[Subscription] = None + subscription: Optional[SubscriptionMinifiedModel] = None """The subscription the alert applies to.""" - thresholds: Optional[List[Threshold]] = None + thresholds: Optional[List[ThresholdModel]] = None """ The thresholds that define the conditions under which the alert will be triggered. diff --git a/src/orb/types/shared/allocation_model.py b/src/orb/types/shared/allocation_model.py new file mode 100644 index 00000000..03d8b6d1 --- /dev/null +++ b/src/orb/types/shared/allocation_model.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["AllocationModel"] + + +class AllocationModel(BaseModel): + allows_rollover: bool + + currency: str diff --git a/src/orb/types/shared/amount_discount_interval_model.py b/src/orb/types/shared/amount_discount_interval_model.py new file mode 100644 index 00000000..d5cf34ec --- /dev/null +++ b/src/orb/types/shared/amount_discount_interval_model.py @@ -0,0 +1,28 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["AmountDiscountIntervalModel"] + + +class AmountDiscountIntervalModel(BaseModel): + amount_discount: str + """Only available if discount_type is `amount`.""" + + applies_to_price_ids: List[str] + """The price ids that this discount interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this discount interval applies to.""" + + discount_type: Literal["amount"] + + end_date: Optional[datetime] = None + """The end date of the discount interval.""" + + start_date: datetime + """The start date of the discount interval.""" diff --git a/src/orb/types/shared/amount_discount_model.py b/src/orb/types/shared/amount_discount_model.py new file mode 100644 index 00000000..c26994b6 --- /dev/null +++ b/src/orb/types/shared/amount_discount_model.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["AmountDiscountModel"] + + +class AmountDiscountModel(BaseModel): + amount_discount: str + """Only available if discount_type is `amount`.""" + + applies_to_price_ids: List[str] + """List of price_ids that this discount applies to. + + For plan/plan phase discounts, this can be a subset of prices. + """ + + discount_type: Literal["amount"] + + reason: Optional[str] = None diff --git a/src/orb/types/shared/auto_collection_model.py b/src/orb/types/shared/auto_collection_model.py new file mode 100644 index 00000000..dbf043f8 --- /dev/null +++ b/src/orb/types/shared/auto_collection_model.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime + +from ..._models import BaseModel + +__all__ = ["AutoCollectionModel"] + + +class AutoCollectionModel(BaseModel): + enabled: Optional[bool] = None + """True only if auto-collection is enabled for this invoice.""" + + next_attempt_at: Optional[datetime] = None + """ + If the invoice is scheduled for auto-collection, this field will reflect when + the next attempt will occur. If dunning has been exhausted, or auto-collection + is not enabled for this invoice, this field will be `null`. + """ + + num_attempts: Optional[int] = None + """Number of auto-collection payment attempts.""" + + previously_attempted_at: Optional[datetime] = None + """ + If Orb has ever attempted payment auto-collection for this invoice, this field + will reflect when that attempt occurred. In conjunction with `next_attempt_at`, + this can be used to tell whether the invoice is currently in dunning (that is, + `previously_attempted_at` is non-null, and `next_attempt_time` is non-null), or + if dunning has been exhausted (`previously_attempted_at` is non-null, but + `next_attempt_time` is null). + """ diff --git a/src/orb/types/events/backfill_list_response.py b/src/orb/types/shared/backfill_model.py similarity index 95% rename from src/orb/types/events/backfill_list_response.py rename to src/orb/types/shared/backfill_model.py index b470ba1f..75c1da23 100644 --- a/src/orb/types/events/backfill_list_response.py +++ b/src/orb/types/shared/backfill_model.py @@ -6,10 +6,10 @@ from ..._models import BaseModel -__all__ = ["BackfillListResponse"] +__all__ = ["BackfillModel"] -class BackfillListResponse(BaseModel): +class BackfillModel(BaseModel): id: str close_time: Optional[datetime] = None diff --git a/src/orb/types/billable_metric.py b/src/orb/types/shared/billable_metric_model.py similarity index 83% rename from src/orb/types/billable_metric.py rename to src/orb/types/shared/billable_metric_model.py index ac70464c..566dc515 100644 --- a/src/orb/types/billable_metric.py +++ b/src/orb/types/shared/billable_metric_model.py @@ -3,18 +3,18 @@ from typing import Dict, Optional from typing_extensions import Literal -from .item import Item -from .._models import BaseModel +from ..._models import BaseModel +from .item_model import ItemModel -__all__ = ["BillableMetric"] +__all__ = ["BillableMetricModel"] -class BillableMetric(BaseModel): +class BillableMetricModel(BaseModel): id: str description: Optional[str] = None - item: Item + item: ItemModel """The Item resource represents a sellable product or good. Items are associated with all line items, billable metrics, and prices and are diff --git a/src/orb/types/shared/billable_metric_simple_model.py b/src/orb/types/shared/billable_metric_simple_model.py new file mode 100644 index 00000000..339aa363 --- /dev/null +++ b/src/orb/types/shared/billable_metric_simple_model.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BillableMetricSimpleModel"] + + +class BillableMetricSimpleModel(BaseModel): + id: str + + name: str diff --git a/src/orb/types/shared/billable_metric_tiny_model.py b/src/orb/types/shared/billable_metric_tiny_model.py new file mode 100644 index 00000000..824b35da --- /dev/null +++ b/src/orb/types/shared/billable_metric_tiny_model.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BillableMetricTinyModel"] + + +class BillableMetricTinyModel(BaseModel): + id: str diff --git a/src/orb/types/shared/billing_cycle_anchor_configuration_model.py b/src/orb/types/shared/billing_cycle_anchor_configuration_model.py new file mode 100644 index 00000000..3b5f1e6b --- /dev/null +++ b/src/orb/types/shared/billing_cycle_anchor_configuration_model.py @@ -0,0 +1,31 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel + +__all__ = ["BillingCycleAnchorConfigurationModel"] + + +class BillingCycleAnchorConfigurationModel(BaseModel): + day: int + """The day of the month on which the billing cycle is anchored. + + If the maximum number of days in a month is greater than this value, the last + day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April + means the billing period begins on the 30th. + """ + + month: Optional[int] = None + """The month on which the billing cycle is anchored (e.g. + + a quarterly price anchored in February would have cycles starting February, May, + August, and November). + """ + + year: Optional[int] = None + """The year on which the billing cycle is anchored (e.g. + + a 2 year billing cycle anchored on 2021 would have cycles starting on 2021, + 2023, 2025, etc.). + """ diff --git a/src/orb/types/shared/billing_cycle_configuration_model.py b/src/orb/types/shared/billing_cycle_configuration_model.py new file mode 100644 index 00000000..4bb9ef22 --- /dev/null +++ b/src/orb/types/shared/billing_cycle_configuration_model.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["BillingCycleConfigurationModel"] + + +class BillingCycleConfigurationModel(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] diff --git a/src/orb/types/shared/bps_config_model.py b/src/orb/types/shared/bps_config_model.py new file mode 100644 index 00000000..3ee042c9 --- /dev/null +++ b/src/orb/types/shared/bps_config_model.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel + +__all__ = ["BpsConfigModel"] + + +class BpsConfigModel(BaseModel): + bps: float + """Basis point take rate per event""" + + per_unit_maximum: Optional[str] = None + """Optional currency amount maximum to cap spend per event""" diff --git a/src/orb/types/shared/bulk_bps_config_model.py b/src/orb/types/shared/bulk_bps_config_model.py new file mode 100644 index 00000000..e7143f8b --- /dev/null +++ b/src/orb/types/shared/bulk_bps_config_model.py @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BulkBpsConfigModel", "Tier"] + + +class Tier(BaseModel): + bps: float + """Basis points to rate on""" + + maximum_amount: Optional[str] = None + """Upper bound for tier""" + + per_unit_maximum: Optional[str] = None + """The maximum amount to charge for any one event""" + + +class BulkBpsConfigModel(BaseModel): + tiers: List[Tier] + """ + Tiers for a bulk BPS pricing model where all usage is aggregated to a single + tier based on total volume + """ diff --git a/src/orb/types/shared/bulk_config_model.py b/src/orb/types/shared/bulk_config_model.py new file mode 100644 index 00000000..be0dd7f7 --- /dev/null +++ b/src/orb/types/shared/bulk_config_model.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BulkConfigModel", "Tier"] + + +class Tier(BaseModel): + unit_amount: str + """Amount per unit""" + + maximum_units: Optional[float] = None + """Upper bound for this tier""" + + +class BulkConfigModel(BaseModel): + tiers: List[Tier] + """Bulk tiers for rating based on total usage volume""" diff --git a/src/orb/types/coupon.py b/src/orb/types/shared/coupon_model.py similarity index 83% rename from src/orb/types/coupon.py rename to src/orb/types/shared/coupon_model.py index c0ac61bd..f2520755 100644 --- a/src/orb/types/coupon.py +++ b/src/orb/types/shared/coupon_model.py @@ -4,17 +4,17 @@ from datetime import datetime from typing_extensions import Annotated, TypeAlias -from .._utils import PropertyInfo -from .._models import BaseModel -from .shared.amount_discount import AmountDiscount -from .shared.percentage_discount import PercentageDiscount +from ..._utils import PropertyInfo +from ..._models import BaseModel +from .amount_discount import AmountDiscount +from .percentage_discount import PercentageDiscount -__all__ = ["Coupon", "Discount"] +__all__ = ["CouponModel", "Discount"] Discount: TypeAlias = Annotated[Union[PercentageDiscount, AmountDiscount], PropertyInfo(discriminator="discount_type")] -class Coupon(BaseModel): +class CouponModel(BaseModel): id: str """Also referred to as coupon_id in this documentation.""" diff --git a/src/orb/types/shared/coupon_redemption_model.py b/src/orb/types/shared/coupon_redemption_model.py new file mode 100644 index 00000000..b4d087be --- /dev/null +++ b/src/orb/types/shared/coupon_redemption_model.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime + +from ..._models import BaseModel + +__all__ = ["CouponRedemptionModel"] + + +class CouponRedemptionModel(BaseModel): + coupon_id: str + + end_date: Optional[datetime] = None + + start_date: datetime diff --git a/src/orb/types/shared/create_customer_alert_request.py b/src/orb/types/shared/create_customer_alert_request.py new file mode 100644 index 00000000..ebc3b142 --- /dev/null +++ b/src/orb/types/shared/create_customer_alert_request.py @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import Literal + +from ..._models import BaseModel +from .threshold_model import ThresholdModel + +__all__ = ["CreateCustomerAlertRequest"] + + +class CreateCustomerAlertRequest(BaseModel): + currency: str + """The case sensitive currency or custom pricing unit to use for this alert.""" + + type: Literal[ + "usage_exceeded", + "cost_exceeded", + "credit_balance_depleted", + "credit_balance_dropped", + "credit_balance_recovered", + ] + """The type of alert to create. This must be a valid alert type.""" + + thresholds: Optional[List[ThresholdModel]] = None + """The thresholds that define the values at which the alert will be triggered.""" diff --git a/src/orb/types/shared/credit_ledger_entries_model.py b/src/orb/types/shared/credit_ledger_entries_model.py new file mode 100644 index 00000000..350fb7f7 --- /dev/null +++ b/src/orb/types/shared/credit_ledger_entries_model.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .pagination_metadata import PaginationMetadata +from .credit_ledger_entry_model import CreditLedgerEntryModel + +__all__ = ["CreditLedgerEntriesModel"] + + +class CreditLedgerEntriesModel(BaseModel): + data: List[CreditLedgerEntryModel] + + pagination_metadata: PaginationMetadata diff --git a/src/orb/types/customers/credits/ledger_list_response.py b/src/orb/types/shared/credit_ledger_entry_model.py similarity index 63% rename from src/orb/types/customers/credits/ledger_list_response.py rename to src/orb/types/shared/credit_ledger_entry_model.py index 26008bcc..d418fcd3 100644 --- a/src/orb/types/customers/credits/ledger_list_response.py +++ b/src/orb/types/shared/credit_ledger_entry_model.py @@ -4,49 +4,23 @@ from datetime import datetime from typing_extensions import Literal, Annotated, TypeAlias -from ...._utils import PropertyInfo -from ...._models import BaseModel +from ..._utils import PropertyInfo +from ..._models import BaseModel +from .affected_block_model import AffectedBlockModel +from .customer_minified_model import CustomerMinifiedModel __all__ = [ - "LedgerListResponse", + "CreditLedgerEntryModel", "IncrementLedgerEntry", - "IncrementLedgerEntryCreditBlock", - "IncrementLedgerEntryCustomer", "DecrementLedgerEntry", - "DecrementLedgerEntryCreditBlock", - "DecrementLedgerEntryCustomer", "ExpirationChangeLedgerEntry", - "ExpirationChangeLedgerEntryCreditBlock", - "ExpirationChangeLedgerEntryCustomer", "CreditBlockExpiryLedgerEntry", - "CreditBlockExpiryLedgerEntryCreditBlock", - "CreditBlockExpiryLedgerEntryCustomer", "VoidLedgerEntry", - "VoidLedgerEntryCreditBlock", - "VoidLedgerEntryCustomer", "VoidInitiatedLedgerEntry", - "VoidInitiatedLedgerEntryCreditBlock", - "VoidInitiatedLedgerEntryCustomer", "AmendmentLedgerEntry", - "AmendmentLedgerEntryCreditBlock", - "AmendmentLedgerEntryCustomer", ] -class IncrementLedgerEntryCreditBlock(BaseModel): - id: str - - expiry_date: Optional[datetime] = None - - per_unit_cost_basis: Optional[str] = None - - -class IncrementLedgerEntryCustomer(BaseModel): - id: str - - external_customer_id: Optional[str] = None - - class IncrementLedgerEntry(BaseModel): id: str @@ -54,11 +28,11 @@ class IncrementLedgerEntry(BaseModel): created_at: datetime - credit_block: IncrementLedgerEntryCreditBlock + credit_block: AffectedBlockModel currency: str - customer: IncrementLedgerEntryCustomer + customer: CustomerMinifiedModel description: Optional[str] = None @@ -81,20 +55,6 @@ class IncrementLedgerEntry(BaseModel): starting_balance: float -class DecrementLedgerEntryCreditBlock(BaseModel): - id: str - - expiry_date: Optional[datetime] = None - - per_unit_cost_basis: Optional[str] = None - - -class DecrementLedgerEntryCustomer(BaseModel): - id: str - - external_customer_id: Optional[str] = None - - class DecrementLedgerEntry(BaseModel): id: str @@ -102,11 +62,11 @@ class DecrementLedgerEntry(BaseModel): created_at: datetime - credit_block: DecrementLedgerEntryCreditBlock + credit_block: AffectedBlockModel currency: str - customer: DecrementLedgerEntryCustomer + customer: CustomerMinifiedModel description: Optional[str] = None @@ -135,20 +95,6 @@ class DecrementLedgerEntry(BaseModel): price_id: Optional[str] = None -class ExpirationChangeLedgerEntryCreditBlock(BaseModel): - id: str - - expiry_date: Optional[datetime] = None - - per_unit_cost_basis: Optional[str] = None - - -class ExpirationChangeLedgerEntryCustomer(BaseModel): - id: str - - external_customer_id: Optional[str] = None - - class ExpirationChangeLedgerEntry(BaseModel): id: str @@ -156,11 +102,11 @@ class ExpirationChangeLedgerEntry(BaseModel): created_at: datetime - credit_block: ExpirationChangeLedgerEntryCreditBlock + credit_block: AffectedBlockModel currency: str - customer: ExpirationChangeLedgerEntryCustomer + customer: CustomerMinifiedModel description: Optional[str] = None @@ -185,20 +131,6 @@ class ExpirationChangeLedgerEntry(BaseModel): starting_balance: float -class CreditBlockExpiryLedgerEntryCreditBlock(BaseModel): - id: str - - expiry_date: Optional[datetime] = None - - per_unit_cost_basis: Optional[str] = None - - -class CreditBlockExpiryLedgerEntryCustomer(BaseModel): - id: str - - external_customer_id: Optional[str] = None - - class CreditBlockExpiryLedgerEntry(BaseModel): id: str @@ -206,11 +138,11 @@ class CreditBlockExpiryLedgerEntry(BaseModel): created_at: datetime - credit_block: CreditBlockExpiryLedgerEntryCreditBlock + credit_block: AffectedBlockModel currency: str - customer: CreditBlockExpiryLedgerEntryCustomer + customer: CustomerMinifiedModel description: Optional[str] = None @@ -233,20 +165,6 @@ class CreditBlockExpiryLedgerEntry(BaseModel): starting_balance: float -class VoidLedgerEntryCreditBlock(BaseModel): - id: str - - expiry_date: Optional[datetime] = None - - per_unit_cost_basis: Optional[str] = None - - -class VoidLedgerEntryCustomer(BaseModel): - id: str - - external_customer_id: Optional[str] = None - - class VoidLedgerEntry(BaseModel): id: str @@ -254,11 +172,11 @@ class VoidLedgerEntry(BaseModel): created_at: datetime - credit_block: VoidLedgerEntryCreditBlock + credit_block: AffectedBlockModel currency: str - customer: VoidLedgerEntryCustomer + customer: CustomerMinifiedModel description: Optional[str] = None @@ -285,20 +203,6 @@ class VoidLedgerEntry(BaseModel): void_reason: Optional[str] = None -class VoidInitiatedLedgerEntryCreditBlock(BaseModel): - id: str - - expiry_date: Optional[datetime] = None - - per_unit_cost_basis: Optional[str] = None - - -class VoidInitiatedLedgerEntryCustomer(BaseModel): - id: str - - external_customer_id: Optional[str] = None - - class VoidInitiatedLedgerEntry(BaseModel): id: str @@ -306,11 +210,11 @@ class VoidInitiatedLedgerEntry(BaseModel): created_at: datetime - credit_block: VoidInitiatedLedgerEntryCreditBlock + credit_block: AffectedBlockModel currency: str - customer: VoidInitiatedLedgerEntryCustomer + customer: CustomerMinifiedModel description: Optional[str] = None @@ -339,20 +243,6 @@ class VoidInitiatedLedgerEntry(BaseModel): void_reason: Optional[str] = None -class AmendmentLedgerEntryCreditBlock(BaseModel): - id: str - - expiry_date: Optional[datetime] = None - - per_unit_cost_basis: Optional[str] = None - - -class AmendmentLedgerEntryCustomer(BaseModel): - id: str - - external_customer_id: Optional[str] = None - - class AmendmentLedgerEntry(BaseModel): id: str @@ -360,11 +250,11 @@ class AmendmentLedgerEntry(BaseModel): created_at: datetime - credit_block: AmendmentLedgerEntryCreditBlock + credit_block: AffectedBlockModel currency: str - customer: AmendmentLedgerEntryCustomer + customer: CustomerMinifiedModel description: Optional[str] = None @@ -387,7 +277,7 @@ class AmendmentLedgerEntry(BaseModel): starting_balance: float -LedgerListResponse: TypeAlias = Annotated[ +CreditLedgerEntryModel: TypeAlias = Annotated[ Union[ IncrementLedgerEntry, DecrementLedgerEntry, diff --git a/src/orb/types/shared/credit_note_discount_model.py b/src/orb/types/shared/credit_note_discount_model.py new file mode 100644 index 00000000..536b18d4 --- /dev/null +++ b/src/orb/types/shared/credit_note_discount_model.py @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["CreditNoteDiscountModel", "AppliesToPrice"] + + +class AppliesToPrice(BaseModel): + id: str + + name: str + + +class CreditNoteDiscountModel(BaseModel): + amount_applied: str + + discount_type: Literal["percentage"] + + percentage_discount: float + + applies_to_prices: Optional[List[AppliesToPrice]] = None + + reason: Optional[str] = None diff --git a/src/orb/types/credit_note.py b/src/orb/types/shared/credit_note_model.py similarity index 61% rename from src/orb/types/credit_note.py rename to src/orb/types/shared/credit_note_model.py index ac789c61..2988e51c 100644 --- a/src/orb/types/credit_note.py +++ b/src/orb/types/shared/credit_note_model.py @@ -4,36 +4,12 @@ from datetime import datetime from typing_extensions import Literal -from .._models import BaseModel - -__all__ = [ - "CreditNote", - "Customer", - "LineItem", - "LineItemTaxAmount", - "LineItemDiscount", - "MaximumAmountAdjustment", - "MaximumAmountAdjustmentAppliesToPrice", - "Discount", - "DiscountAppliesToPrice", -] - - -class Customer(BaseModel): - id: str - - external_customer_id: Optional[str] = None - - -class LineItemTaxAmount(BaseModel): - amount: str - """The amount of additional tax incurred by this tax rate.""" +from ..._models import BaseModel +from .tax_amount_model import TaxAmountModel +from .customer_minified_model import CustomerMinifiedModel +from .credit_note_discount_model import CreditNoteDiscountModel - tax_rate_description: str - """The human-readable description of the applied tax rate.""" - - tax_rate_percentage: Optional[str] = None - """The tax rate percentage, out of 100.""" +__all__ = ["CreditNoteModel", "LineItem", "LineItemDiscount"] class LineItemDiscount(BaseModel): @@ -71,50 +47,14 @@ class LineItem(BaseModel): subtotal: str """The amount of the line item, excluding any line item minimums and discounts.""" - tax_amounts: List[LineItemTaxAmount] + tax_amounts: List[TaxAmountModel] """Any tax amounts applied onto the line item.""" discounts: Optional[List[LineItemDiscount]] = None """Any line item discounts from the invoice's line item.""" -class MaximumAmountAdjustmentAppliesToPrice(BaseModel): - id: str - - name: str - - -class MaximumAmountAdjustment(BaseModel): - amount_applied: str - - discount_type: Literal["percentage"] - - percentage_discount: float - - applies_to_prices: Optional[List[MaximumAmountAdjustmentAppliesToPrice]] = None - - reason: Optional[str] = None - - -class DiscountAppliesToPrice(BaseModel): - id: str - - name: str - - -class Discount(BaseModel): - amount_applied: str - - discount_type: Literal["percentage"] - - percentage_discount: float - - applies_to_prices: Optional[List[DiscountAppliesToPrice]] = None - - reason: Optional[str] = None - - -class CreditNote(BaseModel): +class CreditNoteModel(BaseModel): id: str """The Orb id of this credit note.""" @@ -127,7 +67,7 @@ class CreditNote(BaseModel): credit_note_pdf: Optional[str] = None """A URL to a PDF of the credit note.""" - customer: Customer + customer: CustomerMinifiedModel invoice_id: str """The id of the invoice resource that this credit note is applied to.""" @@ -135,7 +75,7 @@ class CreditNote(BaseModel): line_items: List[LineItem] """All of the line items associated with this credit note.""" - maximum_amount_adjustment: Optional[MaximumAmountAdjustment] = None + maximum_amount_adjustment: Optional[CreditNoteDiscountModel] = None """The maximum amount applied on the original invoice""" memo: Optional[str] = None @@ -157,5 +97,5 @@ class CreditNote(BaseModel): voided_at: Optional[datetime] = None """The time at which the credit note was voided in Orb, if applicable.""" - discounts: Optional[List[Discount]] = None + discounts: Optional[List[CreditNoteDiscountModel]] = None """Any discounts applied on the original invoice.""" diff --git a/src/orb/types/shared/credit_note_summary_model.py b/src/orb/types/shared/credit_note_summary_model.py new file mode 100644 index 00000000..fa4ccc3d --- /dev/null +++ b/src/orb/types/shared/credit_note_summary_model.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime + +from ..._models import BaseModel + +__all__ = ["CreditNoteSummaryModel"] + + +class CreditNoteSummaryModel(BaseModel): + id: str + + credit_note_number: str + + memo: Optional[str] = None + """An optional memo supplied on the credit note.""" + + reason: str + + total: str + + type: str + + voided_at: Optional[datetime] = None + """ + If the credit note has a status of `void`, this gives a timestamp when the + credit note was voided. + """ diff --git a/src/orb/types/shared/custom_rating_function_config_model.py b/src/orb/types/shared/custom_rating_function_config_model.py new file mode 100644 index 00000000..3d9bd7b1 --- /dev/null +++ b/src/orb/types/shared/custom_rating_function_config_model.py @@ -0,0 +1,8 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict +from typing_extensions import TypeAlias + +__all__ = ["CustomRatingFunctionConfigModel"] + +CustomRatingFunctionConfigModel: TypeAlias = Dict[str, object] diff --git a/src/orb/types/customers/balance_transaction_list_response.py b/src/orb/types/shared/customer_balance_transaction_model.py similarity index 92% rename from src/orb/types/customers/balance_transaction_list_response.py rename to src/orb/types/shared/customer_balance_transaction_model.py index 4f39b39d..8da970b3 100644 --- a/src/orb/types/customers/balance_transaction_list_response.py +++ b/src/orb/types/shared/customer_balance_transaction_model.py @@ -6,7 +6,7 @@ from ..._models import BaseModel -__all__ = ["BalanceTransactionListResponse", "CreditNote", "Invoice"] +__all__ = ["CustomerBalanceTransactionModel", "CreditNote", "Invoice"] class CreditNote(BaseModel): @@ -19,7 +19,7 @@ class Invoice(BaseModel): """The Invoice id""" -class BalanceTransactionListResponse(BaseModel): +class CustomerBalanceTransactionModel(BaseModel): id: str """A unique id for this transaction.""" diff --git a/src/orb/types/shared/customer_costs_model.py b/src/orb/types/shared/customer_costs_model.py new file mode 100644 index 00000000..f91a983a --- /dev/null +++ b/src/orb/types/shared/customer_costs_model.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .aggregated_cost_model import AggregatedCostModel + +__all__ = ["CustomerCostsModel"] + + +class CustomerCostsModel(BaseModel): + data: List[AggregatedCostModel] diff --git a/src/orb/types/customers/credit_list_response.py b/src/orb/types/shared/customer_credit_balances_model.py similarity index 63% rename from src/orb/types/customers/credit_list_response.py rename to src/orb/types/shared/customer_credit_balances_model.py index 7ccbfcf1..7a8627da 100644 --- a/src/orb/types/customers/credit_list_response.py +++ b/src/orb/types/shared/customer_credit_balances_model.py @@ -1,15 +1,16 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import List, Optional from datetime import datetime from typing_extensions import Literal from ..._models import BaseModel +from .pagination_metadata import PaginationMetadata -__all__ = ["CreditListResponse"] +__all__ = ["CustomerCreditBalancesModel", "Data"] -class CreditListResponse(BaseModel): +class Data(BaseModel): id: str balance: float @@ -23,3 +24,9 @@ class CreditListResponse(BaseModel): per_unit_cost_basis: Optional[str] = None status: Literal["active", "pending_payment"] + + +class CustomerCreditBalancesModel(BaseModel): + data: List[Data] + + pagination_metadata: PaginationMetadata diff --git a/src/orb/types/shared/customer_hierarchy_config_model.py b/src/orb/types/shared/customer_hierarchy_config_model.py new file mode 100644 index 00000000..20a07530 --- /dev/null +++ b/src/orb/types/shared/customer_hierarchy_config_model.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["CustomerHierarchyConfigModel"] + + +class CustomerHierarchyConfigModel(BaseModel): + child_customer_ids: Optional[List[str]] = None + """A list of child customer IDs to add to the hierarchy. + + The desired child customers must not already be part of another hierarchy. + """ + + parent_customer_id: Optional[str] = None + """The ID of the parent customer in the hierarchy. + + The desired parent customer must not be a child of another customer. + """ diff --git a/src/orb/types/shared/customer_minified_model.py b/src/orb/types/shared/customer_minified_model.py new file mode 100644 index 00000000..8d17edd5 --- /dev/null +++ b/src/orb/types/shared/customer_minified_model.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel + +__all__ = ["CustomerMinifiedModel"] + + +class CustomerMinifiedModel(BaseModel): + id: str + + external_customer_id: Optional[str] = None diff --git a/src/orb/types/customer.py b/src/orb/types/shared/customer_model.py similarity index 83% rename from src/orb/types/customer.py rename to src/orb/types/shared/customer_model.py index a47f3057..47e35314 100644 --- a/src/orb/types/customer.py +++ b/src/orb/types/shared/customer_model.py @@ -4,225 +4,24 @@ from datetime import datetime from typing_extensions import Literal -from .._models import BaseModel +from ..._models import BaseModel +from .address_model import AddressModel +from .customer_tax_id_model import CustomerTaxIDModel +from .customer_minified_model import CustomerMinifiedModel __all__ = [ - "Customer", - "BillingAddress", + "CustomerModel", "Hierarchy", - "HierarchyChild", - "HierarchyParent", - "ShippingAddress", - "TaxID", "AccountingSyncConfiguration", "AccountingSyncConfigurationAccountingProvider", "ReportingConfiguration", ] -class BillingAddress(BaseModel): - city: Optional[str] = None - - country: Optional[str] = None - - line1: Optional[str] = None - - line2: Optional[str] = None - - postal_code: Optional[str] = None - - state: Optional[str] = None - - -class HierarchyChild(BaseModel): - id: str - - external_customer_id: Optional[str] = None - - -class HierarchyParent(BaseModel): - id: str - - external_customer_id: Optional[str] = None - - class Hierarchy(BaseModel): - children: List[HierarchyChild] - - parent: Optional[HierarchyParent] = None - - -class ShippingAddress(BaseModel): - city: Optional[str] = None - - country: Optional[str] = None - - line1: Optional[str] = None - - line2: Optional[str] = None - - postal_code: Optional[str] = None - - state: Optional[str] = None - - -class TaxID(BaseModel): - country: Literal[ - "AD", - "AE", - "AR", - "AT", - "AU", - "BE", - "BG", - "BH", - "BO", - "BR", - "CA", - "CH", - "CL", - "CN", - "CO", - "CR", - "CY", - "CZ", - "DE", - "DK", - "EE", - "DO", - "EC", - "EG", - "ES", - "EU", - "FI", - "FR", - "GB", - "GE", - "GR", - "HK", - "HR", - "HU", - "ID", - "IE", - "IL", - "IN", - "IS", - "IT", - "JP", - "KE", - "KR", - "KZ", - "LI", - "LT", - "LU", - "LV", - "MT", - "MX", - "MY", - "NG", - "NL", - "NO", - "NZ", - "OM", - "PE", - "PH", - "PL", - "PT", - "RO", - "RS", - "RU", - "SA", - "SE", - "SG", - "SI", - "SK", - "SV", - "TH", - "TR", - "TW", - "UA", - "US", - "UY", - "VE", - "VN", - "ZA", - ] - - type: Literal[ - "ad_nrt", - "ae_trn", - "ar_cuit", - "eu_vat", - "au_abn", - "au_arn", - "bg_uic", - "bh_vat", - "bo_tin", - "br_cnpj", - "br_cpf", - "ca_bn", - "ca_gst_hst", - "ca_pst_bc", - "ca_pst_mb", - "ca_pst_sk", - "ca_qst", - "ch_vat", - "cl_tin", - "cn_tin", - "co_nit", - "cr_tin", - "do_rcn", - "ec_ruc", - "eg_tin", - "es_cif", - "eu_oss_vat", - "gb_vat", - "ge_vat", - "hk_br", - "hu_tin", - "id_npwp", - "il_vat", - "in_gst", - "is_vat", - "jp_cn", - "jp_rn", - "jp_trn", - "ke_pin", - "kr_brn", - "kz_bin", - "li_uid", - "mx_rfc", - "my_frp", - "my_itn", - "my_sst", - "ng_tin", - "no_vat", - "no_voec", - "nz_gst", - "om_vat", - "pe_ruc", - "ph_tin", - "ro_tin", - "rs_pib", - "ru_inn", - "ru_kpp", - "sa_vat", - "sg_gst", - "sg_uen", - "si_tin", - "sv_nit", - "th_vat", - "tr_tin", - "tw_vat", - "ua_vat", - "us_ein", - "uy_ruc", - "ve_rif", - "vn_tin", - "za_vat", - ] - - value: str + children: List[CustomerMinifiedModel] + + parent: Optional[CustomerMinifiedModel] = None class AccountingSyncConfigurationAccountingProvider(BaseModel): @@ -241,7 +40,7 @@ class ReportingConfiguration(BaseModel): exempt: bool -class Customer(BaseModel): +class CustomerModel(BaseModel): id: str additional_emails: List[str] @@ -251,7 +50,7 @@ class Customer(BaseModel): balance: str """The customer's current balance in their currency.""" - billing_address: Optional[BillingAddress] = None + billing_address: Optional[AddressModel] = None created_at: datetime @@ -304,9 +103,9 @@ class Customer(BaseModel): portal_url: Optional[str] = None - shipping_address: Optional[ShippingAddress] = None + shipping_address: Optional[AddressModel] = None - tax_id: Optional[TaxID] = None + tax_id: Optional[CustomerTaxIDModel] = None """ Tax IDs are commonly required to be displayed on customer invoices, which are added to the headers of invoices. diff --git a/src/orb/types/shared/customer_tax_id_model.py b/src/orb/types/shared/customer_tax_id_model.py new file mode 100644 index 00000000..3f42c2f4 --- /dev/null +++ b/src/orb/types/shared/customer_tax_id_model.py @@ -0,0 +1,166 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["CustomerTaxIDModel"] + + +class CustomerTaxIDModel(BaseModel): + country: Literal[ + "AD", + "AE", + "AR", + "AT", + "AU", + "BE", + "BG", + "BH", + "BO", + "BR", + "CA", + "CH", + "CL", + "CN", + "CO", + "CR", + "CY", + "CZ", + "DE", + "DK", + "EE", + "DO", + "EC", + "EG", + "ES", + "EU", + "FI", + "FR", + "GB", + "GE", + "GR", + "HK", + "HR", + "HU", + "ID", + "IE", + "IL", + "IN", + "IS", + "IT", + "JP", + "KE", + "KR", + "KZ", + "LI", + "LT", + "LU", + "LV", + "MT", + "MX", + "MY", + "NG", + "NL", + "NO", + "NZ", + "OM", + "PE", + "PH", + "PL", + "PT", + "RO", + "RS", + "RU", + "SA", + "SE", + "SG", + "SI", + "SK", + "SV", + "TH", + "TR", + "TW", + "UA", + "US", + "UY", + "VE", + "VN", + "ZA", + ] + + type: Literal[ + "ad_nrt", + "ae_trn", + "ar_cuit", + "eu_vat", + "au_abn", + "au_arn", + "bg_uic", + "bh_vat", + "bo_tin", + "br_cnpj", + "br_cpf", + "ca_bn", + "ca_gst_hst", + "ca_pst_bc", + "ca_pst_mb", + "ca_pst_sk", + "ca_qst", + "ch_vat", + "cl_tin", + "cn_tin", + "co_nit", + "cr_tin", + "do_rcn", + "ec_ruc", + "eg_tin", + "es_cif", + "eu_oss_vat", + "gb_vat", + "ge_vat", + "hk_br", + "hu_tin", + "id_npwp", + "il_vat", + "in_gst", + "is_vat", + "jp_cn", + "jp_rn", + "jp_trn", + "ke_pin", + "kr_brn", + "kz_bin", + "li_uid", + "mx_rfc", + "my_frp", + "my_itn", + "my_sst", + "ng_tin", + "no_vat", + "no_voec", + "nz_gst", + "om_vat", + "pe_ruc", + "ph_tin", + "ro_tin", + "rs_pib", + "ru_inn", + "ru_kpp", + "sa_vat", + "sg_gst", + "sg_uen", + "si_tin", + "sv_nit", + "th_vat", + "tr_tin", + "tw_vat", + "ua_vat", + "us_ein", + "uy_ruc", + "ve_rif", + "vn_tin", + "za_vat", + ] + + value: str diff --git a/src/orb/types/shared/dimensional_price_configuration_model.py b/src/orb/types/shared/dimensional_price_configuration_model.py new file mode 100644 index 00000000..a59ca8e5 --- /dev/null +++ b/src/orb/types/shared/dimensional_price_configuration_model.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel + +__all__ = ["DimensionalPriceConfigurationModel"] + + +class DimensionalPriceConfigurationModel(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str diff --git a/src/orb/types/dimensional_price_group.py b/src/orb/types/shared/dimensional_price_group_model.py similarity index 88% rename from src/orb/types/dimensional_price_group.py rename to src/orb/types/shared/dimensional_price_group_model.py index da103128..f57ae0dd 100644 --- a/src/orb/types/dimensional_price_group.py +++ b/src/orb/types/shared/dimensional_price_group_model.py @@ -2,12 +2,12 @@ from typing import Dict, List, Optional -from .._models import BaseModel +from ..._models import BaseModel -__all__ = ["DimensionalPriceGroup"] +__all__ = ["DimensionalPriceGroupModel"] -class DimensionalPriceGroup(BaseModel): +class DimensionalPriceGroupModel(BaseModel): id: str billable_metric_id: str diff --git a/src/orb/types/shared/discount_model.py b/src/orb/types/shared/discount_model.py new file mode 100644 index 00000000..8f7c825b --- /dev/null +++ b/src/orb/types/shared/discount_model.py @@ -0,0 +1,35 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias + +from ..._utils import PropertyInfo +from ..._models import BaseModel +from .trial_discount import TrialDiscount +from .amount_discount import AmountDiscount +from .percentage_discount import PercentageDiscount + +__all__ = ["DiscountModel", "UsageDiscount"] + + +class UsageDiscount(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this discount applies to. + + For plan/plan phase discounts, this can be a subset of prices. + """ + + discount_type: Literal["usage"] + + usage_discount: float + """Only available if discount_type is `usage`. + + Number of usage units that this discount is for + """ + + reason: Optional[str] = None + + +DiscountModel: TypeAlias = Annotated[ + Union[PercentageDiscount, TrialDiscount, UsageDiscount, AmountDiscount], PropertyInfo(discriminator="discount_type") +] diff --git a/src/orb/types/shared/discount_override_model.py b/src/orb/types/shared/discount_override_model.py new file mode 100644 index 00000000..39134976 --- /dev/null +++ b/src/orb/types/shared/discount_override_model.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["DiscountOverrideModel"] + + +class DiscountOverrideModel(BaseModel): + discount_type: Literal["percentage", "usage", "amount"] + + amount_discount: Optional[str] = None + """Only available if discount_type is `amount`.""" + + percentage_discount: Optional[float] = None + """Only available if discount_type is `percentage`. + + This is a number between 0 and 1. + """ + + usage_discount: Optional[float] = None + """Only available if discount_type is `usage`. + + Number of usage units that this discount is for + """ diff --git a/src/orb/types/shared/edit_customer_model.py b/src/orb/types/shared/edit_customer_model.py new file mode 100644 index 00000000..82943be8 --- /dev/null +++ b/src/orb/types/shared/edit_customer_model.py @@ -0,0 +1,196 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Optional +from typing_extensions import Literal + +from ..._models import BaseModel +from .address_input_model import AddressInputModel +from .customer_tax_id_model import CustomerTaxIDModel +from .new_tax_configuration_model import NewTaxConfigurationModel +from .customer_hierarchy_config_model import CustomerHierarchyConfigModel +from .new_reporting_configuration_model import NewReportingConfigurationModel +from .new_accounting_sync_configuration_model import NewAccountingSyncConfigurationModel + +__all__ = ["EditCustomerModel"] + + +class EditCustomerModel(BaseModel): + accounting_sync_configuration: Optional[NewAccountingSyncConfigurationModel] = None + + additional_emails: Optional[List[str]] = None + """Additional email addresses for this customer. + + If populated, these email addresses will be CC'd for customer communications. + """ + + auto_collection: Optional[bool] = None + """ + Used to determine if invoices for this customer will automatically attempt to + charge a saved payment method, if available. This parameter defaults to `True` + when a payment provider is provided on customer creation. + """ + + billing_address: Optional[AddressInputModel] = None + + currency: Optional[str] = None + """An ISO 4217 currency string used for the customer's invoices and balance. + + If not set at creation time, will be set at subscription creation time. + """ + + email: Optional[str] = None + """A valid customer email, to be used for invoicing and notifications.""" + + email_delivery: Optional[bool] = None + + external_customer_id: Optional[str] = None + """The external customer ID. + + This can only be set if empty and the customer has no past or current + subscriptions. + """ + + hierarchy: Optional[CustomerHierarchyConfigModel] = None + """The hierarchical relationships for this customer.""" + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + name: Optional[str] = None + """The full name of the customer""" + + payment_provider: Optional[Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite"]] = None + """This is used for creating charges or invoices in an external system via Orb. + + When not in test mode: + + - the connection must first be configured in the Orb webapp. + - if the provider is an invoicing provider (`stripe_invoice`, `quickbooks`, + `bill.com`, `netsuite`), any product mappings must first be configured with + the Orb team. + """ + + payment_provider_id: Optional[str] = None + """The ID of this customer in an external payments solution, such as Stripe. + + This is used for creating charges or invoices in the external system via Orb. + """ + + reporting_configuration: Optional[NewReportingConfigurationModel] = None + + shipping_address: Optional[AddressInputModel] = None + + tax_configuration: Optional[NewTaxConfigurationModel] = None + + tax_id: Optional[CustomerTaxIDModel] = None + """ + Tax IDs are commonly required to be displayed on customer invoices, which are + added to the headers of invoices. + + ### Supported Tax ID Countries and Types + + | Country | Type | Description | + | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- | + | Andorra | `ad_nrt` | Andorran NRT Number | + | Argentina | `ar_cuit` | Argentinian Tax ID Number | + | Australia | `au_abn` | Australian Business Number (AU ABN) | + | Australia | `au_arn` | Australian Taxation Office Reference Number | + | Austria | `eu_vat` | European VAT Number | + | Bahrain | `bh_vat` | Bahraini VAT Number | + | Belgium | `eu_vat` | European VAT Number | + | Bolivia | `bo_tin` | Bolivian Tax ID | + | Brazil | `br_cnpj` | Brazilian CNPJ Number | + | Brazil | `br_cpf` | Brazilian CPF Number | + | Bulgaria | `bg_uic` | Bulgaria Unified Identification Code | + | Bulgaria | `eu_vat` | European VAT Number | + | Canada | `ca_bn` | Canadian BN | + | Canada | `ca_gst_hst` | Canadian GST/HST Number | + | Canada | `ca_pst_bc` | Canadian PST Number (British Columbia) | + | Canada | `ca_pst_mb` | Canadian PST Number (Manitoba) | + | Canada | `ca_pst_sk` | Canadian PST Number (Saskatchewan) | + | Canada | `ca_qst` | Canadian QST Number (Québec) | + | Chile | `cl_tin` | Chilean TIN | + | China | `cn_tin` | Chinese Tax ID | + | Colombia | `co_nit` | Colombian NIT Number | + | Costa Rica | `cr_tin` | Costa Rican Tax ID | + | Croatia | `eu_vat` | European VAT Number | + | Cyprus | `eu_vat` | European VAT Number | + | Czech Republic | `eu_vat` | European VAT Number | + | Denmark | `eu_vat` | European VAT Number | + | Dominican Republic | `do_rcn` | Dominican RCN Number | + | Ecuador | `ec_ruc` | Ecuadorian RUC Number | + | Egypt | `eg_tin` | Egyptian Tax Identification Number | + | El Salvador | `sv_nit` | El Salvadorian NIT Number | + | Estonia | `eu_vat` | European VAT Number | + | EU | `eu_oss_vat` | European One Stop Shop VAT Number for non-Union scheme | + | Finland | `eu_vat` | European VAT Number | + | France | `eu_vat` | European VAT Number | + | Georgia | `ge_vat` | Georgian VAT | + | Germany | `eu_vat` | European VAT Number | + | Greece | `eu_vat` | European VAT Number | + | Hong Kong | `hk_br` | Hong Kong BR Number | + | Hungary | `eu_vat` | European VAT Number | + | Hungary | `hu_tin` | Hungary Tax Number (adószám) | + | Iceland | `is_vat` | Icelandic VAT | + | India | `in_gst` | Indian GST Number | + | Indonesia | `id_npwp` | Indonesian NPWP Number | + | Ireland | `eu_vat` | European VAT Number | + | Israel | `il_vat` | Israel VAT | + | Italy | `eu_vat` | European VAT Number | + | Japan | `jp_cn` | Japanese Corporate Number (_Hōjin Bangō_) | + | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) | + | Japan | `jp_trn` | Japanese Tax Registration Number (_Tōroku Bangō_) | + | Kazakhstan | `kz_bin` | Kazakhstani Business Identification Number | + | Kenya | `ke_pin` | Kenya Revenue Authority Personal Identification Number | + | Latvia | `eu_vat` | European VAT Number | + | Liechtenstein | `li_uid` | Liechtensteinian UID Number | + | Lithuania | `eu_vat` | European VAT Number | + | Luxembourg | `eu_vat` | European VAT Number | + | Malaysia | `my_frp` | Malaysian FRP Number | + | Malaysia | `my_itn` | Malaysian ITN | + | Malaysia | `my_sst` | Malaysian SST Number | + | Malta | `eu_vat ` | European VAT Number | + | Mexico | `mx_rfc` | Mexican RFC Number | + | Netherlands | `eu_vat` | European VAT Number | + | New Zealand | `nz_gst` | New Zealand GST Number | + | Nigeria | `ng_tin` | Nigerian Tax Identification Number | + | Norway | `no_vat` | Norwegian VAT Number | + | Norway | `no_voec` | Norwegian VAT on e-commerce Number | + | Oman | `om_vat` | Omani VAT Number | + | Peru | `pe_ruc` | Peruvian RUC Number | + | Philippines | `ph_tin ` | Philippines Tax Identification Number | + | Poland | `eu_vat` | European VAT Number | + | Portugal | `eu_vat` | European VAT Number | + | Romania | `eu_vat` | European VAT Number | + | Romania | `ro_tin` | Romanian Tax ID Number | + | Russia | `ru_inn` | Russian INN | + | Russia | `ru_kpp` | Russian KPP | + | Saudi Arabia | `sa_vat` | Saudi Arabia VAT | + | Serbia | `rs_pib` | Serbian PIB Number | + | Singapore | `sg_gst` | Singaporean GST | + | Singapore | `sg_uen` | Singaporean UEN | + | Slovakia | `eu_vat` | European VAT Number | + | Slovenia | `eu_vat` | European VAT Number | + | Slovenia | `si_tin` | Slovenia Tax Number (davčna številka) | + | South Africa | `za_vat` | South African VAT Number | + | South Korea | `kr_brn` | Korean BRN | + | Spain | `es_cif` | Spanish NIF Number (previously Spanish CIF Number) | + | Spain | `eu_vat` | European VAT Number | + | Sweden | `eu_vat` | European VAT Number | + | Switzerland | `ch_vat` | Switzerland VAT Number | + | Taiwan | `tw_vat` | Taiwanese VAT | + | Thailand | `th_vat` | Thai VAT | + | Turkey | `tr_tin` | Turkish Tax Identification Number | + | Ukraine | `ua_vat` | Ukrainian VAT | + | United Arab Emirates | `ae_trn` | United Arab Emirates TRN | + | United Kingdom | `eu_vat` | Northern Ireland VAT Number | + | United Kingdom | `gb_vat` | United Kingdom VAT Number | + | United States | `us_ein` | United States EIN | + | Uruguay | `uy_ruc` | Uruguayan RUC Number | + | Venezuela | `ve_rif` | Venezuelan RIF Number | + | Vietnam | `vn_tin` | Vietnamese Tax ID Number | + """ diff --git a/src/orb/types/shared/edit_plan_model.py b/src/orb/types/shared/edit_plan_model.py new file mode 100644 index 00000000..427050f9 --- /dev/null +++ b/src/orb/types/shared/edit_plan_model.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, Optional + +from ..._models import BaseModel + +__all__ = ["EditPlanModel"] + + +class EditPlanModel(BaseModel): + external_plan_id: Optional[str] = None + """ + An optional user-defined ID for this plan resource, used throughout the system + as an alias for this Plan. Use this field to identify a plan by an existing + identifier in your system. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ diff --git a/src/orb/types/shared/fixed_fee_quantity_schedule_entry_model.py b/src/orb/types/shared/fixed_fee_quantity_schedule_entry_model.py new file mode 100644 index 00000000..5e428650 --- /dev/null +++ b/src/orb/types/shared/fixed_fee_quantity_schedule_entry_model.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime + +from ..._models import BaseModel + +__all__ = ["FixedFeeQuantityScheduleEntryModel"] + + +class FixedFeeQuantityScheduleEntryModel(BaseModel): + end_date: Optional[datetime] = None + + price_id: str + + quantity: float + + start_date: datetime diff --git a/src/orb/types/shared/invoice_level_discount_model.py b/src/orb/types/shared/invoice_level_discount_model.py new file mode 100644 index 00000000..c8b3dc02 --- /dev/null +++ b/src/orb/types/shared/invoice_level_discount_model.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union +from typing_extensions import Annotated, TypeAlias + +from ..._utils import PropertyInfo +from .trial_discount import TrialDiscount +from .amount_discount import AmountDiscount +from .percentage_discount import PercentageDiscount + +__all__ = ["InvoiceLevelDiscountModel"] + +InvoiceLevelDiscountModel: TypeAlias = Annotated[ + Union[PercentageDiscount, AmountDiscount, TrialDiscount], PropertyInfo(discriminator="discount_type") +] diff --git a/src/orb/types/invoice_line_item_create_response.py b/src/orb/types/shared/invoice_line_item_model.py similarity index 80% rename from src/orb/types/invoice_line_item_create_response.py rename to src/orb/types/shared/invoice_line_item_model.py index b046e206..10af6ef7 100644 --- a/src/orb/types/invoice_line_item_create_response.py +++ b/src/orb/types/shared/invoice_line_item_model.py @@ -4,31 +4,29 @@ from datetime import datetime from typing_extensions import Literal, Annotated, TypeAlias -from .price import Price -from .._utils import PropertyInfo -from .._models import BaseModel -from .shared.discount import Discount +from ..._utils import PropertyInfo +from .discount import Discount +from ..._models import BaseModel +from .price_model import PriceModel +from .maximum_model import MaximumModel +from .minimum_model import MinimumModel +from .tax_amount_model import TaxAmountModel +from .sub_line_item_grouping_model import SubLineItemGroupingModel __all__ = [ - "InvoiceLineItemCreateResponse", + "InvoiceLineItemModel", "Adjustment", "AdjustmentMonetaryUsageDiscountAdjustment", "AdjustmentMonetaryAmountDiscountAdjustment", "AdjustmentMonetaryPercentageDiscountAdjustment", "AdjustmentMonetaryMinimumAdjustment", "AdjustmentMonetaryMaximumAdjustment", - "Maximum", - "Minimum", "SubLineItem", "SubLineItemMatrixSubLineItem", - "SubLineItemMatrixSubLineItemGrouping", "SubLineItemMatrixSubLineItemMatrixConfig", "SubLineItemTierSubLineItem", - "SubLineItemTierSubLineItemGrouping", "SubLineItemTierSubLineItemTierConfig", "SubLineItemOtherSubLineItem", - "SubLineItemOtherSubLineItemGrouping", - "TaxAmount", ] @@ -182,35 +180,6 @@ class AdjustmentMonetaryMaximumAdjustment(BaseModel): ] -class Maximum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this maximum amount applies to. - - For plan/plan phase maximums, this can be a subset of prices. - """ - - maximum_amount: str - """Maximum amount applied""" - - -class Minimum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this minimum amount applies to. - - For plan/plan phase minimums, this can be a subset of prices. - """ - - minimum_amount: str - """Minimum amount applied""" - - -class SubLineItemMatrixSubLineItemGrouping(BaseModel): - key: str - - value: Optional[str] = None - """No value indicates the default group""" - - class SubLineItemMatrixSubLineItemMatrixConfig(BaseModel): dimension_values: List[Optional[str]] """The ordered dimension values for this line item.""" @@ -220,7 +189,7 @@ class SubLineItemMatrixSubLineItem(BaseModel): amount: str """The total amount for this sub line item.""" - grouping: Optional[SubLineItemMatrixSubLineItemGrouping] = None + grouping: Optional[SubLineItemGroupingModel] = None matrix_config: SubLineItemMatrixSubLineItemMatrixConfig @@ -231,13 +200,6 @@ class SubLineItemMatrixSubLineItem(BaseModel): type: Literal["matrix"] -class SubLineItemTierSubLineItemGrouping(BaseModel): - key: str - - value: Optional[str] = None - """No value indicates the default group""" - - class SubLineItemTierSubLineItemTierConfig(BaseModel): first_unit: float @@ -250,7 +212,7 @@ class SubLineItemTierSubLineItem(BaseModel): amount: str """The total amount for this sub line item.""" - grouping: Optional[SubLineItemTierSubLineItemGrouping] = None + grouping: Optional[SubLineItemGroupingModel] = None name: str @@ -261,18 +223,11 @@ class SubLineItemTierSubLineItem(BaseModel): type: Literal["tier"] -class SubLineItemOtherSubLineItemGrouping(BaseModel): - key: str - - value: Optional[str] = None - """No value indicates the default group""" - - class SubLineItemOtherSubLineItem(BaseModel): amount: str """The total amount for this sub line item.""" - grouping: Optional[SubLineItemOtherSubLineItemGrouping] = None + grouping: Optional[SubLineItemGroupingModel] = None name: str @@ -287,18 +242,7 @@ class SubLineItemOtherSubLineItem(BaseModel): ] -class TaxAmount(BaseModel): - amount: str - """The amount of additional tax incurred by this tax rate.""" - - tax_rate_description: str - """The human-readable description of the applied tax rate.""" - - tax_rate_percentage: Optional[str] = None - """The tax rate percentage, out of 100.""" - - -class InvoiceLineItemCreateResponse(BaseModel): +class InvoiceLineItemModel(BaseModel): id: str """A unique ID for this line item.""" @@ -335,13 +279,13 @@ class InvoiceLineItemCreateResponse(BaseModel): values for this particular grouping. """ - maximum: Optional[Maximum] = None + maximum: Optional[MaximumModel] = None """This field is deprecated in favor of `adjustments`.""" maximum_amount: Optional[str] = None """This field is deprecated in favor of `adjustments`.""" - minimum: Optional[Minimum] = None + minimum: Optional[MinimumModel] = None """This field is deprecated in favor of `adjustments`.""" minimum_amount: Optional[str] = None @@ -353,7 +297,7 @@ class InvoiceLineItemCreateResponse(BaseModel): partially_invoiced_amount: str """Any amount applied from a partial invoice""" - price: Optional[Price] = None + price: Optional[PriceModel] = None """ The Price resource represents a price that can be billed on a subscription, resulting in a charge on an invoice in the form of an invoice line item. Prices @@ -382,7 +326,7 @@ class InvoiceLineItemCreateResponse(BaseModel): subtotal: str """The line amount before before any adjustments.""" - tax_amounts: List[TaxAmount] + tax_amounts: List[TaxAmountModel] """An array of tax rates and their incurred tax amounts. Empty if no tax integration is configured. diff --git a/src/orb/types/invoice.py b/src/orb/types/shared/invoice_model.py similarity index 51% rename from src/orb/types/invoice.py rename to src/orb/types/shared/invoice_model.py index ebc09d4e..db2238ba 100644 --- a/src/orb/types/invoice.py +++ b/src/orb/types/shared/invoice_model.py @@ -1,756 +1,27 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, List, Union, Optional +from typing import Dict, List, Optional from datetime import datetime -from typing_extensions import Literal, Annotated, TypeAlias - -from .price import Price -from .._utils import PropertyInfo -from .._models import BaseModel -from .shared.discount import Discount -from .shared.invoice_level_discount import InvoiceLevelDiscount - -__all__ = [ - "Invoice", - "AutoCollection", - "BillingAddress", - "CreditNote", - "Customer", - "CustomerBalanceTransaction", - "CustomerBalanceTransactionCreditNote", - "CustomerBalanceTransactionInvoice", - "CustomerTaxID", - "LineItem", - "LineItemAdjustment", - "LineItemAdjustmentMonetaryUsageDiscountAdjustment", - "LineItemAdjustmentMonetaryAmountDiscountAdjustment", - "LineItemAdjustmentMonetaryPercentageDiscountAdjustment", - "LineItemAdjustmentMonetaryMinimumAdjustment", - "LineItemAdjustmentMonetaryMaximumAdjustment", - "LineItemMaximum", - "LineItemMinimum", - "LineItemSubLineItem", - "LineItemSubLineItemMatrixSubLineItem", - "LineItemSubLineItemMatrixSubLineItemGrouping", - "LineItemSubLineItemMatrixSubLineItemMatrixConfig", - "LineItemSubLineItemTierSubLineItem", - "LineItemSubLineItemTierSubLineItemGrouping", - "LineItemSubLineItemTierSubLineItemTierConfig", - "LineItemSubLineItemOtherSubLineItem", - "LineItemSubLineItemOtherSubLineItemGrouping", - "LineItemTaxAmount", - "Maximum", - "Minimum", - "PaymentAttempt", - "ShippingAddress", - "Subscription", -] - - -class AutoCollection(BaseModel): - enabled: Optional[bool] = None - """True only if auto-collection is enabled for this invoice.""" - - next_attempt_at: Optional[datetime] = None - """ - If the invoice is scheduled for auto-collection, this field will reflect when - the next attempt will occur. If dunning has been exhausted, or auto-collection - is not enabled for this invoice, this field will be `null`. - """ - - num_attempts: Optional[int] = None - """Number of auto-collection payment attempts.""" - - previously_attempted_at: Optional[datetime] = None - """ - If Orb has ever attempted payment auto-collection for this invoice, this field - will reflect when that attempt occurred. In conjunction with `next_attempt_at`, - this can be used to tell whether the invoice is currently in dunning (that is, - `previously_attempted_at` is non-null, and `next_attempt_time` is non-null), or - if dunning has been exhausted (`previously_attempted_at` is non-null, but - `next_attempt_time` is null). - """ - - -class BillingAddress(BaseModel): - city: Optional[str] = None - - country: Optional[str] = None - - line1: Optional[str] = None - - line2: Optional[str] = None - - postal_code: Optional[str] = None - - state: Optional[str] = None - - -class CreditNote(BaseModel): - id: str - - credit_note_number: str - - memo: Optional[str] = None - """An optional memo supplied on the credit note.""" - - reason: str - - total: str - - type: str - - voided_at: Optional[datetime] = None - """ - If the credit note has a status of `void`, this gives a timestamp when the - credit note was voided. - """ - - -class Customer(BaseModel): - id: str - - external_customer_id: Optional[str] = None - - -class CustomerBalanceTransactionCreditNote(BaseModel): - id: str - """The id of the Credit note""" - - -class CustomerBalanceTransactionInvoice(BaseModel): - id: str - """The Invoice id""" - - -class CustomerBalanceTransaction(BaseModel): - id: str - """A unique id for this transaction.""" - - action: Literal[ - "applied_to_invoice", - "manual_adjustment", - "prorated_refund", - "revert_prorated_refund", - "return_from_voiding", - "credit_note_applied", - "credit_note_voided", - "overpayment_refund", - "external_payment", - ] - - amount: str - """The value of the amount changed in the transaction.""" - - created_at: datetime - """The creation time of this transaction.""" - - credit_note: Optional[CustomerBalanceTransactionCreditNote] = None - - description: Optional[str] = None - """An optional description provided for manual customer balance adjustments.""" - - ending_balance: str - """ - The new value of the customer's balance prior to the transaction, in the - customer's currency. - """ - - invoice: Optional[CustomerBalanceTransactionInvoice] = None - - starting_balance: str - """ - The original value of the customer's balance prior to the transaction, in the - customer's currency. - """ - - type: Literal["increment", "decrement"] - - -class CustomerTaxID(BaseModel): - country: Literal[ - "AD", - "AE", - "AR", - "AT", - "AU", - "BE", - "BG", - "BH", - "BO", - "BR", - "CA", - "CH", - "CL", - "CN", - "CO", - "CR", - "CY", - "CZ", - "DE", - "DK", - "EE", - "DO", - "EC", - "EG", - "ES", - "EU", - "FI", - "FR", - "GB", - "GE", - "GR", - "HK", - "HR", - "HU", - "ID", - "IE", - "IL", - "IN", - "IS", - "IT", - "JP", - "KE", - "KR", - "KZ", - "LI", - "LT", - "LU", - "LV", - "MT", - "MX", - "MY", - "NG", - "NL", - "NO", - "NZ", - "OM", - "PE", - "PH", - "PL", - "PT", - "RO", - "RS", - "RU", - "SA", - "SE", - "SG", - "SI", - "SK", - "SV", - "TH", - "TR", - "TW", - "UA", - "US", - "UY", - "VE", - "VN", - "ZA", - ] - - type: Literal[ - "ad_nrt", - "ae_trn", - "ar_cuit", - "eu_vat", - "au_abn", - "au_arn", - "bg_uic", - "bh_vat", - "bo_tin", - "br_cnpj", - "br_cpf", - "ca_bn", - "ca_gst_hst", - "ca_pst_bc", - "ca_pst_mb", - "ca_pst_sk", - "ca_qst", - "ch_vat", - "cl_tin", - "cn_tin", - "co_nit", - "cr_tin", - "do_rcn", - "ec_ruc", - "eg_tin", - "es_cif", - "eu_oss_vat", - "gb_vat", - "ge_vat", - "hk_br", - "hu_tin", - "id_npwp", - "il_vat", - "in_gst", - "is_vat", - "jp_cn", - "jp_rn", - "jp_trn", - "ke_pin", - "kr_brn", - "kz_bin", - "li_uid", - "mx_rfc", - "my_frp", - "my_itn", - "my_sst", - "ng_tin", - "no_vat", - "no_voec", - "nz_gst", - "om_vat", - "pe_ruc", - "ph_tin", - "ro_tin", - "rs_pib", - "ru_inn", - "ru_kpp", - "sa_vat", - "sg_gst", - "sg_uen", - "si_tin", - "sv_nit", - "th_vat", - "tr_tin", - "tw_vat", - "ua_vat", - "us_ein", - "uy_ruc", - "ve_rif", - "vn_tin", - "za_vat", - ] - - value: str - - -class LineItemAdjustmentMonetaryUsageDiscountAdjustment(BaseModel): - id: str - - adjustment_type: Literal["usage_discount"] - - amount: str - """The value applied by an adjustment.""" - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - reason: Optional[str] = None - """The reason for the adjustment.""" - - usage_discount: float - """ - The number of usage units by which to discount the price this adjustment applies - to in a given billing period. - """ - - -class LineItemAdjustmentMonetaryAmountDiscountAdjustment(BaseModel): - id: str - - adjustment_type: Literal["amount_discount"] - - amount: str - """The value applied by an adjustment.""" - - amount_discount: str - """ - The amount by which to discount the prices this adjustment applies to in a given - billing period. - """ - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -class LineItemAdjustmentMonetaryPercentageDiscountAdjustment(BaseModel): - id: str - - adjustment_type: Literal["percentage_discount"] - - amount: str - """The value applied by an adjustment.""" - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - percentage_discount: float - """ - The percentage (as a value between 0 and 1) by which to discount the price - intervals this adjustment applies to in a given billing period. - """ - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -class LineItemAdjustmentMonetaryMinimumAdjustment(BaseModel): - id: str - - adjustment_type: Literal["minimum"] - - amount: str - """The value applied by an adjustment.""" - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - item_id: str - """The item ID that revenue from this minimum will be attributed to.""" - - minimum_amount: str - """ - The minimum amount to charge in a given billing period for the prices this - adjustment applies to. - """ - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -class LineItemAdjustmentMonetaryMaximumAdjustment(BaseModel): - id: str - - adjustment_type: Literal["maximum"] - - amount: str - """The value applied by an adjustment.""" - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - maximum_amount: str - """ - The maximum amount to charge in a given billing period for the prices this - adjustment applies to. - """ - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -LineItemAdjustment: TypeAlias = Annotated[ - Union[ - LineItemAdjustmentMonetaryUsageDiscountAdjustment, - LineItemAdjustmentMonetaryAmountDiscountAdjustment, - LineItemAdjustmentMonetaryPercentageDiscountAdjustment, - LineItemAdjustmentMonetaryMinimumAdjustment, - LineItemAdjustmentMonetaryMaximumAdjustment, - ], - PropertyInfo(discriminator="adjustment_type"), -] - - -class LineItemMaximum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this maximum amount applies to. - - For plan/plan phase maximums, this can be a subset of prices. - """ - - maximum_amount: str - """Maximum amount applied""" - - -class LineItemMinimum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this minimum amount applies to. - - For plan/plan phase minimums, this can be a subset of prices. - """ - - minimum_amount: str - """Minimum amount applied""" - - -class LineItemSubLineItemMatrixSubLineItemGrouping(BaseModel): - key: str - - value: Optional[str] = None - """No value indicates the default group""" - - -class LineItemSubLineItemMatrixSubLineItemMatrixConfig(BaseModel): - dimension_values: List[Optional[str]] - """The ordered dimension values for this line item.""" - - -class LineItemSubLineItemMatrixSubLineItem(BaseModel): - amount: str - """The total amount for this sub line item.""" - - grouping: Optional[LineItemSubLineItemMatrixSubLineItemGrouping] = None - - matrix_config: LineItemSubLineItemMatrixSubLineItemMatrixConfig - - name: str - - quantity: float - - type: Literal["matrix"] - - -class LineItemSubLineItemTierSubLineItemGrouping(BaseModel): - key: str - - value: Optional[str] = None - """No value indicates the default group""" - - -class LineItemSubLineItemTierSubLineItemTierConfig(BaseModel): - first_unit: float - - last_unit: Optional[float] = None - - unit_amount: str - - -class LineItemSubLineItemTierSubLineItem(BaseModel): - amount: str - """The total amount for this sub line item.""" - - grouping: Optional[LineItemSubLineItemTierSubLineItemGrouping] = None - - name: str - - quantity: float - - tier_config: LineItemSubLineItemTierSubLineItemTierConfig - - type: Literal["tier"] - - -class LineItemSubLineItemOtherSubLineItemGrouping(BaseModel): - key: str - - value: Optional[str] = None - """No value indicates the default group""" - - -class LineItemSubLineItemOtherSubLineItem(BaseModel): - amount: str - """The total amount for this sub line item.""" - - grouping: Optional[LineItemSubLineItemOtherSubLineItemGrouping] = None - - name: str - - quantity: float - - type: Literal["'null'"] - - -LineItemSubLineItem: TypeAlias = Annotated[ - Union[ - LineItemSubLineItemMatrixSubLineItem, LineItemSubLineItemTierSubLineItem, LineItemSubLineItemOtherSubLineItem - ], - PropertyInfo(discriminator="type"), -] - - -class LineItemTaxAmount(BaseModel): - amount: str - """The amount of additional tax incurred by this tax rate.""" - - tax_rate_description: str - """The human-readable description of the applied tax rate.""" - - tax_rate_percentage: Optional[str] = None - """The tax rate percentage, out of 100.""" - - -class LineItem(BaseModel): - id: str - """A unique ID for this line item.""" - - adjusted_subtotal: str - """ - The line amount after any adjustments and before overage conversion, credits and - partial invoicing. - """ - - adjustments: List[LineItemAdjustment] - """All adjustments (ie. maximums, minimums, discounts) applied to the line item.""" - - amount: str - """ - The final amount for a line item after all adjustments and pre paid credits have - been applied. - """ - - credits_applied: str - """The number of prepaid credits applied.""" - - discount: Optional[Discount] = None - - end_date: datetime - """The end date of the range of time applied for this line item's price.""" - - filter: Optional[str] = None - """An additional filter that was used to calculate the usage for this line item.""" - - grouping: Optional[str] = None - """ - [DEPRECATED] For configured prices that are split by a grouping key, this will - be populated with the key and a value. The `amount` and `subtotal` will be the - values for this particular grouping. - """ - - maximum: Optional[LineItemMaximum] = None - """This field is deprecated in favor of `adjustments`.""" - - maximum_amount: Optional[str] = None - """This field is deprecated in favor of `adjustments`.""" - - minimum: Optional[LineItemMinimum] = None - """This field is deprecated in favor of `adjustments`.""" - - minimum_amount: Optional[str] = None - """This field is deprecated in favor of `adjustments`.""" - - name: str - """The name of the price associated with this line item.""" - - partially_invoiced_amount: str - """Any amount applied from a partial invoice""" - - price: Optional[Price] = None - """ - The Price resource represents a price that can be billed on a subscription, - resulting in a charge on an invoice in the form of an invoice line item. Prices - take a quantity and determine an amount to bill. - - Orb supports a few different pricing models out of the box. Each of these models - is serialized differently in a given Price object. The model_type field - determines the key for the configuration object that is present. - - For more on the types of prices, see - [the core concepts documentation](/core-concepts#plan-and-price) - """ - - quantity: float - """Either the fixed fee quantity or the usage during the service period.""" - - start_date: datetime - """The start date of the range of time applied for this line item's price.""" - - sub_line_items: List[LineItemSubLineItem] - """ - For complex pricing structures, the line item can be broken down further in - `sub_line_items`. - """ - - subtotal: str - """The line amount before before any adjustments.""" - - tax_amounts: List[LineItemTaxAmount] - """An array of tax rates and their incurred tax amounts. - - Empty if no tax integration is configured. - """ - - usage_customer_ids: Optional[List[str]] = None - """ - A list of customer ids that were used to calculate the usage for this line item. - """ - - -class Maximum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this maximum amount applies to. - - For plan/plan phase maximums, this can be a subset of prices. - """ - - maximum_amount: str - """Maximum amount applied""" - - -class Minimum(BaseModel): - applies_to_price_ids: List[str] - """List of price_ids that this minimum amount applies to. - - For plan/plan phase minimums, this can be a subset of prices. - """ - - minimum_amount: str - """Minimum amount applied""" - - -class PaymentAttempt(BaseModel): - id: str - """The ID of the payment attempt.""" - - amount: str - """The amount of the payment attempt.""" - - created_at: datetime - """The time at which the payment attempt was created.""" - - payment_provider: Optional[Literal["stripe"]] = None - """The payment provider that attempted to collect the payment.""" - - payment_provider_id: Optional[str] = None - """The ID of the payment attempt in the payment provider.""" - - succeeded: bool - """Whether the payment attempt succeeded.""" - - -class ShippingAddress(BaseModel): - city: Optional[str] = None - - country: Optional[str] = None - - line1: Optional[str] = None - - line2: Optional[str] = None - - postal_code: Optional[str] = None - - state: Optional[str] = None - - -class Subscription(BaseModel): - id: str - - -class Invoice(BaseModel): +from typing_extensions import Literal + +from ..._models import BaseModel +from .address_model import AddressModel +from .maximum_model import MaximumModel +from .minimum_model import MinimumModel +from .auto_collection_model import AutoCollectionModel +from .customer_tax_id_model import CustomerTaxIDModel +from .payment_attempt_model import PaymentAttemptModel +from .invoice_level_discount import InvoiceLevelDiscount +from .customer_minified_model import CustomerMinifiedModel +from .invoice_line_item_model import InvoiceLineItemModel +from .credit_note_summary_model import CreditNoteSummaryModel +from .subscription_minified_model import SubscriptionMinifiedModel +from .customer_balance_transaction_model import CustomerBalanceTransactionModel + +__all__ = ["InvoiceModel"] + + +class InvoiceModel(BaseModel): id: str amount_due: str @@ -759,24 +30,24 @@ class Invoice(BaseModel): application of the customer balance to the `total` of the invoice. """ - auto_collection: AutoCollection + auto_collection: AutoCollectionModel - billing_address: Optional[BillingAddress] = None + billing_address: Optional[AddressModel] = None created_at: datetime """The creation time of the resource in Orb.""" - credit_notes: List[CreditNote] + credit_notes: List[CreditNoteSummaryModel] """A list of credit notes associated with the invoice""" currency: str """An ISO 4217 currency string or `credits`""" - customer: Customer + customer: CustomerMinifiedModel - customer_balance_transactions: List[CustomerBalanceTransaction] + customer_balance_transactions: List[CustomerBalanceTransactionModel] - customer_tax_id: Optional[CustomerTaxID] = None + customer_tax_id: Optional[CustomerTaxIDModel] = None """ Tax IDs are commonly required to be displayed on customer invoices, which are added to the headers of invoices. @@ -941,10 +212,10 @@ class Invoice(BaseModel): `issued` (even if it is now in a different state.) """ - line_items: List[LineItem] + line_items: List[InvoiceLineItemModel] """The breakdown of prices in this invoice.""" - maximum: Optional[Maximum] = None + maximum: Optional[MaximumModel] = None maximum_amount: Optional[str] = None @@ -961,7 +232,7 @@ class Invoice(BaseModel): cleared by setting `metadata` to `null`. """ - minimum: Optional[Minimum] = None + minimum: Optional[MinimumModel] = None minimum_amount: Optional[str] = None @@ -971,7 +242,7 @@ class Invoice(BaseModel): was paid. """ - payment_attempts: List[PaymentAttempt] + payment_attempts: List[PaymentAttemptModel] """A list of payment attempts associated with the invoice""" payment_failed_at: Optional[datetime] = None @@ -993,11 +264,11 @@ class Invoice(BaseModel): scheduled to be issued. """ - shipping_address: Optional[ShippingAddress] = None + shipping_address: Optional[AddressModel] = None status: Literal["issued", "paid", "synced", "void", "draft"] - subscription: Optional[Subscription] = None + subscription: Optional[SubscriptionMinifiedModel] = None subtotal: str """The total before any discounts and minimums are applied.""" diff --git a/src/orb/types/shared/item_external_connection_model.py b/src/orb/types/shared/item_external_connection_model.py new file mode 100644 index 00000000..4442e728 --- /dev/null +++ b/src/orb/types/shared/item_external_connection_model.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ItemExternalConnectionModel"] + + +class ItemExternalConnectionModel(BaseModel): + external_connection_name: Literal["stripe", "quickbooks", "bill.com", "netsuite", "taxjar", "avalara", "anrok"] + + external_entity_id: str diff --git a/src/orb/types/shared/item_model.py b/src/orb/types/shared/item_model.py new file mode 100644 index 00000000..0217bdc5 --- /dev/null +++ b/src/orb/types/shared/item_model.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from datetime import datetime + +from ..._models import BaseModel +from .item_external_connection_model import ItemExternalConnectionModel + +__all__ = ["ItemModel"] + + +class ItemModel(BaseModel): + id: str + + created_at: datetime + + external_connections: List[ItemExternalConnectionModel] + + name: str diff --git a/src/orb/types/shared/item_slim_model.py b/src/orb/types/shared/item_slim_model.py new file mode 100644 index 00000000..d90a820a --- /dev/null +++ b/src/orb/types/shared/item_slim_model.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["ItemSlimModel"] + + +class ItemSlimModel(BaseModel): + id: str + + name: str diff --git a/src/orb/types/shared/matrix_config_model.py b/src/orb/types/shared/matrix_config_model.py new file mode 100644 index 00000000..a6427b7d --- /dev/null +++ b/src/orb/types/shared/matrix_config_model.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel +from .matrix_value_model import MatrixValueModel + +__all__ = ["MatrixConfigModel"] + + +class MatrixConfigModel(BaseModel): + default_unit_amount: str + """Default per unit rate for any usage not bucketed into a specified matrix_value""" + + dimensions: List[Optional[str]] + """One or two event property values to evaluate matrix groups by""" + + matrix_values: List[MatrixValueModel] + """Matrix values for specified matrix grouping keys""" diff --git a/src/orb/types/shared/matrix_value_model.py b/src/orb/types/shared/matrix_value_model.py new file mode 100644 index 00000000..a078eff2 --- /dev/null +++ b/src/orb/types/shared/matrix_value_model.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["MatrixValueModel"] + + +class MatrixValueModel(BaseModel): + dimension_values: List[Optional[str]] + """One or two matrix keys to filter usage to this Matrix value by. + + For example, ["region", "tier"] could be used to filter cloud usage by a cloud + region and an instance tier. + """ + + unit_amount: str + """Unit price for the specified dimension_values""" diff --git a/src/orb/types/shared/matrix_with_allocation_config_model.py b/src/orb/types/shared/matrix_with_allocation_config_model.py new file mode 100644 index 00000000..c0bf222c --- /dev/null +++ b/src/orb/types/shared/matrix_with_allocation_config_model.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel +from .matrix_value_model import MatrixValueModel + +__all__ = ["MatrixWithAllocationConfigModel"] + + +class MatrixWithAllocationConfigModel(BaseModel): + allocation: float + """Allocation to be used to calculate the price""" + + default_unit_amount: str + """Default per unit rate for any usage not bucketed into a specified matrix_value""" + + dimensions: List[Optional[str]] + """One or two event property values to evaluate matrix groups by""" + + matrix_values: List[MatrixValueModel] + """Matrix values for specified matrix grouping keys""" diff --git a/src/orb/types/shared/maximum_interval_model.py b/src/orb/types/shared/maximum_interval_model.py new file mode 100644 index 00000000..4150b560 --- /dev/null +++ b/src/orb/types/shared/maximum_interval_model.py @@ -0,0 +1,28 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime + +from ..._models import BaseModel + +__all__ = ["MaximumIntervalModel"] + + +class MaximumIntervalModel(BaseModel): + applies_to_price_ids: List[str] + """The price ids that this maximum interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this maximum interval applies to.""" + + end_date: Optional[datetime] = None + """The end date of the maximum interval.""" + + maximum_amount: str + """ + The maximum amount to charge in a given billing period for the price intervals + this transform applies to. + """ + + start_date: datetime + """The start date of the maximum interval.""" diff --git a/src/orb/types/shared/maximum_model.py b/src/orb/types/shared/maximum_model.py new file mode 100644 index 00000000..069469a7 --- /dev/null +++ b/src/orb/types/shared/maximum_model.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel + +__all__ = ["MaximumModel"] + + +class MaximumModel(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this maximum amount applies to. + + For plan/plan phase maximums, this can be a subset of prices. + """ + + maximum_amount: str + """Maximum amount applied""" diff --git a/src/orb/types/shared/minimum_interval_model.py b/src/orb/types/shared/minimum_interval_model.py new file mode 100644 index 00000000..e4a028f3 --- /dev/null +++ b/src/orb/types/shared/minimum_interval_model.py @@ -0,0 +1,28 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime + +from ..._models import BaseModel + +__all__ = ["MinimumIntervalModel"] + + +class MinimumIntervalModel(BaseModel): + applies_to_price_ids: List[str] + """The price ids that this minimum interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this minimum interval applies to.""" + + end_date: Optional[datetime] = None + """The end date of the minimum interval.""" + + minimum_amount: str + """ + The minimum amount to charge in a given billing period for the price intervals + this minimum applies to. + """ + + start_date: datetime + """The start date of the minimum interval.""" diff --git a/src/orb/types/shared/minimum_model.py b/src/orb/types/shared/minimum_model.py new file mode 100644 index 00000000..f7da0277 --- /dev/null +++ b/src/orb/types/shared/minimum_model.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel + +__all__ = ["MinimumModel"] + + +class MinimumModel(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this minimum amount applies to. + + For plan/plan phase minimums, this can be a subset of prices. + """ + + minimum_amount: str + """Minimum amount applied""" diff --git a/src/orb/types/shared/mutated_subscription_model.py b/src/orb/types/shared/mutated_subscription_model.py new file mode 100644 index 00000000..116202fb --- /dev/null +++ b/src/orb/types/shared/mutated_subscription_model.py @@ -0,0 +1,154 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Union, Optional +from datetime import datetime +from typing_extensions import Literal, Annotated, TypeAlias + +from ..._utils import PropertyInfo +from ..._models import BaseModel +from .plan_model import PlanModel +from .customer_model import CustomerModel +from .price_interval_model import PriceIntervalModel +from .maximum_interval_model import MaximumIntervalModel +from .minimum_interval_model import MinimumIntervalModel +from .coupon_redemption_model import CouponRedemptionModel +from .adjustment_interval_model import AdjustmentIntervalModel +from .subscription_trial_info_model import SubscriptionTrialInfoModel +from .usage_discount_interval_model import UsageDiscountIntervalModel +from .amount_discount_interval_model import AmountDiscountIntervalModel +from .percentage_discount_interval_model import PercentageDiscountIntervalModel +from .fixed_fee_quantity_schedule_entry_model import FixedFeeQuantityScheduleEntryModel +from .billing_cycle_anchor_configuration_model import BillingCycleAnchorConfigurationModel + +__all__ = ["MutatedSubscriptionModel", "DiscountInterval"] + +DiscountInterval: TypeAlias = Annotated[ + Union[AmountDiscountIntervalModel, PercentageDiscountIntervalModel, UsageDiscountIntervalModel], + PropertyInfo(discriminator="discount_type"), +] + + +class MutatedSubscriptionModel(BaseModel): + id: str + + active_plan_phase_order: Optional[int] = None + """ + The current plan phase that is active, only if the subscription's plan has + phases. + """ + + adjustment_intervals: List[AdjustmentIntervalModel] + """The adjustment intervals for this subscription.""" + + auto_collection: Optional[bool] = None + """ + Determines whether issued invoices for this subscription will automatically be + charged with the saved payment method on the due date. This property defaults to + the plan's behavior. If null, defaults to the customer's setting. + """ + + billing_cycle_anchor_configuration: BillingCycleAnchorConfigurationModel + + billing_cycle_day: int + """The day of the month on which the billing cycle is anchored. + + If the maximum number of days in a month is greater than this value, the last + day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April + means the billing period begins on the 30th. + """ + + created_at: datetime + + current_billing_period_end_date: Optional[datetime] = None + """The end of the current billing period. + + This is an exclusive timestamp, such that the instant returned is not part of + the billing period. Set to null for subscriptions that are not currently active. + """ + + current_billing_period_start_date: Optional[datetime] = None + """The start date of the current billing period. + + This is an inclusive timestamp; the instant returned is exactly the beginning of + the billing period. Set to null if the subscription is not currently active. + """ + + customer: CustomerModel + """ + A customer is a buyer of your products, and the other party to the billing + relationship. + + In Orb, customers are assigned system generated identifiers automatically, but + it's often desirable to have these match existing identifiers in your system. To + avoid having to denormalize Orb ID information, you can pass in an + `external_customer_id` with your own identifier. See + [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + information about how these aliases work in Orb. + + In addition to having an identifier in your system, a customer may exist in a + payment provider solution like Stripe. Use the `payment_provider_id` and the + `payment_provider` enum field to express this mapping. + + A customer also has a timezone (from the standard + [IANA timezone database](https://www.iana.org/time-zones)), which defaults to + your account's timezone. See [Timezone localization](/essentials/timezones) for + information on what this timezone parameter influences within Orb. + """ + + default_invoice_memo: Optional[str] = None + """Determines the default memo on this subscriptions' invoices. + + Note that if this is not provided, it is determined by the plan configuration. + """ + + discount_intervals: List[DiscountInterval] + """The discount intervals for this subscription.""" + + end_date: Optional[datetime] = None + """The date Orb stops billing for this subscription.""" + + fixed_fee_quantity_schedule: List[FixedFeeQuantityScheduleEntryModel] + + invoicing_threshold: Optional[str] = None + + maximum_intervals: List[MaximumIntervalModel] + """The maximum intervals for this subscription.""" + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum_intervals: List[MinimumIntervalModel] + """The minimum intervals for this subscription.""" + + net_terms: int + """ + Determines the difference between the invoice issue date for subscription + invoices as the date that they are due. A value of `0` here represents that the + invoice is due on issue, whereas a value of `30` represents that the customer + has a month to pay the invoice. + """ + + plan: PlanModel + """ + The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be + subscribed to by a customer. Plans define the billing behavior of the + subscription. You can see more about how to configure prices in the + [Price resource](/reference/price). + """ + + price_intervals: List[PriceIntervalModel] + """The price intervals for this subscription.""" + + redeemed_coupon: Optional[CouponRedemptionModel] = None + + start_date: datetime + """The date Orb starts billing for this subscription.""" + + status: Literal["active", "ended", "upcoming"] + + trial_info: SubscriptionTrialInfoModel diff --git a/src/orb/types/shared/new_accounting_sync_configuration_model.py b/src/orb/types/shared/new_accounting_sync_configuration_model.py new file mode 100644 index 00000000..88ff8064 --- /dev/null +++ b/src/orb/types/shared/new_accounting_sync_configuration_model.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["NewAccountingSyncConfigurationModel", "AccountingProvider"] + + +class AccountingProvider(BaseModel): + external_provider_id: str + + provider_type: str + + +class NewAccountingSyncConfigurationModel(BaseModel): + accounting_providers: Optional[List[AccountingProvider]] = None + + excluded: Optional[bool] = None diff --git a/src/orb/types/shared/new_adjustment_model.py b/src/orb/types/shared/new_adjustment_model.py new file mode 100644 index 00000000..f4ccba00 --- /dev/null +++ b/src/orb/types/shared/new_adjustment_model.py @@ -0,0 +1,100 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias + +from ..._utils import PropertyInfo +from ..._models import BaseModel + +__all__ = [ + "NewAdjustmentModel", + "NewPercentageDiscount", + "NewUsageDiscount", + "NewAmountDiscount", + "NewMinimum", + "NewMaximum", +] + + +class NewPercentageDiscount(BaseModel): + adjustment_type: Literal["percentage_discount"] + + applies_to_price_ids: List[str] + """The set of price IDs to which this adjustment applies.""" + + percentage_discount: float + + is_invoice_level: Optional[bool] = None + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +class NewUsageDiscount(BaseModel): + adjustment_type: Literal["usage_discount"] + + applies_to_price_ids: List[str] + """The set of price IDs to which this adjustment applies.""" + + usage_discount: float + + is_invoice_level: Optional[bool] = None + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +class NewAmountDiscount(BaseModel): + adjustment_type: Literal["amount_discount"] + + amount_discount: str + + applies_to_price_ids: List[str] + """The set of price IDs to which this adjustment applies.""" + + is_invoice_level: Optional[bool] = None + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +class NewMinimum(BaseModel): + adjustment_type: Literal["minimum"] + + applies_to_price_ids: List[str] + """The set of price IDs to which this adjustment applies.""" + + item_id: str + """The item ID that revenue from this minimum will be attributed to.""" + + minimum_amount: str + + is_invoice_level: Optional[bool] = None + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +class NewMaximum(BaseModel): + adjustment_type: Literal["maximum"] + + applies_to_price_ids: List[str] + """The set of price IDs to which this adjustment applies.""" + + maximum_amount: str + + is_invoice_level: Optional[bool] = None + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +NewAdjustmentModel: TypeAlias = Annotated[ + Union[NewPercentageDiscount, NewUsageDiscount, NewAmountDiscount, NewMinimum, NewMaximum], + PropertyInfo(discriminator="adjustment_type"), +] diff --git a/src/orb/types/shared/new_allocation_price_model.py b/src/orb/types/shared/new_allocation_price_model.py new file mode 100644 index 00000000..af592c7d --- /dev/null +++ b/src/orb/types/shared/new_allocation_price_model.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["NewAllocationPriceModel"] + + +class NewAllocationPriceModel(BaseModel): + amount: str + """An amount of the currency to allocate to the customer at the specified cadence.""" + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + """The cadence at which to allocate the amount to the customer.""" + + currency: str + """ + An ISO 4217 currency string or a custom pricing unit identifier in which to bill + this price. + """ + + expires_at_end_of_cadence: bool + """ + Whether the allocated amount should expire at the end of the cadence or roll + over to the next period. + """ diff --git a/src/orb/types/shared/new_billing_cycle_configuration_model.py b/src/orb/types/shared/new_billing_cycle_configuration_model.py new file mode 100644 index 00000000..89a72754 --- /dev/null +++ b/src/orb/types/shared/new_billing_cycle_configuration_model.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["NewBillingCycleConfigurationModel"] + + +class NewBillingCycleConfigurationModel(BaseModel): + duration: int + """The duration of the billing period.""" + + duration_unit: Literal["day", "month"] + """The unit of billing period duration.""" diff --git a/src/orb/types/shared/new_floating_price_model.py b/src/orb/types/shared/new_floating_price_model.py new file mode 100644 index 00000000..c45cbc40 --- /dev/null +++ b/src/orb/types/shared/new_floating_price_model.py @@ -0,0 +1,1879 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias + +from pydantic import Field as FieldInfo + +from ..._utils import PropertyInfo +from ..._models import BaseModel +from .bps_config_model import BpsConfigModel +from .bulk_config_model import BulkConfigModel +from .unit_config_model import UnitConfigModel +from .matrix_config_model import MatrixConfigModel +from .tiered_config_model import TieredConfigModel +from .package_config_model import PackageConfigModel +from .bulk_bps_config_model import BulkBpsConfigModel +from .tiered_bps_config_model import TieredBpsConfigModel +from .custom_rating_function_config_model import CustomRatingFunctionConfigModel +from .matrix_with_allocation_config_model import MatrixWithAllocationConfigModel +from .new_billing_cycle_configuration_model import NewBillingCycleConfigurationModel + +__all__ = [ + "NewFloatingPriceModel", + "NewFloatingUnitPrice", + "NewFloatingPackagePrice", + "NewFloatingMatrixPrice", + "NewFloatingMatrixWithAllocationPrice", + "NewFloatingTieredPrice", + "NewFloatingTieredBpsPrice", + "NewFloatingBpsPrice", + "NewFloatingBulkBpsPrice", + "NewFloatingBulkPrice", + "NewFloatingThresholdTotalAmountPrice", + "NewFloatingTieredPackagePrice", + "NewFloatingGroupedTieredPrice", + "NewFloatingMaxGroupTieredPackagePrice", + "NewFloatingTieredWithMinimumPrice", + "NewFloatingPackageWithAllocationPrice", + "NewFloatingTieredPackageWithMinimumPrice", + "NewFloatingUnitWithPercentPrice", + "NewFloatingTieredWithProrationPrice", + "NewFloatingUnitWithProrationPrice", + "NewFloatingGroupedAllocationPrice", + "NewFloatingGroupedWithProratedMinimumPrice", + "NewFloatingGroupedWithMeteredMinimumPrice", + "NewFloatingMatrixWithDisplayNamePrice", + "NewFloatingBulkWithProrationPrice", + "NewFloatingGroupedTieredPackagePrice", + "NewFloatingScalableMatrixWithUnitPricingPrice", + "NewFloatingScalableMatrixWithTieredPricingPrice", + "NewFloatingCumulativeGroupedBulkPrice", +] + + +class NewFloatingUnitPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + currency: str + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["unit"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + unit_config: UnitConfigModel + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingPackagePrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + currency: str + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["package"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + package_config: PackageConfigModel + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingMatrixPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + currency: str + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: str + """The id of the item the price will be associated with.""" + + matrix_config: MatrixConfigModel + + price_model_type: Literal["matrix"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingMatrixWithAllocationPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + currency: str + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: str + """The id of the item the price will be associated with.""" + + matrix_with_allocation_config: MatrixWithAllocationConfigModel + + price_model_type: Literal["matrix_with_allocation"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingTieredPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + currency: str + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["tiered"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + tiered_config: TieredConfigModel + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingTieredBpsPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + currency: str + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["tiered_bps"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + tiered_bps_config: TieredBpsConfigModel + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingBpsPrice(BaseModel): + bps_config: BpsConfigModel + + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + currency: str + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["bps"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingBulkBpsPrice(BaseModel): + bulk_bps_config: BulkBpsConfigModel + + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + currency: str + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["bulk_bps"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingBulkPrice(BaseModel): + bulk_config: BulkConfigModel + + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + currency: str + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["bulk"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingThresholdTotalAmountPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + currency: str + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["threshold_total_amount"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + threshold_total_amount_config: CustomRatingFunctionConfigModel + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingTieredPackagePrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + currency: str + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["tiered_package"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + tiered_package_config: CustomRatingFunctionConfigModel + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingGroupedTieredPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + currency: str + """An ISO 4217 currency string for which this price is billed in.""" + + grouped_tiered_config: CustomRatingFunctionConfigModel + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["grouped_tiered"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingMaxGroupTieredPackagePrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + currency: str + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: str + """The id of the item the price will be associated with.""" + + max_group_tiered_package_config: CustomRatingFunctionConfigModel + + price_model_type: Literal["max_group_tiered_package"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingTieredWithMinimumPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + currency: str + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["tiered_with_minimum"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + tiered_with_minimum_config: CustomRatingFunctionConfigModel + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingPackageWithAllocationPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + currency: str + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["package_with_allocation"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + package_with_allocation_config: CustomRatingFunctionConfigModel + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingTieredPackageWithMinimumPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + currency: str + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["tiered_package_with_minimum"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + tiered_package_with_minimum_config: CustomRatingFunctionConfigModel + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingUnitWithPercentPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + currency: str + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["unit_with_percent"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + unit_with_percent_config: CustomRatingFunctionConfigModel + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingTieredWithProrationPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + currency: str + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["tiered_with_proration"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + tiered_with_proration_config: CustomRatingFunctionConfigModel + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingUnitWithProrationPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + currency: str + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["unit_with_proration"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + unit_with_proration_config: CustomRatingFunctionConfigModel + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingGroupedAllocationPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + currency: str + """An ISO 4217 currency string for which this price is billed in.""" + + grouped_allocation_config: CustomRatingFunctionConfigModel + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["grouped_allocation"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingGroupedWithProratedMinimumPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + currency: str + """An ISO 4217 currency string for which this price is billed in.""" + + grouped_with_prorated_minimum_config: CustomRatingFunctionConfigModel + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["grouped_with_prorated_minimum"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingGroupedWithMeteredMinimumPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + currency: str + """An ISO 4217 currency string for which this price is billed in.""" + + grouped_with_metered_minimum_config: CustomRatingFunctionConfigModel + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["grouped_with_metered_minimum"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingMatrixWithDisplayNamePrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + currency: str + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: str + """The id of the item the price will be associated with.""" + + matrix_with_display_name_config: CustomRatingFunctionConfigModel + + price_model_type: Literal["matrix_with_display_name"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingBulkWithProrationPrice(BaseModel): + bulk_with_proration_config: CustomRatingFunctionConfigModel + + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + currency: str + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["bulk_with_proration"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingGroupedTieredPackagePrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + currency: str + """An ISO 4217 currency string for which this price is billed in.""" + + grouped_tiered_package_config: CustomRatingFunctionConfigModel + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["grouped_tiered_package"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingScalableMatrixWithUnitPricingPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + currency: str + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["scalable_matrix_with_unit_pricing"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + scalable_matrix_with_unit_pricing_config: CustomRatingFunctionConfigModel + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingScalableMatrixWithTieredPricingPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + currency: str + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["scalable_matrix_with_tiered_pricing"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + scalable_matrix_with_tiered_pricing_config: CustomRatingFunctionConfigModel + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingCumulativeGroupedBulkPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + cumulative_grouped_bulk_config: CustomRatingFunctionConfigModel + + currency: str + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["cumulative_grouped_bulk"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +NewFloatingPriceModel: TypeAlias = Annotated[ + Union[ + NewFloatingUnitPrice, + NewFloatingPackagePrice, + NewFloatingMatrixPrice, + NewFloatingMatrixWithAllocationPrice, + NewFloatingTieredPrice, + NewFloatingTieredBpsPrice, + NewFloatingBpsPrice, + NewFloatingBulkBpsPrice, + NewFloatingBulkPrice, + NewFloatingThresholdTotalAmountPrice, + NewFloatingTieredPackagePrice, + NewFloatingGroupedTieredPrice, + NewFloatingMaxGroupTieredPackagePrice, + NewFloatingTieredWithMinimumPrice, + NewFloatingPackageWithAllocationPrice, + NewFloatingTieredPackageWithMinimumPrice, + NewFloatingUnitWithPercentPrice, + NewFloatingTieredWithProrationPrice, + NewFloatingUnitWithProrationPrice, + NewFloatingGroupedAllocationPrice, + NewFloatingGroupedWithProratedMinimumPrice, + NewFloatingGroupedWithMeteredMinimumPrice, + NewFloatingMatrixWithDisplayNamePrice, + NewFloatingBulkWithProrationPrice, + NewFloatingGroupedTieredPackagePrice, + NewFloatingScalableMatrixWithUnitPricingPrice, + NewFloatingScalableMatrixWithTieredPricingPrice, + NewFloatingCumulativeGroupedBulkPrice, + ], + PropertyInfo(discriminator="price_model_type"), +] diff --git a/src/orb/types/shared/new_reporting_configuration_model.py b/src/orb/types/shared/new_reporting_configuration_model.py new file mode 100644 index 00000000..b634ce6d --- /dev/null +++ b/src/orb/types/shared/new_reporting_configuration_model.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["NewReportingConfigurationModel"] + + +class NewReportingConfigurationModel(BaseModel): + exempt: bool diff --git a/src/orb/types/shared/new_subscription_price_model.py b/src/orb/types/shared/new_subscription_price_model.py new file mode 100644 index 00000000..00937099 --- /dev/null +++ b/src/orb/types/shared/new_subscription_price_model.py @@ -0,0 +1,1905 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias + +from pydantic import Field as FieldInfo + +from ..._utils import PropertyInfo +from ..._models import BaseModel +from .bps_config_model import BpsConfigModel +from .bulk_config_model import BulkConfigModel +from .unit_config_model import UnitConfigModel +from .matrix_config_model import MatrixConfigModel +from .tiered_config_model import TieredConfigModel +from .package_config_model import PackageConfigModel +from .bulk_bps_config_model import BulkBpsConfigModel +from .tiered_bps_config_model import TieredBpsConfigModel +from .custom_rating_function_config_model import CustomRatingFunctionConfigModel +from .new_billing_cycle_configuration_model import NewBillingCycleConfigurationModel + +__all__ = [ + "NewSubscriptionPriceModel", + "NewSubscriptionUnitPrice", + "NewSubscriptionPackagePrice", + "NewSubscriptionMatrixPrice", + "NewSubscriptionTieredPrice", + "NewSubscriptionTieredBpsPrice", + "NewSubscriptionBpsPrice", + "NewSubscriptionBulkBpsPrice", + "NewSubscriptionBulkPrice", + "NewSubscriptionThresholdTotalAmountPrice", + "NewSubscriptionTieredPackagePrice", + "NewSubscriptionTieredWithMinimumPrice", + "NewSubscriptionUnitWithPercentPrice", + "NewSubscriptionPackageWithAllocationPrice", + "NewSubscriptionTierWithProrationPrice", + "NewSubscriptionUnitWithProrationPrice", + "NewSubscriptionGroupedAllocationPrice", + "NewSubscriptionGroupedWithProratedMinimumPrice", + "NewSubscriptionBulkWithProrationPrice", + "NewSubscriptionScalableMatrixWithUnitPricingPrice", + "NewSubscriptionScalableMatrixWithTieredPricingPrice", + "NewSubscriptionCumulativeGroupedBulkPrice", + "NewSubscriptionMaxGroupTieredPackagePrice", + "NewSubscriptionGroupedWithMeteredMinimumPrice", + "NewSubscriptionMatrixWithDisplayNamePrice", + "NewSubscriptionGroupedTieredPackagePrice", +] + + +class NewSubscriptionUnitPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["unit"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + unit_config: UnitConfigModel + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class NewSubscriptionPackagePrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["package"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + package_config: PackageConfigModel + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class NewSubscriptionMatrixPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + matrix_config: MatrixConfigModel + + price_model_type: Literal["matrix"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class NewSubscriptionTieredPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["tiered"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + tiered_config: TieredConfigModel + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class NewSubscriptionTieredBpsPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["tiered_bps"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + tiered_bps_config: TieredBpsConfigModel + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class NewSubscriptionBpsPrice(BaseModel): + bps_config: BpsConfigModel + + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["bps"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class NewSubscriptionBulkBpsPrice(BaseModel): + bulk_bps_config: BulkBpsConfigModel + + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["bulk_bps"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class NewSubscriptionBulkPrice(BaseModel): + bulk_config: BulkConfigModel + + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["bulk"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class NewSubscriptionThresholdTotalAmountPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["threshold_total_amount"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + threshold_total_amount_config: CustomRatingFunctionConfigModel + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class NewSubscriptionTieredPackagePrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["tiered_package"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + tiered_package_config: CustomRatingFunctionConfigModel + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class NewSubscriptionTieredWithMinimumPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["tiered_with_minimum"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + tiered_with_minimum_config: CustomRatingFunctionConfigModel + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class NewSubscriptionUnitWithPercentPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["unit_with_percent"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + unit_with_percent_config: CustomRatingFunctionConfigModel + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class NewSubscriptionPackageWithAllocationPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["package_with_allocation"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + package_with_allocation_config: CustomRatingFunctionConfigModel + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class NewSubscriptionTierWithProrationPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["tiered_with_proration"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + tiered_with_proration_config: CustomRatingFunctionConfigModel + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class NewSubscriptionUnitWithProrationPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["unit_with_proration"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + unit_with_proration_config: CustomRatingFunctionConfigModel + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class NewSubscriptionGroupedAllocationPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + grouped_allocation_config: CustomRatingFunctionConfigModel + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["grouped_allocation"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class NewSubscriptionGroupedWithProratedMinimumPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + grouped_with_prorated_minimum_config: CustomRatingFunctionConfigModel + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["grouped_with_prorated_minimum"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class NewSubscriptionBulkWithProrationPrice(BaseModel): + bulk_with_proration_config: CustomRatingFunctionConfigModel + + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["bulk_with_proration"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class NewSubscriptionScalableMatrixWithUnitPricingPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["scalable_matrix_with_unit_pricing"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + scalable_matrix_with_unit_pricing_config: CustomRatingFunctionConfigModel + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class NewSubscriptionScalableMatrixWithTieredPricingPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["scalable_matrix_with_tiered_pricing"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + scalable_matrix_with_tiered_pricing_config: CustomRatingFunctionConfigModel + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class NewSubscriptionCumulativeGroupedBulkPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + cumulative_grouped_bulk_config: CustomRatingFunctionConfigModel + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["cumulative_grouped_bulk"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class NewSubscriptionMaxGroupTieredPackagePrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + max_group_tiered_package_config: CustomRatingFunctionConfigModel + + price_model_type: Literal["max_group_tiered_package"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class NewSubscriptionGroupedWithMeteredMinimumPrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + grouped_with_metered_minimum_config: CustomRatingFunctionConfigModel + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["grouped_with_metered_minimum"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class NewSubscriptionMatrixWithDisplayNamePrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + item_id: str + """The id of the item the price will be associated with.""" + + matrix_with_display_name_config: CustomRatingFunctionConfigModel + + price_model_type: Literal["matrix_with_display_name"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class NewSubscriptionGroupedTieredPackagePrice(BaseModel): + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] + """The cadence to bill for this price on.""" + + grouped_tiered_package_config: CustomRatingFunctionConfigModel + + item_id: str + """The id of the item the price will be associated with.""" + + price_model_type: Literal["grouped_tiered_package"] = FieldInfo(alias="model_type") + + name: str + """The name of the price.""" + + billable_metric_id: Optional[str] = None + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] = None + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] = None + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] = None + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] = None + """An alias for the price.""" + + fixed_price_quantity: Optional[float] = None + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] = None + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] = None + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] = None + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +NewSubscriptionPriceModel: TypeAlias = Annotated[ + Union[ + NewSubscriptionUnitPrice, + NewSubscriptionPackagePrice, + NewSubscriptionMatrixPrice, + NewSubscriptionTieredPrice, + NewSubscriptionTieredBpsPrice, + NewSubscriptionBpsPrice, + NewSubscriptionBulkBpsPrice, + NewSubscriptionBulkPrice, + NewSubscriptionThresholdTotalAmountPrice, + NewSubscriptionTieredPackagePrice, + NewSubscriptionTieredWithMinimumPrice, + NewSubscriptionUnitWithPercentPrice, + NewSubscriptionPackageWithAllocationPrice, + NewSubscriptionTierWithProrationPrice, + NewSubscriptionUnitWithProrationPrice, + NewSubscriptionGroupedAllocationPrice, + NewSubscriptionGroupedWithProratedMinimumPrice, + NewSubscriptionBulkWithProrationPrice, + NewSubscriptionScalableMatrixWithUnitPricingPrice, + NewSubscriptionScalableMatrixWithTieredPricingPrice, + NewSubscriptionCumulativeGroupedBulkPrice, + NewSubscriptionMaxGroupTieredPackagePrice, + NewSubscriptionGroupedWithMeteredMinimumPrice, + NewSubscriptionMatrixWithDisplayNamePrice, + NewSubscriptionGroupedTieredPackagePrice, + ], + PropertyInfo(discriminator="price_model_type"), +] diff --git a/src/orb/types/shared/new_tax_configuration_model.py b/src/orb/types/shared/new_tax_configuration_model.py new file mode 100644 index 00000000..9f78d007 --- /dev/null +++ b/src/orb/types/shared/new_tax_configuration_model.py @@ -0,0 +1,28 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias + +from ..._utils import PropertyInfo +from ..._models import BaseModel + +__all__ = ["NewTaxConfigurationModel", "NewAvalaraTaxConfiguration", "NewTaxJarConfiguration"] + + +class NewAvalaraTaxConfiguration(BaseModel): + tax_exempt: bool + + tax_provider: Literal["avalara"] + + tax_exemption_code: Optional[str] = None + + +class NewTaxJarConfiguration(BaseModel): + tax_exempt: bool + + tax_provider: Literal["taxjar"] + + +NewTaxConfigurationModel: TypeAlias = Annotated[ + Union[NewAvalaraTaxConfiguration, NewTaxJarConfiguration], PropertyInfo(discriminator="tax_provider") +] diff --git a/src/orb/types/shared/package_config_model.py b/src/orb/types/shared/package_config_model.py new file mode 100644 index 00000000..1c9458a9 --- /dev/null +++ b/src/orb/types/shared/package_config_model.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["PackageConfigModel"] + + +class PackageConfigModel(BaseModel): + package_amount: str + """A currency amount to rate usage by""" + + package_size: int + """An integer amount to represent package size. + + For example, 1000 here would divide usage by 1000 before multiplying by + package_amount in rating + """ diff --git a/src/orb/types/shared/pagination_metadata_model.py b/src/orb/types/shared/pagination_metadata_model.py new file mode 100644 index 00000000..9926cab6 --- /dev/null +++ b/src/orb/types/shared/pagination_metadata_model.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel + +__all__ = ["PaginationMetadataModel"] + + +class PaginationMetadataModel(BaseModel): + has_more: bool + + next_cursor: Optional[str] = None diff --git a/src/orb/types/shared/payment_attempt_model.py b/src/orb/types/shared/payment_attempt_model.py new file mode 100644 index 00000000..a0780fa6 --- /dev/null +++ b/src/orb/types/shared/payment_attempt_model.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["PaymentAttemptModel"] + + +class PaymentAttemptModel(BaseModel): + id: str + """The ID of the payment attempt.""" + + amount: str + """The amount of the payment attempt.""" + + created_at: datetime + """The time at which the payment attempt was created.""" + + payment_provider: Optional[Literal["stripe"]] = None + """The payment provider that attempted to collect the payment.""" + + payment_provider_id: Optional[str] = None + """The ID of the payment attempt in the payment provider.""" + + succeeded: bool + """Whether the payment attempt succeeded.""" diff --git a/src/orb/types/shared/percentage_discount_interval_model.py b/src/orb/types/shared/percentage_discount_interval_model.py new file mode 100644 index 00000000..09fd4432 --- /dev/null +++ b/src/orb/types/shared/percentage_discount_interval_model.py @@ -0,0 +1,31 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["PercentageDiscountIntervalModel"] + + +class PercentageDiscountIntervalModel(BaseModel): + applies_to_price_ids: List[str] + """The price ids that this discount interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this discount interval applies to.""" + + discount_type: Literal["percentage"] + + end_date: Optional[datetime] = None + """The end date of the discount interval.""" + + percentage_discount: float + """ + Only available if discount_type is `percentage`.This is a number between 0 + and 1. + """ + + start_date: datetime + """The start date of the discount interval.""" diff --git a/src/orb/types/shared/percentage_discount_model.py b/src/orb/types/shared/percentage_discount_model.py new file mode 100644 index 00000000..447dad69 --- /dev/null +++ b/src/orb/types/shared/percentage_discount_model.py @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["PercentageDiscountModel"] + + +class PercentageDiscountModel(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this discount applies to. + + For plan/plan phase discounts, this can be a subset of prices. + """ + + discount_type: Literal["percentage"] + + percentage_discount: float + """Only available if discount_type is `percentage`. + + This is a number between 0 and 1. + """ + + reason: Optional[str] = None diff --git a/src/orb/types/shared/plan_minified_model.py b/src/orb/types/shared/plan_minified_model.py new file mode 100644 index 00000000..1171d4dc --- /dev/null +++ b/src/orb/types/shared/plan_minified_model.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel + +__all__ = ["PlanMinifiedModel"] + + +class PlanMinifiedModel(BaseModel): + id: Optional[str] = None + + external_plan_id: Optional[str] = None + """ + An optional user-defined ID for this plan resource, used throughout the system + as an alias for this Plan. Use this field to identify a plan by an existing + identifier in your system. + """ + + name: Optional[str] = None diff --git a/src/orb/types/shared/plan_model.py b/src/orb/types/shared/plan_model.py new file mode 100644 index 00000000..0f5ac971 --- /dev/null +++ b/src/orb/types/shared/plan_model.py @@ -0,0 +1,150 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Optional +from datetime import datetime +from typing_extensions import Literal + +from .discount import Discount +from ..._models import BaseModel +from .price_model import PriceModel +from .maximum_model import MaximumModel +from .minimum_model import MinimumModel +from .adjustment_model import AdjustmentModel +from .plan_minified_model import PlanMinifiedModel + +__all__ = ["PlanModel", "PlanPhase", "Product", "TrialConfig"] + + +class PlanPhase(BaseModel): + id: str + + description: Optional[str] = None + + discount: Optional[Discount] = None + + duration: Optional[int] = None + """How many terms of length `duration_unit` this phase is active for. + + If null, this phase is evergreen and active indefinitely + """ + + duration_unit: Optional[Literal["daily", "monthly", "quarterly", "semi_annual", "annual"]] = None + + maximum: Optional[MaximumModel] = None + + maximum_amount: Optional[str] = None + + minimum: Optional[MinimumModel] = None + + minimum_amount: Optional[str] = None + + name: str + + order: int + """Determines the ordering of the phase in a plan's lifecycle. 1 = first phase.""" + + +class Product(BaseModel): + id: str + + created_at: datetime + + name: str + + +class TrialConfig(BaseModel): + trial_period: Optional[int] = None + + trial_period_unit: Literal["days"] + + +class PlanModel(BaseModel): + id: str + + adjustments: List[AdjustmentModel] + """Adjustments for this plan. + + If the plan has phases, this includes adjustments across all phases of the plan. + """ + + base_plan: Optional[PlanMinifiedModel] = None + + base_plan_id: Optional[str] = None + """ + The parent plan id if the given plan was created by overriding one or more of + the parent's prices + """ + + created_at: datetime + + currency: str + """ + An ISO 4217 currency string or custom pricing unit (`credits`) for this plan's + prices. + """ + + default_invoice_memo: Optional[str] = None + """ + The default memo text on the invoices corresponding to subscriptions on this + plan. Note that each subscription may configure its own memo. + """ + + description: str + + discount: Optional[Discount] = None + + external_plan_id: Optional[str] = None + """ + An optional user-defined ID for this plan resource, used throughout the system + as an alias for this Plan. Use this field to identify a plan by an existing + identifier in your system. + """ + + invoicing_currency: str + """An ISO 4217 currency string for which this plan is billed in. + + Matches `currency` unless `currency` is a custom pricing unit. + """ + + maximum: Optional[MaximumModel] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[MinimumModel] = None + + minimum_amount: Optional[str] = None + + name: str + + net_terms: Optional[int] = None + """Determines the difference between the invoice issue date and the due date. + + A value of "0" here signifies that invoices are due on issue, whereas a value of + "30" means that the customer has a month to pay the invoice before its overdue. + Note that individual subscriptions or invoices may set a different net terms + configuration. + """ + + plan_phases: Optional[List[PlanPhase]] = None + + prices: List[PriceModel] + """Prices for this plan. + + If the plan has phases, this includes prices across all phases of the plan. + """ + + product: Product + + status: Literal["active", "archived", "draft"] + + trial_config: TrialConfig + + version: int diff --git a/src/orb/types/shared/price_interval_fixed_fee_quantity_transition_model.py b/src/orb/types/shared/price_interval_fixed_fee_quantity_transition_model.py new file mode 100644 index 00000000..89bf7799 --- /dev/null +++ b/src/orb/types/shared/price_interval_fixed_fee_quantity_transition_model.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from datetime import datetime + +from ..._models import BaseModel + +__all__ = ["PriceIntervalFixedFeeQuantityTransitionModel"] + + +class PriceIntervalFixedFeeQuantityTransitionModel(BaseModel): + effective_date: datetime + """The date that the fixed fee quantity transition should take effect.""" + + quantity: int + """The quantity of the fixed fee quantity transition.""" diff --git a/src/orb/types/shared/price_interval_model.py b/src/orb/types/shared/price_interval_model.py new file mode 100644 index 00000000..33be7053 --- /dev/null +++ b/src/orb/types/shared/price_interval_model.py @@ -0,0 +1,80 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime + +from ..._models import BaseModel +from .price_model import PriceModel + +__all__ = ["PriceIntervalModel", "FixedFeeQuantityTransition"] + + +class FixedFeeQuantityTransition(BaseModel): + effective_date: datetime + + price_id: str + + quantity: int + + +class PriceIntervalModel(BaseModel): + id: str + + billing_cycle_day: int + """The day of the month that Orb bills for this price""" + + current_billing_period_end_date: Optional[datetime] = None + """The end of the current billing period. + + This is an exclusive timestamp, such that the instant returned is exactly the + end of the billing period. Set to null if this price interval is not currently + active. + """ + + current_billing_period_start_date: Optional[datetime] = None + """The start date of the current billing period. + + This is an inclusive timestamp; the instant returned is exactly the beginning of + the billing period. Set to null if this price interval is not currently active. + """ + + end_date: Optional[datetime] = None + """The end date of the price interval. + + This is the date that Orb stops billing for this price. + """ + + filter: Optional[str] = None + """An additional filter to apply to usage queries.""" + + fixed_fee_quantity_transitions: Optional[List[FixedFeeQuantityTransition]] = None + """The fixed fee quantity transitions for this price interval. + + This is only relevant for fixed fees. + """ + + price: PriceModel + """ + The Price resource represents a price that can be billed on a subscription, + resulting in a charge on an invoice in the form of an invoice line item. Prices + take a quantity and determine an amount to bill. + + Orb supports a few different pricing models out of the box. Each of these models + is serialized differently in a given Price object. The model_type field + determines the key for the configuration object that is present. + + For more on the types of prices, see + [the core concepts documentation](/core-concepts#plan-and-price) + """ + + start_date: datetime + """The start date of the price interval. + + This is the date that Orb starts billing for this price. + """ + + usage_customer_ids: Optional[List[str]] = None + """ + A list of customer IDs whose usage events will be aggregated and billed under + this price interval. + """ diff --git a/src/orb/types/shared/price_model.py b/src/orb/types/shared/price_model.py new file mode 100644 index 00000000..53ae0f15 --- /dev/null +++ b/src/orb/types/shared/price_model.py @@ -0,0 +1,1663 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, Union, Optional +from datetime import datetime +from typing_extensions import Literal, Annotated, TypeAlias + +from pydantic import Field as FieldInfo + +from ..._utils import PropertyInfo +from .discount import Discount +from ..._models import BaseModel +from .maximum_model import MaximumModel +from .minimum_model import MinimumModel +from .item_slim_model import ItemSlimModel +from .allocation_model import AllocationModel +from .bps_config_model import BpsConfigModel +from .bulk_config_model import BulkConfigModel +from .unit_config_model import UnitConfigModel +from .matrix_config_model import MatrixConfigModel +from .tiered_config_model import TieredConfigModel +from .package_config_model import PackageConfigModel +from .bulk_bps_config_model import BulkBpsConfigModel +from .tiered_bps_config_model import TieredBpsConfigModel +from .billable_metric_tiny_model import BillableMetricTinyModel +from .billing_cycle_configuration_model import BillingCycleConfigurationModel +from .custom_rating_function_config_model import CustomRatingFunctionConfigModel +from .matrix_with_allocation_config_model import MatrixWithAllocationConfigModel +from .dimensional_price_configuration_model import DimensionalPriceConfigurationModel + +__all__ = [ + "PriceModel", + "UnitPrice", + "PackagePrice", + "MatrixPrice", + "TieredPrice", + "TieredBpsPrice", + "BpsPrice", + "BulkBpsPrice", + "BulkPrice", + "ThresholdTotalAmountPrice", + "TieredPackagePrice", + "GroupedTieredPrice", + "TieredWithMinimumPrice", + "TieredPackageWithMinimumPrice", + "PackageWithAllocationPrice", + "UnitWithPercentPrice", + "MatrixWithAllocationPrice", + "TieredWithProrationPrice", + "UnitWithProrationPrice", + "GroupedAllocationPrice", + "GroupedWithProratedMinimumPrice", + "GroupedWithMeteredMinimumPrice", + "MatrixWithDisplayNamePrice", + "BulkWithProrationPrice", + "GroupedTieredPackagePrice", + "MaxGroupTieredPackagePrice", + "ScalableMatrixWithUnitPricingPrice", + "ScalableMatrixWithTieredPricingPrice", + "CumulativeGroupedBulkPrice", +] + + +class UnitPrice(BaseModel): + id: str + + billable_metric: Optional[BillableMetricTinyModel] = None + + billing_cycle_configuration: BillingCycleConfigurationModel + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[AllocationModel] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None + + item: ItemSlimModel + + maximum: Optional[MaximumModel] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[MinimumModel] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["unit"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + unit_config: UnitConfigModel + + dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None + + +class PackagePrice(BaseModel): + id: str + + billable_metric: Optional[BillableMetricTinyModel] = None + + billing_cycle_configuration: BillingCycleConfigurationModel + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[AllocationModel] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None + + item: ItemSlimModel + + maximum: Optional[MaximumModel] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[MinimumModel] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["package"] = FieldInfo(alias="model_type") + + name: str + + package_config: PackageConfigModel + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None + + +class MatrixPrice(BaseModel): + id: str + + billable_metric: Optional[BillableMetricTinyModel] = None + + billing_cycle_configuration: BillingCycleConfigurationModel + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[AllocationModel] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None + + item: ItemSlimModel + + matrix_config: MatrixConfigModel + + maximum: Optional[MaximumModel] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[MinimumModel] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["matrix"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None + + +class TieredPrice(BaseModel): + id: str + + billable_metric: Optional[BillableMetricTinyModel] = None + + billing_cycle_configuration: BillingCycleConfigurationModel + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[AllocationModel] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None + + item: ItemSlimModel + + maximum: Optional[MaximumModel] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[MinimumModel] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["tiered"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + tiered_config: TieredConfigModel + + dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None + + +class TieredBpsPrice(BaseModel): + id: str + + billable_metric: Optional[BillableMetricTinyModel] = None + + billing_cycle_configuration: BillingCycleConfigurationModel + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[AllocationModel] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None + + item: ItemSlimModel + + maximum: Optional[MaximumModel] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[MinimumModel] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["tiered_bps"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + tiered_bps_config: TieredBpsConfigModel + + dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None + + +class BpsPrice(BaseModel): + id: str + + billable_metric: Optional[BillableMetricTinyModel] = None + + billing_cycle_configuration: BillingCycleConfigurationModel + + bps_config: BpsConfigModel + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[AllocationModel] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None + + item: ItemSlimModel + + maximum: Optional[MaximumModel] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[MinimumModel] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["bps"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None + + +class BulkBpsPrice(BaseModel): + id: str + + billable_metric: Optional[BillableMetricTinyModel] = None + + billing_cycle_configuration: BillingCycleConfigurationModel + + bulk_bps_config: BulkBpsConfigModel + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[AllocationModel] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None + + item: ItemSlimModel + + maximum: Optional[MaximumModel] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[MinimumModel] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["bulk_bps"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None + + +class BulkPrice(BaseModel): + id: str + + billable_metric: Optional[BillableMetricTinyModel] = None + + billing_cycle_configuration: BillingCycleConfigurationModel + + bulk_config: BulkConfigModel + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[AllocationModel] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None + + item: ItemSlimModel + + maximum: Optional[MaximumModel] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[MinimumModel] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["bulk"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None + + +class ThresholdTotalAmountPrice(BaseModel): + id: str + + billable_metric: Optional[BillableMetricTinyModel] = None + + billing_cycle_configuration: BillingCycleConfigurationModel + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[AllocationModel] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None + + item: ItemSlimModel + + maximum: Optional[MaximumModel] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[MinimumModel] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["threshold_total_amount"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + threshold_total_amount_config: CustomRatingFunctionConfigModel + + dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None + + +class TieredPackagePrice(BaseModel): + id: str + + billable_metric: Optional[BillableMetricTinyModel] = None + + billing_cycle_configuration: BillingCycleConfigurationModel + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[AllocationModel] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None + + item: ItemSlimModel + + maximum: Optional[MaximumModel] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[MinimumModel] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["tiered_package"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + tiered_package_config: CustomRatingFunctionConfigModel + + dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None + + +class GroupedTieredPrice(BaseModel): + id: str + + billable_metric: Optional[BillableMetricTinyModel] = None + + billing_cycle_configuration: BillingCycleConfigurationModel + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[AllocationModel] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + grouped_tiered_config: CustomRatingFunctionConfigModel + + invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None + + item: ItemSlimModel + + maximum: Optional[MaximumModel] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[MinimumModel] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["grouped_tiered"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None + + +class TieredWithMinimumPrice(BaseModel): + id: str + + billable_metric: Optional[BillableMetricTinyModel] = None + + billing_cycle_configuration: BillingCycleConfigurationModel + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[AllocationModel] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None + + item: ItemSlimModel + + maximum: Optional[MaximumModel] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[MinimumModel] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["tiered_with_minimum"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + tiered_with_minimum_config: CustomRatingFunctionConfigModel + + dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None + + +class TieredPackageWithMinimumPrice(BaseModel): + id: str + + billable_metric: Optional[BillableMetricTinyModel] = None + + billing_cycle_configuration: BillingCycleConfigurationModel + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[AllocationModel] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None + + item: ItemSlimModel + + maximum: Optional[MaximumModel] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[MinimumModel] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["tiered_package_with_minimum"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + tiered_package_with_minimum_config: CustomRatingFunctionConfigModel + + dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None + + +class PackageWithAllocationPrice(BaseModel): + id: str + + billable_metric: Optional[BillableMetricTinyModel] = None + + billing_cycle_configuration: BillingCycleConfigurationModel + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[AllocationModel] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None + + item: ItemSlimModel + + maximum: Optional[MaximumModel] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[MinimumModel] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["package_with_allocation"] = FieldInfo(alias="model_type") + + name: str + + package_with_allocation_config: CustomRatingFunctionConfigModel + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None + + +class UnitWithPercentPrice(BaseModel): + id: str + + billable_metric: Optional[BillableMetricTinyModel] = None + + billing_cycle_configuration: BillingCycleConfigurationModel + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[AllocationModel] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None + + item: ItemSlimModel + + maximum: Optional[MaximumModel] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[MinimumModel] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["unit_with_percent"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + unit_with_percent_config: CustomRatingFunctionConfigModel + + dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None + + +class MatrixWithAllocationPrice(BaseModel): + id: str + + billable_metric: Optional[BillableMetricTinyModel] = None + + billing_cycle_configuration: BillingCycleConfigurationModel + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[AllocationModel] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None + + item: ItemSlimModel + + matrix_with_allocation_config: MatrixWithAllocationConfigModel + + maximum: Optional[MaximumModel] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[MinimumModel] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["matrix_with_allocation"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None + + +class TieredWithProrationPrice(BaseModel): + id: str + + billable_metric: Optional[BillableMetricTinyModel] = None + + billing_cycle_configuration: BillingCycleConfigurationModel + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[AllocationModel] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None + + item: ItemSlimModel + + maximum: Optional[MaximumModel] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[MinimumModel] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["tiered_with_proration"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + tiered_with_proration_config: CustomRatingFunctionConfigModel + + dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None + + +class UnitWithProrationPrice(BaseModel): + id: str + + billable_metric: Optional[BillableMetricTinyModel] = None + + billing_cycle_configuration: BillingCycleConfigurationModel + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[AllocationModel] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None + + item: ItemSlimModel + + maximum: Optional[MaximumModel] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[MinimumModel] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["unit_with_proration"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + unit_with_proration_config: CustomRatingFunctionConfigModel + + dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None + + +class GroupedAllocationPrice(BaseModel): + id: str + + billable_metric: Optional[BillableMetricTinyModel] = None + + billing_cycle_configuration: BillingCycleConfigurationModel + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[AllocationModel] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + grouped_allocation_config: CustomRatingFunctionConfigModel + + invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None + + item: ItemSlimModel + + maximum: Optional[MaximumModel] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[MinimumModel] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["grouped_allocation"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None + + +class GroupedWithProratedMinimumPrice(BaseModel): + id: str + + billable_metric: Optional[BillableMetricTinyModel] = None + + billing_cycle_configuration: BillingCycleConfigurationModel + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[AllocationModel] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + grouped_with_prorated_minimum_config: CustomRatingFunctionConfigModel + + invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None + + item: ItemSlimModel + + maximum: Optional[MaximumModel] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[MinimumModel] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["grouped_with_prorated_minimum"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None + + +class GroupedWithMeteredMinimumPrice(BaseModel): + id: str + + billable_metric: Optional[BillableMetricTinyModel] = None + + billing_cycle_configuration: BillingCycleConfigurationModel + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[AllocationModel] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + grouped_with_metered_minimum_config: CustomRatingFunctionConfigModel + + invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None + + item: ItemSlimModel + + maximum: Optional[MaximumModel] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[MinimumModel] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["grouped_with_metered_minimum"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None + + +class MatrixWithDisplayNamePrice(BaseModel): + id: str + + billable_metric: Optional[BillableMetricTinyModel] = None + + billing_cycle_configuration: BillingCycleConfigurationModel + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[AllocationModel] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None + + item: ItemSlimModel + + matrix_with_display_name_config: CustomRatingFunctionConfigModel + + maximum: Optional[MaximumModel] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[MinimumModel] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["matrix_with_display_name"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None + + +class BulkWithProrationPrice(BaseModel): + id: str + + billable_metric: Optional[BillableMetricTinyModel] = None + + billing_cycle_configuration: BillingCycleConfigurationModel + + bulk_with_proration_config: CustomRatingFunctionConfigModel + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[AllocationModel] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None + + item: ItemSlimModel + + maximum: Optional[MaximumModel] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[MinimumModel] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["bulk_with_proration"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None + + +class GroupedTieredPackagePrice(BaseModel): + id: str + + billable_metric: Optional[BillableMetricTinyModel] = None + + billing_cycle_configuration: BillingCycleConfigurationModel + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[AllocationModel] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + grouped_tiered_package_config: CustomRatingFunctionConfigModel + + invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None + + item: ItemSlimModel + + maximum: Optional[MaximumModel] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[MinimumModel] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["grouped_tiered_package"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None + + +class MaxGroupTieredPackagePrice(BaseModel): + id: str + + billable_metric: Optional[BillableMetricTinyModel] = None + + billing_cycle_configuration: BillingCycleConfigurationModel + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[AllocationModel] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None + + item: ItemSlimModel + + max_group_tiered_package_config: CustomRatingFunctionConfigModel + + maximum: Optional[MaximumModel] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[MinimumModel] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["max_group_tiered_package"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None + + +class ScalableMatrixWithUnitPricingPrice(BaseModel): + id: str + + billable_metric: Optional[BillableMetricTinyModel] = None + + billing_cycle_configuration: BillingCycleConfigurationModel + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[AllocationModel] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None + + item: ItemSlimModel + + maximum: Optional[MaximumModel] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[MinimumModel] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["scalable_matrix_with_unit_pricing"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + scalable_matrix_with_unit_pricing_config: CustomRatingFunctionConfigModel + + dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None + + +class ScalableMatrixWithTieredPricingPrice(BaseModel): + id: str + + billable_metric: Optional[BillableMetricTinyModel] = None + + billing_cycle_configuration: BillingCycleConfigurationModel + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[AllocationModel] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None + + item: ItemSlimModel + + maximum: Optional[MaximumModel] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[MinimumModel] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["scalable_matrix_with_tiered_pricing"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + scalable_matrix_with_tiered_pricing_config: CustomRatingFunctionConfigModel + + dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None + + +class CumulativeGroupedBulkPrice(BaseModel): + id: str + + billable_metric: Optional[BillableMetricTinyModel] = None + + billing_cycle_configuration: BillingCycleConfigurationModel + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[AllocationModel] = None + + cumulative_grouped_bulk_config: CustomRatingFunctionConfigModel + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + invoicing_cycle_configuration: Optional[BillingCycleConfigurationModel] = None + + item: ItemSlimModel + + maximum: Optional[MaximumModel] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[MinimumModel] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["cumulative_grouped_bulk"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + dimensional_price_configuration: Optional[DimensionalPriceConfigurationModel] = None + + +PriceModel: TypeAlias = Annotated[ + Union[ + UnitPrice, + PackagePrice, + MatrixPrice, + TieredPrice, + TieredBpsPrice, + BpsPrice, + BulkBpsPrice, + BulkPrice, + ThresholdTotalAmountPrice, + TieredPackagePrice, + GroupedTieredPrice, + TieredWithMinimumPrice, + TieredPackageWithMinimumPrice, + PackageWithAllocationPrice, + UnitWithPercentPrice, + MatrixWithAllocationPrice, + TieredWithProrationPrice, + UnitWithProrationPrice, + GroupedAllocationPrice, + GroupedWithProratedMinimumPrice, + GroupedWithMeteredMinimumPrice, + MatrixWithDisplayNamePrice, + BulkWithProrationPrice, + GroupedTieredPackagePrice, + MaxGroupTieredPackagePrice, + ScalableMatrixWithUnitPricingPrice, + ScalableMatrixWithTieredPricingPrice, + CumulativeGroupedBulkPrice, + ], + PropertyInfo(discriminator="price_model_type"), +] diff --git a/src/orb/types/shared/remove_subscription_adjustment_params.py b/src/orb/types/shared/remove_subscription_adjustment_params.py new file mode 100644 index 00000000..3821a7a2 --- /dev/null +++ b/src/orb/types/shared/remove_subscription_adjustment_params.py @@ -0,0 +1,11 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["RemoveSubscriptionAdjustmentParams"] + + +class RemoveSubscriptionAdjustmentParams(BaseModel): + adjustment_id: str + """The id of the adjustment to remove on the subscription.""" diff --git a/src/orb/types/shared/remove_subscription_price_params.py b/src/orb/types/shared/remove_subscription_price_params.py new file mode 100644 index 00000000..fa18bb78 --- /dev/null +++ b/src/orb/types/shared/remove_subscription_price_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel + +__all__ = ["RemoveSubscriptionPriceParams"] + + +class RemoveSubscriptionPriceParams(BaseModel): + external_price_id: Optional[str] = None + """The external price id of the price to remove on the subscription.""" + + price_id: Optional[str] = None + """The id of the price to remove on the subscription.""" diff --git a/src/orb/types/shared/replace_subscription_adjustment_params.py b/src/orb/types/shared/replace_subscription_adjustment_params.py new file mode 100644 index 00000000..a6bfad76 --- /dev/null +++ b/src/orb/types/shared/replace_subscription_adjustment_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .new_adjustment_model import NewAdjustmentModel + +__all__ = ["ReplaceSubscriptionAdjustmentParams"] + + +class ReplaceSubscriptionAdjustmentParams(BaseModel): + adjustment: NewAdjustmentModel + """The definition of a new adjustment to create and add to the subscription.""" + + replaces_adjustment_id: str + """The id of the adjustment on the plan to replace in the subscription.""" diff --git a/src/orb/types/shared/replace_subscription_price_params.py b/src/orb/types/shared/replace_subscription_price_params.py new file mode 100644 index 00000000..3485c672 --- /dev/null +++ b/src/orb/types/shared/replace_subscription_price_params.py @@ -0,0 +1,48 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel +from .discount_override_model import DiscountOverrideModel +from .new_allocation_price_model import NewAllocationPriceModel +from .new_subscription_price_model import NewSubscriptionPriceModel + +__all__ = ["ReplaceSubscriptionPriceParams"] + + +class ReplaceSubscriptionPriceParams(BaseModel): + replaces_price_id: str + """The id of the price on the plan to replace in the subscription.""" + + allocation_price: Optional[NewAllocationPriceModel] = None + """The definition of a new allocation price to create and add to the subscription.""" + + discounts: Optional[List[DiscountOverrideModel]] = None + """[DEPRECATED] Use add_adjustments instead. + + The subscription's discounts for the replacement price. + """ + + external_price_id: Optional[str] = None + """The external price id of the price to add to the subscription.""" + + fixed_price_quantity: Optional[float] = None + """The new quantity of the price, if the price is a fixed price.""" + + maximum_amount: Optional[str] = None + """[DEPRECATED] Use add_adjustments instead. + + The subscription's maximum amount for the replacement price. + """ + + minimum_amount: Optional[str] = None + """[DEPRECATED] Use add_adjustments instead. + + The subscription's minimum amount for the replacement price. + """ + + price: Optional[NewSubscriptionPriceModel] = None + """The definition of a new price to create and add to the subscription.""" + + price_id: Optional[str] = None + """The id of the price to add to the subscription.""" diff --git a/src/orb/types/shared/sub_line_item_grouping_model.py b/src/orb/types/shared/sub_line_item_grouping_model.py new file mode 100644 index 00000000..e521b20d --- /dev/null +++ b/src/orb/types/shared/sub_line_item_grouping_model.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel + +__all__ = ["SubLineItemGroupingModel"] + + +class SubLineItemGroupingModel(BaseModel): + key: str + + value: Optional[str] = None + """No value indicates the default group""" diff --git a/src/orb/types/shared/subscription_minified_model.py b/src/orb/types/shared/subscription_minified_model.py new file mode 100644 index 00000000..ea4b1894 --- /dev/null +++ b/src/orb/types/shared/subscription_minified_model.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["SubscriptionMinifiedModel"] + + +class SubscriptionMinifiedModel(BaseModel): + id: str diff --git a/src/orb/types/shared/subscription_model.py b/src/orb/types/shared/subscription_model.py new file mode 100644 index 00000000..eccbf040 --- /dev/null +++ b/src/orb/types/shared/subscription_model.py @@ -0,0 +1,154 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Union, Optional +from datetime import datetime +from typing_extensions import Literal, Annotated, TypeAlias + +from ..._utils import PropertyInfo +from ..._models import BaseModel +from .plan_model import PlanModel +from .customer_model import CustomerModel +from .price_interval_model import PriceIntervalModel +from .maximum_interval_model import MaximumIntervalModel +from .minimum_interval_model import MinimumIntervalModel +from .coupon_redemption_model import CouponRedemptionModel +from .adjustment_interval_model import AdjustmentIntervalModel +from .subscription_trial_info_model import SubscriptionTrialInfoModel +from .usage_discount_interval_model import UsageDiscountIntervalModel +from .amount_discount_interval_model import AmountDiscountIntervalModel +from .percentage_discount_interval_model import PercentageDiscountIntervalModel +from .fixed_fee_quantity_schedule_entry_model import FixedFeeQuantityScheduleEntryModel +from .billing_cycle_anchor_configuration_model import BillingCycleAnchorConfigurationModel + +__all__ = ["SubscriptionModel", "DiscountInterval"] + +DiscountInterval: TypeAlias = Annotated[ + Union[AmountDiscountIntervalModel, PercentageDiscountIntervalModel, UsageDiscountIntervalModel], + PropertyInfo(discriminator="discount_type"), +] + + +class SubscriptionModel(BaseModel): + id: str + + active_plan_phase_order: Optional[int] = None + """ + The current plan phase that is active, only if the subscription's plan has + phases. + """ + + adjustment_intervals: List[AdjustmentIntervalModel] + """The adjustment intervals for this subscription.""" + + auto_collection: Optional[bool] = None + """ + Determines whether issued invoices for this subscription will automatically be + charged with the saved payment method on the due date. This property defaults to + the plan's behavior. If null, defaults to the customer's setting. + """ + + billing_cycle_anchor_configuration: BillingCycleAnchorConfigurationModel + + billing_cycle_day: int + """The day of the month on which the billing cycle is anchored. + + If the maximum number of days in a month is greater than this value, the last + day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April + means the billing period begins on the 30th. + """ + + created_at: datetime + + current_billing_period_end_date: Optional[datetime] = None + """The end of the current billing period. + + This is an exclusive timestamp, such that the instant returned is not part of + the billing period. Set to null for subscriptions that are not currently active. + """ + + current_billing_period_start_date: Optional[datetime] = None + """The start date of the current billing period. + + This is an inclusive timestamp; the instant returned is exactly the beginning of + the billing period. Set to null if the subscription is not currently active. + """ + + customer: CustomerModel + """ + A customer is a buyer of your products, and the other party to the billing + relationship. + + In Orb, customers are assigned system generated identifiers automatically, but + it's often desirable to have these match existing identifiers in your system. To + avoid having to denormalize Orb ID information, you can pass in an + `external_customer_id` with your own identifier. See + [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + information about how these aliases work in Orb. + + In addition to having an identifier in your system, a customer may exist in a + payment provider solution like Stripe. Use the `payment_provider_id` and the + `payment_provider` enum field to express this mapping. + + A customer also has a timezone (from the standard + [IANA timezone database](https://www.iana.org/time-zones)), which defaults to + your account's timezone. See [Timezone localization](/essentials/timezones) for + information on what this timezone parameter influences within Orb. + """ + + default_invoice_memo: Optional[str] = None + """Determines the default memo on this subscriptions' invoices. + + Note that if this is not provided, it is determined by the plan configuration. + """ + + discount_intervals: List[DiscountInterval] + """The discount intervals for this subscription.""" + + end_date: Optional[datetime] = None + """The date Orb stops billing for this subscription.""" + + fixed_fee_quantity_schedule: List[FixedFeeQuantityScheduleEntryModel] + + invoicing_threshold: Optional[str] = None + + maximum_intervals: List[MaximumIntervalModel] + """The maximum intervals for this subscription.""" + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum_intervals: List[MinimumIntervalModel] + """The minimum intervals for this subscription.""" + + net_terms: int + """ + Determines the difference between the invoice issue date for subscription + invoices as the date that they are due. A value of `0` here represents that the + invoice is due on issue, whereas a value of `30` represents that the customer + has a month to pay the invoice. + """ + + plan: PlanModel + """ + The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be + subscribed to by a customer. Plans define the billing behavior of the + subscription. You can see more about how to configure prices in the + [Price resource](/reference/price). + """ + + price_intervals: List[PriceIntervalModel] + """The price intervals for this subscription.""" + + redeemed_coupon: Optional[CouponRedemptionModel] = None + + start_date: datetime + """The date Orb starts billing for this subscription.""" + + status: Literal["active", "ended", "upcoming"] + + trial_info: SubscriptionTrialInfoModel diff --git a/src/orb/types/shared/subscription_trial_info_model.py b/src/orb/types/shared/subscription_trial_info_model.py new file mode 100644 index 00000000..0a829f14 --- /dev/null +++ b/src/orb/types/shared/subscription_trial_info_model.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime + +from ..._models import BaseModel + +__all__ = ["SubscriptionTrialInfoModel"] + + +class SubscriptionTrialInfoModel(BaseModel): + end_date: Optional[datetime] = None diff --git a/src/orb/types/shared/subscriptions_model.py b/src/orb/types/shared/subscriptions_model.py new file mode 100644 index 00000000..dd001701 --- /dev/null +++ b/src/orb/types/shared/subscriptions_model.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .subscription_model import SubscriptionModel +from .pagination_metadata import PaginationMetadata + +__all__ = ["SubscriptionsModel"] + + +class SubscriptionsModel(BaseModel): + data: List[SubscriptionModel] + + pagination_metadata: PaginationMetadata diff --git a/src/orb/types/shared/tax_amount_model.py b/src/orb/types/shared/tax_amount_model.py new file mode 100644 index 00000000..d7530881 --- /dev/null +++ b/src/orb/types/shared/tax_amount_model.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel + +__all__ = ["TaxAmountModel"] + + +class TaxAmountModel(BaseModel): + amount: str + """The amount of additional tax incurred by this tax rate.""" + + tax_rate_description: str + """The human-readable description of the applied tax rate.""" + + tax_rate_percentage: Optional[str] = None + """The tax rate percentage, out of 100.""" diff --git a/src/orb/types/shared/threshold_model.py b/src/orb/types/shared/threshold_model.py new file mode 100644 index 00000000..e0df8511 --- /dev/null +++ b/src/orb/types/shared/threshold_model.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["ThresholdModel"] + + +class ThresholdModel(BaseModel): + value: float + """The value at which an alert will fire. + + For credit balance alerts, the alert will fire at or below this value. For usage + and cost alerts, the alert will fire at or above this value. + """ diff --git a/src/orb/types/shared/tiered_bps_config_model.py b/src/orb/types/shared/tiered_bps_config_model.py new file mode 100644 index 00000000..8e86a9de --- /dev/null +++ b/src/orb/types/shared/tiered_bps_config_model.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["TieredBpsConfigModel", "Tier"] + + +class Tier(BaseModel): + bps: float + """Per-event basis point rate""" + + minimum_amount: str + """Inclusive tier starting value""" + + maximum_amount: Optional[str] = None + """Exclusive tier ending value""" + + per_unit_maximum: Optional[str] = None + """Per unit maximum to charge""" + + +class TieredBpsConfigModel(BaseModel): + tiers: List[Tier] + """ + Tiers for a Graduated BPS pricing model, where usage is bucketed into specified + tiers + """ diff --git a/src/orb/types/shared/tiered_config_model.py b/src/orb/types/shared/tiered_config_model.py new file mode 100644 index 00000000..76ac4342 --- /dev/null +++ b/src/orb/types/shared/tiered_config_model.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["TieredConfigModel", "Tier"] + + +class Tier(BaseModel): + first_unit: float + """Inclusive tier starting value""" + + unit_amount: str + """Amount per unit""" + + last_unit: Optional[float] = None + """Exclusive tier ending value. If null, this is treated as the last tier""" + + +class TieredConfigModel(BaseModel): + tiers: List[Tier] + """Tiers for rating based on total usage quantities into the specified tier""" diff --git a/src/orb/types/customers/credits/top_up_list_response.py b/src/orb/types/shared/top_up_model.py similarity index 93% rename from src/orb/types/customers/credits/top_up_list_response.py rename to src/orb/types/shared/top_up_model.py index 69a59f4d..f6e0f5d7 100644 --- a/src/orb/types/customers/credits/top_up_list_response.py +++ b/src/orb/types/shared/top_up_model.py @@ -3,9 +3,9 @@ from typing import Optional from typing_extensions import Literal -from ...._models import BaseModel +from ..._models import BaseModel -__all__ = ["TopUpListResponse", "InvoiceSettings"] +__all__ = ["TopUpModel", "InvoiceSettings"] class InvoiceSettings(BaseModel): @@ -32,7 +32,7 @@ class InvoiceSettings(BaseModel): """ -class TopUpListResponse(BaseModel): +class TopUpModel(BaseModel): id: str amount: str diff --git a/src/orb/types/shared/top_ups_model.py b/src/orb/types/shared/top_ups_model.py new file mode 100644 index 00000000..fcf83665 --- /dev/null +++ b/src/orb/types/shared/top_ups_model.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .top_up_model import TopUpModel +from .pagination_metadata import PaginationMetadata + +__all__ = ["TopUpsModel"] + + +class TopUpsModel(BaseModel): + data: List[TopUpModel] + + pagination_metadata: PaginationMetadata diff --git a/src/orb/types/shared/trial_discount_model.py b/src/orb/types/shared/trial_discount_model.py new file mode 100644 index 00000000..d300cb1f --- /dev/null +++ b/src/orb/types/shared/trial_discount_model.py @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["TrialDiscountModel"] + + +class TrialDiscountModel(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this discount applies to. + + For plan/plan phase discounts, this can be a subset of prices. + """ + + discount_type: Literal["trial"] + + reason: Optional[str] = None + + trial_amount_discount: Optional[str] = None + """Only available if discount_type is `trial`""" + + trial_percentage_discount: Optional[float] = None + """Only available if discount_type is `trial`""" diff --git a/src/orb/types/shared/unit_config_model.py b/src/orb/types/shared/unit_config_model.py new file mode 100644 index 00000000..9a974dbc --- /dev/null +++ b/src/orb/types/shared/unit_config_model.py @@ -0,0 +1,11 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["UnitConfigModel"] + + +class UnitConfigModel(BaseModel): + unit_amount: str + """Rate per unit of usage""" diff --git a/src/orb/types/shared/update_price_request_params.py b/src/orb/types/shared/update_price_request_params.py new file mode 100644 index 00000000..766ade7d --- /dev/null +++ b/src/orb/types/shared/update_price_request_params.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, Optional + +from ..._models import BaseModel + +__all__ = ["UpdatePriceRequestParams"] + + +class UpdatePriceRequestParams(BaseModel): + metadata: Optional[Dict[str, Optional[str]]] = None + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ diff --git a/src/orb/types/shared/usage_discount_interval_model.py b/src/orb/types/shared/usage_discount_interval_model.py new file mode 100644 index 00000000..9dde8973 --- /dev/null +++ b/src/orb/types/shared/usage_discount_interval_model.py @@ -0,0 +1,31 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["UsageDiscountIntervalModel"] + + +class UsageDiscountIntervalModel(BaseModel): + applies_to_price_ids: List[str] + """The price ids that this discount interval applies to.""" + + applies_to_price_interval_ids: List[str] + """The price interval ids that this discount interval applies to.""" + + discount_type: Literal["usage"] + + end_date: Optional[datetime] = None + """The end date of the discount interval.""" + + start_date: datetime + """The start date of the discount interval.""" + + usage_discount: float + """Only available if discount_type is `usage`. + + Number of usage units that this discount is for + """ diff --git a/src/orb/types/shared/usage_model.py b/src/orb/types/shared/usage_model.py new file mode 100644 index 00000000..b3e611ea --- /dev/null +++ b/src/orb/types/shared/usage_model.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from datetime import datetime + +from ..._models import BaseModel + +__all__ = ["UsageModel"] + + +class UsageModel(BaseModel): + quantity: float + + timeframe_end: datetime + + timeframe_start: datetime diff --git a/src/orb/types/shared_params/__init__.py b/src/orb/types/shared_params/__init__.py index 9d0d3706..852a124d 100644 --- a/src/orb/types/shared_params/__init__.py +++ b/src/orb/types/shared_params/__init__.py @@ -3,5 +3,51 @@ from .discount import Discount as Discount from .trial_discount import TrialDiscount as TrialDiscount from .amount_discount import AmountDiscount as AmountDiscount +from .threshold_model import ThresholdModel as ThresholdModel +from .bps_config_model import BpsConfigModel as BpsConfigModel +from .bulk_config_model import BulkConfigModel as BulkConfigModel +from .unit_config_model import UnitConfigModel as UnitConfigModel +from .matrix_value_model import MatrixValueModel as MatrixValueModel +from .address_input_model import AddressInputModel as AddressInputModel +from .matrix_config_model import MatrixConfigModel as MatrixConfigModel from .percentage_discount import PercentageDiscount as PercentageDiscount +from .tiered_config_model import TieredConfigModel as TieredConfigModel +from .new_adjustment_model import NewAdjustmentModel as NewAdjustmentModel +from .package_config_model import PackageConfigModel as PackageConfigModel +from .bulk_bps_config_model import BulkBpsConfigModel as BulkBpsConfigModel +from .customer_tax_id_model import CustomerTaxIDModel as CustomerTaxIDModel +from .discount_override_model import DiscountOverrideModel as DiscountOverrideModel +from .tiered_bps_config_model import TieredBpsConfigModel as TieredBpsConfigModel +from .new_floating_price_model import NewFloatingPriceModel as NewFloatingPriceModel +from .new_allocation_price_model import NewAllocationPriceModel as NewAllocationPriceModel from .billing_cycle_relative_date import BillingCycleRelativeDate as BillingCycleRelativeDate +from .new_tax_configuration_model import NewTaxConfigurationModel as NewTaxConfigurationModel +from .new_subscription_price_model import NewSubscriptionPriceModel as NewSubscriptionPriceModel +from .add_subscription_price_params import AddSubscriptionPriceParams as AddSubscriptionPriceParams +from .item_external_connection_model import ItemExternalConnectionModel as ItemExternalConnectionModel +from .add_credit_ledger_entry_request import AddCreditLedgerEntryRequest as AddCreditLedgerEntryRequest +from .customer_hierarchy_config_model import CustomerHierarchyConfigModel as CustomerHierarchyConfigModel +from .remove_subscription_price_params import RemoveSubscriptionPriceParams as RemoveSubscriptionPriceParams +from .new_reporting_configuration_model import NewReportingConfigurationModel as NewReportingConfigurationModel +from .replace_subscription_price_params import ReplaceSubscriptionPriceParams as ReplaceSubscriptionPriceParams +from .add_subscription_adjustment_params import AddSubscriptionAdjustmentParams as AddSubscriptionAdjustmentParams +from .custom_rating_function_config_model import CustomRatingFunctionConfigModel as CustomRatingFunctionConfigModel +from .matrix_with_allocation_config_model import MatrixWithAllocationConfigModel as MatrixWithAllocationConfigModel +from .new_billing_cycle_configuration_model import ( + NewBillingCycleConfigurationModel as NewBillingCycleConfigurationModel, +) +from .remove_subscription_adjustment_params import ( + RemoveSubscriptionAdjustmentParams as RemoveSubscriptionAdjustmentParams, +) +from .replace_subscription_adjustment_params import ( + ReplaceSubscriptionAdjustmentParams as ReplaceSubscriptionAdjustmentParams, +) +from .new_accounting_sync_configuration_model import ( + NewAccountingSyncConfigurationModel as NewAccountingSyncConfigurationModel, +) +from .billing_cycle_anchor_configuration_model import ( + BillingCycleAnchorConfigurationModel as BillingCycleAnchorConfigurationModel, +) +from .price_interval_fixed_fee_quantity_transition_model import ( + PriceIntervalFixedFeeQuantityTransitionModel as PriceIntervalFixedFeeQuantityTransitionModel, +) diff --git a/src/orb/types/shared_params/add_credit_ledger_entry_request.py b/src/orb/types/shared_params/add_credit_ledger_entry_request.py new file mode 100644 index 00000000..7bf51ab8 --- /dev/null +++ b/src/orb/types/shared_params/add_credit_ledger_entry_request.py @@ -0,0 +1,256 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Union, Optional +from datetime import date, datetime +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict + +from ..._utils import PropertyInfo + +__all__ = [ + "AddCreditLedgerEntryRequest", + "AddIncrementCreditLedgerEntryRequestParams", + "AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings", + "AddDecrementCreditLedgerEntryRequestParams", + "AddExpirationChangeCreditLedgerEntryRequestParams", + "AddVoidCreditLedgerEntryRequestParams", + "AddAmendmentCreditLedgerEntryRequestParams", +] + + +class AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings(TypedDict, total=False): + auto_collection: Required[bool] + """ + Whether the credits purchase invoice should auto collect with the customer's + saved payment method. + """ + + net_terms: Required[int] + """ + The net terms determines the difference between the invoice date and the issue + date for the invoice. If you intend the invoice to be due on issue, set this + to 0. + """ + + memo: Optional[str] + """An optional memo to display on the invoice.""" + + require_successful_payment: bool + """ + If true, the new credit block will require that the corresponding invoice is + paid before it can be drawn down from. + """ + + +class AddIncrementCreditLedgerEntryRequestParams(TypedDict, total=False): + amount: Required[float] + """The number of credits to effect. + + Note that this is required for increment, decrement, void, or undo operations. + """ + + entry_type: Required[Literal["increment"]] + + currency: Optional[str] + """The currency or custom pricing unit to use for this ledger entry. + + If this is a real-world currency, it must match the customer's invoicing + currency. + """ + + description: Optional[str] + """Optional metadata that can be specified when adding ledger results via the API. + + For example, this can be used to note an increment refers to trial credits, or + for noting corrections as a result of an incident, etc. + """ + + effective_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] + """ + An ISO 8601 format date that denotes when this credit balance should become + available for use. + """ + + expiry_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] + """An ISO 8601 format date that denotes when this credit balance should expire.""" + + invoice_settings: Optional[AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings] + """ + Passing `invoice_settings` automatically generates an invoice for the newly + added credits. If `invoice_settings` is passed, you must specify + per_unit_cost_basis, as the calculation of the invoice total is done on that + basis. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + per_unit_cost_basis: Optional[str] + """Can only be specified when entry_type=increment. + + How much, in the customer's currency, a customer paid for a single credit in + this block + """ + + +class AddDecrementCreditLedgerEntryRequestParams(TypedDict, total=False): + amount: Required[float] + """The number of credits to effect. + + Note that this is required for increment, decrement, void, or undo operations. + """ + + entry_type: Required[Literal["decrement"]] + + currency: Optional[str] + """The currency or custom pricing unit to use for this ledger entry. + + If this is a real-world currency, it must match the customer's invoicing + currency. + """ + + description: Optional[str] + """Optional metadata that can be specified when adding ledger results via the API. + + For example, this can be used to note an increment refers to trial credits, or + for noting corrections as a result of an incident, etc. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class AddExpirationChangeCreditLedgerEntryRequestParams(TypedDict, total=False): + entry_type: Required[Literal["expiration_change"]] + + expiry_date: Required[Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]] + """An ISO 8601 format date that identifies the origination credit block to expire""" + + target_expiry_date: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]] + """ + A future date (specified in YYYY-MM-DD format) used for expiration change, + denoting when credits transferred (as part of a partial block expiration) should + expire. + """ + + amount: Optional[float] + """The number of credits to effect. + + Note that this is required for increment, decrement, void, or undo operations. + """ + + block_id: Optional[str] + """ + The ID of the block affected by an expiration_change, used to differentiate + between multiple blocks with the same `expiry_date`. + """ + + currency: Optional[str] + """The currency or custom pricing unit to use for this ledger entry. + + If this is a real-world currency, it must match the customer's invoicing + currency. + """ + + description: Optional[str] + """Optional metadata that can be specified when adding ledger results via the API. + + For example, this can be used to note an increment refers to trial credits, or + for noting corrections as a result of an incident, etc. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class AddVoidCreditLedgerEntryRequestParams(TypedDict, total=False): + amount: Required[float] + """The number of credits to effect. + + Note that this is required for increment, decrement, void, or undo operations. + """ + + block_id: Required[str] + """The ID of the block to void.""" + + entry_type: Required[Literal["void"]] + + currency: Optional[str] + """The currency or custom pricing unit to use for this ledger entry. + + If this is a real-world currency, it must match the customer's invoicing + currency. + """ + + description: Optional[str] + """Optional metadata that can be specified when adding ledger results via the API. + + For example, this can be used to note an increment refers to trial credits, or + for noting corrections as a result of an incident, etc. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + void_reason: Optional[Literal["refund"]] + """Can only be specified when `entry_type=void`. The reason for the void.""" + + +class AddAmendmentCreditLedgerEntryRequestParams(TypedDict, total=False): + amount: Required[float] + """The number of credits to effect. + + Note that this is required for increment, decrement or void operations. + """ + + block_id: Required[str] + """The ID of the block to reverse a decrement from.""" + + entry_type: Required[Literal["amendment"]] + + currency: Optional[str] + """The currency or custom pricing unit to use for this ledger entry. + + If this is a real-world currency, it must match the customer's invoicing + currency. + """ + + description: Optional[str] + """Optional metadata that can be specified when adding ledger results via the API. + + For example, this can be used to note an increment refers to trial credits, or + for noting corrections as a result of an incident, etc. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +AddCreditLedgerEntryRequest: TypeAlias = Union[ + AddIncrementCreditLedgerEntryRequestParams, + AddDecrementCreditLedgerEntryRequestParams, + AddExpirationChangeCreditLedgerEntryRequestParams, + AddVoidCreditLedgerEntryRequestParams, + AddAmendmentCreditLedgerEntryRequestParams, +] diff --git a/src/orb/types/shared_params/add_subscription_adjustment_params.py b/src/orb/types/shared_params/add_subscription_adjustment_params.py new file mode 100644 index 00000000..d396c086 --- /dev/null +++ b/src/orb/types/shared_params/add_subscription_adjustment_params.py @@ -0,0 +1,35 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Optional +from datetime import datetime +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .new_adjustment_model import NewAdjustmentModel + +__all__ = ["AddSubscriptionAdjustmentParams"] + + +class AddSubscriptionAdjustmentParams(TypedDict, total=False): + adjustment: Required[NewAdjustmentModel] + """The definition of a new adjustment to create and add to the subscription.""" + + end_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] + """The end date of the adjustment interval. + + This is the date that the adjustment will stop affecting prices on the + subscription. + """ + + plan_phase_order: Optional[int] + """The phase to add this adjustment to.""" + + start_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] + """The start date of the adjustment interval. + + This is the date that the adjustment will start affecting prices on the + subscription. If null, the adjustment will start when the phase or subscription + starts. + """ diff --git a/src/orb/types/shared_params/add_subscription_price_params.py b/src/orb/types/shared_params/add_subscription_price_params.py new file mode 100644 index 00000000..3e850da3 --- /dev/null +++ b/src/orb/types/shared_params/add_subscription_price_params.py @@ -0,0 +1,63 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable, Optional +from datetime import datetime +from typing_extensions import Annotated, TypedDict + +from ..._utils import PropertyInfo +from .discount_override_model import DiscountOverrideModel +from .new_allocation_price_model import NewAllocationPriceModel +from .new_subscription_price_model import NewSubscriptionPriceModel + +__all__ = ["AddSubscriptionPriceParams"] + + +class AddSubscriptionPriceParams(TypedDict, total=False): + allocation_price: Optional[NewAllocationPriceModel] + """The definition of a new allocation price to create and add to the subscription.""" + + discounts: Optional[Iterable[DiscountOverrideModel]] + """[DEPRECATED] Use add_adjustments instead. + + The subscription's discounts for this price. + """ + + end_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] + """The end date of the price interval. + + This is the date that the price will stop billing on the subscription. If null, + billing will end when the phase or subscription ends. + """ + + external_price_id: Optional[str] + """The external price id of the price to add to the subscription.""" + + maximum_amount: Optional[str] + """[DEPRECATED] Use add_adjustments instead. + + The subscription's maximum amount for this price. + """ + + minimum_amount: Optional[str] + """[DEPRECATED] Use add_adjustments instead. + + The subscription's minimum amount for this price. + """ + + plan_phase_order: Optional[int] + """The phase to add this price to.""" + + price: Optional[NewSubscriptionPriceModel] + """The definition of a new price to create and add to the subscription.""" + + price_id: Optional[str] + """The id of the price to add to the subscription.""" + + start_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] + """The start date of the price interval. + + This is the date that the price will start billing on the subscription. If null, + billing will start when the phase or subscription starts. + """ diff --git a/src/orb/types/shared_params/address_input_model.py b/src/orb/types/shared_params/address_input_model.py new file mode 100644 index 00000000..e1c398e8 --- /dev/null +++ b/src/orb/types/shared_params/address_input_model.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import TypedDict + +__all__ = ["AddressInputModel"] + + +class AddressInputModel(TypedDict, total=False): + city: Optional[str] + + country: Optional[str] + + line1: Optional[str] + + line2: Optional[str] + + postal_code: Optional[str] + + state: Optional[str] diff --git a/src/orb/types/shared_params/billing_cycle_anchor_configuration_model.py b/src/orb/types/shared_params/billing_cycle_anchor_configuration_model.py new file mode 100644 index 00000000..6365dde8 --- /dev/null +++ b/src/orb/types/shared_params/billing_cycle_anchor_configuration_model.py @@ -0,0 +1,32 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Required, TypedDict + +__all__ = ["BillingCycleAnchorConfigurationModel"] + + +class BillingCycleAnchorConfigurationModel(TypedDict, total=False): + day: Required[int] + """The day of the month on which the billing cycle is anchored. + + If the maximum number of days in a month is greater than this value, the last + day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April + means the billing period begins on the 30th. + """ + + month: Optional[int] + """The month on which the billing cycle is anchored (e.g. + + a quarterly price anchored in February would have cycles starting February, May, + August, and November). + """ + + year: Optional[int] + """The year on which the billing cycle is anchored (e.g. + + a 2 year billing cycle anchored on 2021 would have cycles starting on 2021, + 2023, 2025, etc.). + """ diff --git a/src/orb/types/shared_params/bps_config_model.py b/src/orb/types/shared_params/bps_config_model.py new file mode 100644 index 00000000..bedb28d9 --- /dev/null +++ b/src/orb/types/shared_params/bps_config_model.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Required, TypedDict + +__all__ = ["BpsConfigModel"] + + +class BpsConfigModel(TypedDict, total=False): + bps: Required[float] + """Basis point take rate per event""" + + per_unit_maximum: Optional[str] + """Optional currency amount maximum to cap spend per event""" diff --git a/src/orb/types/shared_params/bulk_bps_config_model.py b/src/orb/types/shared_params/bulk_bps_config_model.py new file mode 100644 index 00000000..a34ff8f6 --- /dev/null +++ b/src/orb/types/shared_params/bulk_bps_config_model.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable, Optional +from typing_extensions import Required, TypedDict + +__all__ = ["BulkBpsConfigModel", "Tier"] + + +class Tier(TypedDict, total=False): + bps: Required[float] + """Basis points to rate on""" + + maximum_amount: Optional[str] + """Upper bound for tier""" + + per_unit_maximum: Optional[str] + """The maximum amount to charge for any one event""" + + +class BulkBpsConfigModel(TypedDict, total=False): + tiers: Required[Iterable[Tier]] + """ + Tiers for a bulk BPS pricing model where all usage is aggregated to a single + tier based on total volume + """ diff --git a/src/orb/types/shared_params/bulk_config_model.py b/src/orb/types/shared_params/bulk_config_model.py new file mode 100644 index 00000000..386b8d87 --- /dev/null +++ b/src/orb/types/shared_params/bulk_config_model.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable, Optional +from typing_extensions import Required, TypedDict + +__all__ = ["BulkConfigModel", "Tier"] + + +class Tier(TypedDict, total=False): + unit_amount: Required[str] + """Amount per unit""" + + maximum_units: Optional[float] + """Upper bound for this tier""" + + +class BulkConfigModel(TypedDict, total=False): + tiers: Required[Iterable[Tier]] + """Bulk tiers for rating based on total usage volume""" diff --git a/src/orb/types/shared_params/custom_rating_function_config_model.py b/src/orb/types/shared_params/custom_rating_function_config_model.py new file mode 100644 index 00000000..4f8aab29 --- /dev/null +++ b/src/orb/types/shared_params/custom_rating_function_config_model.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict +from typing_extensions import TypeAlias + +__all__ = ["CustomRatingFunctionConfigModel"] + +CustomRatingFunctionConfigModel: TypeAlias = Dict[str, object] diff --git a/src/orb/types/shared_params/customer_hierarchy_config_model.py b/src/orb/types/shared_params/customer_hierarchy_config_model.py new file mode 100644 index 00000000..5f6004c2 --- /dev/null +++ b/src/orb/types/shared_params/customer_hierarchy_config_model.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional +from typing_extensions import TypedDict + +__all__ = ["CustomerHierarchyConfigModel"] + + +class CustomerHierarchyConfigModel(TypedDict, total=False): + child_customer_ids: List[str] + """A list of child customer IDs to add to the hierarchy. + + The desired child customers must not already be part of another hierarchy. + """ + + parent_customer_id: Optional[str] + """The ID of the parent customer in the hierarchy. + + The desired parent customer must not be a child of another customer. + """ diff --git a/src/orb/types/shared_params/customer_tax_id_model.py b/src/orb/types/shared_params/customer_tax_id_model.py new file mode 100644 index 00000000..9bcfd7b1 --- /dev/null +++ b/src/orb/types/shared_params/customer_tax_id_model.py @@ -0,0 +1,170 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["CustomerTaxIDModel"] + + +class CustomerTaxIDModel(TypedDict, total=False): + country: Required[ + Literal[ + "AD", + "AE", + "AR", + "AT", + "AU", + "BE", + "BG", + "BH", + "BO", + "BR", + "CA", + "CH", + "CL", + "CN", + "CO", + "CR", + "CY", + "CZ", + "DE", + "DK", + "EE", + "DO", + "EC", + "EG", + "ES", + "EU", + "FI", + "FR", + "GB", + "GE", + "GR", + "HK", + "HR", + "HU", + "ID", + "IE", + "IL", + "IN", + "IS", + "IT", + "JP", + "KE", + "KR", + "KZ", + "LI", + "LT", + "LU", + "LV", + "MT", + "MX", + "MY", + "NG", + "NL", + "NO", + "NZ", + "OM", + "PE", + "PH", + "PL", + "PT", + "RO", + "RS", + "RU", + "SA", + "SE", + "SG", + "SI", + "SK", + "SV", + "TH", + "TR", + "TW", + "UA", + "US", + "UY", + "VE", + "VN", + "ZA", + ] + ] + + type: Required[ + Literal[ + "ad_nrt", + "ae_trn", + "ar_cuit", + "eu_vat", + "au_abn", + "au_arn", + "bg_uic", + "bh_vat", + "bo_tin", + "br_cnpj", + "br_cpf", + "ca_bn", + "ca_gst_hst", + "ca_pst_bc", + "ca_pst_mb", + "ca_pst_sk", + "ca_qst", + "ch_vat", + "cl_tin", + "cn_tin", + "co_nit", + "cr_tin", + "do_rcn", + "ec_ruc", + "eg_tin", + "es_cif", + "eu_oss_vat", + "gb_vat", + "ge_vat", + "hk_br", + "hu_tin", + "id_npwp", + "il_vat", + "in_gst", + "is_vat", + "jp_cn", + "jp_rn", + "jp_trn", + "ke_pin", + "kr_brn", + "kz_bin", + "li_uid", + "mx_rfc", + "my_frp", + "my_itn", + "my_sst", + "ng_tin", + "no_vat", + "no_voec", + "nz_gst", + "om_vat", + "pe_ruc", + "ph_tin", + "ro_tin", + "rs_pib", + "ru_inn", + "ru_kpp", + "sa_vat", + "sg_gst", + "sg_uen", + "si_tin", + "sv_nit", + "th_vat", + "tr_tin", + "tw_vat", + "ua_vat", + "us_ein", + "uy_ruc", + "ve_rif", + "vn_tin", + "za_vat", + ] + ] + + value: Required[str] diff --git a/src/orb/types/shared_params/discount_override_model.py b/src/orb/types/shared_params/discount_override_model.py new file mode 100644 index 00000000..1cc857e9 --- /dev/null +++ b/src/orb/types/shared_params/discount_override_model.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["DiscountOverrideModel"] + + +class DiscountOverrideModel(TypedDict, total=False): + discount_type: Required[Literal["percentage", "usage", "amount"]] + + amount_discount: Optional[str] + """Only available if discount_type is `amount`.""" + + percentage_discount: Optional[float] + """Only available if discount_type is `percentage`. + + This is a number between 0 and 1. + """ + + usage_discount: Optional[float] + """Only available if discount_type is `usage`. + + Number of usage units that this discount is for + """ diff --git a/src/orb/types/shared_params/item_external_connection_model.py b/src/orb/types/shared_params/item_external_connection_model.py new file mode 100644 index 00000000..a73e9bc5 --- /dev/null +++ b/src/orb/types/shared_params/item_external_connection_model.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["ItemExternalConnectionModel"] + + +class ItemExternalConnectionModel(TypedDict, total=False): + external_connection_name: Required[ + Literal["stripe", "quickbooks", "bill.com", "netsuite", "taxjar", "avalara", "anrok"] + ] + + external_entity_id: Required[str] diff --git a/src/orb/types/shared_params/matrix_config_model.py b/src/orb/types/shared_params/matrix_config_model.py new file mode 100644 index 00000000..9f889f10 --- /dev/null +++ b/src/orb/types/shared_params/matrix_config_model.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable, Optional +from typing_extensions import Required, TypedDict + +from .matrix_value_model import MatrixValueModel + +__all__ = ["MatrixConfigModel"] + + +class MatrixConfigModel(TypedDict, total=False): + default_unit_amount: Required[str] + """Default per unit rate for any usage not bucketed into a specified matrix_value""" + + dimensions: Required[List[Optional[str]]] + """One or two event property values to evaluate matrix groups by""" + + matrix_values: Required[Iterable[MatrixValueModel]] + """Matrix values for specified matrix grouping keys""" diff --git a/src/orb/types/shared_params/matrix_value_model.py b/src/orb/types/shared_params/matrix_value_model.py new file mode 100644 index 00000000..e4d12f47 --- /dev/null +++ b/src/orb/types/shared_params/matrix_value_model.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional +from typing_extensions import Required, TypedDict + +__all__ = ["MatrixValueModel"] + + +class MatrixValueModel(TypedDict, total=False): + dimension_values: Required[List[Optional[str]]] + """One or two matrix keys to filter usage to this Matrix value by. + + For example, ["region", "tier"] could be used to filter cloud usage by a cloud + region and an instance tier. + """ + + unit_amount: Required[str] + """Unit price for the specified dimension_values""" diff --git a/src/orb/types/shared_params/matrix_with_allocation_config_model.py b/src/orb/types/shared_params/matrix_with_allocation_config_model.py new file mode 100644 index 00000000..972e5b0d --- /dev/null +++ b/src/orb/types/shared_params/matrix_with_allocation_config_model.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable, Optional +from typing_extensions import Required, TypedDict + +from .matrix_value_model import MatrixValueModel + +__all__ = ["MatrixWithAllocationConfigModel"] + + +class MatrixWithAllocationConfigModel(TypedDict, total=False): + allocation: Required[float] + """Allocation to be used to calculate the price""" + + default_unit_amount: Required[str] + """Default per unit rate for any usage not bucketed into a specified matrix_value""" + + dimensions: Required[List[Optional[str]]] + """One or two event property values to evaluate matrix groups by""" + + matrix_values: Required[Iterable[MatrixValueModel]] + """Matrix values for specified matrix grouping keys""" diff --git a/src/orb/types/shared_params/new_accounting_sync_configuration_model.py b/src/orb/types/shared_params/new_accounting_sync_configuration_model.py new file mode 100644 index 00000000..cc449918 --- /dev/null +++ b/src/orb/types/shared_params/new_accounting_sync_configuration_model.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable, Optional +from typing_extensions import Required, TypedDict + +__all__ = ["NewAccountingSyncConfigurationModel", "AccountingProvider"] + + +class AccountingProvider(TypedDict, total=False): + external_provider_id: Required[str] + + provider_type: Required[str] + + +class NewAccountingSyncConfigurationModel(TypedDict, total=False): + accounting_providers: Optional[Iterable[AccountingProvider]] + + excluded: Optional[bool] diff --git a/src/orb/types/shared_params/new_adjustment_model.py b/src/orb/types/shared_params/new_adjustment_model.py new file mode 100644 index 00000000..ae21cea8 --- /dev/null +++ b/src/orb/types/shared_params/new_adjustment_model.py @@ -0,0 +1,98 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Union +from typing_extensions import Literal, Required, TypeAlias, TypedDict + +__all__ = [ + "NewAdjustmentModel", + "NewPercentageDiscount", + "NewUsageDiscount", + "NewAmountDiscount", + "NewMinimum", + "NewMaximum", +] + + +class NewPercentageDiscount(TypedDict, total=False): + adjustment_type: Required[Literal["percentage_discount"]] + + applies_to_price_ids: Required[List[str]] + """The set of price IDs to which this adjustment applies.""" + + percentage_discount: Required[float] + + is_invoice_level: bool + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +class NewUsageDiscount(TypedDict, total=False): + adjustment_type: Required[Literal["usage_discount"]] + + applies_to_price_ids: Required[List[str]] + """The set of price IDs to which this adjustment applies.""" + + usage_discount: Required[float] + + is_invoice_level: bool + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +class NewAmountDiscount(TypedDict, total=False): + adjustment_type: Required[Literal["amount_discount"]] + + amount_discount: Required[str] + + applies_to_price_ids: Required[List[str]] + """The set of price IDs to which this adjustment applies.""" + + is_invoice_level: bool + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +class NewMinimum(TypedDict, total=False): + adjustment_type: Required[Literal["minimum"]] + + applies_to_price_ids: Required[List[str]] + """The set of price IDs to which this adjustment applies.""" + + item_id: Required[str] + """The item ID that revenue from this minimum will be attributed to.""" + + minimum_amount: Required[str] + + is_invoice_level: bool + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +class NewMaximum(TypedDict, total=False): + adjustment_type: Required[Literal["maximum"]] + + applies_to_price_ids: Required[List[str]] + """The set of price IDs to which this adjustment applies.""" + + maximum_amount: Required[str] + + is_invoice_level: bool + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +NewAdjustmentModel: TypeAlias = Union[ + NewPercentageDiscount, NewUsageDiscount, NewAmountDiscount, NewMinimum, NewMaximum +] diff --git a/src/orb/types/shared_params/new_allocation_price_model.py b/src/orb/types/shared_params/new_allocation_price_model.py new file mode 100644 index 00000000..b63d61e7 --- /dev/null +++ b/src/orb/types/shared_params/new_allocation_price_model.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["NewAllocationPriceModel"] + + +class NewAllocationPriceModel(TypedDict, total=False): + amount: Required[str] + """An amount of the currency to allocate to the customer at the specified cadence.""" + + cadence: Required[Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"]] + """The cadence at which to allocate the amount to the customer.""" + + currency: Required[str] + """ + An ISO 4217 currency string or a custom pricing unit identifier in which to bill + this price. + """ + + expires_at_end_of_cadence: Required[bool] + """ + Whether the allocated amount should expire at the end of the cadence or roll + over to the next period. + """ diff --git a/src/orb/types/shared_params/new_billing_cycle_configuration_model.py b/src/orb/types/shared_params/new_billing_cycle_configuration_model.py new file mode 100644 index 00000000..d9bb5947 --- /dev/null +++ b/src/orb/types/shared_params/new_billing_cycle_configuration_model.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["NewBillingCycleConfigurationModel"] + + +class NewBillingCycleConfigurationModel(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" diff --git a/src/orb/types/shared_params/new_floating_price_model.py b/src/orb/types/shared_params/new_floating_price_model.py new file mode 100644 index 00000000..e60593e2 --- /dev/null +++ b/src/orb/types/shared_params/new_floating_price_model.py @@ -0,0 +1,1874 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Union, Optional +from typing_extensions import Literal, Required, TypeAlias, TypedDict + +from .bps_config_model import BpsConfigModel +from .bulk_config_model import BulkConfigModel +from .unit_config_model import UnitConfigModel +from .matrix_config_model import MatrixConfigModel +from .tiered_config_model import TieredConfigModel +from .package_config_model import PackageConfigModel +from .bulk_bps_config_model import BulkBpsConfigModel +from .tiered_bps_config_model import TieredBpsConfigModel +from .custom_rating_function_config_model import CustomRatingFunctionConfigModel +from .matrix_with_allocation_config_model import MatrixWithAllocationConfigModel +from .new_billing_cycle_configuration_model import NewBillingCycleConfigurationModel + +__all__ = [ + "NewFloatingPriceModel", + "NewFloatingUnitPrice", + "NewFloatingPackagePrice", + "NewFloatingMatrixPrice", + "NewFloatingMatrixWithAllocationPrice", + "NewFloatingTieredPrice", + "NewFloatingTieredBpsPrice", + "NewFloatingBpsPrice", + "NewFloatingBulkBpsPrice", + "NewFloatingBulkPrice", + "NewFloatingThresholdTotalAmountPrice", + "NewFloatingTieredPackagePrice", + "NewFloatingGroupedTieredPrice", + "NewFloatingMaxGroupTieredPackagePrice", + "NewFloatingTieredWithMinimumPrice", + "NewFloatingPackageWithAllocationPrice", + "NewFloatingTieredPackageWithMinimumPrice", + "NewFloatingUnitWithPercentPrice", + "NewFloatingTieredWithProrationPrice", + "NewFloatingUnitWithProrationPrice", + "NewFloatingGroupedAllocationPrice", + "NewFloatingGroupedWithProratedMinimumPrice", + "NewFloatingGroupedWithMeteredMinimumPrice", + "NewFloatingMatrixWithDisplayNamePrice", + "NewFloatingBulkWithProrationPrice", + "NewFloatingGroupedTieredPackagePrice", + "NewFloatingScalableMatrixWithUnitPricingPrice", + "NewFloatingScalableMatrixWithTieredPricingPrice", + "NewFloatingCumulativeGroupedBulkPrice", +] + + +class NewFloatingUnitPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["unit"]] + + name: Required[str] + """The name of the price.""" + + unit_config: Required[UnitConfigModel] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["package"]] + + name: Required[str] + """The name of the price.""" + + package_config: Required[PackageConfigModel] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingMatrixPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + matrix_config: Required[MatrixConfigModel] + + model_type: Required[Literal["matrix"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingMatrixWithAllocationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + matrix_with_allocation_config: Required[MatrixWithAllocationConfigModel] + + model_type: Required[Literal["matrix_with_allocation"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingTieredPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["tiered"]] + + name: Required[str] + """The name of the price.""" + + tiered_config: Required[TieredConfigModel] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingTieredBpsPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["tiered_bps"]] + + name: Required[str] + """The name of the price.""" + + tiered_bps_config: Required[TieredBpsConfigModel] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingBpsPrice(TypedDict, total=False): + bps_config: Required[BpsConfigModel] + + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["bps"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingBulkBpsPrice(TypedDict, total=False): + bulk_bps_config: Required[BulkBpsConfigModel] + + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["bulk_bps"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingBulkPrice(TypedDict, total=False): + bulk_config: Required[BulkConfigModel] + + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["bulk"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingThresholdTotalAmountPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["threshold_total_amount"]] + + name: Required[str] + """The name of the price.""" + + threshold_total_amount_config: Required[CustomRatingFunctionConfigModel] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingTieredPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["tiered_package"]] + + name: Required[str] + """The name of the price.""" + + tiered_package_config: Required[CustomRatingFunctionConfigModel] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingGroupedTieredPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + grouped_tiered_config: Required[CustomRatingFunctionConfigModel] + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["grouped_tiered"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingMaxGroupTieredPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + max_group_tiered_package_config: Required[CustomRatingFunctionConfigModel] + + model_type: Required[Literal["max_group_tiered_package"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingTieredWithMinimumPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["tiered_with_minimum"]] + + name: Required[str] + """The name of the price.""" + + tiered_with_minimum_config: Required[CustomRatingFunctionConfigModel] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingPackageWithAllocationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["package_with_allocation"]] + + name: Required[str] + """The name of the price.""" + + package_with_allocation_config: Required[CustomRatingFunctionConfigModel] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingTieredPackageWithMinimumPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["tiered_package_with_minimum"]] + + name: Required[str] + """The name of the price.""" + + tiered_package_with_minimum_config: Required[CustomRatingFunctionConfigModel] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingUnitWithPercentPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["unit_with_percent"]] + + name: Required[str] + """The name of the price.""" + + unit_with_percent_config: Required[CustomRatingFunctionConfigModel] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingTieredWithProrationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["tiered_with_proration"]] + + name: Required[str] + """The name of the price.""" + + tiered_with_proration_config: Required[CustomRatingFunctionConfigModel] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingUnitWithProrationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["unit_with_proration"]] + + name: Required[str] + """The name of the price.""" + + unit_with_proration_config: Required[CustomRatingFunctionConfigModel] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingGroupedAllocationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + grouped_allocation_config: Required[CustomRatingFunctionConfigModel] + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["grouped_allocation"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingGroupedWithProratedMinimumPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + grouped_with_prorated_minimum_config: Required[CustomRatingFunctionConfigModel] + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["grouped_with_prorated_minimum"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingGroupedWithMeteredMinimumPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + grouped_with_metered_minimum_config: Required[CustomRatingFunctionConfigModel] + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["grouped_with_metered_minimum"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingMatrixWithDisplayNamePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + matrix_with_display_name_config: Required[CustomRatingFunctionConfigModel] + + model_type: Required[Literal["matrix_with_display_name"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingBulkWithProrationPrice(TypedDict, total=False): + bulk_with_proration_config: Required[CustomRatingFunctionConfigModel] + + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["bulk_with_proration"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingGroupedTieredPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + grouped_tiered_package_config: Required[CustomRatingFunctionConfigModel] + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["grouped_tiered_package"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingScalableMatrixWithUnitPricingPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["scalable_matrix_with_unit_pricing"]] + + name: Required[str] + """The name of the price.""" + + scalable_matrix_with_unit_pricing_config: Required[CustomRatingFunctionConfigModel] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingScalableMatrixWithTieredPricingPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["scalable_matrix_with_tiered_pricing"]] + + name: Required[str] + """The name of the price.""" + + scalable_matrix_with_tiered_pricing_config: Required[CustomRatingFunctionConfigModel] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingCumulativeGroupedBulkPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + cumulative_grouped_bulk_config: Required[CustomRatingFunctionConfigModel] + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["cumulative_grouped_bulk"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +NewFloatingPriceModel: TypeAlias = Union[ + NewFloatingUnitPrice, + NewFloatingPackagePrice, + NewFloatingMatrixPrice, + NewFloatingMatrixWithAllocationPrice, + NewFloatingTieredPrice, + NewFloatingTieredBpsPrice, + NewFloatingBpsPrice, + NewFloatingBulkBpsPrice, + NewFloatingBulkPrice, + NewFloatingThresholdTotalAmountPrice, + NewFloatingTieredPackagePrice, + NewFloatingGroupedTieredPrice, + NewFloatingMaxGroupTieredPackagePrice, + NewFloatingTieredWithMinimumPrice, + NewFloatingPackageWithAllocationPrice, + NewFloatingTieredPackageWithMinimumPrice, + NewFloatingUnitWithPercentPrice, + NewFloatingTieredWithProrationPrice, + NewFloatingUnitWithProrationPrice, + NewFloatingGroupedAllocationPrice, + NewFloatingGroupedWithProratedMinimumPrice, + NewFloatingGroupedWithMeteredMinimumPrice, + NewFloatingMatrixWithDisplayNamePrice, + NewFloatingBulkWithProrationPrice, + NewFloatingGroupedTieredPackagePrice, + NewFloatingScalableMatrixWithUnitPricingPrice, + NewFloatingScalableMatrixWithTieredPricingPrice, + NewFloatingCumulativeGroupedBulkPrice, +] diff --git a/src/orb/types/shared_params/new_reporting_configuration_model.py b/src/orb/types/shared_params/new_reporting_configuration_model.py new file mode 100644 index 00000000..748042d1 --- /dev/null +++ b/src/orb/types/shared_params/new_reporting_configuration_model.py @@ -0,0 +1,11 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["NewReportingConfigurationModel"] + + +class NewReportingConfigurationModel(TypedDict, total=False): + exempt: Required[bool] diff --git a/src/orb/types/shared_params/new_subscription_price_model.py b/src/orb/types/shared_params/new_subscription_price_model.py new file mode 100644 index 00000000..eb39147a --- /dev/null +++ b/src/orb/types/shared_params/new_subscription_price_model.py @@ -0,0 +1,1900 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Union, Optional +from typing_extensions import Literal, Required, TypeAlias, TypedDict + +from .bps_config_model import BpsConfigModel +from .bulk_config_model import BulkConfigModel +from .unit_config_model import UnitConfigModel +from .matrix_config_model import MatrixConfigModel +from .tiered_config_model import TieredConfigModel +from .package_config_model import PackageConfigModel +from .bulk_bps_config_model import BulkBpsConfigModel +from .tiered_bps_config_model import TieredBpsConfigModel +from .custom_rating_function_config_model import CustomRatingFunctionConfigModel +from .new_billing_cycle_configuration_model import NewBillingCycleConfigurationModel + +__all__ = [ + "NewSubscriptionPriceModel", + "NewSubscriptionUnitPrice", + "NewSubscriptionPackagePrice", + "NewSubscriptionMatrixPrice", + "NewSubscriptionTieredPrice", + "NewSubscriptionTieredBpsPrice", + "NewSubscriptionBpsPrice", + "NewSubscriptionBulkBpsPrice", + "NewSubscriptionBulkPrice", + "NewSubscriptionThresholdTotalAmountPrice", + "NewSubscriptionTieredPackagePrice", + "NewSubscriptionTieredWithMinimumPrice", + "NewSubscriptionUnitWithPercentPrice", + "NewSubscriptionPackageWithAllocationPrice", + "NewSubscriptionTierWithProrationPrice", + "NewSubscriptionUnitWithProrationPrice", + "NewSubscriptionGroupedAllocationPrice", + "NewSubscriptionGroupedWithProratedMinimumPrice", + "NewSubscriptionBulkWithProrationPrice", + "NewSubscriptionScalableMatrixWithUnitPricingPrice", + "NewSubscriptionScalableMatrixWithTieredPricingPrice", + "NewSubscriptionCumulativeGroupedBulkPrice", + "NewSubscriptionMaxGroupTieredPackagePrice", + "NewSubscriptionGroupedWithMeteredMinimumPrice", + "NewSubscriptionMatrixWithDisplayNamePrice", + "NewSubscriptionGroupedTieredPackagePrice", +] + + +class NewSubscriptionUnitPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["unit"]] + + name: Required[str] + """The name of the price.""" + + unit_config: Required[UnitConfigModel] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class NewSubscriptionPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["package"]] + + name: Required[str] + """The name of the price.""" + + package_config: Required[PackageConfigModel] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class NewSubscriptionMatrixPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + matrix_config: Required[MatrixConfigModel] + + model_type: Required[Literal["matrix"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class NewSubscriptionTieredPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["tiered"]] + + name: Required[str] + """The name of the price.""" + + tiered_config: Required[TieredConfigModel] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class NewSubscriptionTieredBpsPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["tiered_bps"]] + + name: Required[str] + """The name of the price.""" + + tiered_bps_config: Required[TieredBpsConfigModel] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class NewSubscriptionBpsPrice(TypedDict, total=False): + bps_config: Required[BpsConfigModel] + + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["bps"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class NewSubscriptionBulkBpsPrice(TypedDict, total=False): + bulk_bps_config: Required[BulkBpsConfigModel] + + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["bulk_bps"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class NewSubscriptionBulkPrice(TypedDict, total=False): + bulk_config: Required[BulkConfigModel] + + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["bulk"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class NewSubscriptionThresholdTotalAmountPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["threshold_total_amount"]] + + name: Required[str] + """The name of the price.""" + + threshold_total_amount_config: Required[CustomRatingFunctionConfigModel] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class NewSubscriptionTieredPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["tiered_package"]] + + name: Required[str] + """The name of the price.""" + + tiered_package_config: Required[CustomRatingFunctionConfigModel] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class NewSubscriptionTieredWithMinimumPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["tiered_with_minimum"]] + + name: Required[str] + """The name of the price.""" + + tiered_with_minimum_config: Required[CustomRatingFunctionConfigModel] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class NewSubscriptionUnitWithPercentPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["unit_with_percent"]] + + name: Required[str] + """The name of the price.""" + + unit_with_percent_config: Required[CustomRatingFunctionConfigModel] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class NewSubscriptionPackageWithAllocationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["package_with_allocation"]] + + name: Required[str] + """The name of the price.""" + + package_with_allocation_config: Required[CustomRatingFunctionConfigModel] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class NewSubscriptionTierWithProrationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["tiered_with_proration"]] + + name: Required[str] + """The name of the price.""" + + tiered_with_proration_config: Required[CustomRatingFunctionConfigModel] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class NewSubscriptionUnitWithProrationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["unit_with_proration"]] + + name: Required[str] + """The name of the price.""" + + unit_with_proration_config: Required[CustomRatingFunctionConfigModel] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class NewSubscriptionGroupedAllocationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_allocation_config: Required[CustomRatingFunctionConfigModel] + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["grouped_allocation"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class NewSubscriptionGroupedWithProratedMinimumPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_with_prorated_minimum_config: Required[CustomRatingFunctionConfigModel] + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["grouped_with_prorated_minimum"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class NewSubscriptionBulkWithProrationPrice(TypedDict, total=False): + bulk_with_proration_config: Required[CustomRatingFunctionConfigModel] + + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["bulk_with_proration"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class NewSubscriptionScalableMatrixWithUnitPricingPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["scalable_matrix_with_unit_pricing"]] + + name: Required[str] + """The name of the price.""" + + scalable_matrix_with_unit_pricing_config: Required[CustomRatingFunctionConfigModel] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class NewSubscriptionScalableMatrixWithTieredPricingPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["scalable_matrix_with_tiered_pricing"]] + + name: Required[str] + """The name of the price.""" + + scalable_matrix_with_tiered_pricing_config: Required[CustomRatingFunctionConfigModel] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class NewSubscriptionCumulativeGroupedBulkPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + cumulative_grouped_bulk_config: Required[CustomRatingFunctionConfigModel] + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["cumulative_grouped_bulk"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class NewSubscriptionMaxGroupTieredPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + max_group_tiered_package_config: Required[CustomRatingFunctionConfigModel] + + model_type: Required[Literal["max_group_tiered_package"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class NewSubscriptionGroupedWithMeteredMinimumPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_with_metered_minimum_config: Required[CustomRatingFunctionConfigModel] + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["grouped_with_metered_minimum"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class NewSubscriptionMatrixWithDisplayNamePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + matrix_with_display_name_config: Required[CustomRatingFunctionConfigModel] + + model_type: Required[Literal["matrix_with_display_name"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class NewSubscriptionGroupedTieredPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_tiered_package_config: Required[CustomRatingFunctionConfigModel] + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["grouped_tiered_package"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfigurationModel] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +NewSubscriptionPriceModel: TypeAlias = Union[ + NewSubscriptionUnitPrice, + NewSubscriptionPackagePrice, + NewSubscriptionMatrixPrice, + NewSubscriptionTieredPrice, + NewSubscriptionTieredBpsPrice, + NewSubscriptionBpsPrice, + NewSubscriptionBulkBpsPrice, + NewSubscriptionBulkPrice, + NewSubscriptionThresholdTotalAmountPrice, + NewSubscriptionTieredPackagePrice, + NewSubscriptionTieredWithMinimumPrice, + NewSubscriptionUnitWithPercentPrice, + NewSubscriptionPackageWithAllocationPrice, + NewSubscriptionTierWithProrationPrice, + NewSubscriptionUnitWithProrationPrice, + NewSubscriptionGroupedAllocationPrice, + NewSubscriptionGroupedWithProratedMinimumPrice, + NewSubscriptionBulkWithProrationPrice, + NewSubscriptionScalableMatrixWithUnitPricingPrice, + NewSubscriptionScalableMatrixWithTieredPricingPrice, + NewSubscriptionCumulativeGroupedBulkPrice, + NewSubscriptionMaxGroupTieredPackagePrice, + NewSubscriptionGroupedWithMeteredMinimumPrice, + NewSubscriptionMatrixWithDisplayNamePrice, + NewSubscriptionGroupedTieredPackagePrice, +] diff --git a/src/orb/types/shared_params/new_tax_configuration_model.py b/src/orb/types/shared_params/new_tax_configuration_model.py new file mode 100644 index 00000000..c0d0f650 --- /dev/null +++ b/src/orb/types/shared_params/new_tax_configuration_model.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Optional +from typing_extensions import Literal, Required, TypeAlias, TypedDict + +__all__ = ["NewTaxConfigurationModel", "NewAvalaraTaxConfiguration", "NewTaxJarConfiguration"] + + +class NewAvalaraTaxConfiguration(TypedDict, total=False): + tax_exempt: Required[bool] + + tax_provider: Required[Literal["avalara"]] + + tax_exemption_code: Optional[str] + + +class NewTaxJarConfiguration(TypedDict, total=False): + tax_exempt: Required[bool] + + tax_provider: Required[Literal["taxjar"]] + + +NewTaxConfigurationModel: TypeAlias = Union[NewAvalaraTaxConfiguration, NewTaxJarConfiguration] diff --git a/src/orb/types/shared_params/package_config_model.py b/src/orb/types/shared_params/package_config_model.py new file mode 100644 index 00000000..5cc856ae --- /dev/null +++ b/src/orb/types/shared_params/package_config_model.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["PackageConfigModel"] + + +class PackageConfigModel(TypedDict, total=False): + package_amount: Required[str] + """A currency amount to rate usage by""" + + package_size: Required[int] + """An integer amount to represent package size. + + For example, 1000 here would divide usage by 1000 before multiplying by + package_amount in rating + """ diff --git a/src/orb/types/shared_params/price_interval_fixed_fee_quantity_transition_model.py b/src/orb/types/shared_params/price_interval_fixed_fee_quantity_transition_model.py new file mode 100644 index 00000000..e6b4ac63 --- /dev/null +++ b/src/orb/types/shared_params/price_interval_fixed_fee_quantity_transition_model.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from datetime import datetime +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["PriceIntervalFixedFeeQuantityTransitionModel"] + + +class PriceIntervalFixedFeeQuantityTransitionModel(TypedDict, total=False): + effective_date: Required[Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]] + """The date that the fixed fee quantity transition should take effect.""" + + quantity: Required[int] + """The quantity of the fixed fee quantity transition.""" diff --git a/src/orb/types/shared_params/remove_subscription_adjustment_params.py b/src/orb/types/shared_params/remove_subscription_adjustment_params.py new file mode 100644 index 00000000..bb9a5d02 --- /dev/null +++ b/src/orb/types/shared_params/remove_subscription_adjustment_params.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["RemoveSubscriptionAdjustmentParams"] + + +class RemoveSubscriptionAdjustmentParams(TypedDict, total=False): + adjustment_id: Required[str] + """The id of the adjustment to remove on the subscription.""" diff --git a/src/orb/types/shared_params/remove_subscription_price_params.py b/src/orb/types/shared_params/remove_subscription_price_params.py new file mode 100644 index 00000000..e040a30b --- /dev/null +++ b/src/orb/types/shared_params/remove_subscription_price_params.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import TypedDict + +__all__ = ["RemoveSubscriptionPriceParams"] + + +class RemoveSubscriptionPriceParams(TypedDict, total=False): + external_price_id: Optional[str] + """The external price id of the price to remove on the subscription.""" + + price_id: Optional[str] + """The id of the price to remove on the subscription.""" diff --git a/src/orb/types/shared_params/replace_subscription_adjustment_params.py b/src/orb/types/shared_params/replace_subscription_adjustment_params.py new file mode 100644 index 00000000..01442cc5 --- /dev/null +++ b/src/orb/types/shared_params/replace_subscription_adjustment_params.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .new_adjustment_model import NewAdjustmentModel + +__all__ = ["ReplaceSubscriptionAdjustmentParams"] + + +class ReplaceSubscriptionAdjustmentParams(TypedDict, total=False): + adjustment: Required[NewAdjustmentModel] + """The definition of a new adjustment to create and add to the subscription.""" + + replaces_adjustment_id: Required[str] + """The id of the adjustment on the plan to replace in the subscription.""" diff --git a/src/orb/types/shared_params/replace_subscription_price_params.py b/src/orb/types/shared_params/replace_subscription_price_params.py new file mode 100644 index 00000000..5b426259 --- /dev/null +++ b/src/orb/types/shared_params/replace_subscription_price_params.py @@ -0,0 +1,50 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable, Optional +from typing_extensions import Required, TypedDict + +from .discount_override_model import DiscountOverrideModel +from .new_allocation_price_model import NewAllocationPriceModel +from .new_subscription_price_model import NewSubscriptionPriceModel + +__all__ = ["ReplaceSubscriptionPriceParams"] + + +class ReplaceSubscriptionPriceParams(TypedDict, total=False): + replaces_price_id: Required[str] + """The id of the price on the plan to replace in the subscription.""" + + allocation_price: Optional[NewAllocationPriceModel] + """The definition of a new allocation price to create and add to the subscription.""" + + discounts: Optional[Iterable[DiscountOverrideModel]] + """[DEPRECATED] Use add_adjustments instead. + + The subscription's discounts for the replacement price. + """ + + external_price_id: Optional[str] + """The external price id of the price to add to the subscription.""" + + fixed_price_quantity: Optional[float] + """The new quantity of the price, if the price is a fixed price.""" + + maximum_amount: Optional[str] + """[DEPRECATED] Use add_adjustments instead. + + The subscription's maximum amount for the replacement price. + """ + + minimum_amount: Optional[str] + """[DEPRECATED] Use add_adjustments instead. + + The subscription's minimum amount for the replacement price. + """ + + price: Optional[NewSubscriptionPriceModel] + """The definition of a new price to create and add to the subscription.""" + + price_id: Optional[str] + """The id of the price to add to the subscription.""" diff --git a/src/orb/types/shared_params/threshold_model.py b/src/orb/types/shared_params/threshold_model.py new file mode 100644 index 00000000..85667b79 --- /dev/null +++ b/src/orb/types/shared_params/threshold_model.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["ThresholdModel"] + + +class ThresholdModel(TypedDict, total=False): + value: Required[float] + """The value at which an alert will fire. + + For credit balance alerts, the alert will fire at or below this value. For usage + and cost alerts, the alert will fire at or above this value. + """ diff --git a/src/orb/types/shared_params/tiered_bps_config_model.py b/src/orb/types/shared_params/tiered_bps_config_model.py new file mode 100644 index 00000000..992429d8 --- /dev/null +++ b/src/orb/types/shared_params/tiered_bps_config_model.py @@ -0,0 +1,30 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable, Optional +from typing_extensions import Required, TypedDict + +__all__ = ["TieredBpsConfigModel", "Tier"] + + +class Tier(TypedDict, total=False): + bps: Required[float] + """Per-event basis point rate""" + + minimum_amount: Required[str] + """Inclusive tier starting value""" + + maximum_amount: Optional[str] + """Exclusive tier ending value""" + + per_unit_maximum: Optional[str] + """Per unit maximum to charge""" + + +class TieredBpsConfigModel(TypedDict, total=False): + tiers: Required[Iterable[Tier]] + """ + Tiers for a Graduated BPS pricing model, where usage is bucketed into specified + tiers + """ diff --git a/src/orb/types/shared_params/tiered_config_model.py b/src/orb/types/shared_params/tiered_config_model.py new file mode 100644 index 00000000..a3b888c0 --- /dev/null +++ b/src/orb/types/shared_params/tiered_config_model.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable, Optional +from typing_extensions import Required, TypedDict + +__all__ = ["TieredConfigModel", "Tier"] + + +class Tier(TypedDict, total=False): + first_unit: Required[float] + """Inclusive tier starting value""" + + unit_amount: Required[str] + """Amount per unit""" + + last_unit: Optional[float] + """Exclusive tier ending value. If null, this is treated as the last tier""" + + +class TieredConfigModel(TypedDict, total=False): + tiers: Required[Iterable[Tier]] + """Tiers for rating based on total usage quantities into the specified tier""" diff --git a/src/orb/types/shared_params/unit_config_model.py b/src/orb/types/shared_params/unit_config_model.py new file mode 100644 index 00000000..593a5b3f --- /dev/null +++ b/src/orb/types/shared_params/unit_config_model.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["UnitConfigModel"] + + +class UnitConfigModel(TypedDict, total=False): + unit_amount: Required[str] + """Rate per unit of usage""" diff --git a/src/orb/types/subscription.py b/src/orb/types/subscription.py deleted file mode 100644 index f6118f04..00000000 --- a/src/orb/types/subscription.py +++ /dev/null @@ -1,555 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List, Union, Optional -from datetime import datetime -from typing_extensions import Literal, Annotated, TypeAlias - -from .plan import Plan -from .price import Price -from .._utils import PropertyInfo -from .._models import BaseModel -from .customer import Customer - -__all__ = [ - "Subscription", - "AdjustmentInterval", - "AdjustmentIntervalAdjustment", - "AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment", - "AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment", - "AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment", - "AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment", - "AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment", - "BillingCycleAnchorConfiguration", - "DiscountInterval", - "DiscountIntervalAmountDiscountInterval", - "DiscountIntervalPercentageDiscountInterval", - "DiscountIntervalUsageDiscountInterval", - "FixedFeeQuantitySchedule", - "MaximumInterval", - "MinimumInterval", - "PriceInterval", - "PriceIntervalFixedFeeQuantityTransition", - "RedeemedCoupon", - "TrialInfo", -] - - -class AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment(BaseModel): - id: str - - adjustment_type: Literal["usage_discount"] - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - usage_discount: float - """ - The number of usage units by which to discount the price this adjustment applies - to in a given billing period. - """ - - -class AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment(BaseModel): - id: str - - adjustment_type: Literal["amount_discount"] - - amount_discount: str - """ - The amount by which to discount the prices this adjustment applies to in a given - billing period. - """ - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -class AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment(BaseModel): - id: str - - adjustment_type: Literal["percentage_discount"] - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - percentage_discount: float - """ - The percentage (as a value between 0 and 1) by which to discount the price - intervals this adjustment applies to in a given billing period. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -class AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment(BaseModel): - id: str - - adjustment_type: Literal["minimum"] - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - item_id: str - """The item ID that revenue from this minimum will be attributed to.""" - - minimum_amount: str - """ - The minimum amount to charge in a given billing period for the prices this - adjustment applies to. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -class AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment(BaseModel): - id: str - - adjustment_type: Literal["maximum"] - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - maximum_amount: str - """ - The maximum amount to charge in a given billing period for the prices this - adjustment applies to. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -AdjustmentIntervalAdjustment: TypeAlias = Annotated[ - Union[ - AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment, - AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment, - AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment, - AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment, - AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment, - ], - PropertyInfo(discriminator="adjustment_type"), -] - - -class AdjustmentInterval(BaseModel): - id: str - - adjustment: AdjustmentIntervalAdjustment - - applies_to_price_interval_ids: List[str] - """The price interval IDs that this adjustment applies to.""" - - end_date: Optional[datetime] = None - """The end date of the adjustment interval.""" - - start_date: datetime - """The start date of the adjustment interval.""" - - -class BillingCycleAnchorConfiguration(BaseModel): - day: int - """The day of the month on which the billing cycle is anchored. - - If the maximum number of days in a month is greater than this value, the last - day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April - means the billing period begins on the 30th. - """ - - month: Optional[int] = None - """The month on which the billing cycle is anchored (e.g. - - a quarterly price anchored in February would have cycles starting February, May, - August, and November). - """ - - year: Optional[int] = None - """The year on which the billing cycle is anchored (e.g. - - a 2 year billing cycle anchored on 2021 would have cycles starting on 2021, - 2023, 2025, etc.). - """ - - -class DiscountIntervalAmountDiscountInterval(BaseModel): - amount_discount: str - """Only available if discount_type is `amount`.""" - - applies_to_price_ids: List[str] - """The price ids that this discount interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this discount interval applies to.""" - - discount_type: Literal["amount"] - - end_date: Optional[datetime] = None - """The end date of the discount interval.""" - - start_date: datetime - """The start date of the discount interval.""" - - -class DiscountIntervalPercentageDiscountInterval(BaseModel): - applies_to_price_ids: List[str] - """The price ids that this discount interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this discount interval applies to.""" - - discount_type: Literal["percentage"] - - end_date: Optional[datetime] = None - """The end date of the discount interval.""" - - percentage_discount: float - """ - Only available if discount_type is `percentage`.This is a number between 0 - and 1. - """ - - start_date: datetime - """The start date of the discount interval.""" - - -class DiscountIntervalUsageDiscountInterval(BaseModel): - applies_to_price_ids: List[str] - """The price ids that this discount interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this discount interval applies to.""" - - discount_type: Literal["usage"] - - end_date: Optional[datetime] = None - """The end date of the discount interval.""" - - start_date: datetime - """The start date of the discount interval.""" - - usage_discount: float - """Only available if discount_type is `usage`. - - Number of usage units that this discount is for - """ - - -DiscountInterval: TypeAlias = Annotated[ - Union[ - DiscountIntervalAmountDiscountInterval, - DiscountIntervalPercentageDiscountInterval, - DiscountIntervalUsageDiscountInterval, - ], - PropertyInfo(discriminator="discount_type"), -] - - -class FixedFeeQuantitySchedule(BaseModel): - end_date: Optional[datetime] = None - - price_id: str - - quantity: float - - start_date: datetime - - -class MaximumInterval(BaseModel): - applies_to_price_ids: List[str] - """The price ids that this maximum interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this maximum interval applies to.""" - - end_date: Optional[datetime] = None - """The end date of the maximum interval.""" - - maximum_amount: str - """ - The maximum amount to charge in a given billing period for the price intervals - this transform applies to. - """ - - start_date: datetime - """The start date of the maximum interval.""" - - -class MinimumInterval(BaseModel): - applies_to_price_ids: List[str] - """The price ids that this minimum interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this minimum interval applies to.""" - - end_date: Optional[datetime] = None - """The end date of the minimum interval.""" - - minimum_amount: str - """ - The minimum amount to charge in a given billing period for the price intervals - this minimum applies to. - """ - - start_date: datetime - """The start date of the minimum interval.""" - - -class PriceIntervalFixedFeeQuantityTransition(BaseModel): - effective_date: datetime - - price_id: str - - quantity: int - - -class PriceInterval(BaseModel): - id: str - - billing_cycle_day: int - """The day of the month that Orb bills for this price""" - - current_billing_period_end_date: Optional[datetime] = None - """The end of the current billing period. - - This is an exclusive timestamp, such that the instant returned is exactly the - end of the billing period. Set to null if this price interval is not currently - active. - """ - - current_billing_period_start_date: Optional[datetime] = None - """The start date of the current billing period. - - This is an inclusive timestamp; the instant returned is exactly the beginning of - the billing period. Set to null if this price interval is not currently active. - """ - - end_date: Optional[datetime] = None - """The end date of the price interval. - - This is the date that Orb stops billing for this price. - """ - - filter: Optional[str] = None - """An additional filter to apply to usage queries.""" - - fixed_fee_quantity_transitions: Optional[List[PriceIntervalFixedFeeQuantityTransition]] = None - """The fixed fee quantity transitions for this price interval. - - This is only relevant for fixed fees. - """ - - price: Price - """ - The Price resource represents a price that can be billed on a subscription, - resulting in a charge on an invoice in the form of an invoice line item. Prices - take a quantity and determine an amount to bill. - - Orb supports a few different pricing models out of the box. Each of these models - is serialized differently in a given Price object. The model_type field - determines the key for the configuration object that is present. - - For more on the types of prices, see - [the core concepts documentation](/core-concepts#plan-and-price) - """ - - start_date: datetime - """The start date of the price interval. - - This is the date that Orb starts billing for this price. - """ - - usage_customer_ids: Optional[List[str]] = None - """ - A list of customer IDs whose usage events will be aggregated and billed under - this price interval. - """ - - -class RedeemedCoupon(BaseModel): - coupon_id: str - - end_date: Optional[datetime] = None - - start_date: datetime - - -class TrialInfo(BaseModel): - end_date: Optional[datetime] = None - - -class Subscription(BaseModel): - id: str - - active_plan_phase_order: Optional[int] = None - """ - The current plan phase that is active, only if the subscription's plan has - phases. - """ - - adjustment_intervals: List[AdjustmentInterval] - """The adjustment intervals for this subscription.""" - - auto_collection: Optional[bool] = None - """ - Determines whether issued invoices for this subscription will automatically be - charged with the saved payment method on the due date. This property defaults to - the plan's behavior. If null, defaults to the customer's setting. - """ - - billing_cycle_anchor_configuration: BillingCycleAnchorConfiguration - - billing_cycle_day: int - """The day of the month on which the billing cycle is anchored. - - If the maximum number of days in a month is greater than this value, the last - day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April - means the billing period begins on the 30th. - """ - - created_at: datetime - - current_billing_period_end_date: Optional[datetime] = None - """The end of the current billing period. - - This is an exclusive timestamp, such that the instant returned is not part of - the billing period. Set to null for subscriptions that are not currently active. - """ - - current_billing_period_start_date: Optional[datetime] = None - """The start date of the current billing period. - - This is an inclusive timestamp; the instant returned is exactly the beginning of - the billing period. Set to null if the subscription is not currently active. - """ - - customer: Customer - """ - A customer is a buyer of your products, and the other party to the billing - relationship. - - In Orb, customers are assigned system generated identifiers automatically, but - it's often desirable to have these match existing identifiers in your system. To - avoid having to denormalize Orb ID information, you can pass in an - `external_customer_id` with your own identifier. See - [Customer ID Aliases](/events-and-metrics/customer-aliases) for further - information about how these aliases work in Orb. - - In addition to having an identifier in your system, a customer may exist in a - payment provider solution like Stripe. Use the `payment_provider_id` and the - `payment_provider` enum field to express this mapping. - - A customer also has a timezone (from the standard - [IANA timezone database](https://www.iana.org/time-zones)), which defaults to - your account's timezone. See [Timezone localization](/essentials/timezones) for - information on what this timezone parameter influences within Orb. - """ - - default_invoice_memo: Optional[str] = None - """Determines the default memo on this subscriptions' invoices. - - Note that if this is not provided, it is determined by the plan configuration. - """ - - discount_intervals: List[DiscountInterval] - """The discount intervals for this subscription.""" - - end_date: Optional[datetime] = None - """The date Orb stops billing for this subscription.""" - - fixed_fee_quantity_schedule: List[FixedFeeQuantitySchedule] - - invoicing_threshold: Optional[str] = None - - maximum_intervals: List[MaximumInterval] - """The maximum intervals for this subscription.""" - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum_intervals: List[MinimumInterval] - """The minimum intervals for this subscription.""" - - net_terms: int - """ - Determines the difference between the invoice issue date for subscription - invoices as the date that they are due. A value of `0` here represents that the - invoice is due on issue, whereas a value of `30` represents that the customer - has a month to pay the invoice. - """ - - plan: Plan - """ - The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be - subscribed to by a customer. Plans define the billing behavior of the - subscription. You can see more about how to configure prices in the - [Price resource](/reference/price). - """ - - price_intervals: List[PriceInterval] - """The price intervals for this subscription.""" - - redeemed_coupon: Optional[RedeemedCoupon] = None - - start_date: datetime - """The date Orb starts billing for this subscription.""" - - status: Literal["active", "ended", "upcoming"] - - trial_info: TrialInfo diff --git a/src/orb/types/subscription_cancel_response.py b/src/orb/types/subscription_cancel_response.py deleted file mode 100644 index 797ecfe3..00000000 --- a/src/orb/types/subscription_cancel_response.py +++ /dev/null @@ -1,555 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List, Union, Optional -from datetime import datetime -from typing_extensions import Literal, Annotated, TypeAlias - -from .plan import Plan -from .price import Price -from .._utils import PropertyInfo -from .._models import BaseModel -from .customer import Customer - -__all__ = [ - "SubscriptionCancelResponse", - "AdjustmentInterval", - "AdjustmentIntervalAdjustment", - "AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment", - "AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment", - "AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment", - "AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment", - "AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment", - "BillingCycleAnchorConfiguration", - "DiscountInterval", - "DiscountIntervalAmountDiscountInterval", - "DiscountIntervalPercentageDiscountInterval", - "DiscountIntervalUsageDiscountInterval", - "FixedFeeQuantitySchedule", - "MaximumInterval", - "MinimumInterval", - "PriceInterval", - "PriceIntervalFixedFeeQuantityTransition", - "RedeemedCoupon", - "TrialInfo", -] - - -class AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment(BaseModel): - id: str - - adjustment_type: Literal["usage_discount"] - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - usage_discount: float - """ - The number of usage units by which to discount the price this adjustment applies - to in a given billing period. - """ - - -class AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment(BaseModel): - id: str - - adjustment_type: Literal["amount_discount"] - - amount_discount: str - """ - The amount by which to discount the prices this adjustment applies to in a given - billing period. - """ - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -class AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment(BaseModel): - id: str - - adjustment_type: Literal["percentage_discount"] - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - percentage_discount: float - """ - The percentage (as a value between 0 and 1) by which to discount the price - intervals this adjustment applies to in a given billing period. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -class AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment(BaseModel): - id: str - - adjustment_type: Literal["minimum"] - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - item_id: str - """The item ID that revenue from this minimum will be attributed to.""" - - minimum_amount: str - """ - The minimum amount to charge in a given billing period for the prices this - adjustment applies to. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -class AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment(BaseModel): - id: str - - adjustment_type: Literal["maximum"] - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - maximum_amount: str - """ - The maximum amount to charge in a given billing period for the prices this - adjustment applies to. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -AdjustmentIntervalAdjustment: TypeAlias = Annotated[ - Union[ - AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment, - AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment, - AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment, - AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment, - AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment, - ], - PropertyInfo(discriminator="adjustment_type"), -] - - -class AdjustmentInterval(BaseModel): - id: str - - adjustment: AdjustmentIntervalAdjustment - - applies_to_price_interval_ids: List[str] - """The price interval IDs that this adjustment applies to.""" - - end_date: Optional[datetime] = None - """The end date of the adjustment interval.""" - - start_date: datetime - """The start date of the adjustment interval.""" - - -class BillingCycleAnchorConfiguration(BaseModel): - day: int - """The day of the month on which the billing cycle is anchored. - - If the maximum number of days in a month is greater than this value, the last - day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April - means the billing period begins on the 30th. - """ - - month: Optional[int] = None - """The month on which the billing cycle is anchored (e.g. - - a quarterly price anchored in February would have cycles starting February, May, - August, and November). - """ - - year: Optional[int] = None - """The year on which the billing cycle is anchored (e.g. - - a 2 year billing cycle anchored on 2021 would have cycles starting on 2021, - 2023, 2025, etc.). - """ - - -class DiscountIntervalAmountDiscountInterval(BaseModel): - amount_discount: str - """Only available if discount_type is `amount`.""" - - applies_to_price_ids: List[str] - """The price ids that this discount interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this discount interval applies to.""" - - discount_type: Literal["amount"] - - end_date: Optional[datetime] = None - """The end date of the discount interval.""" - - start_date: datetime - """The start date of the discount interval.""" - - -class DiscountIntervalPercentageDiscountInterval(BaseModel): - applies_to_price_ids: List[str] - """The price ids that this discount interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this discount interval applies to.""" - - discount_type: Literal["percentage"] - - end_date: Optional[datetime] = None - """The end date of the discount interval.""" - - percentage_discount: float - """ - Only available if discount_type is `percentage`.This is a number between 0 - and 1. - """ - - start_date: datetime - """The start date of the discount interval.""" - - -class DiscountIntervalUsageDiscountInterval(BaseModel): - applies_to_price_ids: List[str] - """The price ids that this discount interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this discount interval applies to.""" - - discount_type: Literal["usage"] - - end_date: Optional[datetime] = None - """The end date of the discount interval.""" - - start_date: datetime - """The start date of the discount interval.""" - - usage_discount: float - """Only available if discount_type is `usage`. - - Number of usage units that this discount is for - """ - - -DiscountInterval: TypeAlias = Annotated[ - Union[ - DiscountIntervalAmountDiscountInterval, - DiscountIntervalPercentageDiscountInterval, - DiscountIntervalUsageDiscountInterval, - ], - PropertyInfo(discriminator="discount_type"), -] - - -class FixedFeeQuantitySchedule(BaseModel): - end_date: Optional[datetime] = None - - price_id: str - - quantity: float - - start_date: datetime - - -class MaximumInterval(BaseModel): - applies_to_price_ids: List[str] - """The price ids that this maximum interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this maximum interval applies to.""" - - end_date: Optional[datetime] = None - """The end date of the maximum interval.""" - - maximum_amount: str - """ - The maximum amount to charge in a given billing period for the price intervals - this transform applies to. - """ - - start_date: datetime - """The start date of the maximum interval.""" - - -class MinimumInterval(BaseModel): - applies_to_price_ids: List[str] - """The price ids that this minimum interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this minimum interval applies to.""" - - end_date: Optional[datetime] = None - """The end date of the minimum interval.""" - - minimum_amount: str - """ - The minimum amount to charge in a given billing period for the price intervals - this minimum applies to. - """ - - start_date: datetime - """The start date of the minimum interval.""" - - -class PriceIntervalFixedFeeQuantityTransition(BaseModel): - effective_date: datetime - - price_id: str - - quantity: int - - -class PriceInterval(BaseModel): - id: str - - billing_cycle_day: int - """The day of the month that Orb bills for this price""" - - current_billing_period_end_date: Optional[datetime] = None - """The end of the current billing period. - - This is an exclusive timestamp, such that the instant returned is exactly the - end of the billing period. Set to null if this price interval is not currently - active. - """ - - current_billing_period_start_date: Optional[datetime] = None - """The start date of the current billing period. - - This is an inclusive timestamp; the instant returned is exactly the beginning of - the billing period. Set to null if this price interval is not currently active. - """ - - end_date: Optional[datetime] = None - """The end date of the price interval. - - This is the date that Orb stops billing for this price. - """ - - filter: Optional[str] = None - """An additional filter to apply to usage queries.""" - - fixed_fee_quantity_transitions: Optional[List[PriceIntervalFixedFeeQuantityTransition]] = None - """The fixed fee quantity transitions for this price interval. - - This is only relevant for fixed fees. - """ - - price: Price - """ - The Price resource represents a price that can be billed on a subscription, - resulting in a charge on an invoice in the form of an invoice line item. Prices - take a quantity and determine an amount to bill. - - Orb supports a few different pricing models out of the box. Each of these models - is serialized differently in a given Price object. The model_type field - determines the key for the configuration object that is present. - - For more on the types of prices, see - [the core concepts documentation](/core-concepts#plan-and-price) - """ - - start_date: datetime - """The start date of the price interval. - - This is the date that Orb starts billing for this price. - """ - - usage_customer_ids: Optional[List[str]] = None - """ - A list of customer IDs whose usage events will be aggregated and billed under - this price interval. - """ - - -class RedeemedCoupon(BaseModel): - coupon_id: str - - end_date: Optional[datetime] = None - - start_date: datetime - - -class TrialInfo(BaseModel): - end_date: Optional[datetime] = None - - -class SubscriptionCancelResponse(BaseModel): - id: str - - active_plan_phase_order: Optional[int] = None - """ - The current plan phase that is active, only if the subscription's plan has - phases. - """ - - adjustment_intervals: List[AdjustmentInterval] - """The adjustment intervals for this subscription.""" - - auto_collection: Optional[bool] = None - """ - Determines whether issued invoices for this subscription will automatically be - charged with the saved payment method on the due date. This property defaults to - the plan's behavior. If null, defaults to the customer's setting. - """ - - billing_cycle_anchor_configuration: BillingCycleAnchorConfiguration - - billing_cycle_day: int - """The day of the month on which the billing cycle is anchored. - - If the maximum number of days in a month is greater than this value, the last - day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April - means the billing period begins on the 30th. - """ - - created_at: datetime - - current_billing_period_end_date: Optional[datetime] = None - """The end of the current billing period. - - This is an exclusive timestamp, such that the instant returned is not part of - the billing period. Set to null for subscriptions that are not currently active. - """ - - current_billing_period_start_date: Optional[datetime] = None - """The start date of the current billing period. - - This is an inclusive timestamp; the instant returned is exactly the beginning of - the billing period. Set to null if the subscription is not currently active. - """ - - customer: Customer - """ - A customer is a buyer of your products, and the other party to the billing - relationship. - - In Orb, customers are assigned system generated identifiers automatically, but - it's often desirable to have these match existing identifiers in your system. To - avoid having to denormalize Orb ID information, you can pass in an - `external_customer_id` with your own identifier. See - [Customer ID Aliases](/events-and-metrics/customer-aliases) for further - information about how these aliases work in Orb. - - In addition to having an identifier in your system, a customer may exist in a - payment provider solution like Stripe. Use the `payment_provider_id` and the - `payment_provider` enum field to express this mapping. - - A customer also has a timezone (from the standard - [IANA timezone database](https://www.iana.org/time-zones)), which defaults to - your account's timezone. See [Timezone localization](/essentials/timezones) for - information on what this timezone parameter influences within Orb. - """ - - default_invoice_memo: Optional[str] = None - """Determines the default memo on this subscriptions' invoices. - - Note that if this is not provided, it is determined by the plan configuration. - """ - - discount_intervals: List[DiscountInterval] - """The discount intervals for this subscription.""" - - end_date: Optional[datetime] = None - """The date Orb stops billing for this subscription.""" - - fixed_fee_quantity_schedule: List[FixedFeeQuantitySchedule] - - invoicing_threshold: Optional[str] = None - - maximum_intervals: List[MaximumInterval] - """The maximum intervals for this subscription.""" - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum_intervals: List[MinimumInterval] - """The minimum intervals for this subscription.""" - - net_terms: int - """ - Determines the difference between the invoice issue date for subscription - invoices as the date that they are due. A value of `0` here represents that the - invoice is due on issue, whereas a value of `30` represents that the customer - has a month to pay the invoice. - """ - - plan: Plan - """ - The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be - subscribed to by a customer. Plans define the billing behavior of the - subscription. You can see more about how to configure prices in the - [Price resource](/reference/price). - """ - - price_intervals: List[PriceInterval] - """The price intervals for this subscription.""" - - redeemed_coupon: Optional[RedeemedCoupon] = None - - start_date: datetime - """The date Orb starts billing for this subscription.""" - - status: Literal["active", "ended", "upcoming"] - - trial_info: TrialInfo diff --git a/src/orb/types/subscription_create_params.py b/src/orb/types/subscription_create_params.py index ea4807cb..c5c9d73c 100644 --- a/src/orb/types/subscription_create_params.py +++ b/src/orb/types/subscription_create_params.py @@ -4,183 +4,29 @@ from typing import Dict, List, Union, Iterable, Optional from datetime import datetime -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from typing_extensions import Literal, Annotated, TypedDict from .._utils import PropertyInfo +from .shared_params.add_subscription_price_params import AddSubscriptionPriceParams +from .shared_params.remove_subscription_price_params import RemoveSubscriptionPriceParams +from .shared_params.replace_subscription_price_params import ReplaceSubscriptionPriceParams +from .shared_params.add_subscription_adjustment_params import AddSubscriptionAdjustmentParams +from .shared_params.remove_subscription_adjustment_params import RemoveSubscriptionAdjustmentParams +from .shared_params.replace_subscription_adjustment_params import ReplaceSubscriptionAdjustmentParams +from .shared_params.billing_cycle_anchor_configuration_model import BillingCycleAnchorConfigurationModel -__all__ = [ - "SubscriptionCreateParams", - "AddAdjustment", - "AddAdjustmentAdjustment", - "AddAdjustmentAdjustmentNewPercentageDiscount", - "AddAdjustmentAdjustmentNewUsageDiscount", - "AddAdjustmentAdjustmentNewAmountDiscount", - "AddAdjustmentAdjustmentNewMinimum", - "AddAdjustmentAdjustmentNewMaximum", - "AddPrice", - "AddPriceAllocationPrice", - "AddPriceDiscount", - "AddPricePrice", - "AddPricePriceNewSubscriptionUnitPrice", - "AddPricePriceNewSubscriptionUnitPriceUnitConfig", - "AddPricePriceNewSubscriptionUnitPriceBillingCycleConfiguration", - "AddPricePriceNewSubscriptionUnitPriceInvoicingCycleConfiguration", - "AddPricePriceNewSubscriptionPackagePrice", - "AddPricePriceNewSubscriptionPackagePricePackageConfig", - "AddPricePriceNewSubscriptionPackagePriceBillingCycleConfiguration", - "AddPricePriceNewSubscriptionPackagePriceInvoicingCycleConfiguration", - "AddPricePriceNewSubscriptionMatrixPrice", - "AddPricePriceNewSubscriptionMatrixPriceMatrixConfig", - "AddPricePriceNewSubscriptionMatrixPriceMatrixConfigMatrixValue", - "AddPricePriceNewSubscriptionMatrixPriceBillingCycleConfiguration", - "AddPricePriceNewSubscriptionMatrixPriceInvoicingCycleConfiguration", - "AddPricePriceNewSubscriptionTieredPrice", - "AddPricePriceNewSubscriptionTieredPriceTieredConfig", - "AddPricePriceNewSubscriptionTieredPriceTieredConfigTier", - "AddPricePriceNewSubscriptionTieredPriceBillingCycleConfiguration", - "AddPricePriceNewSubscriptionTieredPriceInvoicingCycleConfiguration", - "AddPricePriceNewSubscriptionTieredBpsPrice", - "AddPricePriceNewSubscriptionTieredBpsPriceTieredBpsConfig", - "AddPricePriceNewSubscriptionTieredBpsPriceTieredBpsConfigTier", - "AddPricePriceNewSubscriptionTieredBpsPriceBillingCycleConfiguration", - "AddPricePriceNewSubscriptionTieredBpsPriceInvoicingCycleConfiguration", - "AddPricePriceNewSubscriptionBpsPrice", - "AddPricePriceNewSubscriptionBpsPriceBpsConfig", - "AddPricePriceNewSubscriptionBpsPriceBillingCycleConfiguration", - "AddPricePriceNewSubscriptionBpsPriceInvoicingCycleConfiguration", - "AddPricePriceNewSubscriptionBulkBpsPrice", - "AddPricePriceNewSubscriptionBulkBpsPriceBulkBpsConfig", - "AddPricePriceNewSubscriptionBulkBpsPriceBulkBpsConfigTier", - "AddPricePriceNewSubscriptionBulkBpsPriceBillingCycleConfiguration", - "AddPricePriceNewSubscriptionBulkBpsPriceInvoicingCycleConfiguration", - "AddPricePriceNewSubscriptionBulkPrice", - "AddPricePriceNewSubscriptionBulkPriceBulkConfig", - "AddPricePriceNewSubscriptionBulkPriceBulkConfigTier", - "AddPricePriceNewSubscriptionBulkPriceBillingCycleConfiguration", - "AddPricePriceNewSubscriptionBulkPriceInvoicingCycleConfiguration", - "AddPricePriceNewSubscriptionThresholdTotalAmountPrice", - "AddPricePriceNewSubscriptionThresholdTotalAmountPriceBillingCycleConfiguration", - "AddPricePriceNewSubscriptionThresholdTotalAmountPriceInvoicingCycleConfiguration", - "AddPricePriceNewSubscriptionTieredPackagePrice", - "AddPricePriceNewSubscriptionTieredPackagePriceBillingCycleConfiguration", - "AddPricePriceNewSubscriptionTieredPackagePriceInvoicingCycleConfiguration", - "AddPricePriceNewSubscriptionTieredWithMinimumPrice", - "AddPricePriceNewSubscriptionTieredWithMinimumPriceBillingCycleConfiguration", - "AddPricePriceNewSubscriptionTieredWithMinimumPriceInvoicingCycleConfiguration", - "AddPricePriceNewSubscriptionUnitWithPercentPrice", - "AddPricePriceNewSubscriptionUnitWithPercentPriceBillingCycleConfiguration", - "AddPricePriceNewSubscriptionUnitWithPercentPriceInvoicingCycleConfiguration", - "AddPricePriceNewSubscriptionPackageWithAllocationPrice", - "AddPricePriceNewSubscriptionPackageWithAllocationPriceBillingCycleConfiguration", - "AddPricePriceNewSubscriptionPackageWithAllocationPriceInvoicingCycleConfiguration", - "AddPricePriceNewSubscriptionTierWithProrationPrice", - "AddPricePriceNewSubscriptionTierWithProrationPriceBillingCycleConfiguration", - "AddPricePriceNewSubscriptionTierWithProrationPriceInvoicingCycleConfiguration", - "AddPricePriceNewSubscriptionUnitWithProrationPrice", - "AddPricePriceNewSubscriptionUnitWithProrationPriceBillingCycleConfiguration", - "AddPricePriceNewSubscriptionUnitWithProrationPriceInvoicingCycleConfiguration", - "AddPricePriceNewSubscriptionGroupedAllocationPrice", - "AddPricePriceNewSubscriptionGroupedAllocationPriceBillingCycleConfiguration", - "AddPricePriceNewSubscriptionGroupedAllocationPriceInvoicingCycleConfiguration", - "AddPricePriceNewSubscriptionGroupedWithProratedMinimumPrice", - "AddPricePriceNewSubscriptionGroupedWithProratedMinimumPriceBillingCycleConfiguration", - "AddPricePriceNewSubscriptionGroupedWithProratedMinimumPriceInvoicingCycleConfiguration", - "AddPricePriceNewSubscriptionBulkWithProrationPrice", - "AddPricePriceNewSubscriptionBulkWithProrationPriceBillingCycleConfiguration", - "AddPricePriceNewSubscriptionBulkWithProrationPriceInvoicingCycleConfiguration", - "BillingCycleAnchorConfiguration", - "RemoveAdjustment", - "RemovePrice", - "ReplaceAdjustment", - "ReplaceAdjustmentAdjustment", - "ReplaceAdjustmentAdjustmentNewPercentageDiscount", - "ReplaceAdjustmentAdjustmentNewUsageDiscount", - "ReplaceAdjustmentAdjustmentNewAmountDiscount", - "ReplaceAdjustmentAdjustmentNewMinimum", - "ReplaceAdjustmentAdjustmentNewMaximum", - "ReplacePrice", - "ReplacePriceAllocationPrice", - "ReplacePriceDiscount", - "ReplacePricePrice", - "ReplacePricePriceNewSubscriptionUnitPrice", - "ReplacePricePriceNewSubscriptionUnitPriceUnitConfig", - "ReplacePricePriceNewSubscriptionUnitPriceBillingCycleConfiguration", - "ReplacePricePriceNewSubscriptionUnitPriceInvoicingCycleConfiguration", - "ReplacePricePriceNewSubscriptionPackagePrice", - "ReplacePricePriceNewSubscriptionPackagePricePackageConfig", - "ReplacePricePriceNewSubscriptionPackagePriceBillingCycleConfiguration", - "ReplacePricePriceNewSubscriptionPackagePriceInvoicingCycleConfiguration", - "ReplacePricePriceNewSubscriptionMatrixPrice", - "ReplacePricePriceNewSubscriptionMatrixPriceMatrixConfig", - "ReplacePricePriceNewSubscriptionMatrixPriceMatrixConfigMatrixValue", - "ReplacePricePriceNewSubscriptionMatrixPriceBillingCycleConfiguration", - "ReplacePricePriceNewSubscriptionMatrixPriceInvoicingCycleConfiguration", - "ReplacePricePriceNewSubscriptionTieredPrice", - "ReplacePricePriceNewSubscriptionTieredPriceTieredConfig", - "ReplacePricePriceNewSubscriptionTieredPriceTieredConfigTier", - "ReplacePricePriceNewSubscriptionTieredPriceBillingCycleConfiguration", - "ReplacePricePriceNewSubscriptionTieredPriceInvoicingCycleConfiguration", - "ReplacePricePriceNewSubscriptionTieredBpsPrice", - "ReplacePricePriceNewSubscriptionTieredBpsPriceTieredBpsConfig", - "ReplacePricePriceNewSubscriptionTieredBpsPriceTieredBpsConfigTier", - "ReplacePricePriceNewSubscriptionTieredBpsPriceBillingCycleConfiguration", - "ReplacePricePriceNewSubscriptionTieredBpsPriceInvoicingCycleConfiguration", - "ReplacePricePriceNewSubscriptionBpsPrice", - "ReplacePricePriceNewSubscriptionBpsPriceBpsConfig", - "ReplacePricePriceNewSubscriptionBpsPriceBillingCycleConfiguration", - "ReplacePricePriceNewSubscriptionBpsPriceInvoicingCycleConfiguration", - "ReplacePricePriceNewSubscriptionBulkBpsPrice", - "ReplacePricePriceNewSubscriptionBulkBpsPriceBulkBpsConfig", - "ReplacePricePriceNewSubscriptionBulkBpsPriceBulkBpsConfigTier", - "ReplacePricePriceNewSubscriptionBulkBpsPriceBillingCycleConfiguration", - "ReplacePricePriceNewSubscriptionBulkBpsPriceInvoicingCycleConfiguration", - "ReplacePricePriceNewSubscriptionBulkPrice", - "ReplacePricePriceNewSubscriptionBulkPriceBulkConfig", - "ReplacePricePriceNewSubscriptionBulkPriceBulkConfigTier", - "ReplacePricePriceNewSubscriptionBulkPriceBillingCycleConfiguration", - "ReplacePricePriceNewSubscriptionBulkPriceInvoicingCycleConfiguration", - "ReplacePricePriceNewSubscriptionThresholdTotalAmountPrice", - "ReplacePricePriceNewSubscriptionThresholdTotalAmountPriceBillingCycleConfiguration", - "ReplacePricePriceNewSubscriptionThresholdTotalAmountPriceInvoicingCycleConfiguration", - "ReplacePricePriceNewSubscriptionTieredPackagePrice", - "ReplacePricePriceNewSubscriptionTieredPackagePriceBillingCycleConfiguration", - "ReplacePricePriceNewSubscriptionTieredPackagePriceInvoicingCycleConfiguration", - "ReplacePricePriceNewSubscriptionTieredWithMinimumPrice", - "ReplacePricePriceNewSubscriptionTieredWithMinimumPriceBillingCycleConfiguration", - "ReplacePricePriceNewSubscriptionTieredWithMinimumPriceInvoicingCycleConfiguration", - "ReplacePricePriceNewSubscriptionUnitWithPercentPrice", - "ReplacePricePriceNewSubscriptionUnitWithPercentPriceBillingCycleConfiguration", - "ReplacePricePriceNewSubscriptionUnitWithPercentPriceInvoicingCycleConfiguration", - "ReplacePricePriceNewSubscriptionPackageWithAllocationPrice", - "ReplacePricePriceNewSubscriptionPackageWithAllocationPriceBillingCycleConfiguration", - "ReplacePricePriceNewSubscriptionPackageWithAllocationPriceInvoicingCycleConfiguration", - "ReplacePricePriceNewSubscriptionTierWithProrationPrice", - "ReplacePricePriceNewSubscriptionTierWithProrationPriceBillingCycleConfiguration", - "ReplacePricePriceNewSubscriptionTierWithProrationPriceInvoicingCycleConfiguration", - "ReplacePricePriceNewSubscriptionUnitWithProrationPrice", - "ReplacePricePriceNewSubscriptionUnitWithProrationPriceBillingCycleConfiguration", - "ReplacePricePriceNewSubscriptionUnitWithProrationPriceInvoicingCycleConfiguration", - "ReplacePricePriceNewSubscriptionGroupedAllocationPrice", - "ReplacePricePriceNewSubscriptionGroupedAllocationPriceBillingCycleConfiguration", - "ReplacePricePriceNewSubscriptionGroupedAllocationPriceInvoicingCycleConfiguration", - "ReplacePricePriceNewSubscriptionGroupedWithProratedMinimumPrice", - "ReplacePricePriceNewSubscriptionGroupedWithProratedMinimumPriceBillingCycleConfiguration", - "ReplacePricePriceNewSubscriptionGroupedWithProratedMinimumPriceInvoicingCycleConfiguration", - "ReplacePricePriceNewSubscriptionBulkWithProrationPrice", - "ReplacePricePriceNewSubscriptionBulkWithProrationPriceBillingCycleConfiguration", - "ReplacePricePriceNewSubscriptionBulkWithProrationPriceInvoicingCycleConfiguration", -] +__all__ = ["SubscriptionCreateParams"] class SubscriptionCreateParams(TypedDict, total=False): - add_adjustments: Optional[Iterable[AddAdjustment]] + add_adjustments: Optional[Iterable[AddSubscriptionAdjustmentParams]] """Additional adjustments to be added to the subscription. (Only available for accounts that have migrated off of legacy subscription overrides) """ - add_prices: Optional[Iterable[AddPrice]] + add_prices: Optional[Iterable[AddSubscriptionPriceParams]] """Additional prices to be added to the subscription. (Only available for accounts that have migrated off of legacy subscription @@ -198,7 +44,7 @@ class SubscriptionCreateParams(TypedDict, total=False): aws_region: Optional[str] - billing_cycle_anchor_configuration: Optional[BillingCycleAnchorConfiguration] + billing_cycle_anchor_configuration: Optional[BillingCycleAnchorConfigurationModel] coupon_redemption_code: Optional[str] """Redemption code to be used for this subscription. @@ -281,28 +127,28 @@ class SubscriptionCreateParams(TypedDict, total=False): price_overrides: Optional[Iterable[object]] """Optionally provide a list of overrides for prices on the plan""" - remove_adjustments: Optional[Iterable[RemoveAdjustment]] + remove_adjustments: Optional[Iterable[RemoveSubscriptionAdjustmentParams]] """Plan adjustments to be removed from the subscription. (Only available for accounts that have migrated off of legacy subscription overrides) """ - remove_prices: Optional[Iterable[RemovePrice]] + remove_prices: Optional[Iterable[RemoveSubscriptionPriceParams]] """Plan prices to be removed from the subscription. (Only available for accounts that have migrated off of legacy subscription overrides) """ - replace_adjustments: Optional[Iterable[ReplaceAdjustment]] + replace_adjustments: Optional[Iterable[ReplaceSubscriptionAdjustmentParams]] """Plan adjustments to be replaced with additional adjustments on the subscription. (Only available for accounts that have migrated off of legacy subscription overrides) """ - replace_prices: Optional[Iterable[ReplacePrice]] + replace_prices: Optional[Iterable[ReplaceSubscriptionPriceParams]] """Plan prices to be replaced with additional prices on the subscription. (Only available for accounts that have migrated off of legacy subscription @@ -327,3954 +173,3 @@ class SubscriptionCreateParams(TypedDict, total=False): only. Provided usage_customer_ids must be either the customer for this subscription itself, or any of that customer's children. """ - - -class AddAdjustmentAdjustmentNewPercentageDiscount(TypedDict, total=False): - adjustment_type: Required[Literal["percentage_discount"]] - - applies_to_price_ids: Required[List[str]] - """The set of price IDs to which this adjustment applies.""" - - percentage_discount: Required[float] - - is_invoice_level: bool - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -class AddAdjustmentAdjustmentNewUsageDiscount(TypedDict, total=False): - adjustment_type: Required[Literal["usage_discount"]] - - applies_to_price_ids: Required[List[str]] - """The set of price IDs to which this adjustment applies.""" - - usage_discount: Required[float] - - is_invoice_level: bool - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -class AddAdjustmentAdjustmentNewAmountDiscount(TypedDict, total=False): - adjustment_type: Required[Literal["amount_discount"]] - - amount_discount: Required[str] - - applies_to_price_ids: Required[List[str]] - """The set of price IDs to which this adjustment applies.""" - - is_invoice_level: bool - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -class AddAdjustmentAdjustmentNewMinimum(TypedDict, total=False): - adjustment_type: Required[Literal["minimum"]] - - applies_to_price_ids: Required[List[str]] - """The set of price IDs to which this adjustment applies.""" - - item_id: Required[str] - """The item ID that revenue from this minimum will be attributed to.""" - - minimum_amount: Required[str] - - is_invoice_level: bool - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -class AddAdjustmentAdjustmentNewMaximum(TypedDict, total=False): - adjustment_type: Required[Literal["maximum"]] - - applies_to_price_ids: Required[List[str]] - """The set of price IDs to which this adjustment applies.""" - - maximum_amount: Required[str] - - is_invoice_level: bool - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -AddAdjustmentAdjustment: TypeAlias = Union[ - AddAdjustmentAdjustmentNewPercentageDiscount, - AddAdjustmentAdjustmentNewUsageDiscount, - AddAdjustmentAdjustmentNewAmountDiscount, - AddAdjustmentAdjustmentNewMinimum, - AddAdjustmentAdjustmentNewMaximum, -] - - -class AddAdjustment(TypedDict, total=False): - adjustment: Required[AddAdjustmentAdjustment] - """The definition of a new adjustment to create and add to the subscription.""" - - end_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] - """The end date of the adjustment interval. - - This is the date that the adjustment will stop affecting prices on the - subscription. - """ - - plan_phase_order: Optional[int] - """The phase to add this adjustment to.""" - - start_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] - """The start date of the adjustment interval. - - This is the date that the adjustment will start affecting prices on the - subscription. If null, the adjustment will start when the phase or subscription - starts. - """ - - -class AddPriceAllocationPrice(TypedDict, total=False): - amount: Required[str] - """An amount of the currency to allocate to the customer at the specified cadence.""" - - cadence: Required[Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"]] - """The cadence at which to allocate the amount to the customer.""" - - currency: Required[str] - """ - An ISO 4217 currency string or a custom pricing unit identifier in which to bill - this price. - """ - - expires_at_end_of_cadence: Required[bool] - """ - Whether the allocated amount should expire at the end of the cadence or roll - over to the next period. - """ - - -class AddPriceDiscount(TypedDict, total=False): - discount_type: Required[Literal["percentage", "usage", "amount"]] - - amount_discount: Optional[str] - """Only available if discount_type is `amount`.""" - - percentage_discount: Optional[float] - """Only available if discount_type is `percentage`. - - This is a number between 0 and 1. - """ - - usage_discount: Optional[float] - """Only available if discount_type is `usage`. - - Number of usage units that this discount is for - """ - - -class AddPricePriceNewSubscriptionUnitPriceUnitConfig(TypedDict, total=False): - unit_amount: Required[str] - """Rate per unit of usage""" - - -class AddPricePriceNewSubscriptionUnitPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionUnitPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionUnitPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["unit"]] - - name: Required[str] - """The name of the price.""" - - unit_config: Required[AddPricePriceNewSubscriptionUnitPriceUnitConfig] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionUnitPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[AddPricePriceNewSubscriptionUnitPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class AddPricePriceNewSubscriptionPackagePricePackageConfig(TypedDict, total=False): - package_amount: Required[str] - """A currency amount to rate usage by""" - - package_size: Required[int] - """An integer amount to represent package size. - - For example, 1000 here would divide usage by 1000 before multiplying by - package_amount in rating - """ - - -class AddPricePriceNewSubscriptionPackagePriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionPackagePrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["package"]] - - name: Required[str] - """The name of the price.""" - - package_config: Required[AddPricePriceNewSubscriptionPackagePricePackageConfig] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionPackagePriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[AddPricePriceNewSubscriptionPackagePriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class AddPricePriceNewSubscriptionMatrixPriceMatrixConfigMatrixValue(TypedDict, total=False): - dimension_values: Required[List[Optional[str]]] - """One or two matrix keys to filter usage to this Matrix value by. - - For example, ["region", "tier"] could be used to filter cloud usage by a cloud - region and an instance tier. - """ - - unit_amount: Required[str] - """Unit price for the specified dimension_values""" - - -class AddPricePriceNewSubscriptionMatrixPriceMatrixConfig(TypedDict, total=False): - default_unit_amount: Required[str] - """Default per unit rate for any usage not bucketed into a specified matrix_value""" - - dimensions: Required[List[Optional[str]]] - """One or two event property values to evaluate matrix groups by""" - - matrix_values: Required[Iterable[AddPricePriceNewSubscriptionMatrixPriceMatrixConfigMatrixValue]] - """Matrix values for specified matrix grouping keys""" - - -class AddPricePriceNewSubscriptionMatrixPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionMatrixPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionMatrixPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - matrix_config: Required[AddPricePriceNewSubscriptionMatrixPriceMatrixConfig] - - model_type: Required[Literal["matrix"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionMatrixPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[AddPricePriceNewSubscriptionMatrixPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class AddPricePriceNewSubscriptionTieredPriceTieredConfigTier(TypedDict, total=False): - first_unit: Required[float] - """Inclusive tier starting value""" - - unit_amount: Required[str] - """Amount per unit""" - - last_unit: Optional[float] - """Exclusive tier ending value. If null, this is treated as the last tier""" - - -class AddPricePriceNewSubscriptionTieredPriceTieredConfig(TypedDict, total=False): - tiers: Required[Iterable[AddPricePriceNewSubscriptionTieredPriceTieredConfigTier]] - """Tiers for rating based on total usage quantities into the specified tier""" - - -class AddPricePriceNewSubscriptionTieredPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionTieredPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionTieredPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["tiered"]] - - name: Required[str] - """The name of the price.""" - - tiered_config: Required[AddPricePriceNewSubscriptionTieredPriceTieredConfig] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionTieredPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[AddPricePriceNewSubscriptionTieredPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class AddPricePriceNewSubscriptionTieredBpsPriceTieredBpsConfigTier(TypedDict, total=False): - bps: Required[float] - """Per-event basis point rate""" - - minimum_amount: Required[str] - """Inclusive tier starting value""" - - maximum_amount: Optional[str] - """Exclusive tier ending value""" - - per_unit_maximum: Optional[str] - """Per unit maximum to charge""" - - -class AddPricePriceNewSubscriptionTieredBpsPriceTieredBpsConfig(TypedDict, total=False): - tiers: Required[Iterable[AddPricePriceNewSubscriptionTieredBpsPriceTieredBpsConfigTier]] - """ - Tiers for a Graduated BPS pricing model, where usage is bucketed into specified - tiers - """ - - -class AddPricePriceNewSubscriptionTieredBpsPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionTieredBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionTieredBpsPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["tiered_bps"]] - - name: Required[str] - """The name of the price.""" - - tiered_bps_config: Required[AddPricePriceNewSubscriptionTieredBpsPriceTieredBpsConfig] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionTieredBpsPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[AddPricePriceNewSubscriptionTieredBpsPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class AddPricePriceNewSubscriptionBpsPriceBpsConfig(TypedDict, total=False): - bps: Required[float] - """Basis point take rate per event""" - - per_unit_maximum: Optional[str] - """Optional currency amount maximum to cap spend per event""" - - -class AddPricePriceNewSubscriptionBpsPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionBpsPrice(TypedDict, total=False): - bps_config: Required[AddPricePriceNewSubscriptionBpsPriceBpsConfig] - - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["bps"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionBpsPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[AddPricePriceNewSubscriptionBpsPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class AddPricePriceNewSubscriptionBulkBpsPriceBulkBpsConfigTier(TypedDict, total=False): - bps: Required[float] - """Basis points to rate on""" - - maximum_amount: Optional[str] - """Upper bound for tier""" - - per_unit_maximum: Optional[str] - """The maximum amount to charge for any one event""" - - -class AddPricePriceNewSubscriptionBulkBpsPriceBulkBpsConfig(TypedDict, total=False): - tiers: Required[Iterable[AddPricePriceNewSubscriptionBulkBpsPriceBulkBpsConfigTier]] - """ - Tiers for a bulk BPS pricing model where all usage is aggregated to a single - tier based on total volume - """ - - -class AddPricePriceNewSubscriptionBulkBpsPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionBulkBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionBulkBpsPrice(TypedDict, total=False): - bulk_bps_config: Required[AddPricePriceNewSubscriptionBulkBpsPriceBulkBpsConfig] - - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["bulk_bps"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionBulkBpsPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[AddPricePriceNewSubscriptionBulkBpsPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class AddPricePriceNewSubscriptionBulkPriceBulkConfigTier(TypedDict, total=False): - unit_amount: Required[str] - """Amount per unit""" - - maximum_units: Optional[float] - """Upper bound for this tier""" - - -class AddPricePriceNewSubscriptionBulkPriceBulkConfig(TypedDict, total=False): - tiers: Required[Iterable[AddPricePriceNewSubscriptionBulkPriceBulkConfigTier]] - """Bulk tiers for rating based on total usage volume""" - - -class AddPricePriceNewSubscriptionBulkPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionBulkPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionBulkPrice(TypedDict, total=False): - bulk_config: Required[AddPricePriceNewSubscriptionBulkPriceBulkConfig] - - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["bulk"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionBulkPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[AddPricePriceNewSubscriptionBulkPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class AddPricePriceNewSubscriptionThresholdTotalAmountPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionThresholdTotalAmountPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionThresholdTotalAmountPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["threshold_total_amount"]] - - name: Required[str] - """The name of the price.""" - - threshold_total_amount_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ - AddPricePriceNewSubscriptionThresholdTotalAmountPriceBillingCycleConfiguration - ] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - AddPricePriceNewSubscriptionThresholdTotalAmountPriceInvoicingCycleConfiguration - ] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class AddPricePriceNewSubscriptionTieredPackagePriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionTieredPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionTieredPackagePrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["tiered_package"]] - - name: Required[str] - """The name of the price.""" - - tiered_package_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionTieredPackagePriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[AddPricePriceNewSubscriptionTieredPackagePriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class AddPricePriceNewSubscriptionTieredWithMinimumPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionTieredWithMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionTieredWithMinimumPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["tiered_with_minimum"]] - - name: Required[str] - """The name of the price.""" - - tiered_with_minimum_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionTieredWithMinimumPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - AddPricePriceNewSubscriptionTieredWithMinimumPriceInvoicingCycleConfiguration - ] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class AddPricePriceNewSubscriptionUnitWithPercentPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionUnitWithPercentPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionUnitWithPercentPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["unit_with_percent"]] - - name: Required[str] - """The name of the price.""" - - unit_with_percent_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionUnitWithPercentPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[AddPricePriceNewSubscriptionUnitWithPercentPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class AddPricePriceNewSubscriptionPackageWithAllocationPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionPackageWithAllocationPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionPackageWithAllocationPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["package_with_allocation"]] - - name: Required[str] - """The name of the price.""" - - package_with_allocation_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ - AddPricePriceNewSubscriptionPackageWithAllocationPriceBillingCycleConfiguration - ] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - AddPricePriceNewSubscriptionPackageWithAllocationPriceInvoicingCycleConfiguration - ] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class AddPricePriceNewSubscriptionTierWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionTierWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionTierWithProrationPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["tiered_with_proration"]] - - name: Required[str] - """The name of the price.""" - - tiered_with_proration_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionTierWithProrationPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - AddPricePriceNewSubscriptionTierWithProrationPriceInvoicingCycleConfiguration - ] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class AddPricePriceNewSubscriptionUnitWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionUnitWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionUnitWithProrationPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["unit_with_proration"]] - - name: Required[str] - """The name of the price.""" - - unit_with_proration_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionUnitWithProrationPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - AddPricePriceNewSubscriptionUnitWithProrationPriceInvoicingCycleConfiguration - ] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class AddPricePriceNewSubscriptionGroupedAllocationPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionGroupedAllocationPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionGroupedAllocationPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - grouped_allocation_config: Required[Dict[str, object]] - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["grouped_allocation"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionGroupedAllocationPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - AddPricePriceNewSubscriptionGroupedAllocationPriceInvoicingCycleConfiguration - ] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class AddPricePriceNewSubscriptionGroupedWithProratedMinimumPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionGroupedWithProratedMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionGroupedWithProratedMinimumPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - grouped_with_prorated_minimum_config: Required[Dict[str, object]] - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["grouped_with_prorated_minimum"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ - AddPricePriceNewSubscriptionGroupedWithProratedMinimumPriceBillingCycleConfiguration - ] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - AddPricePriceNewSubscriptionGroupedWithProratedMinimumPriceInvoicingCycleConfiguration - ] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class AddPricePriceNewSubscriptionBulkWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionBulkWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionBulkWithProrationPrice(TypedDict, total=False): - bulk_with_proration_config: Required[Dict[str, object]] - - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["bulk_with_proration"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionBulkWithProrationPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - AddPricePriceNewSubscriptionBulkWithProrationPriceInvoicingCycleConfiguration - ] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -AddPricePrice: TypeAlias = Union[ - AddPricePriceNewSubscriptionUnitPrice, - AddPricePriceNewSubscriptionPackagePrice, - AddPricePriceNewSubscriptionMatrixPrice, - AddPricePriceNewSubscriptionTieredPrice, - AddPricePriceNewSubscriptionTieredBpsPrice, - AddPricePriceNewSubscriptionBpsPrice, - AddPricePriceNewSubscriptionBulkBpsPrice, - AddPricePriceNewSubscriptionBulkPrice, - AddPricePriceNewSubscriptionThresholdTotalAmountPrice, - AddPricePriceNewSubscriptionTieredPackagePrice, - AddPricePriceNewSubscriptionTieredWithMinimumPrice, - AddPricePriceNewSubscriptionUnitWithPercentPrice, - AddPricePriceNewSubscriptionPackageWithAllocationPrice, - AddPricePriceNewSubscriptionTierWithProrationPrice, - AddPricePriceNewSubscriptionUnitWithProrationPrice, - AddPricePriceNewSubscriptionGroupedAllocationPrice, - AddPricePriceNewSubscriptionGroupedWithProratedMinimumPrice, - AddPricePriceNewSubscriptionBulkWithProrationPrice, -] - - -class AddPrice(TypedDict, total=False): - allocation_price: Optional[AddPriceAllocationPrice] - """The definition of a new allocation price to create and add to the subscription.""" - - discounts: Optional[Iterable[AddPriceDiscount]] - """[DEPRECATED] Use add_adjustments instead. - - The subscription's discounts for this price. - """ - - end_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] - """The end date of the price interval. - - This is the date that the price will stop billing on the subscription. If null, - billing will end when the phase or subscription ends. - """ - - external_price_id: Optional[str] - """The external price id of the price to add to the subscription.""" - - maximum_amount: Optional[str] - """[DEPRECATED] Use add_adjustments instead. - - The subscription's maximum amount for this price. - """ - - minimum_amount: Optional[str] - """[DEPRECATED] Use add_adjustments instead. - - The subscription's minimum amount for this price. - """ - - plan_phase_order: Optional[int] - """The phase to add this price to.""" - - price: Optional[AddPricePrice] - """The definition of a new price to create and add to the subscription.""" - - price_id: Optional[str] - """The id of the price to add to the subscription.""" - - start_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] - """The start date of the price interval. - - This is the date that the price will start billing on the subscription. If null, - billing will start when the phase or subscription starts. - """ - - -class BillingCycleAnchorConfiguration(TypedDict, total=False): - day: Required[int] - """The day of the month on which the billing cycle is anchored. - - If the maximum number of days in a month is greater than this value, the last - day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April - means the billing period begins on the 30th. - """ - - month: Optional[int] - """The month on which the billing cycle is anchored (e.g. - - a quarterly price anchored in February would have cycles starting February, May, - August, and November). - """ - - year: Optional[int] - """The year on which the billing cycle is anchored (e.g. - - a 2 year billing cycle anchored on 2021 would have cycles starting on 2021, - 2023, 2025, etc.). - """ - - -class RemoveAdjustment(TypedDict, total=False): - adjustment_id: Required[str] - """The id of the adjustment to remove on the subscription.""" - - -class RemovePrice(TypedDict, total=False): - external_price_id: Optional[str] - """The external price id of the price to remove on the subscription.""" - - price_id: Optional[str] - """The id of the price to remove on the subscription.""" - - -class ReplaceAdjustmentAdjustmentNewPercentageDiscount(TypedDict, total=False): - adjustment_type: Required[Literal["percentage_discount"]] - - applies_to_price_ids: Required[List[str]] - """The set of price IDs to which this adjustment applies.""" - - percentage_discount: Required[float] - - is_invoice_level: bool - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -class ReplaceAdjustmentAdjustmentNewUsageDiscount(TypedDict, total=False): - adjustment_type: Required[Literal["usage_discount"]] - - applies_to_price_ids: Required[List[str]] - """The set of price IDs to which this adjustment applies.""" - - usage_discount: Required[float] - - is_invoice_level: bool - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -class ReplaceAdjustmentAdjustmentNewAmountDiscount(TypedDict, total=False): - adjustment_type: Required[Literal["amount_discount"]] - - amount_discount: Required[str] - - applies_to_price_ids: Required[List[str]] - """The set of price IDs to which this adjustment applies.""" - - is_invoice_level: bool - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -class ReplaceAdjustmentAdjustmentNewMinimum(TypedDict, total=False): - adjustment_type: Required[Literal["minimum"]] - - applies_to_price_ids: Required[List[str]] - """The set of price IDs to which this adjustment applies.""" - - item_id: Required[str] - """The item ID that revenue from this minimum will be attributed to.""" - - minimum_amount: Required[str] - - is_invoice_level: bool - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -class ReplaceAdjustmentAdjustmentNewMaximum(TypedDict, total=False): - adjustment_type: Required[Literal["maximum"]] - - applies_to_price_ids: Required[List[str]] - """The set of price IDs to which this adjustment applies.""" - - maximum_amount: Required[str] - - is_invoice_level: bool - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -ReplaceAdjustmentAdjustment: TypeAlias = Union[ - ReplaceAdjustmentAdjustmentNewPercentageDiscount, - ReplaceAdjustmentAdjustmentNewUsageDiscount, - ReplaceAdjustmentAdjustmentNewAmountDiscount, - ReplaceAdjustmentAdjustmentNewMinimum, - ReplaceAdjustmentAdjustmentNewMaximum, -] - - -class ReplaceAdjustment(TypedDict, total=False): - adjustment: Required[ReplaceAdjustmentAdjustment] - """The definition of a new adjustment to create and add to the subscription.""" - - replaces_adjustment_id: Required[str] - """The id of the adjustment on the plan to replace in the subscription.""" - - -class ReplacePriceAllocationPrice(TypedDict, total=False): - amount: Required[str] - """An amount of the currency to allocate to the customer at the specified cadence.""" - - cadence: Required[Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"]] - """The cadence at which to allocate the amount to the customer.""" - - currency: Required[str] - """ - An ISO 4217 currency string or a custom pricing unit identifier in which to bill - this price. - """ - - expires_at_end_of_cadence: Required[bool] - """ - Whether the allocated amount should expire at the end of the cadence or roll - over to the next period. - """ - - -class ReplacePriceDiscount(TypedDict, total=False): - discount_type: Required[Literal["percentage", "usage", "amount"]] - - amount_discount: Optional[str] - """Only available if discount_type is `amount`.""" - - percentage_discount: Optional[float] - """Only available if discount_type is `percentage`. - - This is a number between 0 and 1. - """ - - usage_discount: Optional[float] - """Only available if discount_type is `usage`. - - Number of usage units that this discount is for - """ - - -class ReplacePricePriceNewSubscriptionUnitPriceUnitConfig(TypedDict, total=False): - unit_amount: Required[str] - """Rate per unit of usage""" - - -class ReplacePricePriceNewSubscriptionUnitPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionUnitPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionUnitPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["unit"]] - - name: Required[str] - """The name of the price.""" - - unit_config: Required[ReplacePricePriceNewSubscriptionUnitPriceUnitConfig] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionUnitPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionUnitPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class ReplacePricePriceNewSubscriptionPackagePricePackageConfig(TypedDict, total=False): - package_amount: Required[str] - """A currency amount to rate usage by""" - - package_size: Required[int] - """An integer amount to represent package size. - - For example, 1000 here would divide usage by 1000 before multiplying by - package_amount in rating - """ - - -class ReplacePricePriceNewSubscriptionPackagePriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionPackagePrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["package"]] - - name: Required[str] - """The name of the price.""" - - package_config: Required[ReplacePricePriceNewSubscriptionPackagePricePackageConfig] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionPackagePriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionPackagePriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class ReplacePricePriceNewSubscriptionMatrixPriceMatrixConfigMatrixValue(TypedDict, total=False): - dimension_values: Required[List[Optional[str]]] - """One or two matrix keys to filter usage to this Matrix value by. - - For example, ["region", "tier"] could be used to filter cloud usage by a cloud - region and an instance tier. - """ - - unit_amount: Required[str] - """Unit price for the specified dimension_values""" - - -class ReplacePricePriceNewSubscriptionMatrixPriceMatrixConfig(TypedDict, total=False): - default_unit_amount: Required[str] - """Default per unit rate for any usage not bucketed into a specified matrix_value""" - - dimensions: Required[List[Optional[str]]] - """One or two event property values to evaluate matrix groups by""" - - matrix_values: Required[Iterable[ReplacePricePriceNewSubscriptionMatrixPriceMatrixConfigMatrixValue]] - """Matrix values for specified matrix grouping keys""" - - -class ReplacePricePriceNewSubscriptionMatrixPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionMatrixPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionMatrixPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - matrix_config: Required[ReplacePricePriceNewSubscriptionMatrixPriceMatrixConfig] - - model_type: Required[Literal["matrix"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionMatrixPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionMatrixPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class ReplacePricePriceNewSubscriptionTieredPriceTieredConfigTier(TypedDict, total=False): - first_unit: Required[float] - """Inclusive tier starting value""" - - unit_amount: Required[str] - """Amount per unit""" - - last_unit: Optional[float] - """Exclusive tier ending value. If null, this is treated as the last tier""" - - -class ReplacePricePriceNewSubscriptionTieredPriceTieredConfig(TypedDict, total=False): - tiers: Required[Iterable[ReplacePricePriceNewSubscriptionTieredPriceTieredConfigTier]] - """Tiers for rating based on total usage quantities into the specified tier""" - - -class ReplacePricePriceNewSubscriptionTieredPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionTieredPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionTieredPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["tiered"]] - - name: Required[str] - """The name of the price.""" - - tiered_config: Required[ReplacePricePriceNewSubscriptionTieredPriceTieredConfig] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionTieredPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionTieredPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class ReplacePricePriceNewSubscriptionTieredBpsPriceTieredBpsConfigTier(TypedDict, total=False): - bps: Required[float] - """Per-event basis point rate""" - - minimum_amount: Required[str] - """Inclusive tier starting value""" - - maximum_amount: Optional[str] - """Exclusive tier ending value""" - - per_unit_maximum: Optional[str] - """Per unit maximum to charge""" - - -class ReplacePricePriceNewSubscriptionTieredBpsPriceTieredBpsConfig(TypedDict, total=False): - tiers: Required[Iterable[ReplacePricePriceNewSubscriptionTieredBpsPriceTieredBpsConfigTier]] - """ - Tiers for a Graduated BPS pricing model, where usage is bucketed into specified - tiers - """ - - -class ReplacePricePriceNewSubscriptionTieredBpsPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionTieredBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionTieredBpsPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["tiered_bps"]] - - name: Required[str] - """The name of the price.""" - - tiered_bps_config: Required[ReplacePricePriceNewSubscriptionTieredBpsPriceTieredBpsConfig] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionTieredBpsPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionTieredBpsPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class ReplacePricePriceNewSubscriptionBpsPriceBpsConfig(TypedDict, total=False): - bps: Required[float] - """Basis point take rate per event""" - - per_unit_maximum: Optional[str] - """Optional currency amount maximum to cap spend per event""" - - -class ReplacePricePriceNewSubscriptionBpsPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionBpsPrice(TypedDict, total=False): - bps_config: Required[ReplacePricePriceNewSubscriptionBpsPriceBpsConfig] - - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["bps"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionBpsPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionBpsPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class ReplacePricePriceNewSubscriptionBulkBpsPriceBulkBpsConfigTier(TypedDict, total=False): - bps: Required[float] - """Basis points to rate on""" - - maximum_amount: Optional[str] - """Upper bound for tier""" - - per_unit_maximum: Optional[str] - """The maximum amount to charge for any one event""" - - -class ReplacePricePriceNewSubscriptionBulkBpsPriceBulkBpsConfig(TypedDict, total=False): - tiers: Required[Iterable[ReplacePricePriceNewSubscriptionBulkBpsPriceBulkBpsConfigTier]] - """ - Tiers for a bulk BPS pricing model where all usage is aggregated to a single - tier based on total volume - """ - - -class ReplacePricePriceNewSubscriptionBulkBpsPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionBulkBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionBulkBpsPrice(TypedDict, total=False): - bulk_bps_config: Required[ReplacePricePriceNewSubscriptionBulkBpsPriceBulkBpsConfig] - - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["bulk_bps"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionBulkBpsPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionBulkBpsPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class ReplacePricePriceNewSubscriptionBulkPriceBulkConfigTier(TypedDict, total=False): - unit_amount: Required[str] - """Amount per unit""" - - maximum_units: Optional[float] - """Upper bound for this tier""" - - -class ReplacePricePriceNewSubscriptionBulkPriceBulkConfig(TypedDict, total=False): - tiers: Required[Iterable[ReplacePricePriceNewSubscriptionBulkPriceBulkConfigTier]] - """Bulk tiers for rating based on total usage volume""" - - -class ReplacePricePriceNewSubscriptionBulkPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionBulkPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionBulkPrice(TypedDict, total=False): - bulk_config: Required[ReplacePricePriceNewSubscriptionBulkPriceBulkConfig] - - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["bulk"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionBulkPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionBulkPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class ReplacePricePriceNewSubscriptionThresholdTotalAmountPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionThresholdTotalAmountPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionThresholdTotalAmountPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["threshold_total_amount"]] - - name: Required[str] - """The name of the price.""" - - threshold_total_amount_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ - ReplacePricePriceNewSubscriptionThresholdTotalAmountPriceBillingCycleConfiguration - ] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - ReplacePricePriceNewSubscriptionThresholdTotalAmountPriceInvoicingCycleConfiguration - ] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class ReplacePricePriceNewSubscriptionTieredPackagePriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionTieredPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionTieredPackagePrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["tiered_package"]] - - name: Required[str] - """The name of the price.""" - - tiered_package_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionTieredPackagePriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - ReplacePricePriceNewSubscriptionTieredPackagePriceInvoicingCycleConfiguration - ] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class ReplacePricePriceNewSubscriptionTieredWithMinimumPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionTieredWithMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionTieredWithMinimumPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["tiered_with_minimum"]] - - name: Required[str] - """The name of the price.""" - - tiered_with_minimum_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ - ReplacePricePriceNewSubscriptionTieredWithMinimumPriceBillingCycleConfiguration - ] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - ReplacePricePriceNewSubscriptionTieredWithMinimumPriceInvoicingCycleConfiguration - ] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class ReplacePricePriceNewSubscriptionUnitWithPercentPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionUnitWithPercentPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionUnitWithPercentPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["unit_with_percent"]] - - name: Required[str] - """The name of the price.""" - - unit_with_percent_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionUnitWithPercentPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - ReplacePricePriceNewSubscriptionUnitWithPercentPriceInvoicingCycleConfiguration - ] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class ReplacePricePriceNewSubscriptionPackageWithAllocationPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionPackageWithAllocationPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionPackageWithAllocationPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["package_with_allocation"]] - - name: Required[str] - """The name of the price.""" - - package_with_allocation_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ - ReplacePricePriceNewSubscriptionPackageWithAllocationPriceBillingCycleConfiguration - ] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - ReplacePricePriceNewSubscriptionPackageWithAllocationPriceInvoicingCycleConfiguration - ] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class ReplacePricePriceNewSubscriptionTierWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionTierWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionTierWithProrationPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["tiered_with_proration"]] - - name: Required[str] - """The name of the price.""" - - tiered_with_proration_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ - ReplacePricePriceNewSubscriptionTierWithProrationPriceBillingCycleConfiguration - ] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - ReplacePricePriceNewSubscriptionTierWithProrationPriceInvoicingCycleConfiguration - ] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class ReplacePricePriceNewSubscriptionUnitWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionUnitWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionUnitWithProrationPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["unit_with_proration"]] - - name: Required[str] - """The name of the price.""" - - unit_with_proration_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ - ReplacePricePriceNewSubscriptionUnitWithProrationPriceBillingCycleConfiguration - ] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - ReplacePricePriceNewSubscriptionUnitWithProrationPriceInvoicingCycleConfiguration - ] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class ReplacePricePriceNewSubscriptionGroupedAllocationPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionGroupedAllocationPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionGroupedAllocationPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - grouped_allocation_config: Required[Dict[str, object]] - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["grouped_allocation"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ - ReplacePricePriceNewSubscriptionGroupedAllocationPriceBillingCycleConfiguration - ] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - ReplacePricePriceNewSubscriptionGroupedAllocationPriceInvoicingCycleConfiguration - ] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class ReplacePricePriceNewSubscriptionGroupedWithProratedMinimumPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionGroupedWithProratedMinimumPriceInvoicingCycleConfiguration( - TypedDict, total=False -): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionGroupedWithProratedMinimumPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - grouped_with_prorated_minimum_config: Required[Dict[str, object]] - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["grouped_with_prorated_minimum"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ - ReplacePricePriceNewSubscriptionGroupedWithProratedMinimumPriceBillingCycleConfiguration - ] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - ReplacePricePriceNewSubscriptionGroupedWithProratedMinimumPriceInvoicingCycleConfiguration - ] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class ReplacePricePriceNewSubscriptionBulkWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionBulkWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionBulkWithProrationPrice(TypedDict, total=False): - bulk_with_proration_config: Required[Dict[str, object]] - - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["bulk_with_proration"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ - ReplacePricePriceNewSubscriptionBulkWithProrationPriceBillingCycleConfiguration - ] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - ReplacePricePriceNewSubscriptionBulkWithProrationPriceInvoicingCycleConfiguration - ] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -ReplacePricePrice: TypeAlias = Union[ - ReplacePricePriceNewSubscriptionUnitPrice, - ReplacePricePriceNewSubscriptionPackagePrice, - ReplacePricePriceNewSubscriptionMatrixPrice, - ReplacePricePriceNewSubscriptionTieredPrice, - ReplacePricePriceNewSubscriptionTieredBpsPrice, - ReplacePricePriceNewSubscriptionBpsPrice, - ReplacePricePriceNewSubscriptionBulkBpsPrice, - ReplacePricePriceNewSubscriptionBulkPrice, - ReplacePricePriceNewSubscriptionThresholdTotalAmountPrice, - ReplacePricePriceNewSubscriptionTieredPackagePrice, - ReplacePricePriceNewSubscriptionTieredWithMinimumPrice, - ReplacePricePriceNewSubscriptionUnitWithPercentPrice, - ReplacePricePriceNewSubscriptionPackageWithAllocationPrice, - ReplacePricePriceNewSubscriptionTierWithProrationPrice, - ReplacePricePriceNewSubscriptionUnitWithProrationPrice, - ReplacePricePriceNewSubscriptionGroupedAllocationPrice, - ReplacePricePriceNewSubscriptionGroupedWithProratedMinimumPrice, - ReplacePricePriceNewSubscriptionBulkWithProrationPrice, -] - - -class ReplacePrice(TypedDict, total=False): - replaces_price_id: Required[str] - """The id of the price on the plan to replace in the subscription.""" - - allocation_price: Optional[ReplacePriceAllocationPrice] - """The definition of a new allocation price to create and add to the subscription.""" - - discounts: Optional[Iterable[ReplacePriceDiscount]] - """[DEPRECATED] Use add_adjustments instead. - - The subscription's discounts for the replacement price. - """ - - external_price_id: Optional[str] - """The external price id of the price to add to the subscription.""" - - fixed_price_quantity: Optional[float] - """The new quantity of the price, if the price is a fixed price.""" - - maximum_amount: Optional[str] - """[DEPRECATED] Use add_adjustments instead. - - The subscription's maximum amount for the replacement price. - """ - - minimum_amount: Optional[str] - """[DEPRECATED] Use add_adjustments instead. - - The subscription's minimum amount for the replacement price. - """ - - price: Optional[ReplacePricePrice] - """The definition of a new price to create and add to the subscription.""" - - price_id: Optional[str] - """The id of the price to add to the subscription.""" diff --git a/src/orb/types/subscription_create_response.py b/src/orb/types/subscription_create_response.py deleted file mode 100644 index 5a494c5f..00000000 --- a/src/orb/types/subscription_create_response.py +++ /dev/null @@ -1,555 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List, Union, Optional -from datetime import datetime -from typing_extensions import Literal, Annotated, TypeAlias - -from .plan import Plan -from .price import Price -from .._utils import PropertyInfo -from .._models import BaseModel -from .customer import Customer - -__all__ = [ - "SubscriptionCreateResponse", - "AdjustmentInterval", - "AdjustmentIntervalAdjustment", - "AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment", - "AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment", - "AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment", - "AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment", - "AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment", - "BillingCycleAnchorConfiguration", - "DiscountInterval", - "DiscountIntervalAmountDiscountInterval", - "DiscountIntervalPercentageDiscountInterval", - "DiscountIntervalUsageDiscountInterval", - "FixedFeeQuantitySchedule", - "MaximumInterval", - "MinimumInterval", - "PriceInterval", - "PriceIntervalFixedFeeQuantityTransition", - "RedeemedCoupon", - "TrialInfo", -] - - -class AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment(BaseModel): - id: str - - adjustment_type: Literal["usage_discount"] - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - usage_discount: float - """ - The number of usage units by which to discount the price this adjustment applies - to in a given billing period. - """ - - -class AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment(BaseModel): - id: str - - adjustment_type: Literal["amount_discount"] - - amount_discount: str - """ - The amount by which to discount the prices this adjustment applies to in a given - billing period. - """ - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -class AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment(BaseModel): - id: str - - adjustment_type: Literal["percentage_discount"] - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - percentage_discount: float - """ - The percentage (as a value between 0 and 1) by which to discount the price - intervals this adjustment applies to in a given billing period. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -class AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment(BaseModel): - id: str - - adjustment_type: Literal["minimum"] - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - item_id: str - """The item ID that revenue from this minimum will be attributed to.""" - - minimum_amount: str - """ - The minimum amount to charge in a given billing period for the prices this - adjustment applies to. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -class AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment(BaseModel): - id: str - - adjustment_type: Literal["maximum"] - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - maximum_amount: str - """ - The maximum amount to charge in a given billing period for the prices this - adjustment applies to. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -AdjustmentIntervalAdjustment: TypeAlias = Annotated[ - Union[ - AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment, - AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment, - AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment, - AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment, - AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment, - ], - PropertyInfo(discriminator="adjustment_type"), -] - - -class AdjustmentInterval(BaseModel): - id: str - - adjustment: AdjustmentIntervalAdjustment - - applies_to_price_interval_ids: List[str] - """The price interval IDs that this adjustment applies to.""" - - end_date: Optional[datetime] = None - """The end date of the adjustment interval.""" - - start_date: datetime - """The start date of the adjustment interval.""" - - -class BillingCycleAnchorConfiguration(BaseModel): - day: int - """The day of the month on which the billing cycle is anchored. - - If the maximum number of days in a month is greater than this value, the last - day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April - means the billing period begins on the 30th. - """ - - month: Optional[int] = None - """The month on which the billing cycle is anchored (e.g. - - a quarterly price anchored in February would have cycles starting February, May, - August, and November). - """ - - year: Optional[int] = None - """The year on which the billing cycle is anchored (e.g. - - a 2 year billing cycle anchored on 2021 would have cycles starting on 2021, - 2023, 2025, etc.). - """ - - -class DiscountIntervalAmountDiscountInterval(BaseModel): - amount_discount: str - """Only available if discount_type is `amount`.""" - - applies_to_price_ids: List[str] - """The price ids that this discount interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this discount interval applies to.""" - - discount_type: Literal["amount"] - - end_date: Optional[datetime] = None - """The end date of the discount interval.""" - - start_date: datetime - """The start date of the discount interval.""" - - -class DiscountIntervalPercentageDiscountInterval(BaseModel): - applies_to_price_ids: List[str] - """The price ids that this discount interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this discount interval applies to.""" - - discount_type: Literal["percentage"] - - end_date: Optional[datetime] = None - """The end date of the discount interval.""" - - percentage_discount: float - """ - Only available if discount_type is `percentage`.This is a number between 0 - and 1. - """ - - start_date: datetime - """The start date of the discount interval.""" - - -class DiscountIntervalUsageDiscountInterval(BaseModel): - applies_to_price_ids: List[str] - """The price ids that this discount interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this discount interval applies to.""" - - discount_type: Literal["usage"] - - end_date: Optional[datetime] = None - """The end date of the discount interval.""" - - start_date: datetime - """The start date of the discount interval.""" - - usage_discount: float - """Only available if discount_type is `usage`. - - Number of usage units that this discount is for - """ - - -DiscountInterval: TypeAlias = Annotated[ - Union[ - DiscountIntervalAmountDiscountInterval, - DiscountIntervalPercentageDiscountInterval, - DiscountIntervalUsageDiscountInterval, - ], - PropertyInfo(discriminator="discount_type"), -] - - -class FixedFeeQuantitySchedule(BaseModel): - end_date: Optional[datetime] = None - - price_id: str - - quantity: float - - start_date: datetime - - -class MaximumInterval(BaseModel): - applies_to_price_ids: List[str] - """The price ids that this maximum interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this maximum interval applies to.""" - - end_date: Optional[datetime] = None - """The end date of the maximum interval.""" - - maximum_amount: str - """ - The maximum amount to charge in a given billing period for the price intervals - this transform applies to. - """ - - start_date: datetime - """The start date of the maximum interval.""" - - -class MinimumInterval(BaseModel): - applies_to_price_ids: List[str] - """The price ids that this minimum interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this minimum interval applies to.""" - - end_date: Optional[datetime] = None - """The end date of the minimum interval.""" - - minimum_amount: str - """ - The minimum amount to charge in a given billing period for the price intervals - this minimum applies to. - """ - - start_date: datetime - """The start date of the minimum interval.""" - - -class PriceIntervalFixedFeeQuantityTransition(BaseModel): - effective_date: datetime - - price_id: str - - quantity: int - - -class PriceInterval(BaseModel): - id: str - - billing_cycle_day: int - """The day of the month that Orb bills for this price""" - - current_billing_period_end_date: Optional[datetime] = None - """The end of the current billing period. - - This is an exclusive timestamp, such that the instant returned is exactly the - end of the billing period. Set to null if this price interval is not currently - active. - """ - - current_billing_period_start_date: Optional[datetime] = None - """The start date of the current billing period. - - This is an inclusive timestamp; the instant returned is exactly the beginning of - the billing period. Set to null if this price interval is not currently active. - """ - - end_date: Optional[datetime] = None - """The end date of the price interval. - - This is the date that Orb stops billing for this price. - """ - - filter: Optional[str] = None - """An additional filter to apply to usage queries.""" - - fixed_fee_quantity_transitions: Optional[List[PriceIntervalFixedFeeQuantityTransition]] = None - """The fixed fee quantity transitions for this price interval. - - This is only relevant for fixed fees. - """ - - price: Price - """ - The Price resource represents a price that can be billed on a subscription, - resulting in a charge on an invoice in the form of an invoice line item. Prices - take a quantity and determine an amount to bill. - - Orb supports a few different pricing models out of the box. Each of these models - is serialized differently in a given Price object. The model_type field - determines the key for the configuration object that is present. - - For more on the types of prices, see - [the core concepts documentation](/core-concepts#plan-and-price) - """ - - start_date: datetime - """The start date of the price interval. - - This is the date that Orb starts billing for this price. - """ - - usage_customer_ids: Optional[List[str]] = None - """ - A list of customer IDs whose usage events will be aggregated and billed under - this price interval. - """ - - -class RedeemedCoupon(BaseModel): - coupon_id: str - - end_date: Optional[datetime] = None - - start_date: datetime - - -class TrialInfo(BaseModel): - end_date: Optional[datetime] = None - - -class SubscriptionCreateResponse(BaseModel): - id: str - - active_plan_phase_order: Optional[int] = None - """ - The current plan phase that is active, only if the subscription's plan has - phases. - """ - - adjustment_intervals: List[AdjustmentInterval] - """The adjustment intervals for this subscription.""" - - auto_collection: Optional[bool] = None - """ - Determines whether issued invoices for this subscription will automatically be - charged with the saved payment method on the due date. This property defaults to - the plan's behavior. If null, defaults to the customer's setting. - """ - - billing_cycle_anchor_configuration: BillingCycleAnchorConfiguration - - billing_cycle_day: int - """The day of the month on which the billing cycle is anchored. - - If the maximum number of days in a month is greater than this value, the last - day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April - means the billing period begins on the 30th. - """ - - created_at: datetime - - current_billing_period_end_date: Optional[datetime] = None - """The end of the current billing period. - - This is an exclusive timestamp, such that the instant returned is not part of - the billing period. Set to null for subscriptions that are not currently active. - """ - - current_billing_period_start_date: Optional[datetime] = None - """The start date of the current billing period. - - This is an inclusive timestamp; the instant returned is exactly the beginning of - the billing period. Set to null if the subscription is not currently active. - """ - - customer: Customer - """ - A customer is a buyer of your products, and the other party to the billing - relationship. - - In Orb, customers are assigned system generated identifiers automatically, but - it's often desirable to have these match existing identifiers in your system. To - avoid having to denormalize Orb ID information, you can pass in an - `external_customer_id` with your own identifier. See - [Customer ID Aliases](/events-and-metrics/customer-aliases) for further - information about how these aliases work in Orb. - - In addition to having an identifier in your system, a customer may exist in a - payment provider solution like Stripe. Use the `payment_provider_id` and the - `payment_provider` enum field to express this mapping. - - A customer also has a timezone (from the standard - [IANA timezone database](https://www.iana.org/time-zones)), which defaults to - your account's timezone. See [Timezone localization](/essentials/timezones) for - information on what this timezone parameter influences within Orb. - """ - - default_invoice_memo: Optional[str] = None - """Determines the default memo on this subscriptions' invoices. - - Note that if this is not provided, it is determined by the plan configuration. - """ - - discount_intervals: List[DiscountInterval] - """The discount intervals for this subscription.""" - - end_date: Optional[datetime] = None - """The date Orb stops billing for this subscription.""" - - fixed_fee_quantity_schedule: List[FixedFeeQuantitySchedule] - - invoicing_threshold: Optional[str] = None - - maximum_intervals: List[MaximumInterval] - """The maximum intervals for this subscription.""" - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum_intervals: List[MinimumInterval] - """The minimum intervals for this subscription.""" - - net_terms: int - """ - Determines the difference between the invoice issue date for subscription - invoices as the date that they are due. A value of `0` here represents that the - invoice is due on issue, whereas a value of `30` represents that the customer - has a month to pay the invoice. - """ - - plan: Plan - """ - The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be - subscribed to by a customer. Plans define the billing behavior of the - subscription. You can see more about how to configure prices in the - [Price resource](/reference/price). - """ - - price_intervals: List[PriceInterval] - """The price intervals for this subscription.""" - - redeemed_coupon: Optional[RedeemedCoupon] = None - - start_date: datetime - """The date Orb starts billing for this subscription.""" - - status: Literal["active", "ended", "upcoming"] - - trial_info: TrialInfo diff --git a/src/orb/types/subscription_fetch_costs_response.py b/src/orb/types/subscription_fetch_costs_response.py index 64d9c0be..9aec8dc3 100644 --- a/src/orb/types/subscription_fetch_costs_response.py +++ b/src/orb/types/subscription_fetch_costs_response.py @@ -1,44 +1,12 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional -from datetime import datetime +from typing import List -from .price import Price from .._models import BaseModel +from .shared.aggregated_cost_model import AggregatedCostModel -__all__ = ["SubscriptionFetchCostsResponse", "Data", "DataPerPriceCost"] - - -class DataPerPriceCost(BaseModel): - price: Price - """The price object""" - - price_id: str - """The price the cost is associated with""" - - subtotal: str - """Price's contributions for the timeframe, excluding any minimums and discounts.""" - - total: str - """Price's contributions for the timeframe, including minimums and discounts.""" - - quantity: Optional[float] = None - """The price's quantity for the timeframe""" - - -class Data(BaseModel): - per_price_costs: List[DataPerPriceCost] - - subtotal: str - """Total costs for the timeframe, excluding any minimums and discounts.""" - - timeframe_end: datetime - - timeframe_start: datetime - - total: str - """Total costs for the timeframe, including any minimums and discounts.""" +__all__ = ["SubscriptionFetchCostsResponse"] class SubscriptionFetchCostsResponse(BaseModel): - data: List[Data] + data: List[AggregatedCostModel] diff --git a/src/orb/types/subscription_fetch_schedule_response.py b/src/orb/types/subscription_fetch_schedule_response.py index 38a3999c..7b82a9dd 100644 --- a/src/orb/types/subscription_fetch_schedule_response.py +++ b/src/orb/types/subscription_fetch_schedule_response.py @@ -4,21 +4,9 @@ from datetime import datetime from .._models import BaseModel +from .shared.plan_minified_model import PlanMinifiedModel -__all__ = ["SubscriptionFetchScheduleResponse", "Plan"] - - -class Plan(BaseModel): - id: Optional[str] = None - - external_plan_id: Optional[str] = None - """ - An optional user-defined ID for this plan resource, used throughout the system - as an alias for this Plan. Use this field to identify a plan by an existing - identifier in your system. - """ - - name: Optional[str] = None +__all__ = ["SubscriptionFetchScheduleResponse"] class SubscriptionFetchScheduleResponse(BaseModel): @@ -26,6 +14,6 @@ class SubscriptionFetchScheduleResponse(BaseModel): end_date: Optional[datetime] = None - plan: Plan + plan: PlanMinifiedModel start_date: datetime diff --git a/src/orb/types/subscription_price_intervals_params.py b/src/orb/types/subscription_price_intervals_params.py index 0ae10958..c9a7ad70 100644 --- a/src/orb/types/subscription_price_intervals_params.py +++ b/src/orb/types/subscription_price_intervals_params.py @@ -2,131 +2,28 @@ from __future__ import annotations -from typing import Dict, List, Union, Iterable, Optional +from typing import List, Union, Iterable, Optional from datetime import datetime from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict from .._utils import PropertyInfo from .shared.billing_cycle_relative_date import BillingCycleRelativeDate +from .shared_params.new_adjustment_model import NewAdjustmentModel +from .shared_params.new_floating_price_model import NewFloatingPriceModel +from .shared_params.new_allocation_price_model import NewAllocationPriceModel +from .shared_params.price_interval_fixed_fee_quantity_transition_model import ( + PriceIntervalFixedFeeQuantityTransitionModel, +) __all__ = [ "SubscriptionPriceIntervalsParams", "Add", - "AddAllocationPrice", "AddDiscount", "AddDiscountAmountDiscountCreationParams", "AddDiscountPercentageDiscountCreationParams", "AddDiscountUsageDiscountCreationParams", - "AddFixedFeeQuantityTransition", - "AddPrice", - "AddPriceNewFloatingUnitPrice", - "AddPriceNewFloatingUnitPriceUnitConfig", - "AddPriceNewFloatingUnitPriceBillingCycleConfiguration", - "AddPriceNewFloatingUnitPriceInvoicingCycleConfiguration", - "AddPriceNewFloatingPackagePrice", - "AddPriceNewFloatingPackagePricePackageConfig", - "AddPriceNewFloatingPackagePriceBillingCycleConfiguration", - "AddPriceNewFloatingPackagePriceInvoicingCycleConfiguration", - "AddPriceNewFloatingMatrixPrice", - "AddPriceNewFloatingMatrixPriceMatrixConfig", - "AddPriceNewFloatingMatrixPriceMatrixConfigMatrixValue", - "AddPriceNewFloatingMatrixPriceBillingCycleConfiguration", - "AddPriceNewFloatingMatrixPriceInvoicingCycleConfiguration", - "AddPriceNewFloatingMatrixWithAllocationPrice", - "AddPriceNewFloatingMatrixWithAllocationPriceMatrixWithAllocationConfig", - "AddPriceNewFloatingMatrixWithAllocationPriceMatrixWithAllocationConfigMatrixValue", - "AddPriceNewFloatingMatrixWithAllocationPriceBillingCycleConfiguration", - "AddPriceNewFloatingMatrixWithAllocationPriceInvoicingCycleConfiguration", - "AddPriceNewFloatingTieredPrice", - "AddPriceNewFloatingTieredPriceTieredConfig", - "AddPriceNewFloatingTieredPriceTieredConfigTier", - "AddPriceNewFloatingTieredPriceBillingCycleConfiguration", - "AddPriceNewFloatingTieredPriceInvoicingCycleConfiguration", - "AddPriceNewFloatingTieredBpsPrice", - "AddPriceNewFloatingTieredBpsPriceTieredBpsConfig", - "AddPriceNewFloatingTieredBpsPriceTieredBpsConfigTier", - "AddPriceNewFloatingTieredBpsPriceBillingCycleConfiguration", - "AddPriceNewFloatingTieredBpsPriceInvoicingCycleConfiguration", - "AddPriceNewFloatingBpsPrice", - "AddPriceNewFloatingBpsPriceBpsConfig", - "AddPriceNewFloatingBpsPriceBillingCycleConfiguration", - "AddPriceNewFloatingBpsPriceInvoicingCycleConfiguration", - "AddPriceNewFloatingBulkBpsPrice", - "AddPriceNewFloatingBulkBpsPriceBulkBpsConfig", - "AddPriceNewFloatingBulkBpsPriceBulkBpsConfigTier", - "AddPriceNewFloatingBulkBpsPriceBillingCycleConfiguration", - "AddPriceNewFloatingBulkBpsPriceInvoicingCycleConfiguration", - "AddPriceNewFloatingBulkPrice", - "AddPriceNewFloatingBulkPriceBulkConfig", - "AddPriceNewFloatingBulkPriceBulkConfigTier", - "AddPriceNewFloatingBulkPriceBillingCycleConfiguration", - "AddPriceNewFloatingBulkPriceInvoicingCycleConfiguration", - "AddPriceNewFloatingThresholdTotalAmountPrice", - "AddPriceNewFloatingThresholdTotalAmountPriceBillingCycleConfiguration", - "AddPriceNewFloatingThresholdTotalAmountPriceInvoicingCycleConfiguration", - "AddPriceNewFloatingTieredPackagePrice", - "AddPriceNewFloatingTieredPackagePriceBillingCycleConfiguration", - "AddPriceNewFloatingTieredPackagePriceInvoicingCycleConfiguration", - "AddPriceNewFloatingGroupedTieredPrice", - "AddPriceNewFloatingGroupedTieredPriceBillingCycleConfiguration", - "AddPriceNewFloatingGroupedTieredPriceInvoicingCycleConfiguration", - "AddPriceNewFloatingMaxGroupTieredPackagePrice", - "AddPriceNewFloatingMaxGroupTieredPackagePriceBillingCycleConfiguration", - "AddPriceNewFloatingMaxGroupTieredPackagePriceInvoicingCycleConfiguration", - "AddPriceNewFloatingTieredWithMinimumPrice", - "AddPriceNewFloatingTieredWithMinimumPriceBillingCycleConfiguration", - "AddPriceNewFloatingTieredWithMinimumPriceInvoicingCycleConfiguration", - "AddPriceNewFloatingPackageWithAllocationPrice", - "AddPriceNewFloatingPackageWithAllocationPriceBillingCycleConfiguration", - "AddPriceNewFloatingPackageWithAllocationPriceInvoicingCycleConfiguration", - "AddPriceNewFloatingTieredPackageWithMinimumPrice", - "AddPriceNewFloatingTieredPackageWithMinimumPriceBillingCycleConfiguration", - "AddPriceNewFloatingTieredPackageWithMinimumPriceInvoicingCycleConfiguration", - "AddPriceNewFloatingUnitWithPercentPrice", - "AddPriceNewFloatingUnitWithPercentPriceBillingCycleConfiguration", - "AddPriceNewFloatingUnitWithPercentPriceInvoicingCycleConfiguration", - "AddPriceNewFloatingTieredWithProrationPrice", - "AddPriceNewFloatingTieredWithProrationPriceBillingCycleConfiguration", - "AddPriceNewFloatingTieredWithProrationPriceInvoicingCycleConfiguration", - "AddPriceNewFloatingUnitWithProrationPrice", - "AddPriceNewFloatingUnitWithProrationPriceBillingCycleConfiguration", - "AddPriceNewFloatingUnitWithProrationPriceInvoicingCycleConfiguration", - "AddPriceNewFloatingGroupedAllocationPrice", - "AddPriceNewFloatingGroupedAllocationPriceBillingCycleConfiguration", - "AddPriceNewFloatingGroupedAllocationPriceInvoicingCycleConfiguration", - "AddPriceNewFloatingGroupedWithProratedMinimumPrice", - "AddPriceNewFloatingGroupedWithProratedMinimumPriceBillingCycleConfiguration", - "AddPriceNewFloatingGroupedWithProratedMinimumPriceInvoicingCycleConfiguration", - "AddPriceNewFloatingGroupedWithMeteredMinimumPrice", - "AddPriceNewFloatingGroupedWithMeteredMinimumPriceBillingCycleConfiguration", - "AddPriceNewFloatingGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration", - "AddPriceNewFloatingMatrixWithDisplayNamePrice", - "AddPriceNewFloatingMatrixWithDisplayNamePriceBillingCycleConfiguration", - "AddPriceNewFloatingMatrixWithDisplayNamePriceInvoicingCycleConfiguration", - "AddPriceNewFloatingBulkWithProrationPrice", - "AddPriceNewFloatingBulkWithProrationPriceBillingCycleConfiguration", - "AddPriceNewFloatingBulkWithProrationPriceInvoicingCycleConfiguration", - "AddPriceNewFloatingGroupedTieredPackagePrice", - "AddPriceNewFloatingGroupedTieredPackagePriceBillingCycleConfiguration", - "AddPriceNewFloatingGroupedTieredPackagePriceInvoicingCycleConfiguration", - "AddPriceNewFloatingScalableMatrixWithUnitPricingPrice", - "AddPriceNewFloatingScalableMatrixWithUnitPricingPriceBillingCycleConfiguration", - "AddPriceNewFloatingScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration", - "AddPriceNewFloatingScalableMatrixWithTieredPricingPrice", - "AddPriceNewFloatingScalableMatrixWithTieredPricingPriceBillingCycleConfiguration", - "AddPriceNewFloatingScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration", - "AddPriceNewFloatingCumulativeGroupedBulkPrice", - "AddPriceNewFloatingCumulativeGroupedBulkPriceBillingCycleConfiguration", - "AddPriceNewFloatingCumulativeGroupedBulkPriceInvoicingCycleConfiguration", "AddAdjustment", - "AddAdjustmentAdjustment", - "AddAdjustmentAdjustmentNewPercentageDiscount", - "AddAdjustmentAdjustmentNewUsageDiscount", - "AddAdjustmentAdjustmentNewAmountDiscount", - "AddAdjustmentAdjustmentNewMinimum", - "AddAdjustmentAdjustmentNewMaximum", "Edit", - "EditFixedFeeQuantityTransition", "EditAdjustment", ] @@ -152,2493 +49,37 @@ class SubscriptionPriceIntervalsParams(TypedDict, total=False): """A list of adjustments to edit on the subscription.""" -class AddAllocationPrice(TypedDict, total=False): - amount: Required[str] - """An amount of the currency to allocate to the customer at the specified cadence.""" - - cadence: Required[Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"]] - """The cadence at which to allocate the amount to the customer.""" - - currency: Required[str] - """ - An ISO 4217 currency string or a custom pricing unit identifier in which to bill - this price. - """ - - expires_at_end_of_cadence: Required[bool] - """ - Whether the allocated amount should expire at the end of the cadence or roll - over to the next period. - """ - - -class AddDiscountAmountDiscountCreationParams(TypedDict, total=False): - amount_discount: Required[float] - """Only available if discount_type is `amount`.""" - - discount_type: Required[Literal["amount"]] - - -class AddDiscountPercentageDiscountCreationParams(TypedDict, total=False): - discount_type: Required[Literal["percentage"]] - - percentage_discount: Required[float] - """Only available if discount_type is `percentage`. - - This is a number between 0 and 1. - """ - - -class AddDiscountUsageDiscountCreationParams(TypedDict, total=False): - discount_type: Required[Literal["usage"]] - - usage_discount: Required[float] - """Only available if discount_type is `usage`. - - Number of usage units that this discount is for. - """ - - -AddDiscount: TypeAlias = Union[ - AddDiscountAmountDiscountCreationParams, - AddDiscountPercentageDiscountCreationParams, - AddDiscountUsageDiscountCreationParams, -] - - -class AddFixedFeeQuantityTransition(TypedDict, total=False): - effective_date: Required[Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]] - """The date that the fixed fee quantity transition should take effect.""" - - quantity: Required[int] - """The quantity of the fixed fee quantity transition.""" - - -class AddPriceNewFloatingUnitPriceUnitConfig(TypedDict, total=False): - unit_amount: Required[str] - """Rate per unit of usage""" - - -class AddPriceNewFloatingUnitPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingUnitPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingUnitPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["unit"]] - - name: Required[str] - """The name of the price.""" - - unit_config: Required[AddPriceNewFloatingUnitPriceUnitConfig] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPriceNewFloatingUnitPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[AddPriceNewFloatingUnitPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class AddPriceNewFloatingPackagePricePackageConfig(TypedDict, total=False): - package_amount: Required[str] - """A currency amount to rate usage by""" - - package_size: Required[int] - """An integer amount to represent package size. - - For example, 1000 here would divide usage by 1000 before multiplying by - package_amount in rating - """ - - -class AddPriceNewFloatingPackagePriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingPackagePrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["package"]] - - name: Required[str] - """The name of the price.""" - - package_config: Required[AddPriceNewFloatingPackagePricePackageConfig] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPriceNewFloatingPackagePriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[AddPriceNewFloatingPackagePriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class AddPriceNewFloatingMatrixPriceMatrixConfigMatrixValue(TypedDict, total=False): - dimension_values: Required[List[Optional[str]]] - """One or two matrix keys to filter usage to this Matrix value by. - - For example, ["region", "tier"] could be used to filter cloud usage by a cloud - region and an instance tier. - """ - - unit_amount: Required[str] - """Unit price for the specified dimension_values""" - - -class AddPriceNewFloatingMatrixPriceMatrixConfig(TypedDict, total=False): - default_unit_amount: Required[str] - """Default per unit rate for any usage not bucketed into a specified matrix_value""" - - dimensions: Required[List[Optional[str]]] - """One or two event property values to evaluate matrix groups by""" - - matrix_values: Required[Iterable[AddPriceNewFloatingMatrixPriceMatrixConfigMatrixValue]] - """Matrix values for specified matrix grouping keys""" - - -class AddPriceNewFloatingMatrixPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingMatrixPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingMatrixPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - matrix_config: Required[AddPriceNewFloatingMatrixPriceMatrixConfig] - - model_type: Required[Literal["matrix"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPriceNewFloatingMatrixPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[AddPriceNewFloatingMatrixPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class AddPriceNewFloatingMatrixWithAllocationPriceMatrixWithAllocationConfigMatrixValue(TypedDict, total=False): - dimension_values: Required[List[Optional[str]]] - """One or two matrix keys to filter usage to this Matrix value by. - - For example, ["region", "tier"] could be used to filter cloud usage by a cloud - region and an instance tier. - """ - - unit_amount: Required[str] - """Unit price for the specified dimension_values""" - - -class AddPriceNewFloatingMatrixWithAllocationPriceMatrixWithAllocationConfig(TypedDict, total=False): - allocation: Required[float] - """Allocation to be used to calculate the price""" - - default_unit_amount: Required[str] - """Default per unit rate for any usage not bucketed into a specified matrix_value""" - - dimensions: Required[List[Optional[str]]] - """One or two event property values to evaluate matrix groups by""" - - matrix_values: Required[Iterable[AddPriceNewFloatingMatrixWithAllocationPriceMatrixWithAllocationConfigMatrixValue]] - """Matrix values for specified matrix grouping keys""" - - -class AddPriceNewFloatingMatrixWithAllocationPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingMatrixWithAllocationPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingMatrixWithAllocationPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - matrix_with_allocation_config: Required[AddPriceNewFloatingMatrixWithAllocationPriceMatrixWithAllocationConfig] - - model_type: Required[Literal["matrix_with_allocation"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPriceNewFloatingMatrixWithAllocationPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[AddPriceNewFloatingMatrixWithAllocationPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class AddPriceNewFloatingTieredPriceTieredConfigTier(TypedDict, total=False): - first_unit: Required[float] - """Inclusive tier starting value""" - - unit_amount: Required[str] - """Amount per unit""" - - last_unit: Optional[float] - """Exclusive tier ending value. If null, this is treated as the last tier""" - - -class AddPriceNewFloatingTieredPriceTieredConfig(TypedDict, total=False): - tiers: Required[Iterable[AddPriceNewFloatingTieredPriceTieredConfigTier]] - """Tiers for rating based on total usage quantities into the specified tier""" - - -class AddPriceNewFloatingTieredPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingTieredPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingTieredPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["tiered"]] - - name: Required[str] - """The name of the price.""" - - tiered_config: Required[AddPriceNewFloatingTieredPriceTieredConfig] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPriceNewFloatingTieredPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[AddPriceNewFloatingTieredPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class AddPriceNewFloatingTieredBpsPriceTieredBpsConfigTier(TypedDict, total=False): - bps: Required[float] - """Per-event basis point rate""" - - minimum_amount: Required[str] - """Inclusive tier starting value""" - - maximum_amount: Optional[str] - """Exclusive tier ending value""" - - per_unit_maximum: Optional[str] - """Per unit maximum to charge""" - - -class AddPriceNewFloatingTieredBpsPriceTieredBpsConfig(TypedDict, total=False): - tiers: Required[Iterable[AddPriceNewFloatingTieredBpsPriceTieredBpsConfigTier]] - """ - Tiers for a Graduated BPS pricing model, where usage is bucketed into specified - tiers - """ - - -class AddPriceNewFloatingTieredBpsPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingTieredBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingTieredBpsPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["tiered_bps"]] - - name: Required[str] - """The name of the price.""" - - tiered_bps_config: Required[AddPriceNewFloatingTieredBpsPriceTieredBpsConfig] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPriceNewFloatingTieredBpsPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[AddPriceNewFloatingTieredBpsPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class AddPriceNewFloatingBpsPriceBpsConfig(TypedDict, total=False): - bps: Required[float] - """Basis point take rate per event""" - - per_unit_maximum: Optional[str] - """Optional currency amount maximum to cap spend per event""" - - -class AddPriceNewFloatingBpsPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingBpsPrice(TypedDict, total=False): - bps_config: Required[AddPriceNewFloatingBpsPriceBpsConfig] - - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["bps"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPriceNewFloatingBpsPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[AddPriceNewFloatingBpsPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class AddPriceNewFloatingBulkBpsPriceBulkBpsConfigTier(TypedDict, total=False): - bps: Required[float] - """Basis points to rate on""" - - maximum_amount: Optional[str] - """Upper bound for tier""" - - per_unit_maximum: Optional[str] - """The maximum amount to charge for any one event""" - - -class AddPriceNewFloatingBulkBpsPriceBulkBpsConfig(TypedDict, total=False): - tiers: Required[Iterable[AddPriceNewFloatingBulkBpsPriceBulkBpsConfigTier]] - """ - Tiers for a bulk BPS pricing model where all usage is aggregated to a single - tier based on total volume - """ - - -class AddPriceNewFloatingBulkBpsPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingBulkBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingBulkBpsPrice(TypedDict, total=False): - bulk_bps_config: Required[AddPriceNewFloatingBulkBpsPriceBulkBpsConfig] - - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["bulk_bps"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPriceNewFloatingBulkBpsPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[AddPriceNewFloatingBulkBpsPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class AddPriceNewFloatingBulkPriceBulkConfigTier(TypedDict, total=False): - unit_amount: Required[str] - """Amount per unit""" - - maximum_units: Optional[float] - """Upper bound for this tier""" - - -class AddPriceNewFloatingBulkPriceBulkConfig(TypedDict, total=False): - tiers: Required[Iterable[AddPriceNewFloatingBulkPriceBulkConfigTier]] - """Bulk tiers for rating based on total usage volume""" - - -class AddPriceNewFloatingBulkPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingBulkPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingBulkPrice(TypedDict, total=False): - bulk_config: Required[AddPriceNewFloatingBulkPriceBulkConfig] - - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["bulk"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPriceNewFloatingBulkPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[AddPriceNewFloatingBulkPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class AddPriceNewFloatingThresholdTotalAmountPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingThresholdTotalAmountPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingThresholdTotalAmountPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["threshold_total_amount"]] - - name: Required[str] - """The name of the price.""" - - threshold_total_amount_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPriceNewFloatingThresholdTotalAmountPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[AddPriceNewFloatingThresholdTotalAmountPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class AddPriceNewFloatingTieredPackagePriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingTieredPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingTieredPackagePrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["tiered_package"]] - - name: Required[str] - """The name of the price.""" - - tiered_package_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPriceNewFloatingTieredPackagePriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[AddPriceNewFloatingTieredPackagePriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class AddPriceNewFloatingGroupedTieredPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingGroupedTieredPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingGroupedTieredPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - grouped_tiered_config: Required[Dict[str, object]] - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["grouped_tiered"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPriceNewFloatingGroupedTieredPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[AddPriceNewFloatingGroupedTieredPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class AddPriceNewFloatingMaxGroupTieredPackagePriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingMaxGroupTieredPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingMaxGroupTieredPackagePrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - max_group_tiered_package_config: Required[Dict[str, object]] - - model_type: Required[Literal["max_group_tiered_package"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPriceNewFloatingMaxGroupTieredPackagePriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[AddPriceNewFloatingMaxGroupTieredPackagePriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class AddPriceNewFloatingTieredWithMinimumPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingTieredWithMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingTieredWithMinimumPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["tiered_with_minimum"]] - - name: Required[str] - """The name of the price.""" - - tiered_with_minimum_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPriceNewFloatingTieredWithMinimumPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[AddPriceNewFloatingTieredWithMinimumPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class AddPriceNewFloatingPackageWithAllocationPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingPackageWithAllocationPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingPackageWithAllocationPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["package_with_allocation"]] - - name: Required[str] - """The name of the price.""" - - package_with_allocation_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPriceNewFloatingPackageWithAllocationPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[AddPriceNewFloatingPackageWithAllocationPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class AddPriceNewFloatingTieredPackageWithMinimumPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingTieredPackageWithMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingTieredPackageWithMinimumPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["tiered_package_with_minimum"]] - - name: Required[str] - """The name of the price.""" - - tiered_package_with_minimum_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPriceNewFloatingTieredPackageWithMinimumPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[AddPriceNewFloatingTieredPackageWithMinimumPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class AddPriceNewFloatingUnitWithPercentPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingUnitWithPercentPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingUnitWithPercentPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["unit_with_percent"]] - - name: Required[str] - """The name of the price.""" - - unit_with_percent_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPriceNewFloatingUnitWithPercentPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[AddPriceNewFloatingUnitWithPercentPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class AddPriceNewFloatingTieredWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingTieredWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingTieredWithProrationPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["tiered_with_proration"]] - - name: Required[str] - """The name of the price.""" - - tiered_with_proration_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPriceNewFloatingTieredWithProrationPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[AddPriceNewFloatingTieredWithProrationPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class AddPriceNewFloatingUnitWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingUnitWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingUnitWithProrationPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["unit_with_proration"]] - - name: Required[str] - """The name of the price.""" - - unit_with_proration_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPriceNewFloatingUnitWithProrationPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[AddPriceNewFloatingUnitWithProrationPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class AddPriceNewFloatingGroupedAllocationPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingGroupedAllocationPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingGroupedAllocationPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - grouped_allocation_config: Required[Dict[str, object]] - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["grouped_allocation"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPriceNewFloatingGroupedAllocationPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[AddPriceNewFloatingGroupedAllocationPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class AddPriceNewFloatingGroupedWithProratedMinimumPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingGroupedWithProratedMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingGroupedWithProratedMinimumPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - grouped_with_prorated_minimum_config: Required[Dict[str, object]] - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["grouped_with_prorated_minimum"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPriceNewFloatingGroupedWithProratedMinimumPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - AddPriceNewFloatingGroupedWithProratedMinimumPriceInvoicingCycleConfiguration - ] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class AddPriceNewFloatingGroupedWithMeteredMinimumPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingGroupedWithMeteredMinimumPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - grouped_with_metered_minimum_config: Required[Dict[str, object]] - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["grouped_with_metered_minimum"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPriceNewFloatingGroupedWithMeteredMinimumPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - AddPriceNewFloatingGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration - ] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class AddPriceNewFloatingMatrixWithDisplayNamePriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingMatrixWithDisplayNamePriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingMatrixWithDisplayNamePrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - matrix_with_display_name_config: Required[Dict[str, object]] - - model_type: Required[Literal["matrix_with_display_name"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPriceNewFloatingMatrixWithDisplayNamePriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[AddPriceNewFloatingMatrixWithDisplayNamePriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class AddPriceNewFloatingBulkWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingBulkWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingBulkWithProrationPrice(TypedDict, total=False): - bulk_with_proration_config: Required[Dict[str, object]] - - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["bulk_with_proration"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPriceNewFloatingBulkWithProrationPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[AddPriceNewFloatingBulkWithProrationPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class AddPriceNewFloatingGroupedTieredPackagePriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingGroupedTieredPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingGroupedTieredPackagePrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - grouped_tiered_package_config: Required[Dict[str, object]] - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["grouped_tiered_package"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPriceNewFloatingGroupedTieredPackagePriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[AddPriceNewFloatingGroupedTieredPackagePriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class AddPriceNewFloatingScalableMatrixWithUnitPricingPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingScalableMatrixWithUnitPricingPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["scalable_matrix_with_unit_pricing"]] - - name: Required[str] - """The name of the price.""" - - scalable_matrix_with_unit_pricing_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ - AddPriceNewFloatingScalableMatrixWithUnitPricingPriceBillingCycleConfiguration - ] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - AddPriceNewFloatingScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration - ] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class AddPriceNewFloatingScalableMatrixWithTieredPricingPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingScalableMatrixWithTieredPricingPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["scalable_matrix_with_tiered_pricing"]] - - name: Required[str] - """The name of the price.""" - - scalable_matrix_with_tiered_pricing_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ - AddPriceNewFloatingScalableMatrixWithTieredPricingPriceBillingCycleConfiguration - ] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - AddPriceNewFloatingScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration - ] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class AddPriceNewFloatingCumulativeGroupedBulkPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingCumulativeGroupedBulkPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPriceNewFloatingCumulativeGroupedBulkPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - cumulative_grouped_bulk_config: Required[Dict[str, object]] - - currency: Required[str] - """An ISO 4217 currency string for which this price is billed in.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["cumulative_grouped_bulk"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ +class AddDiscountAmountDiscountCreationParams(TypedDict, total=False): + amount_discount: Required[float] + """Only available if discount_type is `amount`.""" - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ + discount_type: Required[Literal["amount"]] - billing_cycle_configuration: Optional[AddPriceNewFloatingCumulativeGroupedBulkPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" +class AddDiscountPercentageDiscountCreationParams(TypedDict, total=False): + discount_type: Required[Literal["percentage"]] - external_price_id: Optional[str] - """An alias for the price.""" + percentage_discount: Required[float] + """Only available if discount_type is `percentage`. - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. + This is a number between 0 and 1. """ - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[AddPriceNewFloatingCumulativeGroupedBulkPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - If unspecified, a single invoice is produced per billing cycle. - """ +class AddDiscountUsageDiscountCreationParams(TypedDict, total=False): + discount_type: Required[Literal["usage"]] - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. + usage_discount: Required[float] + """Only available if discount_type is `usage`. - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. + Number of usage units that this discount is for. """ -AddPrice: TypeAlias = Union[ - AddPriceNewFloatingUnitPrice, - AddPriceNewFloatingPackagePrice, - AddPriceNewFloatingMatrixPrice, - AddPriceNewFloatingMatrixWithAllocationPrice, - AddPriceNewFloatingTieredPrice, - AddPriceNewFloatingTieredBpsPrice, - AddPriceNewFloatingBpsPrice, - AddPriceNewFloatingBulkBpsPrice, - AddPriceNewFloatingBulkPrice, - AddPriceNewFloatingThresholdTotalAmountPrice, - AddPriceNewFloatingTieredPackagePrice, - AddPriceNewFloatingGroupedTieredPrice, - AddPriceNewFloatingMaxGroupTieredPackagePrice, - AddPriceNewFloatingTieredWithMinimumPrice, - AddPriceNewFloatingPackageWithAllocationPrice, - AddPriceNewFloatingTieredPackageWithMinimumPrice, - AddPriceNewFloatingUnitWithPercentPrice, - AddPriceNewFloatingTieredWithProrationPrice, - AddPriceNewFloatingUnitWithProrationPrice, - AddPriceNewFloatingGroupedAllocationPrice, - AddPriceNewFloatingGroupedWithProratedMinimumPrice, - AddPriceNewFloatingGroupedWithMeteredMinimumPrice, - AddPriceNewFloatingMatrixWithDisplayNamePrice, - AddPriceNewFloatingBulkWithProrationPrice, - AddPriceNewFloatingGroupedTieredPackagePrice, - AddPriceNewFloatingScalableMatrixWithUnitPricingPrice, - AddPriceNewFloatingScalableMatrixWithTieredPricingPrice, - AddPriceNewFloatingCumulativeGroupedBulkPrice, +AddDiscount: TypeAlias = Union[ + AddDiscountAmountDiscountCreationParams, + AddDiscountPercentageDiscountCreationParams, + AddDiscountUsageDiscountCreationParams, ] @@ -2651,7 +92,7 @@ class Add(TypedDict, total=False): This is the date that the price will start billing on the subscription. """ - allocation_price: Optional[AddAllocationPrice] + allocation_price: Optional[NewAllocationPriceModel] """The definition of a new allocation price to create and add to the subscription.""" discounts: Optional[Iterable[AddDiscount]] @@ -2674,7 +115,7 @@ class Add(TypedDict, total=False): null, usage queries will not include any additional filter. """ - fixed_fee_quantity_transitions: Optional[Iterable[AddFixedFeeQuantityTransition]] + fixed_fee_quantity_transitions: Optional[Iterable[PriceIntervalFixedFeeQuantityTransitionModel]] """A list of fixed fee quantity transitions to initialize on the price interval.""" maximum_amount: Optional[float] @@ -2689,7 +130,7 @@ class Add(TypedDict, total=False): billing period. """ - price: Optional[AddPrice] + price: Optional[NewFloatingPriceModel] """The definition of a new price to create and add to the subscription.""" price_id: Optional[str] @@ -2706,95 +147,8 @@ class Add(TypedDict, total=False): """ -class AddAdjustmentAdjustmentNewPercentageDiscount(TypedDict, total=False): - adjustment_type: Required[Literal["percentage_discount"]] - - applies_to_price_ids: Required[List[str]] - """The set of price IDs to which this adjustment applies.""" - - percentage_discount: Required[float] - - is_invoice_level: bool - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -class AddAdjustmentAdjustmentNewUsageDiscount(TypedDict, total=False): - adjustment_type: Required[Literal["usage_discount"]] - - applies_to_price_ids: Required[List[str]] - """The set of price IDs to which this adjustment applies.""" - - usage_discount: Required[float] - - is_invoice_level: bool - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -class AddAdjustmentAdjustmentNewAmountDiscount(TypedDict, total=False): - adjustment_type: Required[Literal["amount_discount"]] - - amount_discount: Required[str] - - applies_to_price_ids: Required[List[str]] - """The set of price IDs to which this adjustment applies.""" - - is_invoice_level: bool - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -class AddAdjustmentAdjustmentNewMinimum(TypedDict, total=False): - adjustment_type: Required[Literal["minimum"]] - - applies_to_price_ids: Required[List[str]] - """The set of price IDs to which this adjustment applies.""" - - item_id: Required[str] - """The item ID that revenue from this minimum will be attributed to.""" - - minimum_amount: Required[str] - - is_invoice_level: bool - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -class AddAdjustmentAdjustmentNewMaximum(TypedDict, total=False): - adjustment_type: Required[Literal["maximum"]] - - applies_to_price_ids: Required[List[str]] - """The set of price IDs to which this adjustment applies.""" - - maximum_amount: Required[str] - - is_invoice_level: bool - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -AddAdjustmentAdjustment: TypeAlias = Union[ - AddAdjustmentAdjustmentNewPercentageDiscount, - AddAdjustmentAdjustmentNewUsageDiscount, - AddAdjustmentAdjustmentNewAmountDiscount, - AddAdjustmentAdjustmentNewMinimum, - AddAdjustmentAdjustmentNewMaximum, -] - - class AddAdjustment(TypedDict, total=False): - adjustment: Required[AddAdjustmentAdjustment] + adjustment: Required[NewAdjustmentModel] """The definition of a new adjustment to create and add to the subscription.""" start_date: Required[ @@ -2814,14 +168,6 @@ class AddAdjustment(TypedDict, total=False): """ -class EditFixedFeeQuantityTransition(TypedDict, total=False): - effective_date: Required[Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]] - """The date that the fixed fee quantity transition should take effect.""" - - quantity: Required[int] - """The quantity of the fixed fee quantity transition.""" - - class Edit(TypedDict, total=False): price_interval_id: Required[str] """The id of the price interval to edit.""" @@ -2847,7 +193,7 @@ class Edit(TypedDict, total=False): null, usage queries will not include any additional filter. """ - fixed_fee_quantity_transitions: Optional[Iterable[EditFixedFeeQuantityTransition]] + fixed_fee_quantity_transitions: Optional[Iterable[PriceIntervalFixedFeeQuantityTransitionModel]] """A list of fixed fee quantity transitions to use for this price interval. Note that this list will overwrite all existing fixed fee quantity transitions diff --git a/src/orb/types/subscription_price_intervals_response.py b/src/orb/types/subscription_price_intervals_response.py deleted file mode 100644 index 0dc1d984..00000000 --- a/src/orb/types/subscription_price_intervals_response.py +++ /dev/null @@ -1,555 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List, Union, Optional -from datetime import datetime -from typing_extensions import Literal, Annotated, TypeAlias - -from .plan import Plan -from .price import Price -from .._utils import PropertyInfo -from .._models import BaseModel -from .customer import Customer - -__all__ = [ - "SubscriptionPriceIntervalsResponse", - "AdjustmentInterval", - "AdjustmentIntervalAdjustment", - "AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment", - "AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment", - "AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment", - "AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment", - "AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment", - "BillingCycleAnchorConfiguration", - "DiscountInterval", - "DiscountIntervalAmountDiscountInterval", - "DiscountIntervalPercentageDiscountInterval", - "DiscountIntervalUsageDiscountInterval", - "FixedFeeQuantitySchedule", - "MaximumInterval", - "MinimumInterval", - "PriceInterval", - "PriceIntervalFixedFeeQuantityTransition", - "RedeemedCoupon", - "TrialInfo", -] - - -class AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment(BaseModel): - id: str - - adjustment_type: Literal["usage_discount"] - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - usage_discount: float - """ - The number of usage units by which to discount the price this adjustment applies - to in a given billing period. - """ - - -class AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment(BaseModel): - id: str - - adjustment_type: Literal["amount_discount"] - - amount_discount: str - """ - The amount by which to discount the prices this adjustment applies to in a given - billing period. - """ - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -class AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment(BaseModel): - id: str - - adjustment_type: Literal["percentage_discount"] - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - percentage_discount: float - """ - The percentage (as a value between 0 and 1) by which to discount the price - intervals this adjustment applies to in a given billing period. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -class AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment(BaseModel): - id: str - - adjustment_type: Literal["minimum"] - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - item_id: str - """The item ID that revenue from this minimum will be attributed to.""" - - minimum_amount: str - """ - The minimum amount to charge in a given billing period for the prices this - adjustment applies to. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -class AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment(BaseModel): - id: str - - adjustment_type: Literal["maximum"] - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - maximum_amount: str - """ - The maximum amount to charge in a given billing period for the prices this - adjustment applies to. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -AdjustmentIntervalAdjustment: TypeAlias = Annotated[ - Union[ - AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment, - AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment, - AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment, - AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment, - AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment, - ], - PropertyInfo(discriminator="adjustment_type"), -] - - -class AdjustmentInterval(BaseModel): - id: str - - adjustment: AdjustmentIntervalAdjustment - - applies_to_price_interval_ids: List[str] - """The price interval IDs that this adjustment applies to.""" - - end_date: Optional[datetime] = None - """The end date of the adjustment interval.""" - - start_date: datetime - """The start date of the adjustment interval.""" - - -class BillingCycleAnchorConfiguration(BaseModel): - day: int - """The day of the month on which the billing cycle is anchored. - - If the maximum number of days in a month is greater than this value, the last - day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April - means the billing period begins on the 30th. - """ - - month: Optional[int] = None - """The month on which the billing cycle is anchored (e.g. - - a quarterly price anchored in February would have cycles starting February, May, - August, and November). - """ - - year: Optional[int] = None - """The year on which the billing cycle is anchored (e.g. - - a 2 year billing cycle anchored on 2021 would have cycles starting on 2021, - 2023, 2025, etc.). - """ - - -class DiscountIntervalAmountDiscountInterval(BaseModel): - amount_discount: str - """Only available if discount_type is `amount`.""" - - applies_to_price_ids: List[str] - """The price ids that this discount interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this discount interval applies to.""" - - discount_type: Literal["amount"] - - end_date: Optional[datetime] = None - """The end date of the discount interval.""" - - start_date: datetime - """The start date of the discount interval.""" - - -class DiscountIntervalPercentageDiscountInterval(BaseModel): - applies_to_price_ids: List[str] - """The price ids that this discount interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this discount interval applies to.""" - - discount_type: Literal["percentage"] - - end_date: Optional[datetime] = None - """The end date of the discount interval.""" - - percentage_discount: float - """ - Only available if discount_type is `percentage`.This is a number between 0 - and 1. - """ - - start_date: datetime - """The start date of the discount interval.""" - - -class DiscountIntervalUsageDiscountInterval(BaseModel): - applies_to_price_ids: List[str] - """The price ids that this discount interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this discount interval applies to.""" - - discount_type: Literal["usage"] - - end_date: Optional[datetime] = None - """The end date of the discount interval.""" - - start_date: datetime - """The start date of the discount interval.""" - - usage_discount: float - """Only available if discount_type is `usage`. - - Number of usage units that this discount is for - """ - - -DiscountInterval: TypeAlias = Annotated[ - Union[ - DiscountIntervalAmountDiscountInterval, - DiscountIntervalPercentageDiscountInterval, - DiscountIntervalUsageDiscountInterval, - ], - PropertyInfo(discriminator="discount_type"), -] - - -class FixedFeeQuantitySchedule(BaseModel): - end_date: Optional[datetime] = None - - price_id: str - - quantity: float - - start_date: datetime - - -class MaximumInterval(BaseModel): - applies_to_price_ids: List[str] - """The price ids that this maximum interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this maximum interval applies to.""" - - end_date: Optional[datetime] = None - """The end date of the maximum interval.""" - - maximum_amount: str - """ - The maximum amount to charge in a given billing period for the price intervals - this transform applies to. - """ - - start_date: datetime - """The start date of the maximum interval.""" - - -class MinimumInterval(BaseModel): - applies_to_price_ids: List[str] - """The price ids that this minimum interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this minimum interval applies to.""" - - end_date: Optional[datetime] = None - """The end date of the minimum interval.""" - - minimum_amount: str - """ - The minimum amount to charge in a given billing period for the price intervals - this minimum applies to. - """ - - start_date: datetime - """The start date of the minimum interval.""" - - -class PriceIntervalFixedFeeQuantityTransition(BaseModel): - effective_date: datetime - - price_id: str - - quantity: int - - -class PriceInterval(BaseModel): - id: str - - billing_cycle_day: int - """The day of the month that Orb bills for this price""" - - current_billing_period_end_date: Optional[datetime] = None - """The end of the current billing period. - - This is an exclusive timestamp, such that the instant returned is exactly the - end of the billing period. Set to null if this price interval is not currently - active. - """ - - current_billing_period_start_date: Optional[datetime] = None - """The start date of the current billing period. - - This is an inclusive timestamp; the instant returned is exactly the beginning of - the billing period. Set to null if this price interval is not currently active. - """ - - end_date: Optional[datetime] = None - """The end date of the price interval. - - This is the date that Orb stops billing for this price. - """ - - filter: Optional[str] = None - """An additional filter to apply to usage queries.""" - - fixed_fee_quantity_transitions: Optional[List[PriceIntervalFixedFeeQuantityTransition]] = None - """The fixed fee quantity transitions for this price interval. - - This is only relevant for fixed fees. - """ - - price: Price - """ - The Price resource represents a price that can be billed on a subscription, - resulting in a charge on an invoice in the form of an invoice line item. Prices - take a quantity and determine an amount to bill. - - Orb supports a few different pricing models out of the box. Each of these models - is serialized differently in a given Price object. The model_type field - determines the key for the configuration object that is present. - - For more on the types of prices, see - [the core concepts documentation](/core-concepts#plan-and-price) - """ - - start_date: datetime - """The start date of the price interval. - - This is the date that Orb starts billing for this price. - """ - - usage_customer_ids: Optional[List[str]] = None - """ - A list of customer IDs whose usage events will be aggregated and billed under - this price interval. - """ - - -class RedeemedCoupon(BaseModel): - coupon_id: str - - end_date: Optional[datetime] = None - - start_date: datetime - - -class TrialInfo(BaseModel): - end_date: Optional[datetime] = None - - -class SubscriptionPriceIntervalsResponse(BaseModel): - id: str - - active_plan_phase_order: Optional[int] = None - """ - The current plan phase that is active, only if the subscription's plan has - phases. - """ - - adjustment_intervals: List[AdjustmentInterval] - """The adjustment intervals for this subscription.""" - - auto_collection: Optional[bool] = None - """ - Determines whether issued invoices for this subscription will automatically be - charged with the saved payment method on the due date. This property defaults to - the plan's behavior. If null, defaults to the customer's setting. - """ - - billing_cycle_anchor_configuration: BillingCycleAnchorConfiguration - - billing_cycle_day: int - """The day of the month on which the billing cycle is anchored. - - If the maximum number of days in a month is greater than this value, the last - day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April - means the billing period begins on the 30th. - """ - - created_at: datetime - - current_billing_period_end_date: Optional[datetime] = None - """The end of the current billing period. - - This is an exclusive timestamp, such that the instant returned is not part of - the billing period. Set to null for subscriptions that are not currently active. - """ - - current_billing_period_start_date: Optional[datetime] = None - """The start date of the current billing period. - - This is an inclusive timestamp; the instant returned is exactly the beginning of - the billing period. Set to null if the subscription is not currently active. - """ - - customer: Customer - """ - A customer is a buyer of your products, and the other party to the billing - relationship. - - In Orb, customers are assigned system generated identifiers automatically, but - it's often desirable to have these match existing identifiers in your system. To - avoid having to denormalize Orb ID information, you can pass in an - `external_customer_id` with your own identifier. See - [Customer ID Aliases](/events-and-metrics/customer-aliases) for further - information about how these aliases work in Orb. - - In addition to having an identifier in your system, a customer may exist in a - payment provider solution like Stripe. Use the `payment_provider_id` and the - `payment_provider` enum field to express this mapping. - - A customer also has a timezone (from the standard - [IANA timezone database](https://www.iana.org/time-zones)), which defaults to - your account's timezone. See [Timezone localization](/essentials/timezones) for - information on what this timezone parameter influences within Orb. - """ - - default_invoice_memo: Optional[str] = None - """Determines the default memo on this subscriptions' invoices. - - Note that if this is not provided, it is determined by the plan configuration. - """ - - discount_intervals: List[DiscountInterval] - """The discount intervals for this subscription.""" - - end_date: Optional[datetime] = None - """The date Orb stops billing for this subscription.""" - - fixed_fee_quantity_schedule: List[FixedFeeQuantitySchedule] - - invoicing_threshold: Optional[str] = None - - maximum_intervals: List[MaximumInterval] - """The maximum intervals for this subscription.""" - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum_intervals: List[MinimumInterval] - """The minimum intervals for this subscription.""" - - net_terms: int - """ - Determines the difference between the invoice issue date for subscription - invoices as the date that they are due. A value of `0` here represents that the - invoice is due on issue, whereas a value of `30` represents that the customer - has a month to pay the invoice. - """ - - plan: Plan - """ - The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be - subscribed to by a customer. Plans define the billing behavior of the - subscription. You can see more about how to configure prices in the - [Price resource](/reference/price). - """ - - price_intervals: List[PriceInterval] - """The price intervals for this subscription.""" - - redeemed_coupon: Optional[RedeemedCoupon] = None - - start_date: datetime - """The date Orb starts billing for this subscription.""" - - status: Literal["active", "ended", "upcoming"] - - trial_info: TrialInfo diff --git a/src/orb/types/subscription_schedule_plan_change_params.py b/src/orb/types/subscription_schedule_plan_change_params.py index 4410b50a..60641243 100644 --- a/src/orb/types/subscription_schedule_plan_change_params.py +++ b/src/orb/types/subscription_schedule_plan_change_params.py @@ -2,187 +2,33 @@ from __future__ import annotations -from typing import Dict, List, Union, Iterable, Optional +from typing import List, Union, Iterable, Optional from datetime import datetime -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from .._utils import PropertyInfo +from .shared_params.add_subscription_price_params import AddSubscriptionPriceParams +from .shared_params.remove_subscription_price_params import RemoveSubscriptionPriceParams +from .shared_params.replace_subscription_price_params import ReplaceSubscriptionPriceParams +from .shared_params.add_subscription_adjustment_params import AddSubscriptionAdjustmentParams +from .shared_params.remove_subscription_adjustment_params import RemoveSubscriptionAdjustmentParams +from .shared_params.replace_subscription_adjustment_params import ReplaceSubscriptionAdjustmentParams +from .shared_params.billing_cycle_anchor_configuration_model import BillingCycleAnchorConfigurationModel -__all__ = [ - "SubscriptionSchedulePlanChangeParams", - "AddAdjustment", - "AddAdjustmentAdjustment", - "AddAdjustmentAdjustmentNewPercentageDiscount", - "AddAdjustmentAdjustmentNewUsageDiscount", - "AddAdjustmentAdjustmentNewAmountDiscount", - "AddAdjustmentAdjustmentNewMinimum", - "AddAdjustmentAdjustmentNewMaximum", - "AddPrice", - "AddPriceAllocationPrice", - "AddPriceDiscount", - "AddPricePrice", - "AddPricePriceNewSubscriptionUnitPrice", - "AddPricePriceNewSubscriptionUnitPriceUnitConfig", - "AddPricePriceNewSubscriptionUnitPriceBillingCycleConfiguration", - "AddPricePriceNewSubscriptionUnitPriceInvoicingCycleConfiguration", - "AddPricePriceNewSubscriptionPackagePrice", - "AddPricePriceNewSubscriptionPackagePricePackageConfig", - "AddPricePriceNewSubscriptionPackagePriceBillingCycleConfiguration", - "AddPricePriceNewSubscriptionPackagePriceInvoicingCycleConfiguration", - "AddPricePriceNewSubscriptionMatrixPrice", - "AddPricePriceNewSubscriptionMatrixPriceMatrixConfig", - "AddPricePriceNewSubscriptionMatrixPriceMatrixConfigMatrixValue", - "AddPricePriceNewSubscriptionMatrixPriceBillingCycleConfiguration", - "AddPricePriceNewSubscriptionMatrixPriceInvoicingCycleConfiguration", - "AddPricePriceNewSubscriptionTieredPrice", - "AddPricePriceNewSubscriptionTieredPriceTieredConfig", - "AddPricePriceNewSubscriptionTieredPriceTieredConfigTier", - "AddPricePriceNewSubscriptionTieredPriceBillingCycleConfiguration", - "AddPricePriceNewSubscriptionTieredPriceInvoicingCycleConfiguration", - "AddPricePriceNewSubscriptionTieredBpsPrice", - "AddPricePriceNewSubscriptionTieredBpsPriceTieredBpsConfig", - "AddPricePriceNewSubscriptionTieredBpsPriceTieredBpsConfigTier", - "AddPricePriceNewSubscriptionTieredBpsPriceBillingCycleConfiguration", - "AddPricePriceNewSubscriptionTieredBpsPriceInvoicingCycleConfiguration", - "AddPricePriceNewSubscriptionBpsPrice", - "AddPricePriceNewSubscriptionBpsPriceBpsConfig", - "AddPricePriceNewSubscriptionBpsPriceBillingCycleConfiguration", - "AddPricePriceNewSubscriptionBpsPriceInvoicingCycleConfiguration", - "AddPricePriceNewSubscriptionBulkBpsPrice", - "AddPricePriceNewSubscriptionBulkBpsPriceBulkBpsConfig", - "AddPricePriceNewSubscriptionBulkBpsPriceBulkBpsConfigTier", - "AddPricePriceNewSubscriptionBulkBpsPriceBillingCycleConfiguration", - "AddPricePriceNewSubscriptionBulkBpsPriceInvoicingCycleConfiguration", - "AddPricePriceNewSubscriptionBulkPrice", - "AddPricePriceNewSubscriptionBulkPriceBulkConfig", - "AddPricePriceNewSubscriptionBulkPriceBulkConfigTier", - "AddPricePriceNewSubscriptionBulkPriceBillingCycleConfiguration", - "AddPricePriceNewSubscriptionBulkPriceInvoicingCycleConfiguration", - "AddPricePriceNewSubscriptionThresholdTotalAmountPrice", - "AddPricePriceNewSubscriptionThresholdTotalAmountPriceBillingCycleConfiguration", - "AddPricePriceNewSubscriptionThresholdTotalAmountPriceInvoicingCycleConfiguration", - "AddPricePriceNewSubscriptionTieredPackagePrice", - "AddPricePriceNewSubscriptionTieredPackagePriceBillingCycleConfiguration", - "AddPricePriceNewSubscriptionTieredPackagePriceInvoicingCycleConfiguration", - "AddPricePriceNewSubscriptionTieredWithMinimumPrice", - "AddPricePriceNewSubscriptionTieredWithMinimumPriceBillingCycleConfiguration", - "AddPricePriceNewSubscriptionTieredWithMinimumPriceInvoicingCycleConfiguration", - "AddPricePriceNewSubscriptionUnitWithPercentPrice", - "AddPricePriceNewSubscriptionUnitWithPercentPriceBillingCycleConfiguration", - "AddPricePriceNewSubscriptionUnitWithPercentPriceInvoicingCycleConfiguration", - "AddPricePriceNewSubscriptionPackageWithAllocationPrice", - "AddPricePriceNewSubscriptionPackageWithAllocationPriceBillingCycleConfiguration", - "AddPricePriceNewSubscriptionPackageWithAllocationPriceInvoicingCycleConfiguration", - "AddPricePriceNewSubscriptionTierWithProrationPrice", - "AddPricePriceNewSubscriptionTierWithProrationPriceBillingCycleConfiguration", - "AddPricePriceNewSubscriptionTierWithProrationPriceInvoicingCycleConfiguration", - "AddPricePriceNewSubscriptionUnitWithProrationPrice", - "AddPricePriceNewSubscriptionUnitWithProrationPriceBillingCycleConfiguration", - "AddPricePriceNewSubscriptionUnitWithProrationPriceInvoicingCycleConfiguration", - "AddPricePriceNewSubscriptionGroupedAllocationPrice", - "AddPricePriceNewSubscriptionGroupedAllocationPriceBillingCycleConfiguration", - "AddPricePriceNewSubscriptionGroupedAllocationPriceInvoicingCycleConfiguration", - "AddPricePriceNewSubscriptionGroupedWithProratedMinimumPrice", - "AddPricePriceNewSubscriptionGroupedWithProratedMinimumPriceBillingCycleConfiguration", - "AddPricePriceNewSubscriptionGroupedWithProratedMinimumPriceInvoicingCycleConfiguration", - "AddPricePriceNewSubscriptionBulkWithProrationPrice", - "AddPricePriceNewSubscriptionBulkWithProrationPriceBillingCycleConfiguration", - "AddPricePriceNewSubscriptionBulkWithProrationPriceInvoicingCycleConfiguration", - "BillingCycleAnchorConfiguration", - "RemoveAdjustment", - "RemovePrice", - "ReplaceAdjustment", - "ReplaceAdjustmentAdjustment", - "ReplaceAdjustmentAdjustmentNewPercentageDiscount", - "ReplaceAdjustmentAdjustmentNewUsageDiscount", - "ReplaceAdjustmentAdjustmentNewAmountDiscount", - "ReplaceAdjustmentAdjustmentNewMinimum", - "ReplaceAdjustmentAdjustmentNewMaximum", - "ReplacePrice", - "ReplacePriceAllocationPrice", - "ReplacePriceDiscount", - "ReplacePricePrice", - "ReplacePricePriceNewSubscriptionUnitPrice", - "ReplacePricePriceNewSubscriptionUnitPriceUnitConfig", - "ReplacePricePriceNewSubscriptionUnitPriceBillingCycleConfiguration", - "ReplacePricePriceNewSubscriptionUnitPriceInvoicingCycleConfiguration", - "ReplacePricePriceNewSubscriptionPackagePrice", - "ReplacePricePriceNewSubscriptionPackagePricePackageConfig", - "ReplacePricePriceNewSubscriptionPackagePriceBillingCycleConfiguration", - "ReplacePricePriceNewSubscriptionPackagePriceInvoicingCycleConfiguration", - "ReplacePricePriceNewSubscriptionMatrixPrice", - "ReplacePricePriceNewSubscriptionMatrixPriceMatrixConfig", - "ReplacePricePriceNewSubscriptionMatrixPriceMatrixConfigMatrixValue", - "ReplacePricePriceNewSubscriptionMatrixPriceBillingCycleConfiguration", - "ReplacePricePriceNewSubscriptionMatrixPriceInvoicingCycleConfiguration", - "ReplacePricePriceNewSubscriptionTieredPrice", - "ReplacePricePriceNewSubscriptionTieredPriceTieredConfig", - "ReplacePricePriceNewSubscriptionTieredPriceTieredConfigTier", - "ReplacePricePriceNewSubscriptionTieredPriceBillingCycleConfiguration", - "ReplacePricePriceNewSubscriptionTieredPriceInvoicingCycleConfiguration", - "ReplacePricePriceNewSubscriptionTieredBpsPrice", - "ReplacePricePriceNewSubscriptionTieredBpsPriceTieredBpsConfig", - "ReplacePricePriceNewSubscriptionTieredBpsPriceTieredBpsConfigTier", - "ReplacePricePriceNewSubscriptionTieredBpsPriceBillingCycleConfiguration", - "ReplacePricePriceNewSubscriptionTieredBpsPriceInvoicingCycleConfiguration", - "ReplacePricePriceNewSubscriptionBpsPrice", - "ReplacePricePriceNewSubscriptionBpsPriceBpsConfig", - "ReplacePricePriceNewSubscriptionBpsPriceBillingCycleConfiguration", - "ReplacePricePriceNewSubscriptionBpsPriceInvoicingCycleConfiguration", - "ReplacePricePriceNewSubscriptionBulkBpsPrice", - "ReplacePricePriceNewSubscriptionBulkBpsPriceBulkBpsConfig", - "ReplacePricePriceNewSubscriptionBulkBpsPriceBulkBpsConfigTier", - "ReplacePricePriceNewSubscriptionBulkBpsPriceBillingCycleConfiguration", - "ReplacePricePriceNewSubscriptionBulkBpsPriceInvoicingCycleConfiguration", - "ReplacePricePriceNewSubscriptionBulkPrice", - "ReplacePricePriceNewSubscriptionBulkPriceBulkConfig", - "ReplacePricePriceNewSubscriptionBulkPriceBulkConfigTier", - "ReplacePricePriceNewSubscriptionBulkPriceBillingCycleConfiguration", - "ReplacePricePriceNewSubscriptionBulkPriceInvoicingCycleConfiguration", - "ReplacePricePriceNewSubscriptionThresholdTotalAmountPrice", - "ReplacePricePriceNewSubscriptionThresholdTotalAmountPriceBillingCycleConfiguration", - "ReplacePricePriceNewSubscriptionThresholdTotalAmountPriceInvoicingCycleConfiguration", - "ReplacePricePriceNewSubscriptionTieredPackagePrice", - "ReplacePricePriceNewSubscriptionTieredPackagePriceBillingCycleConfiguration", - "ReplacePricePriceNewSubscriptionTieredPackagePriceInvoicingCycleConfiguration", - "ReplacePricePriceNewSubscriptionTieredWithMinimumPrice", - "ReplacePricePriceNewSubscriptionTieredWithMinimumPriceBillingCycleConfiguration", - "ReplacePricePriceNewSubscriptionTieredWithMinimumPriceInvoicingCycleConfiguration", - "ReplacePricePriceNewSubscriptionUnitWithPercentPrice", - "ReplacePricePriceNewSubscriptionUnitWithPercentPriceBillingCycleConfiguration", - "ReplacePricePriceNewSubscriptionUnitWithPercentPriceInvoicingCycleConfiguration", - "ReplacePricePriceNewSubscriptionPackageWithAllocationPrice", - "ReplacePricePriceNewSubscriptionPackageWithAllocationPriceBillingCycleConfiguration", - "ReplacePricePriceNewSubscriptionPackageWithAllocationPriceInvoicingCycleConfiguration", - "ReplacePricePriceNewSubscriptionTierWithProrationPrice", - "ReplacePricePriceNewSubscriptionTierWithProrationPriceBillingCycleConfiguration", - "ReplacePricePriceNewSubscriptionTierWithProrationPriceInvoicingCycleConfiguration", - "ReplacePricePriceNewSubscriptionUnitWithProrationPrice", - "ReplacePricePriceNewSubscriptionUnitWithProrationPriceBillingCycleConfiguration", - "ReplacePricePriceNewSubscriptionUnitWithProrationPriceInvoicingCycleConfiguration", - "ReplacePricePriceNewSubscriptionGroupedAllocationPrice", - "ReplacePricePriceNewSubscriptionGroupedAllocationPriceBillingCycleConfiguration", - "ReplacePricePriceNewSubscriptionGroupedAllocationPriceInvoicingCycleConfiguration", - "ReplacePricePriceNewSubscriptionGroupedWithProratedMinimumPrice", - "ReplacePricePriceNewSubscriptionGroupedWithProratedMinimumPriceBillingCycleConfiguration", - "ReplacePricePriceNewSubscriptionGroupedWithProratedMinimumPriceInvoicingCycleConfiguration", - "ReplacePricePriceNewSubscriptionBulkWithProrationPrice", - "ReplacePricePriceNewSubscriptionBulkWithProrationPriceBillingCycleConfiguration", - "ReplacePricePriceNewSubscriptionBulkWithProrationPriceInvoicingCycleConfiguration", -] +__all__ = ["SubscriptionSchedulePlanChangeParams"] class SubscriptionSchedulePlanChangeParams(TypedDict, total=False): change_option: Required[Literal["requested_date", "end_of_subscription_term", "immediate"]] - add_adjustments: Optional[Iterable[AddAdjustment]] + add_adjustments: Optional[Iterable[AddSubscriptionAdjustmentParams]] """Additional adjustments to be added to the subscription. (Only available for accounts that have migrated off of legacy subscription overrides) """ - add_prices: Optional[Iterable[AddPrice]] + add_prices: Optional[Iterable[AddSubscriptionPriceParams]] """Additional prices to be added to the subscription. (Only available for accounts that have migrated off of legacy subscription @@ -209,7 +55,7 @@ class SubscriptionSchedulePlanChangeParams(TypedDict, total=False): billing cycle alignment. """ - billing_cycle_anchor_configuration: Optional[BillingCycleAnchorConfiguration] + billing_cycle_anchor_configuration: Optional[BillingCycleAnchorConfigurationModel] change_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] """The date that the plan change should take effect. @@ -283,28 +129,28 @@ class SubscriptionSchedulePlanChangeParams(TypedDict, total=False): price_overrides: Optional[Iterable[object]] """Optionally provide a list of overrides for prices on the plan""" - remove_adjustments: Optional[Iterable[RemoveAdjustment]] + remove_adjustments: Optional[Iterable[RemoveSubscriptionAdjustmentParams]] """Plan adjustments to be removed from the subscription. (Only available for accounts that have migrated off of legacy subscription overrides) """ - remove_prices: Optional[Iterable[RemovePrice]] + remove_prices: Optional[Iterable[RemoveSubscriptionPriceParams]] """Plan prices to be removed from the subscription. (Only available for accounts that have migrated off of legacy subscription overrides) """ - replace_adjustments: Optional[Iterable[ReplaceAdjustment]] + replace_adjustments: Optional[Iterable[ReplaceSubscriptionAdjustmentParams]] """Plan adjustments to be replaced with additional adjustments on the subscription. (Only available for accounts that have migrated off of legacy subscription overrides) """ - replace_prices: Optional[Iterable[ReplacePrice]] + replace_prices: Optional[Iterable[ReplaceSubscriptionPriceParams]] """Plan prices to be replaced with additional prices on the subscription. (Only available for accounts that have migrated off of legacy subscription @@ -327,3954 +173,3 @@ class SubscriptionSchedulePlanChangeParams(TypedDict, total=False): only. Provided usage_customer_ids must be either the customer for this subscription itself, or any of that customer's children. """ - - -class AddAdjustmentAdjustmentNewPercentageDiscount(TypedDict, total=False): - adjustment_type: Required[Literal["percentage_discount"]] - - applies_to_price_ids: Required[List[str]] - """The set of price IDs to which this adjustment applies.""" - - percentage_discount: Required[float] - - is_invoice_level: bool - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -class AddAdjustmentAdjustmentNewUsageDiscount(TypedDict, total=False): - adjustment_type: Required[Literal["usage_discount"]] - - applies_to_price_ids: Required[List[str]] - """The set of price IDs to which this adjustment applies.""" - - usage_discount: Required[float] - - is_invoice_level: bool - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -class AddAdjustmentAdjustmentNewAmountDiscount(TypedDict, total=False): - adjustment_type: Required[Literal["amount_discount"]] - - amount_discount: Required[str] - - applies_to_price_ids: Required[List[str]] - """The set of price IDs to which this adjustment applies.""" - - is_invoice_level: bool - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -class AddAdjustmentAdjustmentNewMinimum(TypedDict, total=False): - adjustment_type: Required[Literal["minimum"]] - - applies_to_price_ids: Required[List[str]] - """The set of price IDs to which this adjustment applies.""" - - item_id: Required[str] - """The item ID that revenue from this minimum will be attributed to.""" - - minimum_amount: Required[str] - - is_invoice_level: bool - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -class AddAdjustmentAdjustmentNewMaximum(TypedDict, total=False): - adjustment_type: Required[Literal["maximum"]] - - applies_to_price_ids: Required[List[str]] - """The set of price IDs to which this adjustment applies.""" - - maximum_amount: Required[str] - - is_invoice_level: bool - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -AddAdjustmentAdjustment: TypeAlias = Union[ - AddAdjustmentAdjustmentNewPercentageDiscount, - AddAdjustmentAdjustmentNewUsageDiscount, - AddAdjustmentAdjustmentNewAmountDiscount, - AddAdjustmentAdjustmentNewMinimum, - AddAdjustmentAdjustmentNewMaximum, -] - - -class AddAdjustment(TypedDict, total=False): - adjustment: Required[AddAdjustmentAdjustment] - """The definition of a new adjustment to create and add to the subscription.""" - - end_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] - """The end date of the adjustment interval. - - This is the date that the adjustment will stop affecting prices on the - subscription. - """ - - plan_phase_order: Optional[int] - """The phase to add this adjustment to.""" - - start_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] - """The start date of the adjustment interval. - - This is the date that the adjustment will start affecting prices on the - subscription. If null, the adjustment will start when the phase or subscription - starts. - """ - - -class AddPriceAllocationPrice(TypedDict, total=False): - amount: Required[str] - """An amount of the currency to allocate to the customer at the specified cadence.""" - - cadence: Required[Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"]] - """The cadence at which to allocate the amount to the customer.""" - - currency: Required[str] - """ - An ISO 4217 currency string or a custom pricing unit identifier in which to bill - this price. - """ - - expires_at_end_of_cadence: Required[bool] - """ - Whether the allocated amount should expire at the end of the cadence or roll - over to the next period. - """ - - -class AddPriceDiscount(TypedDict, total=False): - discount_type: Required[Literal["percentage", "usage", "amount"]] - - amount_discount: Optional[str] - """Only available if discount_type is `amount`.""" - - percentage_discount: Optional[float] - """Only available if discount_type is `percentage`. - - This is a number between 0 and 1. - """ - - usage_discount: Optional[float] - """Only available if discount_type is `usage`. - - Number of usage units that this discount is for - """ - - -class AddPricePriceNewSubscriptionUnitPriceUnitConfig(TypedDict, total=False): - unit_amount: Required[str] - """Rate per unit of usage""" - - -class AddPricePriceNewSubscriptionUnitPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionUnitPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionUnitPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["unit"]] - - name: Required[str] - """The name of the price.""" - - unit_config: Required[AddPricePriceNewSubscriptionUnitPriceUnitConfig] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionUnitPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[AddPricePriceNewSubscriptionUnitPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class AddPricePriceNewSubscriptionPackagePricePackageConfig(TypedDict, total=False): - package_amount: Required[str] - """A currency amount to rate usage by""" - - package_size: Required[int] - """An integer amount to represent package size. - - For example, 1000 here would divide usage by 1000 before multiplying by - package_amount in rating - """ - - -class AddPricePriceNewSubscriptionPackagePriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionPackagePrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["package"]] - - name: Required[str] - """The name of the price.""" - - package_config: Required[AddPricePriceNewSubscriptionPackagePricePackageConfig] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionPackagePriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[AddPricePriceNewSubscriptionPackagePriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class AddPricePriceNewSubscriptionMatrixPriceMatrixConfigMatrixValue(TypedDict, total=False): - dimension_values: Required[List[Optional[str]]] - """One or two matrix keys to filter usage to this Matrix value by. - - For example, ["region", "tier"] could be used to filter cloud usage by a cloud - region and an instance tier. - """ - - unit_amount: Required[str] - """Unit price for the specified dimension_values""" - - -class AddPricePriceNewSubscriptionMatrixPriceMatrixConfig(TypedDict, total=False): - default_unit_amount: Required[str] - """Default per unit rate for any usage not bucketed into a specified matrix_value""" - - dimensions: Required[List[Optional[str]]] - """One or two event property values to evaluate matrix groups by""" - - matrix_values: Required[Iterable[AddPricePriceNewSubscriptionMatrixPriceMatrixConfigMatrixValue]] - """Matrix values for specified matrix grouping keys""" - - -class AddPricePriceNewSubscriptionMatrixPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionMatrixPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionMatrixPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - matrix_config: Required[AddPricePriceNewSubscriptionMatrixPriceMatrixConfig] - - model_type: Required[Literal["matrix"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionMatrixPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[AddPricePriceNewSubscriptionMatrixPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class AddPricePriceNewSubscriptionTieredPriceTieredConfigTier(TypedDict, total=False): - first_unit: Required[float] - """Inclusive tier starting value""" - - unit_amount: Required[str] - """Amount per unit""" - - last_unit: Optional[float] - """Exclusive tier ending value. If null, this is treated as the last tier""" - - -class AddPricePriceNewSubscriptionTieredPriceTieredConfig(TypedDict, total=False): - tiers: Required[Iterable[AddPricePriceNewSubscriptionTieredPriceTieredConfigTier]] - """Tiers for rating based on total usage quantities into the specified tier""" - - -class AddPricePriceNewSubscriptionTieredPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionTieredPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionTieredPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["tiered"]] - - name: Required[str] - """The name of the price.""" - - tiered_config: Required[AddPricePriceNewSubscriptionTieredPriceTieredConfig] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionTieredPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[AddPricePriceNewSubscriptionTieredPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class AddPricePriceNewSubscriptionTieredBpsPriceTieredBpsConfigTier(TypedDict, total=False): - bps: Required[float] - """Per-event basis point rate""" - - minimum_amount: Required[str] - """Inclusive tier starting value""" - - maximum_amount: Optional[str] - """Exclusive tier ending value""" - - per_unit_maximum: Optional[str] - """Per unit maximum to charge""" - - -class AddPricePriceNewSubscriptionTieredBpsPriceTieredBpsConfig(TypedDict, total=False): - tiers: Required[Iterable[AddPricePriceNewSubscriptionTieredBpsPriceTieredBpsConfigTier]] - """ - Tiers for a Graduated BPS pricing model, where usage is bucketed into specified - tiers - """ - - -class AddPricePriceNewSubscriptionTieredBpsPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionTieredBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionTieredBpsPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["tiered_bps"]] - - name: Required[str] - """The name of the price.""" - - tiered_bps_config: Required[AddPricePriceNewSubscriptionTieredBpsPriceTieredBpsConfig] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionTieredBpsPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[AddPricePriceNewSubscriptionTieredBpsPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class AddPricePriceNewSubscriptionBpsPriceBpsConfig(TypedDict, total=False): - bps: Required[float] - """Basis point take rate per event""" - - per_unit_maximum: Optional[str] - """Optional currency amount maximum to cap spend per event""" - - -class AddPricePriceNewSubscriptionBpsPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionBpsPrice(TypedDict, total=False): - bps_config: Required[AddPricePriceNewSubscriptionBpsPriceBpsConfig] - - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["bps"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionBpsPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[AddPricePriceNewSubscriptionBpsPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class AddPricePriceNewSubscriptionBulkBpsPriceBulkBpsConfigTier(TypedDict, total=False): - bps: Required[float] - """Basis points to rate on""" - - maximum_amount: Optional[str] - """Upper bound for tier""" - - per_unit_maximum: Optional[str] - """The maximum amount to charge for any one event""" - - -class AddPricePriceNewSubscriptionBulkBpsPriceBulkBpsConfig(TypedDict, total=False): - tiers: Required[Iterable[AddPricePriceNewSubscriptionBulkBpsPriceBulkBpsConfigTier]] - """ - Tiers for a bulk BPS pricing model where all usage is aggregated to a single - tier based on total volume - """ - - -class AddPricePriceNewSubscriptionBulkBpsPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionBulkBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionBulkBpsPrice(TypedDict, total=False): - bulk_bps_config: Required[AddPricePriceNewSubscriptionBulkBpsPriceBulkBpsConfig] - - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["bulk_bps"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionBulkBpsPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[AddPricePriceNewSubscriptionBulkBpsPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class AddPricePriceNewSubscriptionBulkPriceBulkConfigTier(TypedDict, total=False): - unit_amount: Required[str] - """Amount per unit""" - - maximum_units: Optional[float] - """Upper bound for this tier""" - - -class AddPricePriceNewSubscriptionBulkPriceBulkConfig(TypedDict, total=False): - tiers: Required[Iterable[AddPricePriceNewSubscriptionBulkPriceBulkConfigTier]] - """Bulk tiers for rating based on total usage volume""" - - -class AddPricePriceNewSubscriptionBulkPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionBulkPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionBulkPrice(TypedDict, total=False): - bulk_config: Required[AddPricePriceNewSubscriptionBulkPriceBulkConfig] - - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["bulk"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionBulkPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[AddPricePriceNewSubscriptionBulkPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class AddPricePriceNewSubscriptionThresholdTotalAmountPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionThresholdTotalAmountPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionThresholdTotalAmountPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["threshold_total_amount"]] - - name: Required[str] - """The name of the price.""" - - threshold_total_amount_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ - AddPricePriceNewSubscriptionThresholdTotalAmountPriceBillingCycleConfiguration - ] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - AddPricePriceNewSubscriptionThresholdTotalAmountPriceInvoicingCycleConfiguration - ] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class AddPricePriceNewSubscriptionTieredPackagePriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionTieredPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionTieredPackagePrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["tiered_package"]] - - name: Required[str] - """The name of the price.""" - - tiered_package_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionTieredPackagePriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[AddPricePriceNewSubscriptionTieredPackagePriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class AddPricePriceNewSubscriptionTieredWithMinimumPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionTieredWithMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionTieredWithMinimumPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["tiered_with_minimum"]] - - name: Required[str] - """The name of the price.""" - - tiered_with_minimum_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionTieredWithMinimumPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - AddPricePriceNewSubscriptionTieredWithMinimumPriceInvoicingCycleConfiguration - ] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class AddPricePriceNewSubscriptionUnitWithPercentPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionUnitWithPercentPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionUnitWithPercentPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["unit_with_percent"]] - - name: Required[str] - """The name of the price.""" - - unit_with_percent_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionUnitWithPercentPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[AddPricePriceNewSubscriptionUnitWithPercentPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class AddPricePriceNewSubscriptionPackageWithAllocationPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionPackageWithAllocationPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionPackageWithAllocationPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["package_with_allocation"]] - - name: Required[str] - """The name of the price.""" - - package_with_allocation_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ - AddPricePriceNewSubscriptionPackageWithAllocationPriceBillingCycleConfiguration - ] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - AddPricePriceNewSubscriptionPackageWithAllocationPriceInvoicingCycleConfiguration - ] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class AddPricePriceNewSubscriptionTierWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionTierWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionTierWithProrationPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["tiered_with_proration"]] - - name: Required[str] - """The name of the price.""" - - tiered_with_proration_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionTierWithProrationPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - AddPricePriceNewSubscriptionTierWithProrationPriceInvoicingCycleConfiguration - ] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class AddPricePriceNewSubscriptionUnitWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionUnitWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionUnitWithProrationPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["unit_with_proration"]] - - name: Required[str] - """The name of the price.""" - - unit_with_proration_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionUnitWithProrationPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - AddPricePriceNewSubscriptionUnitWithProrationPriceInvoicingCycleConfiguration - ] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class AddPricePriceNewSubscriptionGroupedAllocationPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionGroupedAllocationPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionGroupedAllocationPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - grouped_allocation_config: Required[Dict[str, object]] - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["grouped_allocation"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionGroupedAllocationPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - AddPricePriceNewSubscriptionGroupedAllocationPriceInvoicingCycleConfiguration - ] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class AddPricePriceNewSubscriptionGroupedWithProratedMinimumPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionGroupedWithProratedMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionGroupedWithProratedMinimumPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - grouped_with_prorated_minimum_config: Required[Dict[str, object]] - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["grouped_with_prorated_minimum"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ - AddPricePriceNewSubscriptionGroupedWithProratedMinimumPriceBillingCycleConfiguration - ] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - AddPricePriceNewSubscriptionGroupedWithProratedMinimumPriceInvoicingCycleConfiguration - ] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class AddPricePriceNewSubscriptionBulkWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionBulkWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class AddPricePriceNewSubscriptionBulkWithProrationPrice(TypedDict, total=False): - bulk_with_proration_config: Required[Dict[str, object]] - - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["bulk_with_proration"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionBulkWithProrationPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - AddPricePriceNewSubscriptionBulkWithProrationPriceInvoicingCycleConfiguration - ] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -AddPricePrice: TypeAlias = Union[ - AddPricePriceNewSubscriptionUnitPrice, - AddPricePriceNewSubscriptionPackagePrice, - AddPricePriceNewSubscriptionMatrixPrice, - AddPricePriceNewSubscriptionTieredPrice, - AddPricePriceNewSubscriptionTieredBpsPrice, - AddPricePriceNewSubscriptionBpsPrice, - AddPricePriceNewSubscriptionBulkBpsPrice, - AddPricePriceNewSubscriptionBulkPrice, - AddPricePriceNewSubscriptionThresholdTotalAmountPrice, - AddPricePriceNewSubscriptionTieredPackagePrice, - AddPricePriceNewSubscriptionTieredWithMinimumPrice, - AddPricePriceNewSubscriptionUnitWithPercentPrice, - AddPricePriceNewSubscriptionPackageWithAllocationPrice, - AddPricePriceNewSubscriptionTierWithProrationPrice, - AddPricePriceNewSubscriptionUnitWithProrationPrice, - AddPricePriceNewSubscriptionGroupedAllocationPrice, - AddPricePriceNewSubscriptionGroupedWithProratedMinimumPrice, - AddPricePriceNewSubscriptionBulkWithProrationPrice, -] - - -class AddPrice(TypedDict, total=False): - allocation_price: Optional[AddPriceAllocationPrice] - """The definition of a new allocation price to create and add to the subscription.""" - - discounts: Optional[Iterable[AddPriceDiscount]] - """[DEPRECATED] Use add_adjustments instead. - - The subscription's discounts for this price. - """ - - end_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] - """The end date of the price interval. - - This is the date that the price will stop billing on the subscription. If null, - billing will end when the phase or subscription ends. - """ - - external_price_id: Optional[str] - """The external price id of the price to add to the subscription.""" - - maximum_amount: Optional[str] - """[DEPRECATED] Use add_adjustments instead. - - The subscription's maximum amount for this price. - """ - - minimum_amount: Optional[str] - """[DEPRECATED] Use add_adjustments instead. - - The subscription's minimum amount for this price. - """ - - plan_phase_order: Optional[int] - """The phase to add this price to.""" - - price: Optional[AddPricePrice] - """The definition of a new price to create and add to the subscription.""" - - price_id: Optional[str] - """The id of the price to add to the subscription.""" - - start_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] - """The start date of the price interval. - - This is the date that the price will start billing on the subscription. If null, - billing will start when the phase or subscription starts. - """ - - -class BillingCycleAnchorConfiguration(TypedDict, total=False): - day: Required[int] - """The day of the month on which the billing cycle is anchored. - - If the maximum number of days in a month is greater than this value, the last - day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April - means the billing period begins on the 30th. - """ - - month: Optional[int] - """The month on which the billing cycle is anchored (e.g. - - a quarterly price anchored in February would have cycles starting February, May, - August, and November). - """ - - year: Optional[int] - """The year on which the billing cycle is anchored (e.g. - - a 2 year billing cycle anchored on 2021 would have cycles starting on 2021, - 2023, 2025, etc.). - """ - - -class RemoveAdjustment(TypedDict, total=False): - adjustment_id: Required[str] - """The id of the adjustment to remove on the subscription.""" - - -class RemovePrice(TypedDict, total=False): - external_price_id: Optional[str] - """The external price id of the price to remove on the subscription.""" - - price_id: Optional[str] - """The id of the price to remove on the subscription.""" - - -class ReplaceAdjustmentAdjustmentNewPercentageDiscount(TypedDict, total=False): - adjustment_type: Required[Literal["percentage_discount"]] - - applies_to_price_ids: Required[List[str]] - """The set of price IDs to which this adjustment applies.""" - - percentage_discount: Required[float] - - is_invoice_level: bool - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -class ReplaceAdjustmentAdjustmentNewUsageDiscount(TypedDict, total=False): - adjustment_type: Required[Literal["usage_discount"]] - - applies_to_price_ids: Required[List[str]] - """The set of price IDs to which this adjustment applies.""" - - usage_discount: Required[float] - - is_invoice_level: bool - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -class ReplaceAdjustmentAdjustmentNewAmountDiscount(TypedDict, total=False): - adjustment_type: Required[Literal["amount_discount"]] - - amount_discount: Required[str] - - applies_to_price_ids: Required[List[str]] - """The set of price IDs to which this adjustment applies.""" - - is_invoice_level: bool - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -class ReplaceAdjustmentAdjustmentNewMinimum(TypedDict, total=False): - adjustment_type: Required[Literal["minimum"]] - - applies_to_price_ids: Required[List[str]] - """The set of price IDs to which this adjustment applies.""" - - item_id: Required[str] - """The item ID that revenue from this minimum will be attributed to.""" - - minimum_amount: Required[str] - - is_invoice_level: bool - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -class ReplaceAdjustmentAdjustmentNewMaximum(TypedDict, total=False): - adjustment_type: Required[Literal["maximum"]] - - applies_to_price_ids: Required[List[str]] - """The set of price IDs to which this adjustment applies.""" - - maximum_amount: Required[str] - - is_invoice_level: bool - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -ReplaceAdjustmentAdjustment: TypeAlias = Union[ - ReplaceAdjustmentAdjustmentNewPercentageDiscount, - ReplaceAdjustmentAdjustmentNewUsageDiscount, - ReplaceAdjustmentAdjustmentNewAmountDiscount, - ReplaceAdjustmentAdjustmentNewMinimum, - ReplaceAdjustmentAdjustmentNewMaximum, -] - - -class ReplaceAdjustment(TypedDict, total=False): - adjustment: Required[ReplaceAdjustmentAdjustment] - """The definition of a new adjustment to create and add to the subscription.""" - - replaces_adjustment_id: Required[str] - """The id of the adjustment on the plan to replace in the subscription.""" - - -class ReplacePriceAllocationPrice(TypedDict, total=False): - amount: Required[str] - """An amount of the currency to allocate to the customer at the specified cadence.""" - - cadence: Required[Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"]] - """The cadence at which to allocate the amount to the customer.""" - - currency: Required[str] - """ - An ISO 4217 currency string or a custom pricing unit identifier in which to bill - this price. - """ - - expires_at_end_of_cadence: Required[bool] - """ - Whether the allocated amount should expire at the end of the cadence or roll - over to the next period. - """ - - -class ReplacePriceDiscount(TypedDict, total=False): - discount_type: Required[Literal["percentage", "usage", "amount"]] - - amount_discount: Optional[str] - """Only available if discount_type is `amount`.""" - - percentage_discount: Optional[float] - """Only available if discount_type is `percentage`. - - This is a number between 0 and 1. - """ - - usage_discount: Optional[float] - """Only available if discount_type is `usage`. - - Number of usage units that this discount is for - """ - - -class ReplacePricePriceNewSubscriptionUnitPriceUnitConfig(TypedDict, total=False): - unit_amount: Required[str] - """Rate per unit of usage""" - - -class ReplacePricePriceNewSubscriptionUnitPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionUnitPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionUnitPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["unit"]] - - name: Required[str] - """The name of the price.""" - - unit_config: Required[ReplacePricePriceNewSubscriptionUnitPriceUnitConfig] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionUnitPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionUnitPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class ReplacePricePriceNewSubscriptionPackagePricePackageConfig(TypedDict, total=False): - package_amount: Required[str] - """A currency amount to rate usage by""" - - package_size: Required[int] - """An integer amount to represent package size. - - For example, 1000 here would divide usage by 1000 before multiplying by - package_amount in rating - """ - - -class ReplacePricePriceNewSubscriptionPackagePriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionPackagePrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["package"]] - - name: Required[str] - """The name of the price.""" - - package_config: Required[ReplacePricePriceNewSubscriptionPackagePricePackageConfig] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionPackagePriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionPackagePriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class ReplacePricePriceNewSubscriptionMatrixPriceMatrixConfigMatrixValue(TypedDict, total=False): - dimension_values: Required[List[Optional[str]]] - """One or two matrix keys to filter usage to this Matrix value by. - - For example, ["region", "tier"] could be used to filter cloud usage by a cloud - region and an instance tier. - """ - - unit_amount: Required[str] - """Unit price for the specified dimension_values""" - - -class ReplacePricePriceNewSubscriptionMatrixPriceMatrixConfig(TypedDict, total=False): - default_unit_amount: Required[str] - """Default per unit rate for any usage not bucketed into a specified matrix_value""" - - dimensions: Required[List[Optional[str]]] - """One or two event property values to evaluate matrix groups by""" - - matrix_values: Required[Iterable[ReplacePricePriceNewSubscriptionMatrixPriceMatrixConfigMatrixValue]] - """Matrix values for specified matrix grouping keys""" - - -class ReplacePricePriceNewSubscriptionMatrixPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionMatrixPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionMatrixPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - matrix_config: Required[ReplacePricePriceNewSubscriptionMatrixPriceMatrixConfig] - - model_type: Required[Literal["matrix"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionMatrixPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionMatrixPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class ReplacePricePriceNewSubscriptionTieredPriceTieredConfigTier(TypedDict, total=False): - first_unit: Required[float] - """Inclusive tier starting value""" - - unit_amount: Required[str] - """Amount per unit""" - - last_unit: Optional[float] - """Exclusive tier ending value. If null, this is treated as the last tier""" - - -class ReplacePricePriceNewSubscriptionTieredPriceTieredConfig(TypedDict, total=False): - tiers: Required[Iterable[ReplacePricePriceNewSubscriptionTieredPriceTieredConfigTier]] - """Tiers for rating based on total usage quantities into the specified tier""" - - -class ReplacePricePriceNewSubscriptionTieredPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionTieredPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionTieredPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["tiered"]] - - name: Required[str] - """The name of the price.""" - - tiered_config: Required[ReplacePricePriceNewSubscriptionTieredPriceTieredConfig] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionTieredPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionTieredPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class ReplacePricePriceNewSubscriptionTieredBpsPriceTieredBpsConfigTier(TypedDict, total=False): - bps: Required[float] - """Per-event basis point rate""" - - minimum_amount: Required[str] - """Inclusive tier starting value""" - - maximum_amount: Optional[str] - """Exclusive tier ending value""" - - per_unit_maximum: Optional[str] - """Per unit maximum to charge""" - - -class ReplacePricePriceNewSubscriptionTieredBpsPriceTieredBpsConfig(TypedDict, total=False): - tiers: Required[Iterable[ReplacePricePriceNewSubscriptionTieredBpsPriceTieredBpsConfigTier]] - """ - Tiers for a Graduated BPS pricing model, where usage is bucketed into specified - tiers - """ - - -class ReplacePricePriceNewSubscriptionTieredBpsPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionTieredBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionTieredBpsPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["tiered_bps"]] - - name: Required[str] - """The name of the price.""" - - tiered_bps_config: Required[ReplacePricePriceNewSubscriptionTieredBpsPriceTieredBpsConfig] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionTieredBpsPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionTieredBpsPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class ReplacePricePriceNewSubscriptionBpsPriceBpsConfig(TypedDict, total=False): - bps: Required[float] - """Basis point take rate per event""" - - per_unit_maximum: Optional[str] - """Optional currency amount maximum to cap spend per event""" - - -class ReplacePricePriceNewSubscriptionBpsPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionBpsPrice(TypedDict, total=False): - bps_config: Required[ReplacePricePriceNewSubscriptionBpsPriceBpsConfig] - - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["bps"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionBpsPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionBpsPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class ReplacePricePriceNewSubscriptionBulkBpsPriceBulkBpsConfigTier(TypedDict, total=False): - bps: Required[float] - """Basis points to rate on""" - - maximum_amount: Optional[str] - """Upper bound for tier""" - - per_unit_maximum: Optional[str] - """The maximum amount to charge for any one event""" - - -class ReplacePricePriceNewSubscriptionBulkBpsPriceBulkBpsConfig(TypedDict, total=False): - tiers: Required[Iterable[ReplacePricePriceNewSubscriptionBulkBpsPriceBulkBpsConfigTier]] - """ - Tiers for a bulk BPS pricing model where all usage is aggregated to a single - tier based on total volume - """ - - -class ReplacePricePriceNewSubscriptionBulkBpsPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionBulkBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionBulkBpsPrice(TypedDict, total=False): - bulk_bps_config: Required[ReplacePricePriceNewSubscriptionBulkBpsPriceBulkBpsConfig] - - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["bulk_bps"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionBulkBpsPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionBulkBpsPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class ReplacePricePriceNewSubscriptionBulkPriceBulkConfigTier(TypedDict, total=False): - unit_amount: Required[str] - """Amount per unit""" - - maximum_units: Optional[float] - """Upper bound for this tier""" - - -class ReplacePricePriceNewSubscriptionBulkPriceBulkConfig(TypedDict, total=False): - tiers: Required[Iterable[ReplacePricePriceNewSubscriptionBulkPriceBulkConfigTier]] - """Bulk tiers for rating based on total usage volume""" - - -class ReplacePricePriceNewSubscriptionBulkPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionBulkPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionBulkPrice(TypedDict, total=False): - bulk_config: Required[ReplacePricePriceNewSubscriptionBulkPriceBulkConfig] - - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["bulk"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionBulkPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionBulkPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class ReplacePricePriceNewSubscriptionThresholdTotalAmountPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionThresholdTotalAmountPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionThresholdTotalAmountPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["threshold_total_amount"]] - - name: Required[str] - """The name of the price.""" - - threshold_total_amount_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ - ReplacePricePriceNewSubscriptionThresholdTotalAmountPriceBillingCycleConfiguration - ] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - ReplacePricePriceNewSubscriptionThresholdTotalAmountPriceInvoicingCycleConfiguration - ] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class ReplacePricePriceNewSubscriptionTieredPackagePriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionTieredPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionTieredPackagePrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["tiered_package"]] - - name: Required[str] - """The name of the price.""" - - tiered_package_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionTieredPackagePriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - ReplacePricePriceNewSubscriptionTieredPackagePriceInvoicingCycleConfiguration - ] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class ReplacePricePriceNewSubscriptionTieredWithMinimumPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionTieredWithMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionTieredWithMinimumPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["tiered_with_minimum"]] - - name: Required[str] - """The name of the price.""" - - tiered_with_minimum_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ - ReplacePricePriceNewSubscriptionTieredWithMinimumPriceBillingCycleConfiguration - ] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - ReplacePricePriceNewSubscriptionTieredWithMinimumPriceInvoicingCycleConfiguration - ] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class ReplacePricePriceNewSubscriptionUnitWithPercentPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionUnitWithPercentPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionUnitWithPercentPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["unit_with_percent"]] - - name: Required[str] - """The name of the price.""" - - unit_with_percent_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionUnitWithPercentPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - ReplacePricePriceNewSubscriptionUnitWithPercentPriceInvoicingCycleConfiguration - ] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class ReplacePricePriceNewSubscriptionPackageWithAllocationPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionPackageWithAllocationPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionPackageWithAllocationPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["package_with_allocation"]] - - name: Required[str] - """The name of the price.""" - - package_with_allocation_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ - ReplacePricePriceNewSubscriptionPackageWithAllocationPriceBillingCycleConfiguration - ] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - ReplacePricePriceNewSubscriptionPackageWithAllocationPriceInvoicingCycleConfiguration - ] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class ReplacePricePriceNewSubscriptionTierWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionTierWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionTierWithProrationPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["tiered_with_proration"]] - - name: Required[str] - """The name of the price.""" - - tiered_with_proration_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ - ReplacePricePriceNewSubscriptionTierWithProrationPriceBillingCycleConfiguration - ] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - ReplacePricePriceNewSubscriptionTierWithProrationPriceInvoicingCycleConfiguration - ] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class ReplacePricePriceNewSubscriptionUnitWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionUnitWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionUnitWithProrationPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["unit_with_proration"]] - - name: Required[str] - """The name of the price.""" - - unit_with_proration_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ - ReplacePricePriceNewSubscriptionUnitWithProrationPriceBillingCycleConfiguration - ] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - ReplacePricePriceNewSubscriptionUnitWithProrationPriceInvoicingCycleConfiguration - ] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class ReplacePricePriceNewSubscriptionGroupedAllocationPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionGroupedAllocationPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionGroupedAllocationPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - grouped_allocation_config: Required[Dict[str, object]] - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["grouped_allocation"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ - ReplacePricePriceNewSubscriptionGroupedAllocationPriceBillingCycleConfiguration - ] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - ReplacePricePriceNewSubscriptionGroupedAllocationPriceInvoicingCycleConfiguration - ] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class ReplacePricePriceNewSubscriptionGroupedWithProratedMinimumPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionGroupedWithProratedMinimumPriceInvoicingCycleConfiguration( - TypedDict, total=False -): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionGroupedWithProratedMinimumPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - grouped_with_prorated_minimum_config: Required[Dict[str, object]] - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["grouped_with_prorated_minimum"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ - ReplacePricePriceNewSubscriptionGroupedWithProratedMinimumPriceBillingCycleConfiguration - ] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - ReplacePricePriceNewSubscriptionGroupedWithProratedMinimumPriceInvoicingCycleConfiguration - ] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class ReplacePricePriceNewSubscriptionBulkWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionBulkWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class ReplacePricePriceNewSubscriptionBulkWithProrationPrice(TypedDict, total=False): - bulk_with_proration_config: Required[Dict[str, object]] - - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["bulk_with_proration"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ - ReplacePricePriceNewSubscriptionBulkWithProrationPriceBillingCycleConfiguration - ] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - ReplacePricePriceNewSubscriptionBulkWithProrationPriceInvoicingCycleConfiguration - ] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -ReplacePricePrice: TypeAlias = Union[ - ReplacePricePriceNewSubscriptionUnitPrice, - ReplacePricePriceNewSubscriptionPackagePrice, - ReplacePricePriceNewSubscriptionMatrixPrice, - ReplacePricePriceNewSubscriptionTieredPrice, - ReplacePricePriceNewSubscriptionTieredBpsPrice, - ReplacePricePriceNewSubscriptionBpsPrice, - ReplacePricePriceNewSubscriptionBulkBpsPrice, - ReplacePricePriceNewSubscriptionBulkPrice, - ReplacePricePriceNewSubscriptionThresholdTotalAmountPrice, - ReplacePricePriceNewSubscriptionTieredPackagePrice, - ReplacePricePriceNewSubscriptionTieredWithMinimumPrice, - ReplacePricePriceNewSubscriptionUnitWithPercentPrice, - ReplacePricePriceNewSubscriptionPackageWithAllocationPrice, - ReplacePricePriceNewSubscriptionTierWithProrationPrice, - ReplacePricePriceNewSubscriptionUnitWithProrationPrice, - ReplacePricePriceNewSubscriptionGroupedAllocationPrice, - ReplacePricePriceNewSubscriptionGroupedWithProratedMinimumPrice, - ReplacePricePriceNewSubscriptionBulkWithProrationPrice, -] - - -class ReplacePrice(TypedDict, total=False): - replaces_price_id: Required[str] - """The id of the price on the plan to replace in the subscription.""" - - allocation_price: Optional[ReplacePriceAllocationPrice] - """The definition of a new allocation price to create and add to the subscription.""" - - discounts: Optional[Iterable[ReplacePriceDiscount]] - """[DEPRECATED] Use add_adjustments instead. - - The subscription's discounts for the replacement price. - """ - - external_price_id: Optional[str] - """The external price id of the price to add to the subscription.""" - - fixed_price_quantity: Optional[float] - """The new quantity of the price, if the price is a fixed price.""" - - maximum_amount: Optional[str] - """[DEPRECATED] Use add_adjustments instead. - - The subscription's maximum amount for the replacement price. - """ - - minimum_amount: Optional[str] - """[DEPRECATED] Use add_adjustments instead. - - The subscription's minimum amount for the replacement price. - """ - - price: Optional[ReplacePricePrice] - """The definition of a new price to create and add to the subscription.""" - - price_id: Optional[str] - """The id of the price to add to the subscription.""" diff --git a/src/orb/types/subscription_schedule_plan_change_response.py b/src/orb/types/subscription_schedule_plan_change_response.py deleted file mode 100644 index 5549771f..00000000 --- a/src/orb/types/subscription_schedule_plan_change_response.py +++ /dev/null @@ -1,555 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List, Union, Optional -from datetime import datetime -from typing_extensions import Literal, Annotated, TypeAlias - -from .plan import Plan -from .price import Price -from .._utils import PropertyInfo -from .._models import BaseModel -from .customer import Customer - -__all__ = [ - "SubscriptionSchedulePlanChangeResponse", - "AdjustmentInterval", - "AdjustmentIntervalAdjustment", - "AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment", - "AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment", - "AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment", - "AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment", - "AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment", - "BillingCycleAnchorConfiguration", - "DiscountInterval", - "DiscountIntervalAmountDiscountInterval", - "DiscountIntervalPercentageDiscountInterval", - "DiscountIntervalUsageDiscountInterval", - "FixedFeeQuantitySchedule", - "MaximumInterval", - "MinimumInterval", - "PriceInterval", - "PriceIntervalFixedFeeQuantityTransition", - "RedeemedCoupon", - "TrialInfo", -] - - -class AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment(BaseModel): - id: str - - adjustment_type: Literal["usage_discount"] - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - usage_discount: float - """ - The number of usage units by which to discount the price this adjustment applies - to in a given billing period. - """ - - -class AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment(BaseModel): - id: str - - adjustment_type: Literal["amount_discount"] - - amount_discount: str - """ - The amount by which to discount the prices this adjustment applies to in a given - billing period. - """ - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -class AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment(BaseModel): - id: str - - adjustment_type: Literal["percentage_discount"] - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - percentage_discount: float - """ - The percentage (as a value between 0 and 1) by which to discount the price - intervals this adjustment applies to in a given billing period. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -class AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment(BaseModel): - id: str - - adjustment_type: Literal["minimum"] - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - item_id: str - """The item ID that revenue from this minimum will be attributed to.""" - - minimum_amount: str - """ - The minimum amount to charge in a given billing period for the prices this - adjustment applies to. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -class AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment(BaseModel): - id: str - - adjustment_type: Literal["maximum"] - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - maximum_amount: str - """ - The maximum amount to charge in a given billing period for the prices this - adjustment applies to. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -AdjustmentIntervalAdjustment: TypeAlias = Annotated[ - Union[ - AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment, - AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment, - AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment, - AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment, - AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment, - ], - PropertyInfo(discriminator="adjustment_type"), -] - - -class AdjustmentInterval(BaseModel): - id: str - - adjustment: AdjustmentIntervalAdjustment - - applies_to_price_interval_ids: List[str] - """The price interval IDs that this adjustment applies to.""" - - end_date: Optional[datetime] = None - """The end date of the adjustment interval.""" - - start_date: datetime - """The start date of the adjustment interval.""" - - -class BillingCycleAnchorConfiguration(BaseModel): - day: int - """The day of the month on which the billing cycle is anchored. - - If the maximum number of days in a month is greater than this value, the last - day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April - means the billing period begins on the 30th. - """ - - month: Optional[int] = None - """The month on which the billing cycle is anchored (e.g. - - a quarterly price anchored in February would have cycles starting February, May, - August, and November). - """ - - year: Optional[int] = None - """The year on which the billing cycle is anchored (e.g. - - a 2 year billing cycle anchored on 2021 would have cycles starting on 2021, - 2023, 2025, etc.). - """ - - -class DiscountIntervalAmountDiscountInterval(BaseModel): - amount_discount: str - """Only available if discount_type is `amount`.""" - - applies_to_price_ids: List[str] - """The price ids that this discount interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this discount interval applies to.""" - - discount_type: Literal["amount"] - - end_date: Optional[datetime] = None - """The end date of the discount interval.""" - - start_date: datetime - """The start date of the discount interval.""" - - -class DiscountIntervalPercentageDiscountInterval(BaseModel): - applies_to_price_ids: List[str] - """The price ids that this discount interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this discount interval applies to.""" - - discount_type: Literal["percentage"] - - end_date: Optional[datetime] = None - """The end date of the discount interval.""" - - percentage_discount: float - """ - Only available if discount_type is `percentage`.This is a number between 0 - and 1. - """ - - start_date: datetime - """The start date of the discount interval.""" - - -class DiscountIntervalUsageDiscountInterval(BaseModel): - applies_to_price_ids: List[str] - """The price ids that this discount interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this discount interval applies to.""" - - discount_type: Literal["usage"] - - end_date: Optional[datetime] = None - """The end date of the discount interval.""" - - start_date: datetime - """The start date of the discount interval.""" - - usage_discount: float - """Only available if discount_type is `usage`. - - Number of usage units that this discount is for - """ - - -DiscountInterval: TypeAlias = Annotated[ - Union[ - DiscountIntervalAmountDiscountInterval, - DiscountIntervalPercentageDiscountInterval, - DiscountIntervalUsageDiscountInterval, - ], - PropertyInfo(discriminator="discount_type"), -] - - -class FixedFeeQuantitySchedule(BaseModel): - end_date: Optional[datetime] = None - - price_id: str - - quantity: float - - start_date: datetime - - -class MaximumInterval(BaseModel): - applies_to_price_ids: List[str] - """The price ids that this maximum interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this maximum interval applies to.""" - - end_date: Optional[datetime] = None - """The end date of the maximum interval.""" - - maximum_amount: str - """ - The maximum amount to charge in a given billing period for the price intervals - this transform applies to. - """ - - start_date: datetime - """The start date of the maximum interval.""" - - -class MinimumInterval(BaseModel): - applies_to_price_ids: List[str] - """The price ids that this minimum interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this minimum interval applies to.""" - - end_date: Optional[datetime] = None - """The end date of the minimum interval.""" - - minimum_amount: str - """ - The minimum amount to charge in a given billing period for the price intervals - this minimum applies to. - """ - - start_date: datetime - """The start date of the minimum interval.""" - - -class PriceIntervalFixedFeeQuantityTransition(BaseModel): - effective_date: datetime - - price_id: str - - quantity: int - - -class PriceInterval(BaseModel): - id: str - - billing_cycle_day: int - """The day of the month that Orb bills for this price""" - - current_billing_period_end_date: Optional[datetime] = None - """The end of the current billing period. - - This is an exclusive timestamp, such that the instant returned is exactly the - end of the billing period. Set to null if this price interval is not currently - active. - """ - - current_billing_period_start_date: Optional[datetime] = None - """The start date of the current billing period. - - This is an inclusive timestamp; the instant returned is exactly the beginning of - the billing period. Set to null if this price interval is not currently active. - """ - - end_date: Optional[datetime] = None - """The end date of the price interval. - - This is the date that Orb stops billing for this price. - """ - - filter: Optional[str] = None - """An additional filter to apply to usage queries.""" - - fixed_fee_quantity_transitions: Optional[List[PriceIntervalFixedFeeQuantityTransition]] = None - """The fixed fee quantity transitions for this price interval. - - This is only relevant for fixed fees. - """ - - price: Price - """ - The Price resource represents a price that can be billed on a subscription, - resulting in a charge on an invoice in the form of an invoice line item. Prices - take a quantity and determine an amount to bill. - - Orb supports a few different pricing models out of the box. Each of these models - is serialized differently in a given Price object. The model_type field - determines the key for the configuration object that is present. - - For more on the types of prices, see - [the core concepts documentation](/core-concepts#plan-and-price) - """ - - start_date: datetime - """The start date of the price interval. - - This is the date that Orb starts billing for this price. - """ - - usage_customer_ids: Optional[List[str]] = None - """ - A list of customer IDs whose usage events will be aggregated and billed under - this price interval. - """ - - -class RedeemedCoupon(BaseModel): - coupon_id: str - - end_date: Optional[datetime] = None - - start_date: datetime - - -class TrialInfo(BaseModel): - end_date: Optional[datetime] = None - - -class SubscriptionSchedulePlanChangeResponse(BaseModel): - id: str - - active_plan_phase_order: Optional[int] = None - """ - The current plan phase that is active, only if the subscription's plan has - phases. - """ - - adjustment_intervals: List[AdjustmentInterval] - """The adjustment intervals for this subscription.""" - - auto_collection: Optional[bool] = None - """ - Determines whether issued invoices for this subscription will automatically be - charged with the saved payment method on the due date. This property defaults to - the plan's behavior. If null, defaults to the customer's setting. - """ - - billing_cycle_anchor_configuration: BillingCycleAnchorConfiguration - - billing_cycle_day: int - """The day of the month on which the billing cycle is anchored. - - If the maximum number of days in a month is greater than this value, the last - day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April - means the billing period begins on the 30th. - """ - - created_at: datetime - - current_billing_period_end_date: Optional[datetime] = None - """The end of the current billing period. - - This is an exclusive timestamp, such that the instant returned is not part of - the billing period. Set to null for subscriptions that are not currently active. - """ - - current_billing_period_start_date: Optional[datetime] = None - """The start date of the current billing period. - - This is an inclusive timestamp; the instant returned is exactly the beginning of - the billing period. Set to null if the subscription is not currently active. - """ - - customer: Customer - """ - A customer is a buyer of your products, and the other party to the billing - relationship. - - In Orb, customers are assigned system generated identifiers automatically, but - it's often desirable to have these match existing identifiers in your system. To - avoid having to denormalize Orb ID information, you can pass in an - `external_customer_id` with your own identifier. See - [Customer ID Aliases](/events-and-metrics/customer-aliases) for further - information about how these aliases work in Orb. - - In addition to having an identifier in your system, a customer may exist in a - payment provider solution like Stripe. Use the `payment_provider_id` and the - `payment_provider` enum field to express this mapping. - - A customer also has a timezone (from the standard - [IANA timezone database](https://www.iana.org/time-zones)), which defaults to - your account's timezone. See [Timezone localization](/essentials/timezones) for - information on what this timezone parameter influences within Orb. - """ - - default_invoice_memo: Optional[str] = None - """Determines the default memo on this subscriptions' invoices. - - Note that if this is not provided, it is determined by the plan configuration. - """ - - discount_intervals: List[DiscountInterval] - """The discount intervals for this subscription.""" - - end_date: Optional[datetime] = None - """The date Orb stops billing for this subscription.""" - - fixed_fee_quantity_schedule: List[FixedFeeQuantitySchedule] - - invoicing_threshold: Optional[str] = None - - maximum_intervals: List[MaximumInterval] - """The maximum intervals for this subscription.""" - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum_intervals: List[MinimumInterval] - """The minimum intervals for this subscription.""" - - net_terms: int - """ - Determines the difference between the invoice issue date for subscription - invoices as the date that they are due. A value of `0` here represents that the - invoice is due on issue, whereas a value of `30` represents that the customer - has a month to pay the invoice. - """ - - plan: Plan - """ - The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be - subscribed to by a customer. Plans define the billing behavior of the - subscription. You can see more about how to configure prices in the - [Price resource](/reference/price). - """ - - price_intervals: List[PriceInterval] - """The price intervals for this subscription.""" - - redeemed_coupon: Optional[RedeemedCoupon] = None - - start_date: datetime - """The date Orb starts billing for this subscription.""" - - status: Literal["active", "ended", "upcoming"] - - trial_info: TrialInfo diff --git a/src/orb/types/subscription_trigger_phase_response.py b/src/orb/types/subscription_trigger_phase_response.py deleted file mode 100644 index a0891557..00000000 --- a/src/orb/types/subscription_trigger_phase_response.py +++ /dev/null @@ -1,555 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List, Union, Optional -from datetime import datetime -from typing_extensions import Literal, Annotated, TypeAlias - -from .plan import Plan -from .price import Price -from .._utils import PropertyInfo -from .._models import BaseModel -from .customer import Customer - -__all__ = [ - "SubscriptionTriggerPhaseResponse", - "AdjustmentInterval", - "AdjustmentIntervalAdjustment", - "AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment", - "AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment", - "AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment", - "AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment", - "AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment", - "BillingCycleAnchorConfiguration", - "DiscountInterval", - "DiscountIntervalAmountDiscountInterval", - "DiscountIntervalPercentageDiscountInterval", - "DiscountIntervalUsageDiscountInterval", - "FixedFeeQuantitySchedule", - "MaximumInterval", - "MinimumInterval", - "PriceInterval", - "PriceIntervalFixedFeeQuantityTransition", - "RedeemedCoupon", - "TrialInfo", -] - - -class AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment(BaseModel): - id: str - - adjustment_type: Literal["usage_discount"] - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - usage_discount: float - """ - The number of usage units by which to discount the price this adjustment applies - to in a given billing period. - """ - - -class AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment(BaseModel): - id: str - - adjustment_type: Literal["amount_discount"] - - amount_discount: str - """ - The amount by which to discount the prices this adjustment applies to in a given - billing period. - """ - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -class AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment(BaseModel): - id: str - - adjustment_type: Literal["percentage_discount"] - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - percentage_discount: float - """ - The percentage (as a value between 0 and 1) by which to discount the price - intervals this adjustment applies to in a given billing period. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -class AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment(BaseModel): - id: str - - adjustment_type: Literal["minimum"] - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - item_id: str - """The item ID that revenue from this minimum will be attributed to.""" - - minimum_amount: str - """ - The minimum amount to charge in a given billing period for the prices this - adjustment applies to. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -class AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment(BaseModel): - id: str - - adjustment_type: Literal["maximum"] - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - maximum_amount: str - """ - The maximum amount to charge in a given billing period for the prices this - adjustment applies to. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -AdjustmentIntervalAdjustment: TypeAlias = Annotated[ - Union[ - AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment, - AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment, - AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment, - AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment, - AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment, - ], - PropertyInfo(discriminator="adjustment_type"), -] - - -class AdjustmentInterval(BaseModel): - id: str - - adjustment: AdjustmentIntervalAdjustment - - applies_to_price_interval_ids: List[str] - """The price interval IDs that this adjustment applies to.""" - - end_date: Optional[datetime] = None - """The end date of the adjustment interval.""" - - start_date: datetime - """The start date of the adjustment interval.""" - - -class BillingCycleAnchorConfiguration(BaseModel): - day: int - """The day of the month on which the billing cycle is anchored. - - If the maximum number of days in a month is greater than this value, the last - day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April - means the billing period begins on the 30th. - """ - - month: Optional[int] = None - """The month on which the billing cycle is anchored (e.g. - - a quarterly price anchored in February would have cycles starting February, May, - August, and November). - """ - - year: Optional[int] = None - """The year on which the billing cycle is anchored (e.g. - - a 2 year billing cycle anchored on 2021 would have cycles starting on 2021, - 2023, 2025, etc.). - """ - - -class DiscountIntervalAmountDiscountInterval(BaseModel): - amount_discount: str - """Only available if discount_type is `amount`.""" - - applies_to_price_ids: List[str] - """The price ids that this discount interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this discount interval applies to.""" - - discount_type: Literal["amount"] - - end_date: Optional[datetime] = None - """The end date of the discount interval.""" - - start_date: datetime - """The start date of the discount interval.""" - - -class DiscountIntervalPercentageDiscountInterval(BaseModel): - applies_to_price_ids: List[str] - """The price ids that this discount interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this discount interval applies to.""" - - discount_type: Literal["percentage"] - - end_date: Optional[datetime] = None - """The end date of the discount interval.""" - - percentage_discount: float - """ - Only available if discount_type is `percentage`.This is a number between 0 - and 1. - """ - - start_date: datetime - """The start date of the discount interval.""" - - -class DiscountIntervalUsageDiscountInterval(BaseModel): - applies_to_price_ids: List[str] - """The price ids that this discount interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this discount interval applies to.""" - - discount_type: Literal["usage"] - - end_date: Optional[datetime] = None - """The end date of the discount interval.""" - - start_date: datetime - """The start date of the discount interval.""" - - usage_discount: float - """Only available if discount_type is `usage`. - - Number of usage units that this discount is for - """ - - -DiscountInterval: TypeAlias = Annotated[ - Union[ - DiscountIntervalAmountDiscountInterval, - DiscountIntervalPercentageDiscountInterval, - DiscountIntervalUsageDiscountInterval, - ], - PropertyInfo(discriminator="discount_type"), -] - - -class FixedFeeQuantitySchedule(BaseModel): - end_date: Optional[datetime] = None - - price_id: str - - quantity: float - - start_date: datetime - - -class MaximumInterval(BaseModel): - applies_to_price_ids: List[str] - """The price ids that this maximum interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this maximum interval applies to.""" - - end_date: Optional[datetime] = None - """The end date of the maximum interval.""" - - maximum_amount: str - """ - The maximum amount to charge in a given billing period for the price intervals - this transform applies to. - """ - - start_date: datetime - """The start date of the maximum interval.""" - - -class MinimumInterval(BaseModel): - applies_to_price_ids: List[str] - """The price ids that this minimum interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this minimum interval applies to.""" - - end_date: Optional[datetime] = None - """The end date of the minimum interval.""" - - minimum_amount: str - """ - The minimum amount to charge in a given billing period for the price intervals - this minimum applies to. - """ - - start_date: datetime - """The start date of the minimum interval.""" - - -class PriceIntervalFixedFeeQuantityTransition(BaseModel): - effective_date: datetime - - price_id: str - - quantity: int - - -class PriceInterval(BaseModel): - id: str - - billing_cycle_day: int - """The day of the month that Orb bills for this price""" - - current_billing_period_end_date: Optional[datetime] = None - """The end of the current billing period. - - This is an exclusive timestamp, such that the instant returned is exactly the - end of the billing period. Set to null if this price interval is not currently - active. - """ - - current_billing_period_start_date: Optional[datetime] = None - """The start date of the current billing period. - - This is an inclusive timestamp; the instant returned is exactly the beginning of - the billing period. Set to null if this price interval is not currently active. - """ - - end_date: Optional[datetime] = None - """The end date of the price interval. - - This is the date that Orb stops billing for this price. - """ - - filter: Optional[str] = None - """An additional filter to apply to usage queries.""" - - fixed_fee_quantity_transitions: Optional[List[PriceIntervalFixedFeeQuantityTransition]] = None - """The fixed fee quantity transitions for this price interval. - - This is only relevant for fixed fees. - """ - - price: Price - """ - The Price resource represents a price that can be billed on a subscription, - resulting in a charge on an invoice in the form of an invoice line item. Prices - take a quantity and determine an amount to bill. - - Orb supports a few different pricing models out of the box. Each of these models - is serialized differently in a given Price object. The model_type field - determines the key for the configuration object that is present. - - For more on the types of prices, see - [the core concepts documentation](/core-concepts#plan-and-price) - """ - - start_date: datetime - """The start date of the price interval. - - This is the date that Orb starts billing for this price. - """ - - usage_customer_ids: Optional[List[str]] = None - """ - A list of customer IDs whose usage events will be aggregated and billed under - this price interval. - """ - - -class RedeemedCoupon(BaseModel): - coupon_id: str - - end_date: Optional[datetime] = None - - start_date: datetime - - -class TrialInfo(BaseModel): - end_date: Optional[datetime] = None - - -class SubscriptionTriggerPhaseResponse(BaseModel): - id: str - - active_plan_phase_order: Optional[int] = None - """ - The current plan phase that is active, only if the subscription's plan has - phases. - """ - - adjustment_intervals: List[AdjustmentInterval] - """The adjustment intervals for this subscription.""" - - auto_collection: Optional[bool] = None - """ - Determines whether issued invoices for this subscription will automatically be - charged with the saved payment method on the due date. This property defaults to - the plan's behavior. If null, defaults to the customer's setting. - """ - - billing_cycle_anchor_configuration: BillingCycleAnchorConfiguration - - billing_cycle_day: int - """The day of the month on which the billing cycle is anchored. - - If the maximum number of days in a month is greater than this value, the last - day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April - means the billing period begins on the 30th. - """ - - created_at: datetime - - current_billing_period_end_date: Optional[datetime] = None - """The end of the current billing period. - - This is an exclusive timestamp, such that the instant returned is not part of - the billing period. Set to null for subscriptions that are not currently active. - """ - - current_billing_period_start_date: Optional[datetime] = None - """The start date of the current billing period. - - This is an inclusive timestamp; the instant returned is exactly the beginning of - the billing period. Set to null if the subscription is not currently active. - """ - - customer: Customer - """ - A customer is a buyer of your products, and the other party to the billing - relationship. - - In Orb, customers are assigned system generated identifiers automatically, but - it's often desirable to have these match existing identifiers in your system. To - avoid having to denormalize Orb ID information, you can pass in an - `external_customer_id` with your own identifier. See - [Customer ID Aliases](/events-and-metrics/customer-aliases) for further - information about how these aliases work in Orb. - - In addition to having an identifier in your system, a customer may exist in a - payment provider solution like Stripe. Use the `payment_provider_id` and the - `payment_provider` enum field to express this mapping. - - A customer also has a timezone (from the standard - [IANA timezone database](https://www.iana.org/time-zones)), which defaults to - your account's timezone. See [Timezone localization](/essentials/timezones) for - information on what this timezone parameter influences within Orb. - """ - - default_invoice_memo: Optional[str] = None - """Determines the default memo on this subscriptions' invoices. - - Note that if this is not provided, it is determined by the plan configuration. - """ - - discount_intervals: List[DiscountInterval] - """The discount intervals for this subscription.""" - - end_date: Optional[datetime] = None - """The date Orb stops billing for this subscription.""" - - fixed_fee_quantity_schedule: List[FixedFeeQuantitySchedule] - - invoicing_threshold: Optional[str] = None - - maximum_intervals: List[MaximumInterval] - """The maximum intervals for this subscription.""" - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum_intervals: List[MinimumInterval] - """The minimum intervals for this subscription.""" - - net_terms: int - """ - Determines the difference between the invoice issue date for subscription - invoices as the date that they are due. A value of `0` here represents that the - invoice is due on issue, whereas a value of `30` represents that the customer - has a month to pay the invoice. - """ - - plan: Plan - """ - The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be - subscribed to by a customer. Plans define the billing behavior of the - subscription. You can see more about how to configure prices in the - [Price resource](/reference/price). - """ - - price_intervals: List[PriceInterval] - """The price intervals for this subscription.""" - - redeemed_coupon: Optional[RedeemedCoupon] = None - - start_date: datetime - """The date Orb starts billing for this subscription.""" - - status: Literal["active", "ended", "upcoming"] - - trial_info: TrialInfo diff --git a/src/orb/types/subscription_unschedule_cancellation_response.py b/src/orb/types/subscription_unschedule_cancellation_response.py deleted file mode 100644 index f084f56a..00000000 --- a/src/orb/types/subscription_unschedule_cancellation_response.py +++ /dev/null @@ -1,555 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List, Union, Optional -from datetime import datetime -from typing_extensions import Literal, Annotated, TypeAlias - -from .plan import Plan -from .price import Price -from .._utils import PropertyInfo -from .._models import BaseModel -from .customer import Customer - -__all__ = [ - "SubscriptionUnscheduleCancellationResponse", - "AdjustmentInterval", - "AdjustmentIntervalAdjustment", - "AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment", - "AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment", - "AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment", - "AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment", - "AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment", - "BillingCycleAnchorConfiguration", - "DiscountInterval", - "DiscountIntervalAmountDiscountInterval", - "DiscountIntervalPercentageDiscountInterval", - "DiscountIntervalUsageDiscountInterval", - "FixedFeeQuantitySchedule", - "MaximumInterval", - "MinimumInterval", - "PriceInterval", - "PriceIntervalFixedFeeQuantityTransition", - "RedeemedCoupon", - "TrialInfo", -] - - -class AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment(BaseModel): - id: str - - adjustment_type: Literal["usage_discount"] - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - usage_discount: float - """ - The number of usage units by which to discount the price this adjustment applies - to in a given billing period. - """ - - -class AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment(BaseModel): - id: str - - adjustment_type: Literal["amount_discount"] - - amount_discount: str - """ - The amount by which to discount the prices this adjustment applies to in a given - billing period. - """ - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -class AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment(BaseModel): - id: str - - adjustment_type: Literal["percentage_discount"] - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - percentage_discount: float - """ - The percentage (as a value between 0 and 1) by which to discount the price - intervals this adjustment applies to in a given billing period. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -class AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment(BaseModel): - id: str - - adjustment_type: Literal["minimum"] - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - item_id: str - """The item ID that revenue from this minimum will be attributed to.""" - - minimum_amount: str - """ - The minimum amount to charge in a given billing period for the prices this - adjustment applies to. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -class AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment(BaseModel): - id: str - - adjustment_type: Literal["maximum"] - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - maximum_amount: str - """ - The maximum amount to charge in a given billing period for the prices this - adjustment applies to. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -AdjustmentIntervalAdjustment: TypeAlias = Annotated[ - Union[ - AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment, - AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment, - AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment, - AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment, - AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment, - ], - PropertyInfo(discriminator="adjustment_type"), -] - - -class AdjustmentInterval(BaseModel): - id: str - - adjustment: AdjustmentIntervalAdjustment - - applies_to_price_interval_ids: List[str] - """The price interval IDs that this adjustment applies to.""" - - end_date: Optional[datetime] = None - """The end date of the adjustment interval.""" - - start_date: datetime - """The start date of the adjustment interval.""" - - -class BillingCycleAnchorConfiguration(BaseModel): - day: int - """The day of the month on which the billing cycle is anchored. - - If the maximum number of days in a month is greater than this value, the last - day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April - means the billing period begins on the 30th. - """ - - month: Optional[int] = None - """The month on which the billing cycle is anchored (e.g. - - a quarterly price anchored in February would have cycles starting February, May, - August, and November). - """ - - year: Optional[int] = None - """The year on which the billing cycle is anchored (e.g. - - a 2 year billing cycle anchored on 2021 would have cycles starting on 2021, - 2023, 2025, etc.). - """ - - -class DiscountIntervalAmountDiscountInterval(BaseModel): - amount_discount: str - """Only available if discount_type is `amount`.""" - - applies_to_price_ids: List[str] - """The price ids that this discount interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this discount interval applies to.""" - - discount_type: Literal["amount"] - - end_date: Optional[datetime] = None - """The end date of the discount interval.""" - - start_date: datetime - """The start date of the discount interval.""" - - -class DiscountIntervalPercentageDiscountInterval(BaseModel): - applies_to_price_ids: List[str] - """The price ids that this discount interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this discount interval applies to.""" - - discount_type: Literal["percentage"] - - end_date: Optional[datetime] = None - """The end date of the discount interval.""" - - percentage_discount: float - """ - Only available if discount_type is `percentage`.This is a number between 0 - and 1. - """ - - start_date: datetime - """The start date of the discount interval.""" - - -class DiscountIntervalUsageDiscountInterval(BaseModel): - applies_to_price_ids: List[str] - """The price ids that this discount interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this discount interval applies to.""" - - discount_type: Literal["usage"] - - end_date: Optional[datetime] = None - """The end date of the discount interval.""" - - start_date: datetime - """The start date of the discount interval.""" - - usage_discount: float - """Only available if discount_type is `usage`. - - Number of usage units that this discount is for - """ - - -DiscountInterval: TypeAlias = Annotated[ - Union[ - DiscountIntervalAmountDiscountInterval, - DiscountIntervalPercentageDiscountInterval, - DiscountIntervalUsageDiscountInterval, - ], - PropertyInfo(discriminator="discount_type"), -] - - -class FixedFeeQuantitySchedule(BaseModel): - end_date: Optional[datetime] = None - - price_id: str - - quantity: float - - start_date: datetime - - -class MaximumInterval(BaseModel): - applies_to_price_ids: List[str] - """The price ids that this maximum interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this maximum interval applies to.""" - - end_date: Optional[datetime] = None - """The end date of the maximum interval.""" - - maximum_amount: str - """ - The maximum amount to charge in a given billing period for the price intervals - this transform applies to. - """ - - start_date: datetime - """The start date of the maximum interval.""" - - -class MinimumInterval(BaseModel): - applies_to_price_ids: List[str] - """The price ids that this minimum interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this minimum interval applies to.""" - - end_date: Optional[datetime] = None - """The end date of the minimum interval.""" - - minimum_amount: str - """ - The minimum amount to charge in a given billing period for the price intervals - this minimum applies to. - """ - - start_date: datetime - """The start date of the minimum interval.""" - - -class PriceIntervalFixedFeeQuantityTransition(BaseModel): - effective_date: datetime - - price_id: str - - quantity: int - - -class PriceInterval(BaseModel): - id: str - - billing_cycle_day: int - """The day of the month that Orb bills for this price""" - - current_billing_period_end_date: Optional[datetime] = None - """The end of the current billing period. - - This is an exclusive timestamp, such that the instant returned is exactly the - end of the billing period. Set to null if this price interval is not currently - active. - """ - - current_billing_period_start_date: Optional[datetime] = None - """The start date of the current billing period. - - This is an inclusive timestamp; the instant returned is exactly the beginning of - the billing period. Set to null if this price interval is not currently active. - """ - - end_date: Optional[datetime] = None - """The end date of the price interval. - - This is the date that Orb stops billing for this price. - """ - - filter: Optional[str] = None - """An additional filter to apply to usage queries.""" - - fixed_fee_quantity_transitions: Optional[List[PriceIntervalFixedFeeQuantityTransition]] = None - """The fixed fee quantity transitions for this price interval. - - This is only relevant for fixed fees. - """ - - price: Price - """ - The Price resource represents a price that can be billed on a subscription, - resulting in a charge on an invoice in the form of an invoice line item. Prices - take a quantity and determine an amount to bill. - - Orb supports a few different pricing models out of the box. Each of these models - is serialized differently in a given Price object. The model_type field - determines the key for the configuration object that is present. - - For more on the types of prices, see - [the core concepts documentation](/core-concepts#plan-and-price) - """ - - start_date: datetime - """The start date of the price interval. - - This is the date that Orb starts billing for this price. - """ - - usage_customer_ids: Optional[List[str]] = None - """ - A list of customer IDs whose usage events will be aggregated and billed under - this price interval. - """ - - -class RedeemedCoupon(BaseModel): - coupon_id: str - - end_date: Optional[datetime] = None - - start_date: datetime - - -class TrialInfo(BaseModel): - end_date: Optional[datetime] = None - - -class SubscriptionUnscheduleCancellationResponse(BaseModel): - id: str - - active_plan_phase_order: Optional[int] = None - """ - The current plan phase that is active, only if the subscription's plan has - phases. - """ - - adjustment_intervals: List[AdjustmentInterval] - """The adjustment intervals for this subscription.""" - - auto_collection: Optional[bool] = None - """ - Determines whether issued invoices for this subscription will automatically be - charged with the saved payment method on the due date. This property defaults to - the plan's behavior. If null, defaults to the customer's setting. - """ - - billing_cycle_anchor_configuration: BillingCycleAnchorConfiguration - - billing_cycle_day: int - """The day of the month on which the billing cycle is anchored. - - If the maximum number of days in a month is greater than this value, the last - day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April - means the billing period begins on the 30th. - """ - - created_at: datetime - - current_billing_period_end_date: Optional[datetime] = None - """The end of the current billing period. - - This is an exclusive timestamp, such that the instant returned is not part of - the billing period. Set to null for subscriptions that are not currently active. - """ - - current_billing_period_start_date: Optional[datetime] = None - """The start date of the current billing period. - - This is an inclusive timestamp; the instant returned is exactly the beginning of - the billing period. Set to null if the subscription is not currently active. - """ - - customer: Customer - """ - A customer is a buyer of your products, and the other party to the billing - relationship. - - In Orb, customers are assigned system generated identifiers automatically, but - it's often desirable to have these match existing identifiers in your system. To - avoid having to denormalize Orb ID information, you can pass in an - `external_customer_id` with your own identifier. See - [Customer ID Aliases](/events-and-metrics/customer-aliases) for further - information about how these aliases work in Orb. - - In addition to having an identifier in your system, a customer may exist in a - payment provider solution like Stripe. Use the `payment_provider_id` and the - `payment_provider` enum field to express this mapping. - - A customer also has a timezone (from the standard - [IANA timezone database](https://www.iana.org/time-zones)), which defaults to - your account's timezone. See [Timezone localization](/essentials/timezones) for - information on what this timezone parameter influences within Orb. - """ - - default_invoice_memo: Optional[str] = None - """Determines the default memo on this subscriptions' invoices. - - Note that if this is not provided, it is determined by the plan configuration. - """ - - discount_intervals: List[DiscountInterval] - """The discount intervals for this subscription.""" - - end_date: Optional[datetime] = None - """The date Orb stops billing for this subscription.""" - - fixed_fee_quantity_schedule: List[FixedFeeQuantitySchedule] - - invoicing_threshold: Optional[str] = None - - maximum_intervals: List[MaximumInterval] - """The maximum intervals for this subscription.""" - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum_intervals: List[MinimumInterval] - """The minimum intervals for this subscription.""" - - net_terms: int - """ - Determines the difference between the invoice issue date for subscription - invoices as the date that they are due. A value of `0` here represents that the - invoice is due on issue, whereas a value of `30` represents that the customer - has a month to pay the invoice. - """ - - plan: Plan - """ - The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be - subscribed to by a customer. Plans define the billing behavior of the - subscription. You can see more about how to configure prices in the - [Price resource](/reference/price). - """ - - price_intervals: List[PriceInterval] - """The price intervals for this subscription.""" - - redeemed_coupon: Optional[RedeemedCoupon] = None - - start_date: datetime - """The date Orb starts billing for this subscription.""" - - status: Literal["active", "ended", "upcoming"] - - trial_info: TrialInfo diff --git a/src/orb/types/subscription_unschedule_fixed_fee_quantity_updates_response.py b/src/orb/types/subscription_unschedule_fixed_fee_quantity_updates_response.py deleted file mode 100644 index 6e27be58..00000000 --- a/src/orb/types/subscription_unschedule_fixed_fee_quantity_updates_response.py +++ /dev/null @@ -1,555 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List, Union, Optional -from datetime import datetime -from typing_extensions import Literal, Annotated, TypeAlias - -from .plan import Plan -from .price import Price -from .._utils import PropertyInfo -from .._models import BaseModel -from .customer import Customer - -__all__ = [ - "SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse", - "AdjustmentInterval", - "AdjustmentIntervalAdjustment", - "AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment", - "AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment", - "AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment", - "AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment", - "AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment", - "BillingCycleAnchorConfiguration", - "DiscountInterval", - "DiscountIntervalAmountDiscountInterval", - "DiscountIntervalPercentageDiscountInterval", - "DiscountIntervalUsageDiscountInterval", - "FixedFeeQuantitySchedule", - "MaximumInterval", - "MinimumInterval", - "PriceInterval", - "PriceIntervalFixedFeeQuantityTransition", - "RedeemedCoupon", - "TrialInfo", -] - - -class AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment(BaseModel): - id: str - - adjustment_type: Literal["usage_discount"] - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - usage_discount: float - """ - The number of usage units by which to discount the price this adjustment applies - to in a given billing period. - """ - - -class AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment(BaseModel): - id: str - - adjustment_type: Literal["amount_discount"] - - amount_discount: str - """ - The amount by which to discount the prices this adjustment applies to in a given - billing period. - """ - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -class AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment(BaseModel): - id: str - - adjustment_type: Literal["percentage_discount"] - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - percentage_discount: float - """ - The percentage (as a value between 0 and 1) by which to discount the price - intervals this adjustment applies to in a given billing period. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -class AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment(BaseModel): - id: str - - adjustment_type: Literal["minimum"] - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - item_id: str - """The item ID that revenue from this minimum will be attributed to.""" - - minimum_amount: str - """ - The minimum amount to charge in a given billing period for the prices this - adjustment applies to. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -class AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment(BaseModel): - id: str - - adjustment_type: Literal["maximum"] - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - maximum_amount: str - """ - The maximum amount to charge in a given billing period for the prices this - adjustment applies to. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -AdjustmentIntervalAdjustment: TypeAlias = Annotated[ - Union[ - AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment, - AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment, - AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment, - AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment, - AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment, - ], - PropertyInfo(discriminator="adjustment_type"), -] - - -class AdjustmentInterval(BaseModel): - id: str - - adjustment: AdjustmentIntervalAdjustment - - applies_to_price_interval_ids: List[str] - """The price interval IDs that this adjustment applies to.""" - - end_date: Optional[datetime] = None - """The end date of the adjustment interval.""" - - start_date: datetime - """The start date of the adjustment interval.""" - - -class BillingCycleAnchorConfiguration(BaseModel): - day: int - """The day of the month on which the billing cycle is anchored. - - If the maximum number of days in a month is greater than this value, the last - day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April - means the billing period begins on the 30th. - """ - - month: Optional[int] = None - """The month on which the billing cycle is anchored (e.g. - - a quarterly price anchored in February would have cycles starting February, May, - August, and November). - """ - - year: Optional[int] = None - """The year on which the billing cycle is anchored (e.g. - - a 2 year billing cycle anchored on 2021 would have cycles starting on 2021, - 2023, 2025, etc.). - """ - - -class DiscountIntervalAmountDiscountInterval(BaseModel): - amount_discount: str - """Only available if discount_type is `amount`.""" - - applies_to_price_ids: List[str] - """The price ids that this discount interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this discount interval applies to.""" - - discount_type: Literal["amount"] - - end_date: Optional[datetime] = None - """The end date of the discount interval.""" - - start_date: datetime - """The start date of the discount interval.""" - - -class DiscountIntervalPercentageDiscountInterval(BaseModel): - applies_to_price_ids: List[str] - """The price ids that this discount interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this discount interval applies to.""" - - discount_type: Literal["percentage"] - - end_date: Optional[datetime] = None - """The end date of the discount interval.""" - - percentage_discount: float - """ - Only available if discount_type is `percentage`.This is a number between 0 - and 1. - """ - - start_date: datetime - """The start date of the discount interval.""" - - -class DiscountIntervalUsageDiscountInterval(BaseModel): - applies_to_price_ids: List[str] - """The price ids that this discount interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this discount interval applies to.""" - - discount_type: Literal["usage"] - - end_date: Optional[datetime] = None - """The end date of the discount interval.""" - - start_date: datetime - """The start date of the discount interval.""" - - usage_discount: float - """Only available if discount_type is `usage`. - - Number of usage units that this discount is for - """ - - -DiscountInterval: TypeAlias = Annotated[ - Union[ - DiscountIntervalAmountDiscountInterval, - DiscountIntervalPercentageDiscountInterval, - DiscountIntervalUsageDiscountInterval, - ], - PropertyInfo(discriminator="discount_type"), -] - - -class FixedFeeQuantitySchedule(BaseModel): - end_date: Optional[datetime] = None - - price_id: str - - quantity: float - - start_date: datetime - - -class MaximumInterval(BaseModel): - applies_to_price_ids: List[str] - """The price ids that this maximum interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this maximum interval applies to.""" - - end_date: Optional[datetime] = None - """The end date of the maximum interval.""" - - maximum_amount: str - """ - The maximum amount to charge in a given billing period for the price intervals - this transform applies to. - """ - - start_date: datetime - """The start date of the maximum interval.""" - - -class MinimumInterval(BaseModel): - applies_to_price_ids: List[str] - """The price ids that this minimum interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this minimum interval applies to.""" - - end_date: Optional[datetime] = None - """The end date of the minimum interval.""" - - minimum_amount: str - """ - The minimum amount to charge in a given billing period for the price intervals - this minimum applies to. - """ - - start_date: datetime - """The start date of the minimum interval.""" - - -class PriceIntervalFixedFeeQuantityTransition(BaseModel): - effective_date: datetime - - price_id: str - - quantity: int - - -class PriceInterval(BaseModel): - id: str - - billing_cycle_day: int - """The day of the month that Orb bills for this price""" - - current_billing_period_end_date: Optional[datetime] = None - """The end of the current billing period. - - This is an exclusive timestamp, such that the instant returned is exactly the - end of the billing period. Set to null if this price interval is not currently - active. - """ - - current_billing_period_start_date: Optional[datetime] = None - """The start date of the current billing period. - - This is an inclusive timestamp; the instant returned is exactly the beginning of - the billing period. Set to null if this price interval is not currently active. - """ - - end_date: Optional[datetime] = None - """The end date of the price interval. - - This is the date that Orb stops billing for this price. - """ - - filter: Optional[str] = None - """An additional filter to apply to usage queries.""" - - fixed_fee_quantity_transitions: Optional[List[PriceIntervalFixedFeeQuantityTransition]] = None - """The fixed fee quantity transitions for this price interval. - - This is only relevant for fixed fees. - """ - - price: Price - """ - The Price resource represents a price that can be billed on a subscription, - resulting in a charge on an invoice in the form of an invoice line item. Prices - take a quantity and determine an amount to bill. - - Orb supports a few different pricing models out of the box. Each of these models - is serialized differently in a given Price object. The model_type field - determines the key for the configuration object that is present. - - For more on the types of prices, see - [the core concepts documentation](/core-concepts#plan-and-price) - """ - - start_date: datetime - """The start date of the price interval. - - This is the date that Orb starts billing for this price. - """ - - usage_customer_ids: Optional[List[str]] = None - """ - A list of customer IDs whose usage events will be aggregated and billed under - this price interval. - """ - - -class RedeemedCoupon(BaseModel): - coupon_id: str - - end_date: Optional[datetime] = None - - start_date: datetime - - -class TrialInfo(BaseModel): - end_date: Optional[datetime] = None - - -class SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse(BaseModel): - id: str - - active_plan_phase_order: Optional[int] = None - """ - The current plan phase that is active, only if the subscription's plan has - phases. - """ - - adjustment_intervals: List[AdjustmentInterval] - """The adjustment intervals for this subscription.""" - - auto_collection: Optional[bool] = None - """ - Determines whether issued invoices for this subscription will automatically be - charged with the saved payment method on the due date. This property defaults to - the plan's behavior. If null, defaults to the customer's setting. - """ - - billing_cycle_anchor_configuration: BillingCycleAnchorConfiguration - - billing_cycle_day: int - """The day of the month on which the billing cycle is anchored. - - If the maximum number of days in a month is greater than this value, the last - day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April - means the billing period begins on the 30th. - """ - - created_at: datetime - - current_billing_period_end_date: Optional[datetime] = None - """The end of the current billing period. - - This is an exclusive timestamp, such that the instant returned is not part of - the billing period. Set to null for subscriptions that are not currently active. - """ - - current_billing_period_start_date: Optional[datetime] = None - """The start date of the current billing period. - - This is an inclusive timestamp; the instant returned is exactly the beginning of - the billing period. Set to null if the subscription is not currently active. - """ - - customer: Customer - """ - A customer is a buyer of your products, and the other party to the billing - relationship. - - In Orb, customers are assigned system generated identifiers automatically, but - it's often desirable to have these match existing identifiers in your system. To - avoid having to denormalize Orb ID information, you can pass in an - `external_customer_id` with your own identifier. See - [Customer ID Aliases](/events-and-metrics/customer-aliases) for further - information about how these aliases work in Orb. - - In addition to having an identifier in your system, a customer may exist in a - payment provider solution like Stripe. Use the `payment_provider_id` and the - `payment_provider` enum field to express this mapping. - - A customer also has a timezone (from the standard - [IANA timezone database](https://www.iana.org/time-zones)), which defaults to - your account's timezone. See [Timezone localization](/essentials/timezones) for - information on what this timezone parameter influences within Orb. - """ - - default_invoice_memo: Optional[str] = None - """Determines the default memo on this subscriptions' invoices. - - Note that if this is not provided, it is determined by the plan configuration. - """ - - discount_intervals: List[DiscountInterval] - """The discount intervals for this subscription.""" - - end_date: Optional[datetime] = None - """The date Orb stops billing for this subscription.""" - - fixed_fee_quantity_schedule: List[FixedFeeQuantitySchedule] - - invoicing_threshold: Optional[str] = None - - maximum_intervals: List[MaximumInterval] - """The maximum intervals for this subscription.""" - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum_intervals: List[MinimumInterval] - """The minimum intervals for this subscription.""" - - net_terms: int - """ - Determines the difference between the invoice issue date for subscription - invoices as the date that they are due. A value of `0` here represents that the - invoice is due on issue, whereas a value of `30` represents that the customer - has a month to pay the invoice. - """ - - plan: Plan - """ - The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be - subscribed to by a customer. Plans define the billing behavior of the - subscription. You can see more about how to configure prices in the - [Price resource](/reference/price). - """ - - price_intervals: List[PriceInterval] - """The price intervals for this subscription.""" - - redeemed_coupon: Optional[RedeemedCoupon] = None - - start_date: datetime - """The date Orb starts billing for this subscription.""" - - status: Literal["active", "ended", "upcoming"] - - trial_info: TrialInfo diff --git a/src/orb/types/subscription_unschedule_pending_plan_changes_response.py b/src/orb/types/subscription_unschedule_pending_plan_changes_response.py deleted file mode 100644 index 3d5943a6..00000000 --- a/src/orb/types/subscription_unschedule_pending_plan_changes_response.py +++ /dev/null @@ -1,555 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List, Union, Optional -from datetime import datetime -from typing_extensions import Literal, Annotated, TypeAlias - -from .plan import Plan -from .price import Price -from .._utils import PropertyInfo -from .._models import BaseModel -from .customer import Customer - -__all__ = [ - "SubscriptionUnschedulePendingPlanChangesResponse", - "AdjustmentInterval", - "AdjustmentIntervalAdjustment", - "AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment", - "AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment", - "AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment", - "AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment", - "AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment", - "BillingCycleAnchorConfiguration", - "DiscountInterval", - "DiscountIntervalAmountDiscountInterval", - "DiscountIntervalPercentageDiscountInterval", - "DiscountIntervalUsageDiscountInterval", - "FixedFeeQuantitySchedule", - "MaximumInterval", - "MinimumInterval", - "PriceInterval", - "PriceIntervalFixedFeeQuantityTransition", - "RedeemedCoupon", - "TrialInfo", -] - - -class AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment(BaseModel): - id: str - - adjustment_type: Literal["usage_discount"] - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - usage_discount: float - """ - The number of usage units by which to discount the price this adjustment applies - to in a given billing period. - """ - - -class AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment(BaseModel): - id: str - - adjustment_type: Literal["amount_discount"] - - amount_discount: str - """ - The amount by which to discount the prices this adjustment applies to in a given - billing period. - """ - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -class AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment(BaseModel): - id: str - - adjustment_type: Literal["percentage_discount"] - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - percentage_discount: float - """ - The percentage (as a value between 0 and 1) by which to discount the price - intervals this adjustment applies to in a given billing period. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -class AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment(BaseModel): - id: str - - adjustment_type: Literal["minimum"] - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - item_id: str - """The item ID that revenue from this minimum will be attributed to.""" - - minimum_amount: str - """ - The minimum amount to charge in a given billing period for the prices this - adjustment applies to. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -class AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment(BaseModel): - id: str - - adjustment_type: Literal["maximum"] - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - maximum_amount: str - """ - The maximum amount to charge in a given billing period for the prices this - adjustment applies to. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -AdjustmentIntervalAdjustment: TypeAlias = Annotated[ - Union[ - AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment, - AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment, - AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment, - AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment, - AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment, - ], - PropertyInfo(discriminator="adjustment_type"), -] - - -class AdjustmentInterval(BaseModel): - id: str - - adjustment: AdjustmentIntervalAdjustment - - applies_to_price_interval_ids: List[str] - """The price interval IDs that this adjustment applies to.""" - - end_date: Optional[datetime] = None - """The end date of the adjustment interval.""" - - start_date: datetime - """The start date of the adjustment interval.""" - - -class BillingCycleAnchorConfiguration(BaseModel): - day: int - """The day of the month on which the billing cycle is anchored. - - If the maximum number of days in a month is greater than this value, the last - day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April - means the billing period begins on the 30th. - """ - - month: Optional[int] = None - """The month on which the billing cycle is anchored (e.g. - - a quarterly price anchored in February would have cycles starting February, May, - August, and November). - """ - - year: Optional[int] = None - """The year on which the billing cycle is anchored (e.g. - - a 2 year billing cycle anchored on 2021 would have cycles starting on 2021, - 2023, 2025, etc.). - """ - - -class DiscountIntervalAmountDiscountInterval(BaseModel): - amount_discount: str - """Only available if discount_type is `amount`.""" - - applies_to_price_ids: List[str] - """The price ids that this discount interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this discount interval applies to.""" - - discount_type: Literal["amount"] - - end_date: Optional[datetime] = None - """The end date of the discount interval.""" - - start_date: datetime - """The start date of the discount interval.""" - - -class DiscountIntervalPercentageDiscountInterval(BaseModel): - applies_to_price_ids: List[str] - """The price ids that this discount interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this discount interval applies to.""" - - discount_type: Literal["percentage"] - - end_date: Optional[datetime] = None - """The end date of the discount interval.""" - - percentage_discount: float - """ - Only available if discount_type is `percentage`.This is a number between 0 - and 1. - """ - - start_date: datetime - """The start date of the discount interval.""" - - -class DiscountIntervalUsageDiscountInterval(BaseModel): - applies_to_price_ids: List[str] - """The price ids that this discount interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this discount interval applies to.""" - - discount_type: Literal["usage"] - - end_date: Optional[datetime] = None - """The end date of the discount interval.""" - - start_date: datetime - """The start date of the discount interval.""" - - usage_discount: float - """Only available if discount_type is `usage`. - - Number of usage units that this discount is for - """ - - -DiscountInterval: TypeAlias = Annotated[ - Union[ - DiscountIntervalAmountDiscountInterval, - DiscountIntervalPercentageDiscountInterval, - DiscountIntervalUsageDiscountInterval, - ], - PropertyInfo(discriminator="discount_type"), -] - - -class FixedFeeQuantitySchedule(BaseModel): - end_date: Optional[datetime] = None - - price_id: str - - quantity: float - - start_date: datetime - - -class MaximumInterval(BaseModel): - applies_to_price_ids: List[str] - """The price ids that this maximum interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this maximum interval applies to.""" - - end_date: Optional[datetime] = None - """The end date of the maximum interval.""" - - maximum_amount: str - """ - The maximum amount to charge in a given billing period for the price intervals - this transform applies to. - """ - - start_date: datetime - """The start date of the maximum interval.""" - - -class MinimumInterval(BaseModel): - applies_to_price_ids: List[str] - """The price ids that this minimum interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this minimum interval applies to.""" - - end_date: Optional[datetime] = None - """The end date of the minimum interval.""" - - minimum_amount: str - """ - The minimum amount to charge in a given billing period for the price intervals - this minimum applies to. - """ - - start_date: datetime - """The start date of the minimum interval.""" - - -class PriceIntervalFixedFeeQuantityTransition(BaseModel): - effective_date: datetime - - price_id: str - - quantity: int - - -class PriceInterval(BaseModel): - id: str - - billing_cycle_day: int - """The day of the month that Orb bills for this price""" - - current_billing_period_end_date: Optional[datetime] = None - """The end of the current billing period. - - This is an exclusive timestamp, such that the instant returned is exactly the - end of the billing period. Set to null if this price interval is not currently - active. - """ - - current_billing_period_start_date: Optional[datetime] = None - """The start date of the current billing period. - - This is an inclusive timestamp; the instant returned is exactly the beginning of - the billing period. Set to null if this price interval is not currently active. - """ - - end_date: Optional[datetime] = None - """The end date of the price interval. - - This is the date that Orb stops billing for this price. - """ - - filter: Optional[str] = None - """An additional filter to apply to usage queries.""" - - fixed_fee_quantity_transitions: Optional[List[PriceIntervalFixedFeeQuantityTransition]] = None - """The fixed fee quantity transitions for this price interval. - - This is only relevant for fixed fees. - """ - - price: Price - """ - The Price resource represents a price that can be billed on a subscription, - resulting in a charge on an invoice in the form of an invoice line item. Prices - take a quantity and determine an amount to bill. - - Orb supports a few different pricing models out of the box. Each of these models - is serialized differently in a given Price object. The model_type field - determines the key for the configuration object that is present. - - For more on the types of prices, see - [the core concepts documentation](/core-concepts#plan-and-price) - """ - - start_date: datetime - """The start date of the price interval. - - This is the date that Orb starts billing for this price. - """ - - usage_customer_ids: Optional[List[str]] = None - """ - A list of customer IDs whose usage events will be aggregated and billed under - this price interval. - """ - - -class RedeemedCoupon(BaseModel): - coupon_id: str - - end_date: Optional[datetime] = None - - start_date: datetime - - -class TrialInfo(BaseModel): - end_date: Optional[datetime] = None - - -class SubscriptionUnschedulePendingPlanChangesResponse(BaseModel): - id: str - - active_plan_phase_order: Optional[int] = None - """ - The current plan phase that is active, only if the subscription's plan has - phases. - """ - - adjustment_intervals: List[AdjustmentInterval] - """The adjustment intervals for this subscription.""" - - auto_collection: Optional[bool] = None - """ - Determines whether issued invoices for this subscription will automatically be - charged with the saved payment method on the due date. This property defaults to - the plan's behavior. If null, defaults to the customer's setting. - """ - - billing_cycle_anchor_configuration: BillingCycleAnchorConfiguration - - billing_cycle_day: int - """The day of the month on which the billing cycle is anchored. - - If the maximum number of days in a month is greater than this value, the last - day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April - means the billing period begins on the 30th. - """ - - created_at: datetime - - current_billing_period_end_date: Optional[datetime] = None - """The end of the current billing period. - - This is an exclusive timestamp, such that the instant returned is not part of - the billing period. Set to null for subscriptions that are not currently active. - """ - - current_billing_period_start_date: Optional[datetime] = None - """The start date of the current billing period. - - This is an inclusive timestamp; the instant returned is exactly the beginning of - the billing period. Set to null if the subscription is not currently active. - """ - - customer: Customer - """ - A customer is a buyer of your products, and the other party to the billing - relationship. - - In Orb, customers are assigned system generated identifiers automatically, but - it's often desirable to have these match existing identifiers in your system. To - avoid having to denormalize Orb ID information, you can pass in an - `external_customer_id` with your own identifier. See - [Customer ID Aliases](/events-and-metrics/customer-aliases) for further - information about how these aliases work in Orb. - - In addition to having an identifier in your system, a customer may exist in a - payment provider solution like Stripe. Use the `payment_provider_id` and the - `payment_provider` enum field to express this mapping. - - A customer also has a timezone (from the standard - [IANA timezone database](https://www.iana.org/time-zones)), which defaults to - your account's timezone. See [Timezone localization](/essentials/timezones) for - information on what this timezone parameter influences within Orb. - """ - - default_invoice_memo: Optional[str] = None - """Determines the default memo on this subscriptions' invoices. - - Note that if this is not provided, it is determined by the plan configuration. - """ - - discount_intervals: List[DiscountInterval] - """The discount intervals for this subscription.""" - - end_date: Optional[datetime] = None - """The date Orb stops billing for this subscription.""" - - fixed_fee_quantity_schedule: List[FixedFeeQuantitySchedule] - - invoicing_threshold: Optional[str] = None - - maximum_intervals: List[MaximumInterval] - """The maximum intervals for this subscription.""" - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum_intervals: List[MinimumInterval] - """The minimum intervals for this subscription.""" - - net_terms: int - """ - Determines the difference between the invoice issue date for subscription - invoices as the date that they are due. A value of `0` here represents that the - invoice is due on issue, whereas a value of `30` represents that the customer - has a month to pay the invoice. - """ - - plan: Plan - """ - The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be - subscribed to by a customer. Plans define the billing behavior of the - subscription. You can see more about how to configure prices in the - [Price resource](/reference/price). - """ - - price_intervals: List[PriceInterval] - """The price intervals for this subscription.""" - - redeemed_coupon: Optional[RedeemedCoupon] = None - - start_date: datetime - """The date Orb starts billing for this subscription.""" - - status: Literal["active", "ended", "upcoming"] - - trial_info: TrialInfo diff --git a/src/orb/types/subscription_update_fixed_fee_quantity_response.py b/src/orb/types/subscription_update_fixed_fee_quantity_response.py deleted file mode 100644 index 4be85ee3..00000000 --- a/src/orb/types/subscription_update_fixed_fee_quantity_response.py +++ /dev/null @@ -1,555 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List, Union, Optional -from datetime import datetime -from typing_extensions import Literal, Annotated, TypeAlias - -from .plan import Plan -from .price import Price -from .._utils import PropertyInfo -from .._models import BaseModel -from .customer import Customer - -__all__ = [ - "SubscriptionUpdateFixedFeeQuantityResponse", - "AdjustmentInterval", - "AdjustmentIntervalAdjustment", - "AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment", - "AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment", - "AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment", - "AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment", - "AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment", - "BillingCycleAnchorConfiguration", - "DiscountInterval", - "DiscountIntervalAmountDiscountInterval", - "DiscountIntervalPercentageDiscountInterval", - "DiscountIntervalUsageDiscountInterval", - "FixedFeeQuantitySchedule", - "MaximumInterval", - "MinimumInterval", - "PriceInterval", - "PriceIntervalFixedFeeQuantityTransition", - "RedeemedCoupon", - "TrialInfo", -] - - -class AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment(BaseModel): - id: str - - adjustment_type: Literal["usage_discount"] - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - usage_discount: float - """ - The number of usage units by which to discount the price this adjustment applies - to in a given billing period. - """ - - -class AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment(BaseModel): - id: str - - adjustment_type: Literal["amount_discount"] - - amount_discount: str - """ - The amount by which to discount the prices this adjustment applies to in a given - billing period. - """ - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -class AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment(BaseModel): - id: str - - adjustment_type: Literal["percentage_discount"] - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - percentage_discount: float - """ - The percentage (as a value between 0 and 1) by which to discount the price - intervals this adjustment applies to in a given billing period. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -class AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment(BaseModel): - id: str - - adjustment_type: Literal["minimum"] - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - item_id: str - """The item ID that revenue from this minimum will be attributed to.""" - - minimum_amount: str - """ - The minimum amount to charge in a given billing period for the prices this - adjustment applies to. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -class AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment(BaseModel): - id: str - - adjustment_type: Literal["maximum"] - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - maximum_amount: str - """ - The maximum amount to charge in a given billing period for the prices this - adjustment applies to. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -AdjustmentIntervalAdjustment: TypeAlias = Annotated[ - Union[ - AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment, - AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment, - AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment, - AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment, - AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment, - ], - PropertyInfo(discriminator="adjustment_type"), -] - - -class AdjustmentInterval(BaseModel): - id: str - - adjustment: AdjustmentIntervalAdjustment - - applies_to_price_interval_ids: List[str] - """The price interval IDs that this adjustment applies to.""" - - end_date: Optional[datetime] = None - """The end date of the adjustment interval.""" - - start_date: datetime - """The start date of the adjustment interval.""" - - -class BillingCycleAnchorConfiguration(BaseModel): - day: int - """The day of the month on which the billing cycle is anchored. - - If the maximum number of days in a month is greater than this value, the last - day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April - means the billing period begins on the 30th. - """ - - month: Optional[int] = None - """The month on which the billing cycle is anchored (e.g. - - a quarterly price anchored in February would have cycles starting February, May, - August, and November). - """ - - year: Optional[int] = None - """The year on which the billing cycle is anchored (e.g. - - a 2 year billing cycle anchored on 2021 would have cycles starting on 2021, - 2023, 2025, etc.). - """ - - -class DiscountIntervalAmountDiscountInterval(BaseModel): - amount_discount: str - """Only available if discount_type is `amount`.""" - - applies_to_price_ids: List[str] - """The price ids that this discount interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this discount interval applies to.""" - - discount_type: Literal["amount"] - - end_date: Optional[datetime] = None - """The end date of the discount interval.""" - - start_date: datetime - """The start date of the discount interval.""" - - -class DiscountIntervalPercentageDiscountInterval(BaseModel): - applies_to_price_ids: List[str] - """The price ids that this discount interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this discount interval applies to.""" - - discount_type: Literal["percentage"] - - end_date: Optional[datetime] = None - """The end date of the discount interval.""" - - percentage_discount: float - """ - Only available if discount_type is `percentage`.This is a number between 0 - and 1. - """ - - start_date: datetime - """The start date of the discount interval.""" - - -class DiscountIntervalUsageDiscountInterval(BaseModel): - applies_to_price_ids: List[str] - """The price ids that this discount interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this discount interval applies to.""" - - discount_type: Literal["usage"] - - end_date: Optional[datetime] = None - """The end date of the discount interval.""" - - start_date: datetime - """The start date of the discount interval.""" - - usage_discount: float - """Only available if discount_type is `usage`. - - Number of usage units that this discount is for - """ - - -DiscountInterval: TypeAlias = Annotated[ - Union[ - DiscountIntervalAmountDiscountInterval, - DiscountIntervalPercentageDiscountInterval, - DiscountIntervalUsageDiscountInterval, - ], - PropertyInfo(discriminator="discount_type"), -] - - -class FixedFeeQuantitySchedule(BaseModel): - end_date: Optional[datetime] = None - - price_id: str - - quantity: float - - start_date: datetime - - -class MaximumInterval(BaseModel): - applies_to_price_ids: List[str] - """The price ids that this maximum interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this maximum interval applies to.""" - - end_date: Optional[datetime] = None - """The end date of the maximum interval.""" - - maximum_amount: str - """ - The maximum amount to charge in a given billing period for the price intervals - this transform applies to. - """ - - start_date: datetime - """The start date of the maximum interval.""" - - -class MinimumInterval(BaseModel): - applies_to_price_ids: List[str] - """The price ids that this minimum interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this minimum interval applies to.""" - - end_date: Optional[datetime] = None - """The end date of the minimum interval.""" - - minimum_amount: str - """ - The minimum amount to charge in a given billing period for the price intervals - this minimum applies to. - """ - - start_date: datetime - """The start date of the minimum interval.""" - - -class PriceIntervalFixedFeeQuantityTransition(BaseModel): - effective_date: datetime - - price_id: str - - quantity: int - - -class PriceInterval(BaseModel): - id: str - - billing_cycle_day: int - """The day of the month that Orb bills for this price""" - - current_billing_period_end_date: Optional[datetime] = None - """The end of the current billing period. - - This is an exclusive timestamp, such that the instant returned is exactly the - end of the billing period. Set to null if this price interval is not currently - active. - """ - - current_billing_period_start_date: Optional[datetime] = None - """The start date of the current billing period. - - This is an inclusive timestamp; the instant returned is exactly the beginning of - the billing period. Set to null if this price interval is not currently active. - """ - - end_date: Optional[datetime] = None - """The end date of the price interval. - - This is the date that Orb stops billing for this price. - """ - - filter: Optional[str] = None - """An additional filter to apply to usage queries.""" - - fixed_fee_quantity_transitions: Optional[List[PriceIntervalFixedFeeQuantityTransition]] = None - """The fixed fee quantity transitions for this price interval. - - This is only relevant for fixed fees. - """ - - price: Price - """ - The Price resource represents a price that can be billed on a subscription, - resulting in a charge on an invoice in the form of an invoice line item. Prices - take a quantity and determine an amount to bill. - - Orb supports a few different pricing models out of the box. Each of these models - is serialized differently in a given Price object. The model_type field - determines the key for the configuration object that is present. - - For more on the types of prices, see - [the core concepts documentation](/core-concepts#plan-and-price) - """ - - start_date: datetime - """The start date of the price interval. - - This is the date that Orb starts billing for this price. - """ - - usage_customer_ids: Optional[List[str]] = None - """ - A list of customer IDs whose usage events will be aggregated and billed under - this price interval. - """ - - -class RedeemedCoupon(BaseModel): - coupon_id: str - - end_date: Optional[datetime] = None - - start_date: datetime - - -class TrialInfo(BaseModel): - end_date: Optional[datetime] = None - - -class SubscriptionUpdateFixedFeeQuantityResponse(BaseModel): - id: str - - active_plan_phase_order: Optional[int] = None - """ - The current plan phase that is active, only if the subscription's plan has - phases. - """ - - adjustment_intervals: List[AdjustmentInterval] - """The adjustment intervals for this subscription.""" - - auto_collection: Optional[bool] = None - """ - Determines whether issued invoices for this subscription will automatically be - charged with the saved payment method on the due date. This property defaults to - the plan's behavior. If null, defaults to the customer's setting. - """ - - billing_cycle_anchor_configuration: BillingCycleAnchorConfiguration - - billing_cycle_day: int - """The day of the month on which the billing cycle is anchored. - - If the maximum number of days in a month is greater than this value, the last - day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April - means the billing period begins on the 30th. - """ - - created_at: datetime - - current_billing_period_end_date: Optional[datetime] = None - """The end of the current billing period. - - This is an exclusive timestamp, such that the instant returned is not part of - the billing period. Set to null for subscriptions that are not currently active. - """ - - current_billing_period_start_date: Optional[datetime] = None - """The start date of the current billing period. - - This is an inclusive timestamp; the instant returned is exactly the beginning of - the billing period. Set to null if the subscription is not currently active. - """ - - customer: Customer - """ - A customer is a buyer of your products, and the other party to the billing - relationship. - - In Orb, customers are assigned system generated identifiers automatically, but - it's often desirable to have these match existing identifiers in your system. To - avoid having to denormalize Orb ID information, you can pass in an - `external_customer_id` with your own identifier. See - [Customer ID Aliases](/events-and-metrics/customer-aliases) for further - information about how these aliases work in Orb. - - In addition to having an identifier in your system, a customer may exist in a - payment provider solution like Stripe. Use the `payment_provider_id` and the - `payment_provider` enum field to express this mapping. - - A customer also has a timezone (from the standard - [IANA timezone database](https://www.iana.org/time-zones)), which defaults to - your account's timezone. See [Timezone localization](/essentials/timezones) for - information on what this timezone parameter influences within Orb. - """ - - default_invoice_memo: Optional[str] = None - """Determines the default memo on this subscriptions' invoices. - - Note that if this is not provided, it is determined by the plan configuration. - """ - - discount_intervals: List[DiscountInterval] - """The discount intervals for this subscription.""" - - end_date: Optional[datetime] = None - """The date Orb stops billing for this subscription.""" - - fixed_fee_quantity_schedule: List[FixedFeeQuantitySchedule] - - invoicing_threshold: Optional[str] = None - - maximum_intervals: List[MaximumInterval] - """The maximum intervals for this subscription.""" - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum_intervals: List[MinimumInterval] - """The minimum intervals for this subscription.""" - - net_terms: int - """ - Determines the difference between the invoice issue date for subscription - invoices as the date that they are due. A value of `0` here represents that the - invoice is due on issue, whereas a value of `30` represents that the customer - has a month to pay the invoice. - """ - - plan: Plan - """ - The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be - subscribed to by a customer. Plans define the billing behavior of the - subscription. You can see more about how to configure prices in the - [Price resource](/reference/price). - """ - - price_intervals: List[PriceInterval] - """The price intervals for this subscription.""" - - redeemed_coupon: Optional[RedeemedCoupon] = None - - start_date: datetime - """The date Orb starts billing for this subscription.""" - - status: Literal["active", "ended", "upcoming"] - - trial_info: TrialInfo diff --git a/src/orb/types/subscription_update_trial_response.py b/src/orb/types/subscription_update_trial_response.py deleted file mode 100644 index c56975f6..00000000 --- a/src/orb/types/subscription_update_trial_response.py +++ /dev/null @@ -1,555 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List, Union, Optional -from datetime import datetime -from typing_extensions import Literal, Annotated, TypeAlias - -from .plan import Plan -from .price import Price -from .._utils import PropertyInfo -from .._models import BaseModel -from .customer import Customer - -__all__ = [ - "SubscriptionUpdateTrialResponse", - "AdjustmentInterval", - "AdjustmentIntervalAdjustment", - "AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment", - "AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment", - "AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment", - "AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment", - "AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment", - "BillingCycleAnchorConfiguration", - "DiscountInterval", - "DiscountIntervalAmountDiscountInterval", - "DiscountIntervalPercentageDiscountInterval", - "DiscountIntervalUsageDiscountInterval", - "FixedFeeQuantitySchedule", - "MaximumInterval", - "MinimumInterval", - "PriceInterval", - "PriceIntervalFixedFeeQuantityTransition", - "RedeemedCoupon", - "TrialInfo", -] - - -class AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment(BaseModel): - id: str - - adjustment_type: Literal["usage_discount"] - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - usage_discount: float - """ - The number of usage units by which to discount the price this adjustment applies - to in a given billing period. - """ - - -class AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment(BaseModel): - id: str - - adjustment_type: Literal["amount_discount"] - - amount_discount: str - """ - The amount by which to discount the prices this adjustment applies to in a given - billing period. - """ - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -class AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment(BaseModel): - id: str - - adjustment_type: Literal["percentage_discount"] - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - percentage_discount: float - """ - The percentage (as a value between 0 and 1) by which to discount the price - intervals this adjustment applies to in a given billing period. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -class AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment(BaseModel): - id: str - - adjustment_type: Literal["minimum"] - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - item_id: str - """The item ID that revenue from this minimum will be attributed to.""" - - minimum_amount: str - """ - The minimum amount to charge in a given billing period for the prices this - adjustment applies to. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -class AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment(BaseModel): - id: str - - adjustment_type: Literal["maximum"] - - applies_to_price_ids: List[str] - """The price IDs that this adjustment applies to.""" - - is_invoice_level: bool - """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. - """ - - maximum_amount: str - """ - The maximum amount to charge in a given billing period for the prices this - adjustment applies to. - """ - - plan_phase_order: Optional[int] = None - """The plan phase in which this adjustment is active.""" - - reason: Optional[str] = None - """The reason for the adjustment.""" - - -AdjustmentIntervalAdjustment: TypeAlias = Annotated[ - Union[ - AdjustmentIntervalAdjustmentPlanPhaseUsageDiscountAdjustment, - AdjustmentIntervalAdjustmentPlanPhaseAmountDiscountAdjustment, - AdjustmentIntervalAdjustmentPlanPhasePercentageDiscountAdjustment, - AdjustmentIntervalAdjustmentPlanPhaseMinimumAdjustment, - AdjustmentIntervalAdjustmentPlanPhaseMaximumAdjustment, - ], - PropertyInfo(discriminator="adjustment_type"), -] - - -class AdjustmentInterval(BaseModel): - id: str - - adjustment: AdjustmentIntervalAdjustment - - applies_to_price_interval_ids: List[str] - """The price interval IDs that this adjustment applies to.""" - - end_date: Optional[datetime] = None - """The end date of the adjustment interval.""" - - start_date: datetime - """The start date of the adjustment interval.""" - - -class BillingCycleAnchorConfiguration(BaseModel): - day: int - """The day of the month on which the billing cycle is anchored. - - If the maximum number of days in a month is greater than this value, the last - day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April - means the billing period begins on the 30th. - """ - - month: Optional[int] = None - """The month on which the billing cycle is anchored (e.g. - - a quarterly price anchored in February would have cycles starting February, May, - August, and November). - """ - - year: Optional[int] = None - """The year on which the billing cycle is anchored (e.g. - - a 2 year billing cycle anchored on 2021 would have cycles starting on 2021, - 2023, 2025, etc.). - """ - - -class DiscountIntervalAmountDiscountInterval(BaseModel): - amount_discount: str - """Only available if discount_type is `amount`.""" - - applies_to_price_ids: List[str] - """The price ids that this discount interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this discount interval applies to.""" - - discount_type: Literal["amount"] - - end_date: Optional[datetime] = None - """The end date of the discount interval.""" - - start_date: datetime - """The start date of the discount interval.""" - - -class DiscountIntervalPercentageDiscountInterval(BaseModel): - applies_to_price_ids: List[str] - """The price ids that this discount interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this discount interval applies to.""" - - discount_type: Literal["percentage"] - - end_date: Optional[datetime] = None - """The end date of the discount interval.""" - - percentage_discount: float - """ - Only available if discount_type is `percentage`.This is a number between 0 - and 1. - """ - - start_date: datetime - """The start date of the discount interval.""" - - -class DiscountIntervalUsageDiscountInterval(BaseModel): - applies_to_price_ids: List[str] - """The price ids that this discount interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this discount interval applies to.""" - - discount_type: Literal["usage"] - - end_date: Optional[datetime] = None - """The end date of the discount interval.""" - - start_date: datetime - """The start date of the discount interval.""" - - usage_discount: float - """Only available if discount_type is `usage`. - - Number of usage units that this discount is for - """ - - -DiscountInterval: TypeAlias = Annotated[ - Union[ - DiscountIntervalAmountDiscountInterval, - DiscountIntervalPercentageDiscountInterval, - DiscountIntervalUsageDiscountInterval, - ], - PropertyInfo(discriminator="discount_type"), -] - - -class FixedFeeQuantitySchedule(BaseModel): - end_date: Optional[datetime] = None - - price_id: str - - quantity: float - - start_date: datetime - - -class MaximumInterval(BaseModel): - applies_to_price_ids: List[str] - """The price ids that this maximum interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this maximum interval applies to.""" - - end_date: Optional[datetime] = None - """The end date of the maximum interval.""" - - maximum_amount: str - """ - The maximum amount to charge in a given billing period for the price intervals - this transform applies to. - """ - - start_date: datetime - """The start date of the maximum interval.""" - - -class MinimumInterval(BaseModel): - applies_to_price_ids: List[str] - """The price ids that this minimum interval applies to.""" - - applies_to_price_interval_ids: List[str] - """The price interval ids that this minimum interval applies to.""" - - end_date: Optional[datetime] = None - """The end date of the minimum interval.""" - - minimum_amount: str - """ - The minimum amount to charge in a given billing period for the price intervals - this minimum applies to. - """ - - start_date: datetime - """The start date of the minimum interval.""" - - -class PriceIntervalFixedFeeQuantityTransition(BaseModel): - effective_date: datetime - - price_id: str - - quantity: int - - -class PriceInterval(BaseModel): - id: str - - billing_cycle_day: int - """The day of the month that Orb bills for this price""" - - current_billing_period_end_date: Optional[datetime] = None - """The end of the current billing period. - - This is an exclusive timestamp, such that the instant returned is exactly the - end of the billing period. Set to null if this price interval is not currently - active. - """ - - current_billing_period_start_date: Optional[datetime] = None - """The start date of the current billing period. - - This is an inclusive timestamp; the instant returned is exactly the beginning of - the billing period. Set to null if this price interval is not currently active. - """ - - end_date: Optional[datetime] = None - """The end date of the price interval. - - This is the date that Orb stops billing for this price. - """ - - filter: Optional[str] = None - """An additional filter to apply to usage queries.""" - - fixed_fee_quantity_transitions: Optional[List[PriceIntervalFixedFeeQuantityTransition]] = None - """The fixed fee quantity transitions for this price interval. - - This is only relevant for fixed fees. - """ - - price: Price - """ - The Price resource represents a price that can be billed on a subscription, - resulting in a charge on an invoice in the form of an invoice line item. Prices - take a quantity and determine an amount to bill. - - Orb supports a few different pricing models out of the box. Each of these models - is serialized differently in a given Price object. The model_type field - determines the key for the configuration object that is present. - - For more on the types of prices, see - [the core concepts documentation](/core-concepts#plan-and-price) - """ - - start_date: datetime - """The start date of the price interval. - - This is the date that Orb starts billing for this price. - """ - - usage_customer_ids: Optional[List[str]] = None - """ - A list of customer IDs whose usage events will be aggregated and billed under - this price interval. - """ - - -class RedeemedCoupon(BaseModel): - coupon_id: str - - end_date: Optional[datetime] = None - - start_date: datetime - - -class TrialInfo(BaseModel): - end_date: Optional[datetime] = None - - -class SubscriptionUpdateTrialResponse(BaseModel): - id: str - - active_plan_phase_order: Optional[int] = None - """ - The current plan phase that is active, only if the subscription's plan has - phases. - """ - - adjustment_intervals: List[AdjustmentInterval] - """The adjustment intervals for this subscription.""" - - auto_collection: Optional[bool] = None - """ - Determines whether issued invoices for this subscription will automatically be - charged with the saved payment method on the due date. This property defaults to - the plan's behavior. If null, defaults to the customer's setting. - """ - - billing_cycle_anchor_configuration: BillingCycleAnchorConfiguration - - billing_cycle_day: int - """The day of the month on which the billing cycle is anchored. - - If the maximum number of days in a month is greater than this value, the last - day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April - means the billing period begins on the 30th. - """ - - created_at: datetime - - current_billing_period_end_date: Optional[datetime] = None - """The end of the current billing period. - - This is an exclusive timestamp, such that the instant returned is not part of - the billing period. Set to null for subscriptions that are not currently active. - """ - - current_billing_period_start_date: Optional[datetime] = None - """The start date of the current billing period. - - This is an inclusive timestamp; the instant returned is exactly the beginning of - the billing period. Set to null if the subscription is not currently active. - """ - - customer: Customer - """ - A customer is a buyer of your products, and the other party to the billing - relationship. - - In Orb, customers are assigned system generated identifiers automatically, but - it's often desirable to have these match existing identifiers in your system. To - avoid having to denormalize Orb ID information, you can pass in an - `external_customer_id` with your own identifier. See - [Customer ID Aliases](/events-and-metrics/customer-aliases) for further - information about how these aliases work in Orb. - - In addition to having an identifier in your system, a customer may exist in a - payment provider solution like Stripe. Use the `payment_provider_id` and the - `payment_provider` enum field to express this mapping. - - A customer also has a timezone (from the standard - [IANA timezone database](https://www.iana.org/time-zones)), which defaults to - your account's timezone. See [Timezone localization](/essentials/timezones) for - information on what this timezone parameter influences within Orb. - """ - - default_invoice_memo: Optional[str] = None - """Determines the default memo on this subscriptions' invoices. - - Note that if this is not provided, it is determined by the plan configuration. - """ - - discount_intervals: List[DiscountInterval] - """The discount intervals for this subscription.""" - - end_date: Optional[datetime] = None - """The date Orb stops billing for this subscription.""" - - fixed_fee_quantity_schedule: List[FixedFeeQuantitySchedule] - - invoicing_threshold: Optional[str] = None - - maximum_intervals: List[MaximumInterval] - """The maximum intervals for this subscription.""" - - metadata: Dict[str, str] - """User specified key-value pairs for the resource. - - If not present, this defaults to an empty dictionary. Individual keys can be - removed by setting the value to `null`, and the entire metadata mapping can be - cleared by setting `metadata` to `null`. - """ - - minimum_intervals: List[MinimumInterval] - """The minimum intervals for this subscription.""" - - net_terms: int - """ - Determines the difference between the invoice issue date for subscription - invoices as the date that they are due. A value of `0` here represents that the - invoice is due on issue, whereas a value of `30` represents that the customer - has a month to pay the invoice. - """ - - plan: Plan - """ - The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be - subscribed to by a customer. Plans define the billing behavior of the - subscription. You can see more about how to configure prices in the - [Price resource](/reference/price). - """ - - price_intervals: List[PriceInterval] - """The price intervals for this subscription.""" - - redeemed_coupon: Optional[RedeemedCoupon] = None - - start_date: datetime - """The date Orb starts billing for this subscription.""" - - status: Literal["active", "ended", "upcoming"] - - trial_info: TrialInfo diff --git a/src/orb/types/subscription_usage.py b/src/orb/types/subscription_usage.py index 4a5c4f2e..124140df 100644 --- a/src/orb/types/subscription_usage.py +++ b/src/orb/types/subscription_usage.py @@ -1,44 +1,27 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List, Union, Optional -from datetime import datetime from typing_extensions import Literal, TypeAlias from .._models import BaseModel +from .shared.usage_model import UsageModel from .shared.pagination_metadata import PaginationMetadata +from .shared.billable_metric_simple_model import BillableMetricSimpleModel __all__ = [ "SubscriptionUsage", "UngroupedSubscriptionUsage", "UngroupedSubscriptionUsageData", - "UngroupedSubscriptionUsageDataBillableMetric", - "UngroupedSubscriptionUsageDataUsage", "GroupedSubscriptionUsage", "GroupedSubscriptionUsageData", - "GroupedSubscriptionUsageDataBillableMetric", "GroupedSubscriptionUsageDataMetricGroup", - "GroupedSubscriptionUsageDataUsage", ] -class UngroupedSubscriptionUsageDataBillableMetric(BaseModel): - id: str - - name: str - - -class UngroupedSubscriptionUsageDataUsage(BaseModel): - quantity: float - - timeframe_end: datetime - - timeframe_start: datetime - - class UngroupedSubscriptionUsageData(BaseModel): - billable_metric: UngroupedSubscriptionUsageDataBillableMetric + billable_metric: BillableMetricSimpleModel - usage: List[UngroupedSubscriptionUsageDataUsage] + usage: List[UsageModel] view_mode: Literal["periodic", "cumulative"] @@ -47,32 +30,18 @@ class UngroupedSubscriptionUsage(BaseModel): data: List[UngroupedSubscriptionUsageData] -class GroupedSubscriptionUsageDataBillableMetric(BaseModel): - id: str - - name: str - - class GroupedSubscriptionUsageDataMetricGroup(BaseModel): property_key: str property_value: str -class GroupedSubscriptionUsageDataUsage(BaseModel): - quantity: float - - timeframe_end: datetime - - timeframe_start: datetime - - class GroupedSubscriptionUsageData(BaseModel): - billable_metric: GroupedSubscriptionUsageDataBillableMetric + billable_metric: BillableMetricSimpleModel metric_group: GroupedSubscriptionUsageDataMetricGroup - usage: List[GroupedSubscriptionUsageDataUsage] + usage: List[UsageModel] view_mode: Literal["periodic", "cumulative"] diff --git a/src/orb/types/subscriptions.py b/src/orb/types/subscriptions.py index c80fef11..f331072d 100644 --- a/src/orb/types/subscriptions.py +++ b/src/orb/types/subscriptions.py @@ -3,13 +3,13 @@ from typing import List from .._models import BaseModel -from .subscription import Subscription +from .shared.subscription_model import SubscriptionModel from .shared.pagination_metadata import PaginationMetadata __all__ = ["Subscriptions"] class Subscriptions(BaseModel): - data: List[Subscription] + data: List[SubscriptionModel] pagination_metadata: PaginationMetadata diff --git a/tests/api_resources/coupons/test_subscriptions.py b/tests/api_resources/coupons/test_subscriptions.py index 4c190521..6e2e5a7f 100644 --- a/tests/api_resources/coupons/test_subscriptions.py +++ b/tests/api_resources/coupons/test_subscriptions.py @@ -8,9 +8,9 @@ import pytest from orb import Orb, AsyncOrb -from orb.types import Subscription from tests.utils import assert_matches_type from orb.pagination import SyncPage, AsyncPage +from orb.types.shared import SubscriptionModel base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -23,7 +23,7 @@ def test_method_list(self, client: Orb) -> None: subscription = client.coupons.subscriptions.list( coupon_id="coupon_id", ) - assert_matches_type(SyncPage[Subscription], subscription, path=["response"]) + assert_matches_type(SyncPage[SubscriptionModel], subscription, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Orb) -> None: @@ -32,7 +32,7 @@ def test_method_list_with_all_params(self, client: Orb) -> None: cursor="cursor", limit=1, ) - assert_matches_type(SyncPage[Subscription], subscription, path=["response"]) + assert_matches_type(SyncPage[SubscriptionModel], subscription, path=["response"]) @parametrize def test_raw_response_list(self, client: Orb) -> None: @@ -43,7 +43,7 @@ def test_raw_response_list(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SyncPage[Subscription], subscription, path=["response"]) + assert_matches_type(SyncPage[SubscriptionModel], subscription, path=["response"]) @parametrize def test_streaming_response_list(self, client: Orb) -> None: @@ -54,7 +54,7 @@ def test_streaming_response_list(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SyncPage[Subscription], subscription, path=["response"]) + assert_matches_type(SyncPage[SubscriptionModel], subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -74,7 +74,7 @@ async def test_method_list(self, async_client: AsyncOrb) -> None: subscription = await async_client.coupons.subscriptions.list( coupon_id="coupon_id", ) - assert_matches_type(AsyncPage[Subscription], subscription, path=["response"]) + assert_matches_type(AsyncPage[SubscriptionModel], subscription, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None: @@ -83,7 +83,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None cursor="cursor", limit=1, ) - assert_matches_type(AsyncPage[Subscription], subscription, path=["response"]) + assert_matches_type(AsyncPage[SubscriptionModel], subscription, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncOrb) -> None: @@ -94,7 +94,7 @@ async def test_raw_response_list(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(AsyncPage[Subscription], subscription, path=["response"]) + assert_matches_type(AsyncPage[SubscriptionModel], subscription, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: @@ -105,7 +105,7 @@ async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(AsyncPage[Subscription], subscription, path=["response"]) + assert_matches_type(AsyncPage[SubscriptionModel], subscription, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/customers/credits/test_ledger.py b/tests/api_resources/customers/credits/test_ledger.py index ff759955..478e10ac 100644 --- a/tests/api_resources/customers/credits/test_ledger.py +++ b/tests/api_resources/customers/credits/test_ledger.py @@ -11,12 +11,7 @@ from orb._utils import parse_date, parse_datetime from tests.utils import assert_matches_type from orb.pagination import SyncPage, AsyncPage -from orb.types.customers.credits import ( - LedgerListResponse, - LedgerCreateEntryResponse, - LedgerListByExternalIDResponse, - LedgerCreateEntryByExternalIDResponse, -) +from orb.types.shared import CreditLedgerEntryModel base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -29,7 +24,7 @@ def test_method_list(self, client: Orb) -> None: ledger = client.customers.credits.ledger.list( customer_id="customer_id", ) - assert_matches_type(SyncPage[LedgerListResponse], ledger, path=["response"]) + assert_matches_type(SyncPage[CreditLedgerEntryModel], ledger, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Orb) -> None: @@ -46,7 +41,7 @@ def test_method_list_with_all_params(self, client: Orb) -> None: limit=1, minimum_amount="minimum_amount", ) - assert_matches_type(SyncPage[LedgerListResponse], ledger, path=["response"]) + assert_matches_type(SyncPage[CreditLedgerEntryModel], ledger, path=["response"]) @parametrize def test_raw_response_list(self, client: Orb) -> None: @@ -57,7 +52,7 @@ def test_raw_response_list(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(SyncPage[LedgerListResponse], ledger, path=["response"]) + assert_matches_type(SyncPage[CreditLedgerEntryModel], ledger, path=["response"]) @parametrize def test_streaming_response_list(self, client: Orb) -> None: @@ -68,7 +63,7 @@ def test_streaming_response_list(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(SyncPage[LedgerListResponse], ledger, path=["response"]) + assert_matches_type(SyncPage[CreditLedgerEntryModel], ledger, path=["response"]) assert cast(Any, response.is_closed) is True @@ -86,7 +81,7 @@ def test_method_create_entry_overload_1(self, client: Orb) -> None: amount=0, entry_type="increment", ) - assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize def test_method_create_entry_with_all_params_overload_1(self, client: Orb) -> None: @@ -107,7 +102,7 @@ def test_method_create_entry_with_all_params_overload_1(self, client: Orb) -> No metadata={"foo": "string"}, per_unit_cost_basis="per_unit_cost_basis", ) - assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize def test_raw_response_create_entry_overload_1(self, client: Orb) -> None: @@ -120,7 +115,7 @@ def test_raw_response_create_entry_overload_1(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize def test_streaming_response_create_entry_overload_1(self, client: Orb) -> None: @@ -133,7 +128,7 @@ def test_streaming_response_create_entry_overload_1(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) assert cast(Any, response.is_closed) is True @@ -153,7 +148,7 @@ def test_method_create_entry_overload_2(self, client: Orb) -> None: amount=0, entry_type="decrement", ) - assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize def test_method_create_entry_with_all_params_overload_2(self, client: Orb) -> None: @@ -165,7 +160,7 @@ def test_method_create_entry_with_all_params_overload_2(self, client: Orb) -> No description="description", metadata={"foo": "string"}, ) - assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize def test_raw_response_create_entry_overload_2(self, client: Orb) -> None: @@ -178,7 +173,7 @@ def test_raw_response_create_entry_overload_2(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize def test_streaming_response_create_entry_overload_2(self, client: Orb) -> None: @@ -191,7 +186,7 @@ def test_streaming_response_create_entry_overload_2(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) assert cast(Any, response.is_closed) is True @@ -212,7 +207,7 @@ def test_method_create_entry_overload_3(self, client: Orb) -> None: expiry_date=parse_datetime("2019-12-27T18:11:19.117Z"), target_expiry_date=parse_date("2019-12-27"), ) - assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize def test_method_create_entry_with_all_params_overload_3(self, client: Orb) -> None: @@ -227,7 +222,7 @@ def test_method_create_entry_with_all_params_overload_3(self, client: Orb) -> No description="description", metadata={"foo": "string"}, ) - assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize def test_raw_response_create_entry_overload_3(self, client: Orb) -> None: @@ -241,7 +236,7 @@ def test_raw_response_create_entry_overload_3(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize def test_streaming_response_create_entry_overload_3(self, client: Orb) -> None: @@ -255,7 +250,7 @@ def test_streaming_response_create_entry_overload_3(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) assert cast(Any, response.is_closed) is True @@ -277,7 +272,7 @@ def test_method_create_entry_overload_4(self, client: Orb) -> None: block_id="block_id", entry_type="void", ) - assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize def test_method_create_entry_with_all_params_overload_4(self, client: Orb) -> None: @@ -291,7 +286,7 @@ def test_method_create_entry_with_all_params_overload_4(self, client: Orb) -> No metadata={"foo": "string"}, void_reason="refund", ) - assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize def test_raw_response_create_entry_overload_4(self, client: Orb) -> None: @@ -305,7 +300,7 @@ def test_raw_response_create_entry_overload_4(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize def test_streaming_response_create_entry_overload_4(self, client: Orb) -> None: @@ -319,7 +314,7 @@ def test_streaming_response_create_entry_overload_4(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) assert cast(Any, response.is_closed) is True @@ -341,7 +336,7 @@ def test_method_create_entry_overload_5(self, client: Orb) -> None: block_id="block_id", entry_type="amendment", ) - assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize def test_method_create_entry_with_all_params_overload_5(self, client: Orb) -> None: @@ -354,7 +349,7 @@ def test_method_create_entry_with_all_params_overload_5(self, client: Orb) -> No description="description", metadata={"foo": "string"}, ) - assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize def test_raw_response_create_entry_overload_5(self, client: Orb) -> None: @@ -368,7 +363,7 @@ def test_raw_response_create_entry_overload_5(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize def test_streaming_response_create_entry_overload_5(self, client: Orb) -> None: @@ -382,7 +377,7 @@ def test_streaming_response_create_entry_overload_5(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) assert cast(Any, response.is_closed) is True @@ -403,7 +398,7 @@ def test_method_create_entry_by_external_id_overload_1(self, client: Orb) -> Non amount=0, entry_type="increment", ) - assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize def test_method_create_entry_by_external_id_with_all_params_overload_1(self, client: Orb) -> None: @@ -424,7 +419,7 @@ def test_method_create_entry_by_external_id_with_all_params_overload_1(self, cli metadata={"foo": "string"}, per_unit_cost_basis="per_unit_cost_basis", ) - assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize def test_raw_response_create_entry_by_external_id_overload_1(self, client: Orb) -> None: @@ -437,7 +432,7 @@ def test_raw_response_create_entry_by_external_id_overload_1(self, client: Orb) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize def test_streaming_response_create_entry_by_external_id_overload_1(self, client: Orb) -> None: @@ -450,7 +445,7 @@ def test_streaming_response_create_entry_by_external_id_overload_1(self, client: assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) assert cast(Any, response.is_closed) is True @@ -470,7 +465,7 @@ def test_method_create_entry_by_external_id_overload_2(self, client: Orb) -> Non amount=0, entry_type="decrement", ) - assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize def test_method_create_entry_by_external_id_with_all_params_overload_2(self, client: Orb) -> None: @@ -482,7 +477,7 @@ def test_method_create_entry_by_external_id_with_all_params_overload_2(self, cli description="description", metadata={"foo": "string"}, ) - assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize def test_raw_response_create_entry_by_external_id_overload_2(self, client: Orb) -> None: @@ -495,7 +490,7 @@ def test_raw_response_create_entry_by_external_id_overload_2(self, client: Orb) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize def test_streaming_response_create_entry_by_external_id_overload_2(self, client: Orb) -> None: @@ -508,7 +503,7 @@ def test_streaming_response_create_entry_by_external_id_overload_2(self, client: assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) assert cast(Any, response.is_closed) is True @@ -529,7 +524,7 @@ def test_method_create_entry_by_external_id_overload_3(self, client: Orb) -> Non expiry_date=parse_datetime("2019-12-27T18:11:19.117Z"), target_expiry_date=parse_date("2019-12-27"), ) - assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize def test_method_create_entry_by_external_id_with_all_params_overload_3(self, client: Orb) -> None: @@ -544,7 +539,7 @@ def test_method_create_entry_by_external_id_with_all_params_overload_3(self, cli description="description", metadata={"foo": "string"}, ) - assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize def test_raw_response_create_entry_by_external_id_overload_3(self, client: Orb) -> None: @@ -558,7 +553,7 @@ def test_raw_response_create_entry_by_external_id_overload_3(self, client: Orb) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize def test_streaming_response_create_entry_by_external_id_overload_3(self, client: Orb) -> None: @@ -572,7 +567,7 @@ def test_streaming_response_create_entry_by_external_id_overload_3(self, client: assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) assert cast(Any, response.is_closed) is True @@ -594,7 +589,7 @@ def test_method_create_entry_by_external_id_overload_4(self, client: Orb) -> Non block_id="block_id", entry_type="void", ) - assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize def test_method_create_entry_by_external_id_with_all_params_overload_4(self, client: Orb) -> None: @@ -608,7 +603,7 @@ def test_method_create_entry_by_external_id_with_all_params_overload_4(self, cli metadata={"foo": "string"}, void_reason="refund", ) - assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize def test_raw_response_create_entry_by_external_id_overload_4(self, client: Orb) -> None: @@ -622,7 +617,7 @@ def test_raw_response_create_entry_by_external_id_overload_4(self, client: Orb) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize def test_streaming_response_create_entry_by_external_id_overload_4(self, client: Orb) -> None: @@ -636,7 +631,7 @@ def test_streaming_response_create_entry_by_external_id_overload_4(self, client: assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) assert cast(Any, response.is_closed) is True @@ -658,7 +653,7 @@ def test_method_create_entry_by_external_id_overload_5(self, client: Orb) -> Non block_id="block_id", entry_type="amendment", ) - assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize def test_method_create_entry_by_external_id_with_all_params_overload_5(self, client: Orb) -> None: @@ -671,7 +666,7 @@ def test_method_create_entry_by_external_id_with_all_params_overload_5(self, cli description="description", metadata={"foo": "string"}, ) - assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize def test_raw_response_create_entry_by_external_id_overload_5(self, client: Orb) -> None: @@ -685,7 +680,7 @@ def test_raw_response_create_entry_by_external_id_overload_5(self, client: Orb) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize def test_streaming_response_create_entry_by_external_id_overload_5(self, client: Orb) -> None: @@ -699,7 +694,7 @@ def test_streaming_response_create_entry_by_external_id_overload_5(self, client: assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) assert cast(Any, response.is_closed) is True @@ -718,7 +713,7 @@ def test_method_list_by_external_id(self, client: Orb) -> None: ledger = client.customers.credits.ledger.list_by_external_id( external_customer_id="external_customer_id", ) - assert_matches_type(SyncPage[LedgerListByExternalIDResponse], ledger, path=["response"]) + assert_matches_type(SyncPage[CreditLedgerEntryModel], ledger, path=["response"]) @parametrize def test_method_list_by_external_id_with_all_params(self, client: Orb) -> None: @@ -735,7 +730,7 @@ def test_method_list_by_external_id_with_all_params(self, client: Orb) -> None: limit=1, minimum_amount="minimum_amount", ) - assert_matches_type(SyncPage[LedgerListByExternalIDResponse], ledger, path=["response"]) + assert_matches_type(SyncPage[CreditLedgerEntryModel], ledger, path=["response"]) @parametrize def test_raw_response_list_by_external_id(self, client: Orb) -> None: @@ -746,7 +741,7 @@ def test_raw_response_list_by_external_id(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(SyncPage[LedgerListByExternalIDResponse], ledger, path=["response"]) + assert_matches_type(SyncPage[CreditLedgerEntryModel], ledger, path=["response"]) @parametrize def test_streaming_response_list_by_external_id(self, client: Orb) -> None: @@ -757,7 +752,7 @@ def test_streaming_response_list_by_external_id(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(SyncPage[LedgerListByExternalIDResponse], ledger, path=["response"]) + assert_matches_type(SyncPage[CreditLedgerEntryModel], ledger, path=["response"]) assert cast(Any, response.is_closed) is True @@ -777,7 +772,7 @@ async def test_method_list(self, async_client: AsyncOrb) -> None: ledger = await async_client.customers.credits.ledger.list( customer_id="customer_id", ) - assert_matches_type(AsyncPage[LedgerListResponse], ledger, path=["response"]) + assert_matches_type(AsyncPage[CreditLedgerEntryModel], ledger, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None: @@ -794,7 +789,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None limit=1, minimum_amount="minimum_amount", ) - assert_matches_type(AsyncPage[LedgerListResponse], ledger, path=["response"]) + assert_matches_type(AsyncPage[CreditLedgerEntryModel], ledger, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncOrb) -> None: @@ -805,7 +800,7 @@ async def test_raw_response_list(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(AsyncPage[LedgerListResponse], ledger, path=["response"]) + assert_matches_type(AsyncPage[CreditLedgerEntryModel], ledger, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: @@ -816,7 +811,7 @@ async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = await response.parse() - assert_matches_type(AsyncPage[LedgerListResponse], ledger, path=["response"]) + assert_matches_type(AsyncPage[CreditLedgerEntryModel], ledger, path=["response"]) assert cast(Any, response.is_closed) is True @@ -834,7 +829,7 @@ async def test_method_create_entry_overload_1(self, async_client: AsyncOrb) -> N amount=0, entry_type="increment", ) - assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize async def test_method_create_entry_with_all_params_overload_1(self, async_client: AsyncOrb) -> None: @@ -855,7 +850,7 @@ async def test_method_create_entry_with_all_params_overload_1(self, async_client metadata={"foo": "string"}, per_unit_cost_basis="per_unit_cost_basis", ) - assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize async def test_raw_response_create_entry_overload_1(self, async_client: AsyncOrb) -> None: @@ -868,7 +863,7 @@ async def test_raw_response_create_entry_overload_1(self, async_client: AsyncOrb assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize async def test_streaming_response_create_entry_overload_1(self, async_client: AsyncOrb) -> None: @@ -881,7 +876,7 @@ async def test_streaming_response_create_entry_overload_1(self, async_client: As assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = await response.parse() - assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) assert cast(Any, response.is_closed) is True @@ -901,7 +896,7 @@ async def test_method_create_entry_overload_2(self, async_client: AsyncOrb) -> N amount=0, entry_type="decrement", ) - assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize async def test_method_create_entry_with_all_params_overload_2(self, async_client: AsyncOrb) -> None: @@ -913,7 +908,7 @@ async def test_method_create_entry_with_all_params_overload_2(self, async_client description="description", metadata={"foo": "string"}, ) - assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize async def test_raw_response_create_entry_overload_2(self, async_client: AsyncOrb) -> None: @@ -926,7 +921,7 @@ async def test_raw_response_create_entry_overload_2(self, async_client: AsyncOrb assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize async def test_streaming_response_create_entry_overload_2(self, async_client: AsyncOrb) -> None: @@ -939,7 +934,7 @@ async def test_streaming_response_create_entry_overload_2(self, async_client: As assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = await response.parse() - assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) assert cast(Any, response.is_closed) is True @@ -960,7 +955,7 @@ async def test_method_create_entry_overload_3(self, async_client: AsyncOrb) -> N expiry_date=parse_datetime("2019-12-27T18:11:19.117Z"), target_expiry_date=parse_date("2019-12-27"), ) - assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize async def test_method_create_entry_with_all_params_overload_3(self, async_client: AsyncOrb) -> None: @@ -975,7 +970,7 @@ async def test_method_create_entry_with_all_params_overload_3(self, async_client description="description", metadata={"foo": "string"}, ) - assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize async def test_raw_response_create_entry_overload_3(self, async_client: AsyncOrb) -> None: @@ -989,7 +984,7 @@ async def test_raw_response_create_entry_overload_3(self, async_client: AsyncOrb assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize async def test_streaming_response_create_entry_overload_3(self, async_client: AsyncOrb) -> None: @@ -1003,7 +998,7 @@ async def test_streaming_response_create_entry_overload_3(self, async_client: As assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = await response.parse() - assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1025,7 +1020,7 @@ async def test_method_create_entry_overload_4(self, async_client: AsyncOrb) -> N block_id="block_id", entry_type="void", ) - assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize async def test_method_create_entry_with_all_params_overload_4(self, async_client: AsyncOrb) -> None: @@ -1039,7 +1034,7 @@ async def test_method_create_entry_with_all_params_overload_4(self, async_client metadata={"foo": "string"}, void_reason="refund", ) - assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize async def test_raw_response_create_entry_overload_4(self, async_client: AsyncOrb) -> None: @@ -1053,7 +1048,7 @@ async def test_raw_response_create_entry_overload_4(self, async_client: AsyncOrb assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize async def test_streaming_response_create_entry_overload_4(self, async_client: AsyncOrb) -> None: @@ -1067,7 +1062,7 @@ async def test_streaming_response_create_entry_overload_4(self, async_client: As assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = await response.parse() - assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1089,7 +1084,7 @@ async def test_method_create_entry_overload_5(self, async_client: AsyncOrb) -> N block_id="block_id", entry_type="amendment", ) - assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize async def test_method_create_entry_with_all_params_overload_5(self, async_client: AsyncOrb) -> None: @@ -1102,7 +1097,7 @@ async def test_method_create_entry_with_all_params_overload_5(self, async_client description="description", metadata={"foo": "string"}, ) - assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize async def test_raw_response_create_entry_overload_5(self, async_client: AsyncOrb) -> None: @@ -1116,7 +1111,7 @@ async def test_raw_response_create_entry_overload_5(self, async_client: AsyncOrb assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize async def test_streaming_response_create_entry_overload_5(self, async_client: AsyncOrb) -> None: @@ -1130,7 +1125,7 @@ async def test_streaming_response_create_entry_overload_5(self, async_client: As assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = await response.parse() - assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1151,7 +1146,7 @@ async def test_method_create_entry_by_external_id_overload_1(self, async_client: amount=0, entry_type="increment", ) - assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize async def test_method_create_entry_by_external_id_with_all_params_overload_1(self, async_client: AsyncOrb) -> None: @@ -1172,7 +1167,7 @@ async def test_method_create_entry_by_external_id_with_all_params_overload_1(sel metadata={"foo": "string"}, per_unit_cost_basis="per_unit_cost_basis", ) - assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize async def test_raw_response_create_entry_by_external_id_overload_1(self, async_client: AsyncOrb) -> None: @@ -1185,7 +1180,7 @@ async def test_raw_response_create_entry_by_external_id_overload_1(self, async_c assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize async def test_streaming_response_create_entry_by_external_id_overload_1(self, async_client: AsyncOrb) -> None: @@ -1198,7 +1193,7 @@ async def test_streaming_response_create_entry_by_external_id_overload_1(self, a assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = await response.parse() - assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1218,7 +1213,7 @@ async def test_method_create_entry_by_external_id_overload_2(self, async_client: amount=0, entry_type="decrement", ) - assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize async def test_method_create_entry_by_external_id_with_all_params_overload_2(self, async_client: AsyncOrb) -> None: @@ -1230,7 +1225,7 @@ async def test_method_create_entry_by_external_id_with_all_params_overload_2(sel description="description", metadata={"foo": "string"}, ) - assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize async def test_raw_response_create_entry_by_external_id_overload_2(self, async_client: AsyncOrb) -> None: @@ -1243,7 +1238,7 @@ async def test_raw_response_create_entry_by_external_id_overload_2(self, async_c assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize async def test_streaming_response_create_entry_by_external_id_overload_2(self, async_client: AsyncOrb) -> None: @@ -1256,7 +1251,7 @@ async def test_streaming_response_create_entry_by_external_id_overload_2(self, a assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = await response.parse() - assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1277,7 +1272,7 @@ async def test_method_create_entry_by_external_id_overload_3(self, async_client: expiry_date=parse_datetime("2019-12-27T18:11:19.117Z"), target_expiry_date=parse_date("2019-12-27"), ) - assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize async def test_method_create_entry_by_external_id_with_all_params_overload_3(self, async_client: AsyncOrb) -> None: @@ -1292,7 +1287,7 @@ async def test_method_create_entry_by_external_id_with_all_params_overload_3(sel description="description", metadata={"foo": "string"}, ) - assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize async def test_raw_response_create_entry_by_external_id_overload_3(self, async_client: AsyncOrb) -> None: @@ -1306,7 +1301,7 @@ async def test_raw_response_create_entry_by_external_id_overload_3(self, async_c assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize async def test_streaming_response_create_entry_by_external_id_overload_3(self, async_client: AsyncOrb) -> None: @@ -1320,7 +1315,7 @@ async def test_streaming_response_create_entry_by_external_id_overload_3(self, a assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = await response.parse() - assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1342,7 +1337,7 @@ async def test_method_create_entry_by_external_id_overload_4(self, async_client: block_id="block_id", entry_type="void", ) - assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize async def test_method_create_entry_by_external_id_with_all_params_overload_4(self, async_client: AsyncOrb) -> None: @@ -1356,7 +1351,7 @@ async def test_method_create_entry_by_external_id_with_all_params_overload_4(sel metadata={"foo": "string"}, void_reason="refund", ) - assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize async def test_raw_response_create_entry_by_external_id_overload_4(self, async_client: AsyncOrb) -> None: @@ -1370,7 +1365,7 @@ async def test_raw_response_create_entry_by_external_id_overload_4(self, async_c assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize async def test_streaming_response_create_entry_by_external_id_overload_4(self, async_client: AsyncOrb) -> None: @@ -1384,7 +1379,7 @@ async def test_streaming_response_create_entry_by_external_id_overload_4(self, a assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = await response.parse() - assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1406,7 +1401,7 @@ async def test_method_create_entry_by_external_id_overload_5(self, async_client: block_id="block_id", entry_type="amendment", ) - assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize async def test_method_create_entry_by_external_id_with_all_params_overload_5(self, async_client: AsyncOrb) -> None: @@ -1419,7 +1414,7 @@ async def test_method_create_entry_by_external_id_with_all_params_overload_5(sel description="description", metadata={"foo": "string"}, ) - assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize async def test_raw_response_create_entry_by_external_id_overload_5(self, async_client: AsyncOrb) -> None: @@ -1433,7 +1428,7 @@ async def test_raw_response_create_entry_by_external_id_overload_5(self, async_c assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) @parametrize async def test_streaming_response_create_entry_by_external_id_overload_5(self, async_client: AsyncOrb) -> None: @@ -1447,7 +1442,7 @@ async def test_streaming_response_create_entry_by_external_id_overload_5(self, a assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = await response.parse() - assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) + assert_matches_type(CreditLedgerEntryModel, ledger, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1466,7 +1461,7 @@ async def test_method_list_by_external_id(self, async_client: AsyncOrb) -> None: ledger = await async_client.customers.credits.ledger.list_by_external_id( external_customer_id="external_customer_id", ) - assert_matches_type(AsyncPage[LedgerListByExternalIDResponse], ledger, path=["response"]) + assert_matches_type(AsyncPage[CreditLedgerEntryModel], ledger, path=["response"]) @parametrize async def test_method_list_by_external_id_with_all_params(self, async_client: AsyncOrb) -> None: @@ -1483,7 +1478,7 @@ async def test_method_list_by_external_id_with_all_params(self, async_client: As limit=1, minimum_amount="minimum_amount", ) - assert_matches_type(AsyncPage[LedgerListByExternalIDResponse], ledger, path=["response"]) + assert_matches_type(AsyncPage[CreditLedgerEntryModel], ledger, path=["response"]) @parametrize async def test_raw_response_list_by_external_id(self, async_client: AsyncOrb) -> None: @@ -1494,7 +1489,7 @@ async def test_raw_response_list_by_external_id(self, async_client: AsyncOrb) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = response.parse() - assert_matches_type(AsyncPage[LedgerListByExternalIDResponse], ledger, path=["response"]) + assert_matches_type(AsyncPage[CreditLedgerEntryModel], ledger, path=["response"]) @parametrize async def test_streaming_response_list_by_external_id(self, async_client: AsyncOrb) -> None: @@ -1505,7 +1500,7 @@ async def test_streaming_response_list_by_external_id(self, async_client: AsyncO assert response.http_request.headers.get("X-Stainless-Lang") == "python" ledger = await response.parse() - assert_matches_type(AsyncPage[LedgerListByExternalIDResponse], ledger, path=["response"]) + assert_matches_type(AsyncPage[CreditLedgerEntryModel], ledger, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/customers/credits/test_top_ups.py b/tests/api_resources/customers/credits/test_top_ups.py index 03281ee1..0cf7af9f 100644 --- a/tests/api_resources/customers/credits/test_top_ups.py +++ b/tests/api_resources/customers/credits/test_top_ups.py @@ -11,12 +11,7 @@ from orb._utils import parse_datetime from tests.utils import assert_matches_type from orb.pagination import SyncPage, AsyncPage -from orb.types.customers.credits import ( - TopUpListResponse, - TopUpCreateResponse, - TopUpListByExternalIDResponse, - TopUpCreateByExternalIDResponse, -) +from orb.types.shared import TopUpModel base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -37,7 +32,7 @@ def test_method_create(self, client: Orb) -> None: per_unit_cost_basis="per_unit_cost_basis", threshold="threshold", ) - assert_matches_type(TopUpCreateResponse, top_up, path=["response"]) + assert_matches_type(TopUpModel, top_up, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Orb) -> None: @@ -57,7 +52,7 @@ def test_method_create_with_all_params(self, client: Orb) -> None: expires_after=0, expires_after_unit="day", ) - assert_matches_type(TopUpCreateResponse, top_up, path=["response"]) + assert_matches_type(TopUpModel, top_up, path=["response"]) @parametrize def test_raw_response_create(self, client: Orb) -> None: @@ -76,7 +71,7 @@ def test_raw_response_create(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" top_up = response.parse() - assert_matches_type(TopUpCreateResponse, top_up, path=["response"]) + assert_matches_type(TopUpModel, top_up, path=["response"]) @parametrize def test_streaming_response_create(self, client: Orb) -> None: @@ -95,7 +90,7 @@ def test_streaming_response_create(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" top_up = response.parse() - assert_matches_type(TopUpCreateResponse, top_up, path=["response"]) + assert_matches_type(TopUpModel, top_up, path=["response"]) assert cast(Any, response.is_closed) is True @@ -119,7 +114,7 @@ def test_method_list(self, client: Orb) -> None: top_up = client.customers.credits.top_ups.list( customer_id="customer_id", ) - assert_matches_type(SyncPage[TopUpListResponse], top_up, path=["response"]) + assert_matches_type(SyncPage[TopUpModel], top_up, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Orb) -> None: @@ -128,7 +123,7 @@ def test_method_list_with_all_params(self, client: Orb) -> None: cursor="cursor", limit=1, ) - assert_matches_type(SyncPage[TopUpListResponse], top_up, path=["response"]) + assert_matches_type(SyncPage[TopUpModel], top_up, path=["response"]) @parametrize def test_raw_response_list(self, client: Orb) -> None: @@ -139,7 +134,7 @@ def test_raw_response_list(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" top_up = response.parse() - assert_matches_type(SyncPage[TopUpListResponse], top_up, path=["response"]) + assert_matches_type(SyncPage[TopUpModel], top_up, path=["response"]) @parametrize def test_streaming_response_list(self, client: Orb) -> None: @@ -150,7 +145,7 @@ def test_streaming_response_list(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" top_up = response.parse() - assert_matches_type(SyncPage[TopUpListResponse], top_up, path=["response"]) + assert_matches_type(SyncPage[TopUpModel], top_up, path=["response"]) assert cast(Any, response.is_closed) is True @@ -222,7 +217,7 @@ def test_method_create_by_external_id(self, client: Orb) -> None: per_unit_cost_basis="per_unit_cost_basis", threshold="threshold", ) - assert_matches_type(TopUpCreateByExternalIDResponse, top_up, path=["response"]) + assert_matches_type(TopUpModel, top_up, path=["response"]) @parametrize def test_method_create_by_external_id_with_all_params(self, client: Orb) -> None: @@ -242,7 +237,7 @@ def test_method_create_by_external_id_with_all_params(self, client: Orb) -> None expires_after=0, expires_after_unit="day", ) - assert_matches_type(TopUpCreateByExternalIDResponse, top_up, path=["response"]) + assert_matches_type(TopUpModel, top_up, path=["response"]) @parametrize def test_raw_response_create_by_external_id(self, client: Orb) -> None: @@ -261,7 +256,7 @@ def test_raw_response_create_by_external_id(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" top_up = response.parse() - assert_matches_type(TopUpCreateByExternalIDResponse, top_up, path=["response"]) + assert_matches_type(TopUpModel, top_up, path=["response"]) @parametrize def test_streaming_response_create_by_external_id(self, client: Orb) -> None: @@ -280,7 +275,7 @@ def test_streaming_response_create_by_external_id(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" top_up = response.parse() - assert_matches_type(TopUpCreateByExternalIDResponse, top_up, path=["response"]) + assert_matches_type(TopUpModel, top_up, path=["response"]) assert cast(Any, response.is_closed) is True @@ -352,7 +347,7 @@ def test_method_list_by_external_id(self, client: Orb) -> None: top_up = client.customers.credits.top_ups.list_by_external_id( external_customer_id="external_customer_id", ) - assert_matches_type(SyncPage[TopUpListByExternalIDResponse], top_up, path=["response"]) + assert_matches_type(SyncPage[TopUpModel], top_up, path=["response"]) @parametrize def test_method_list_by_external_id_with_all_params(self, client: Orb) -> None: @@ -361,7 +356,7 @@ def test_method_list_by_external_id_with_all_params(self, client: Orb) -> None: cursor="cursor", limit=1, ) - assert_matches_type(SyncPage[TopUpListByExternalIDResponse], top_up, path=["response"]) + assert_matches_type(SyncPage[TopUpModel], top_up, path=["response"]) @parametrize def test_raw_response_list_by_external_id(self, client: Orb) -> None: @@ -372,7 +367,7 @@ def test_raw_response_list_by_external_id(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" top_up = response.parse() - assert_matches_type(SyncPage[TopUpListByExternalIDResponse], top_up, path=["response"]) + assert_matches_type(SyncPage[TopUpModel], top_up, path=["response"]) @parametrize def test_streaming_response_list_by_external_id(self, client: Orb) -> None: @@ -383,7 +378,7 @@ def test_streaming_response_list_by_external_id(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" top_up = response.parse() - assert_matches_type(SyncPage[TopUpListByExternalIDResponse], top_up, path=["response"]) + assert_matches_type(SyncPage[TopUpModel], top_up, path=["response"]) assert cast(Any, response.is_closed) is True @@ -411,7 +406,7 @@ async def test_method_create(self, async_client: AsyncOrb) -> None: per_unit_cost_basis="per_unit_cost_basis", threshold="threshold", ) - assert_matches_type(TopUpCreateResponse, top_up, path=["response"]) + assert_matches_type(TopUpModel, top_up, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> None: @@ -431,7 +426,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No expires_after=0, expires_after_unit="day", ) - assert_matches_type(TopUpCreateResponse, top_up, path=["response"]) + assert_matches_type(TopUpModel, top_up, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncOrb) -> None: @@ -450,7 +445,7 @@ async def test_raw_response_create(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" top_up = response.parse() - assert_matches_type(TopUpCreateResponse, top_up, path=["response"]) + assert_matches_type(TopUpModel, top_up, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: @@ -469,7 +464,7 @@ async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" top_up = await response.parse() - assert_matches_type(TopUpCreateResponse, top_up, path=["response"]) + assert_matches_type(TopUpModel, top_up, path=["response"]) assert cast(Any, response.is_closed) is True @@ -493,7 +488,7 @@ async def test_method_list(self, async_client: AsyncOrb) -> None: top_up = await async_client.customers.credits.top_ups.list( customer_id="customer_id", ) - assert_matches_type(AsyncPage[TopUpListResponse], top_up, path=["response"]) + assert_matches_type(AsyncPage[TopUpModel], top_up, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None: @@ -502,7 +497,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None cursor="cursor", limit=1, ) - assert_matches_type(AsyncPage[TopUpListResponse], top_up, path=["response"]) + assert_matches_type(AsyncPage[TopUpModel], top_up, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncOrb) -> None: @@ -513,7 +508,7 @@ async def test_raw_response_list(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" top_up = response.parse() - assert_matches_type(AsyncPage[TopUpListResponse], top_up, path=["response"]) + assert_matches_type(AsyncPage[TopUpModel], top_up, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: @@ -524,7 +519,7 @@ async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" top_up = await response.parse() - assert_matches_type(AsyncPage[TopUpListResponse], top_up, path=["response"]) + assert_matches_type(AsyncPage[TopUpModel], top_up, path=["response"]) assert cast(Any, response.is_closed) is True @@ -596,7 +591,7 @@ async def test_method_create_by_external_id(self, async_client: AsyncOrb) -> Non per_unit_cost_basis="per_unit_cost_basis", threshold="threshold", ) - assert_matches_type(TopUpCreateByExternalIDResponse, top_up, path=["response"]) + assert_matches_type(TopUpModel, top_up, path=["response"]) @parametrize async def test_method_create_by_external_id_with_all_params(self, async_client: AsyncOrb) -> None: @@ -616,7 +611,7 @@ async def test_method_create_by_external_id_with_all_params(self, async_client: expires_after=0, expires_after_unit="day", ) - assert_matches_type(TopUpCreateByExternalIDResponse, top_up, path=["response"]) + assert_matches_type(TopUpModel, top_up, path=["response"]) @parametrize async def test_raw_response_create_by_external_id(self, async_client: AsyncOrb) -> None: @@ -635,7 +630,7 @@ async def test_raw_response_create_by_external_id(self, async_client: AsyncOrb) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" top_up = response.parse() - assert_matches_type(TopUpCreateByExternalIDResponse, top_up, path=["response"]) + assert_matches_type(TopUpModel, top_up, path=["response"]) @parametrize async def test_streaming_response_create_by_external_id(self, async_client: AsyncOrb) -> None: @@ -654,7 +649,7 @@ async def test_streaming_response_create_by_external_id(self, async_client: Asyn assert response.http_request.headers.get("X-Stainless-Lang") == "python" top_up = await response.parse() - assert_matches_type(TopUpCreateByExternalIDResponse, top_up, path=["response"]) + assert_matches_type(TopUpModel, top_up, path=["response"]) assert cast(Any, response.is_closed) is True @@ -726,7 +721,7 @@ async def test_method_list_by_external_id(self, async_client: AsyncOrb) -> None: top_up = await async_client.customers.credits.top_ups.list_by_external_id( external_customer_id="external_customer_id", ) - assert_matches_type(AsyncPage[TopUpListByExternalIDResponse], top_up, path=["response"]) + assert_matches_type(AsyncPage[TopUpModel], top_up, path=["response"]) @parametrize async def test_method_list_by_external_id_with_all_params(self, async_client: AsyncOrb) -> None: @@ -735,7 +730,7 @@ async def test_method_list_by_external_id_with_all_params(self, async_client: As cursor="cursor", limit=1, ) - assert_matches_type(AsyncPage[TopUpListByExternalIDResponse], top_up, path=["response"]) + assert_matches_type(AsyncPage[TopUpModel], top_up, path=["response"]) @parametrize async def test_raw_response_list_by_external_id(self, async_client: AsyncOrb) -> None: @@ -746,7 +741,7 @@ async def test_raw_response_list_by_external_id(self, async_client: AsyncOrb) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" top_up = response.parse() - assert_matches_type(AsyncPage[TopUpListByExternalIDResponse], top_up, path=["response"]) + assert_matches_type(AsyncPage[TopUpModel], top_up, path=["response"]) @parametrize async def test_streaming_response_list_by_external_id(self, async_client: AsyncOrb) -> None: @@ -757,7 +752,7 @@ async def test_streaming_response_list_by_external_id(self, async_client: AsyncO assert response.http_request.headers.get("X-Stainless-Lang") == "python" top_up = await response.parse() - assert_matches_type(AsyncPage[TopUpListByExternalIDResponse], top_up, path=["response"]) + assert_matches_type(AsyncPage[TopUpModel], top_up, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/customers/test_balance_transactions.py b/tests/api_resources/customers/test_balance_transactions.py index 77d23372..10fe89aa 100644 --- a/tests/api_resources/customers/test_balance_transactions.py +++ b/tests/api_resources/customers/test_balance_transactions.py @@ -11,10 +11,7 @@ from orb._utils import parse_datetime from tests.utils import assert_matches_type from orb.pagination import SyncPage, AsyncPage -from orb.types.customers import ( - BalanceTransactionListResponse, - BalanceTransactionCreateResponse, -) +from orb.types.shared import CustomerBalanceTransactionModel base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -29,7 +26,7 @@ def test_method_create(self, client: Orb) -> None: amount="amount", type="increment", ) - assert_matches_type(BalanceTransactionCreateResponse, balance_transaction, path=["response"]) + assert_matches_type(CustomerBalanceTransactionModel, balance_transaction, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Orb) -> None: @@ -39,7 +36,7 @@ def test_method_create_with_all_params(self, client: Orb) -> None: type="increment", description="description", ) - assert_matches_type(BalanceTransactionCreateResponse, balance_transaction, path=["response"]) + assert_matches_type(CustomerBalanceTransactionModel, balance_transaction, path=["response"]) @parametrize def test_raw_response_create(self, client: Orb) -> None: @@ -52,7 +49,7 @@ def test_raw_response_create(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" balance_transaction = response.parse() - assert_matches_type(BalanceTransactionCreateResponse, balance_transaction, path=["response"]) + assert_matches_type(CustomerBalanceTransactionModel, balance_transaction, path=["response"]) @parametrize def test_streaming_response_create(self, client: Orb) -> None: @@ -65,7 +62,7 @@ def test_streaming_response_create(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" balance_transaction = response.parse() - assert_matches_type(BalanceTransactionCreateResponse, balance_transaction, path=["response"]) + assert_matches_type(CustomerBalanceTransactionModel, balance_transaction, path=["response"]) assert cast(Any, response.is_closed) is True @@ -83,7 +80,7 @@ def test_method_list(self, client: Orb) -> None: balance_transaction = client.customers.balance_transactions.list( customer_id="customer_id", ) - assert_matches_type(SyncPage[BalanceTransactionListResponse], balance_transaction, path=["response"]) + assert_matches_type(SyncPage[CustomerBalanceTransactionModel], balance_transaction, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Orb) -> None: @@ -96,7 +93,7 @@ def test_method_list_with_all_params(self, client: Orb) -> None: operation_time_lt=parse_datetime("2019-12-27T18:11:19.117Z"), operation_time_lte=parse_datetime("2019-12-27T18:11:19.117Z"), ) - assert_matches_type(SyncPage[BalanceTransactionListResponse], balance_transaction, path=["response"]) + assert_matches_type(SyncPage[CustomerBalanceTransactionModel], balance_transaction, path=["response"]) @parametrize def test_raw_response_list(self, client: Orb) -> None: @@ -107,7 +104,7 @@ def test_raw_response_list(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" balance_transaction = response.parse() - assert_matches_type(SyncPage[BalanceTransactionListResponse], balance_transaction, path=["response"]) + assert_matches_type(SyncPage[CustomerBalanceTransactionModel], balance_transaction, path=["response"]) @parametrize def test_streaming_response_list(self, client: Orb) -> None: @@ -118,7 +115,7 @@ def test_streaming_response_list(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" balance_transaction = response.parse() - assert_matches_type(SyncPage[BalanceTransactionListResponse], balance_transaction, path=["response"]) + assert_matches_type(SyncPage[CustomerBalanceTransactionModel], balance_transaction, path=["response"]) assert cast(Any, response.is_closed) is True @@ -140,7 +137,7 @@ async def test_method_create(self, async_client: AsyncOrb) -> None: amount="amount", type="increment", ) - assert_matches_type(BalanceTransactionCreateResponse, balance_transaction, path=["response"]) + assert_matches_type(CustomerBalanceTransactionModel, balance_transaction, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> None: @@ -150,7 +147,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No type="increment", description="description", ) - assert_matches_type(BalanceTransactionCreateResponse, balance_transaction, path=["response"]) + assert_matches_type(CustomerBalanceTransactionModel, balance_transaction, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncOrb) -> None: @@ -163,7 +160,7 @@ async def test_raw_response_create(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" balance_transaction = response.parse() - assert_matches_type(BalanceTransactionCreateResponse, balance_transaction, path=["response"]) + assert_matches_type(CustomerBalanceTransactionModel, balance_transaction, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: @@ -176,7 +173,7 @@ async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" balance_transaction = await response.parse() - assert_matches_type(BalanceTransactionCreateResponse, balance_transaction, path=["response"]) + assert_matches_type(CustomerBalanceTransactionModel, balance_transaction, path=["response"]) assert cast(Any, response.is_closed) is True @@ -194,7 +191,7 @@ async def test_method_list(self, async_client: AsyncOrb) -> None: balance_transaction = await async_client.customers.balance_transactions.list( customer_id="customer_id", ) - assert_matches_type(AsyncPage[BalanceTransactionListResponse], balance_transaction, path=["response"]) + assert_matches_type(AsyncPage[CustomerBalanceTransactionModel], balance_transaction, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None: @@ -207,7 +204,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None operation_time_lt=parse_datetime("2019-12-27T18:11:19.117Z"), operation_time_lte=parse_datetime("2019-12-27T18:11:19.117Z"), ) - assert_matches_type(AsyncPage[BalanceTransactionListResponse], balance_transaction, path=["response"]) + assert_matches_type(AsyncPage[CustomerBalanceTransactionModel], balance_transaction, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncOrb) -> None: @@ -218,7 +215,7 @@ async def test_raw_response_list(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" balance_transaction = response.parse() - assert_matches_type(AsyncPage[BalanceTransactionListResponse], balance_transaction, path=["response"]) + assert_matches_type(AsyncPage[CustomerBalanceTransactionModel], balance_transaction, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: @@ -229,7 +226,7 @@ async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" balance_transaction = await response.parse() - assert_matches_type(AsyncPage[BalanceTransactionListResponse], balance_transaction, path=["response"]) + assert_matches_type(AsyncPage[CustomerBalanceTransactionModel], balance_transaction, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/customers/test_costs.py b/tests/api_resources/customers/test_costs.py index 17d95e60..603e4258 100644 --- a/tests/api_resources/customers/test_costs.py +++ b/tests/api_resources/customers/test_costs.py @@ -10,10 +10,7 @@ from orb import Orb, AsyncOrb from orb._utils import parse_datetime from tests.utils import assert_matches_type -from orb.types.customers import ( - CostListResponse, - CostListByExternalIDResponse, -) +from orb.types.shared import CustomerCostsModel base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -26,7 +23,7 @@ def test_method_list(self, client: Orb) -> None: cost = client.customers.costs.list( customer_id="customer_id", ) - assert_matches_type(CostListResponse, cost, path=["response"]) + assert_matches_type(CustomerCostsModel, cost, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Orb) -> None: @@ -37,7 +34,7 @@ def test_method_list_with_all_params(self, client: Orb) -> None: timeframe_start=parse_datetime("2022-02-01T05:00:00Z"), view_mode="periodic", ) - assert_matches_type(CostListResponse, cost, path=["response"]) + assert_matches_type(CustomerCostsModel, cost, path=["response"]) @parametrize def test_raw_response_list(self, client: Orb) -> None: @@ -48,7 +45,7 @@ def test_raw_response_list(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" cost = response.parse() - assert_matches_type(CostListResponse, cost, path=["response"]) + assert_matches_type(CustomerCostsModel, cost, path=["response"]) @parametrize def test_streaming_response_list(self, client: Orb) -> None: @@ -59,7 +56,7 @@ def test_streaming_response_list(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" cost = response.parse() - assert_matches_type(CostListResponse, cost, path=["response"]) + assert_matches_type(CustomerCostsModel, cost, path=["response"]) assert cast(Any, response.is_closed) is True @@ -75,7 +72,7 @@ def test_method_list_by_external_id(self, client: Orb) -> None: cost = client.customers.costs.list_by_external_id( external_customer_id="external_customer_id", ) - assert_matches_type(CostListByExternalIDResponse, cost, path=["response"]) + assert_matches_type(CustomerCostsModel, cost, path=["response"]) @parametrize def test_method_list_by_external_id_with_all_params(self, client: Orb) -> None: @@ -86,7 +83,7 @@ def test_method_list_by_external_id_with_all_params(self, client: Orb) -> None: timeframe_start=parse_datetime("2022-02-01T05:00:00Z"), view_mode="periodic", ) - assert_matches_type(CostListByExternalIDResponse, cost, path=["response"]) + assert_matches_type(CustomerCostsModel, cost, path=["response"]) @parametrize def test_raw_response_list_by_external_id(self, client: Orb) -> None: @@ -97,7 +94,7 @@ def test_raw_response_list_by_external_id(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" cost = response.parse() - assert_matches_type(CostListByExternalIDResponse, cost, path=["response"]) + assert_matches_type(CustomerCostsModel, cost, path=["response"]) @parametrize def test_streaming_response_list_by_external_id(self, client: Orb) -> None: @@ -108,7 +105,7 @@ def test_streaming_response_list_by_external_id(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" cost = response.parse() - assert_matches_type(CostListByExternalIDResponse, cost, path=["response"]) + assert_matches_type(CustomerCostsModel, cost, path=["response"]) assert cast(Any, response.is_closed) is True @@ -128,7 +125,7 @@ async def test_method_list(self, async_client: AsyncOrb) -> None: cost = await async_client.customers.costs.list( customer_id="customer_id", ) - assert_matches_type(CostListResponse, cost, path=["response"]) + assert_matches_type(CustomerCostsModel, cost, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None: @@ -139,7 +136,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None timeframe_start=parse_datetime("2022-02-01T05:00:00Z"), view_mode="periodic", ) - assert_matches_type(CostListResponse, cost, path=["response"]) + assert_matches_type(CustomerCostsModel, cost, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncOrb) -> None: @@ -150,7 +147,7 @@ async def test_raw_response_list(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" cost = response.parse() - assert_matches_type(CostListResponse, cost, path=["response"]) + assert_matches_type(CustomerCostsModel, cost, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: @@ -161,7 +158,7 @@ async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" cost = await response.parse() - assert_matches_type(CostListResponse, cost, path=["response"]) + assert_matches_type(CustomerCostsModel, cost, path=["response"]) assert cast(Any, response.is_closed) is True @@ -177,7 +174,7 @@ async def test_method_list_by_external_id(self, async_client: AsyncOrb) -> None: cost = await async_client.customers.costs.list_by_external_id( external_customer_id="external_customer_id", ) - assert_matches_type(CostListByExternalIDResponse, cost, path=["response"]) + assert_matches_type(CustomerCostsModel, cost, path=["response"]) @parametrize async def test_method_list_by_external_id_with_all_params(self, async_client: AsyncOrb) -> None: @@ -188,7 +185,7 @@ async def test_method_list_by_external_id_with_all_params(self, async_client: As timeframe_start=parse_datetime("2022-02-01T05:00:00Z"), view_mode="periodic", ) - assert_matches_type(CostListByExternalIDResponse, cost, path=["response"]) + assert_matches_type(CustomerCostsModel, cost, path=["response"]) @parametrize async def test_raw_response_list_by_external_id(self, async_client: AsyncOrb) -> None: @@ -199,7 +196,7 @@ async def test_raw_response_list_by_external_id(self, async_client: AsyncOrb) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" cost = response.parse() - assert_matches_type(CostListByExternalIDResponse, cost, path=["response"]) + assert_matches_type(CustomerCostsModel, cost, path=["response"]) @parametrize async def test_streaming_response_list_by_external_id(self, async_client: AsyncOrb) -> None: @@ -210,7 +207,7 @@ async def test_streaming_response_list_by_external_id(self, async_client: AsyncO assert response.http_request.headers.get("X-Stainless-Lang") == "python" cost = await response.parse() - assert_matches_type(CostListByExternalIDResponse, cost, path=["response"]) + assert_matches_type(CustomerCostsModel, cost, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/customers/test_credits.py b/tests/api_resources/customers/test_credits.py index 19de5732..9e1abcf5 100644 --- a/tests/api_resources/customers/test_credits.py +++ b/tests/api_resources/customers/test_credits.py @@ -10,10 +10,7 @@ from orb import Orb, AsyncOrb from tests.utils import assert_matches_type from orb.pagination import SyncPage, AsyncPage -from orb.types.customers import ( - CreditListResponse, - CreditListByExternalIDResponse, -) +from orb.types.shared.customer_credit_balances_model import Data base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -26,7 +23,7 @@ def test_method_list(self, client: Orb) -> None: credit = client.customers.credits.list( customer_id="customer_id", ) - assert_matches_type(SyncPage[CreditListResponse], credit, path=["response"]) + assert_matches_type(SyncPage[Data], credit, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Orb) -> None: @@ -37,7 +34,7 @@ def test_method_list_with_all_params(self, client: Orb) -> None: include_all_blocks=True, limit=1, ) - assert_matches_type(SyncPage[CreditListResponse], credit, path=["response"]) + assert_matches_type(SyncPage[Data], credit, path=["response"]) @parametrize def test_raw_response_list(self, client: Orb) -> None: @@ -48,7 +45,7 @@ def test_raw_response_list(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" credit = response.parse() - assert_matches_type(SyncPage[CreditListResponse], credit, path=["response"]) + assert_matches_type(SyncPage[Data], credit, path=["response"]) @parametrize def test_streaming_response_list(self, client: Orb) -> None: @@ -59,7 +56,7 @@ def test_streaming_response_list(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" credit = response.parse() - assert_matches_type(SyncPage[CreditListResponse], credit, path=["response"]) + assert_matches_type(SyncPage[Data], credit, path=["response"]) assert cast(Any, response.is_closed) is True @@ -75,7 +72,7 @@ def test_method_list_by_external_id(self, client: Orb) -> None: credit = client.customers.credits.list_by_external_id( external_customer_id="external_customer_id", ) - assert_matches_type(SyncPage[CreditListByExternalIDResponse], credit, path=["response"]) + assert_matches_type(SyncPage[Data], credit, path=["response"]) @parametrize def test_method_list_by_external_id_with_all_params(self, client: Orb) -> None: @@ -86,7 +83,7 @@ def test_method_list_by_external_id_with_all_params(self, client: Orb) -> None: include_all_blocks=True, limit=1, ) - assert_matches_type(SyncPage[CreditListByExternalIDResponse], credit, path=["response"]) + assert_matches_type(SyncPage[Data], credit, path=["response"]) @parametrize def test_raw_response_list_by_external_id(self, client: Orb) -> None: @@ -97,7 +94,7 @@ def test_raw_response_list_by_external_id(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" credit = response.parse() - assert_matches_type(SyncPage[CreditListByExternalIDResponse], credit, path=["response"]) + assert_matches_type(SyncPage[Data], credit, path=["response"]) @parametrize def test_streaming_response_list_by_external_id(self, client: Orb) -> None: @@ -108,7 +105,7 @@ def test_streaming_response_list_by_external_id(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" credit = response.parse() - assert_matches_type(SyncPage[CreditListByExternalIDResponse], credit, path=["response"]) + assert_matches_type(SyncPage[Data], credit, path=["response"]) assert cast(Any, response.is_closed) is True @@ -128,7 +125,7 @@ async def test_method_list(self, async_client: AsyncOrb) -> None: credit = await async_client.customers.credits.list( customer_id="customer_id", ) - assert_matches_type(AsyncPage[CreditListResponse], credit, path=["response"]) + assert_matches_type(AsyncPage[Data], credit, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None: @@ -139,7 +136,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None include_all_blocks=True, limit=1, ) - assert_matches_type(AsyncPage[CreditListResponse], credit, path=["response"]) + assert_matches_type(AsyncPage[Data], credit, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncOrb) -> None: @@ -150,7 +147,7 @@ async def test_raw_response_list(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" credit = response.parse() - assert_matches_type(AsyncPage[CreditListResponse], credit, path=["response"]) + assert_matches_type(AsyncPage[Data], credit, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: @@ -161,7 +158,7 @@ async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" credit = await response.parse() - assert_matches_type(AsyncPage[CreditListResponse], credit, path=["response"]) + assert_matches_type(AsyncPage[Data], credit, path=["response"]) assert cast(Any, response.is_closed) is True @@ -177,7 +174,7 @@ async def test_method_list_by_external_id(self, async_client: AsyncOrb) -> None: credit = await async_client.customers.credits.list_by_external_id( external_customer_id="external_customer_id", ) - assert_matches_type(AsyncPage[CreditListByExternalIDResponse], credit, path=["response"]) + assert_matches_type(AsyncPage[Data], credit, path=["response"]) @parametrize async def test_method_list_by_external_id_with_all_params(self, async_client: AsyncOrb) -> None: @@ -188,7 +185,7 @@ async def test_method_list_by_external_id_with_all_params(self, async_client: As include_all_blocks=True, limit=1, ) - assert_matches_type(AsyncPage[CreditListByExternalIDResponse], credit, path=["response"]) + assert_matches_type(AsyncPage[Data], credit, path=["response"]) @parametrize async def test_raw_response_list_by_external_id(self, async_client: AsyncOrb) -> None: @@ -199,7 +196,7 @@ async def test_raw_response_list_by_external_id(self, async_client: AsyncOrb) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" credit = response.parse() - assert_matches_type(AsyncPage[CreditListByExternalIDResponse], credit, path=["response"]) + assert_matches_type(AsyncPage[Data], credit, path=["response"]) @parametrize async def test_streaming_response_list_by_external_id(self, async_client: AsyncOrb) -> None: @@ -210,7 +207,7 @@ async def test_streaming_response_list_by_external_id(self, async_client: AsyncO assert response.http_request.headers.get("X-Stainless-Lang") == "python" credit = await response.parse() - assert_matches_type(AsyncPage[CreditListByExternalIDResponse], credit, path=["response"]) + assert_matches_type(AsyncPage[Data], credit, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/dimensional_price_groups/test_external_dimensional_price_group_id.py b/tests/api_resources/dimensional_price_groups/test_external_dimensional_price_group_id.py index e4d7118f..d6af6534 100644 --- a/tests/api_resources/dimensional_price_groups/test_external_dimensional_price_group_id.py +++ b/tests/api_resources/dimensional_price_groups/test_external_dimensional_price_group_id.py @@ -8,8 +8,8 @@ import pytest from orb import Orb, AsyncOrb -from orb.types import DimensionalPriceGroup from tests.utils import assert_matches_type +from orb.types.shared import DimensionalPriceGroupModel base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -24,7 +24,7 @@ def test_method_retrieve(self, client: Orb) -> None: "external_dimensional_price_group_id", ) ) - assert_matches_type(DimensionalPriceGroup, external_dimensional_price_group_id, path=["response"]) + assert_matches_type(DimensionalPriceGroupModel, external_dimensional_price_group_id, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Orb) -> None: @@ -35,7 +35,7 @@ def test_raw_response_retrieve(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" external_dimensional_price_group_id = response.parse() - assert_matches_type(DimensionalPriceGroup, external_dimensional_price_group_id, path=["response"]) + assert_matches_type(DimensionalPriceGroupModel, external_dimensional_price_group_id, path=["response"]) @parametrize def test_streaming_response_retrieve(self, client: Orb) -> None: @@ -46,7 +46,7 @@ def test_streaming_response_retrieve(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" external_dimensional_price_group_id = response.parse() - assert_matches_type(DimensionalPriceGroup, external_dimensional_price_group_id, path=["response"]) + assert_matches_type(DimensionalPriceGroupModel, external_dimensional_price_group_id, path=["response"]) assert cast(Any, response.is_closed) is True @@ -70,7 +70,7 @@ async def test_method_retrieve(self, async_client: AsyncOrb) -> None: "external_dimensional_price_group_id", ) ) - assert_matches_type(DimensionalPriceGroup, external_dimensional_price_group_id, path=["response"]) + assert_matches_type(DimensionalPriceGroupModel, external_dimensional_price_group_id, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncOrb) -> None: @@ -83,7 +83,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" external_dimensional_price_group_id = response.parse() - assert_matches_type(DimensionalPriceGroup, external_dimensional_price_group_id, path=["response"]) + assert_matches_type(DimensionalPriceGroupModel, external_dimensional_price_group_id, path=["response"]) @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncOrb) -> None: @@ -96,7 +96,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncOrb) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" external_dimensional_price_group_id = await response.parse() - assert_matches_type(DimensionalPriceGroup, external_dimensional_price_group_id, path=["response"]) + assert_matches_type(DimensionalPriceGroupModel, external_dimensional_price_group_id, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/events/test_backfills.py b/tests/api_resources/events/test_backfills.py index bed65b8c..ca095e83 100644 --- a/tests/api_resources/events/test_backfills.py +++ b/tests/api_resources/events/test_backfills.py @@ -11,13 +11,7 @@ from orb._utils import parse_datetime from tests.utils import assert_matches_type from orb.pagination import SyncPage, AsyncPage -from orb.types.events import ( - BackfillListResponse, - BackfillCloseResponse, - BackfillFetchResponse, - BackfillCreateResponse, - BackfillRevertResponse, -) +from orb.types.shared import BackfillModel base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -31,7 +25,7 @@ def test_method_create(self, client: Orb) -> None: timeframe_end=parse_datetime("2019-12-27T18:11:19.117Z"), timeframe_start=parse_datetime("2019-12-27T18:11:19.117Z"), ) - assert_matches_type(BackfillCreateResponse, backfill, path=["response"]) + assert_matches_type(BackfillModel, backfill, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Orb) -> None: @@ -44,7 +38,7 @@ def test_method_create_with_all_params(self, client: Orb) -> None: external_customer_id="external_customer_id", replace_existing_events=True, ) - assert_matches_type(BackfillCreateResponse, backfill, path=["response"]) + assert_matches_type(BackfillModel, backfill, path=["response"]) @parametrize def test_raw_response_create(self, client: Orb) -> None: @@ -56,7 +50,7 @@ def test_raw_response_create(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" backfill = response.parse() - assert_matches_type(BackfillCreateResponse, backfill, path=["response"]) + assert_matches_type(BackfillModel, backfill, path=["response"]) @parametrize def test_streaming_response_create(self, client: Orb) -> None: @@ -68,14 +62,14 @@ def test_streaming_response_create(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" backfill = response.parse() - assert_matches_type(BackfillCreateResponse, backfill, path=["response"]) + assert_matches_type(BackfillModel, backfill, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_method_list(self, client: Orb) -> None: backfill = client.events.backfills.list() - assert_matches_type(SyncPage[BackfillListResponse], backfill, path=["response"]) + assert_matches_type(SyncPage[BackfillModel], backfill, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Orb) -> None: @@ -83,7 +77,7 @@ def test_method_list_with_all_params(self, client: Orb) -> None: cursor="cursor", limit=1, ) - assert_matches_type(SyncPage[BackfillListResponse], backfill, path=["response"]) + assert_matches_type(SyncPage[BackfillModel], backfill, path=["response"]) @parametrize def test_raw_response_list(self, client: Orb) -> None: @@ -92,7 +86,7 @@ def test_raw_response_list(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" backfill = response.parse() - assert_matches_type(SyncPage[BackfillListResponse], backfill, path=["response"]) + assert_matches_type(SyncPage[BackfillModel], backfill, path=["response"]) @parametrize def test_streaming_response_list(self, client: Orb) -> None: @@ -101,7 +95,7 @@ def test_streaming_response_list(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" backfill = response.parse() - assert_matches_type(SyncPage[BackfillListResponse], backfill, path=["response"]) + assert_matches_type(SyncPage[BackfillModel], backfill, path=["response"]) assert cast(Any, response.is_closed) is True @@ -110,7 +104,7 @@ def test_method_close(self, client: Orb) -> None: backfill = client.events.backfills.close( "backfill_id", ) - assert_matches_type(BackfillCloseResponse, backfill, path=["response"]) + assert_matches_type(BackfillModel, backfill, path=["response"]) @parametrize def test_raw_response_close(self, client: Orb) -> None: @@ -121,7 +115,7 @@ def test_raw_response_close(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" backfill = response.parse() - assert_matches_type(BackfillCloseResponse, backfill, path=["response"]) + assert_matches_type(BackfillModel, backfill, path=["response"]) @parametrize def test_streaming_response_close(self, client: Orb) -> None: @@ -132,7 +126,7 @@ def test_streaming_response_close(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" backfill = response.parse() - assert_matches_type(BackfillCloseResponse, backfill, path=["response"]) + assert_matches_type(BackfillModel, backfill, path=["response"]) assert cast(Any, response.is_closed) is True @@ -148,7 +142,7 @@ def test_method_fetch(self, client: Orb) -> None: backfill = client.events.backfills.fetch( "backfill_id", ) - assert_matches_type(BackfillFetchResponse, backfill, path=["response"]) + assert_matches_type(BackfillModel, backfill, path=["response"]) @parametrize def test_raw_response_fetch(self, client: Orb) -> None: @@ -159,7 +153,7 @@ def test_raw_response_fetch(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" backfill = response.parse() - assert_matches_type(BackfillFetchResponse, backfill, path=["response"]) + assert_matches_type(BackfillModel, backfill, path=["response"]) @parametrize def test_streaming_response_fetch(self, client: Orb) -> None: @@ -170,7 +164,7 @@ def test_streaming_response_fetch(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" backfill = response.parse() - assert_matches_type(BackfillFetchResponse, backfill, path=["response"]) + assert_matches_type(BackfillModel, backfill, path=["response"]) assert cast(Any, response.is_closed) is True @@ -186,7 +180,7 @@ def test_method_revert(self, client: Orb) -> None: backfill = client.events.backfills.revert( "backfill_id", ) - assert_matches_type(BackfillRevertResponse, backfill, path=["response"]) + assert_matches_type(BackfillModel, backfill, path=["response"]) @parametrize def test_raw_response_revert(self, client: Orb) -> None: @@ -197,7 +191,7 @@ def test_raw_response_revert(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" backfill = response.parse() - assert_matches_type(BackfillRevertResponse, backfill, path=["response"]) + assert_matches_type(BackfillModel, backfill, path=["response"]) @parametrize def test_streaming_response_revert(self, client: Orb) -> None: @@ -208,7 +202,7 @@ def test_streaming_response_revert(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" backfill = response.parse() - assert_matches_type(BackfillRevertResponse, backfill, path=["response"]) + assert_matches_type(BackfillModel, backfill, path=["response"]) assert cast(Any, response.is_closed) is True @@ -229,7 +223,7 @@ async def test_method_create(self, async_client: AsyncOrb) -> None: timeframe_end=parse_datetime("2019-12-27T18:11:19.117Z"), timeframe_start=parse_datetime("2019-12-27T18:11:19.117Z"), ) - assert_matches_type(BackfillCreateResponse, backfill, path=["response"]) + assert_matches_type(BackfillModel, backfill, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> None: @@ -242,7 +236,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No external_customer_id="external_customer_id", replace_existing_events=True, ) - assert_matches_type(BackfillCreateResponse, backfill, path=["response"]) + assert_matches_type(BackfillModel, backfill, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncOrb) -> None: @@ -254,7 +248,7 @@ async def test_raw_response_create(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" backfill = response.parse() - assert_matches_type(BackfillCreateResponse, backfill, path=["response"]) + assert_matches_type(BackfillModel, backfill, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: @@ -266,14 +260,14 @@ async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" backfill = await response.parse() - assert_matches_type(BackfillCreateResponse, backfill, path=["response"]) + assert_matches_type(BackfillModel, backfill, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_method_list(self, async_client: AsyncOrb) -> None: backfill = await async_client.events.backfills.list() - assert_matches_type(AsyncPage[BackfillListResponse], backfill, path=["response"]) + assert_matches_type(AsyncPage[BackfillModel], backfill, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None: @@ -281,7 +275,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None cursor="cursor", limit=1, ) - assert_matches_type(AsyncPage[BackfillListResponse], backfill, path=["response"]) + assert_matches_type(AsyncPage[BackfillModel], backfill, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncOrb) -> None: @@ -290,7 +284,7 @@ async def test_raw_response_list(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" backfill = response.parse() - assert_matches_type(AsyncPage[BackfillListResponse], backfill, path=["response"]) + assert_matches_type(AsyncPage[BackfillModel], backfill, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: @@ -299,7 +293,7 @@ async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" backfill = await response.parse() - assert_matches_type(AsyncPage[BackfillListResponse], backfill, path=["response"]) + assert_matches_type(AsyncPage[BackfillModel], backfill, path=["response"]) assert cast(Any, response.is_closed) is True @@ -308,7 +302,7 @@ async def test_method_close(self, async_client: AsyncOrb) -> None: backfill = await async_client.events.backfills.close( "backfill_id", ) - assert_matches_type(BackfillCloseResponse, backfill, path=["response"]) + assert_matches_type(BackfillModel, backfill, path=["response"]) @parametrize async def test_raw_response_close(self, async_client: AsyncOrb) -> None: @@ -319,7 +313,7 @@ async def test_raw_response_close(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" backfill = response.parse() - assert_matches_type(BackfillCloseResponse, backfill, path=["response"]) + assert_matches_type(BackfillModel, backfill, path=["response"]) @parametrize async def test_streaming_response_close(self, async_client: AsyncOrb) -> None: @@ -330,7 +324,7 @@ async def test_streaming_response_close(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" backfill = await response.parse() - assert_matches_type(BackfillCloseResponse, backfill, path=["response"]) + assert_matches_type(BackfillModel, backfill, path=["response"]) assert cast(Any, response.is_closed) is True @@ -346,7 +340,7 @@ async def test_method_fetch(self, async_client: AsyncOrb) -> None: backfill = await async_client.events.backfills.fetch( "backfill_id", ) - assert_matches_type(BackfillFetchResponse, backfill, path=["response"]) + assert_matches_type(BackfillModel, backfill, path=["response"]) @parametrize async def test_raw_response_fetch(self, async_client: AsyncOrb) -> None: @@ -357,7 +351,7 @@ async def test_raw_response_fetch(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" backfill = response.parse() - assert_matches_type(BackfillFetchResponse, backfill, path=["response"]) + assert_matches_type(BackfillModel, backfill, path=["response"]) @parametrize async def test_streaming_response_fetch(self, async_client: AsyncOrb) -> None: @@ -368,7 +362,7 @@ async def test_streaming_response_fetch(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" backfill = await response.parse() - assert_matches_type(BackfillFetchResponse, backfill, path=["response"]) + assert_matches_type(BackfillModel, backfill, path=["response"]) assert cast(Any, response.is_closed) is True @@ -384,7 +378,7 @@ async def test_method_revert(self, async_client: AsyncOrb) -> None: backfill = await async_client.events.backfills.revert( "backfill_id", ) - assert_matches_type(BackfillRevertResponse, backfill, path=["response"]) + assert_matches_type(BackfillModel, backfill, path=["response"]) @parametrize async def test_raw_response_revert(self, async_client: AsyncOrb) -> None: @@ -395,7 +389,7 @@ async def test_raw_response_revert(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" backfill = response.parse() - assert_matches_type(BackfillRevertResponse, backfill, path=["response"]) + assert_matches_type(BackfillModel, backfill, path=["response"]) @parametrize async def test_streaming_response_revert(self, async_client: AsyncOrb) -> None: @@ -406,7 +400,7 @@ async def test_streaming_response_revert(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" backfill = await response.parse() - assert_matches_type(BackfillRevertResponse, backfill, path=["response"]) + assert_matches_type(BackfillModel, backfill, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/plans/test_external_plan_id.py b/tests/api_resources/plans/test_external_plan_id.py index a73b26ea..75448b46 100644 --- a/tests/api_resources/plans/test_external_plan_id.py +++ b/tests/api_resources/plans/test_external_plan_id.py @@ -8,8 +8,8 @@ import pytest from orb import Orb, AsyncOrb -from orb.types import Plan from tests.utils import assert_matches_type +from orb.types.shared import PlanModel base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -22,7 +22,7 @@ def test_method_update(self, client: Orb) -> None: external_plan_id = client.plans.external_plan_id.update( other_external_plan_id="external_plan_id", ) - assert_matches_type(Plan, external_plan_id, path=["response"]) + assert_matches_type(PlanModel, external_plan_id, path=["response"]) @parametrize def test_method_update_with_all_params(self, client: Orb) -> None: @@ -31,7 +31,7 @@ def test_method_update_with_all_params(self, client: Orb) -> None: external_plan_id="external_plan_id", metadata={"foo": "string"}, ) - assert_matches_type(Plan, external_plan_id, path=["response"]) + assert_matches_type(PlanModel, external_plan_id, path=["response"]) @parametrize def test_raw_response_update(self, client: Orb) -> None: @@ -42,7 +42,7 @@ def test_raw_response_update(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" external_plan_id = response.parse() - assert_matches_type(Plan, external_plan_id, path=["response"]) + assert_matches_type(PlanModel, external_plan_id, path=["response"]) @parametrize def test_streaming_response_update(self, client: Orb) -> None: @@ -53,7 +53,7 @@ def test_streaming_response_update(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" external_plan_id = response.parse() - assert_matches_type(Plan, external_plan_id, path=["response"]) + assert_matches_type(PlanModel, external_plan_id, path=["response"]) assert cast(Any, response.is_closed) is True @@ -72,7 +72,7 @@ def test_method_fetch(self, client: Orb) -> None: external_plan_id = client.plans.external_plan_id.fetch( "external_plan_id", ) - assert_matches_type(Plan, external_plan_id, path=["response"]) + assert_matches_type(PlanModel, external_plan_id, path=["response"]) @parametrize def test_raw_response_fetch(self, client: Orb) -> None: @@ -83,7 +83,7 @@ def test_raw_response_fetch(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" external_plan_id = response.parse() - assert_matches_type(Plan, external_plan_id, path=["response"]) + assert_matches_type(PlanModel, external_plan_id, path=["response"]) @parametrize def test_streaming_response_fetch(self, client: Orb) -> None: @@ -94,7 +94,7 @@ def test_streaming_response_fetch(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" external_plan_id = response.parse() - assert_matches_type(Plan, external_plan_id, path=["response"]) + assert_matches_type(PlanModel, external_plan_id, path=["response"]) assert cast(Any, response.is_closed) is True @@ -114,7 +114,7 @@ async def test_method_update(self, async_client: AsyncOrb) -> None: external_plan_id = await async_client.plans.external_plan_id.update( other_external_plan_id="external_plan_id", ) - assert_matches_type(Plan, external_plan_id, path=["response"]) + assert_matches_type(PlanModel, external_plan_id, path=["response"]) @parametrize async def test_method_update_with_all_params(self, async_client: AsyncOrb) -> None: @@ -123,7 +123,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncOrb) -> No external_plan_id="external_plan_id", metadata={"foo": "string"}, ) - assert_matches_type(Plan, external_plan_id, path=["response"]) + assert_matches_type(PlanModel, external_plan_id, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncOrb) -> None: @@ -134,7 +134,7 @@ async def test_raw_response_update(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" external_plan_id = response.parse() - assert_matches_type(Plan, external_plan_id, path=["response"]) + assert_matches_type(PlanModel, external_plan_id, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncOrb) -> None: @@ -145,7 +145,7 @@ async def test_streaming_response_update(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" external_plan_id = await response.parse() - assert_matches_type(Plan, external_plan_id, path=["response"]) + assert_matches_type(PlanModel, external_plan_id, path=["response"]) assert cast(Any, response.is_closed) is True @@ -164,7 +164,7 @@ async def test_method_fetch(self, async_client: AsyncOrb) -> None: external_plan_id = await async_client.plans.external_plan_id.fetch( "external_plan_id", ) - assert_matches_type(Plan, external_plan_id, path=["response"]) + assert_matches_type(PlanModel, external_plan_id, path=["response"]) @parametrize async def test_raw_response_fetch(self, async_client: AsyncOrb) -> None: @@ -175,7 +175,7 @@ async def test_raw_response_fetch(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" external_plan_id = response.parse() - assert_matches_type(Plan, external_plan_id, path=["response"]) + assert_matches_type(PlanModel, external_plan_id, path=["response"]) @parametrize async def test_streaming_response_fetch(self, async_client: AsyncOrb) -> None: @@ -186,7 +186,7 @@ async def test_streaming_response_fetch(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" external_plan_id = await response.parse() - assert_matches_type(Plan, external_plan_id, path=["response"]) + assert_matches_type(PlanModel, external_plan_id, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/prices/test_external_price_id.py b/tests/api_resources/prices/test_external_price_id.py index cfee75ae..9128c0dc 100644 --- a/tests/api_resources/prices/test_external_price_id.py +++ b/tests/api_resources/prices/test_external_price_id.py @@ -8,8 +8,8 @@ import pytest from orb import Orb, AsyncOrb -from orb.types import Price from tests.utils import assert_matches_type +from orb.types.shared import PriceModel base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -22,7 +22,7 @@ def test_method_update(self, client: Orb) -> None: external_price_id = client.prices.external_price_id.update( external_price_id="external_price_id", ) - assert_matches_type(Price, external_price_id, path=["response"]) + assert_matches_type(PriceModel, external_price_id, path=["response"]) @parametrize def test_method_update_with_all_params(self, client: Orb) -> None: @@ -30,7 +30,7 @@ def test_method_update_with_all_params(self, client: Orb) -> None: external_price_id="external_price_id", metadata={"foo": "string"}, ) - assert_matches_type(Price, external_price_id, path=["response"]) + assert_matches_type(PriceModel, external_price_id, path=["response"]) @parametrize def test_raw_response_update(self, client: Orb) -> None: @@ -41,7 +41,7 @@ def test_raw_response_update(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" external_price_id = response.parse() - assert_matches_type(Price, external_price_id, path=["response"]) + assert_matches_type(PriceModel, external_price_id, path=["response"]) @parametrize def test_streaming_response_update(self, client: Orb) -> None: @@ -52,7 +52,7 @@ def test_streaming_response_update(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" external_price_id = response.parse() - assert_matches_type(Price, external_price_id, path=["response"]) + assert_matches_type(PriceModel, external_price_id, path=["response"]) assert cast(Any, response.is_closed) is True @@ -68,7 +68,7 @@ def test_method_fetch(self, client: Orb) -> None: external_price_id = client.prices.external_price_id.fetch( "external_price_id", ) - assert_matches_type(Price, external_price_id, path=["response"]) + assert_matches_type(PriceModel, external_price_id, path=["response"]) @parametrize def test_raw_response_fetch(self, client: Orb) -> None: @@ -79,7 +79,7 @@ def test_raw_response_fetch(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" external_price_id = response.parse() - assert_matches_type(Price, external_price_id, path=["response"]) + assert_matches_type(PriceModel, external_price_id, path=["response"]) @parametrize def test_streaming_response_fetch(self, client: Orb) -> None: @@ -90,7 +90,7 @@ def test_streaming_response_fetch(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" external_price_id = response.parse() - assert_matches_type(Price, external_price_id, path=["response"]) + assert_matches_type(PriceModel, external_price_id, path=["response"]) assert cast(Any, response.is_closed) is True @@ -110,7 +110,7 @@ async def test_method_update(self, async_client: AsyncOrb) -> None: external_price_id = await async_client.prices.external_price_id.update( external_price_id="external_price_id", ) - assert_matches_type(Price, external_price_id, path=["response"]) + assert_matches_type(PriceModel, external_price_id, path=["response"]) @parametrize async def test_method_update_with_all_params(self, async_client: AsyncOrb) -> None: @@ -118,7 +118,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncOrb) -> No external_price_id="external_price_id", metadata={"foo": "string"}, ) - assert_matches_type(Price, external_price_id, path=["response"]) + assert_matches_type(PriceModel, external_price_id, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncOrb) -> None: @@ -129,7 +129,7 @@ async def test_raw_response_update(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" external_price_id = response.parse() - assert_matches_type(Price, external_price_id, path=["response"]) + assert_matches_type(PriceModel, external_price_id, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncOrb) -> None: @@ -140,7 +140,7 @@ async def test_streaming_response_update(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" external_price_id = await response.parse() - assert_matches_type(Price, external_price_id, path=["response"]) + assert_matches_type(PriceModel, external_price_id, path=["response"]) assert cast(Any, response.is_closed) is True @@ -156,7 +156,7 @@ async def test_method_fetch(self, async_client: AsyncOrb) -> None: external_price_id = await async_client.prices.external_price_id.fetch( "external_price_id", ) - assert_matches_type(Price, external_price_id, path=["response"]) + assert_matches_type(PriceModel, external_price_id, path=["response"]) @parametrize async def test_raw_response_fetch(self, async_client: AsyncOrb) -> None: @@ -167,7 +167,7 @@ async def test_raw_response_fetch(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" external_price_id = response.parse() - assert_matches_type(Price, external_price_id, path=["response"]) + assert_matches_type(PriceModel, external_price_id, path=["response"]) @parametrize async def test_streaming_response_fetch(self, async_client: AsyncOrb) -> None: @@ -178,7 +178,7 @@ async def test_streaming_response_fetch(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" external_price_id = await response.parse() - assert_matches_type(Price, external_price_id, path=["response"]) + assert_matches_type(PriceModel, external_price_id, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_alerts.py b/tests/api_resources/test_alerts.py index 568aa4ea..1425bd7e 100644 --- a/tests/api_resources/test_alerts.py +++ b/tests/api_resources/test_alerts.py @@ -8,12 +8,10 @@ import pytest from orb import Orb, AsyncOrb -from orb.types import ( - Alert, -) from orb._utils import parse_datetime from tests.utils import assert_matches_type from orb.pagination import SyncPage, AsyncPage +from orb.types.shared import AlertModel base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -26,7 +24,7 @@ def test_method_retrieve(self, client: Orb) -> None: alert = client.alerts.retrieve( "alert_id", ) - assert_matches_type(Alert, alert, path=["response"]) + assert_matches_type(AlertModel, alert, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Orb) -> None: @@ -37,7 +35,7 @@ def test_raw_response_retrieve(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = response.parse() - assert_matches_type(Alert, alert, path=["response"]) + assert_matches_type(AlertModel, alert, path=["response"]) @parametrize def test_streaming_response_retrieve(self, client: Orb) -> None: @@ -48,7 +46,7 @@ def test_streaming_response_retrieve(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = response.parse() - assert_matches_type(Alert, alert, path=["response"]) + assert_matches_type(AlertModel, alert, path=["response"]) assert cast(Any, response.is_closed) is True @@ -65,7 +63,7 @@ def test_method_update(self, client: Orb) -> None: alert_configuration_id="alert_configuration_id", thresholds=[{"value": 0}], ) - assert_matches_type(Alert, alert, path=["response"]) + assert_matches_type(AlertModel, alert, path=["response"]) @parametrize def test_raw_response_update(self, client: Orb) -> None: @@ -77,7 +75,7 @@ def test_raw_response_update(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = response.parse() - assert_matches_type(Alert, alert, path=["response"]) + assert_matches_type(AlertModel, alert, path=["response"]) @parametrize def test_streaming_response_update(self, client: Orb) -> None: @@ -89,7 +87,7 @@ def test_streaming_response_update(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = response.parse() - assert_matches_type(Alert, alert, path=["response"]) + assert_matches_type(AlertModel, alert, path=["response"]) assert cast(Any, response.is_closed) is True @@ -107,7 +105,7 @@ def test_path_params_update(self, client: Orb) -> None: @parametrize def test_method_list(self, client: Orb) -> None: alert = client.alerts.list() - assert_matches_type(SyncPage[Alert], alert, path=["response"]) + assert_matches_type(SyncPage[AlertModel], alert, path=["response"]) @pytest.mark.skip(reason="plan_version=0 breaks Prism") @parametrize @@ -123,7 +121,7 @@ def test_method_list_with_all_params(self, client: Orb) -> None: limit=1, subscription_id="subscription_id", ) - assert_matches_type(SyncPage[Alert], alert, path=["response"]) + assert_matches_type(SyncPage[AlertModel], alert, path=["response"]) @pytest.mark.skip(reason="plan_version=0 breaks Prism") @parametrize @@ -133,7 +131,7 @@ def test_raw_response_list(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = response.parse() - assert_matches_type(SyncPage[Alert], alert, path=["response"]) + assert_matches_type(SyncPage[AlertModel], alert, path=["response"]) @pytest.mark.skip(reason="plan_version=0 breaks Prism") @parametrize @@ -143,7 +141,7 @@ def test_streaming_response_list(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = response.parse() - assert_matches_type(SyncPage[Alert], alert, path=["response"]) + assert_matches_type(SyncPage[AlertModel], alert, path=["response"]) assert cast(Any, response.is_closed) is True @@ -154,7 +152,7 @@ def test_method_create_for_customer(self, client: Orb) -> None: currency="currency", type="usage_exceeded", ) - assert_matches_type(Alert, alert, path=["response"]) + assert_matches_type(AlertModel, alert, path=["response"]) @parametrize def test_method_create_for_customer_with_all_params(self, client: Orb) -> None: @@ -164,7 +162,7 @@ def test_method_create_for_customer_with_all_params(self, client: Orb) -> None: type="usage_exceeded", thresholds=[{"value": 0}], ) - assert_matches_type(Alert, alert, path=["response"]) + assert_matches_type(AlertModel, alert, path=["response"]) @parametrize def test_raw_response_create_for_customer(self, client: Orb) -> None: @@ -177,7 +175,7 @@ def test_raw_response_create_for_customer(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = response.parse() - assert_matches_type(Alert, alert, path=["response"]) + assert_matches_type(AlertModel, alert, path=["response"]) @parametrize def test_streaming_response_create_for_customer(self, client: Orb) -> None: @@ -190,7 +188,7 @@ def test_streaming_response_create_for_customer(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = response.parse() - assert_matches_type(Alert, alert, path=["response"]) + assert_matches_type(AlertModel, alert, path=["response"]) assert cast(Any, response.is_closed) is True @@ -210,7 +208,7 @@ def test_method_create_for_external_customer(self, client: Orb) -> None: currency="currency", type="usage_exceeded", ) - assert_matches_type(Alert, alert, path=["response"]) + assert_matches_type(AlertModel, alert, path=["response"]) @parametrize def test_method_create_for_external_customer_with_all_params(self, client: Orb) -> None: @@ -220,7 +218,7 @@ def test_method_create_for_external_customer_with_all_params(self, client: Orb) type="usage_exceeded", thresholds=[{"value": 0}], ) - assert_matches_type(Alert, alert, path=["response"]) + assert_matches_type(AlertModel, alert, path=["response"]) @parametrize def test_raw_response_create_for_external_customer(self, client: Orb) -> None: @@ -233,7 +231,7 @@ def test_raw_response_create_for_external_customer(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = response.parse() - assert_matches_type(Alert, alert, path=["response"]) + assert_matches_type(AlertModel, alert, path=["response"]) @parametrize def test_streaming_response_create_for_external_customer(self, client: Orb) -> None: @@ -246,7 +244,7 @@ def test_streaming_response_create_for_external_customer(self, client: Orb) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = response.parse() - assert_matches_type(Alert, alert, path=["response"]) + assert_matches_type(AlertModel, alert, path=["response"]) assert cast(Any, response.is_closed) is True @@ -266,7 +264,7 @@ def test_method_create_for_subscription(self, client: Orb) -> None: thresholds=[{"value": 0}], type="usage_exceeded", ) - assert_matches_type(Alert, alert, path=["response"]) + assert_matches_type(AlertModel, alert, path=["response"]) @parametrize def test_method_create_for_subscription_with_all_params(self, client: Orb) -> None: @@ -276,7 +274,7 @@ def test_method_create_for_subscription_with_all_params(self, client: Orb) -> No type="usage_exceeded", metric_id="metric_id", ) - assert_matches_type(Alert, alert, path=["response"]) + assert_matches_type(AlertModel, alert, path=["response"]) @parametrize def test_raw_response_create_for_subscription(self, client: Orb) -> None: @@ -289,7 +287,7 @@ def test_raw_response_create_for_subscription(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = response.parse() - assert_matches_type(Alert, alert, path=["response"]) + assert_matches_type(AlertModel, alert, path=["response"]) @parametrize def test_streaming_response_create_for_subscription(self, client: Orb) -> None: @@ -302,7 +300,7 @@ def test_streaming_response_create_for_subscription(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = response.parse() - assert_matches_type(Alert, alert, path=["response"]) + assert_matches_type(AlertModel, alert, path=["response"]) assert cast(Any, response.is_closed) is True @@ -320,7 +318,7 @@ def test_method_disable(self, client: Orb) -> None: alert = client.alerts.disable( alert_configuration_id="alert_configuration_id", ) - assert_matches_type(Alert, alert, path=["response"]) + assert_matches_type(AlertModel, alert, path=["response"]) @parametrize def test_method_disable_with_all_params(self, client: Orb) -> None: @@ -328,7 +326,7 @@ def test_method_disable_with_all_params(self, client: Orb) -> None: alert_configuration_id="alert_configuration_id", subscription_id="subscription_id", ) - assert_matches_type(Alert, alert, path=["response"]) + assert_matches_type(AlertModel, alert, path=["response"]) @parametrize def test_raw_response_disable(self, client: Orb) -> None: @@ -339,7 +337,7 @@ def test_raw_response_disable(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = response.parse() - assert_matches_type(Alert, alert, path=["response"]) + assert_matches_type(AlertModel, alert, path=["response"]) @parametrize def test_streaming_response_disable(self, client: Orb) -> None: @@ -350,7 +348,7 @@ def test_streaming_response_disable(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = response.parse() - assert_matches_type(Alert, alert, path=["response"]) + assert_matches_type(AlertModel, alert, path=["response"]) assert cast(Any, response.is_closed) is True @@ -368,7 +366,7 @@ def test_method_enable(self, client: Orb) -> None: alert = client.alerts.enable( alert_configuration_id="alert_configuration_id", ) - assert_matches_type(Alert, alert, path=["response"]) + assert_matches_type(AlertModel, alert, path=["response"]) @parametrize def test_method_enable_with_all_params(self, client: Orb) -> None: @@ -376,7 +374,7 @@ def test_method_enable_with_all_params(self, client: Orb) -> None: alert_configuration_id="alert_configuration_id", subscription_id="subscription_id", ) - assert_matches_type(Alert, alert, path=["response"]) + assert_matches_type(AlertModel, alert, path=["response"]) @parametrize def test_raw_response_enable(self, client: Orb) -> None: @@ -387,7 +385,7 @@ def test_raw_response_enable(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = response.parse() - assert_matches_type(Alert, alert, path=["response"]) + assert_matches_type(AlertModel, alert, path=["response"]) @parametrize def test_streaming_response_enable(self, client: Orb) -> None: @@ -398,7 +396,7 @@ def test_streaming_response_enable(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = response.parse() - assert_matches_type(Alert, alert, path=["response"]) + assert_matches_type(AlertModel, alert, path=["response"]) assert cast(Any, response.is_closed) is True @@ -420,7 +418,7 @@ async def test_method_retrieve(self, async_client: AsyncOrb) -> None: alert = await async_client.alerts.retrieve( "alert_id", ) - assert_matches_type(Alert, alert, path=["response"]) + assert_matches_type(AlertModel, alert, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncOrb) -> None: @@ -431,7 +429,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = response.parse() - assert_matches_type(Alert, alert, path=["response"]) + assert_matches_type(AlertModel, alert, path=["response"]) @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncOrb) -> None: @@ -442,7 +440,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncOrb) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = await response.parse() - assert_matches_type(Alert, alert, path=["response"]) + assert_matches_type(AlertModel, alert, path=["response"]) assert cast(Any, response.is_closed) is True @@ -459,7 +457,7 @@ async def test_method_update(self, async_client: AsyncOrb) -> None: alert_configuration_id="alert_configuration_id", thresholds=[{"value": 0}], ) - assert_matches_type(Alert, alert, path=["response"]) + assert_matches_type(AlertModel, alert, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncOrb) -> None: @@ -471,7 +469,7 @@ async def test_raw_response_update(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = response.parse() - assert_matches_type(Alert, alert, path=["response"]) + assert_matches_type(AlertModel, alert, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncOrb) -> None: @@ -483,7 +481,7 @@ async def test_streaming_response_update(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = await response.parse() - assert_matches_type(Alert, alert, path=["response"]) + assert_matches_type(AlertModel, alert, path=["response"]) assert cast(Any, response.is_closed) is True @@ -501,7 +499,7 @@ async def test_path_params_update(self, async_client: AsyncOrb) -> None: @parametrize async def test_method_list(self, async_client: AsyncOrb) -> None: alert = await async_client.alerts.list() - assert_matches_type(AsyncPage[Alert], alert, path=["response"]) + assert_matches_type(AsyncPage[AlertModel], alert, path=["response"]) @pytest.mark.skip(reason="plan_version=0 breaks Prism") @parametrize @@ -517,7 +515,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None limit=1, subscription_id="subscription_id", ) - assert_matches_type(AsyncPage[Alert], alert, path=["response"]) + assert_matches_type(AsyncPage[AlertModel], alert, path=["response"]) @pytest.mark.skip(reason="plan_version=0 breaks Prism") @parametrize @@ -527,7 +525,7 @@ async def test_raw_response_list(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = response.parse() - assert_matches_type(AsyncPage[Alert], alert, path=["response"]) + assert_matches_type(AsyncPage[AlertModel], alert, path=["response"]) @pytest.mark.skip(reason="plan_version=0 breaks Prism") @parametrize @@ -537,7 +535,7 @@ async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = await response.parse() - assert_matches_type(AsyncPage[Alert], alert, path=["response"]) + assert_matches_type(AsyncPage[AlertModel], alert, path=["response"]) assert cast(Any, response.is_closed) is True @@ -548,7 +546,7 @@ async def test_method_create_for_customer(self, async_client: AsyncOrb) -> None: currency="currency", type="usage_exceeded", ) - assert_matches_type(Alert, alert, path=["response"]) + assert_matches_type(AlertModel, alert, path=["response"]) @parametrize async def test_method_create_for_customer_with_all_params(self, async_client: AsyncOrb) -> None: @@ -558,7 +556,7 @@ async def test_method_create_for_customer_with_all_params(self, async_client: As type="usage_exceeded", thresholds=[{"value": 0}], ) - assert_matches_type(Alert, alert, path=["response"]) + assert_matches_type(AlertModel, alert, path=["response"]) @parametrize async def test_raw_response_create_for_customer(self, async_client: AsyncOrb) -> None: @@ -571,7 +569,7 @@ async def test_raw_response_create_for_customer(self, async_client: AsyncOrb) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = response.parse() - assert_matches_type(Alert, alert, path=["response"]) + assert_matches_type(AlertModel, alert, path=["response"]) @parametrize async def test_streaming_response_create_for_customer(self, async_client: AsyncOrb) -> None: @@ -584,7 +582,7 @@ async def test_streaming_response_create_for_customer(self, async_client: AsyncO assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = await response.parse() - assert_matches_type(Alert, alert, path=["response"]) + assert_matches_type(AlertModel, alert, path=["response"]) assert cast(Any, response.is_closed) is True @@ -604,7 +602,7 @@ async def test_method_create_for_external_customer(self, async_client: AsyncOrb) currency="currency", type="usage_exceeded", ) - assert_matches_type(Alert, alert, path=["response"]) + assert_matches_type(AlertModel, alert, path=["response"]) @parametrize async def test_method_create_for_external_customer_with_all_params(self, async_client: AsyncOrb) -> None: @@ -614,7 +612,7 @@ async def test_method_create_for_external_customer_with_all_params(self, async_c type="usage_exceeded", thresholds=[{"value": 0}], ) - assert_matches_type(Alert, alert, path=["response"]) + assert_matches_type(AlertModel, alert, path=["response"]) @parametrize async def test_raw_response_create_for_external_customer(self, async_client: AsyncOrb) -> None: @@ -627,7 +625,7 @@ async def test_raw_response_create_for_external_customer(self, async_client: Asy assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = response.parse() - assert_matches_type(Alert, alert, path=["response"]) + assert_matches_type(AlertModel, alert, path=["response"]) @parametrize async def test_streaming_response_create_for_external_customer(self, async_client: AsyncOrb) -> None: @@ -640,7 +638,7 @@ async def test_streaming_response_create_for_external_customer(self, async_clien assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = await response.parse() - assert_matches_type(Alert, alert, path=["response"]) + assert_matches_type(AlertModel, alert, path=["response"]) assert cast(Any, response.is_closed) is True @@ -660,7 +658,7 @@ async def test_method_create_for_subscription(self, async_client: AsyncOrb) -> N thresholds=[{"value": 0}], type="usage_exceeded", ) - assert_matches_type(Alert, alert, path=["response"]) + assert_matches_type(AlertModel, alert, path=["response"]) @parametrize async def test_method_create_for_subscription_with_all_params(self, async_client: AsyncOrb) -> None: @@ -670,7 +668,7 @@ async def test_method_create_for_subscription_with_all_params(self, async_client type="usage_exceeded", metric_id="metric_id", ) - assert_matches_type(Alert, alert, path=["response"]) + assert_matches_type(AlertModel, alert, path=["response"]) @parametrize async def test_raw_response_create_for_subscription(self, async_client: AsyncOrb) -> None: @@ -683,7 +681,7 @@ async def test_raw_response_create_for_subscription(self, async_client: AsyncOrb assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = response.parse() - assert_matches_type(Alert, alert, path=["response"]) + assert_matches_type(AlertModel, alert, path=["response"]) @parametrize async def test_streaming_response_create_for_subscription(self, async_client: AsyncOrb) -> None: @@ -696,7 +694,7 @@ async def test_streaming_response_create_for_subscription(self, async_client: As assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = await response.parse() - assert_matches_type(Alert, alert, path=["response"]) + assert_matches_type(AlertModel, alert, path=["response"]) assert cast(Any, response.is_closed) is True @@ -714,7 +712,7 @@ async def test_method_disable(self, async_client: AsyncOrb) -> None: alert = await async_client.alerts.disable( alert_configuration_id="alert_configuration_id", ) - assert_matches_type(Alert, alert, path=["response"]) + assert_matches_type(AlertModel, alert, path=["response"]) @parametrize async def test_method_disable_with_all_params(self, async_client: AsyncOrb) -> None: @@ -722,7 +720,7 @@ async def test_method_disable_with_all_params(self, async_client: AsyncOrb) -> N alert_configuration_id="alert_configuration_id", subscription_id="subscription_id", ) - assert_matches_type(Alert, alert, path=["response"]) + assert_matches_type(AlertModel, alert, path=["response"]) @parametrize async def test_raw_response_disable(self, async_client: AsyncOrb) -> None: @@ -733,7 +731,7 @@ async def test_raw_response_disable(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = response.parse() - assert_matches_type(Alert, alert, path=["response"]) + assert_matches_type(AlertModel, alert, path=["response"]) @parametrize async def test_streaming_response_disable(self, async_client: AsyncOrb) -> None: @@ -744,7 +742,7 @@ async def test_streaming_response_disable(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = await response.parse() - assert_matches_type(Alert, alert, path=["response"]) + assert_matches_type(AlertModel, alert, path=["response"]) assert cast(Any, response.is_closed) is True @@ -762,7 +760,7 @@ async def test_method_enable(self, async_client: AsyncOrb) -> None: alert = await async_client.alerts.enable( alert_configuration_id="alert_configuration_id", ) - assert_matches_type(Alert, alert, path=["response"]) + assert_matches_type(AlertModel, alert, path=["response"]) @parametrize async def test_method_enable_with_all_params(self, async_client: AsyncOrb) -> None: @@ -770,7 +768,7 @@ async def test_method_enable_with_all_params(self, async_client: AsyncOrb) -> No alert_configuration_id="alert_configuration_id", subscription_id="subscription_id", ) - assert_matches_type(Alert, alert, path=["response"]) + assert_matches_type(AlertModel, alert, path=["response"]) @parametrize async def test_raw_response_enable(self, async_client: AsyncOrb) -> None: @@ -781,7 +779,7 @@ async def test_raw_response_enable(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = response.parse() - assert_matches_type(Alert, alert, path=["response"]) + assert_matches_type(AlertModel, alert, path=["response"]) @parametrize async def test_streaming_response_enable(self, async_client: AsyncOrb) -> None: @@ -792,7 +790,7 @@ async def test_streaming_response_enable(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" alert = await response.parse() - assert_matches_type(Alert, alert, path=["response"]) + assert_matches_type(AlertModel, alert, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_coupons.py b/tests/api_resources/test_coupons.py index 8d59baa8..4c9e0f59 100644 --- a/tests/api_resources/test_coupons.py +++ b/tests/api_resources/test_coupons.py @@ -8,9 +8,9 @@ import pytest from orb import Orb, AsyncOrb -from orb.types import Coupon from tests.utils import assert_matches_type from orb.pagination import SyncPage, AsyncPage +from orb.types.shared import CouponModel base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -27,7 +27,7 @@ def test_method_create(self, client: Orb) -> None: }, redemption_code="HALFOFF", ) - assert_matches_type(Coupon, coupon, path=["response"]) + assert_matches_type(CouponModel, coupon, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Orb) -> None: @@ -40,7 +40,7 @@ def test_method_create_with_all_params(self, client: Orb) -> None: duration_in_months=12, max_redemptions=1, ) - assert_matches_type(Coupon, coupon, path=["response"]) + assert_matches_type(CouponModel, coupon, path=["response"]) @parametrize def test_raw_response_create(self, client: Orb) -> None: @@ -55,7 +55,7 @@ def test_raw_response_create(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" coupon = response.parse() - assert_matches_type(Coupon, coupon, path=["response"]) + assert_matches_type(CouponModel, coupon, path=["response"]) @parametrize def test_streaming_response_create(self, client: Orb) -> None: @@ -70,14 +70,14 @@ def test_streaming_response_create(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" coupon = response.parse() - assert_matches_type(Coupon, coupon, path=["response"]) + assert_matches_type(CouponModel, coupon, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_method_list(self, client: Orb) -> None: coupon = client.coupons.list() - assert_matches_type(SyncPage[Coupon], coupon, path=["response"]) + assert_matches_type(SyncPage[CouponModel], coupon, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Orb) -> None: @@ -87,7 +87,7 @@ def test_method_list_with_all_params(self, client: Orb) -> None: redemption_code="redemption_code", show_archived=True, ) - assert_matches_type(SyncPage[Coupon], coupon, path=["response"]) + assert_matches_type(SyncPage[CouponModel], coupon, path=["response"]) @parametrize def test_raw_response_list(self, client: Orb) -> None: @@ -96,7 +96,7 @@ def test_raw_response_list(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" coupon = response.parse() - assert_matches_type(SyncPage[Coupon], coupon, path=["response"]) + assert_matches_type(SyncPage[CouponModel], coupon, path=["response"]) @parametrize def test_streaming_response_list(self, client: Orb) -> None: @@ -105,7 +105,7 @@ def test_streaming_response_list(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" coupon = response.parse() - assert_matches_type(SyncPage[Coupon], coupon, path=["response"]) + assert_matches_type(SyncPage[CouponModel], coupon, path=["response"]) assert cast(Any, response.is_closed) is True @@ -114,7 +114,7 @@ def test_method_archive(self, client: Orb) -> None: coupon = client.coupons.archive( "coupon_id", ) - assert_matches_type(Coupon, coupon, path=["response"]) + assert_matches_type(CouponModel, coupon, path=["response"]) @parametrize def test_raw_response_archive(self, client: Orb) -> None: @@ -125,7 +125,7 @@ def test_raw_response_archive(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" coupon = response.parse() - assert_matches_type(Coupon, coupon, path=["response"]) + assert_matches_type(CouponModel, coupon, path=["response"]) @parametrize def test_streaming_response_archive(self, client: Orb) -> None: @@ -136,7 +136,7 @@ def test_streaming_response_archive(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" coupon = response.parse() - assert_matches_type(Coupon, coupon, path=["response"]) + assert_matches_type(CouponModel, coupon, path=["response"]) assert cast(Any, response.is_closed) is True @@ -152,7 +152,7 @@ def test_method_fetch(self, client: Orb) -> None: coupon = client.coupons.fetch( "coupon_id", ) - assert_matches_type(Coupon, coupon, path=["response"]) + assert_matches_type(CouponModel, coupon, path=["response"]) @parametrize def test_raw_response_fetch(self, client: Orb) -> None: @@ -163,7 +163,7 @@ def test_raw_response_fetch(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" coupon = response.parse() - assert_matches_type(Coupon, coupon, path=["response"]) + assert_matches_type(CouponModel, coupon, path=["response"]) @parametrize def test_streaming_response_fetch(self, client: Orb) -> None: @@ -174,7 +174,7 @@ def test_streaming_response_fetch(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" coupon = response.parse() - assert_matches_type(Coupon, coupon, path=["response"]) + assert_matches_type(CouponModel, coupon, path=["response"]) assert cast(Any, response.is_closed) is True @@ -198,7 +198,7 @@ async def test_method_create(self, async_client: AsyncOrb) -> None: }, redemption_code="HALFOFF", ) - assert_matches_type(Coupon, coupon, path=["response"]) + assert_matches_type(CouponModel, coupon, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> None: @@ -211,7 +211,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No duration_in_months=12, max_redemptions=1, ) - assert_matches_type(Coupon, coupon, path=["response"]) + assert_matches_type(CouponModel, coupon, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncOrb) -> None: @@ -226,7 +226,7 @@ async def test_raw_response_create(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" coupon = response.parse() - assert_matches_type(Coupon, coupon, path=["response"]) + assert_matches_type(CouponModel, coupon, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: @@ -241,14 +241,14 @@ async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" coupon = await response.parse() - assert_matches_type(Coupon, coupon, path=["response"]) + assert_matches_type(CouponModel, coupon, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_method_list(self, async_client: AsyncOrb) -> None: coupon = await async_client.coupons.list() - assert_matches_type(AsyncPage[Coupon], coupon, path=["response"]) + assert_matches_type(AsyncPage[CouponModel], coupon, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None: @@ -258,7 +258,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None redemption_code="redemption_code", show_archived=True, ) - assert_matches_type(AsyncPage[Coupon], coupon, path=["response"]) + assert_matches_type(AsyncPage[CouponModel], coupon, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncOrb) -> None: @@ -267,7 +267,7 @@ async def test_raw_response_list(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" coupon = response.parse() - assert_matches_type(AsyncPage[Coupon], coupon, path=["response"]) + assert_matches_type(AsyncPage[CouponModel], coupon, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: @@ -276,7 +276,7 @@ async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" coupon = await response.parse() - assert_matches_type(AsyncPage[Coupon], coupon, path=["response"]) + assert_matches_type(AsyncPage[CouponModel], coupon, path=["response"]) assert cast(Any, response.is_closed) is True @@ -285,7 +285,7 @@ async def test_method_archive(self, async_client: AsyncOrb) -> None: coupon = await async_client.coupons.archive( "coupon_id", ) - assert_matches_type(Coupon, coupon, path=["response"]) + assert_matches_type(CouponModel, coupon, path=["response"]) @parametrize async def test_raw_response_archive(self, async_client: AsyncOrb) -> None: @@ -296,7 +296,7 @@ async def test_raw_response_archive(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" coupon = response.parse() - assert_matches_type(Coupon, coupon, path=["response"]) + assert_matches_type(CouponModel, coupon, path=["response"]) @parametrize async def test_streaming_response_archive(self, async_client: AsyncOrb) -> None: @@ -307,7 +307,7 @@ async def test_streaming_response_archive(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" coupon = await response.parse() - assert_matches_type(Coupon, coupon, path=["response"]) + assert_matches_type(CouponModel, coupon, path=["response"]) assert cast(Any, response.is_closed) is True @@ -323,7 +323,7 @@ async def test_method_fetch(self, async_client: AsyncOrb) -> None: coupon = await async_client.coupons.fetch( "coupon_id", ) - assert_matches_type(Coupon, coupon, path=["response"]) + assert_matches_type(CouponModel, coupon, path=["response"]) @parametrize async def test_raw_response_fetch(self, async_client: AsyncOrb) -> None: @@ -334,7 +334,7 @@ async def test_raw_response_fetch(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" coupon = response.parse() - assert_matches_type(Coupon, coupon, path=["response"]) + assert_matches_type(CouponModel, coupon, path=["response"]) @parametrize async def test_streaming_response_fetch(self, async_client: AsyncOrb) -> None: @@ -345,7 +345,7 @@ async def test_streaming_response_fetch(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" coupon = await response.parse() - assert_matches_type(Coupon, coupon, path=["response"]) + assert_matches_type(CouponModel, coupon, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_credit_notes.py b/tests/api_resources/test_credit_notes.py index 08d07146..73080142 100644 --- a/tests/api_resources/test_credit_notes.py +++ b/tests/api_resources/test_credit_notes.py @@ -8,9 +8,9 @@ import pytest from orb import Orb, AsyncOrb -from orb.types import CreditNote from tests.utils import assert_matches_type from orb.pagination import SyncPage, AsyncPage +from orb.types.shared import CreditNoteModel base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -28,7 +28,7 @@ def test_method_create(self, client: Orb) -> None: } ], ) - assert_matches_type(CreditNote, credit_note, path=["response"]) + assert_matches_type(CreditNoteModel, credit_note, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Orb) -> None: @@ -42,7 +42,7 @@ def test_method_create_with_all_params(self, client: Orb) -> None: memo="An optional memo for my credit note.", reason="duplicate", ) - assert_matches_type(CreditNote, credit_note, path=["response"]) + assert_matches_type(CreditNoteModel, credit_note, path=["response"]) @parametrize def test_raw_response_create(self, client: Orb) -> None: @@ -58,7 +58,7 @@ def test_raw_response_create(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" credit_note = response.parse() - assert_matches_type(CreditNote, credit_note, path=["response"]) + assert_matches_type(CreditNoteModel, credit_note, path=["response"]) @parametrize def test_streaming_response_create(self, client: Orb) -> None: @@ -74,14 +74,14 @@ def test_streaming_response_create(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" credit_note = response.parse() - assert_matches_type(CreditNote, credit_note, path=["response"]) + assert_matches_type(CreditNoteModel, credit_note, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_method_list(self, client: Orb) -> None: credit_note = client.credit_notes.list() - assert_matches_type(SyncPage[CreditNote], credit_note, path=["response"]) + assert_matches_type(SyncPage[CreditNoteModel], credit_note, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Orb) -> None: @@ -89,7 +89,7 @@ def test_method_list_with_all_params(self, client: Orb) -> None: cursor="cursor", limit=1, ) - assert_matches_type(SyncPage[CreditNote], credit_note, path=["response"]) + assert_matches_type(SyncPage[CreditNoteModel], credit_note, path=["response"]) @parametrize def test_raw_response_list(self, client: Orb) -> None: @@ -98,7 +98,7 @@ def test_raw_response_list(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" credit_note = response.parse() - assert_matches_type(SyncPage[CreditNote], credit_note, path=["response"]) + assert_matches_type(SyncPage[CreditNoteModel], credit_note, path=["response"]) @parametrize def test_streaming_response_list(self, client: Orb) -> None: @@ -107,7 +107,7 @@ def test_streaming_response_list(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" credit_note = response.parse() - assert_matches_type(SyncPage[CreditNote], credit_note, path=["response"]) + assert_matches_type(SyncPage[CreditNoteModel], credit_note, path=["response"]) assert cast(Any, response.is_closed) is True @@ -116,7 +116,7 @@ def test_method_fetch(self, client: Orb) -> None: credit_note = client.credit_notes.fetch( "credit_note_id", ) - assert_matches_type(CreditNote, credit_note, path=["response"]) + assert_matches_type(CreditNoteModel, credit_note, path=["response"]) @parametrize def test_raw_response_fetch(self, client: Orb) -> None: @@ -127,7 +127,7 @@ def test_raw_response_fetch(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" credit_note = response.parse() - assert_matches_type(CreditNote, credit_note, path=["response"]) + assert_matches_type(CreditNoteModel, credit_note, path=["response"]) @parametrize def test_streaming_response_fetch(self, client: Orb) -> None: @@ -138,7 +138,7 @@ def test_streaming_response_fetch(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" credit_note = response.parse() - assert_matches_type(CreditNote, credit_note, path=["response"]) + assert_matches_type(CreditNoteModel, credit_note, path=["response"]) assert cast(Any, response.is_closed) is True @@ -163,7 +163,7 @@ async def test_method_create(self, async_client: AsyncOrb) -> None: } ], ) - assert_matches_type(CreditNote, credit_note, path=["response"]) + assert_matches_type(CreditNoteModel, credit_note, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> None: @@ -177,7 +177,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No memo="An optional memo for my credit note.", reason="duplicate", ) - assert_matches_type(CreditNote, credit_note, path=["response"]) + assert_matches_type(CreditNoteModel, credit_note, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncOrb) -> None: @@ -193,7 +193,7 @@ async def test_raw_response_create(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" credit_note = response.parse() - assert_matches_type(CreditNote, credit_note, path=["response"]) + assert_matches_type(CreditNoteModel, credit_note, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: @@ -209,14 +209,14 @@ async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" credit_note = await response.parse() - assert_matches_type(CreditNote, credit_note, path=["response"]) + assert_matches_type(CreditNoteModel, credit_note, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_method_list(self, async_client: AsyncOrb) -> None: credit_note = await async_client.credit_notes.list() - assert_matches_type(AsyncPage[CreditNote], credit_note, path=["response"]) + assert_matches_type(AsyncPage[CreditNoteModel], credit_note, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None: @@ -224,7 +224,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None cursor="cursor", limit=1, ) - assert_matches_type(AsyncPage[CreditNote], credit_note, path=["response"]) + assert_matches_type(AsyncPage[CreditNoteModel], credit_note, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncOrb) -> None: @@ -233,7 +233,7 @@ async def test_raw_response_list(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" credit_note = response.parse() - assert_matches_type(AsyncPage[CreditNote], credit_note, path=["response"]) + assert_matches_type(AsyncPage[CreditNoteModel], credit_note, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: @@ -242,7 +242,7 @@ async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" credit_note = await response.parse() - assert_matches_type(AsyncPage[CreditNote], credit_note, path=["response"]) + assert_matches_type(AsyncPage[CreditNoteModel], credit_note, path=["response"]) assert cast(Any, response.is_closed) is True @@ -251,7 +251,7 @@ async def test_method_fetch(self, async_client: AsyncOrb) -> None: credit_note = await async_client.credit_notes.fetch( "credit_note_id", ) - assert_matches_type(CreditNote, credit_note, path=["response"]) + assert_matches_type(CreditNoteModel, credit_note, path=["response"]) @parametrize async def test_raw_response_fetch(self, async_client: AsyncOrb) -> None: @@ -262,7 +262,7 @@ async def test_raw_response_fetch(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" credit_note = response.parse() - assert_matches_type(CreditNote, credit_note, path=["response"]) + assert_matches_type(CreditNoteModel, credit_note, path=["response"]) @parametrize async def test_streaming_response_fetch(self, async_client: AsyncOrb) -> None: @@ -273,7 +273,7 @@ async def test_streaming_response_fetch(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" credit_note = await response.parse() - assert_matches_type(CreditNote, credit_note, path=["response"]) + assert_matches_type(CreditNoteModel, credit_note, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_customers.py b/tests/api_resources/test_customers.py index 1e87e427..3616c1ee 100644 --- a/tests/api_resources/test_customers.py +++ b/tests/api_resources/test_customers.py @@ -8,12 +8,10 @@ import pytest from orb import Orb, AsyncOrb -from orb.types import ( - Customer, -) from orb._utils import parse_datetime from tests.utils import assert_matches_type from orb.pagination import SyncPage, AsyncPage +from orb.types.shared import CustomerModel base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -27,7 +25,7 @@ def test_method_create(self, client: Orb) -> None: email="dev@stainless.com", name="x", ) - assert_matches_type(Customer, customer, path=["response"]) + assert_matches_type(CustomerModel, customer, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Orb) -> None: @@ -84,7 +82,7 @@ def test_method_create_with_all_params(self, client: Orb) -> None: }, timezone="timezone", ) - assert_matches_type(Customer, customer, path=["response"]) + assert_matches_type(CustomerModel, customer, path=["response"]) @parametrize def test_raw_response_create(self, client: Orb) -> None: @@ -96,7 +94,7 @@ def test_raw_response_create(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" customer = response.parse() - assert_matches_type(Customer, customer, path=["response"]) + assert_matches_type(CustomerModel, customer, path=["response"]) @parametrize def test_streaming_response_create(self, client: Orb) -> None: @@ -108,7 +106,7 @@ def test_streaming_response_create(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" customer = response.parse() - assert_matches_type(Customer, customer, path=["response"]) + assert_matches_type(CustomerModel, customer, path=["response"]) assert cast(Any, response.is_closed) is True @@ -117,7 +115,7 @@ def test_method_update(self, client: Orb) -> None: customer = client.customers.update( customer_id="customer_id", ) - assert_matches_type(Customer, customer, path=["response"]) + assert_matches_type(CustomerModel, customer, path=["response"]) @parametrize def test_method_update_with_all_params(self, client: Orb) -> None: @@ -174,7 +172,7 @@ def test_method_update_with_all_params(self, client: Orb) -> None: "value": "value", }, ) - assert_matches_type(Customer, customer, path=["response"]) + assert_matches_type(CustomerModel, customer, path=["response"]) @parametrize def test_raw_response_update(self, client: Orb) -> None: @@ -185,7 +183,7 @@ def test_raw_response_update(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" customer = response.parse() - assert_matches_type(Customer, customer, path=["response"]) + assert_matches_type(CustomerModel, customer, path=["response"]) @parametrize def test_streaming_response_update(self, client: Orb) -> None: @@ -196,7 +194,7 @@ def test_streaming_response_update(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" customer = response.parse() - assert_matches_type(Customer, customer, path=["response"]) + assert_matches_type(CustomerModel, customer, path=["response"]) assert cast(Any, response.is_closed) is True @@ -210,7 +208,7 @@ def test_path_params_update(self, client: Orb) -> None: @parametrize def test_method_list(self, client: Orb) -> None: customer = client.customers.list() - assert_matches_type(SyncPage[Customer], customer, path=["response"]) + assert_matches_type(SyncPage[CustomerModel], customer, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Orb) -> None: @@ -222,7 +220,7 @@ def test_method_list_with_all_params(self, client: Orb) -> None: cursor="cursor", limit=1, ) - assert_matches_type(SyncPage[Customer], customer, path=["response"]) + assert_matches_type(SyncPage[CustomerModel], customer, path=["response"]) @parametrize def test_raw_response_list(self, client: Orb) -> None: @@ -231,7 +229,7 @@ def test_raw_response_list(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" customer = response.parse() - assert_matches_type(SyncPage[Customer], customer, path=["response"]) + assert_matches_type(SyncPage[CustomerModel], customer, path=["response"]) @parametrize def test_streaming_response_list(self, client: Orb) -> None: @@ -240,7 +238,7 @@ def test_streaming_response_list(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" customer = response.parse() - assert_matches_type(SyncPage[Customer], customer, path=["response"]) + assert_matches_type(SyncPage[CustomerModel], customer, path=["response"]) assert cast(Any, response.is_closed) is True @@ -287,7 +285,7 @@ def test_method_fetch(self, client: Orb) -> None: customer = client.customers.fetch( "customer_id", ) - assert_matches_type(Customer, customer, path=["response"]) + assert_matches_type(CustomerModel, customer, path=["response"]) @parametrize def test_raw_response_fetch(self, client: Orb) -> None: @@ -298,7 +296,7 @@ def test_raw_response_fetch(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" customer = response.parse() - assert_matches_type(Customer, customer, path=["response"]) + assert_matches_type(CustomerModel, customer, path=["response"]) @parametrize def test_streaming_response_fetch(self, client: Orb) -> None: @@ -309,7 +307,7 @@ def test_streaming_response_fetch(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" customer = response.parse() - assert_matches_type(Customer, customer, path=["response"]) + assert_matches_type(CustomerModel, customer, path=["response"]) assert cast(Any, response.is_closed) is True @@ -325,7 +323,7 @@ def test_method_fetch_by_external_id(self, client: Orb) -> None: customer = client.customers.fetch_by_external_id( "external_customer_id", ) - assert_matches_type(Customer, customer, path=["response"]) + assert_matches_type(CustomerModel, customer, path=["response"]) @parametrize def test_raw_response_fetch_by_external_id(self, client: Orb) -> None: @@ -336,7 +334,7 @@ def test_raw_response_fetch_by_external_id(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" customer = response.parse() - assert_matches_type(Customer, customer, path=["response"]) + assert_matches_type(CustomerModel, customer, path=["response"]) @parametrize def test_streaming_response_fetch_by_external_id(self, client: Orb) -> None: @@ -347,7 +345,7 @@ def test_streaming_response_fetch_by_external_id(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" customer = response.parse() - assert_matches_type(Customer, customer, path=["response"]) + assert_matches_type(CustomerModel, customer, path=["response"]) assert cast(Any, response.is_closed) is True @@ -439,7 +437,7 @@ def test_method_update_by_external_id(self, client: Orb) -> None: customer = client.customers.update_by_external_id( id="external_customer_id", ) - assert_matches_type(Customer, customer, path=["response"]) + assert_matches_type(CustomerModel, customer, path=["response"]) @parametrize def test_method_update_by_external_id_with_all_params(self, client: Orb) -> None: @@ -496,7 +494,7 @@ def test_method_update_by_external_id_with_all_params(self, client: Orb) -> None "value": "value", }, ) - assert_matches_type(Customer, customer, path=["response"]) + assert_matches_type(CustomerModel, customer, path=["response"]) @parametrize def test_raw_response_update_by_external_id(self, client: Orb) -> None: @@ -507,7 +505,7 @@ def test_raw_response_update_by_external_id(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" customer = response.parse() - assert_matches_type(Customer, customer, path=["response"]) + assert_matches_type(CustomerModel, customer, path=["response"]) @parametrize def test_streaming_response_update_by_external_id(self, client: Orb) -> None: @@ -518,7 +516,7 @@ def test_streaming_response_update_by_external_id(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" customer = response.parse() - assert_matches_type(Customer, customer, path=["response"]) + assert_matches_type(CustomerModel, customer, path=["response"]) assert cast(Any, response.is_closed) is True @@ -540,7 +538,7 @@ async def test_method_create(self, async_client: AsyncOrb) -> None: email="dev@stainless.com", name="x", ) - assert_matches_type(Customer, customer, path=["response"]) + assert_matches_type(CustomerModel, customer, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> None: @@ -597,7 +595,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No }, timezone="timezone", ) - assert_matches_type(Customer, customer, path=["response"]) + assert_matches_type(CustomerModel, customer, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncOrb) -> None: @@ -609,7 +607,7 @@ async def test_raw_response_create(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" customer = response.parse() - assert_matches_type(Customer, customer, path=["response"]) + assert_matches_type(CustomerModel, customer, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: @@ -621,7 +619,7 @@ async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" customer = await response.parse() - assert_matches_type(Customer, customer, path=["response"]) + assert_matches_type(CustomerModel, customer, path=["response"]) assert cast(Any, response.is_closed) is True @@ -630,7 +628,7 @@ async def test_method_update(self, async_client: AsyncOrb) -> None: customer = await async_client.customers.update( customer_id="customer_id", ) - assert_matches_type(Customer, customer, path=["response"]) + assert_matches_type(CustomerModel, customer, path=["response"]) @parametrize async def test_method_update_with_all_params(self, async_client: AsyncOrb) -> None: @@ -687,7 +685,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncOrb) -> No "value": "value", }, ) - assert_matches_type(Customer, customer, path=["response"]) + assert_matches_type(CustomerModel, customer, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncOrb) -> None: @@ -698,7 +696,7 @@ async def test_raw_response_update(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" customer = response.parse() - assert_matches_type(Customer, customer, path=["response"]) + assert_matches_type(CustomerModel, customer, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncOrb) -> None: @@ -709,7 +707,7 @@ async def test_streaming_response_update(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" customer = await response.parse() - assert_matches_type(Customer, customer, path=["response"]) + assert_matches_type(CustomerModel, customer, path=["response"]) assert cast(Any, response.is_closed) is True @@ -723,7 +721,7 @@ async def test_path_params_update(self, async_client: AsyncOrb) -> None: @parametrize async def test_method_list(self, async_client: AsyncOrb) -> None: customer = await async_client.customers.list() - assert_matches_type(AsyncPage[Customer], customer, path=["response"]) + assert_matches_type(AsyncPage[CustomerModel], customer, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None: @@ -735,7 +733,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None cursor="cursor", limit=1, ) - assert_matches_type(AsyncPage[Customer], customer, path=["response"]) + assert_matches_type(AsyncPage[CustomerModel], customer, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncOrb) -> None: @@ -744,7 +742,7 @@ async def test_raw_response_list(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" customer = response.parse() - assert_matches_type(AsyncPage[Customer], customer, path=["response"]) + assert_matches_type(AsyncPage[CustomerModel], customer, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: @@ -753,7 +751,7 @@ async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" customer = await response.parse() - assert_matches_type(AsyncPage[Customer], customer, path=["response"]) + assert_matches_type(AsyncPage[CustomerModel], customer, path=["response"]) assert cast(Any, response.is_closed) is True @@ -800,7 +798,7 @@ async def test_method_fetch(self, async_client: AsyncOrb) -> None: customer = await async_client.customers.fetch( "customer_id", ) - assert_matches_type(Customer, customer, path=["response"]) + assert_matches_type(CustomerModel, customer, path=["response"]) @parametrize async def test_raw_response_fetch(self, async_client: AsyncOrb) -> None: @@ -811,7 +809,7 @@ async def test_raw_response_fetch(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" customer = response.parse() - assert_matches_type(Customer, customer, path=["response"]) + assert_matches_type(CustomerModel, customer, path=["response"]) @parametrize async def test_streaming_response_fetch(self, async_client: AsyncOrb) -> None: @@ -822,7 +820,7 @@ async def test_streaming_response_fetch(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" customer = await response.parse() - assert_matches_type(Customer, customer, path=["response"]) + assert_matches_type(CustomerModel, customer, path=["response"]) assert cast(Any, response.is_closed) is True @@ -838,7 +836,7 @@ async def test_method_fetch_by_external_id(self, async_client: AsyncOrb) -> None customer = await async_client.customers.fetch_by_external_id( "external_customer_id", ) - assert_matches_type(Customer, customer, path=["response"]) + assert_matches_type(CustomerModel, customer, path=["response"]) @parametrize async def test_raw_response_fetch_by_external_id(self, async_client: AsyncOrb) -> None: @@ -849,7 +847,7 @@ async def test_raw_response_fetch_by_external_id(self, async_client: AsyncOrb) - assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" customer = response.parse() - assert_matches_type(Customer, customer, path=["response"]) + assert_matches_type(CustomerModel, customer, path=["response"]) @parametrize async def test_streaming_response_fetch_by_external_id(self, async_client: AsyncOrb) -> None: @@ -860,7 +858,7 @@ async def test_streaming_response_fetch_by_external_id(self, async_client: Async assert response.http_request.headers.get("X-Stainless-Lang") == "python" customer = await response.parse() - assert_matches_type(Customer, customer, path=["response"]) + assert_matches_type(CustomerModel, customer, path=["response"]) assert cast(Any, response.is_closed) is True @@ -964,7 +962,7 @@ async def test_method_update_by_external_id(self, async_client: AsyncOrb) -> Non customer = await async_client.customers.update_by_external_id( id="external_customer_id", ) - assert_matches_type(Customer, customer, path=["response"]) + assert_matches_type(CustomerModel, customer, path=["response"]) @parametrize async def test_method_update_by_external_id_with_all_params(self, async_client: AsyncOrb) -> None: @@ -1021,7 +1019,7 @@ async def test_method_update_by_external_id_with_all_params(self, async_client: "value": "value", }, ) - assert_matches_type(Customer, customer, path=["response"]) + assert_matches_type(CustomerModel, customer, path=["response"]) @parametrize async def test_raw_response_update_by_external_id(self, async_client: AsyncOrb) -> None: @@ -1032,7 +1030,7 @@ async def test_raw_response_update_by_external_id(self, async_client: AsyncOrb) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" customer = response.parse() - assert_matches_type(Customer, customer, path=["response"]) + assert_matches_type(CustomerModel, customer, path=["response"]) @parametrize async def test_streaming_response_update_by_external_id(self, async_client: AsyncOrb) -> None: @@ -1043,7 +1041,7 @@ async def test_streaming_response_update_by_external_id(self, async_client: Asyn assert response.http_request.headers.get("X-Stainless-Lang") == "python" customer = await response.parse() - assert_matches_type(Customer, customer, path=["response"]) + assert_matches_type(CustomerModel, customer, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_dimensional_price_groups.py b/tests/api_resources/test_dimensional_price_groups.py index d371b7c5..de1e9f2a 100644 --- a/tests/api_resources/test_dimensional_price_groups.py +++ b/tests/api_resources/test_dimensional_price_groups.py @@ -8,9 +8,9 @@ import pytest from orb import Orb, AsyncOrb -from orb.types import DimensionalPriceGroup from tests.utils import assert_matches_type from orb.pagination import SyncPage, AsyncPage +from orb.types.shared import DimensionalPriceGroupModel base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -25,7 +25,7 @@ def test_method_create(self, client: Orb) -> None: dimensions=["region", "instance_type"], name="name", ) - assert_matches_type(DimensionalPriceGroup, dimensional_price_group, path=["response"]) + assert_matches_type(DimensionalPriceGroupModel, dimensional_price_group, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Orb) -> None: @@ -36,7 +36,7 @@ def test_method_create_with_all_params(self, client: Orb) -> None: external_dimensional_price_group_id="external_dimensional_price_group_id", metadata={"foo": "string"}, ) - assert_matches_type(DimensionalPriceGroup, dimensional_price_group, path=["response"]) + assert_matches_type(DimensionalPriceGroupModel, dimensional_price_group, path=["response"]) @parametrize def test_raw_response_create(self, client: Orb) -> None: @@ -49,7 +49,7 @@ def test_raw_response_create(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" dimensional_price_group = response.parse() - assert_matches_type(DimensionalPriceGroup, dimensional_price_group, path=["response"]) + assert_matches_type(DimensionalPriceGroupModel, dimensional_price_group, path=["response"]) @parametrize def test_streaming_response_create(self, client: Orb) -> None: @@ -62,7 +62,7 @@ def test_streaming_response_create(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" dimensional_price_group = response.parse() - assert_matches_type(DimensionalPriceGroup, dimensional_price_group, path=["response"]) + assert_matches_type(DimensionalPriceGroupModel, dimensional_price_group, path=["response"]) assert cast(Any, response.is_closed) is True @@ -71,7 +71,7 @@ def test_method_retrieve(self, client: Orb) -> None: dimensional_price_group = client.dimensional_price_groups.retrieve( "dimensional_price_group_id", ) - assert_matches_type(DimensionalPriceGroup, dimensional_price_group, path=["response"]) + assert_matches_type(DimensionalPriceGroupModel, dimensional_price_group, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Orb) -> None: @@ -82,7 +82,7 @@ def test_raw_response_retrieve(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" dimensional_price_group = response.parse() - assert_matches_type(DimensionalPriceGroup, dimensional_price_group, path=["response"]) + assert_matches_type(DimensionalPriceGroupModel, dimensional_price_group, path=["response"]) @parametrize def test_streaming_response_retrieve(self, client: Orb) -> None: @@ -93,7 +93,7 @@ def test_streaming_response_retrieve(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" dimensional_price_group = response.parse() - assert_matches_type(DimensionalPriceGroup, dimensional_price_group, path=["response"]) + assert_matches_type(DimensionalPriceGroupModel, dimensional_price_group, path=["response"]) assert cast(Any, response.is_closed) is True @@ -109,7 +109,7 @@ def test_path_params_retrieve(self, client: Orb) -> None: @parametrize def test_method_list(self, client: Orb) -> None: dimensional_price_group = client.dimensional_price_groups.list() - assert_matches_type(SyncPage[DimensionalPriceGroup], dimensional_price_group, path=["response"]) + assert_matches_type(SyncPage[DimensionalPriceGroupModel], dimensional_price_group, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Orb) -> None: @@ -117,7 +117,7 @@ def test_method_list_with_all_params(self, client: Orb) -> None: cursor="cursor", limit=1, ) - assert_matches_type(SyncPage[DimensionalPriceGroup], dimensional_price_group, path=["response"]) + assert_matches_type(SyncPage[DimensionalPriceGroupModel], dimensional_price_group, path=["response"]) @parametrize def test_raw_response_list(self, client: Orb) -> None: @@ -126,7 +126,7 @@ def test_raw_response_list(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" dimensional_price_group = response.parse() - assert_matches_type(SyncPage[DimensionalPriceGroup], dimensional_price_group, path=["response"]) + assert_matches_type(SyncPage[DimensionalPriceGroupModel], dimensional_price_group, path=["response"]) @parametrize def test_streaming_response_list(self, client: Orb) -> None: @@ -135,7 +135,7 @@ def test_streaming_response_list(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" dimensional_price_group = response.parse() - assert_matches_type(SyncPage[DimensionalPriceGroup], dimensional_price_group, path=["response"]) + assert_matches_type(SyncPage[DimensionalPriceGroupModel], dimensional_price_group, path=["response"]) assert cast(Any, response.is_closed) is True @@ -150,7 +150,7 @@ async def test_method_create(self, async_client: AsyncOrb) -> None: dimensions=["region", "instance_type"], name="name", ) - assert_matches_type(DimensionalPriceGroup, dimensional_price_group, path=["response"]) + assert_matches_type(DimensionalPriceGroupModel, dimensional_price_group, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> None: @@ -161,7 +161,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No external_dimensional_price_group_id="external_dimensional_price_group_id", metadata={"foo": "string"}, ) - assert_matches_type(DimensionalPriceGroup, dimensional_price_group, path=["response"]) + assert_matches_type(DimensionalPriceGroupModel, dimensional_price_group, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncOrb) -> None: @@ -174,7 +174,7 @@ async def test_raw_response_create(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" dimensional_price_group = response.parse() - assert_matches_type(DimensionalPriceGroup, dimensional_price_group, path=["response"]) + assert_matches_type(DimensionalPriceGroupModel, dimensional_price_group, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: @@ -187,7 +187,7 @@ async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" dimensional_price_group = await response.parse() - assert_matches_type(DimensionalPriceGroup, dimensional_price_group, path=["response"]) + assert_matches_type(DimensionalPriceGroupModel, dimensional_price_group, path=["response"]) assert cast(Any, response.is_closed) is True @@ -196,7 +196,7 @@ async def test_method_retrieve(self, async_client: AsyncOrb) -> None: dimensional_price_group = await async_client.dimensional_price_groups.retrieve( "dimensional_price_group_id", ) - assert_matches_type(DimensionalPriceGroup, dimensional_price_group, path=["response"]) + assert_matches_type(DimensionalPriceGroupModel, dimensional_price_group, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncOrb) -> None: @@ -207,7 +207,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" dimensional_price_group = response.parse() - assert_matches_type(DimensionalPriceGroup, dimensional_price_group, path=["response"]) + assert_matches_type(DimensionalPriceGroupModel, dimensional_price_group, path=["response"]) @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncOrb) -> None: @@ -218,7 +218,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncOrb) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" dimensional_price_group = await response.parse() - assert_matches_type(DimensionalPriceGroup, dimensional_price_group, path=["response"]) + assert_matches_type(DimensionalPriceGroupModel, dimensional_price_group, path=["response"]) assert cast(Any, response.is_closed) is True @@ -234,7 +234,7 @@ async def test_path_params_retrieve(self, async_client: AsyncOrb) -> None: @parametrize async def test_method_list(self, async_client: AsyncOrb) -> None: dimensional_price_group = await async_client.dimensional_price_groups.list() - assert_matches_type(AsyncPage[DimensionalPriceGroup], dimensional_price_group, path=["response"]) + assert_matches_type(AsyncPage[DimensionalPriceGroupModel], dimensional_price_group, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None: @@ -242,7 +242,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None cursor="cursor", limit=1, ) - assert_matches_type(AsyncPage[DimensionalPriceGroup], dimensional_price_group, path=["response"]) + assert_matches_type(AsyncPage[DimensionalPriceGroupModel], dimensional_price_group, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncOrb) -> None: @@ -251,7 +251,7 @@ async def test_raw_response_list(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" dimensional_price_group = response.parse() - assert_matches_type(AsyncPage[DimensionalPriceGroup], dimensional_price_group, path=["response"]) + assert_matches_type(AsyncPage[DimensionalPriceGroupModel], dimensional_price_group, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: @@ -260,6 +260,6 @@ async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" dimensional_price_group = await response.parse() - assert_matches_type(AsyncPage[DimensionalPriceGroup], dimensional_price_group, path=["response"]) + assert_matches_type(AsyncPage[DimensionalPriceGroupModel], dimensional_price_group, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_invoice_line_items.py b/tests/api_resources/test_invoice_line_items.py index 55411e85..78f266bc 100644 --- a/tests/api_resources/test_invoice_line_items.py +++ b/tests/api_resources/test_invoice_line_items.py @@ -8,9 +8,9 @@ import pytest from orb import Orb, AsyncOrb -from orb.types import InvoiceLineItemCreateResponse from orb._utils import parse_date from tests.utils import assert_matches_type +from orb.types.shared import InvoiceLineItemModel base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -28,7 +28,7 @@ def test_method_create(self, client: Orb) -> None: quantity=1, start_date=parse_date("2023-09-22"), ) - assert_matches_type(InvoiceLineItemCreateResponse, invoice_line_item, path=["response"]) + assert_matches_type(InvoiceLineItemModel, invoice_line_item, path=["response"]) @parametrize def test_raw_response_create(self, client: Orb) -> None: @@ -44,7 +44,7 @@ def test_raw_response_create(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice_line_item = response.parse() - assert_matches_type(InvoiceLineItemCreateResponse, invoice_line_item, path=["response"]) + assert_matches_type(InvoiceLineItemModel, invoice_line_item, path=["response"]) @parametrize def test_streaming_response_create(self, client: Orb) -> None: @@ -60,7 +60,7 @@ def test_streaming_response_create(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice_line_item = response.parse() - assert_matches_type(InvoiceLineItemCreateResponse, invoice_line_item, path=["response"]) + assert_matches_type(InvoiceLineItemModel, invoice_line_item, path=["response"]) assert cast(Any, response.is_closed) is True @@ -78,7 +78,7 @@ async def test_method_create(self, async_client: AsyncOrb) -> None: quantity=1, start_date=parse_date("2023-09-22"), ) - assert_matches_type(InvoiceLineItemCreateResponse, invoice_line_item, path=["response"]) + assert_matches_type(InvoiceLineItemModel, invoice_line_item, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncOrb) -> None: @@ -94,7 +94,7 @@ async def test_raw_response_create(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice_line_item = response.parse() - assert_matches_type(InvoiceLineItemCreateResponse, invoice_line_item, path=["response"]) + assert_matches_type(InvoiceLineItemModel, invoice_line_item, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: @@ -110,6 +110,6 @@ async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice_line_item = await response.parse() - assert_matches_type(InvoiceLineItemCreateResponse, invoice_line_item, path=["response"]) + assert_matches_type(InvoiceLineItemModel, invoice_line_item, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_invoices.py b/tests/api_resources/test_invoices.py index 4d379d1f..2d9c3076 100644 --- a/tests/api_resources/test_invoices.py +++ b/tests/api_resources/test_invoices.py @@ -9,12 +9,12 @@ from orb import Orb, AsyncOrb from orb.types import ( - Invoice, InvoiceFetchUpcomingResponse, ) from orb._utils import parse_date, parse_datetime from tests.utils import assert_matches_type from orb.pagination import SyncPage, AsyncPage +from orb.types.shared import InvoiceModel base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -40,7 +40,7 @@ def test_method_create(self, client: Orb) -> None: ], net_terms=0, ) - assert_matches_type(Invoice, invoice, path=["response"]) + assert_matches_type(InvoiceModel, invoice, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Orb) -> None: @@ -71,7 +71,7 @@ def test_method_create_with_all_params(self, client: Orb) -> None: metadata={"foo": "string"}, will_auto_issue=False, ) - assert_matches_type(Invoice, invoice, path=["response"]) + assert_matches_type(InvoiceModel, invoice, path=["response"]) @parametrize def test_raw_response_create(self, client: Orb) -> None: @@ -95,7 +95,7 @@ def test_raw_response_create(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = response.parse() - assert_matches_type(Invoice, invoice, path=["response"]) + assert_matches_type(InvoiceModel, invoice, path=["response"]) @parametrize def test_streaming_response_create(self, client: Orb) -> None: @@ -119,7 +119,7 @@ def test_streaming_response_create(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = response.parse() - assert_matches_type(Invoice, invoice, path=["response"]) + assert_matches_type(InvoiceModel, invoice, path=["response"]) assert cast(Any, response.is_closed) is True @@ -128,7 +128,7 @@ def test_method_update(self, client: Orb) -> None: invoice = client.invoices.update( invoice_id="invoice_id", ) - assert_matches_type(Invoice, invoice, path=["response"]) + assert_matches_type(InvoiceModel, invoice, path=["response"]) @parametrize def test_method_update_with_all_params(self, client: Orb) -> None: @@ -136,7 +136,7 @@ def test_method_update_with_all_params(self, client: Orb) -> None: invoice_id="invoice_id", metadata={"foo": "string"}, ) - assert_matches_type(Invoice, invoice, path=["response"]) + assert_matches_type(InvoiceModel, invoice, path=["response"]) @parametrize def test_raw_response_update(self, client: Orb) -> None: @@ -147,7 +147,7 @@ def test_raw_response_update(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = response.parse() - assert_matches_type(Invoice, invoice, path=["response"]) + assert_matches_type(InvoiceModel, invoice, path=["response"]) @parametrize def test_streaming_response_update(self, client: Orb) -> None: @@ -158,7 +158,7 @@ def test_streaming_response_update(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = response.parse() - assert_matches_type(Invoice, invoice, path=["response"]) + assert_matches_type(InvoiceModel, invoice, path=["response"]) assert cast(Any, response.is_closed) is True @@ -172,7 +172,7 @@ def test_path_params_update(self, client: Orb) -> None: @parametrize def test_method_list(self, client: Orb) -> None: invoice = client.invoices.list() - assert_matches_type(SyncPage[Invoice], invoice, path=["response"]) + assert_matches_type(SyncPage[InvoiceModel], invoice, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Orb) -> None: @@ -197,7 +197,7 @@ def test_method_list_with_all_params(self, client: Orb) -> None: status=["draft"], subscription_id="subscription_id", ) - assert_matches_type(SyncPage[Invoice], invoice, path=["response"]) + assert_matches_type(SyncPage[InvoiceModel], invoice, path=["response"]) @parametrize def test_raw_response_list(self, client: Orb) -> None: @@ -206,7 +206,7 @@ def test_raw_response_list(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = response.parse() - assert_matches_type(SyncPage[Invoice], invoice, path=["response"]) + assert_matches_type(SyncPage[InvoiceModel], invoice, path=["response"]) @parametrize def test_streaming_response_list(self, client: Orb) -> None: @@ -215,7 +215,7 @@ def test_streaming_response_list(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = response.parse() - assert_matches_type(SyncPage[Invoice], invoice, path=["response"]) + assert_matches_type(SyncPage[InvoiceModel], invoice, path=["response"]) assert cast(Any, response.is_closed) is True @@ -224,7 +224,7 @@ def test_method_fetch(self, client: Orb) -> None: invoice = client.invoices.fetch( "invoice_id", ) - assert_matches_type(Invoice, invoice, path=["response"]) + assert_matches_type(InvoiceModel, invoice, path=["response"]) @parametrize def test_raw_response_fetch(self, client: Orb) -> None: @@ -235,7 +235,7 @@ def test_raw_response_fetch(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = response.parse() - assert_matches_type(Invoice, invoice, path=["response"]) + assert_matches_type(InvoiceModel, invoice, path=["response"]) @parametrize def test_streaming_response_fetch(self, client: Orb) -> None: @@ -246,7 +246,7 @@ def test_streaming_response_fetch(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = response.parse() - assert_matches_type(Invoice, invoice, path=["response"]) + assert_matches_type(InvoiceModel, invoice, path=["response"]) assert cast(Any, response.is_closed) is True @@ -293,7 +293,7 @@ def test_method_issue(self, client: Orb) -> None: invoice = client.invoices.issue( invoice_id="invoice_id", ) - assert_matches_type(Invoice, invoice, path=["response"]) + assert_matches_type(InvoiceModel, invoice, path=["response"]) @parametrize def test_method_issue_with_all_params(self, client: Orb) -> None: @@ -301,7 +301,7 @@ def test_method_issue_with_all_params(self, client: Orb) -> None: invoice_id="invoice_id", synchronous=True, ) - assert_matches_type(Invoice, invoice, path=["response"]) + assert_matches_type(InvoiceModel, invoice, path=["response"]) @parametrize def test_raw_response_issue(self, client: Orb) -> None: @@ -312,7 +312,7 @@ def test_raw_response_issue(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = response.parse() - assert_matches_type(Invoice, invoice, path=["response"]) + assert_matches_type(InvoiceModel, invoice, path=["response"]) @parametrize def test_streaming_response_issue(self, client: Orb) -> None: @@ -323,7 +323,7 @@ def test_streaming_response_issue(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = response.parse() - assert_matches_type(Invoice, invoice, path=["response"]) + assert_matches_type(InvoiceModel, invoice, path=["response"]) assert cast(Any, response.is_closed) is True @@ -340,7 +340,7 @@ def test_method_mark_paid(self, client: Orb) -> None: invoice_id="invoice_id", payment_received_date=parse_date("2023-09-22"), ) - assert_matches_type(Invoice, invoice, path=["response"]) + assert_matches_type(InvoiceModel, invoice, path=["response"]) @parametrize def test_method_mark_paid_with_all_params(self, client: Orb) -> None: @@ -350,7 +350,7 @@ def test_method_mark_paid_with_all_params(self, client: Orb) -> None: external_id="external_payment_id_123", notes="notes", ) - assert_matches_type(Invoice, invoice, path=["response"]) + assert_matches_type(InvoiceModel, invoice, path=["response"]) @parametrize def test_raw_response_mark_paid(self, client: Orb) -> None: @@ -362,7 +362,7 @@ def test_raw_response_mark_paid(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = response.parse() - assert_matches_type(Invoice, invoice, path=["response"]) + assert_matches_type(InvoiceModel, invoice, path=["response"]) @parametrize def test_streaming_response_mark_paid(self, client: Orb) -> None: @@ -374,7 +374,7 @@ def test_streaming_response_mark_paid(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = response.parse() - assert_matches_type(Invoice, invoice, path=["response"]) + assert_matches_type(InvoiceModel, invoice, path=["response"]) assert cast(Any, response.is_closed) is True @@ -391,7 +391,7 @@ def test_method_pay(self, client: Orb) -> None: invoice = client.invoices.pay( "invoice_id", ) - assert_matches_type(Invoice, invoice, path=["response"]) + assert_matches_type(InvoiceModel, invoice, path=["response"]) @parametrize def test_raw_response_pay(self, client: Orb) -> None: @@ -402,7 +402,7 @@ def test_raw_response_pay(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = response.parse() - assert_matches_type(Invoice, invoice, path=["response"]) + assert_matches_type(InvoiceModel, invoice, path=["response"]) @parametrize def test_streaming_response_pay(self, client: Orb) -> None: @@ -413,7 +413,7 @@ def test_streaming_response_pay(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = response.parse() - assert_matches_type(Invoice, invoice, path=["response"]) + assert_matches_type(InvoiceModel, invoice, path=["response"]) assert cast(Any, response.is_closed) is True @@ -429,7 +429,7 @@ def test_method_void(self, client: Orb) -> None: invoice = client.invoices.void( "invoice_id", ) - assert_matches_type(Invoice, invoice, path=["response"]) + assert_matches_type(InvoiceModel, invoice, path=["response"]) @parametrize def test_raw_response_void(self, client: Orb) -> None: @@ -440,7 +440,7 @@ def test_raw_response_void(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = response.parse() - assert_matches_type(Invoice, invoice, path=["response"]) + assert_matches_type(InvoiceModel, invoice, path=["response"]) @parametrize def test_streaming_response_void(self, client: Orb) -> None: @@ -451,7 +451,7 @@ def test_streaming_response_void(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = response.parse() - assert_matches_type(Invoice, invoice, path=["response"]) + assert_matches_type(InvoiceModel, invoice, path=["response"]) assert cast(Any, response.is_closed) is True @@ -484,7 +484,7 @@ async def test_method_create(self, async_client: AsyncOrb) -> None: ], net_terms=0, ) - assert_matches_type(Invoice, invoice, path=["response"]) + assert_matches_type(InvoiceModel, invoice, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> None: @@ -515,7 +515,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No metadata={"foo": "string"}, will_auto_issue=False, ) - assert_matches_type(Invoice, invoice, path=["response"]) + assert_matches_type(InvoiceModel, invoice, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncOrb) -> None: @@ -539,7 +539,7 @@ async def test_raw_response_create(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = response.parse() - assert_matches_type(Invoice, invoice, path=["response"]) + assert_matches_type(InvoiceModel, invoice, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: @@ -563,7 +563,7 @@ async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = await response.parse() - assert_matches_type(Invoice, invoice, path=["response"]) + assert_matches_type(InvoiceModel, invoice, path=["response"]) assert cast(Any, response.is_closed) is True @@ -572,7 +572,7 @@ async def test_method_update(self, async_client: AsyncOrb) -> None: invoice = await async_client.invoices.update( invoice_id="invoice_id", ) - assert_matches_type(Invoice, invoice, path=["response"]) + assert_matches_type(InvoiceModel, invoice, path=["response"]) @parametrize async def test_method_update_with_all_params(self, async_client: AsyncOrb) -> None: @@ -580,7 +580,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncOrb) -> No invoice_id="invoice_id", metadata={"foo": "string"}, ) - assert_matches_type(Invoice, invoice, path=["response"]) + assert_matches_type(InvoiceModel, invoice, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncOrb) -> None: @@ -591,7 +591,7 @@ async def test_raw_response_update(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = response.parse() - assert_matches_type(Invoice, invoice, path=["response"]) + assert_matches_type(InvoiceModel, invoice, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncOrb) -> None: @@ -602,7 +602,7 @@ async def test_streaming_response_update(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = await response.parse() - assert_matches_type(Invoice, invoice, path=["response"]) + assert_matches_type(InvoiceModel, invoice, path=["response"]) assert cast(Any, response.is_closed) is True @@ -616,7 +616,7 @@ async def test_path_params_update(self, async_client: AsyncOrb) -> None: @parametrize async def test_method_list(self, async_client: AsyncOrb) -> None: invoice = await async_client.invoices.list() - assert_matches_type(AsyncPage[Invoice], invoice, path=["response"]) + assert_matches_type(AsyncPage[InvoiceModel], invoice, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None: @@ -641,7 +641,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None status=["draft"], subscription_id="subscription_id", ) - assert_matches_type(AsyncPage[Invoice], invoice, path=["response"]) + assert_matches_type(AsyncPage[InvoiceModel], invoice, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncOrb) -> None: @@ -650,7 +650,7 @@ async def test_raw_response_list(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = response.parse() - assert_matches_type(AsyncPage[Invoice], invoice, path=["response"]) + assert_matches_type(AsyncPage[InvoiceModel], invoice, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: @@ -659,7 +659,7 @@ async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = await response.parse() - assert_matches_type(AsyncPage[Invoice], invoice, path=["response"]) + assert_matches_type(AsyncPage[InvoiceModel], invoice, path=["response"]) assert cast(Any, response.is_closed) is True @@ -668,7 +668,7 @@ async def test_method_fetch(self, async_client: AsyncOrb) -> None: invoice = await async_client.invoices.fetch( "invoice_id", ) - assert_matches_type(Invoice, invoice, path=["response"]) + assert_matches_type(InvoiceModel, invoice, path=["response"]) @parametrize async def test_raw_response_fetch(self, async_client: AsyncOrb) -> None: @@ -679,7 +679,7 @@ async def test_raw_response_fetch(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = response.parse() - assert_matches_type(Invoice, invoice, path=["response"]) + assert_matches_type(InvoiceModel, invoice, path=["response"]) @parametrize async def test_streaming_response_fetch(self, async_client: AsyncOrb) -> None: @@ -690,7 +690,7 @@ async def test_streaming_response_fetch(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = await response.parse() - assert_matches_type(Invoice, invoice, path=["response"]) + assert_matches_type(InvoiceModel, invoice, path=["response"]) assert cast(Any, response.is_closed) is True @@ -737,7 +737,7 @@ async def test_method_issue(self, async_client: AsyncOrb) -> None: invoice = await async_client.invoices.issue( invoice_id="invoice_id", ) - assert_matches_type(Invoice, invoice, path=["response"]) + assert_matches_type(InvoiceModel, invoice, path=["response"]) @parametrize async def test_method_issue_with_all_params(self, async_client: AsyncOrb) -> None: @@ -745,7 +745,7 @@ async def test_method_issue_with_all_params(self, async_client: AsyncOrb) -> Non invoice_id="invoice_id", synchronous=True, ) - assert_matches_type(Invoice, invoice, path=["response"]) + assert_matches_type(InvoiceModel, invoice, path=["response"]) @parametrize async def test_raw_response_issue(self, async_client: AsyncOrb) -> None: @@ -756,7 +756,7 @@ async def test_raw_response_issue(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = response.parse() - assert_matches_type(Invoice, invoice, path=["response"]) + assert_matches_type(InvoiceModel, invoice, path=["response"]) @parametrize async def test_streaming_response_issue(self, async_client: AsyncOrb) -> None: @@ -767,7 +767,7 @@ async def test_streaming_response_issue(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = await response.parse() - assert_matches_type(Invoice, invoice, path=["response"]) + assert_matches_type(InvoiceModel, invoice, path=["response"]) assert cast(Any, response.is_closed) is True @@ -784,7 +784,7 @@ async def test_method_mark_paid(self, async_client: AsyncOrb) -> None: invoice_id="invoice_id", payment_received_date=parse_date("2023-09-22"), ) - assert_matches_type(Invoice, invoice, path=["response"]) + assert_matches_type(InvoiceModel, invoice, path=["response"]) @parametrize async def test_method_mark_paid_with_all_params(self, async_client: AsyncOrb) -> None: @@ -794,7 +794,7 @@ async def test_method_mark_paid_with_all_params(self, async_client: AsyncOrb) -> external_id="external_payment_id_123", notes="notes", ) - assert_matches_type(Invoice, invoice, path=["response"]) + assert_matches_type(InvoiceModel, invoice, path=["response"]) @parametrize async def test_raw_response_mark_paid(self, async_client: AsyncOrb) -> None: @@ -806,7 +806,7 @@ async def test_raw_response_mark_paid(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = response.parse() - assert_matches_type(Invoice, invoice, path=["response"]) + assert_matches_type(InvoiceModel, invoice, path=["response"]) @parametrize async def test_streaming_response_mark_paid(self, async_client: AsyncOrb) -> None: @@ -818,7 +818,7 @@ async def test_streaming_response_mark_paid(self, async_client: AsyncOrb) -> Non assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = await response.parse() - assert_matches_type(Invoice, invoice, path=["response"]) + assert_matches_type(InvoiceModel, invoice, path=["response"]) assert cast(Any, response.is_closed) is True @@ -835,7 +835,7 @@ async def test_method_pay(self, async_client: AsyncOrb) -> None: invoice = await async_client.invoices.pay( "invoice_id", ) - assert_matches_type(Invoice, invoice, path=["response"]) + assert_matches_type(InvoiceModel, invoice, path=["response"]) @parametrize async def test_raw_response_pay(self, async_client: AsyncOrb) -> None: @@ -846,7 +846,7 @@ async def test_raw_response_pay(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = response.parse() - assert_matches_type(Invoice, invoice, path=["response"]) + assert_matches_type(InvoiceModel, invoice, path=["response"]) @parametrize async def test_streaming_response_pay(self, async_client: AsyncOrb) -> None: @@ -857,7 +857,7 @@ async def test_streaming_response_pay(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = await response.parse() - assert_matches_type(Invoice, invoice, path=["response"]) + assert_matches_type(InvoiceModel, invoice, path=["response"]) assert cast(Any, response.is_closed) is True @@ -873,7 +873,7 @@ async def test_method_void(self, async_client: AsyncOrb) -> None: invoice = await async_client.invoices.void( "invoice_id", ) - assert_matches_type(Invoice, invoice, path=["response"]) + assert_matches_type(InvoiceModel, invoice, path=["response"]) @parametrize async def test_raw_response_void(self, async_client: AsyncOrb) -> None: @@ -884,7 +884,7 @@ async def test_raw_response_void(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = response.parse() - assert_matches_type(Invoice, invoice, path=["response"]) + assert_matches_type(InvoiceModel, invoice, path=["response"]) @parametrize async def test_streaming_response_void(self, async_client: AsyncOrb) -> None: @@ -895,7 +895,7 @@ async def test_streaming_response_void(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" invoice = await response.parse() - assert_matches_type(Invoice, invoice, path=["response"]) + assert_matches_type(InvoiceModel, invoice, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_items.py b/tests/api_resources/test_items.py index c65f50ad..688a0630 100644 --- a/tests/api_resources/test_items.py +++ b/tests/api_resources/test_items.py @@ -8,9 +8,9 @@ import pytest from orb import Orb, AsyncOrb -from orb.types import Item from tests.utils import assert_matches_type from orb.pagination import SyncPage, AsyncPage +from orb.types.shared import ItemModel base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -23,7 +23,7 @@ def test_method_create(self, client: Orb) -> None: item = client.items.create( name="API requests", ) - assert_matches_type(Item, item, path=["response"]) + assert_matches_type(ItemModel, item, path=["response"]) @parametrize def test_raw_response_create(self, client: Orb) -> None: @@ -34,7 +34,7 @@ def test_raw_response_create(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" item = response.parse() - assert_matches_type(Item, item, path=["response"]) + assert_matches_type(ItemModel, item, path=["response"]) @parametrize def test_streaming_response_create(self, client: Orb) -> None: @@ -45,7 +45,7 @@ def test_streaming_response_create(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" item = response.parse() - assert_matches_type(Item, item, path=["response"]) + assert_matches_type(ItemModel, item, path=["response"]) assert cast(Any, response.is_closed) is True @@ -54,7 +54,7 @@ def test_method_update(self, client: Orb) -> None: item = client.items.update( item_id="item_id", ) - assert_matches_type(Item, item, path=["response"]) + assert_matches_type(ItemModel, item, path=["response"]) @parametrize def test_method_update_with_all_params(self, client: Orb) -> None: @@ -68,7 +68,7 @@ def test_method_update_with_all_params(self, client: Orb) -> None: ], name="name", ) - assert_matches_type(Item, item, path=["response"]) + assert_matches_type(ItemModel, item, path=["response"]) @parametrize def test_raw_response_update(self, client: Orb) -> None: @@ -79,7 +79,7 @@ def test_raw_response_update(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" item = response.parse() - assert_matches_type(Item, item, path=["response"]) + assert_matches_type(ItemModel, item, path=["response"]) @parametrize def test_streaming_response_update(self, client: Orb) -> None: @@ -90,7 +90,7 @@ def test_streaming_response_update(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" item = response.parse() - assert_matches_type(Item, item, path=["response"]) + assert_matches_type(ItemModel, item, path=["response"]) assert cast(Any, response.is_closed) is True @@ -104,7 +104,7 @@ def test_path_params_update(self, client: Orb) -> None: @parametrize def test_method_list(self, client: Orb) -> None: item = client.items.list() - assert_matches_type(SyncPage[Item], item, path=["response"]) + assert_matches_type(SyncPage[ItemModel], item, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Orb) -> None: @@ -112,7 +112,7 @@ def test_method_list_with_all_params(self, client: Orb) -> None: cursor="cursor", limit=1, ) - assert_matches_type(SyncPage[Item], item, path=["response"]) + assert_matches_type(SyncPage[ItemModel], item, path=["response"]) @parametrize def test_raw_response_list(self, client: Orb) -> None: @@ -121,7 +121,7 @@ def test_raw_response_list(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" item = response.parse() - assert_matches_type(SyncPage[Item], item, path=["response"]) + assert_matches_type(SyncPage[ItemModel], item, path=["response"]) @parametrize def test_streaming_response_list(self, client: Orb) -> None: @@ -130,7 +130,7 @@ def test_streaming_response_list(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" item = response.parse() - assert_matches_type(SyncPage[Item], item, path=["response"]) + assert_matches_type(SyncPage[ItemModel], item, path=["response"]) assert cast(Any, response.is_closed) is True @@ -139,7 +139,7 @@ def test_method_fetch(self, client: Orb) -> None: item = client.items.fetch( "item_id", ) - assert_matches_type(Item, item, path=["response"]) + assert_matches_type(ItemModel, item, path=["response"]) @parametrize def test_raw_response_fetch(self, client: Orb) -> None: @@ -150,7 +150,7 @@ def test_raw_response_fetch(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" item = response.parse() - assert_matches_type(Item, item, path=["response"]) + assert_matches_type(ItemModel, item, path=["response"]) @parametrize def test_streaming_response_fetch(self, client: Orb) -> None: @@ -161,7 +161,7 @@ def test_streaming_response_fetch(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" item = response.parse() - assert_matches_type(Item, item, path=["response"]) + assert_matches_type(ItemModel, item, path=["response"]) assert cast(Any, response.is_closed) is True @@ -181,7 +181,7 @@ async def test_method_create(self, async_client: AsyncOrb) -> None: item = await async_client.items.create( name="API requests", ) - assert_matches_type(Item, item, path=["response"]) + assert_matches_type(ItemModel, item, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncOrb) -> None: @@ -192,7 +192,7 @@ async def test_raw_response_create(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" item = response.parse() - assert_matches_type(Item, item, path=["response"]) + assert_matches_type(ItemModel, item, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: @@ -203,7 +203,7 @@ async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" item = await response.parse() - assert_matches_type(Item, item, path=["response"]) + assert_matches_type(ItemModel, item, path=["response"]) assert cast(Any, response.is_closed) is True @@ -212,7 +212,7 @@ async def test_method_update(self, async_client: AsyncOrb) -> None: item = await async_client.items.update( item_id="item_id", ) - assert_matches_type(Item, item, path=["response"]) + assert_matches_type(ItemModel, item, path=["response"]) @parametrize async def test_method_update_with_all_params(self, async_client: AsyncOrb) -> None: @@ -226,7 +226,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncOrb) -> No ], name="name", ) - assert_matches_type(Item, item, path=["response"]) + assert_matches_type(ItemModel, item, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncOrb) -> None: @@ -237,7 +237,7 @@ async def test_raw_response_update(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" item = response.parse() - assert_matches_type(Item, item, path=["response"]) + assert_matches_type(ItemModel, item, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncOrb) -> None: @@ -248,7 +248,7 @@ async def test_streaming_response_update(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" item = await response.parse() - assert_matches_type(Item, item, path=["response"]) + assert_matches_type(ItemModel, item, path=["response"]) assert cast(Any, response.is_closed) is True @@ -262,7 +262,7 @@ async def test_path_params_update(self, async_client: AsyncOrb) -> None: @parametrize async def test_method_list(self, async_client: AsyncOrb) -> None: item = await async_client.items.list() - assert_matches_type(AsyncPage[Item], item, path=["response"]) + assert_matches_type(AsyncPage[ItemModel], item, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None: @@ -270,7 +270,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None cursor="cursor", limit=1, ) - assert_matches_type(AsyncPage[Item], item, path=["response"]) + assert_matches_type(AsyncPage[ItemModel], item, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncOrb) -> None: @@ -279,7 +279,7 @@ async def test_raw_response_list(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" item = response.parse() - assert_matches_type(AsyncPage[Item], item, path=["response"]) + assert_matches_type(AsyncPage[ItemModel], item, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: @@ -288,7 +288,7 @@ async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" item = await response.parse() - assert_matches_type(AsyncPage[Item], item, path=["response"]) + assert_matches_type(AsyncPage[ItemModel], item, path=["response"]) assert cast(Any, response.is_closed) is True @@ -297,7 +297,7 @@ async def test_method_fetch(self, async_client: AsyncOrb) -> None: item = await async_client.items.fetch( "item_id", ) - assert_matches_type(Item, item, path=["response"]) + assert_matches_type(ItemModel, item, path=["response"]) @parametrize async def test_raw_response_fetch(self, async_client: AsyncOrb) -> None: @@ -308,7 +308,7 @@ async def test_raw_response_fetch(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" item = response.parse() - assert_matches_type(Item, item, path=["response"]) + assert_matches_type(ItemModel, item, path=["response"]) @parametrize async def test_streaming_response_fetch(self, async_client: AsyncOrb) -> None: @@ -319,7 +319,7 @@ async def test_streaming_response_fetch(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" item = await response.parse() - assert_matches_type(Item, item, path=["response"]) + assert_matches_type(ItemModel, item, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_metrics.py b/tests/api_resources/test_metrics.py index f111499e..c723d1e0 100644 --- a/tests/api_resources/test_metrics.py +++ b/tests/api_resources/test_metrics.py @@ -8,10 +8,10 @@ import pytest from orb import Orb, AsyncOrb -from orb.types import BillableMetric from orb._utils import parse_datetime from tests.utils import assert_matches_type from orb.pagination import SyncPage, AsyncPage +from orb.types.shared import BillableMetricModel base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -27,7 +27,7 @@ def test_method_create(self, client: Orb) -> None: name="Bytes downloaded", sql="SELECT sum(bytes_downloaded) FROM events WHERE download_speed = 'fast'", ) - assert_matches_type(BillableMetric, metric, path=["response"]) + assert_matches_type(BillableMetricModel, metric, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Orb) -> None: @@ -38,7 +38,7 @@ def test_method_create_with_all_params(self, client: Orb) -> None: sql="SELECT sum(bytes_downloaded) FROM events WHERE download_speed = 'fast'", metadata={"foo": "string"}, ) - assert_matches_type(BillableMetric, metric, path=["response"]) + assert_matches_type(BillableMetricModel, metric, path=["response"]) @parametrize def test_raw_response_create(self, client: Orb) -> None: @@ -52,7 +52,7 @@ def test_raw_response_create(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" metric = response.parse() - assert_matches_type(BillableMetric, metric, path=["response"]) + assert_matches_type(BillableMetricModel, metric, path=["response"]) @parametrize def test_streaming_response_create(self, client: Orb) -> None: @@ -66,7 +66,7 @@ def test_streaming_response_create(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" metric = response.parse() - assert_matches_type(BillableMetric, metric, path=["response"]) + assert_matches_type(BillableMetricModel, metric, path=["response"]) assert cast(Any, response.is_closed) is True @@ -75,7 +75,7 @@ def test_method_update(self, client: Orb) -> None: metric = client.metrics.update( metric_id="metric_id", ) - assert_matches_type(BillableMetric, metric, path=["response"]) + assert_matches_type(BillableMetricModel, metric, path=["response"]) @parametrize def test_method_update_with_all_params(self, client: Orb) -> None: @@ -83,7 +83,7 @@ def test_method_update_with_all_params(self, client: Orb) -> None: metric_id="metric_id", metadata={"foo": "string"}, ) - assert_matches_type(BillableMetric, metric, path=["response"]) + assert_matches_type(BillableMetricModel, metric, path=["response"]) @parametrize def test_raw_response_update(self, client: Orb) -> None: @@ -94,7 +94,7 @@ def test_raw_response_update(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" metric = response.parse() - assert_matches_type(BillableMetric, metric, path=["response"]) + assert_matches_type(BillableMetricModel, metric, path=["response"]) @parametrize def test_streaming_response_update(self, client: Orb) -> None: @@ -105,7 +105,7 @@ def test_streaming_response_update(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" metric = response.parse() - assert_matches_type(BillableMetric, metric, path=["response"]) + assert_matches_type(BillableMetricModel, metric, path=["response"]) assert cast(Any, response.is_closed) is True @@ -119,7 +119,7 @@ def test_path_params_update(self, client: Orb) -> None: @parametrize def test_method_list(self, client: Orb) -> None: metric = client.metrics.list() - assert_matches_type(SyncPage[BillableMetric], metric, path=["response"]) + assert_matches_type(SyncPage[BillableMetricModel], metric, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Orb) -> None: @@ -131,7 +131,7 @@ def test_method_list_with_all_params(self, client: Orb) -> None: cursor="cursor", limit=1, ) - assert_matches_type(SyncPage[BillableMetric], metric, path=["response"]) + assert_matches_type(SyncPage[BillableMetricModel], metric, path=["response"]) @parametrize def test_raw_response_list(self, client: Orb) -> None: @@ -140,7 +140,7 @@ def test_raw_response_list(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" metric = response.parse() - assert_matches_type(SyncPage[BillableMetric], metric, path=["response"]) + assert_matches_type(SyncPage[BillableMetricModel], metric, path=["response"]) @parametrize def test_streaming_response_list(self, client: Orb) -> None: @@ -149,7 +149,7 @@ def test_streaming_response_list(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" metric = response.parse() - assert_matches_type(SyncPage[BillableMetric], metric, path=["response"]) + assert_matches_type(SyncPage[BillableMetricModel], metric, path=["response"]) assert cast(Any, response.is_closed) is True @@ -158,7 +158,7 @@ def test_method_fetch(self, client: Orb) -> None: metric = client.metrics.fetch( "metric_id", ) - assert_matches_type(BillableMetric, metric, path=["response"]) + assert_matches_type(BillableMetricModel, metric, path=["response"]) @parametrize def test_raw_response_fetch(self, client: Orb) -> None: @@ -169,7 +169,7 @@ def test_raw_response_fetch(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" metric = response.parse() - assert_matches_type(BillableMetric, metric, path=["response"]) + assert_matches_type(BillableMetricModel, metric, path=["response"]) @parametrize def test_streaming_response_fetch(self, client: Orb) -> None: @@ -180,7 +180,7 @@ def test_streaming_response_fetch(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" metric = response.parse() - assert_matches_type(BillableMetric, metric, path=["response"]) + assert_matches_type(BillableMetricModel, metric, path=["response"]) assert cast(Any, response.is_closed) is True @@ -203,7 +203,7 @@ async def test_method_create(self, async_client: AsyncOrb) -> None: name="Bytes downloaded", sql="SELECT sum(bytes_downloaded) FROM events WHERE download_speed = 'fast'", ) - assert_matches_type(BillableMetric, metric, path=["response"]) + assert_matches_type(BillableMetricModel, metric, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> None: @@ -214,7 +214,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No sql="SELECT sum(bytes_downloaded) FROM events WHERE download_speed = 'fast'", metadata={"foo": "string"}, ) - assert_matches_type(BillableMetric, metric, path=["response"]) + assert_matches_type(BillableMetricModel, metric, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncOrb) -> None: @@ -228,7 +228,7 @@ async def test_raw_response_create(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" metric = response.parse() - assert_matches_type(BillableMetric, metric, path=["response"]) + assert_matches_type(BillableMetricModel, metric, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: @@ -242,7 +242,7 @@ async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" metric = await response.parse() - assert_matches_type(BillableMetric, metric, path=["response"]) + assert_matches_type(BillableMetricModel, metric, path=["response"]) assert cast(Any, response.is_closed) is True @@ -251,7 +251,7 @@ async def test_method_update(self, async_client: AsyncOrb) -> None: metric = await async_client.metrics.update( metric_id="metric_id", ) - assert_matches_type(BillableMetric, metric, path=["response"]) + assert_matches_type(BillableMetricModel, metric, path=["response"]) @parametrize async def test_method_update_with_all_params(self, async_client: AsyncOrb) -> None: @@ -259,7 +259,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncOrb) -> No metric_id="metric_id", metadata={"foo": "string"}, ) - assert_matches_type(BillableMetric, metric, path=["response"]) + assert_matches_type(BillableMetricModel, metric, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncOrb) -> None: @@ -270,7 +270,7 @@ async def test_raw_response_update(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" metric = response.parse() - assert_matches_type(BillableMetric, metric, path=["response"]) + assert_matches_type(BillableMetricModel, metric, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncOrb) -> None: @@ -281,7 +281,7 @@ async def test_streaming_response_update(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" metric = await response.parse() - assert_matches_type(BillableMetric, metric, path=["response"]) + assert_matches_type(BillableMetricModel, metric, path=["response"]) assert cast(Any, response.is_closed) is True @@ -295,7 +295,7 @@ async def test_path_params_update(self, async_client: AsyncOrb) -> None: @parametrize async def test_method_list(self, async_client: AsyncOrb) -> None: metric = await async_client.metrics.list() - assert_matches_type(AsyncPage[BillableMetric], metric, path=["response"]) + assert_matches_type(AsyncPage[BillableMetricModel], metric, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None: @@ -307,7 +307,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None cursor="cursor", limit=1, ) - assert_matches_type(AsyncPage[BillableMetric], metric, path=["response"]) + assert_matches_type(AsyncPage[BillableMetricModel], metric, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncOrb) -> None: @@ -316,7 +316,7 @@ async def test_raw_response_list(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" metric = response.parse() - assert_matches_type(AsyncPage[BillableMetric], metric, path=["response"]) + assert_matches_type(AsyncPage[BillableMetricModel], metric, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: @@ -325,7 +325,7 @@ async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" metric = await response.parse() - assert_matches_type(AsyncPage[BillableMetric], metric, path=["response"]) + assert_matches_type(AsyncPage[BillableMetricModel], metric, path=["response"]) assert cast(Any, response.is_closed) is True @@ -334,7 +334,7 @@ async def test_method_fetch(self, async_client: AsyncOrb) -> None: metric = await async_client.metrics.fetch( "metric_id", ) - assert_matches_type(BillableMetric, metric, path=["response"]) + assert_matches_type(BillableMetricModel, metric, path=["response"]) @parametrize async def test_raw_response_fetch(self, async_client: AsyncOrb) -> None: @@ -345,7 +345,7 @@ async def test_raw_response_fetch(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" metric = response.parse() - assert_matches_type(BillableMetric, metric, path=["response"]) + assert_matches_type(BillableMetricModel, metric, path=["response"]) @parametrize async def test_streaming_response_fetch(self, async_client: AsyncOrb) -> None: @@ -356,7 +356,7 @@ async def test_streaming_response_fetch(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" metric = await response.parse() - assert_matches_type(BillableMetric, metric, path=["response"]) + assert_matches_type(BillableMetricModel, metric, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_plans.py b/tests/api_resources/test_plans.py index 938816b8..1adee0ff 100644 --- a/tests/api_resources/test_plans.py +++ b/tests/api_resources/test_plans.py @@ -8,10 +8,10 @@ import pytest from orb import Orb, AsyncOrb -from orb.types import Plan from orb._utils import parse_datetime from tests.utils import assert_matches_type from orb.pagination import SyncPage, AsyncPage +from orb.types.shared import PlanModel base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -34,7 +34,7 @@ def test_method_create(self, client: Orb) -> None: } ], ) - assert_matches_type(Plan, plan, path=["response"]) + assert_matches_type(PlanModel, plan, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Orb) -> None: @@ -72,7 +72,7 @@ def test_method_create_with_all_params(self, client: Orb) -> None: net_terms=0, status="active", ) - assert_matches_type(Plan, plan, path=["response"]) + assert_matches_type(PlanModel, plan, path=["response"]) @parametrize def test_raw_response_create(self, client: Orb) -> None: @@ -93,7 +93,7 @@ def test_raw_response_create(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" plan = response.parse() - assert_matches_type(Plan, plan, path=["response"]) + assert_matches_type(PlanModel, plan, path=["response"]) @parametrize def test_streaming_response_create(self, client: Orb) -> None: @@ -114,7 +114,7 @@ def test_streaming_response_create(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" plan = response.parse() - assert_matches_type(Plan, plan, path=["response"]) + assert_matches_type(PlanModel, plan, path=["response"]) assert cast(Any, response.is_closed) is True @@ -123,7 +123,7 @@ def test_method_update(self, client: Orb) -> None: plan = client.plans.update( plan_id="plan_id", ) - assert_matches_type(Plan, plan, path=["response"]) + assert_matches_type(PlanModel, plan, path=["response"]) @parametrize def test_method_update_with_all_params(self, client: Orb) -> None: @@ -132,7 +132,7 @@ def test_method_update_with_all_params(self, client: Orb) -> None: external_plan_id="external_plan_id", metadata={"foo": "string"}, ) - assert_matches_type(Plan, plan, path=["response"]) + assert_matches_type(PlanModel, plan, path=["response"]) @parametrize def test_raw_response_update(self, client: Orb) -> None: @@ -143,7 +143,7 @@ def test_raw_response_update(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" plan = response.parse() - assert_matches_type(Plan, plan, path=["response"]) + assert_matches_type(PlanModel, plan, path=["response"]) @parametrize def test_streaming_response_update(self, client: Orb) -> None: @@ -154,7 +154,7 @@ def test_streaming_response_update(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" plan = response.parse() - assert_matches_type(Plan, plan, path=["response"]) + assert_matches_type(PlanModel, plan, path=["response"]) assert cast(Any, response.is_closed) is True @@ -168,7 +168,7 @@ def test_path_params_update(self, client: Orb) -> None: @parametrize def test_method_list(self, client: Orb) -> None: plan = client.plans.list() - assert_matches_type(SyncPage[Plan], plan, path=["response"]) + assert_matches_type(SyncPage[PlanModel], plan, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Orb) -> None: @@ -181,7 +181,7 @@ def test_method_list_with_all_params(self, client: Orb) -> None: limit=1, status="active", ) - assert_matches_type(SyncPage[Plan], plan, path=["response"]) + assert_matches_type(SyncPage[PlanModel], plan, path=["response"]) @parametrize def test_raw_response_list(self, client: Orb) -> None: @@ -190,7 +190,7 @@ def test_raw_response_list(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" plan = response.parse() - assert_matches_type(SyncPage[Plan], plan, path=["response"]) + assert_matches_type(SyncPage[PlanModel], plan, path=["response"]) @parametrize def test_streaming_response_list(self, client: Orb) -> None: @@ -199,7 +199,7 @@ def test_streaming_response_list(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" plan = response.parse() - assert_matches_type(SyncPage[Plan], plan, path=["response"]) + assert_matches_type(SyncPage[PlanModel], plan, path=["response"]) assert cast(Any, response.is_closed) is True @@ -208,7 +208,7 @@ def test_method_fetch(self, client: Orb) -> None: plan = client.plans.fetch( "plan_id", ) - assert_matches_type(Plan, plan, path=["response"]) + assert_matches_type(PlanModel, plan, path=["response"]) @parametrize def test_raw_response_fetch(self, client: Orb) -> None: @@ -219,7 +219,7 @@ def test_raw_response_fetch(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" plan = response.parse() - assert_matches_type(Plan, plan, path=["response"]) + assert_matches_type(PlanModel, plan, path=["response"]) @parametrize def test_streaming_response_fetch(self, client: Orb) -> None: @@ -230,7 +230,7 @@ def test_streaming_response_fetch(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" plan = response.parse() - assert_matches_type(Plan, plan, path=["response"]) + assert_matches_type(PlanModel, plan, path=["response"]) assert cast(Any, response.is_closed) is True @@ -260,7 +260,7 @@ async def test_method_create(self, async_client: AsyncOrb) -> None: } ], ) - assert_matches_type(Plan, plan, path=["response"]) + assert_matches_type(PlanModel, plan, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> None: @@ -298,7 +298,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No net_terms=0, status="active", ) - assert_matches_type(Plan, plan, path=["response"]) + assert_matches_type(PlanModel, plan, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncOrb) -> None: @@ -319,7 +319,7 @@ async def test_raw_response_create(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" plan = response.parse() - assert_matches_type(Plan, plan, path=["response"]) + assert_matches_type(PlanModel, plan, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: @@ -340,7 +340,7 @@ async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" plan = await response.parse() - assert_matches_type(Plan, plan, path=["response"]) + assert_matches_type(PlanModel, plan, path=["response"]) assert cast(Any, response.is_closed) is True @@ -349,7 +349,7 @@ async def test_method_update(self, async_client: AsyncOrb) -> None: plan = await async_client.plans.update( plan_id="plan_id", ) - assert_matches_type(Plan, plan, path=["response"]) + assert_matches_type(PlanModel, plan, path=["response"]) @parametrize async def test_method_update_with_all_params(self, async_client: AsyncOrb) -> None: @@ -358,7 +358,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncOrb) -> No external_plan_id="external_plan_id", metadata={"foo": "string"}, ) - assert_matches_type(Plan, plan, path=["response"]) + assert_matches_type(PlanModel, plan, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncOrb) -> None: @@ -369,7 +369,7 @@ async def test_raw_response_update(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" plan = response.parse() - assert_matches_type(Plan, plan, path=["response"]) + assert_matches_type(PlanModel, plan, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncOrb) -> None: @@ -380,7 +380,7 @@ async def test_streaming_response_update(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" plan = await response.parse() - assert_matches_type(Plan, plan, path=["response"]) + assert_matches_type(PlanModel, plan, path=["response"]) assert cast(Any, response.is_closed) is True @@ -394,7 +394,7 @@ async def test_path_params_update(self, async_client: AsyncOrb) -> None: @parametrize async def test_method_list(self, async_client: AsyncOrb) -> None: plan = await async_client.plans.list() - assert_matches_type(AsyncPage[Plan], plan, path=["response"]) + assert_matches_type(AsyncPage[PlanModel], plan, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None: @@ -407,7 +407,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None limit=1, status="active", ) - assert_matches_type(AsyncPage[Plan], plan, path=["response"]) + assert_matches_type(AsyncPage[PlanModel], plan, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncOrb) -> None: @@ -416,7 +416,7 @@ async def test_raw_response_list(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" plan = response.parse() - assert_matches_type(AsyncPage[Plan], plan, path=["response"]) + assert_matches_type(AsyncPage[PlanModel], plan, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: @@ -425,7 +425,7 @@ async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" plan = await response.parse() - assert_matches_type(AsyncPage[Plan], plan, path=["response"]) + assert_matches_type(AsyncPage[PlanModel], plan, path=["response"]) assert cast(Any, response.is_closed) is True @@ -434,7 +434,7 @@ async def test_method_fetch(self, async_client: AsyncOrb) -> None: plan = await async_client.plans.fetch( "plan_id", ) - assert_matches_type(Plan, plan, path=["response"]) + assert_matches_type(PlanModel, plan, path=["response"]) @parametrize async def test_raw_response_fetch(self, async_client: AsyncOrb) -> None: @@ -445,7 +445,7 @@ async def test_raw_response_fetch(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" plan = response.parse() - assert_matches_type(Plan, plan, path=["response"]) + assert_matches_type(PlanModel, plan, path=["response"]) @parametrize async def test_streaming_response_fetch(self, async_client: AsyncOrb) -> None: @@ -456,7 +456,7 @@ async def test_streaming_response_fetch(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" plan = await response.parse() - assert_matches_type(Plan, plan, path=["response"]) + assert_matches_type(PlanModel, plan, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_prices.py b/tests/api_resources/test_prices.py index 41b706cf..675422aa 100644 --- a/tests/api_resources/test_prices.py +++ b/tests/api_resources/test_prices.py @@ -9,12 +9,12 @@ from orb import Orb, AsyncOrb from orb.types import ( - Price, PriceEvaluateResponse, ) from orb._utils import parse_datetime from tests.utils import assert_matches_type from orb.pagination import SyncPage, AsyncPage +from orb.types.shared import PriceModel base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -32,7 +32,7 @@ def test_method_create_overload_1(self, client: Orb) -> None: name="Annual fee", unit_config={"unit_amount": "unit_amount"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_1(self, client: Orb) -> None: @@ -59,7 +59,7 @@ def test_method_create_with_all_params_overload_1(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_raw_response_create_overload_1(self, client: Orb) -> None: @@ -75,7 +75,7 @@ def test_raw_response_create_overload_1(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_streaming_response_create_overload_1(self, client: Orb) -> None: @@ -91,7 +91,7 @@ def test_streaming_response_create_overload_1(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -108,7 +108,7 @@ def test_method_create_overload_2(self, client: Orb) -> None: "package_size": 0, }, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_2(self, client: Orb) -> None: @@ -138,7 +138,7 @@ def test_method_create_with_all_params_overload_2(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_raw_response_create_overload_2(self, client: Orb) -> None: @@ -157,7 +157,7 @@ def test_raw_response_create_overload_2(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_streaming_response_create_overload_2(self, client: Orb) -> None: @@ -176,7 +176,7 @@ def test_streaming_response_create_overload_2(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -199,7 +199,7 @@ def test_method_create_overload_3(self, client: Orb) -> None: model_type="matrix", name="Annual fee", ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_3(self, client: Orb) -> None: @@ -235,7 +235,7 @@ def test_method_create_with_all_params_overload_3(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_raw_response_create_overload_3(self, client: Orb) -> None: @@ -260,7 +260,7 @@ def test_raw_response_create_overload_3(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_streaming_response_create_overload_3(self, client: Orb) -> None: @@ -285,7 +285,7 @@ def test_streaming_response_create_overload_3(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -309,7 +309,7 @@ def test_method_create_overload_4(self, client: Orb) -> None: model_type="matrix_with_allocation", name="Annual fee", ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_4(self, client: Orb) -> None: @@ -346,7 +346,7 @@ def test_method_create_with_all_params_overload_4(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_raw_response_create_overload_4(self, client: Orb) -> None: @@ -372,7 +372,7 @@ def test_raw_response_create_overload_4(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_streaming_response_create_overload_4(self, client: Orb) -> None: @@ -398,7 +398,7 @@ def test_streaming_response_create_overload_4(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -419,7 +419,7 @@ def test_method_create_overload_5(self, client: Orb) -> None: ] }, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_5(self, client: Orb) -> None: @@ -454,7 +454,7 @@ def test_method_create_with_all_params_overload_5(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_raw_response_create_overload_5(self, client: Orb) -> None: @@ -477,7 +477,7 @@ def test_raw_response_create_overload_5(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_streaming_response_create_overload_5(self, client: Orb) -> None: @@ -500,7 +500,7 @@ def test_streaming_response_create_overload_5(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -521,7 +521,7 @@ def test_method_create_overload_6(self, client: Orb) -> None: ] }, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_6(self, client: Orb) -> None: @@ -557,7 +557,7 @@ def test_method_create_with_all_params_overload_6(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_raw_response_create_overload_6(self, client: Orb) -> None: @@ -580,7 +580,7 @@ def test_raw_response_create_overload_6(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_streaming_response_create_overload_6(self, client: Orb) -> None: @@ -603,7 +603,7 @@ def test_streaming_response_create_overload_6(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -617,7 +617,7 @@ def test_method_create_overload_7(self, client: Orb) -> None: model_type="bps", name="Annual fee", ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_7(self, client: Orb) -> None: @@ -647,7 +647,7 @@ def test_method_create_with_all_params_overload_7(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_raw_response_create_overload_7(self, client: Orb) -> None: @@ -663,7 +663,7 @@ def test_raw_response_create_overload_7(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_streaming_response_create_overload_7(self, client: Orb) -> None: @@ -679,7 +679,7 @@ def test_streaming_response_create_overload_7(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -693,7 +693,7 @@ def test_method_create_overload_8(self, client: Orb) -> None: model_type="bulk_bps", name="Annual fee", ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_8(self, client: Orb) -> None: @@ -728,7 +728,7 @@ def test_method_create_with_all_params_overload_8(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_raw_response_create_overload_8(self, client: Orb) -> None: @@ -744,7 +744,7 @@ def test_raw_response_create_overload_8(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_streaming_response_create_overload_8(self, client: Orb) -> None: @@ -760,7 +760,7 @@ def test_streaming_response_create_overload_8(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -774,7 +774,7 @@ def test_method_create_overload_9(self, client: Orb) -> None: model_type="bulk", name="Annual fee", ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_9(self, client: Orb) -> None: @@ -808,7 +808,7 @@ def test_method_create_with_all_params_overload_9(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_raw_response_create_overload_9(self, client: Orb) -> None: @@ -824,7 +824,7 @@ def test_raw_response_create_overload_9(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_streaming_response_create_overload_9(self, client: Orb) -> None: @@ -840,7 +840,7 @@ def test_streaming_response_create_overload_9(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -854,7 +854,7 @@ def test_method_create_overload_10(self, client: Orb) -> None: name="Annual fee", threshold_total_amount_config={"foo": "bar"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_10(self, client: Orb) -> None: @@ -881,7 +881,7 @@ def test_method_create_with_all_params_overload_10(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_raw_response_create_overload_10(self, client: Orb) -> None: @@ -897,7 +897,7 @@ def test_raw_response_create_overload_10(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_streaming_response_create_overload_10(self, client: Orb) -> None: @@ -913,7 +913,7 @@ def test_streaming_response_create_overload_10(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -927,7 +927,7 @@ def test_method_create_overload_11(self, client: Orb) -> None: name="Annual fee", tiered_package_config={"foo": "bar"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_11(self, client: Orb) -> None: @@ -954,7 +954,7 @@ def test_method_create_with_all_params_overload_11(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_raw_response_create_overload_11(self, client: Orb) -> None: @@ -970,7 +970,7 @@ def test_raw_response_create_overload_11(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_streaming_response_create_overload_11(self, client: Orb) -> None: @@ -986,7 +986,7 @@ def test_streaming_response_create_overload_11(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1000,7 +1000,7 @@ def test_method_create_overload_12(self, client: Orb) -> None: model_type="grouped_tiered", name="Annual fee", ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_12(self, client: Orb) -> None: @@ -1027,7 +1027,7 @@ def test_method_create_with_all_params_overload_12(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_raw_response_create_overload_12(self, client: Orb) -> None: @@ -1043,7 +1043,7 @@ def test_raw_response_create_overload_12(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_streaming_response_create_overload_12(self, client: Orb) -> None: @@ -1059,7 +1059,7 @@ def test_streaming_response_create_overload_12(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1073,7 +1073,7 @@ def test_method_create_overload_13(self, client: Orb) -> None: model_type="max_group_tiered_package", name="Annual fee", ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_13(self, client: Orb) -> None: @@ -1100,7 +1100,7 @@ def test_method_create_with_all_params_overload_13(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_raw_response_create_overload_13(self, client: Orb) -> None: @@ -1116,7 +1116,7 @@ def test_raw_response_create_overload_13(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_streaming_response_create_overload_13(self, client: Orb) -> None: @@ -1132,7 +1132,7 @@ def test_streaming_response_create_overload_13(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1146,7 +1146,7 @@ def test_method_create_overload_14(self, client: Orb) -> None: name="Annual fee", tiered_with_minimum_config={"foo": "bar"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_14(self, client: Orb) -> None: @@ -1173,7 +1173,7 @@ def test_method_create_with_all_params_overload_14(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_raw_response_create_overload_14(self, client: Orb) -> None: @@ -1189,7 +1189,7 @@ def test_raw_response_create_overload_14(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_streaming_response_create_overload_14(self, client: Orb) -> None: @@ -1205,7 +1205,7 @@ def test_streaming_response_create_overload_14(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1219,7 +1219,7 @@ def test_method_create_overload_15(self, client: Orb) -> None: name="Annual fee", package_with_allocation_config={"foo": "bar"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_15(self, client: Orb) -> None: @@ -1246,7 +1246,7 @@ def test_method_create_with_all_params_overload_15(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_raw_response_create_overload_15(self, client: Orb) -> None: @@ -1262,7 +1262,7 @@ def test_raw_response_create_overload_15(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_streaming_response_create_overload_15(self, client: Orb) -> None: @@ -1278,7 +1278,7 @@ def test_streaming_response_create_overload_15(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1292,7 +1292,7 @@ def test_method_create_overload_16(self, client: Orb) -> None: name="Annual fee", tiered_package_with_minimum_config={"foo": "bar"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_16(self, client: Orb) -> None: @@ -1319,7 +1319,7 @@ def test_method_create_with_all_params_overload_16(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_raw_response_create_overload_16(self, client: Orb) -> None: @@ -1335,7 +1335,7 @@ def test_raw_response_create_overload_16(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_streaming_response_create_overload_16(self, client: Orb) -> None: @@ -1351,7 +1351,7 @@ def test_streaming_response_create_overload_16(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1365,7 +1365,7 @@ def test_method_create_overload_17(self, client: Orb) -> None: name="Annual fee", unit_with_percent_config={"foo": "bar"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_17(self, client: Orb) -> None: @@ -1392,7 +1392,7 @@ def test_method_create_with_all_params_overload_17(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_raw_response_create_overload_17(self, client: Orb) -> None: @@ -1408,7 +1408,7 @@ def test_raw_response_create_overload_17(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_streaming_response_create_overload_17(self, client: Orb) -> None: @@ -1424,7 +1424,7 @@ def test_streaming_response_create_overload_17(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1438,7 +1438,7 @@ def test_method_create_overload_18(self, client: Orb) -> None: name="Annual fee", tiered_with_proration_config={"foo": "bar"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_18(self, client: Orb) -> None: @@ -1465,7 +1465,7 @@ def test_method_create_with_all_params_overload_18(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_raw_response_create_overload_18(self, client: Orb) -> None: @@ -1481,7 +1481,7 @@ def test_raw_response_create_overload_18(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_streaming_response_create_overload_18(self, client: Orb) -> None: @@ -1497,7 +1497,7 @@ def test_streaming_response_create_overload_18(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1511,7 +1511,7 @@ def test_method_create_overload_19(self, client: Orb) -> None: name="Annual fee", unit_with_proration_config={"foo": "bar"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_19(self, client: Orb) -> None: @@ -1538,7 +1538,7 @@ def test_method_create_with_all_params_overload_19(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_raw_response_create_overload_19(self, client: Orb) -> None: @@ -1554,7 +1554,7 @@ def test_raw_response_create_overload_19(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_streaming_response_create_overload_19(self, client: Orb) -> None: @@ -1570,7 +1570,7 @@ def test_streaming_response_create_overload_19(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1584,7 +1584,7 @@ def test_method_create_overload_20(self, client: Orb) -> None: model_type="grouped_allocation", name="Annual fee", ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_20(self, client: Orb) -> None: @@ -1611,7 +1611,7 @@ def test_method_create_with_all_params_overload_20(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_raw_response_create_overload_20(self, client: Orb) -> None: @@ -1627,7 +1627,7 @@ def test_raw_response_create_overload_20(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_streaming_response_create_overload_20(self, client: Orb) -> None: @@ -1643,7 +1643,7 @@ def test_streaming_response_create_overload_20(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1657,7 +1657,7 @@ def test_method_create_overload_21(self, client: Orb) -> None: model_type="grouped_with_prorated_minimum", name="Annual fee", ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_21(self, client: Orb) -> None: @@ -1684,7 +1684,7 @@ def test_method_create_with_all_params_overload_21(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_raw_response_create_overload_21(self, client: Orb) -> None: @@ -1700,7 +1700,7 @@ def test_raw_response_create_overload_21(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_streaming_response_create_overload_21(self, client: Orb) -> None: @@ -1716,7 +1716,7 @@ def test_streaming_response_create_overload_21(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1730,7 +1730,7 @@ def test_method_create_overload_22(self, client: Orb) -> None: model_type="grouped_with_metered_minimum", name="Annual fee", ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_22(self, client: Orb) -> None: @@ -1757,7 +1757,7 @@ def test_method_create_with_all_params_overload_22(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_raw_response_create_overload_22(self, client: Orb) -> None: @@ -1773,7 +1773,7 @@ def test_raw_response_create_overload_22(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_streaming_response_create_overload_22(self, client: Orb) -> None: @@ -1789,7 +1789,7 @@ def test_streaming_response_create_overload_22(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1803,7 +1803,7 @@ def test_method_create_overload_23(self, client: Orb) -> None: model_type="matrix_with_display_name", name="Annual fee", ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_23(self, client: Orb) -> None: @@ -1830,7 +1830,7 @@ def test_method_create_with_all_params_overload_23(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_raw_response_create_overload_23(self, client: Orb) -> None: @@ -1846,7 +1846,7 @@ def test_raw_response_create_overload_23(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_streaming_response_create_overload_23(self, client: Orb) -> None: @@ -1862,7 +1862,7 @@ def test_streaming_response_create_overload_23(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1876,7 +1876,7 @@ def test_method_create_overload_24(self, client: Orb) -> None: model_type="bulk_with_proration", name="Annual fee", ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_24(self, client: Orb) -> None: @@ -1903,7 +1903,7 @@ def test_method_create_with_all_params_overload_24(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_raw_response_create_overload_24(self, client: Orb) -> None: @@ -1919,7 +1919,7 @@ def test_raw_response_create_overload_24(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_streaming_response_create_overload_24(self, client: Orb) -> None: @@ -1935,7 +1935,7 @@ def test_streaming_response_create_overload_24(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1949,7 +1949,7 @@ def test_method_create_overload_25(self, client: Orb) -> None: model_type="grouped_tiered_package", name="Annual fee", ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_25(self, client: Orb) -> None: @@ -1976,7 +1976,7 @@ def test_method_create_with_all_params_overload_25(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_raw_response_create_overload_25(self, client: Orb) -> None: @@ -1992,7 +1992,7 @@ def test_raw_response_create_overload_25(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_streaming_response_create_overload_25(self, client: Orb) -> None: @@ -2008,7 +2008,7 @@ def test_streaming_response_create_overload_25(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2022,7 +2022,7 @@ def test_method_create_overload_26(self, client: Orb) -> None: name="Annual fee", scalable_matrix_with_unit_pricing_config={"foo": "bar"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_26(self, client: Orb) -> None: @@ -2049,7 +2049,7 @@ def test_method_create_with_all_params_overload_26(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_raw_response_create_overload_26(self, client: Orb) -> None: @@ -2065,7 +2065,7 @@ def test_raw_response_create_overload_26(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_streaming_response_create_overload_26(self, client: Orb) -> None: @@ -2081,7 +2081,7 @@ def test_streaming_response_create_overload_26(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2095,7 +2095,7 @@ def test_method_create_overload_27(self, client: Orb) -> None: name="Annual fee", scalable_matrix_with_tiered_pricing_config={"foo": "bar"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_27(self, client: Orb) -> None: @@ -2122,7 +2122,7 @@ def test_method_create_with_all_params_overload_27(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_raw_response_create_overload_27(self, client: Orb) -> None: @@ -2138,7 +2138,7 @@ def test_raw_response_create_overload_27(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_streaming_response_create_overload_27(self, client: Orb) -> None: @@ -2154,7 +2154,7 @@ def test_streaming_response_create_overload_27(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2168,7 +2168,7 @@ def test_method_create_overload_28(self, client: Orb) -> None: model_type="cumulative_grouped_bulk", name="Annual fee", ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_28(self, client: Orb) -> None: @@ -2195,7 +2195,7 @@ def test_method_create_with_all_params_overload_28(self, client: Orb) -> None: }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_raw_response_create_overload_28(self, client: Orb) -> None: @@ -2211,7 +2211,7 @@ def test_raw_response_create_overload_28(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_streaming_response_create_overload_28(self, client: Orb) -> None: @@ -2227,7 +2227,7 @@ def test_streaming_response_create_overload_28(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2236,7 +2236,7 @@ def test_method_update(self, client: Orb) -> None: price = client.prices.update( price_id="price_id", ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_method_update_with_all_params(self, client: Orb) -> None: @@ -2244,7 +2244,7 @@ def test_method_update_with_all_params(self, client: Orb) -> None: price_id="price_id", metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_raw_response_update(self, client: Orb) -> None: @@ -2255,7 +2255,7 @@ def test_raw_response_update(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_streaming_response_update(self, client: Orb) -> None: @@ -2266,7 +2266,7 @@ def test_streaming_response_update(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2280,7 +2280,7 @@ def test_path_params_update(self, client: Orb) -> None: @parametrize def test_method_list(self, client: Orb) -> None: price = client.prices.list() - assert_matches_type(SyncPage[Price], price, path=["response"]) + assert_matches_type(SyncPage[PriceModel], price, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Orb) -> None: @@ -2288,7 +2288,7 @@ def test_method_list_with_all_params(self, client: Orb) -> None: cursor="cursor", limit=1, ) - assert_matches_type(SyncPage[Price], price, path=["response"]) + assert_matches_type(SyncPage[PriceModel], price, path=["response"]) @parametrize def test_raw_response_list(self, client: Orb) -> None: @@ -2297,7 +2297,7 @@ def test_raw_response_list(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(SyncPage[Price], price, path=["response"]) + assert_matches_type(SyncPage[PriceModel], price, path=["response"]) @parametrize def test_streaming_response_list(self, client: Orb) -> None: @@ -2306,7 +2306,7 @@ def test_streaming_response_list(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(SyncPage[Price], price, path=["response"]) + assert_matches_type(SyncPage[PriceModel], price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2374,7 +2374,7 @@ def test_method_fetch(self, client: Orb) -> None: price = client.prices.fetch( "price_id", ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_raw_response_fetch(self, client: Orb) -> None: @@ -2385,7 +2385,7 @@ def test_raw_response_fetch(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize def test_streaming_response_fetch(self, client: Orb) -> None: @@ -2396,7 +2396,7 @@ def test_streaming_response_fetch(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2421,7 +2421,7 @@ async def test_method_create_overload_1(self, async_client: AsyncOrb) -> None: name="Annual fee", unit_config={"unit_amount": "unit_amount"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_1(self, async_client: AsyncOrb) -> None: @@ -2448,7 +2448,7 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_raw_response_create_overload_1(self, async_client: AsyncOrb) -> None: @@ -2464,7 +2464,7 @@ async def test_raw_response_create_overload_1(self, async_client: AsyncOrb) -> N assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_1(self, async_client: AsyncOrb) -> None: @@ -2480,7 +2480,7 @@ async def test_streaming_response_create_overload_1(self, async_client: AsyncOrb assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2497,7 +2497,7 @@ async def test_method_create_overload_2(self, async_client: AsyncOrb) -> None: "package_size": 0, }, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_2(self, async_client: AsyncOrb) -> None: @@ -2527,7 +2527,7 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_raw_response_create_overload_2(self, async_client: AsyncOrb) -> None: @@ -2546,7 +2546,7 @@ async def test_raw_response_create_overload_2(self, async_client: AsyncOrb) -> N assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_2(self, async_client: AsyncOrb) -> None: @@ -2565,7 +2565,7 @@ async def test_streaming_response_create_overload_2(self, async_client: AsyncOrb assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2588,7 +2588,7 @@ async def test_method_create_overload_3(self, async_client: AsyncOrb) -> None: model_type="matrix", name="Annual fee", ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_3(self, async_client: AsyncOrb) -> None: @@ -2624,7 +2624,7 @@ async def test_method_create_with_all_params_overload_3(self, async_client: Asyn }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_raw_response_create_overload_3(self, async_client: AsyncOrb) -> None: @@ -2649,7 +2649,7 @@ async def test_raw_response_create_overload_3(self, async_client: AsyncOrb) -> N assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_3(self, async_client: AsyncOrb) -> None: @@ -2674,7 +2674,7 @@ async def test_streaming_response_create_overload_3(self, async_client: AsyncOrb assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2698,7 +2698,7 @@ async def test_method_create_overload_4(self, async_client: AsyncOrb) -> None: model_type="matrix_with_allocation", name="Annual fee", ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_4(self, async_client: AsyncOrb) -> None: @@ -2735,7 +2735,7 @@ async def test_method_create_with_all_params_overload_4(self, async_client: Asyn }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_raw_response_create_overload_4(self, async_client: AsyncOrb) -> None: @@ -2761,7 +2761,7 @@ async def test_raw_response_create_overload_4(self, async_client: AsyncOrb) -> N assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_4(self, async_client: AsyncOrb) -> None: @@ -2787,7 +2787,7 @@ async def test_streaming_response_create_overload_4(self, async_client: AsyncOrb assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2808,7 +2808,7 @@ async def test_method_create_overload_5(self, async_client: AsyncOrb) -> None: ] }, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_5(self, async_client: AsyncOrb) -> None: @@ -2843,7 +2843,7 @@ async def test_method_create_with_all_params_overload_5(self, async_client: Asyn }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_raw_response_create_overload_5(self, async_client: AsyncOrb) -> None: @@ -2866,7 +2866,7 @@ async def test_raw_response_create_overload_5(self, async_client: AsyncOrb) -> N assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_5(self, async_client: AsyncOrb) -> None: @@ -2889,7 +2889,7 @@ async def test_streaming_response_create_overload_5(self, async_client: AsyncOrb assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2910,7 +2910,7 @@ async def test_method_create_overload_6(self, async_client: AsyncOrb) -> None: ] }, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_6(self, async_client: AsyncOrb) -> None: @@ -2946,7 +2946,7 @@ async def test_method_create_with_all_params_overload_6(self, async_client: Asyn }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_raw_response_create_overload_6(self, async_client: AsyncOrb) -> None: @@ -2969,7 +2969,7 @@ async def test_raw_response_create_overload_6(self, async_client: AsyncOrb) -> N assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_6(self, async_client: AsyncOrb) -> None: @@ -2992,7 +2992,7 @@ async def test_streaming_response_create_overload_6(self, async_client: AsyncOrb assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3006,7 +3006,7 @@ async def test_method_create_overload_7(self, async_client: AsyncOrb) -> None: model_type="bps", name="Annual fee", ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_7(self, async_client: AsyncOrb) -> None: @@ -3036,7 +3036,7 @@ async def test_method_create_with_all_params_overload_7(self, async_client: Asyn }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_raw_response_create_overload_7(self, async_client: AsyncOrb) -> None: @@ -3052,7 +3052,7 @@ async def test_raw_response_create_overload_7(self, async_client: AsyncOrb) -> N assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_7(self, async_client: AsyncOrb) -> None: @@ -3068,7 +3068,7 @@ async def test_streaming_response_create_overload_7(self, async_client: AsyncOrb assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3082,7 +3082,7 @@ async def test_method_create_overload_8(self, async_client: AsyncOrb) -> None: model_type="bulk_bps", name="Annual fee", ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_8(self, async_client: AsyncOrb) -> None: @@ -3117,7 +3117,7 @@ async def test_method_create_with_all_params_overload_8(self, async_client: Asyn }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_raw_response_create_overload_8(self, async_client: AsyncOrb) -> None: @@ -3133,7 +3133,7 @@ async def test_raw_response_create_overload_8(self, async_client: AsyncOrb) -> N assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_8(self, async_client: AsyncOrb) -> None: @@ -3149,7 +3149,7 @@ async def test_streaming_response_create_overload_8(self, async_client: AsyncOrb assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3163,7 +3163,7 @@ async def test_method_create_overload_9(self, async_client: AsyncOrb) -> None: model_type="bulk", name="Annual fee", ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_9(self, async_client: AsyncOrb) -> None: @@ -3197,7 +3197,7 @@ async def test_method_create_with_all_params_overload_9(self, async_client: Asyn }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_raw_response_create_overload_9(self, async_client: AsyncOrb) -> None: @@ -3213,7 +3213,7 @@ async def test_raw_response_create_overload_9(self, async_client: AsyncOrb) -> N assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_9(self, async_client: AsyncOrb) -> None: @@ -3229,7 +3229,7 @@ async def test_streaming_response_create_overload_9(self, async_client: AsyncOrb assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3243,7 +3243,7 @@ async def test_method_create_overload_10(self, async_client: AsyncOrb) -> None: name="Annual fee", threshold_total_amount_config={"foo": "bar"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_10(self, async_client: AsyncOrb) -> None: @@ -3270,7 +3270,7 @@ async def test_method_create_with_all_params_overload_10(self, async_client: Asy }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_raw_response_create_overload_10(self, async_client: AsyncOrb) -> None: @@ -3286,7 +3286,7 @@ async def test_raw_response_create_overload_10(self, async_client: AsyncOrb) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_10(self, async_client: AsyncOrb) -> None: @@ -3302,7 +3302,7 @@ async def test_streaming_response_create_overload_10(self, async_client: AsyncOr assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3316,7 +3316,7 @@ async def test_method_create_overload_11(self, async_client: AsyncOrb) -> None: name="Annual fee", tiered_package_config={"foo": "bar"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_11(self, async_client: AsyncOrb) -> None: @@ -3343,7 +3343,7 @@ async def test_method_create_with_all_params_overload_11(self, async_client: Asy }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_raw_response_create_overload_11(self, async_client: AsyncOrb) -> None: @@ -3359,7 +3359,7 @@ async def test_raw_response_create_overload_11(self, async_client: AsyncOrb) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_11(self, async_client: AsyncOrb) -> None: @@ -3375,7 +3375,7 @@ async def test_streaming_response_create_overload_11(self, async_client: AsyncOr assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3389,7 +3389,7 @@ async def test_method_create_overload_12(self, async_client: AsyncOrb) -> None: model_type="grouped_tiered", name="Annual fee", ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_12(self, async_client: AsyncOrb) -> None: @@ -3416,7 +3416,7 @@ async def test_method_create_with_all_params_overload_12(self, async_client: Asy }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_raw_response_create_overload_12(self, async_client: AsyncOrb) -> None: @@ -3432,7 +3432,7 @@ async def test_raw_response_create_overload_12(self, async_client: AsyncOrb) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_12(self, async_client: AsyncOrb) -> None: @@ -3448,7 +3448,7 @@ async def test_streaming_response_create_overload_12(self, async_client: AsyncOr assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3462,7 +3462,7 @@ async def test_method_create_overload_13(self, async_client: AsyncOrb) -> None: model_type="max_group_tiered_package", name="Annual fee", ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_13(self, async_client: AsyncOrb) -> None: @@ -3489,7 +3489,7 @@ async def test_method_create_with_all_params_overload_13(self, async_client: Asy }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_raw_response_create_overload_13(self, async_client: AsyncOrb) -> None: @@ -3505,7 +3505,7 @@ async def test_raw_response_create_overload_13(self, async_client: AsyncOrb) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_13(self, async_client: AsyncOrb) -> None: @@ -3521,7 +3521,7 @@ async def test_streaming_response_create_overload_13(self, async_client: AsyncOr assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3535,7 +3535,7 @@ async def test_method_create_overload_14(self, async_client: AsyncOrb) -> None: name="Annual fee", tiered_with_minimum_config={"foo": "bar"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_14(self, async_client: AsyncOrb) -> None: @@ -3562,7 +3562,7 @@ async def test_method_create_with_all_params_overload_14(self, async_client: Asy }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_raw_response_create_overload_14(self, async_client: AsyncOrb) -> None: @@ -3578,7 +3578,7 @@ async def test_raw_response_create_overload_14(self, async_client: AsyncOrb) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_14(self, async_client: AsyncOrb) -> None: @@ -3594,7 +3594,7 @@ async def test_streaming_response_create_overload_14(self, async_client: AsyncOr assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3608,7 +3608,7 @@ async def test_method_create_overload_15(self, async_client: AsyncOrb) -> None: name="Annual fee", package_with_allocation_config={"foo": "bar"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_15(self, async_client: AsyncOrb) -> None: @@ -3635,7 +3635,7 @@ async def test_method_create_with_all_params_overload_15(self, async_client: Asy }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_raw_response_create_overload_15(self, async_client: AsyncOrb) -> None: @@ -3651,7 +3651,7 @@ async def test_raw_response_create_overload_15(self, async_client: AsyncOrb) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_15(self, async_client: AsyncOrb) -> None: @@ -3667,7 +3667,7 @@ async def test_streaming_response_create_overload_15(self, async_client: AsyncOr assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3681,7 +3681,7 @@ async def test_method_create_overload_16(self, async_client: AsyncOrb) -> None: name="Annual fee", tiered_package_with_minimum_config={"foo": "bar"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_16(self, async_client: AsyncOrb) -> None: @@ -3708,7 +3708,7 @@ async def test_method_create_with_all_params_overload_16(self, async_client: Asy }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_raw_response_create_overload_16(self, async_client: AsyncOrb) -> None: @@ -3724,7 +3724,7 @@ async def test_raw_response_create_overload_16(self, async_client: AsyncOrb) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_16(self, async_client: AsyncOrb) -> None: @@ -3740,7 +3740,7 @@ async def test_streaming_response_create_overload_16(self, async_client: AsyncOr assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3754,7 +3754,7 @@ async def test_method_create_overload_17(self, async_client: AsyncOrb) -> None: name="Annual fee", unit_with_percent_config={"foo": "bar"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_17(self, async_client: AsyncOrb) -> None: @@ -3781,7 +3781,7 @@ async def test_method_create_with_all_params_overload_17(self, async_client: Asy }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_raw_response_create_overload_17(self, async_client: AsyncOrb) -> None: @@ -3797,7 +3797,7 @@ async def test_raw_response_create_overload_17(self, async_client: AsyncOrb) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_17(self, async_client: AsyncOrb) -> None: @@ -3813,7 +3813,7 @@ async def test_streaming_response_create_overload_17(self, async_client: AsyncOr assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3827,7 +3827,7 @@ async def test_method_create_overload_18(self, async_client: AsyncOrb) -> None: name="Annual fee", tiered_with_proration_config={"foo": "bar"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_18(self, async_client: AsyncOrb) -> None: @@ -3854,7 +3854,7 @@ async def test_method_create_with_all_params_overload_18(self, async_client: Asy }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_raw_response_create_overload_18(self, async_client: AsyncOrb) -> None: @@ -3870,7 +3870,7 @@ async def test_raw_response_create_overload_18(self, async_client: AsyncOrb) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_18(self, async_client: AsyncOrb) -> None: @@ -3886,7 +3886,7 @@ async def test_streaming_response_create_overload_18(self, async_client: AsyncOr assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3900,7 +3900,7 @@ async def test_method_create_overload_19(self, async_client: AsyncOrb) -> None: name="Annual fee", unit_with_proration_config={"foo": "bar"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_19(self, async_client: AsyncOrb) -> None: @@ -3927,7 +3927,7 @@ async def test_method_create_with_all_params_overload_19(self, async_client: Asy }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_raw_response_create_overload_19(self, async_client: AsyncOrb) -> None: @@ -3943,7 +3943,7 @@ async def test_raw_response_create_overload_19(self, async_client: AsyncOrb) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_19(self, async_client: AsyncOrb) -> None: @@ -3959,7 +3959,7 @@ async def test_streaming_response_create_overload_19(self, async_client: AsyncOr assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3973,7 +3973,7 @@ async def test_method_create_overload_20(self, async_client: AsyncOrb) -> None: model_type="grouped_allocation", name="Annual fee", ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_20(self, async_client: AsyncOrb) -> None: @@ -4000,7 +4000,7 @@ async def test_method_create_with_all_params_overload_20(self, async_client: Asy }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_raw_response_create_overload_20(self, async_client: AsyncOrb) -> None: @@ -4016,7 +4016,7 @@ async def test_raw_response_create_overload_20(self, async_client: AsyncOrb) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_20(self, async_client: AsyncOrb) -> None: @@ -4032,7 +4032,7 @@ async def test_streaming_response_create_overload_20(self, async_client: AsyncOr assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4046,7 +4046,7 @@ async def test_method_create_overload_21(self, async_client: AsyncOrb) -> None: model_type="grouped_with_prorated_minimum", name="Annual fee", ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_21(self, async_client: AsyncOrb) -> None: @@ -4073,7 +4073,7 @@ async def test_method_create_with_all_params_overload_21(self, async_client: Asy }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_raw_response_create_overload_21(self, async_client: AsyncOrb) -> None: @@ -4089,7 +4089,7 @@ async def test_raw_response_create_overload_21(self, async_client: AsyncOrb) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_21(self, async_client: AsyncOrb) -> None: @@ -4105,7 +4105,7 @@ async def test_streaming_response_create_overload_21(self, async_client: AsyncOr assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4119,7 +4119,7 @@ async def test_method_create_overload_22(self, async_client: AsyncOrb) -> None: model_type="grouped_with_metered_minimum", name="Annual fee", ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_22(self, async_client: AsyncOrb) -> None: @@ -4146,7 +4146,7 @@ async def test_method_create_with_all_params_overload_22(self, async_client: Asy }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_raw_response_create_overload_22(self, async_client: AsyncOrb) -> None: @@ -4162,7 +4162,7 @@ async def test_raw_response_create_overload_22(self, async_client: AsyncOrb) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_22(self, async_client: AsyncOrb) -> None: @@ -4178,7 +4178,7 @@ async def test_streaming_response_create_overload_22(self, async_client: AsyncOr assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4192,7 +4192,7 @@ async def test_method_create_overload_23(self, async_client: AsyncOrb) -> None: model_type="matrix_with_display_name", name="Annual fee", ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_23(self, async_client: AsyncOrb) -> None: @@ -4219,7 +4219,7 @@ async def test_method_create_with_all_params_overload_23(self, async_client: Asy }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_raw_response_create_overload_23(self, async_client: AsyncOrb) -> None: @@ -4235,7 +4235,7 @@ async def test_raw_response_create_overload_23(self, async_client: AsyncOrb) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_23(self, async_client: AsyncOrb) -> None: @@ -4251,7 +4251,7 @@ async def test_streaming_response_create_overload_23(self, async_client: AsyncOr assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4265,7 +4265,7 @@ async def test_method_create_overload_24(self, async_client: AsyncOrb) -> None: model_type="bulk_with_proration", name="Annual fee", ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_24(self, async_client: AsyncOrb) -> None: @@ -4292,7 +4292,7 @@ async def test_method_create_with_all_params_overload_24(self, async_client: Asy }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_raw_response_create_overload_24(self, async_client: AsyncOrb) -> None: @@ -4308,7 +4308,7 @@ async def test_raw_response_create_overload_24(self, async_client: AsyncOrb) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_24(self, async_client: AsyncOrb) -> None: @@ -4324,7 +4324,7 @@ async def test_streaming_response_create_overload_24(self, async_client: AsyncOr assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4338,7 +4338,7 @@ async def test_method_create_overload_25(self, async_client: AsyncOrb) -> None: model_type="grouped_tiered_package", name="Annual fee", ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_25(self, async_client: AsyncOrb) -> None: @@ -4365,7 +4365,7 @@ async def test_method_create_with_all_params_overload_25(self, async_client: Asy }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_raw_response_create_overload_25(self, async_client: AsyncOrb) -> None: @@ -4381,7 +4381,7 @@ async def test_raw_response_create_overload_25(self, async_client: AsyncOrb) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_25(self, async_client: AsyncOrb) -> None: @@ -4397,7 +4397,7 @@ async def test_streaming_response_create_overload_25(self, async_client: AsyncOr assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4411,7 +4411,7 @@ async def test_method_create_overload_26(self, async_client: AsyncOrb) -> None: name="Annual fee", scalable_matrix_with_unit_pricing_config={"foo": "bar"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_26(self, async_client: AsyncOrb) -> None: @@ -4438,7 +4438,7 @@ async def test_method_create_with_all_params_overload_26(self, async_client: Asy }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_raw_response_create_overload_26(self, async_client: AsyncOrb) -> None: @@ -4454,7 +4454,7 @@ async def test_raw_response_create_overload_26(self, async_client: AsyncOrb) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_26(self, async_client: AsyncOrb) -> None: @@ -4470,7 +4470,7 @@ async def test_streaming_response_create_overload_26(self, async_client: AsyncOr assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4484,7 +4484,7 @@ async def test_method_create_overload_27(self, async_client: AsyncOrb) -> None: name="Annual fee", scalable_matrix_with_tiered_pricing_config={"foo": "bar"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_27(self, async_client: AsyncOrb) -> None: @@ -4511,7 +4511,7 @@ async def test_method_create_with_all_params_overload_27(self, async_client: Asy }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_raw_response_create_overload_27(self, async_client: AsyncOrb) -> None: @@ -4527,7 +4527,7 @@ async def test_raw_response_create_overload_27(self, async_client: AsyncOrb) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_27(self, async_client: AsyncOrb) -> None: @@ -4543,7 +4543,7 @@ async def test_streaming_response_create_overload_27(self, async_client: AsyncOr assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4557,7 +4557,7 @@ async def test_method_create_overload_28(self, async_client: AsyncOrb) -> None: model_type="cumulative_grouped_bulk", name="Annual fee", ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_28(self, async_client: AsyncOrb) -> None: @@ -4584,7 +4584,7 @@ async def test_method_create_with_all_params_overload_28(self, async_client: Asy }, metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_raw_response_create_overload_28(self, async_client: AsyncOrb) -> None: @@ -4600,7 +4600,7 @@ async def test_raw_response_create_overload_28(self, async_client: AsyncOrb) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_streaming_response_create_overload_28(self, async_client: AsyncOrb) -> None: @@ -4616,7 +4616,7 @@ async def test_streaming_response_create_overload_28(self, async_client: AsyncOr assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4625,7 +4625,7 @@ async def test_method_update(self, async_client: AsyncOrb) -> None: price = await async_client.prices.update( price_id="price_id", ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_method_update_with_all_params(self, async_client: AsyncOrb) -> None: @@ -4633,7 +4633,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncOrb) -> No price_id="price_id", metadata={"foo": "string"}, ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncOrb) -> None: @@ -4644,7 +4644,7 @@ async def test_raw_response_update(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncOrb) -> None: @@ -4655,7 +4655,7 @@ async def test_streaming_response_update(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4669,7 +4669,7 @@ async def test_path_params_update(self, async_client: AsyncOrb) -> None: @parametrize async def test_method_list(self, async_client: AsyncOrb) -> None: price = await async_client.prices.list() - assert_matches_type(AsyncPage[Price], price, path=["response"]) + assert_matches_type(AsyncPage[PriceModel], price, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None: @@ -4677,7 +4677,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None cursor="cursor", limit=1, ) - assert_matches_type(AsyncPage[Price], price, path=["response"]) + assert_matches_type(AsyncPage[PriceModel], price, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncOrb) -> None: @@ -4686,7 +4686,7 @@ async def test_raw_response_list(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(AsyncPage[Price], price, path=["response"]) + assert_matches_type(AsyncPage[PriceModel], price, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: @@ -4695,7 +4695,7 @@ async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(AsyncPage[Price], price, path=["response"]) + assert_matches_type(AsyncPage[PriceModel], price, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4763,7 +4763,7 @@ async def test_method_fetch(self, async_client: AsyncOrb) -> None: price = await async_client.prices.fetch( "price_id", ) - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_raw_response_fetch(self, async_client: AsyncOrb) -> None: @@ -4774,7 +4774,7 @@ async def test_raw_response_fetch(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) @parametrize async def test_streaming_response_fetch(self, async_client: AsyncOrb) -> None: @@ -4785,7 +4785,7 @@ async def test_streaming_response_fetch(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" price = await response.parse() - assert_matches_type(Price, price, path=["response"]) + assert_matches_type(PriceModel, price, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_subscriptions.py b/tests/api_resources/test_subscriptions.py index 89ac2bab..26b2292b 100644 --- a/tests/api_resources/test_subscriptions.py +++ b/tests/api_resources/test_subscriptions.py @@ -9,24 +9,14 @@ from orb import Orb, AsyncOrb from orb.types import ( - Subscription, SubscriptionUsage, - SubscriptionCancelResponse, - SubscriptionCreateResponse, SubscriptionFetchCostsResponse, - SubscriptionUpdateTrialResponse, - SubscriptionTriggerPhaseResponse, SubscriptionFetchScheduleResponse, - SubscriptionPriceIntervalsResponse, - SubscriptionSchedulePlanChangeResponse, - SubscriptionUnscheduleCancellationResponse, - SubscriptionUpdateFixedFeeQuantityResponse, - SubscriptionUnschedulePendingPlanChangesResponse, - SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse, ) from orb._utils import parse_date, parse_datetime from tests.utils import assert_matches_type from orb.pagination import SyncPage, AsyncPage +from orb.types.shared import SubscriptionModel, MutatedSubscriptionModel base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -37,7 +27,7 @@ class TestSubscriptions: @parametrize def test_method_create(self, client: Orb) -> None: subscription = client.subscriptions.create() - assert_matches_type(SubscriptionCreateResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Orb) -> None: @@ -200,7 +190,7 @@ def test_method_create_with_all_params(self, client: Orb) -> None: trial_duration_days=999999, usage_customer_ids=["string"], ) - assert_matches_type(SubscriptionCreateResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) @parametrize def test_raw_response_create(self, client: Orb) -> None: @@ -209,7 +199,7 @@ def test_raw_response_create(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SubscriptionCreateResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) @parametrize def test_streaming_response_create(self, client: Orb) -> None: @@ -218,7 +208,7 @@ def test_streaming_response_create(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SubscriptionCreateResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -227,7 +217,7 @@ def test_method_update(self, client: Orb) -> None: subscription = client.subscriptions.update( subscription_id="subscription_id", ) - assert_matches_type(Subscription, subscription, path=["response"]) + assert_matches_type(SubscriptionModel, subscription, path=["response"]) @parametrize def test_method_update_with_all_params(self, client: Orb) -> None: @@ -239,7 +229,7 @@ def test_method_update_with_all_params(self, client: Orb) -> None: metadata={"foo": "string"}, net_terms=0, ) - assert_matches_type(Subscription, subscription, path=["response"]) + assert_matches_type(SubscriptionModel, subscription, path=["response"]) @parametrize def test_raw_response_update(self, client: Orb) -> None: @@ -250,7 +240,7 @@ def test_raw_response_update(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(Subscription, subscription, path=["response"]) + assert_matches_type(SubscriptionModel, subscription, path=["response"]) @parametrize def test_streaming_response_update(self, client: Orb) -> None: @@ -261,7 +251,7 @@ def test_streaming_response_update(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(Subscription, subscription, path=["response"]) + assert_matches_type(SubscriptionModel, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -275,7 +265,7 @@ def test_path_params_update(self, client: Orb) -> None: @parametrize def test_method_list(self, client: Orb) -> None: subscription = client.subscriptions.list() - assert_matches_type(SyncPage[Subscription], subscription, path=["response"]) + assert_matches_type(SyncPage[SubscriptionModel], subscription, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Orb) -> None: @@ -290,7 +280,7 @@ def test_method_list_with_all_params(self, client: Orb) -> None: limit=1, status="active", ) - assert_matches_type(SyncPage[Subscription], subscription, path=["response"]) + assert_matches_type(SyncPage[SubscriptionModel], subscription, path=["response"]) @parametrize def test_raw_response_list(self, client: Orb) -> None: @@ -299,7 +289,7 @@ def test_raw_response_list(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SyncPage[Subscription], subscription, path=["response"]) + assert_matches_type(SyncPage[SubscriptionModel], subscription, path=["response"]) @parametrize def test_streaming_response_list(self, client: Orb) -> None: @@ -308,7 +298,7 @@ def test_streaming_response_list(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SyncPage[Subscription], subscription, path=["response"]) + assert_matches_type(SyncPage[SubscriptionModel], subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -318,7 +308,7 @@ def test_method_cancel(self, client: Orb) -> None: subscription_id="subscription_id", cancel_option="end_of_subscription_term", ) - assert_matches_type(SubscriptionCancelResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) @parametrize def test_method_cancel_with_all_params(self, client: Orb) -> None: @@ -328,7 +318,7 @@ def test_method_cancel_with_all_params(self, client: Orb) -> None: allow_invoice_credit_or_void=True, cancellation_date=parse_datetime("2019-12-27T18:11:19.117Z"), ) - assert_matches_type(SubscriptionCancelResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) @parametrize def test_raw_response_cancel(self, client: Orb) -> None: @@ -340,7 +330,7 @@ def test_raw_response_cancel(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SubscriptionCancelResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) @parametrize def test_streaming_response_cancel(self, client: Orb) -> None: @@ -352,7 +342,7 @@ def test_streaming_response_cancel(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SubscriptionCancelResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -369,7 +359,7 @@ def test_method_fetch(self, client: Orb) -> None: subscription = client.subscriptions.fetch( "subscription_id", ) - assert_matches_type(Subscription, subscription, path=["response"]) + assert_matches_type(SubscriptionModel, subscription, path=["response"]) @parametrize def test_raw_response_fetch(self, client: Orb) -> None: @@ -380,7 +370,7 @@ def test_raw_response_fetch(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(Subscription, subscription, path=["response"]) + assert_matches_type(SubscriptionModel, subscription, path=["response"]) @parametrize def test_streaming_response_fetch(self, client: Orb) -> None: @@ -391,7 +381,7 @@ def test_streaming_response_fetch(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(Subscription, subscription, path=["response"]) + assert_matches_type(SubscriptionModel, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -568,7 +558,7 @@ def test_method_price_intervals(self, client: Orb) -> None: subscription = client.subscriptions.price_intervals( subscription_id="subscription_id", ) - assert_matches_type(SubscriptionPriceIntervalsResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) @pytest.mark.skip(reason="Incorrect example breaks Prism") @parametrize @@ -665,7 +655,7 @@ def test_method_price_intervals_with_all_params(self, client: Orb) -> None: } ], ) - assert_matches_type(SubscriptionPriceIntervalsResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) @pytest.mark.skip(reason="Incorrect example breaks Prism") @parametrize @@ -677,7 +667,7 @@ def test_raw_response_price_intervals(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SubscriptionPriceIntervalsResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) @pytest.mark.skip(reason="Incorrect example breaks Prism") @parametrize @@ -689,7 +679,7 @@ def test_streaming_response_price_intervals(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SubscriptionPriceIntervalsResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -707,7 +697,7 @@ def test_method_schedule_plan_change(self, client: Orb) -> None: subscription_id="subscription_id", change_option="requested_date", ) - assert_matches_type(SubscriptionSchedulePlanChangeResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) @parametrize def test_method_schedule_plan_change_with_all_params(self, client: Orb) -> None: @@ -866,7 +856,7 @@ def test_method_schedule_plan_change_with_all_params(self, client: Orb) -> None: trial_duration_days=999999, usage_customer_ids=["string"], ) - assert_matches_type(SubscriptionSchedulePlanChangeResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) @parametrize def test_raw_response_schedule_plan_change(self, client: Orb) -> None: @@ -878,7 +868,7 @@ def test_raw_response_schedule_plan_change(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SubscriptionSchedulePlanChangeResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) @parametrize def test_streaming_response_schedule_plan_change(self, client: Orb) -> None: @@ -890,7 +880,7 @@ def test_streaming_response_schedule_plan_change(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SubscriptionSchedulePlanChangeResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -907,7 +897,7 @@ def test_method_trigger_phase(self, client: Orb) -> None: subscription = client.subscriptions.trigger_phase( subscription_id="subscription_id", ) - assert_matches_type(SubscriptionTriggerPhaseResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) @parametrize def test_method_trigger_phase_with_all_params(self, client: Orb) -> None: @@ -916,7 +906,7 @@ def test_method_trigger_phase_with_all_params(self, client: Orb) -> None: allow_invoice_credit_or_void=True, effective_date=parse_date("2019-12-27"), ) - assert_matches_type(SubscriptionTriggerPhaseResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) @parametrize def test_raw_response_trigger_phase(self, client: Orb) -> None: @@ -927,7 +917,7 @@ def test_raw_response_trigger_phase(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SubscriptionTriggerPhaseResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) @parametrize def test_streaming_response_trigger_phase(self, client: Orb) -> None: @@ -938,7 +928,7 @@ def test_streaming_response_trigger_phase(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SubscriptionTriggerPhaseResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -954,7 +944,7 @@ def test_method_unschedule_cancellation(self, client: Orb) -> None: subscription = client.subscriptions.unschedule_cancellation( "subscription_id", ) - assert_matches_type(SubscriptionUnscheduleCancellationResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) @parametrize def test_raw_response_unschedule_cancellation(self, client: Orb) -> None: @@ -965,7 +955,7 @@ def test_raw_response_unschedule_cancellation(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SubscriptionUnscheduleCancellationResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) @parametrize def test_streaming_response_unschedule_cancellation(self, client: Orb) -> None: @@ -976,7 +966,7 @@ def test_streaming_response_unschedule_cancellation(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SubscriptionUnscheduleCancellationResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -993,7 +983,7 @@ def test_method_unschedule_fixed_fee_quantity_updates(self, client: Orb) -> None subscription_id="subscription_id", price_id="price_id", ) - assert_matches_type(SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) @parametrize def test_raw_response_unschedule_fixed_fee_quantity_updates(self, client: Orb) -> None: @@ -1005,7 +995,7 @@ def test_raw_response_unschedule_fixed_fee_quantity_updates(self, client: Orb) - assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) @parametrize def test_streaming_response_unschedule_fixed_fee_quantity_updates(self, client: Orb) -> None: @@ -1017,7 +1007,7 @@ def test_streaming_response_unschedule_fixed_fee_quantity_updates(self, client: assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1034,7 +1024,7 @@ def test_method_unschedule_pending_plan_changes(self, client: Orb) -> None: subscription = client.subscriptions.unschedule_pending_plan_changes( "subscription_id", ) - assert_matches_type(SubscriptionUnschedulePendingPlanChangesResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) @parametrize def test_raw_response_unschedule_pending_plan_changes(self, client: Orb) -> None: @@ -1045,7 +1035,7 @@ def test_raw_response_unschedule_pending_plan_changes(self, client: Orb) -> None assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SubscriptionUnschedulePendingPlanChangesResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) @parametrize def test_streaming_response_unschedule_pending_plan_changes(self, client: Orb) -> None: @@ -1056,7 +1046,7 @@ def test_streaming_response_unschedule_pending_plan_changes(self, client: Orb) - assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SubscriptionUnschedulePendingPlanChangesResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1074,7 +1064,7 @@ def test_method_update_fixed_fee_quantity(self, client: Orb) -> None: price_id="price_id", quantity=0, ) - assert_matches_type(SubscriptionUpdateFixedFeeQuantityResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) @parametrize def test_method_update_fixed_fee_quantity_with_all_params(self, client: Orb) -> None: @@ -1086,7 +1076,7 @@ def test_method_update_fixed_fee_quantity_with_all_params(self, client: Orb) -> change_option="immediate", effective_date=parse_date("2022-12-21"), ) - assert_matches_type(SubscriptionUpdateFixedFeeQuantityResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) @parametrize def test_raw_response_update_fixed_fee_quantity(self, client: Orb) -> None: @@ -1099,7 +1089,7 @@ def test_raw_response_update_fixed_fee_quantity(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SubscriptionUpdateFixedFeeQuantityResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) @parametrize def test_streaming_response_update_fixed_fee_quantity(self, client: Orb) -> None: @@ -1112,7 +1102,7 @@ def test_streaming_response_update_fixed_fee_quantity(self, client: Orb) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SubscriptionUpdateFixedFeeQuantityResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1131,7 +1121,7 @@ def test_method_update_trial(self, client: Orb) -> None: subscription_id="subscription_id", trial_end_date=parse_datetime("2017-07-21T17:32:28Z"), ) - assert_matches_type(SubscriptionUpdateTrialResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) @parametrize def test_method_update_trial_with_all_params(self, client: Orb) -> None: @@ -1140,7 +1130,7 @@ def test_method_update_trial_with_all_params(self, client: Orb) -> None: trial_end_date=parse_datetime("2017-07-21T17:32:28Z"), shift=True, ) - assert_matches_type(SubscriptionUpdateTrialResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) @parametrize def test_raw_response_update_trial(self, client: Orb) -> None: @@ -1152,7 +1142,7 @@ def test_raw_response_update_trial(self, client: Orb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SubscriptionUpdateTrialResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) @parametrize def test_streaming_response_update_trial(self, client: Orb) -> None: @@ -1164,7 +1154,7 @@ def test_streaming_response_update_trial(self, client: Orb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SubscriptionUpdateTrialResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1183,7 +1173,7 @@ class TestAsyncSubscriptions: @parametrize async def test_method_create(self, async_client: AsyncOrb) -> None: subscription = await async_client.subscriptions.create() - assert_matches_type(SubscriptionCreateResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> None: @@ -1346,7 +1336,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No trial_duration_days=999999, usage_customer_ids=["string"], ) - assert_matches_type(SubscriptionCreateResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncOrb) -> None: @@ -1355,7 +1345,7 @@ async def test_raw_response_create(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SubscriptionCreateResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: @@ -1364,7 +1354,7 @@ async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(SubscriptionCreateResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1373,7 +1363,7 @@ async def test_method_update(self, async_client: AsyncOrb) -> None: subscription = await async_client.subscriptions.update( subscription_id="subscription_id", ) - assert_matches_type(Subscription, subscription, path=["response"]) + assert_matches_type(SubscriptionModel, subscription, path=["response"]) @parametrize async def test_method_update_with_all_params(self, async_client: AsyncOrb) -> None: @@ -1385,7 +1375,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncOrb) -> No metadata={"foo": "string"}, net_terms=0, ) - assert_matches_type(Subscription, subscription, path=["response"]) + assert_matches_type(SubscriptionModel, subscription, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncOrb) -> None: @@ -1396,7 +1386,7 @@ async def test_raw_response_update(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(Subscription, subscription, path=["response"]) + assert_matches_type(SubscriptionModel, subscription, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncOrb) -> None: @@ -1407,7 +1397,7 @@ async def test_streaming_response_update(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(Subscription, subscription, path=["response"]) + assert_matches_type(SubscriptionModel, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1421,7 +1411,7 @@ async def test_path_params_update(self, async_client: AsyncOrb) -> None: @parametrize async def test_method_list(self, async_client: AsyncOrb) -> None: subscription = await async_client.subscriptions.list() - assert_matches_type(AsyncPage[Subscription], subscription, path=["response"]) + assert_matches_type(AsyncPage[SubscriptionModel], subscription, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None: @@ -1436,7 +1426,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None limit=1, status="active", ) - assert_matches_type(AsyncPage[Subscription], subscription, path=["response"]) + assert_matches_type(AsyncPage[SubscriptionModel], subscription, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncOrb) -> None: @@ -1445,7 +1435,7 @@ async def test_raw_response_list(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(AsyncPage[Subscription], subscription, path=["response"]) + assert_matches_type(AsyncPage[SubscriptionModel], subscription, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: @@ -1454,7 +1444,7 @@ async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(AsyncPage[Subscription], subscription, path=["response"]) + assert_matches_type(AsyncPage[SubscriptionModel], subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1464,7 +1454,7 @@ async def test_method_cancel(self, async_client: AsyncOrb) -> None: subscription_id="subscription_id", cancel_option="end_of_subscription_term", ) - assert_matches_type(SubscriptionCancelResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) @parametrize async def test_method_cancel_with_all_params(self, async_client: AsyncOrb) -> None: @@ -1474,7 +1464,7 @@ async def test_method_cancel_with_all_params(self, async_client: AsyncOrb) -> No allow_invoice_credit_or_void=True, cancellation_date=parse_datetime("2019-12-27T18:11:19.117Z"), ) - assert_matches_type(SubscriptionCancelResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) @parametrize async def test_raw_response_cancel(self, async_client: AsyncOrb) -> None: @@ -1486,7 +1476,7 @@ async def test_raw_response_cancel(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SubscriptionCancelResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) @parametrize async def test_streaming_response_cancel(self, async_client: AsyncOrb) -> None: @@ -1498,7 +1488,7 @@ async def test_streaming_response_cancel(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(SubscriptionCancelResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1515,7 +1505,7 @@ async def test_method_fetch(self, async_client: AsyncOrb) -> None: subscription = await async_client.subscriptions.fetch( "subscription_id", ) - assert_matches_type(Subscription, subscription, path=["response"]) + assert_matches_type(SubscriptionModel, subscription, path=["response"]) @parametrize async def test_raw_response_fetch(self, async_client: AsyncOrb) -> None: @@ -1526,7 +1516,7 @@ async def test_raw_response_fetch(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(Subscription, subscription, path=["response"]) + assert_matches_type(SubscriptionModel, subscription, path=["response"]) @parametrize async def test_streaming_response_fetch(self, async_client: AsyncOrb) -> None: @@ -1537,7 +1527,7 @@ async def test_streaming_response_fetch(self, async_client: AsyncOrb) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(Subscription, subscription, path=["response"]) + assert_matches_type(SubscriptionModel, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1714,7 +1704,7 @@ async def test_method_price_intervals(self, async_client: AsyncOrb) -> None: subscription = await async_client.subscriptions.price_intervals( subscription_id="subscription_id", ) - assert_matches_type(SubscriptionPriceIntervalsResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) @pytest.mark.skip(reason="Incorrect example breaks Prism") @parametrize @@ -1811,7 +1801,7 @@ async def test_method_price_intervals_with_all_params(self, async_client: AsyncO } ], ) - assert_matches_type(SubscriptionPriceIntervalsResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) @pytest.mark.skip(reason="Incorrect example breaks Prism") @parametrize @@ -1823,7 +1813,7 @@ async def test_raw_response_price_intervals(self, async_client: AsyncOrb) -> Non assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SubscriptionPriceIntervalsResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) @pytest.mark.skip(reason="Incorrect example breaks Prism") @parametrize @@ -1835,7 +1825,7 @@ async def test_streaming_response_price_intervals(self, async_client: AsyncOrb) assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(SubscriptionPriceIntervalsResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1853,7 +1843,7 @@ async def test_method_schedule_plan_change(self, async_client: AsyncOrb) -> None subscription_id="subscription_id", change_option="requested_date", ) - assert_matches_type(SubscriptionSchedulePlanChangeResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) @parametrize async def test_method_schedule_plan_change_with_all_params(self, async_client: AsyncOrb) -> None: @@ -2012,7 +2002,7 @@ async def test_method_schedule_plan_change_with_all_params(self, async_client: A trial_duration_days=999999, usage_customer_ids=["string"], ) - assert_matches_type(SubscriptionSchedulePlanChangeResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) @parametrize async def test_raw_response_schedule_plan_change(self, async_client: AsyncOrb) -> None: @@ -2024,7 +2014,7 @@ async def test_raw_response_schedule_plan_change(self, async_client: AsyncOrb) - assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SubscriptionSchedulePlanChangeResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) @parametrize async def test_streaming_response_schedule_plan_change(self, async_client: AsyncOrb) -> None: @@ -2036,7 +2026,7 @@ async def test_streaming_response_schedule_plan_change(self, async_client: Async assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(SubscriptionSchedulePlanChangeResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2053,7 +2043,7 @@ async def test_method_trigger_phase(self, async_client: AsyncOrb) -> None: subscription = await async_client.subscriptions.trigger_phase( subscription_id="subscription_id", ) - assert_matches_type(SubscriptionTriggerPhaseResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) @parametrize async def test_method_trigger_phase_with_all_params(self, async_client: AsyncOrb) -> None: @@ -2062,7 +2052,7 @@ async def test_method_trigger_phase_with_all_params(self, async_client: AsyncOrb allow_invoice_credit_or_void=True, effective_date=parse_date("2019-12-27"), ) - assert_matches_type(SubscriptionTriggerPhaseResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) @parametrize async def test_raw_response_trigger_phase(self, async_client: AsyncOrb) -> None: @@ -2073,7 +2063,7 @@ async def test_raw_response_trigger_phase(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SubscriptionTriggerPhaseResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) @parametrize async def test_streaming_response_trigger_phase(self, async_client: AsyncOrb) -> None: @@ -2084,7 +2074,7 @@ async def test_streaming_response_trigger_phase(self, async_client: AsyncOrb) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(SubscriptionTriggerPhaseResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2100,7 +2090,7 @@ async def test_method_unschedule_cancellation(self, async_client: AsyncOrb) -> N subscription = await async_client.subscriptions.unschedule_cancellation( "subscription_id", ) - assert_matches_type(SubscriptionUnscheduleCancellationResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) @parametrize async def test_raw_response_unschedule_cancellation(self, async_client: AsyncOrb) -> None: @@ -2111,7 +2101,7 @@ async def test_raw_response_unschedule_cancellation(self, async_client: AsyncOrb assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SubscriptionUnscheduleCancellationResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) @parametrize async def test_streaming_response_unschedule_cancellation(self, async_client: AsyncOrb) -> None: @@ -2122,7 +2112,7 @@ async def test_streaming_response_unschedule_cancellation(self, async_client: As assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(SubscriptionUnscheduleCancellationResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2139,7 +2129,7 @@ async def test_method_unschedule_fixed_fee_quantity_updates(self, async_client: subscription_id="subscription_id", price_id="price_id", ) - assert_matches_type(SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) @parametrize async def test_raw_response_unschedule_fixed_fee_quantity_updates(self, async_client: AsyncOrb) -> None: @@ -2151,7 +2141,7 @@ async def test_raw_response_unschedule_fixed_fee_quantity_updates(self, async_cl assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) @parametrize async def test_streaming_response_unschedule_fixed_fee_quantity_updates(self, async_client: AsyncOrb) -> None: @@ -2163,7 +2153,7 @@ async def test_streaming_response_unschedule_fixed_fee_quantity_updates(self, as assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2180,7 +2170,7 @@ async def test_method_unschedule_pending_plan_changes(self, async_client: AsyncO subscription = await async_client.subscriptions.unschedule_pending_plan_changes( "subscription_id", ) - assert_matches_type(SubscriptionUnschedulePendingPlanChangesResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) @parametrize async def test_raw_response_unschedule_pending_plan_changes(self, async_client: AsyncOrb) -> None: @@ -2191,7 +2181,7 @@ async def test_raw_response_unschedule_pending_plan_changes(self, async_client: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SubscriptionUnschedulePendingPlanChangesResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) @parametrize async def test_streaming_response_unschedule_pending_plan_changes(self, async_client: AsyncOrb) -> None: @@ -2202,7 +2192,7 @@ async def test_streaming_response_unschedule_pending_plan_changes(self, async_cl assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(SubscriptionUnschedulePendingPlanChangesResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2220,7 +2210,7 @@ async def test_method_update_fixed_fee_quantity(self, async_client: AsyncOrb) -> price_id="price_id", quantity=0, ) - assert_matches_type(SubscriptionUpdateFixedFeeQuantityResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) @parametrize async def test_method_update_fixed_fee_quantity_with_all_params(self, async_client: AsyncOrb) -> None: @@ -2232,7 +2222,7 @@ async def test_method_update_fixed_fee_quantity_with_all_params(self, async_clie change_option="immediate", effective_date=parse_date("2022-12-21"), ) - assert_matches_type(SubscriptionUpdateFixedFeeQuantityResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) @parametrize async def test_raw_response_update_fixed_fee_quantity(self, async_client: AsyncOrb) -> None: @@ -2245,7 +2235,7 @@ async def test_raw_response_update_fixed_fee_quantity(self, async_client: AsyncO assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SubscriptionUpdateFixedFeeQuantityResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) @parametrize async def test_streaming_response_update_fixed_fee_quantity(self, async_client: AsyncOrb) -> None: @@ -2258,7 +2248,7 @@ async def test_streaming_response_update_fixed_fee_quantity(self, async_client: assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(SubscriptionUpdateFixedFeeQuantityResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2277,7 +2267,7 @@ async def test_method_update_trial(self, async_client: AsyncOrb) -> None: subscription_id="subscription_id", trial_end_date=parse_datetime("2017-07-21T17:32:28Z"), ) - assert_matches_type(SubscriptionUpdateTrialResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) @parametrize async def test_method_update_trial_with_all_params(self, async_client: AsyncOrb) -> None: @@ -2286,7 +2276,7 @@ async def test_method_update_trial_with_all_params(self, async_client: AsyncOrb) trial_end_date=parse_datetime("2017-07-21T17:32:28Z"), shift=True, ) - assert_matches_type(SubscriptionUpdateTrialResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) @parametrize async def test_raw_response_update_trial(self, async_client: AsyncOrb) -> None: @@ -2298,7 +2288,7 @@ async def test_raw_response_update_trial(self, async_client: AsyncOrb) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SubscriptionUpdateTrialResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) @parametrize async def test_streaming_response_update_trial(self, async_client: AsyncOrb) -> None: @@ -2310,7 +2300,7 @@ async def test_streaming_response_update_trial(self, async_client: AsyncOrb) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(SubscriptionUpdateTrialResponse, subscription, path=["response"]) + assert_matches_type(MutatedSubscriptionModel, subscription, path=["response"]) assert cast(Any, response.is_closed) is True From 0d9fcf47ac501eabc8525da5caa76ff2072b0333 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 5 Mar 2025 02:51:31 +0000 Subject: [PATCH 4/4] release: 3.11.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 14 ++++++++++++++ pyproject.toml | 2 +- src/orb/_version.py | 2 +- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 25709d1b..940f2ca3 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "3.10.0" + ".": "3.11.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ed609d5..1137a571 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## 3.11.0 (2025-03-05) + +Full Changelog: [v3.10.0...v3.11.0](https://github.com/orbcorp/orb-python/compare/v3.10.0...v3.11.0) + +### Features + +* **api:** api update ([#567](https://github.com/orbcorp/orb-python/issues/567)) ([247a81c](https://github.com/orbcorp/orb-python/commit/247a81c8582c9aebb0787789426b1454d16f1134)) + + +### Chores + +* **internal:** codegen related update ([#564](https://github.com/orbcorp/orb-python/issues/564)) ([03b058d](https://github.com/orbcorp/orb-python/commit/03b058d6125ca84365fe4622432a9ada74aa288f)) +* **internal:** remove unused http client options forwarding ([#566](https://github.com/orbcorp/orb-python/issues/566)) ([aa7b3cf](https://github.com/orbcorp/orb-python/commit/aa7b3cf321a322150f12014674d914f2aa4a3c1e)) + ## 3.10.0 (2025-03-01) Full Changelog: [v3.9.0...v3.10.0](https://github.com/orbcorp/orb-python/compare/v3.9.0...v3.10.0) diff --git a/pyproject.toml b/pyproject.toml index fe770b38..f94db758 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "orb-billing" -version = "3.10.0" +version = "3.11.0" description = "The official Python library for the orb API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/orb/_version.py b/src/orb/_version.py index 393cacd0..c8a9a1dd 100644 --- a/src/orb/_version.py +++ b/src/orb/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "orb" -__version__ = "3.10.0" # x-release-please-version +__version__ = "3.11.0" # x-release-please-version