diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 163049e5..03276cfb 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "4.11.1" + ".": "4.12.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 69ee938b..5c39bf21 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 118 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-4f31d46f5ba187fc4d702c9f9f1573dacb891edbd086f935707578d7c4f5fed8.yml -openapi_spec_hash: 25b1019f20a47b8af665aae5f8fd0025 -config_hash: d8a0d696f3250ab096fac87b6b0eab53 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-6b2550b95f82872b3825619c109352352b9c92281c8b2470fce158e971142881.yml +openapi_spec_hash: 379df18de1af6a9d0b50d3653aab4d44 +config_hash: 1f73a949b649ecfe6ec68ba1bb459dc2 diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c66c909..27124322 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,26 @@ # Changelog +## 4.12.0 (2025-09-03) + +Full Changelog: [v4.11.1...v4.12.0](https://github.com/orbcorp/orb-python/compare/v4.11.1...v4.12.0) + +### ⚠ BREAKING CHANGES + +* **api:** define shared model ConversionRateConfig + +### Features + +* **api:** api update ([9f4c932](https://github.com/orbcorp/orb-python/commit/9f4c9321d5fd23eafbca5a91411976d1ea73fc1c)) +* **api:** define shared model ConversionRateConfig ([fe3cedb](https://github.com/orbcorp/orb-python/commit/fe3cedb638aeda208d325e7ea78d7db90f596857)) +* extract minimum composite to type ([4dba245](https://github.com/orbcorp/orb-python/commit/4dba2455ca1d390b7079a462cc03dddc2ce89b01)) +* **types:** replace List[str] with SequenceNotStr in params ([7a4eb7b](https://github.com/orbcorp/orb-python/commit/7a4eb7bcce5a2db055a7bfa27b074311c310aecc)) + + +### Chores + +* **internal:** add Sequence related utils ([8427f8a](https://github.com/orbcorp/orb-python/commit/8427f8ae3bb00a9af89dd42b5c70479452350070)) +* **internal:** codegen related update ([4a2abd9](https://github.com/orbcorp/orb-python/commit/4a2abd95d4b6771171ca0f7de99a390c8b268dd9)) + ## 4.11.1 (2025-08-29) Full Changelog: [v4.11.0...v4.11.1](https://github.com/orbcorp/orb-python/compare/v4.11.0...v4.11.1) diff --git a/api.md b/api.md index 3168f9f2..46581a39 100644 --- a/api.md +++ b/api.md @@ -12,10 +12,6 @@ from orb.types import ( BillingCycleAnchorConfiguration, BillingCycleConfiguration, BillingCycleRelativeDate, - BPSConfig, - BPSTier, - BulkBPSConfig, - BulkBPSTier, BulkConfig, BulkTier, ChangedSubscriptionResources, @@ -53,8 +49,6 @@ from orb.types import ( NewAmountDiscount, NewBillingCycleConfiguration, NewDimensionalPriceConfiguration, - NewFloatingBPSPrice, - NewFloatingBulkBPSPrice, NewFloatingBulkPrice, NewFloatingBulkWithProrationPrice, NewFloatingCumulativeGroupedBulkPrice, @@ -67,12 +61,12 @@ from orb.types import ( NewFloatingMatrixWithAllocationPrice, NewFloatingMatrixWithDisplayNamePrice, NewFloatingMaxGroupTieredPackagePrice, + NewFloatingMinimumCompositePrice, NewFloatingPackagePrice, NewFloatingPackageWithAllocationPrice, NewFloatingScalableMatrixWithTieredPricingPrice, NewFloatingScalableMatrixWithUnitPricingPrice, NewFloatingThresholdTotalAmountPrice, - NewFloatingTieredBPSPrice, NewFloatingTieredPackagePrice, NewFloatingTieredPackageWithMinimumPrice, NewFloatingTieredPrice, @@ -84,8 +78,6 @@ from orb.types import ( NewMaximum, NewMinimum, NewPercentageDiscount, - NewPlanBPSPrice, - NewPlanBulkBPSPrice, NewPlanBulkPrice, NewPlanBulkWithProrationPrice, NewPlanCumulativeGroupedBulkPrice, @@ -98,13 +90,13 @@ from orb.types import ( NewPlanMatrixWithAllocationPrice, NewPlanMatrixWithDisplayNamePrice, NewPlanMaxGroupTieredPackagePrice, + NewPlanMinimumCompositePrice, NewPlanPackagePrice, NewPlanPackageWithAllocationPrice, NewPlanScalableMatrixWithTieredPricingPrice, NewPlanScalableMatrixWithUnitPricingPrice, NewPlanThresholdTotalAmountPrice, NewPlanTierWithProrationPrice, - NewPlanTieredBPSPrice, NewPlanTieredPackagePrice, NewPlanTieredPackageWithMinimumPrice, NewPlanTieredPrice, @@ -135,7 +127,6 @@ from orb.types import ( Tier, TierConfig, TierSubLineItem, - TieredBPSConfig, TieredConfig, TieredConversionRateConfig, TransformPriceFilter, @@ -506,8 +497,6 @@ Types: ```python from orb.types import ( DiscountOverride, - NewSubscriptionBPSPrice, - NewSubscriptionBulkBPSPrice, NewSubscriptionBulkPrice, NewSubscriptionBulkWithProrationPrice, NewSubscriptionCumulativeGroupedBulkPrice, @@ -520,13 +509,13 @@ from orb.types import ( NewSubscriptionMatrixWithAllocationPrice, NewSubscriptionMatrixWithDisplayNamePrice, NewSubscriptionMaxGroupTieredPackagePrice, + NewSubscriptionMinimumCompositePrice, NewSubscriptionPackagePrice, NewSubscriptionPackageWithAllocationPrice, NewSubscriptionScalableMatrixWithTieredPricingPrice, NewSubscriptionScalableMatrixWithUnitPricingPrice, NewSubscriptionThresholdTotalAmountPrice, NewSubscriptionTierWithProrationPrice, - NewSubscriptionTieredBPSPrice, NewSubscriptionTieredPackagePrice, NewSubscriptionTieredPackageWithMinimumPrice, NewSubscriptionTieredPrice, diff --git a/pyproject.toml b/pyproject.toml index a321e6d9..362f2c31 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "orb-billing" -version = "4.11.1" +version = "4.12.0" description = "The official Python library for the orb API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/orb/_types.py b/src/orb/_types.py index 545d7960..f0ca0275 100644 --- a/src/orb/_types.py +++ b/src/orb/_types.py @@ -13,10 +13,21 @@ Mapping, TypeVar, Callable, + Iterator, Optional, Sequence, ) -from typing_extensions import Set, Literal, Protocol, TypeAlias, TypedDict, override, runtime_checkable +from typing_extensions import ( + Set, + Literal, + Protocol, + TypeAlias, + TypedDict, + SupportsIndex, + overload, + override, + runtime_checkable, +) import httpx import pydantic @@ -219,3 +230,26 @@ class _GenericAlias(Protocol): class HttpxSendArgs(TypedDict, total=False): auth: httpx.Auth follow_redirects: bool + + +_T_co = TypeVar("_T_co", covariant=True) + + +if TYPE_CHECKING: + # This works because str.__contains__ does not accept object (either in typeshed or at runtime) + # https://github.com/hauntsaninja/useful_types/blob/5e9710f3875107d068e7679fd7fec9cfab0eff3b/useful_types/__init__.py#L285 + class SequenceNotStr(Protocol[_T_co]): + @overload + def __getitem__(self, index: SupportsIndex, /) -> _T_co: ... + @overload + def __getitem__(self, index: slice, /) -> Sequence[_T_co]: ... + def __contains__(self, value: object, /) -> bool: ... + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[_T_co]: ... + def index(self, value: Any, start: int = 0, stop: int = ..., /) -> int: ... + def count(self, value: Any, /) -> int: ... + def __reversed__(self) -> Iterator[_T_co]: ... +else: + # just point this to a normal `Sequence` at runtime to avoid having to special case + # deserializing our custom sequence type + SequenceNotStr = Sequence diff --git a/src/orb/_utils/__init__.py b/src/orb/_utils/__init__.py index d4fda26f..ca547ce5 100644 --- a/src/orb/_utils/__init__.py +++ b/src/orb/_utils/__init__.py @@ -38,6 +38,7 @@ extract_type_arg as extract_type_arg, is_iterable_type as is_iterable_type, is_required_type as is_required_type, + is_sequence_type as is_sequence_type, is_annotated_type as is_annotated_type, is_type_alias_type as is_type_alias_type, strip_annotated_type as strip_annotated_type, diff --git a/src/orb/_utils/_transform.py b/src/orb/_utils/_transform.py index b0cc20a7..f0bcefd4 100644 --- a/src/orb/_utils/_transform.py +++ b/src/orb/_utils/_transform.py @@ -16,6 +16,7 @@ lru_cache, is_mapping, is_iterable, + is_sequence, ) from .._files import is_base64_file_input from ._typing import ( @@ -24,6 +25,7 @@ extract_type_arg, is_iterable_type, is_required_type, + is_sequence_type, is_annotated_type, strip_annotated_type, ) @@ -184,6 +186,8 @@ def _transform_recursive( (is_list_type(stripped_type) and is_list(data)) # Iterable[T] or (is_iterable_type(stripped_type) and is_iterable(data) and not isinstance(data, str)) + # Sequence[T] + or (is_sequence_type(stripped_type) and is_sequence(data) and not isinstance(data, str)) ): # dicts are technically iterable, but it is an iterable on the keys of the dict and is not usually # intended as an iterable, so we don't transform it. @@ -346,6 +350,8 @@ async def _async_transform_recursive( (is_list_type(stripped_type) and is_list(data)) # Iterable[T] or (is_iterable_type(stripped_type) and is_iterable(data) and not isinstance(data, str)) + # Sequence[T] + or (is_sequence_type(stripped_type) and is_sequence(data) and not isinstance(data, str)) ): # dicts are technically iterable, but it is an iterable on the keys of the dict and is not usually # intended as an iterable, so we don't transform it. diff --git a/src/orb/_utils/_typing.py b/src/orb/_utils/_typing.py index 1bac9542..845cd6b2 100644 --- a/src/orb/_utils/_typing.py +++ b/src/orb/_utils/_typing.py @@ -26,6 +26,11 @@ def is_list_type(typ: type) -> bool: return (get_origin(typ) or typ) == list +def is_sequence_type(typ: type) -> bool: + origin = get_origin(typ) or typ + return origin == typing_extensions.Sequence or origin == typing.Sequence or origin == _c_abc.Sequence + + def is_iterable_type(typ: type) -> bool: """If the given type is `typing.Iterable[T]`""" origin = get_origin(typ) or typ diff --git a/src/orb/_version.py b/src/orb/_version.py index 8aab10f6..1dea7b44 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__ = "4.11.1" # x-release-please-version +__version__ = "4.12.0" # x-release-please-version diff --git a/src/orb/resources/alerts.py b/src/orb/resources/alerts.py index bf2c62a4..ed1e43fd 100644 --- a/src/orb/resources/alerts.py +++ b/src/orb/resources/alerts.py @@ -155,7 +155,7 @@ def list( The request must specify one of `customer_id`, `external_customer_id`, or `subscription_id`. - If querying by subscripion_id, the endpoint will return the subscription level + If querying by subscription_id, the endpoint will return the subscription level alerts as well as the plan level alerts associated with the subscription. The list of alerts is ordered starting from the most recently created alert. @@ -630,7 +630,7 @@ def list( The request must specify one of `customer_id`, `external_customer_id`, or `subscription_id`. - If querying by subscripion_id, the endpoint will return the subscription level + If querying by subscription_id, the endpoint will return the subscription level alerts as well as the plan level alerts associated with the subscription. The list of alerts is ordered starting from the most recently created alert. diff --git a/src/orb/resources/customers/credits/ledger.py b/src/orb/resources/customers/credits/ledger.py index f82310d6..a8951af5 100644 --- a/src/orb/resources/customers/credits/ledger.py +++ b/src/orb/resources/customers/credits/ledger.py @@ -142,7 +142,7 @@ def list( Note that for this entry type, `starting_balance` will equal `ending_balance`, and the `amount` represents the balance transferred. The credit block linked to the ledger entry is the source credit block from which there was an expiration - change + change. ## Credits expiry @@ -2088,7 +2088,7 @@ def list_by_external_id( Note that for this entry type, `starting_balance` will equal `ending_balance`, and the `amount` represents the balance transferred. The credit block linked to the ledger entry is the source credit block from which there was an expiration - change + change. ## Credits expiry @@ -2273,7 +2273,7 @@ def list( Note that for this entry type, `starting_balance` will equal `ending_balance`, and the `amount` represents the balance transferred. The credit block linked to the ledger entry is the source credit block from which there was an expiration - change + change. ## Credits expiry @@ -4219,7 +4219,7 @@ def list_by_external_id( Note that for this entry type, `starting_balance` will equal `ending_balance`, and the `amount` represents the balance transferred. The credit block linked to the ledger entry is the source credit block from which there was an expiration - change + change. ## Credits expiry diff --git a/src/orb/resources/customers/customers.py b/src/orb/resources/customers/customers.py index 446b4818..b50ad5c1 100644 --- a/src/orb/resources/customers/customers.py +++ b/src/orb/resources/customers/customers.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Dict, List, Union, Optional +from typing import Dict, Union, Optional from datetime import datetime from typing_extensions import Literal @@ -23,7 +23,7 @@ customer_update_params, customer_update_by_external_id_params, ) -from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven +from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven, SequenceNotStr from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -94,8 +94,9 @@ def create( email: str, name: str, accounting_sync_configuration: Optional[NewAccountingSyncConfigurationParam] | NotGiven = NOT_GIVEN, - additional_emails: Optional[List[str]] | NotGiven = NOT_GIVEN, + additional_emails: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, auto_collection: Optional[bool] | NotGiven = NOT_GIVEN, + auto_issuance: Optional[bool] | NotGiven = NOT_GIVEN, billing_address: Optional[AddressInputParam] | NotGiven = NOT_GIVEN, currency: Optional[str] | NotGiven = NOT_GIVEN, email_delivery: Optional[bool] | NotGiven = NOT_GIVEN, @@ -146,6 +147,11 @@ def create( charge a saved payment method, if available. This parameter defaults to `True` when a payment provider is provided on customer creation. + auto_issuance: Used to determine if invoices for this customer will be automatically issued. If + true, invoices will be automatically issued. If false, invoices will require + manual approval. If `null` is specified, the customer's auto issuance setting + will be inherited from the account-level setting. + currency: 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. @@ -334,6 +340,7 @@ def create( "accounting_sync_configuration": accounting_sync_configuration, "additional_emails": additional_emails, "auto_collection": auto_collection, + "auto_issuance": auto_issuance, "billing_address": billing_address, "currency": currency, "email_delivery": email_delivery, @@ -365,8 +372,9 @@ def update( customer_id: str, *, accounting_sync_configuration: Optional[NewAccountingSyncConfigurationParam] | NotGiven = NOT_GIVEN, - additional_emails: Optional[List[str]] | NotGiven = NOT_GIVEN, + additional_emails: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, auto_collection: Optional[bool] | NotGiven = NOT_GIVEN, + auto_issuance: Optional[bool] | NotGiven = NOT_GIVEN, billing_address: Optional[AddressInputParam] | NotGiven = NOT_GIVEN, currency: Optional[str] | NotGiven = NOT_GIVEN, email: Optional[str] | NotGiven = NOT_GIVEN, @@ -405,6 +413,11 @@ def update( charge a saved payment method, if available. This parameter defaults to `True` when a payment provider is provided on customer creation. + auto_issuance: Used to determine if invoices for this customer will be automatically issued. If + true, invoices will be automatically issued. If false, invoices will require + manual approval.If `null` is specified, the customer's auto issuance setting + will be inherited from the account-level setting. + currency: 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. @@ -599,6 +612,7 @@ def update( "accounting_sync_configuration": accounting_sync_configuration, "additional_emails": additional_emails, "auto_collection": auto_collection, + "auto_issuance": auto_issuance, "billing_address": billing_address, "currency": currency, "email": email, @@ -917,8 +931,9 @@ def update_by_external_id( id: str, *, accounting_sync_configuration: Optional[NewAccountingSyncConfigurationParam] | NotGiven = NOT_GIVEN, - additional_emails: Optional[List[str]] | NotGiven = NOT_GIVEN, + additional_emails: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, auto_collection: Optional[bool] | NotGiven = NOT_GIVEN, + auto_issuance: Optional[bool] | NotGiven = NOT_GIVEN, billing_address: Optional[AddressInputParam] | NotGiven = NOT_GIVEN, currency: Optional[str] | NotGiven = NOT_GIVEN, email: Optional[str] | NotGiven = NOT_GIVEN, @@ -956,6 +971,11 @@ def update_by_external_id( charge a saved payment method, if available. This parameter defaults to `True` when a payment provider is provided on customer creation. + auto_issuance: Used to determine if invoices for this customer will be automatically issued. If + true, invoices will be automatically issued. If false, invoices will require + manual approval.If `null` is specified, the customer's auto issuance setting + will be inherited from the account-level setting. + currency: 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. @@ -1150,6 +1170,7 @@ def update_by_external_id( "accounting_sync_configuration": accounting_sync_configuration, "additional_emails": additional_emails, "auto_collection": auto_collection, + "auto_issuance": auto_issuance, "billing_address": billing_address, "currency": currency, "email": email, @@ -1216,8 +1237,9 @@ async def create( email: str, name: str, accounting_sync_configuration: Optional[NewAccountingSyncConfigurationParam] | NotGiven = NOT_GIVEN, - additional_emails: Optional[List[str]] | NotGiven = NOT_GIVEN, + additional_emails: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, auto_collection: Optional[bool] | NotGiven = NOT_GIVEN, + auto_issuance: Optional[bool] | NotGiven = NOT_GIVEN, billing_address: Optional[AddressInputParam] | NotGiven = NOT_GIVEN, currency: Optional[str] | NotGiven = NOT_GIVEN, email_delivery: Optional[bool] | NotGiven = NOT_GIVEN, @@ -1268,6 +1290,11 @@ async def create( charge a saved payment method, if available. This parameter defaults to `True` when a payment provider is provided on customer creation. + auto_issuance: Used to determine if invoices for this customer will be automatically issued. If + true, invoices will be automatically issued. If false, invoices will require + manual approval. If `null` is specified, the customer's auto issuance setting + will be inherited from the account-level setting. + currency: 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. @@ -1456,6 +1483,7 @@ async def create( "accounting_sync_configuration": accounting_sync_configuration, "additional_emails": additional_emails, "auto_collection": auto_collection, + "auto_issuance": auto_issuance, "billing_address": billing_address, "currency": currency, "email_delivery": email_delivery, @@ -1487,8 +1515,9 @@ async def update( customer_id: str, *, accounting_sync_configuration: Optional[NewAccountingSyncConfigurationParam] | NotGiven = NOT_GIVEN, - additional_emails: Optional[List[str]] | NotGiven = NOT_GIVEN, + additional_emails: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, auto_collection: Optional[bool] | NotGiven = NOT_GIVEN, + auto_issuance: Optional[bool] | NotGiven = NOT_GIVEN, billing_address: Optional[AddressInputParam] | NotGiven = NOT_GIVEN, currency: Optional[str] | NotGiven = NOT_GIVEN, email: Optional[str] | NotGiven = NOT_GIVEN, @@ -1527,6 +1556,11 @@ async def update( charge a saved payment method, if available. This parameter defaults to `True` when a payment provider is provided on customer creation. + auto_issuance: Used to determine if invoices for this customer will be automatically issued. If + true, invoices will be automatically issued. If false, invoices will require + manual approval.If `null` is specified, the customer's auto issuance setting + will be inherited from the account-level setting. + currency: 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. @@ -1721,6 +1755,7 @@ async def update( "accounting_sync_configuration": accounting_sync_configuration, "additional_emails": additional_emails, "auto_collection": auto_collection, + "auto_issuance": auto_issuance, "billing_address": billing_address, "currency": currency, "email": email, @@ -2039,8 +2074,9 @@ async def update_by_external_id( id: str, *, accounting_sync_configuration: Optional[NewAccountingSyncConfigurationParam] | NotGiven = NOT_GIVEN, - additional_emails: Optional[List[str]] | NotGiven = NOT_GIVEN, + additional_emails: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, auto_collection: Optional[bool] | NotGiven = NOT_GIVEN, + auto_issuance: Optional[bool] | NotGiven = NOT_GIVEN, billing_address: Optional[AddressInputParam] | NotGiven = NOT_GIVEN, currency: Optional[str] | NotGiven = NOT_GIVEN, email: Optional[str] | NotGiven = NOT_GIVEN, @@ -2078,6 +2114,11 @@ async def update_by_external_id( charge a saved payment method, if available. This parameter defaults to `True` when a payment provider is provided on customer creation. + auto_issuance: Used to determine if invoices for this customer will be automatically issued. If + true, invoices will be automatically issued. If false, invoices will require + manual approval.If `null` is specified, the customer's auto issuance setting + will be inherited from the account-level setting. + currency: 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. @@ -2272,6 +2313,7 @@ async def update_by_external_id( "accounting_sync_configuration": accounting_sync_configuration, "additional_emails": additional_emails, "auto_collection": auto_collection, + "auto_issuance": auto_issuance, "billing_address": billing_address, "currency": currency, "email": email, 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 d82a2b47..8c2cb8c6 100644 --- a/src/orb/resources/dimensional_price_groups/dimensional_price_groups.py +++ b/src/orb/resources/dimensional_price_groups/dimensional_price_groups.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Dict, List, Optional +from typing import Dict, Optional import httpx @@ -12,7 +12,7 @@ dimensional_price_group_create_params, dimensional_price_group_update_params, ) -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -60,7 +60,7 @@ def create( self, *, billable_metric_id: str, - dimensions: List[str], + dimensions: SequenceNotStr[str], name: str, external_dimensional_price_group_id: Optional[str] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, @@ -74,7 +74,7 @@ def create( ) -> DimensionalPriceGroup: """ 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 + by a set of dimensions. Prices in a price group must specify the partition used to derive their usage. For example, suppose we have a billable metric that measures the number of @@ -296,7 +296,7 @@ async def create( self, *, billable_metric_id: str, - dimensions: List[str], + dimensions: SequenceNotStr[str], name: str, external_dimensional_price_group_id: Optional[str] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, @@ -310,7 +310,7 @@ async def create( ) -> DimensionalPriceGroup: """ 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 + by a set of dimensions. Prices in a price group must specify the partition used to derive their usage. For example, suppose we have a billable metric that measures the number of diff --git a/src/orb/resources/events/backfills.py b/src/orb/resources/events/backfills.py index bcec768d..75dfb4ca 100644 --- a/src/orb/resources/events/backfills.py +++ b/src/orb/resources/events/backfills.py @@ -96,8 +96,8 @@ def create( When `replace_existing_events` is `true`, this indicates that existing events in the timeframe should no longer be counted towards invoiced usage. In this - scenario, the parameter `filter` can be optionally added which enables filtering - using + scenario, the parameter `deprecation_filter` can be optionally added which + enables filtering using [computed properties](/extensibility/advanced-metrics#computed-properties). The expressiveness of computed properties allows you to deprecate existing events based on both a period of time and specific property values. @@ -412,8 +412,8 @@ async def create( When `replace_existing_events` is `true`, this indicates that existing events in the timeframe should no longer be counted towards invoiced usage. In this - scenario, the parameter `filter` can be optionally added which enables filtering - using + scenario, the parameter `deprecation_filter` can be optionally added which + enables filtering using [computed properties](/extensibility/advanced-metrics#computed-properties). The expressiveness of computed properties allows you to deprecate existing events based on both a period of time and specific property values. diff --git a/src/orb/resources/events/events.py b/src/orb/resources/events/events.py index 619d6029..bf424356 100644 --- a/src/orb/resources/events/events.py +++ b/src/orb/resources/events/events.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Dict, List, Union, Iterable, Optional +from typing import Dict, Union, Iterable, Optional from datetime import datetime import httpx @@ -17,7 +17,7 @@ AsyncVolumeWithStreamingResponse, ) from ...types import event_ingest_params, event_search_params, event_update_params -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from .backfills import ( @@ -519,7 +519,7 @@ def ingest( def search( self, *, - event_ids: List[str], + event_ids: SequenceNotStr[str], timeframe_end: Union[str, datetime, None] | NotGiven = NOT_GIVEN, timeframe_start: Union[str, datetime, None] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1070,7 +1070,7 @@ async def ingest( async def search( self, *, - event_ids: List[str], + event_ids: SequenceNotStr[str], timeframe_end: Union[str, datetime, None] | NotGiven = NOT_GIVEN, timeframe_start: Union[str, datetime, None] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. diff --git a/src/orb/resources/invoices.py b/src/orb/resources/invoices.py index ed47e86d..fbeb4cc6 100644 --- a/src/orb/resources/invoices.py +++ b/src/orb/resources/invoices.py @@ -59,6 +59,7 @@ def create( line_items: Iterable[invoice_create_params.LineItem], customer_id: Optional[str] | NotGiven = NOT_GIVEN, discount: Optional[Discount] | NotGiven = NOT_GIVEN, + due_date: Union[Union[str, date], Union[str, datetime], None] | NotGiven = NOT_GIVEN, external_customer_id: Optional[str] | NotGiven = NOT_GIVEN, memo: Optional[str] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, @@ -87,19 +88,24 @@ def create( discount: An optional discount to attach to the invoice. + due_date: An optional custom due date for the invoice. If not set, the due date will be + calculated based on the `net_terms` value. + external_customer_id: The `external_customer_id` of the `Customer` to create this invoice for. One of `customer_id` and `external_customer_id` are required. - memo: An optional memo to attach to the invoice. + memo: An optional memo to attach to the invoice. If no memo is provided, we will + attach the default memo metadata: 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`. - net_terms: 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 - 30 days to pay the invoice. + net_terms: The net terms determines the due date of the invoice. Due date is calculated + based on the invoice or issuance date, depending on the account's configured due + date calculation method. A value of '0' here represents that the invoice is due + on issue, whereas a value of '30' represents that the customer has 30 days to + pay the invoice. Do not set this field if you want to set a custom due date. will_auto_issue: When true, this invoice will be submitted for issuance upon creation. When false, the resulting invoice will require manual review to issue. Defaulted to @@ -124,6 +130,7 @@ def create( "line_items": line_items, "customer_id": customer_id, "discount": discount, + "due_date": due_date, "external_customer_id": external_customer_id, "memo": memo, "metadata": metadata, @@ -146,7 +153,9 @@ def update( self, invoice_id: str, *, + due_date: Union[Union[str, date], Union[str, datetime], None] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, + net_terms: Optional[int] | 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, @@ -164,10 +173,19 @@ def update( `due_date` can only be modified if the invoice is in a `draft` state. Args: + due_date: An optional custom due date for the invoice. If not set, the due date will be + calculated based on the `net_terms` value. + metadata: 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`. + net_terms: The net terms determines the due date of the invoice. Due date is calculated + based on the invoice or issuance date, depending on the account's configured due + date calculation method. A value of '0' here represents that the invoice is due + on issue, whereas a value of '30' represents that the customer has 30 days to + pay the invoice. Do not set this field if you want to set a custom due date. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -182,7 +200,14 @@ def update( raise ValueError(f"Expected a non-empty value for `invoice_id` but received {invoice_id!r}") return self._put( f"/invoices/{invoice_id}", - body=maybe_transform({"metadata": metadata}, invoice_update_params.InvoiceUpdateParams), + body=maybe_transform( + { + "due_date": due_date, + "metadata": metadata, + "net_terms": net_terms, + }, + invoice_update_params.InvoiceUpdateParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -434,10 +459,10 @@ def mark_paid( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, ) -> Invoice: - """This endpoint allows an invoice's status to be set the `paid` status. + """This endpoint allows an invoice's status to be set to the `paid` status. - This can - only be done to invoices that are in the `issued` status. + This + can only be done to invoices that are in the `issued` or `synced` status. Args: payment_received_date: A date string to specify the date of the payment. @@ -531,10 +556,10 @@ def void( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, ) -> Invoice: - """This endpoint allows an invoice's status to be set the `void` status. + """This endpoint allows an invoice's status to be set to the `void` status. - This can - only be done to invoices that are in the `issued` status. + This + can only be done to invoices that are in the `issued` status. If the associated invoice has used the customer balance to change the amount due, the customer balance operation will be reverted. For example, if the @@ -599,6 +624,7 @@ async def create( line_items: Iterable[invoice_create_params.LineItem], customer_id: Optional[str] | NotGiven = NOT_GIVEN, discount: Optional[Discount] | NotGiven = NOT_GIVEN, + due_date: Union[Union[str, date], Union[str, datetime], None] | NotGiven = NOT_GIVEN, external_customer_id: Optional[str] | NotGiven = NOT_GIVEN, memo: Optional[str] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, @@ -627,19 +653,24 @@ async def create( discount: An optional discount to attach to the invoice. + due_date: An optional custom due date for the invoice. If not set, the due date will be + calculated based on the `net_terms` value. + external_customer_id: The `external_customer_id` of the `Customer` to create this invoice for. One of `customer_id` and `external_customer_id` are required. - memo: An optional memo to attach to the invoice. + memo: An optional memo to attach to the invoice. If no memo is provided, we will + attach the default memo metadata: 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`. - net_terms: 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 - 30 days to pay the invoice. + net_terms: The net terms determines the due date of the invoice. Due date is calculated + based on the invoice or issuance date, depending on the account's configured due + date calculation method. A value of '0' here represents that the invoice is due + on issue, whereas a value of '30' represents that the customer has 30 days to + pay the invoice. Do not set this field if you want to set a custom due date. will_auto_issue: When true, this invoice will be submitted for issuance upon creation. When false, the resulting invoice will require manual review to issue. Defaulted to @@ -664,6 +695,7 @@ async def create( "line_items": line_items, "customer_id": customer_id, "discount": discount, + "due_date": due_date, "external_customer_id": external_customer_id, "memo": memo, "metadata": metadata, @@ -686,7 +718,9 @@ async def update( self, invoice_id: str, *, + due_date: Union[Union[str, date], Union[str, datetime], None] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, + net_terms: Optional[int] | 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, @@ -704,10 +738,19 @@ async def update( `due_date` can only be modified if the invoice is in a `draft` state. Args: + due_date: An optional custom due date for the invoice. If not set, the due date will be + calculated based on the `net_terms` value. + metadata: 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`. + net_terms: The net terms determines the due date of the invoice. Due date is calculated + based on the invoice or issuance date, depending on the account's configured due + date calculation method. A value of '0' here represents that the invoice is due + on issue, whereas a value of '30' represents that the customer has 30 days to + pay the invoice. Do not set this field if you want to set a custom due date. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -722,7 +765,14 @@ async def update( raise ValueError(f"Expected a non-empty value for `invoice_id` but received {invoice_id!r}") return await self._put( f"/invoices/{invoice_id}", - body=await async_maybe_transform({"metadata": metadata}, invoice_update_params.InvoiceUpdateParams), + body=await async_maybe_transform( + { + "due_date": due_date, + "metadata": metadata, + "net_terms": net_terms, + }, + invoice_update_params.InvoiceUpdateParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -974,10 +1024,10 @@ async def mark_paid( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, ) -> Invoice: - """This endpoint allows an invoice's status to be set the `paid` status. + """This endpoint allows an invoice's status to be set to the `paid` status. - This can - only be done to invoices that are in the `issued` status. + This + can only be done to invoices that are in the `issued` or `synced` status. Args: payment_received_date: A date string to specify the date of the payment. @@ -1071,10 +1121,10 @@ async def void( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, ) -> Invoice: - """This endpoint allows an invoice's status to be set the `void` status. + """This endpoint allows an invoice's status to be set to the `void` status. - This can - only be done to invoices that are in the `issued` status. + This + can only be done to invoices that are in the `issued` status. If the associated invoice has used the customer balance to change the amount due, the customer balance operation will be reverted. For example, if the diff --git a/src/orb/resources/prices/prices.py b/src/orb/resources/prices/prices.py index 2c93ca17..d1f87cb8 100644 --- a/src/orb/resources/prices/prices.py +++ b/src/orb/resources/prices/prices.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Any, Dict, List, Union, Iterable, Optional, cast +from typing import Any, Dict, Union, Iterable, Optional, cast from datetime import datetime from typing_extensions import Literal, overload @@ -17,7 +17,7 @@ price_evaluate_multiple_params, price_evaluate_preview_events_params, ) -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr from ..._utils import required_args, maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -34,14 +34,11 @@ ) from ...types.shared.price import Price from ...types.price_evaluate_response import PriceEvaluateResponse -from ...types.shared_params.bps_config import BPSConfig from ...types.shared_params.bulk_config import BulkConfig from ...types.shared_params.unit_config import UnitConfig from ...types.shared_params.matrix_config import MatrixConfig from ...types.shared_params.tiered_config import TieredConfig from ...types.shared_params.package_config import PackageConfig -from ...types.shared_params.bulk_bps_config import BulkBPSConfig -from ...types.shared_params.tiered_bps_config import TieredBPSConfig from ...types.price_evaluate_multiple_response import PriceEvaluateMultipleResponse from ...types.price_evaluate_preview_events_response import PriceEvaluatePreviewEventsResponse from ...types.shared_params.matrix_with_allocation_config import MatrixWithAllocationConfig @@ -539,109 +536,17 @@ def create( def create( self, *, + bulk_config: BulkConfig, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, item_id: str, - model_type: Literal["tiered_bps"], - name: str, - tiered_bps_config: TieredBPSConfig, - billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, - billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfiguration] | NotGiven = NOT_GIVEN, - conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, - conversion_rate_config: Optional[price_create_params.NewFloatingTieredBPSPriceConversionRateConfig] - | NotGiven = NOT_GIVEN, - dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | 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[NewBillingCycleConfiguration] | 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. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - idempotency_key: str | None = None, - ) -> Price: - """ - 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 - associated with a specific plan and can instead be individually added to - subscriptions, including subscriptions on different plans. - - An `external_price_id` can be optionally specified as an alias to allow - ergonomic interaction with prices in the Orb API. - - See the [Price resource](/product-catalog/price-configuration) for the - specification of different price model configurations possible in this endpoint. - - Args: - cadence: The cadence to bill for this price on. - - currency: An ISO 4217 currency string for which this price is billed in. - - item_id: The id of the item the price will be associated with. - - name: The name of the price. - - billable_metric_id: The id of the billable metric for the price. Only needed if the price is - usage-based. - - billed_in_advance: 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: For custom cadence: specifies the duration of the billing period in days or - months. - - conversion_rate: The per unit conversion rate of the price currency to the invoicing currency. - - conversion_rate_config: The configuration for the rate of the price currency to the invoicing currency. - - dimensional_price_configuration: For dimensional price: specifies a price group and dimension values - - external_price_id: An alias for the price. - - fixed_price_quantity: If the Price represents a fixed cost, this represents the quantity of units - applied. - - invoice_grouping_key: The property used to group this price on an invoice - - invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. - If unspecified, a single invoice is produced per billing cycle. - - metadata: 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`. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - - idempotency_key: Specify a custom idempotency key for this request - """ - ... - - @overload - def create( - self, - *, - bps_config: BPSConfig, - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], - currency: str, - item_id: str, - model_type: Literal["bps"], + model_type: Literal["bulk"], name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, billing_cycle_configuration: Optional[NewBillingCycleConfiguration] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, - conversion_rate_config: Optional[price_create_params.NewFloatingBPSPriceConversionRateConfig] + conversion_rate_config: Optional[price_create_params.NewFloatingBulkPriceConversionRateConfig] | NotGiven = NOT_GIVEN, dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -723,17 +628,17 @@ def create( def create( self, *, - bulk_bps_config: BulkBPSConfig, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, item_id: str, - model_type: Literal["bulk_bps"], + model_type: Literal["threshold_total_amount"], name: str, + threshold_total_amount_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, billing_cycle_configuration: Optional[NewBillingCycleConfiguration] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, - conversion_rate_config: Optional[price_create_params.NewFloatingBulkBPSPriceConversionRateConfig] + conversion_rate_config: Optional[price_create_params.NewFloatingThresholdTotalAmountPriceConversionRateConfig] | NotGiven = NOT_GIVEN, dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -815,17 +720,17 @@ def create( def create( self, *, - bulk_config: BulkConfig, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, item_id: str, - model_type: Literal["bulk"], + model_type: Literal["tiered_package"], name: str, + tiered_package_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, billing_cycle_configuration: Optional[NewBillingCycleConfiguration] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, - conversion_rate_config: Optional[price_create_params.NewFloatingBulkPriceConversionRateConfig] + conversion_rate_config: Optional[price_create_params.NewFloatingTieredPackagePriceConversionRateConfig] | NotGiven = NOT_GIVEN, dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -909,15 +814,15 @@ def create( *, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, + grouped_tiered_config: Dict[str, object], item_id: str, - model_type: Literal["threshold_total_amount"], + model_type: Literal["grouped_tiered"], name: str, - threshold_total_amount_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, billing_cycle_configuration: Optional[NewBillingCycleConfiguration] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, - conversion_rate_config: Optional[price_create_params.NewFloatingThresholdTotalAmountPriceConversionRateConfig] + conversion_rate_config: Optional[price_create_params.NewFloatingGroupedTieredPriceConversionRateConfig] | NotGiven = NOT_GIVEN, dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -1002,14 +907,14 @@ def create( cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, item_id: str, - model_type: Literal["tiered_package"], + max_group_tiered_package_config: Dict[str, object], + model_type: Literal["max_group_tiered_package"], name: str, - tiered_package_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, billing_cycle_configuration: Optional[NewBillingCycleConfiguration] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, - conversion_rate_config: Optional[price_create_params.NewFloatingTieredPackagePriceConversionRateConfig] + conversion_rate_config: Optional[price_create_params.NewFloatingMaxGroupTieredPackagePriceConversionRateConfig] | NotGiven = NOT_GIVEN, dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -1093,15 +998,15 @@ def create( *, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, - grouped_tiered_config: Dict[str, object], item_id: str, - model_type: Literal["grouped_tiered"], + model_type: Literal["tiered_with_minimum"], name: str, + tiered_with_minimum_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, billing_cycle_configuration: Optional[NewBillingCycleConfiguration] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, - conversion_rate_config: Optional[price_create_params.NewFloatingGroupedTieredPriceConversionRateConfig] + conversion_rate_config: Optional[price_create_params.NewFloatingTieredWithMinimumPriceConversionRateConfig] | NotGiven = NOT_GIVEN, dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -1186,14 +1091,14 @@ 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], - model_type: Literal["max_group_tiered_package"], + model_type: Literal["package_with_allocation"], name: str, + package_with_allocation_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, billing_cycle_configuration: Optional[NewBillingCycleConfiguration] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, - conversion_rate_config: Optional[price_create_params.NewFloatingMaxGroupTieredPackagePriceConversionRateConfig] + conversion_rate_config: Optional[price_create_params.NewFloatingPackageWithAllocationPriceConversionRateConfig] | NotGiven = NOT_GIVEN, dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -1278,14 +1183,16 @@ def create( cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, item_id: str, - model_type: Literal["tiered_with_minimum"], + model_type: Literal["tiered_package_with_minimum"], name: str, - tiered_with_minimum_config: Dict[str, object], + tiered_package_with_minimum_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, billing_cycle_configuration: Optional[NewBillingCycleConfiguration] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, - conversion_rate_config: Optional[price_create_params.NewFloatingTieredWithMinimumPriceConversionRateConfig] + conversion_rate_config: Optional[ + price_create_params.NewFloatingTieredPackageWithMinimumPriceConversionRateConfig + ] | NotGiven = NOT_GIVEN, dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -1370,14 +1277,14 @@ def create( cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, item_id: str, - model_type: Literal["package_with_allocation"], + model_type: Literal["unit_with_percent"], name: str, - package_with_allocation_config: Dict[str, object], + unit_with_percent_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, billing_cycle_configuration: Optional[NewBillingCycleConfiguration] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, - conversion_rate_config: Optional[price_create_params.NewFloatingPackageWithAllocationPriceConversionRateConfig] + conversion_rate_config: Optional[price_create_params.NewFloatingUnitWithPercentPriceConversionRateConfig] | NotGiven = NOT_GIVEN, dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -1462,16 +1369,14 @@ def create( cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, item_id: str, - model_type: Literal["tiered_package_with_minimum"], + model_type: Literal["tiered_with_proration"], name: str, - tiered_package_with_minimum_config: Dict[str, object], + tiered_with_proration_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, billing_cycle_configuration: Optional[NewBillingCycleConfiguration] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, - conversion_rate_config: Optional[ - price_create_params.NewFloatingTieredPackageWithMinimumPriceConversionRateConfig - ] + conversion_rate_config: Optional[price_create_params.NewFloatingTieredWithProrationPriceConversionRateConfig] | NotGiven = NOT_GIVEN, dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -1556,14 +1461,14 @@ def create( cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, item_id: str, - model_type: Literal["unit_with_percent"], + model_type: Literal["unit_with_proration"], name: str, - unit_with_percent_config: Dict[str, object], + unit_with_proration_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, billing_cycle_configuration: Optional[NewBillingCycleConfiguration] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, - conversion_rate_config: Optional[price_create_params.NewFloatingUnitWithPercentPriceConversionRateConfig] + conversion_rate_config: Optional[price_create_params.NewFloatingUnitWithProrationPriceConversionRateConfig] | NotGiven = NOT_GIVEN, dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -1647,15 +1552,15 @@ def create( *, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, + grouped_allocation_config: Dict[str, object], item_id: str, - model_type: Literal["tiered_with_proration"], + model_type: Literal["grouped_allocation"], name: str, - tiered_with_proration_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, billing_cycle_configuration: Optional[NewBillingCycleConfiguration] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, - conversion_rate_config: Optional[price_create_params.NewFloatingTieredWithProrationPriceConversionRateConfig] + conversion_rate_config: Optional[price_create_params.NewFloatingGroupedAllocationPriceConversionRateConfig] | NotGiven = NOT_GIVEN, dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -1739,15 +1644,17 @@ def create( *, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, + grouped_with_prorated_minimum_config: Dict[str, object], item_id: str, - model_type: Literal["unit_with_proration"], + model_type: Literal["grouped_with_prorated_minimum"], name: str, - unit_with_proration_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, billing_cycle_configuration: Optional[NewBillingCycleConfiguration] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, - conversion_rate_config: Optional[price_create_params.NewFloatingUnitWithProrationPriceConversionRateConfig] + conversion_rate_config: Optional[ + price_create_params.NewFloatingGroupedWithProratedMinimumPriceConversionRateConfig + ] | NotGiven = NOT_GIVEN, dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -1831,15 +1738,17 @@ def create( *, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, - grouped_allocation_config: Dict[str, object], + grouped_with_metered_minimum_config: Dict[str, object], item_id: str, - model_type: Literal["grouped_allocation"], + 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[NewBillingCycleConfiguration] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, - conversion_rate_config: Optional[price_create_params.NewFloatingGroupedAllocationPriceConversionRateConfig] + conversion_rate_config: Optional[ + price_create_params.NewFloatingGroupedWithMeteredMinimumPriceConversionRateConfig + ] | NotGiven = NOT_GIVEN, dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -1923,17 +1832,15 @@ def create( *, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, - grouped_with_prorated_minimum_config: Dict[str, object], item_id: str, - model_type: Literal["grouped_with_prorated_minimum"], + matrix_with_display_name_config: Dict[str, object], + 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[NewBillingCycleConfiguration] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, - conversion_rate_config: Optional[ - price_create_params.NewFloatingGroupedWithProratedMinimumPriceConversionRateConfig - ] + conversion_rate_config: Optional[price_create_params.NewFloatingMatrixWithDisplayNamePriceConversionRateConfig] | NotGiven = NOT_GIVEN, dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -2015,19 +1922,17 @@ def create( def create( self, *, + bulk_with_proration_config: Dict[str, object], cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, - grouped_with_metered_minimum_config: Dict[str, object], item_id: str, - model_type: Literal["grouped_with_metered_minimum"], + model_type: Literal["bulk_with_proration"], name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, billing_cycle_configuration: Optional[NewBillingCycleConfiguration] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, - conversion_rate_config: Optional[ - price_create_params.NewFloatingGroupedWithMeteredMinimumPriceConversionRateConfig - ] + conversion_rate_config: Optional[price_create_params.NewFloatingBulkWithProrationPriceConversionRateConfig] | NotGiven = NOT_GIVEN, dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -2111,15 +2016,15 @@ def create( *, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, + grouped_tiered_package_config: Dict[str, object], item_id: str, - matrix_with_display_name_config: Dict[str, object], - model_type: Literal["matrix_with_display_name"], + 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[NewBillingCycleConfiguration] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, - conversion_rate_config: Optional[price_create_params.NewFloatingMatrixWithDisplayNamePriceConversionRateConfig] + conversion_rate_config: Optional[price_create_params.NewFloatingGroupedTieredPackagePriceConversionRateConfig] | NotGiven = NOT_GIVEN, dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -2201,17 +2106,19 @@ def create( def create( self, *, - bulk_with_proration_config: Dict[str, object], cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, item_id: str, - model_type: Literal["bulk_with_proration"], + model_type: Literal["scalable_matrix_with_unit_pricing"], name: str, + scalable_matrix_with_unit_pricing_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, billing_cycle_configuration: Optional[NewBillingCycleConfiguration] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, - conversion_rate_config: Optional[price_create_params.NewFloatingBulkWithProrationPriceConversionRateConfig] + conversion_rate_config: Optional[ + price_create_params.NewFloatingScalableMatrixWithUnitPricingPriceConversionRateConfig + ] | NotGiven = NOT_GIVEN, dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -2295,15 +2202,17 @@ def create( *, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, - grouped_tiered_package_config: Dict[str, object], item_id: str, - model_type: Literal["grouped_tiered_package"], + model_type: Literal["scalable_matrix_with_tiered_pricing"], name: str, + scalable_matrix_with_tiered_pricing_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, billing_cycle_configuration: Optional[NewBillingCycleConfiguration] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, - conversion_rate_config: Optional[price_create_params.NewFloatingGroupedTieredPackagePriceConversionRateConfig] + conversion_rate_config: Optional[ + price_create_params.NewFloatingScalableMatrixWithTieredPricingPriceConversionRateConfig + ] | NotGiven = NOT_GIVEN, dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -2386,18 +2295,16 @@ def create( self, *, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], + cumulative_grouped_bulk_config: Dict[str, object], currency: str, item_id: str, - model_type: Literal["scalable_matrix_with_unit_pricing"], + model_type: Literal["cumulative_grouped_bulk"], name: str, - scalable_matrix_with_unit_pricing_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, billing_cycle_configuration: Optional[NewBillingCycleConfiguration] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, - conversion_rate_config: Optional[ - price_create_params.NewFloatingScalableMatrixWithUnitPricingPriceConversionRateConfig - ] + conversion_rate_config: Optional[price_create_params.NewFloatingCumulativeGroupedBulkPriceConversionRateConfig] | NotGiven = NOT_GIVEN, dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -2481,16 +2388,16 @@ def create( *, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, + grouped_with_min_max_thresholds_config: Dict[str, object], item_id: str, - model_type: Literal["scalable_matrix_with_tiered_pricing"], + model_type: Literal["grouped_with_min_max_thresholds"], name: str, - scalable_matrix_with_tiered_pricing_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, billing_cycle_configuration: Optional[NewBillingCycleConfiguration] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, conversion_rate_config: Optional[ - price_create_params.NewFloatingScalableMatrixWithTieredPricingPriceConversionRateConfig + price_create_params.NewFloatingGroupedWithMinMaxThresholdsPriceConversionRateConfig ] | NotGiven = NOT_GIVEN, dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | NotGiven = NOT_GIVEN, @@ -2574,16 +2481,16 @@ def create( self, *, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], - cumulative_grouped_bulk_config: Dict[str, object], currency: str, item_id: str, - model_type: Literal["cumulative_grouped_bulk"], + minimum_config: price_create_params.NewFloatingMinimumCompositePriceMinimumConfig, + model_type: Literal["minimum"], name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, billing_cycle_configuration: Optional[NewBillingCycleConfiguration] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, - conversion_rate_config: Optional[price_create_params.NewFloatingCumulativeGroupedBulkPriceConversionRateConfig] + conversion_rate_config: Optional[price_create_params.NewFloatingMinimumCompositePriceConversionRateConfig] | NotGiven = NOT_GIVEN, dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -2667,9 +2574,6 @@ def create( ["cadence", "currency", "item_id", "matrix_config", "model_type", "name"], ["cadence", "currency", "item_id", "matrix_with_allocation_config", "model_type", "name"], ["cadence", "currency", "item_id", "model_type", "name", "tiered_config"], - ["cadence", "currency", "item_id", "model_type", "name", "tiered_bps_config"], - ["bps_config", "cadence", "currency", "item_id", "model_type", "name"], - ["bulk_bps_config", "cadence", "currency", "item_id", "model_type", "name"], ["bulk_config", "cadence", "currency", "item_id", "model_type", "name"], ["cadence", "currency", "item_id", "model_type", "name", "threshold_total_amount_config"], ["cadence", "currency", "item_id", "model_type", "name", "tiered_package_config"], @@ -2690,6 +2594,8 @@ def create( ["cadence", "currency", "item_id", "model_type", "name", "scalable_matrix_with_unit_pricing_config"], ["cadence", "currency", "item_id", "model_type", "name", "scalable_matrix_with_tiered_pricing_config"], ["cadence", "cumulative_grouped_bulk_config", "currency", "item_id", "model_type", "name"], + ["cadence", "currency", "grouped_with_min_max_thresholds_config", "item_id", "model_type", "name"], + ["cadence", "currency", "item_id", "minimum_config", "model_type", "name"], ) def create( self, @@ -2702,9 +2608,6 @@ def create( | Literal["matrix"] | Literal["matrix_with_allocation"] | Literal["tiered"] - | Literal["tiered_bps"] - | Literal["bps"] - | Literal["bulk_bps"] | Literal["bulk"] | Literal["threshold_total_amount"] | Literal["tiered_package"] @@ -2724,7 +2627,9 @@ def create( | Literal["grouped_tiered_package"] | Literal["scalable_matrix_with_unit_pricing"] | Literal["scalable_matrix_with_tiered_pricing"] - | Literal["cumulative_grouped_bulk"], + | Literal["cumulative_grouped_bulk"] + | Literal["grouped_with_min_max_thresholds"] + | Literal["minimum"], name: str, unit_config: UnitConfig | NotGiven = NOT_GIVEN, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -2743,9 +2648,6 @@ def create( matrix_config: MatrixConfig | NotGiven = NOT_GIVEN, matrix_with_allocation_config: MatrixWithAllocationConfig | NotGiven = NOT_GIVEN, tiered_config: TieredConfig | NotGiven = NOT_GIVEN, - tiered_bps_config: TieredBPSConfig | NotGiven = NOT_GIVEN, - bps_config: BPSConfig | NotGiven = NOT_GIVEN, - bulk_bps_config: BulkBPSConfig | NotGiven = NOT_GIVEN, bulk_config: BulkConfig | NotGiven = NOT_GIVEN, threshold_total_amount_config: Dict[str, object] | NotGiven = NOT_GIVEN, tiered_package_config: Dict[str, object] | NotGiven = NOT_GIVEN, @@ -2766,6 +2668,8 @@ def create( 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, + grouped_with_min_max_thresholds_config: Dict[str, object] | NotGiven = NOT_GIVEN, + minimum_config: price_create_params.NewFloatingMinimumCompositePriceMinimumConfig | 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, @@ -2801,9 +2705,6 @@ def create( "matrix_config": matrix_config, "matrix_with_allocation_config": matrix_with_allocation_config, "tiered_config": tiered_config, - "tiered_bps_config": tiered_bps_config, - "bps_config": bps_config, - "bulk_bps_config": bulk_bps_config, "bulk_config": bulk_config, "threshold_total_amount_config": threshold_total_amount_config, "tiered_package_config": tiered_package_config, @@ -2824,6 +2725,8 @@ def create( "scalable_matrix_with_unit_pricing_config": scalable_matrix_with_unit_pricing_config, "scalable_matrix_with_tiered_pricing_config": scalable_matrix_with_tiered_pricing_config, "cumulative_grouped_bulk_config": cumulative_grouped_bulk_config, + "grouped_with_min_max_thresholds_config": grouped_with_min_max_thresholds_config, + "minimum_config": minimum_config, }, price_create_params.PriceCreateParams, ), @@ -2948,7 +2851,7 @@ def evaluate( customer_id: Optional[str] | NotGiven = NOT_GIVEN, external_customer_id: Optional[str] | NotGiven = NOT_GIVEN, filter: Optional[str] | NotGiven = NOT_GIVEN, - grouping_keys: List[str] | NotGiven = NOT_GIVEN, + grouping_keys: SequenceNotStr[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. extra_headers: Headers | None = None, @@ -3734,109 +3637,17 @@ async def create( async def create( self, *, + bulk_config: BulkConfig, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, item_id: str, - model_type: Literal["tiered_bps"], - name: str, - tiered_bps_config: TieredBPSConfig, - billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, - billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_configuration: Optional[NewBillingCycleConfiguration] | NotGiven = NOT_GIVEN, - conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, - conversion_rate_config: Optional[price_create_params.NewFloatingTieredBPSPriceConversionRateConfig] - | NotGiven = NOT_GIVEN, - dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | 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[NewBillingCycleConfiguration] | 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. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - idempotency_key: str | None = None, - ) -> Price: - """ - 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 - associated with a specific plan and can instead be individually added to - subscriptions, including subscriptions on different plans. - - An `external_price_id` can be optionally specified as an alias to allow - ergonomic interaction with prices in the Orb API. - - See the [Price resource](/product-catalog/price-configuration) for the - specification of different price model configurations possible in this endpoint. - - Args: - cadence: The cadence to bill for this price on. - - currency: An ISO 4217 currency string for which this price is billed in. - - item_id: The id of the item the price will be associated with. - - name: The name of the price. - - billable_metric_id: The id of the billable metric for the price. Only needed if the price is - usage-based. - - billed_in_advance: 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: For custom cadence: specifies the duration of the billing period in days or - months. - - conversion_rate: The per unit conversion rate of the price currency to the invoicing currency. - - conversion_rate_config: The configuration for the rate of the price currency to the invoicing currency. - - dimensional_price_configuration: For dimensional price: specifies a price group and dimension values - - external_price_id: An alias for the price. - - fixed_price_quantity: If the Price represents a fixed cost, this represents the quantity of units - applied. - - invoice_grouping_key: The property used to group this price on an invoice - - invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. - If unspecified, a single invoice is produced per billing cycle. - - metadata: 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`. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - - idempotency_key: Specify a custom idempotency key for this request - """ - ... - - @overload - async def create( - self, - *, - bps_config: BPSConfig, - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], - currency: str, - item_id: str, - model_type: Literal["bps"], + model_type: Literal["bulk"], name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, billing_cycle_configuration: Optional[NewBillingCycleConfiguration] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, - conversion_rate_config: Optional[price_create_params.NewFloatingBPSPriceConversionRateConfig] + conversion_rate_config: Optional[price_create_params.NewFloatingBulkPriceConversionRateConfig] | NotGiven = NOT_GIVEN, dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -3918,17 +3729,17 @@ async def create( async def create( self, *, - bulk_bps_config: BulkBPSConfig, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, item_id: str, - model_type: Literal["bulk_bps"], + model_type: Literal["threshold_total_amount"], name: str, + threshold_total_amount_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, billing_cycle_configuration: Optional[NewBillingCycleConfiguration] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, - conversion_rate_config: Optional[price_create_params.NewFloatingBulkBPSPriceConversionRateConfig] + conversion_rate_config: Optional[price_create_params.NewFloatingThresholdTotalAmountPriceConversionRateConfig] | NotGiven = NOT_GIVEN, dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -4010,17 +3821,17 @@ async def create( async def create( self, *, - bulk_config: BulkConfig, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, item_id: str, - model_type: Literal["bulk"], + model_type: Literal["tiered_package"], name: str, + tiered_package_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, billing_cycle_configuration: Optional[NewBillingCycleConfiguration] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, - conversion_rate_config: Optional[price_create_params.NewFloatingBulkPriceConversionRateConfig] + conversion_rate_config: Optional[price_create_params.NewFloatingTieredPackagePriceConversionRateConfig] | NotGiven = NOT_GIVEN, dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -4104,15 +3915,15 @@ async def create( *, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, + grouped_tiered_config: Dict[str, object], item_id: str, - model_type: Literal["threshold_total_amount"], + model_type: Literal["grouped_tiered"], name: str, - threshold_total_amount_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, billing_cycle_configuration: Optional[NewBillingCycleConfiguration] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, - conversion_rate_config: Optional[price_create_params.NewFloatingThresholdTotalAmountPriceConversionRateConfig] + conversion_rate_config: Optional[price_create_params.NewFloatingGroupedTieredPriceConversionRateConfig] | NotGiven = NOT_GIVEN, dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -4197,14 +4008,14 @@ async def create( cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, item_id: str, - model_type: Literal["tiered_package"], + max_group_tiered_package_config: Dict[str, object], + model_type: Literal["max_group_tiered_package"], name: str, - tiered_package_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, billing_cycle_configuration: Optional[NewBillingCycleConfiguration] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, - conversion_rate_config: Optional[price_create_params.NewFloatingTieredPackagePriceConversionRateConfig] + conversion_rate_config: Optional[price_create_params.NewFloatingMaxGroupTieredPackagePriceConversionRateConfig] | NotGiven = NOT_GIVEN, dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -4288,15 +4099,15 @@ async def create( *, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, - grouped_tiered_config: Dict[str, object], item_id: str, - model_type: Literal["grouped_tiered"], + model_type: Literal["tiered_with_minimum"], name: str, + tiered_with_minimum_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, billing_cycle_configuration: Optional[NewBillingCycleConfiguration] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, - conversion_rate_config: Optional[price_create_params.NewFloatingGroupedTieredPriceConversionRateConfig] + conversion_rate_config: Optional[price_create_params.NewFloatingTieredWithMinimumPriceConversionRateConfig] | NotGiven = NOT_GIVEN, dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -4381,14 +4192,14 @@ 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], - model_type: Literal["max_group_tiered_package"], + model_type: Literal["package_with_allocation"], name: str, + package_with_allocation_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, billing_cycle_configuration: Optional[NewBillingCycleConfiguration] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, - conversion_rate_config: Optional[price_create_params.NewFloatingMaxGroupTieredPackagePriceConversionRateConfig] + conversion_rate_config: Optional[price_create_params.NewFloatingPackageWithAllocationPriceConversionRateConfig] | NotGiven = NOT_GIVEN, dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -4473,14 +4284,16 @@ async def create( cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, item_id: str, - model_type: Literal["tiered_with_minimum"], + model_type: Literal["tiered_package_with_minimum"], name: str, - tiered_with_minimum_config: Dict[str, object], + tiered_package_with_minimum_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, billing_cycle_configuration: Optional[NewBillingCycleConfiguration] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, - conversion_rate_config: Optional[price_create_params.NewFloatingTieredWithMinimumPriceConversionRateConfig] + conversion_rate_config: Optional[ + price_create_params.NewFloatingTieredPackageWithMinimumPriceConversionRateConfig + ] | NotGiven = NOT_GIVEN, dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -4565,14 +4378,14 @@ async def create( cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, item_id: str, - model_type: Literal["package_with_allocation"], + model_type: Literal["unit_with_percent"], name: str, - package_with_allocation_config: Dict[str, object], + unit_with_percent_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, billing_cycle_configuration: Optional[NewBillingCycleConfiguration] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, - conversion_rate_config: Optional[price_create_params.NewFloatingPackageWithAllocationPriceConversionRateConfig] + conversion_rate_config: Optional[price_create_params.NewFloatingUnitWithPercentPriceConversionRateConfig] | NotGiven = NOT_GIVEN, dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -4657,16 +4470,14 @@ async def create( cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, item_id: str, - model_type: Literal["tiered_package_with_minimum"], + model_type: Literal["tiered_with_proration"], name: str, - tiered_package_with_minimum_config: Dict[str, object], + tiered_with_proration_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, billing_cycle_configuration: Optional[NewBillingCycleConfiguration] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, - conversion_rate_config: Optional[ - price_create_params.NewFloatingTieredPackageWithMinimumPriceConversionRateConfig - ] + conversion_rate_config: Optional[price_create_params.NewFloatingTieredWithProrationPriceConversionRateConfig] | NotGiven = NOT_GIVEN, dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -4751,14 +4562,14 @@ async def create( cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, item_id: str, - model_type: Literal["unit_with_percent"], + model_type: Literal["unit_with_proration"], name: str, - unit_with_percent_config: Dict[str, object], + unit_with_proration_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, billing_cycle_configuration: Optional[NewBillingCycleConfiguration] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, - conversion_rate_config: Optional[price_create_params.NewFloatingUnitWithPercentPriceConversionRateConfig] + conversion_rate_config: Optional[price_create_params.NewFloatingUnitWithProrationPriceConversionRateConfig] | NotGiven = NOT_GIVEN, dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -4842,15 +4653,15 @@ async def create( *, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, + grouped_allocation_config: Dict[str, object], item_id: str, - model_type: Literal["tiered_with_proration"], + model_type: Literal["grouped_allocation"], name: str, - tiered_with_proration_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, billing_cycle_configuration: Optional[NewBillingCycleConfiguration] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, - conversion_rate_config: Optional[price_create_params.NewFloatingTieredWithProrationPriceConversionRateConfig] + conversion_rate_config: Optional[price_create_params.NewFloatingGroupedAllocationPriceConversionRateConfig] | NotGiven = NOT_GIVEN, dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -4934,15 +4745,17 @@ async def create( *, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, + grouped_with_prorated_minimum_config: Dict[str, object], item_id: str, - model_type: Literal["unit_with_proration"], + model_type: Literal["grouped_with_prorated_minimum"], name: str, - unit_with_proration_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, billing_cycle_configuration: Optional[NewBillingCycleConfiguration] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, - conversion_rate_config: Optional[price_create_params.NewFloatingUnitWithProrationPriceConversionRateConfig] + conversion_rate_config: Optional[ + price_create_params.NewFloatingGroupedWithProratedMinimumPriceConversionRateConfig + ] | NotGiven = NOT_GIVEN, dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -5026,15 +4839,17 @@ async def create( *, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, - grouped_allocation_config: Dict[str, object], + grouped_with_metered_minimum_config: Dict[str, object], item_id: str, - model_type: Literal["grouped_allocation"], + 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[NewBillingCycleConfiguration] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, - conversion_rate_config: Optional[price_create_params.NewFloatingGroupedAllocationPriceConversionRateConfig] + conversion_rate_config: Optional[ + price_create_params.NewFloatingGroupedWithMeteredMinimumPriceConversionRateConfig + ] | NotGiven = NOT_GIVEN, dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -5118,17 +4933,15 @@ async def create( *, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, - grouped_with_prorated_minimum_config: Dict[str, object], item_id: str, - model_type: Literal["grouped_with_prorated_minimum"], + matrix_with_display_name_config: Dict[str, object], + 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[NewBillingCycleConfiguration] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, - conversion_rate_config: Optional[ - price_create_params.NewFloatingGroupedWithProratedMinimumPriceConversionRateConfig - ] + conversion_rate_config: Optional[price_create_params.NewFloatingMatrixWithDisplayNamePriceConversionRateConfig] | NotGiven = NOT_GIVEN, dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -5210,19 +5023,17 @@ async def create( async def create( self, *, + bulk_with_proration_config: Dict[str, object], cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, - grouped_with_metered_minimum_config: Dict[str, object], item_id: str, - model_type: Literal["grouped_with_metered_minimum"], + model_type: Literal["bulk_with_proration"], name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, billing_cycle_configuration: Optional[NewBillingCycleConfiguration] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, - conversion_rate_config: Optional[ - price_create_params.NewFloatingGroupedWithMeteredMinimumPriceConversionRateConfig - ] + conversion_rate_config: Optional[price_create_params.NewFloatingBulkWithProrationPriceConversionRateConfig] | NotGiven = NOT_GIVEN, dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -5306,15 +5117,15 @@ async def create( *, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, + grouped_tiered_package_config: Dict[str, object], item_id: str, - matrix_with_display_name_config: Dict[str, object], - model_type: Literal["matrix_with_display_name"], + 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[NewBillingCycleConfiguration] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, - conversion_rate_config: Optional[price_create_params.NewFloatingMatrixWithDisplayNamePriceConversionRateConfig] + conversion_rate_config: Optional[price_create_params.NewFloatingGroupedTieredPackagePriceConversionRateConfig] | NotGiven = NOT_GIVEN, dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -5396,17 +5207,19 @@ async def create( async def create( self, *, - bulk_with_proration_config: Dict[str, object], cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, item_id: str, - model_type: Literal["bulk_with_proration"], + model_type: Literal["scalable_matrix_with_unit_pricing"], name: str, + scalable_matrix_with_unit_pricing_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, billing_cycle_configuration: Optional[NewBillingCycleConfiguration] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, - conversion_rate_config: Optional[price_create_params.NewFloatingBulkWithProrationPriceConversionRateConfig] + conversion_rate_config: Optional[ + price_create_params.NewFloatingScalableMatrixWithUnitPricingPriceConversionRateConfig + ] | NotGiven = NOT_GIVEN, dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -5490,15 +5303,17 @@ async def create( *, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, - grouped_tiered_package_config: Dict[str, object], item_id: str, - model_type: Literal["grouped_tiered_package"], + model_type: Literal["scalable_matrix_with_tiered_pricing"], name: str, + scalable_matrix_with_tiered_pricing_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, billing_cycle_configuration: Optional[NewBillingCycleConfiguration] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, - conversion_rate_config: Optional[price_create_params.NewFloatingGroupedTieredPackagePriceConversionRateConfig] + conversion_rate_config: Optional[ + price_create_params.NewFloatingScalableMatrixWithTieredPricingPriceConversionRateConfig + ] | NotGiven = NOT_GIVEN, dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -5581,18 +5396,16 @@ async def create( self, *, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], + cumulative_grouped_bulk_config: Dict[str, object], currency: str, item_id: str, - model_type: Literal["scalable_matrix_with_unit_pricing"], + model_type: Literal["cumulative_grouped_bulk"], name: str, - scalable_matrix_with_unit_pricing_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, billing_cycle_configuration: Optional[NewBillingCycleConfiguration] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, - conversion_rate_config: Optional[ - price_create_params.NewFloatingScalableMatrixWithUnitPricingPriceConversionRateConfig - ] + conversion_rate_config: Optional[price_create_params.NewFloatingCumulativeGroupedBulkPriceConversionRateConfig] | NotGiven = NOT_GIVEN, dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -5676,16 +5489,16 @@ async def create( *, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, + grouped_with_min_max_thresholds_config: Dict[str, object], item_id: str, - model_type: Literal["scalable_matrix_with_tiered_pricing"], + model_type: Literal["grouped_with_min_max_thresholds"], name: str, - scalable_matrix_with_tiered_pricing_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, billing_cycle_configuration: Optional[NewBillingCycleConfiguration] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, conversion_rate_config: Optional[ - price_create_params.NewFloatingScalableMatrixWithTieredPricingPriceConversionRateConfig + price_create_params.NewFloatingGroupedWithMinMaxThresholdsPriceConversionRateConfig ] | NotGiven = NOT_GIVEN, dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | NotGiven = NOT_GIVEN, @@ -5769,16 +5582,16 @@ async def create( self, *, cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], - cumulative_grouped_bulk_config: Dict[str, object], currency: str, item_id: str, - model_type: Literal["cumulative_grouped_bulk"], + minimum_config: price_create_params.NewFloatingMinimumCompositePriceMinimumConfig, + model_type: Literal["minimum"], name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, billing_cycle_configuration: Optional[NewBillingCycleConfiguration] | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, - conversion_rate_config: Optional[price_create_params.NewFloatingCumulativeGroupedBulkPriceConversionRateConfig] + conversion_rate_config: Optional[price_create_params.NewFloatingMinimumCompositePriceConversionRateConfig] | NotGiven = NOT_GIVEN, dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -5862,9 +5675,6 @@ async def create( ["cadence", "currency", "item_id", "matrix_config", "model_type", "name"], ["cadence", "currency", "item_id", "matrix_with_allocation_config", "model_type", "name"], ["cadence", "currency", "item_id", "model_type", "name", "tiered_config"], - ["cadence", "currency", "item_id", "model_type", "name", "tiered_bps_config"], - ["bps_config", "cadence", "currency", "item_id", "model_type", "name"], - ["bulk_bps_config", "cadence", "currency", "item_id", "model_type", "name"], ["bulk_config", "cadence", "currency", "item_id", "model_type", "name"], ["cadence", "currency", "item_id", "model_type", "name", "threshold_total_amount_config"], ["cadence", "currency", "item_id", "model_type", "name", "tiered_package_config"], @@ -5885,6 +5695,8 @@ async def create( ["cadence", "currency", "item_id", "model_type", "name", "scalable_matrix_with_unit_pricing_config"], ["cadence", "currency", "item_id", "model_type", "name", "scalable_matrix_with_tiered_pricing_config"], ["cadence", "cumulative_grouped_bulk_config", "currency", "item_id", "model_type", "name"], + ["cadence", "currency", "grouped_with_min_max_thresholds_config", "item_id", "model_type", "name"], + ["cadence", "currency", "item_id", "minimum_config", "model_type", "name"], ) async def create( self, @@ -5897,9 +5709,6 @@ async def create( | Literal["matrix"] | Literal["matrix_with_allocation"] | Literal["tiered"] - | Literal["tiered_bps"] - | Literal["bps"] - | Literal["bulk_bps"] | Literal["bulk"] | Literal["threshold_total_amount"] | Literal["tiered_package"] @@ -5919,7 +5728,9 @@ async def create( | Literal["grouped_tiered_package"] | Literal["scalable_matrix_with_unit_pricing"] | Literal["scalable_matrix_with_tiered_pricing"] - | Literal["cumulative_grouped_bulk"], + | Literal["cumulative_grouped_bulk"] + | Literal["grouped_with_min_max_thresholds"] + | Literal["minimum"], name: str, unit_config: UnitConfig | NotGiven = NOT_GIVEN, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -5938,9 +5749,6 @@ async def create( matrix_config: MatrixConfig | NotGiven = NOT_GIVEN, matrix_with_allocation_config: MatrixWithAllocationConfig | NotGiven = NOT_GIVEN, tiered_config: TieredConfig | NotGiven = NOT_GIVEN, - tiered_bps_config: TieredBPSConfig | NotGiven = NOT_GIVEN, - bps_config: BPSConfig | NotGiven = NOT_GIVEN, - bulk_bps_config: BulkBPSConfig | NotGiven = NOT_GIVEN, bulk_config: BulkConfig | NotGiven = NOT_GIVEN, threshold_total_amount_config: Dict[str, object] | NotGiven = NOT_GIVEN, tiered_package_config: Dict[str, object] | NotGiven = NOT_GIVEN, @@ -5961,6 +5769,8 @@ async def create( 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, + grouped_with_min_max_thresholds_config: Dict[str, object] | NotGiven = NOT_GIVEN, + minimum_config: price_create_params.NewFloatingMinimumCompositePriceMinimumConfig | 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, @@ -5996,9 +5806,6 @@ async def create( "matrix_config": matrix_config, "matrix_with_allocation_config": matrix_with_allocation_config, "tiered_config": tiered_config, - "tiered_bps_config": tiered_bps_config, - "bps_config": bps_config, - "bulk_bps_config": bulk_bps_config, "bulk_config": bulk_config, "threshold_total_amount_config": threshold_total_amount_config, "tiered_package_config": tiered_package_config, @@ -6019,6 +5826,8 @@ async def create( "scalable_matrix_with_unit_pricing_config": scalable_matrix_with_unit_pricing_config, "scalable_matrix_with_tiered_pricing_config": scalable_matrix_with_tiered_pricing_config, "cumulative_grouped_bulk_config": cumulative_grouped_bulk_config, + "grouped_with_min_max_thresholds_config": grouped_with_min_max_thresholds_config, + "minimum_config": minimum_config, }, price_create_params.PriceCreateParams, ), @@ -6143,7 +5952,7 @@ async def evaluate( customer_id: Optional[str] | NotGiven = NOT_GIVEN, external_customer_id: Optional[str] | NotGiven = NOT_GIVEN, filter: Optional[str] | NotGiven = NOT_GIVEN, - grouping_keys: List[str] | NotGiven = NOT_GIVEN, + grouping_keys: SequenceNotStr[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. extra_headers: Headers | None = None, diff --git a/src/orb/resources/subscriptions.py b/src/orb/resources/subscriptions.py index 64212514..4f4aeefc 100644 --- a/src/orb/resources/subscriptions.py +++ b/src/orb/resources/subscriptions.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Any, Dict, List, Union, Iterable, Optional, cast +from typing import Any, Dict, Union, Iterable, Optional, cast from datetime import date, datetime from typing_extensions import Literal @@ -25,7 +25,7 @@ subscription_update_fixed_fee_quantity_params, subscription_unschedule_fixed_fee_quantity_updates_params, ) -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource @@ -97,7 +97,7 @@ def create( replace_prices: Optional[Iterable[subscription_create_params.ReplacePrice]] | 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, + usage_customer_ids: Optional[SequenceNotStr[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. extra_headers: Headers | None = None, @@ -588,8 +588,8 @@ def list( created_at_lt: Union[str, datetime, None] | NotGiven = NOT_GIVEN, created_at_lte: Union[str, datetime, None] | NotGiven = NOT_GIVEN, cursor: Optional[str] | NotGiven = NOT_GIVEN, - customer_id: Optional[List[str]] | NotGiven = NOT_GIVEN, - external_customer_id: Optional[List[str]] | NotGiven = NOT_GIVEN, + customer_id: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, + external_customer_id: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, limit: int | NotGiven = NOT_GIVEN, status: Optional[Literal["active", "ended", "upcoming"]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1449,7 +1449,7 @@ def schedule_plan_change( replace_prices: Optional[Iterable[subscription_schedule_plan_change_params.ReplacePrice]] | NotGiven = NOT_GIVEN, trial_duration_days: Optional[int] | NotGiven = NOT_GIVEN, - usage_customer_ids: Optional[List[str]] | NotGiven = NOT_GIVEN, + usage_customer_ids: Optional[SequenceNotStr[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. extra_headers: Headers | None = None, @@ -1463,7 +1463,7 @@ def schedule_plan_change( It returns the serialized updated subscription object. - The body parameter `change_option` determines when the plan change occurrs. Orb + The body parameter `change_option` determines when the plan change occurs. Orb supports three options: - `end_of_subscription_term`: changes the plan at the end of the existing plan's @@ -2183,7 +2183,7 @@ async def create( replace_prices: Optional[Iterable[subscription_create_params.ReplacePrice]] | 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, + usage_customer_ids: Optional[SequenceNotStr[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. extra_headers: Headers | None = None, @@ -2674,8 +2674,8 @@ def list( created_at_lt: Union[str, datetime, None] | NotGiven = NOT_GIVEN, created_at_lte: Union[str, datetime, None] | NotGiven = NOT_GIVEN, cursor: Optional[str] | NotGiven = NOT_GIVEN, - customer_id: Optional[List[str]] | NotGiven = NOT_GIVEN, - external_customer_id: Optional[List[str]] | NotGiven = NOT_GIVEN, + customer_id: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, + external_customer_id: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, limit: int | NotGiven = NOT_GIVEN, status: Optional[Literal["active", "ended", "upcoming"]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -3535,7 +3535,7 @@ async def schedule_plan_change( replace_prices: Optional[Iterable[subscription_schedule_plan_change_params.ReplacePrice]] | NotGiven = NOT_GIVEN, trial_duration_days: Optional[int] | NotGiven = NOT_GIVEN, - usage_customer_ids: Optional[List[str]] | NotGiven = NOT_GIVEN, + usage_customer_ids: Optional[SequenceNotStr[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. extra_headers: Headers | None = None, @@ -3549,7 +3549,7 @@ async def schedule_plan_change( It returns the serialized updated subscription object. - The body parameter `change_option` determines when the plan change occurrs. Orb + The body parameter `change_option` determines when the plan change occurs. Orb supports three options: - `end_of_subscription_term`: changes the plan at the end of the existing plan's diff --git a/src/orb/types/__init__.py b/src/orb/types/__init__.py index 8d49de23..867be819 100644 --- a/src/orb/types/__init__.py +++ b/src/orb/types/__init__.py @@ -10,14 +10,12 @@ Tier as Tier, Price as Price, Address as Address, - BPSTier as BPSTier, Invoice as Invoice, Maximum as Maximum, Minimum as Minimum, BulkTier as BulkTier, Discount as Discount, ItemSlim as ItemSlim, - BPSConfig as BPSConfig, TaxAmount as TaxAmount, Allocation as Allocation, BulkConfig as BulkConfig, @@ -26,13 +24,11 @@ NewMinimum as NewMinimum, TierConfig as TierConfig, UnitConfig as UnitConfig, - BulkBPSTier as BulkBPSTier, InvoiceTiny as InvoiceTiny, MatrixValue as MatrixValue, MatrixConfig as MatrixConfig, PerPriceCost as PerPriceCost, TieredConfig as TieredConfig, - BulkBPSConfig as BulkBPSConfig, CustomerTaxID as CustomerTaxID, PackageConfig as PackageConfig, PriceInterval as PriceInterval, @@ -43,8 +39,6 @@ CreditNoteTiny as CreditNoteTiny, MaximumInterval as MaximumInterval, MinimumInterval as MinimumInterval, - NewPlanBPSPrice as NewPlanBPSPrice, - TieredBPSConfig as TieredBPSConfig, TierSubLineItem as TierSubLineItem, CouponRedemption as CouponRedemption, CustomerMinified as CustomerMinified, @@ -63,8 +57,6 @@ NewPlanTieredPrice as NewPlanTieredPrice, PaginationMetadata as PaginationMetadata, PercentageDiscount as PercentageDiscount, - NewFloatingBPSPrice as NewFloatingBPSPrice, - NewPlanBulkBPSPrice as NewPlanBulkBPSPrice, NewPlanPackagePrice as NewPlanPackagePrice, SubLineItemGrouping as SubLineItemGrouping, InvoiceLevelDiscount as InvoiceLevelDiscount, @@ -73,13 +65,11 @@ SubscriptionMinified as SubscriptionMinified, TransformPriceFilter as TransformPriceFilter, NewPercentageDiscount as NewPercentageDiscount, - NewPlanTieredBPSPrice as NewPlanTieredBPSPrice, SubscriptionTrialInfo as SubscriptionTrialInfo, UsageDiscountInterval as UsageDiscountInterval, AmountDiscountInterval as AmountDiscountInterval, NewFloatingMatrixPrice as NewFloatingMatrixPrice, NewFloatingTieredPrice as NewFloatingTieredPrice, - NewFloatingBulkBPSPrice as NewFloatingBulkBPSPrice, NewFloatingPackagePrice as NewFloatingPackagePrice, SubLineItemMatrixConfig as SubLineItemMatrixConfig, BillingCycleRelativeDate as BillingCycleRelativeDate, @@ -88,7 +78,6 @@ BillingCycleConfiguration as BillingCycleConfiguration, MonetaryMaximumAdjustment as MonetaryMaximumAdjustment, MonetaryMinimumAdjustment as MonetaryMinimumAdjustment, - NewFloatingTieredBPSPrice as NewFloatingTieredBPSPrice, NewPlanGroupedTieredPrice as NewPlanGroupedTieredPrice, NewPlanTieredPackagePrice as NewPlanTieredPackagePrice, ConversionRateTieredConfig as ConversionRateTieredConfig, @@ -102,6 +91,7 @@ NewPlanUnitWithPercentPrice as NewPlanUnitWithPercentPrice, ChangedSubscriptionResources as ChangedSubscriptionResources, NewBillingCycleConfiguration as NewBillingCycleConfiguration, + NewPlanMinimumCompositePrice as NewPlanMinimumCompositePrice, DimensionalPriceConfiguration as DimensionalPriceConfiguration, FixedFeeQuantityScheduleEntry as FixedFeeQuantityScheduleEntry, NewFloatingGroupedTieredPrice as NewFloatingGroupedTieredPrice, @@ -116,6 +106,7 @@ NewFloatingUnitWithPercentPrice as NewFloatingUnitWithPercentPrice, MonetaryAmountDiscountAdjustment as MonetaryAmountDiscountAdjustment, NewDimensionalPriceConfiguration as NewDimensionalPriceConfiguration, + NewFloatingMinimumCompositePrice as NewFloatingMinimumCompositePrice, NewPlanGroupedTieredPackagePrice as NewPlanGroupedTieredPackagePrice, NewPlanMatrixWithAllocationPrice as NewPlanMatrixWithAllocationPrice, NewPlanThresholdTotalAmountPrice as NewPlanThresholdTotalAmountPrice, @@ -219,7 +210,6 @@ from .subscription_fetch_usage_params import SubscriptionFetchUsageParams as SubscriptionFetchUsageParams from .accounting_provider_config_param import AccountingProviderConfigParam as AccountingProviderConfigParam from .alert_create_for_customer_params import AlertCreateForCustomerParams as AlertCreateForCustomerParams -from .new_subscription_bps_price_param import NewSubscriptionBPSPriceParam as NewSubscriptionBPSPriceParam from .price_evaluate_multiple_response import PriceEvaluateMultipleResponse as PriceEvaluateMultipleResponse from .subscription_change_apply_params import SubscriptionChangeApplyParams as SubscriptionChangeApplyParams from .subscription_update_trial_params import SubscriptionUpdateTrialParams as SubscriptionUpdateTrialParams @@ -250,7 +240,6 @@ from .dimensional_price_group_update_params import ( DimensionalPriceGroupUpdateParams as DimensionalPriceGroupUpdateParams, ) -from .new_subscription_bulk_bps_price_param import NewSubscriptionBulkBPSPriceParam as NewSubscriptionBulkBPSPriceParam from .subscription_change_retrieve_response import ( SubscriptionChangeRetrieveResponse as SubscriptionChangeRetrieveResponse, ) @@ -260,9 +249,6 @@ from .new_accounting_sync_configuration_param import ( NewAccountingSyncConfigurationParam as NewAccountingSyncConfigurationParam, ) -from .new_subscription_tiered_bps_price_param import ( - NewSubscriptionTieredBPSPriceParam as NewSubscriptionTieredBPSPriceParam, -) from .subscription_schedule_plan_change_params import ( SubscriptionSchedulePlanChangeParams as SubscriptionSchedulePlanChangeParams, ) @@ -278,6 +264,9 @@ from .subscription_update_fixed_fee_quantity_params import ( SubscriptionUpdateFixedFeeQuantityParams as SubscriptionUpdateFixedFeeQuantityParams, ) +from .new_subscription_minimum_composite_price_param import ( + NewSubscriptionMinimumCompositePriceParam as NewSubscriptionMinimumCompositePriceParam, +) from .new_subscription_unit_with_percent_price_param import ( NewSubscriptionUnitWithPercentPriceParam as NewSubscriptionUnitWithPercentPriceParam, ) diff --git a/src/orb/types/beta/external_plan_id_create_plan_version_params.py b/src/orb/types/beta/external_plan_id_create_plan_version_params.py index 2a130e0e..565489e6 100644 --- a/src/orb/types/beta/external_plan_id_create_plan_version_params.py +++ b/src/orb/types/beta/external_plan_id_create_plan_version_params.py @@ -2,12 +2,11 @@ from __future__ import annotations -from typing import Union, Iterable, Optional -from typing_extensions import Required, TypeAlias, TypedDict +from typing import Dict, Union, Iterable, Optional +from typing_extensions import Literal, Required, TypeAlias, TypedDict from ..shared_params.new_maximum import NewMaximum from ..shared_params.new_minimum import NewMinimum -from ..shared_params.new_plan_bps_price import NewPlanBPSPrice from ..shared_params.new_usage_discount import NewUsageDiscount from ..shared_params.new_amount_discount import NewAmountDiscount from ..shared_params.new_plan_bulk_price import NewPlanBulkPrice @@ -17,16 +16,19 @@ from ..shared_params.new_plan_tiered_price import NewPlanTieredPrice from ..shared_params.new_plan_package_price import NewPlanPackagePrice from ..shared_params.new_percentage_discount import NewPercentageDiscount -from ..shared_params.new_plan_bulk_bps_price import NewPlanBulkBPSPrice -from ..shared_params.new_plan_tiered_bps_price import NewPlanTieredBPSPrice +from ..shared_params.unit_conversion_rate_config import UnitConversionRateConfig from ..shared_params.new_plan_grouped_tiered_price import NewPlanGroupedTieredPrice from ..shared_params.new_plan_tiered_package_price import NewPlanTieredPackagePrice +from ..shared_params.tiered_conversion_rate_config import TieredConversionRateConfig +from ..shared_params.new_billing_cycle_configuration import NewBillingCycleConfiguration +from ..shared_params.new_plan_minimum_composite_price import NewPlanMinimumCompositePrice from ..shared_params.new_plan_unit_with_percent_price import NewPlanUnitWithPercentPrice from ..shared_params.new_plan_grouped_allocation_price import NewPlanGroupedAllocationPrice from ..shared_params.new_plan_bulk_with_proration_price import NewPlanBulkWithProrationPrice from ..shared_params.new_plan_tier_with_proration_price import NewPlanTierWithProrationPrice from ..shared_params.new_plan_tiered_with_minimum_price import NewPlanTieredWithMinimumPrice from ..shared_params.new_plan_unit_with_proration_price import NewPlanUnitWithProrationPrice +from ..shared_params.new_dimensional_price_configuration import NewDimensionalPriceConfiguration from ..shared_params.new_plan_grouped_tiered_package_price import NewPlanGroupedTieredPackagePrice from ..shared_params.new_plan_matrix_with_allocation_price import NewPlanMatrixWithAllocationPrice from ..shared_params.new_plan_threshold_total_amount_price import NewPlanThresholdTotalAmountPrice @@ -48,12 +50,16 @@ "AddAdjustmentAdjustment", "AddPrice", "AddPricePrice", + "AddPricePriceNewPlanGroupedWithMinMaxThresholdsPrice", + "AddPricePriceNewPlanGroupedWithMinMaxThresholdsPriceConversionRateConfig", "RemoveAdjustment", "RemovePrice", "ReplaceAdjustment", "ReplaceAdjustmentAdjustment", "ReplacePrice", "ReplacePricePrice", + "ReplacePricePriceNewPlanGroupedWithMinMaxThresholdsPrice", + "ReplacePricePriceNewPlanGroupedWithMinMaxThresholdsPriceConversionRateConfig", ] @@ -96,14 +102,95 @@ class AddAdjustment(TypedDict, total=False): """The phase to add this adjustment to.""" +AddPricePriceNewPlanGroupedWithMinMaxThresholdsPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPricePriceNewPlanGroupedWithMinMaxThresholdsPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_with_min_max_thresholds_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_min_max_thresholds"]] + + 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[NewBillingCycleConfiguration] + """ + 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.""" + + conversion_rate_config: Optional[AddPricePriceNewPlanGroupedWithMinMaxThresholdsPriceConversionRateConfig] + """The configuration for the 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. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + 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[NewBillingCycleConfiguration] + """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[ NewPlanUnitPrice, NewPlanPackagePrice, NewPlanMatrixPrice, NewPlanTieredPrice, - NewPlanTieredBPSPrice, - NewPlanBPSPrice, - NewPlanBulkBPSPrice, NewPlanBulkPrice, NewPlanThresholdTotalAmountPrice, NewPlanTieredPackagePrice, @@ -115,6 +202,7 @@ class AddAdjustment(TypedDict, total=False): NewPlanGroupedAllocationPrice, NewPlanGroupedWithProratedMinimumPrice, NewPlanGroupedWithMeteredMinimumPrice, + AddPricePriceNewPlanGroupedWithMinMaxThresholdsPrice, NewPlanMatrixWithDisplayNamePrice, NewPlanBulkWithProrationPrice, NewPlanGroupedTieredPackagePrice, @@ -125,6 +213,7 @@ class AddAdjustment(TypedDict, total=False): NewPlanTieredPackageWithMinimumPrice, NewPlanMatrixWithAllocationPrice, NewPlanGroupedTieredPrice, + NewPlanMinimumCompositePrice, ] @@ -171,14 +260,95 @@ class ReplaceAdjustment(TypedDict, total=False): """The phase to replace this adjustment from.""" +ReplacePricePriceNewPlanGroupedWithMinMaxThresholdsPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePricePriceNewPlanGroupedWithMinMaxThresholdsPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_with_min_max_thresholds_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_min_max_thresholds"]] + + 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[NewBillingCycleConfiguration] + """ + 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.""" + + conversion_rate_config: Optional[ReplacePricePriceNewPlanGroupedWithMinMaxThresholdsPriceConversionRateConfig] + """The configuration for the 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. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + 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[NewBillingCycleConfiguration] + """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[ NewPlanUnitPrice, NewPlanPackagePrice, NewPlanMatrixPrice, NewPlanTieredPrice, - NewPlanTieredBPSPrice, - NewPlanBPSPrice, - NewPlanBulkBPSPrice, NewPlanBulkPrice, NewPlanThresholdTotalAmountPrice, NewPlanTieredPackagePrice, @@ -190,6 +360,7 @@ class ReplaceAdjustment(TypedDict, total=False): NewPlanGroupedAllocationPrice, NewPlanGroupedWithProratedMinimumPrice, NewPlanGroupedWithMeteredMinimumPrice, + ReplacePricePriceNewPlanGroupedWithMinMaxThresholdsPrice, NewPlanMatrixWithDisplayNamePrice, NewPlanBulkWithProrationPrice, NewPlanGroupedTieredPackagePrice, @@ -200,6 +371,7 @@ class ReplaceAdjustment(TypedDict, total=False): NewPlanTieredPackageWithMinimumPrice, NewPlanMatrixWithAllocationPrice, NewPlanGroupedTieredPrice, + NewPlanMinimumCompositePrice, ] diff --git a/src/orb/types/beta_create_plan_version_params.py b/src/orb/types/beta_create_plan_version_params.py index 58c710ea..5907c133 100644 --- a/src/orb/types/beta_create_plan_version_params.py +++ b/src/orb/types/beta_create_plan_version_params.py @@ -2,12 +2,11 @@ from __future__ import annotations -from typing import Union, Iterable, Optional -from typing_extensions import Required, TypeAlias, TypedDict +from typing import Dict, Union, Iterable, Optional +from typing_extensions import Literal, Required, TypeAlias, TypedDict from .shared_params.new_maximum import NewMaximum from .shared_params.new_minimum import NewMinimum -from .shared_params.new_plan_bps_price import NewPlanBPSPrice from .shared_params.new_usage_discount import NewUsageDiscount from .shared_params.new_amount_discount import NewAmountDiscount from .shared_params.new_plan_bulk_price import NewPlanBulkPrice @@ -17,16 +16,19 @@ from .shared_params.new_plan_tiered_price import NewPlanTieredPrice from .shared_params.new_plan_package_price import NewPlanPackagePrice from .shared_params.new_percentage_discount import NewPercentageDiscount -from .shared_params.new_plan_bulk_bps_price import NewPlanBulkBPSPrice -from .shared_params.new_plan_tiered_bps_price import NewPlanTieredBPSPrice +from .shared_params.unit_conversion_rate_config import UnitConversionRateConfig from .shared_params.new_plan_grouped_tiered_price import NewPlanGroupedTieredPrice from .shared_params.new_plan_tiered_package_price import NewPlanTieredPackagePrice +from .shared_params.tiered_conversion_rate_config import TieredConversionRateConfig +from .shared_params.new_billing_cycle_configuration import NewBillingCycleConfiguration +from .shared_params.new_plan_minimum_composite_price import NewPlanMinimumCompositePrice from .shared_params.new_plan_unit_with_percent_price import NewPlanUnitWithPercentPrice from .shared_params.new_plan_grouped_allocation_price import NewPlanGroupedAllocationPrice from .shared_params.new_plan_bulk_with_proration_price import NewPlanBulkWithProrationPrice from .shared_params.new_plan_tier_with_proration_price import NewPlanTierWithProrationPrice from .shared_params.new_plan_tiered_with_minimum_price import NewPlanTieredWithMinimumPrice from .shared_params.new_plan_unit_with_proration_price import NewPlanUnitWithProrationPrice +from .shared_params.new_dimensional_price_configuration import NewDimensionalPriceConfiguration from .shared_params.new_plan_grouped_tiered_package_price import NewPlanGroupedTieredPackagePrice from .shared_params.new_plan_matrix_with_allocation_price import NewPlanMatrixWithAllocationPrice from .shared_params.new_plan_threshold_total_amount_price import NewPlanThresholdTotalAmountPrice @@ -48,12 +50,16 @@ "AddAdjustmentAdjustment", "AddPrice", "AddPricePrice", + "AddPricePriceNewPlanGroupedWithMinMaxThresholdsPrice", + "AddPricePriceNewPlanGroupedWithMinMaxThresholdsPriceConversionRateConfig", "RemoveAdjustment", "RemovePrice", "ReplaceAdjustment", "ReplaceAdjustmentAdjustment", "ReplacePrice", "ReplacePricePrice", + "ReplacePricePriceNewPlanGroupedWithMinMaxThresholdsPrice", + "ReplacePricePriceNewPlanGroupedWithMinMaxThresholdsPriceConversionRateConfig", ] @@ -96,14 +102,95 @@ class AddAdjustment(TypedDict, total=False): """The phase to add this adjustment to.""" +AddPricePriceNewPlanGroupedWithMinMaxThresholdsPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPricePriceNewPlanGroupedWithMinMaxThresholdsPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_with_min_max_thresholds_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_min_max_thresholds"]] + + 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[NewBillingCycleConfiguration] + """ + 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.""" + + conversion_rate_config: Optional[AddPricePriceNewPlanGroupedWithMinMaxThresholdsPriceConversionRateConfig] + """The configuration for the 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. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + 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[NewBillingCycleConfiguration] + """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[ NewPlanUnitPrice, NewPlanPackagePrice, NewPlanMatrixPrice, NewPlanTieredPrice, - NewPlanTieredBPSPrice, - NewPlanBPSPrice, - NewPlanBulkBPSPrice, NewPlanBulkPrice, NewPlanThresholdTotalAmountPrice, NewPlanTieredPackagePrice, @@ -115,6 +202,7 @@ class AddAdjustment(TypedDict, total=False): NewPlanGroupedAllocationPrice, NewPlanGroupedWithProratedMinimumPrice, NewPlanGroupedWithMeteredMinimumPrice, + AddPricePriceNewPlanGroupedWithMinMaxThresholdsPrice, NewPlanMatrixWithDisplayNamePrice, NewPlanBulkWithProrationPrice, NewPlanGroupedTieredPackagePrice, @@ -125,6 +213,7 @@ class AddAdjustment(TypedDict, total=False): NewPlanTieredPackageWithMinimumPrice, NewPlanMatrixWithAllocationPrice, NewPlanGroupedTieredPrice, + NewPlanMinimumCompositePrice, ] @@ -171,14 +260,95 @@ class ReplaceAdjustment(TypedDict, total=False): """The phase to replace this adjustment from.""" +ReplacePricePriceNewPlanGroupedWithMinMaxThresholdsPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePricePriceNewPlanGroupedWithMinMaxThresholdsPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_with_min_max_thresholds_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_min_max_thresholds"]] + + 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[NewBillingCycleConfiguration] + """ + 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.""" + + conversion_rate_config: Optional[ReplacePricePriceNewPlanGroupedWithMinMaxThresholdsPriceConversionRateConfig] + """The configuration for the 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. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + 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[NewBillingCycleConfiguration] + """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[ NewPlanUnitPrice, NewPlanPackagePrice, NewPlanMatrixPrice, NewPlanTieredPrice, - NewPlanTieredBPSPrice, - NewPlanBPSPrice, - NewPlanBulkBPSPrice, NewPlanBulkPrice, NewPlanThresholdTotalAmountPrice, NewPlanTieredPackagePrice, @@ -190,6 +360,7 @@ class ReplaceAdjustment(TypedDict, total=False): NewPlanGroupedAllocationPrice, NewPlanGroupedWithProratedMinimumPrice, NewPlanGroupedWithMeteredMinimumPrice, + ReplacePricePriceNewPlanGroupedWithMinMaxThresholdsPrice, NewPlanMatrixWithDisplayNamePrice, NewPlanBulkWithProrationPrice, NewPlanGroupedTieredPackagePrice, @@ -200,6 +371,7 @@ class ReplaceAdjustment(TypedDict, total=False): NewPlanTieredPackageWithMinimumPrice, NewPlanMatrixWithAllocationPrice, NewPlanGroupedTieredPrice, + NewPlanMinimumCompositePrice, ] diff --git a/src/orb/types/customer.py b/src/orb/types/customer.py index ae602031..d50e2b54 100644 --- a/src/orb/types/customer.py +++ b/src/orb/types/customer.py @@ -47,6 +47,13 @@ class Customer(BaseModel): auto_collection: bool + auto_issuance: Optional[bool] = None + """Whether invoices for this customer should be automatically issued. + + If true, invoices will be automatically issued. If false, invoices will require + manual approval. If null, inherits the account-level setting. + """ + balance: str """The customer's current balance in their currency.""" diff --git a/src/orb/types/customer_create_params.py b/src/orb/types/customer_create_params.py index c7d2490e..4d40ad94 100644 --- a/src/orb/types/customer_create_params.py +++ b/src/orb/types/customer_create_params.py @@ -2,9 +2,10 @@ from __future__ import annotations -from typing import Dict, List, Union, Optional +from typing import Dict, Union, Optional from typing_extensions import Literal, Required, TypeAlias, TypedDict +from .._types import SequenceNotStr from .address_input_param import AddressInputParam from .shared_params.customer_tax_id import CustomerTaxID from .new_sphere_configuration_param import NewSphereConfigurationParam @@ -30,7 +31,7 @@ class CustomerCreateParams(TypedDict, total=False): accounting_sync_configuration: Optional[NewAccountingSyncConfigurationParam] - additional_emails: Optional[List[str]] + additional_emails: Optional[SequenceNotStr[str]] """Additional email addresses for this customer. If populated, these email addresses will be CC'd for customer communications. @@ -43,6 +44,14 @@ class CustomerCreateParams(TypedDict, total=False): when a payment provider is provided on customer creation. """ + auto_issuance: Optional[bool] + """Used to determine if invoices for this customer will be automatically issued. + + If true, invoices will be automatically issued. If false, invoices will require + manual approval. If `null` is specified, the customer's auto issuance setting + will be inherited from the account-level setting. + """ + billing_address: Optional[AddressInputParam] currency: Optional[str] diff --git a/src/orb/types/customer_hierarchy_config_param.py b/src/orb/types/customer_hierarchy_config_param.py index 4022df75..a89c124e 100644 --- a/src/orb/types/customer_hierarchy_config_param.py +++ b/src/orb/types/customer_hierarchy_config_param.py @@ -2,14 +2,16 @@ from __future__ import annotations -from typing import List, Optional +from typing import Optional from typing_extensions import TypedDict +from .._types import SequenceNotStr + __all__ = ["CustomerHierarchyConfigParam"] class CustomerHierarchyConfigParam(TypedDict, total=False): - child_customer_ids: List[str] + child_customer_ids: SequenceNotStr[str] """A list of child customer IDs to add to the hierarchy. The desired child customers must not already be part of another hierarchy. 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 3b0d5b41..e0958916 100644 --- a/src/orb/types/customer_update_by_external_id_params.py +++ b/src/orb/types/customer_update_by_external_id_params.py @@ -2,9 +2,10 @@ from __future__ import annotations -from typing import Dict, List, Union, Optional +from typing import Dict, Union, Optional from typing_extensions import Literal, TypeAlias, TypedDict +from .._types import SequenceNotStr from .address_input_param import AddressInputParam from .shared_params.customer_tax_id import CustomerTaxID from .new_sphere_configuration_param import NewSphereConfigurationParam @@ -20,7 +21,7 @@ class CustomerUpdateByExternalIDParams(TypedDict, total=False): accounting_sync_configuration: Optional[NewAccountingSyncConfigurationParam] - additional_emails: Optional[List[str]] + additional_emails: Optional[SequenceNotStr[str]] """Additional email addresses for this customer. If populated, these email addresses will be CC'd for customer communications. @@ -33,6 +34,14 @@ class CustomerUpdateByExternalIDParams(TypedDict, total=False): when a payment provider is provided on customer creation. """ + auto_issuance: Optional[bool] + """Used to determine if invoices for this customer will be automatically issued. + + If true, invoices will be automatically issued. If false, invoices will require + manual approval.If `null` is specified, the customer's auto issuance setting + will be inherited from the account-level setting. + """ + billing_address: Optional[AddressInputParam] currency: Optional[str] diff --git a/src/orb/types/customer_update_params.py b/src/orb/types/customer_update_params.py index 3411a31f..d3f0617c 100644 --- a/src/orb/types/customer_update_params.py +++ b/src/orb/types/customer_update_params.py @@ -2,9 +2,10 @@ from __future__ import annotations -from typing import Dict, List, Union, Optional +from typing import Dict, Union, Optional from typing_extensions import Literal, TypeAlias, TypedDict +from .._types import SequenceNotStr from .address_input_param import AddressInputParam from .shared_params.customer_tax_id import CustomerTaxID from .new_sphere_configuration_param import NewSphereConfigurationParam @@ -20,7 +21,7 @@ class CustomerUpdateParams(TypedDict, total=False): accounting_sync_configuration: Optional[NewAccountingSyncConfigurationParam] - additional_emails: Optional[List[str]] + additional_emails: Optional[SequenceNotStr[str]] """Additional email addresses for this customer. If populated, these email addresses will be CC'd for customer communications. @@ -33,6 +34,14 @@ class CustomerUpdateParams(TypedDict, total=False): when a payment provider is provided on customer creation. """ + auto_issuance: Optional[bool] + """Used to determine if invoices for this customer will be automatically issued. + + If true, invoices will be automatically issued. If false, invoices will require + manual approval.If `null` is specified, the customer's auto issuance setting + will be inherited from the account-level setting. + """ + billing_address: Optional[AddressInputParam] currency: Optional[str] diff --git a/src/orb/types/customers/balance_transaction_create_response.py b/src/orb/types/customers/balance_transaction_create_response.py index 96424d1f..1141d365 100644 --- a/src/orb/types/customers/balance_transaction_create_response.py +++ b/src/orb/types/customers/balance_transaction_create_response.py @@ -25,6 +25,7 @@ class BalanceTransactionCreateResponse(BaseModel): "credit_note_voided", "overpayment_refund", "external_payment", + "small_invoice_carryover", ] amount: str diff --git a/src/orb/types/customers/balance_transaction_list_response.py b/src/orb/types/customers/balance_transaction_list_response.py index 81cb47e1..ac3ccea8 100644 --- a/src/orb/types/customers/balance_transaction_list_response.py +++ b/src/orb/types/customers/balance_transaction_list_response.py @@ -25,6 +25,7 @@ class BalanceTransactionListResponse(BaseModel): "credit_note_voided", "overpayment_refund", "external_payment", + "small_invoice_carryover", ] amount: str diff --git a/src/orb/types/customers/credits/ledger_create_entry_by_external_id_params.py b/src/orb/types/customers/credits/ledger_create_entry_by_external_id_params.py index 84291198..6db90ed6 100644 --- a/src/orb/types/customers/credits/ledger_create_entry_by_external_id_params.py +++ b/src/orb/types/customers/credits/ledger_create_entry_by_external_id_params.py @@ -82,10 +82,19 @@ class AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings(TypedDict, total """ net_terms: Required[Optional[int]] + """The net terms determines the due date of the invoice. + + Due date is calculated based on the invoice or issuance date, depending on the + account's configured due date calculation method. A value of '0' here represents + that the invoice is due on issue, whereas a value of '30' represents that the + customer has 30 days to pay the invoice. Do not set this field if you want to + set a custom due date. """ - 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. + + custom_due_date: Annotated[Union[Union[str, date], Union[str, datetime], None], PropertyInfo(format="iso8601")] + """An optional custom due date for the invoice. + + If not set, the due date will be calculated based on the `net_terms` value. """ invoice_date: Annotated[Union[Union[str, date], Union[str, datetime], None], PropertyInfo(format="iso8601")] diff --git a/src/orb/types/customers/credits/ledger_create_entry_params.py b/src/orb/types/customers/credits/ledger_create_entry_params.py index ac7a6a85..a300e05f 100644 --- a/src/orb/types/customers/credits/ledger_create_entry_params.py +++ b/src/orb/types/customers/credits/ledger_create_entry_params.py @@ -82,10 +82,19 @@ class AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings(TypedDict, total """ net_terms: Required[Optional[int]] + """The net terms determines the due date of the invoice. + + Due date is calculated based on the invoice or issuance date, depending on the + account's configured due date calculation method. A value of '0' here represents + that the invoice is due on issue, whereas a value of '30' represents that the + customer has 30 days to pay the invoice. Do not set this field if you want to + set a custom due date. """ - 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. + + custom_due_date: Annotated[Union[Union[str, date], Union[str, datetime], None], PropertyInfo(format="iso8601")] + """An optional custom due date for the invoice. + + If not set, the due date will be calculated based on the `net_terms` value. """ invoice_date: Annotated[Union[Union[str, date], Union[str, datetime], None], PropertyInfo(format="iso8601")] diff --git a/src/orb/types/dimensional_price_group_create_params.py b/src/orb/types/dimensional_price_group_create_params.py index 36c07bf1..d1780014 100644 --- a/src/orb/types/dimensional_price_group_create_params.py +++ b/src/orb/types/dimensional_price_group_create_params.py @@ -2,16 +2,18 @@ from __future__ import annotations -from typing import Dict, List, Optional +from typing import Dict, Optional from typing_extensions import Required, TypedDict +from .._types import SequenceNotStr + __all__ = ["DimensionalPriceGroupCreateParams"] class DimensionalPriceGroupCreateParams(TypedDict, total=False): billable_metric_id: Required[str] - dimensions: Required[List[str]] + dimensions: Required[SequenceNotStr[str]] """The set of keys (in order) used to disambiguate prices in the group.""" name: Required[str] diff --git a/src/orb/types/event_search_params.py b/src/orb/types/event_search_params.py index e422ae4f..a69e92ee 100644 --- a/src/orb/types/event_search_params.py +++ b/src/orb/types/event_search_params.py @@ -2,17 +2,18 @@ from __future__ import annotations -from typing import List, Union +from typing import Union from datetime import datetime from typing_extensions import Required, Annotated, TypedDict +from .._types import SequenceNotStr from .._utils import PropertyInfo __all__ = ["EventSearchParams"] class EventSearchParams(TypedDict, total=False): - event_ids: Required[List[str]] + event_ids: Required[SequenceNotStr[str]] """This is an explicit array of IDs to filter by. Note that an event's ID is the idempotency_key that was originally used for diff --git a/src/orb/types/invoice_create_params.py b/src/orb/types/invoice_create_params.py index 7154f066..c6cacf24 100644 --- a/src/orb/types/invoice_create_params.py +++ b/src/orb/types/invoice_create_params.py @@ -38,6 +38,12 @@ class InvoiceCreateParams(TypedDict, total=False): discount: Optional[Discount] """An optional discount to attach to the invoice.""" + due_date: Annotated[Union[Union[str, date], Union[str, datetime], None], PropertyInfo(format="iso8601")] + """An optional custom due date for the invoice. + + If not set, the due date will be calculated based on the `net_terms` value. + """ + external_customer_id: Optional[str] """The `external_customer_id` of the `Customer` to create this invoice for. @@ -45,7 +51,10 @@ class InvoiceCreateParams(TypedDict, total=False): """ memo: Optional[str] - """An optional memo to attach to the invoice.""" + """An optional memo to attach to the invoice. + + If no memo is provided, we will attach the default memo + """ metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -55,11 +64,13 @@ class InvoiceCreateParams(TypedDict, total=False): """ net_terms: Optional[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 - 30 days to pay the invoice. + """The net terms determines the due date of the invoice. + + Due date is calculated based on the invoice or issuance date, depending on the + account's configured due date calculation method. A value of '0' here represents + that the invoice is due on issue, whereas a value of '30' represents that the + customer has 30 days to pay the invoice. Do not set this field if you want to + set a custom due date. """ will_auto_issue: bool diff --git a/src/orb/types/invoice_fetch_upcoming_response.py b/src/orb/types/invoice_fetch_upcoming_response.py index 418e3cfa..2a79e064 100644 --- a/src/orb/types/invoice_fetch_upcoming_response.py +++ b/src/orb/types/invoice_fetch_upcoming_response.py @@ -99,6 +99,7 @@ class CustomerBalanceTransaction(BaseModel): "credit_note_voided", "overpayment_refund", "external_payment", + "small_invoice_carryover", ] amount: str @@ -232,7 +233,7 @@ class LineItem(BaseModel): """ subtotal: str - """The line amount before before any adjustments.""" + """The line amount before any adjustments.""" tax_amounts: List[TaxAmount] """An array of tax rates and their incurred tax amounts. @@ -262,6 +263,12 @@ class PaymentAttempt(BaseModel): payment_provider_id: Optional[str] = None """The ID of the payment attempt in the payment provider.""" + receipt_pdf: Optional[str] = None + """URL to the downloadable PDF version of the receipt. + + This field will be `null` for payment attempts that did not succeed. + """ + succeeded: bool """Whether the payment attempt succeeded.""" diff --git a/src/orb/types/invoice_line_item_create_response.py b/src/orb/types/invoice_line_item_create_response.py index fb3cfa03..ed91c31f 100644 --- a/src/orb/types/invoice_line_item_create_response.py +++ b/src/orb/types/invoice_line_item_create_response.py @@ -125,7 +125,7 @@ class InvoiceLineItemCreateResponse(BaseModel): """ subtotal: str - """The line amount before before any adjustments.""" + """The line amount before any adjustments.""" tax_amounts: List[TaxAmount] """An array of tax rates and their incurred tax amounts. diff --git a/src/orb/types/invoice_update_params.py b/src/orb/types/invoice_update_params.py index e0e5c347..a999f44c 100644 --- a/src/orb/types/invoice_update_params.py +++ b/src/orb/types/invoice_update_params.py @@ -2,16 +2,35 @@ from __future__ import annotations -from typing import Dict, Optional -from typing_extensions import TypedDict +from typing import Dict, Union, Optional +from datetime import date, datetime +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo __all__ = ["InvoiceUpdateParams"] class InvoiceUpdateParams(TypedDict, total=False): + due_date: Annotated[Union[Union[str, date], Union[str, datetime], None], PropertyInfo(format="iso8601")] + """An optional custom due date for the invoice. + + If not set, the due date will be calculated based on the `net_terms` value. + """ + 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`. """ + + net_terms: Optional[int] + """The net terms determines the due date of the invoice. + + Due date is calculated based on the invoice or issuance date, depending on the + account's configured due date calculation method. A value of '0' here represents + that the invoice is due on issue, whereas a value of '30' represents that the + customer has 30 days to pay the invoice. Do not set this field if you want to + set a custom due date. + """ diff --git a/src/orb/types/new_subscription_bulk_bps_price_param.py b/src/orb/types/new_subscription_bulk_bps_price_param.py deleted file mode 100644 index f3623e87..00000000 --- a/src/orb/types/new_subscription_bulk_bps_price_param.py +++ /dev/null @@ -1,95 +0,0 @@ -# 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 .shared_params.bulk_bps_config import BulkBPSConfig -from .shared_params.unit_conversion_rate_config import UnitConversionRateConfig -from .shared_params.tiered_conversion_rate_config import TieredConversionRateConfig -from .shared_params.new_billing_cycle_configuration import NewBillingCycleConfiguration -from .shared_params.new_dimensional_price_configuration import NewDimensionalPriceConfiguration - -__all__ = ["NewSubscriptionBulkBPSPriceParam", "ConversionRateConfig"] - -ConversionRateConfig: TypeAlias = Union[UnitConversionRateConfig, TieredConversionRateConfig] - - -class NewSubscriptionBulkBPSPriceParam(TypedDict, total=False): - bulk_bps_config: Required[BulkBPSConfig] - - 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[NewBillingCycleConfiguration] - """ - 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.""" - - conversion_rate_config: Optional[ConversionRateConfig] - """The configuration for the 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. - """ - - dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] - """For dimensional price: specifies a price group and dimension values""" - - 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[NewBillingCycleConfiguration] - """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. - """ diff --git a/src/orb/types/new_subscription_bps_price_param.py b/src/orb/types/new_subscription_minimum_composite_price_param.py similarity index 84% rename from src/orb/types/new_subscription_bps_price_param.py rename to src/orb/types/new_subscription_minimum_composite_price_param.py index d4cc3e3c..e7ad72db 100644 --- a/src/orb/types/new_subscription_bps_price_param.py +++ b/src/orb/types/new_subscription_minimum_composite_price_param.py @@ -5,27 +5,38 @@ from typing import Dict, Union, Optional from typing_extensions import Literal, Required, TypeAlias, TypedDict -from .shared_params.bps_config import BPSConfig from .shared_params.unit_conversion_rate_config import UnitConversionRateConfig from .shared_params.tiered_conversion_rate_config import TieredConversionRateConfig from .shared_params.new_billing_cycle_configuration import NewBillingCycleConfiguration from .shared_params.new_dimensional_price_configuration import NewDimensionalPriceConfiguration -__all__ = ["NewSubscriptionBPSPriceParam", "ConversionRateConfig"] +__all__ = ["NewSubscriptionMinimumCompositePriceParam", "MinimumConfig", "ConversionRateConfig"] + + +class MinimumConfig(TypedDict, total=False): + minimum_amount: Required[str] + """The minimum amount to apply""" + + prorated: Optional[bool] + """ + By default, subtotals from minimum composite prices are prorated based on the + service period. Set to false to disable proration. + """ -ConversionRateConfig: TypeAlias = Union[UnitConversionRateConfig, TieredConversionRateConfig] +ConversionRateConfig: TypeAlias = Union[UnitConversionRateConfig, TieredConversionRateConfig] -class NewSubscriptionBPSPriceParam(TypedDict, total=False): - bps_config: Required[BPSConfig] +class NewSubscriptionMinimumCompositePriceParam(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["bps"]] + minimum_config: Required[MinimumConfig] + + model_type: Required[Literal["minimum"]] name: Required[str] """The name of the price.""" diff --git a/src/orb/types/new_subscription_tiered_bps_price_param.py b/src/orb/types/new_subscription_tiered_bps_price_param.py deleted file mode 100644 index 925e740d..00000000 --- a/src/orb/types/new_subscription_tiered_bps_price_param.py +++ /dev/null @@ -1,95 +0,0 @@ -# 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 .shared_params.tiered_bps_config import TieredBPSConfig -from .shared_params.unit_conversion_rate_config import UnitConversionRateConfig -from .shared_params.tiered_conversion_rate_config import TieredConversionRateConfig -from .shared_params.new_billing_cycle_configuration import NewBillingCycleConfiguration -from .shared_params.new_dimensional_price_configuration import NewDimensionalPriceConfiguration - -__all__ = ["NewSubscriptionTieredBPSPriceParam", "ConversionRateConfig"] - -ConversionRateConfig: TypeAlias = Union[UnitConversionRateConfig, TieredConversionRateConfig] - - -class NewSubscriptionTieredBPSPriceParam(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[TieredBPSConfig] - - 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[NewBillingCycleConfiguration] - """ - 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.""" - - conversion_rate_config: Optional[ConversionRateConfig] - """The configuration for the 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. - """ - - dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] - """For dimensional price: specifies a price group and dimension values""" - - 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[NewBillingCycleConfiguration] - """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. - """ diff --git a/src/orb/types/plan_create_params.py b/src/orb/types/plan_create_params.py index d1619d7c..d4f9598c 100644 --- a/src/orb/types/plan_create_params.py +++ b/src/orb/types/plan_create_params.py @@ -7,7 +7,6 @@ from .shared_params.new_maximum import NewMaximum from .shared_params.new_minimum import NewMinimum -from .shared_params.new_plan_bps_price import NewPlanBPSPrice from .shared_params.new_usage_discount import NewUsageDiscount from .shared_params.new_amount_discount import NewAmountDiscount from .shared_params.new_plan_bulk_price import NewPlanBulkPrice @@ -17,16 +16,19 @@ from .shared_params.new_plan_tiered_price import NewPlanTieredPrice from .shared_params.new_plan_package_price import NewPlanPackagePrice from .shared_params.new_percentage_discount import NewPercentageDiscount -from .shared_params.new_plan_bulk_bps_price import NewPlanBulkBPSPrice -from .shared_params.new_plan_tiered_bps_price import NewPlanTieredBPSPrice +from .shared_params.unit_conversion_rate_config import UnitConversionRateConfig from .shared_params.new_plan_grouped_tiered_price import NewPlanGroupedTieredPrice from .shared_params.new_plan_tiered_package_price import NewPlanTieredPackagePrice +from .shared_params.tiered_conversion_rate_config import TieredConversionRateConfig +from .shared_params.new_billing_cycle_configuration import NewBillingCycleConfiguration +from .shared_params.new_plan_minimum_composite_price import NewPlanMinimumCompositePrice from .shared_params.new_plan_unit_with_percent_price import NewPlanUnitWithPercentPrice from .shared_params.new_plan_grouped_allocation_price import NewPlanGroupedAllocationPrice from .shared_params.new_plan_bulk_with_proration_price import NewPlanBulkWithProrationPrice from .shared_params.new_plan_tier_with_proration_price import NewPlanTierWithProrationPrice from .shared_params.new_plan_tiered_with_minimum_price import NewPlanTieredWithMinimumPrice from .shared_params.new_plan_unit_with_proration_price import NewPlanUnitWithProrationPrice +from .shared_params.new_dimensional_price_configuration import NewDimensionalPriceConfiguration from .shared_params.new_plan_grouped_tiered_package_price import NewPlanGroupedTieredPackagePrice from .shared_params.new_plan_matrix_with_allocation_price import NewPlanMatrixWithAllocationPrice from .shared_params.new_plan_threshold_total_amount_price import NewPlanThresholdTotalAmountPrice @@ -42,7 +44,16 @@ NewPlanScalableMatrixWithTieredPricingPrice, ) -__all__ = ["PlanCreateParams", "Price", "PricePrice", "Adjustment", "AdjustmentAdjustment", "PlanPhase"] +__all__ = [ + "PlanCreateParams", + "Price", + "PricePrice", + "PricePriceNewPlanGroupedWithMinMaxThresholdsPrice", + "PricePriceNewPlanGroupedWithMinMaxThresholdsPriceConversionRateConfig", + "Adjustment", + "AdjustmentAdjustment", + "PlanPhase", +] class PlanCreateParams(TypedDict, total=False): @@ -100,14 +111,95 @@ class PlanCreateParams(TypedDict, total=False): """ +PricePriceNewPlanGroupedWithMinMaxThresholdsPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class PricePriceNewPlanGroupedWithMinMaxThresholdsPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_with_min_max_thresholds_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_min_max_thresholds"]] + + 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[NewBillingCycleConfiguration] + """ + 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.""" + + conversion_rate_config: Optional[PricePriceNewPlanGroupedWithMinMaxThresholdsPriceConversionRateConfig] + """The configuration for the 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. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + 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[NewBillingCycleConfiguration] + """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. + """ + + PricePrice: TypeAlias = Union[ NewPlanUnitPrice, NewPlanPackagePrice, NewPlanMatrixPrice, NewPlanTieredPrice, - NewPlanTieredBPSPrice, - NewPlanBPSPrice, - NewPlanBulkBPSPrice, NewPlanBulkPrice, NewPlanThresholdTotalAmountPrice, NewPlanTieredPackagePrice, @@ -119,6 +211,7 @@ class PlanCreateParams(TypedDict, total=False): NewPlanGroupedAllocationPrice, NewPlanGroupedWithProratedMinimumPrice, NewPlanGroupedWithMeteredMinimumPrice, + PricePriceNewPlanGroupedWithMinMaxThresholdsPrice, NewPlanMatrixWithDisplayNamePrice, NewPlanBulkWithProrationPrice, NewPlanGroupedTieredPackagePrice, @@ -129,6 +222,7 @@ class PlanCreateParams(TypedDict, total=False): NewPlanTieredPackageWithMinimumPrice, NewPlanMatrixWithAllocationPrice, NewPlanGroupedTieredPrice, + NewPlanMinimumCompositePrice, ] diff --git a/src/orb/types/price_create_params.py b/src/orb/types/price_create_params.py index 2d4e37e9..07d04453 100644 --- a/src/orb/types/price_create_params.py +++ b/src/orb/types/price_create_params.py @@ -5,14 +5,11 @@ from typing import Dict, Union, Optional from typing_extensions import Literal, Required, TypeAlias, TypedDict -from .shared_params.bps_config import BPSConfig from .shared_params.bulk_config import BulkConfig from .shared_params.unit_config import UnitConfig from .shared_params.matrix_config import MatrixConfig from .shared_params.tiered_config import TieredConfig from .shared_params.package_config import PackageConfig -from .shared_params.bulk_bps_config import BulkBPSConfig -from .shared_params.tiered_bps_config import TieredBPSConfig from .shared_params.unit_conversion_rate_config import UnitConversionRateConfig from .shared_params.matrix_with_allocation_config import MatrixWithAllocationConfig from .shared_params.tiered_conversion_rate_config import TieredConversionRateConfig @@ -31,12 +28,6 @@ "NewFloatingMatrixWithAllocationPriceConversionRateConfig", "NewFloatingTieredPrice", "NewFloatingTieredPriceConversionRateConfig", - "NewFloatingTieredBPSPrice", - "NewFloatingTieredBPSPriceConversionRateConfig", - "NewFloatingBPSPrice", - "NewFloatingBPSPriceConversionRateConfig", - "NewFloatingBulkBPSPrice", - "NewFloatingBulkBPSPriceConversionRateConfig", "NewFloatingBulkPrice", "NewFloatingBulkPriceConversionRateConfig", "NewFloatingThresholdTotalAmountPrice", @@ -77,6 +68,11 @@ "NewFloatingScalableMatrixWithTieredPricingPriceConversionRateConfig", "NewFloatingCumulativeGroupedBulkPrice", "NewFloatingCumulativeGroupedBulkPriceConversionRateConfig", + "NewFloatingGroupedWithMinMaxThresholdsPrice", + "NewFloatingGroupedWithMinMaxThresholdsPriceConversionRateConfig", + "NewFloatingMinimumCompositePrice", + "NewFloatingMinimumCompositePriceMinimumConfig", + "NewFloatingMinimumCompositePriceConversionRateConfig", ] @@ -447,7 +443,9 @@ class NewFloatingTieredPrice(TypedDict, total=False): NewFloatingTieredPriceConversionRateConfig: TypeAlias = Union[UnitConversionRateConfig, TieredConversionRateConfig] -class NewFloatingTieredBPSPrice(TypedDict, total=False): +class NewFloatingBulkPrice(TypedDict, total=False): + bulk_config: Required[BulkConfig] + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -457,13 +455,11 @@ class NewFloatingTieredBPSPrice(TypedDict, total=False): item_id: Required[str] """The id of the item the price will be associated with.""" - model_type: Required[Literal["tiered_bps"]] + model_type: Required[Literal["bulk"]] name: Required[str] """The name of the price.""" - tiered_bps_config: Required[TieredBPSConfig] - billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -485,7 +481,7 @@ class NewFloatingTieredBPSPrice(TypedDict, total=False): conversion_rate: Optional[float] """The per unit conversion rate of the price currency to the invoicing currency.""" - conversion_rate_config: Optional[NewFloatingTieredBPSPriceConversionRateConfig] + conversion_rate_config: Optional[NewFloatingBulkPriceConversionRateConfig] """The configuration for the rate of the price currency to the invoicing currency.""" dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] @@ -517,12 +513,10 @@ class NewFloatingTieredBPSPrice(TypedDict, total=False): """ -NewFloatingTieredBPSPriceConversionRateConfig: TypeAlias = Union[UnitConversionRateConfig, TieredConversionRateConfig] - +NewFloatingBulkPriceConversionRateConfig: TypeAlias = Union[UnitConversionRateConfig, TieredConversionRateConfig] -class NewFloatingBPSPrice(TypedDict, total=False): - bps_config: Required[BPSConfig] +class NewFloatingThresholdTotalAmountPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -532,11 +526,13 @@ class NewFloatingBPSPrice(TypedDict, total=False): item_id: Required[str] """The id of the item the price will be associated with.""" - model_type: Required[Literal["bps"]] + 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. @@ -558,7 +554,7 @@ class NewFloatingBPSPrice(TypedDict, total=False): conversion_rate: Optional[float] """The per unit conversion rate of the price currency to the invoicing currency.""" - conversion_rate_config: Optional[NewFloatingBPSPriceConversionRateConfig] + conversion_rate_config: Optional[NewFloatingThresholdTotalAmountPriceConversionRateConfig] """The configuration for the rate of the price currency to the invoicing currency.""" dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] @@ -590,12 +586,12 @@ class NewFloatingBPSPrice(TypedDict, total=False): """ -NewFloatingBPSPriceConversionRateConfig: TypeAlias = Union[UnitConversionRateConfig, TieredConversionRateConfig] - +NewFloatingThresholdTotalAmountPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] -class NewFloatingBulkBPSPrice(TypedDict, total=False): - bulk_bps_config: Required[BulkBPSConfig] +class NewFloatingTieredPackagePrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -605,11 +601,13 @@ class NewFloatingBulkBPSPrice(TypedDict, total=False): item_id: Required[str] """The id of the item the price will be associated with.""" - model_type: Required[Literal["bulk_bps"]] + 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. @@ -631,7 +629,7 @@ class NewFloatingBulkBPSPrice(TypedDict, total=False): conversion_rate: Optional[float] """The per unit conversion rate of the price currency to the invoicing currency.""" - conversion_rate_config: Optional[NewFloatingBulkBPSPriceConversionRateConfig] + conversion_rate_config: Optional[NewFloatingTieredPackagePriceConversionRateConfig] """The configuration for the rate of the price currency to the invoicing currency.""" dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] @@ -663,22 +661,24 @@ class NewFloatingBulkBPSPrice(TypedDict, total=False): """ -NewFloatingBulkBPSPriceConversionRateConfig: TypeAlias = Union[UnitConversionRateConfig, TieredConversionRateConfig] - +NewFloatingTieredPackagePriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] -class NewFloatingBulkPrice(TypedDict, total=False): - bulk_config: Required[BulkConfig] +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[Dict[str, object]] + item_id: Required[str] """The id of the item the price will be associated with.""" - model_type: Required[Literal["bulk"]] + model_type: Required[Literal["grouped_tiered"]] name: Required[str] """The name of the price.""" @@ -704,7 +704,7 @@ class NewFloatingBulkPrice(TypedDict, total=False): conversion_rate: Optional[float] """The per unit conversion rate of the price currency to the invoicing currency.""" - conversion_rate_config: Optional[NewFloatingBulkPriceConversionRateConfig] + conversion_rate_config: Optional[NewFloatingGroupedTieredPriceConversionRateConfig] """The configuration for the rate of the price currency to the invoicing currency.""" dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] @@ -736,10 +736,12 @@ class NewFloatingBulkPrice(TypedDict, total=False): """ -NewFloatingBulkPriceConversionRateConfig: TypeAlias = Union[UnitConversionRateConfig, TieredConversionRateConfig] +NewFloatingGroupedTieredPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] -class NewFloatingThresholdTotalAmountPrice(TypedDict, total=False): +class NewFloatingMaxGroupTieredPackagePrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -749,13 +751,13 @@ class NewFloatingThresholdTotalAmountPrice(TypedDict, total=False): item_id: Required[str] """The id of the item the price will be associated with.""" - model_type: Required[Literal["threshold_total_amount"]] + 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.""" - threshold_total_amount_config: Required[Dict[str, object]] - billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -777,7 +779,7 @@ class NewFloatingThresholdTotalAmountPrice(TypedDict, total=False): conversion_rate: Optional[float] """The per unit conversion rate of the price currency to the invoicing currency.""" - conversion_rate_config: Optional[NewFloatingThresholdTotalAmountPriceConversionRateConfig] + conversion_rate_config: Optional[NewFloatingMaxGroupTieredPackagePriceConversionRateConfig] """The configuration for the rate of the price currency to the invoicing currency.""" dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] @@ -809,12 +811,12 @@ class NewFloatingThresholdTotalAmountPrice(TypedDict, total=False): """ -NewFloatingThresholdTotalAmountPriceConversionRateConfig: TypeAlias = Union[ +NewFloatingMaxGroupTieredPackagePriceConversionRateConfig: TypeAlias = Union[ UnitConversionRateConfig, TieredConversionRateConfig ] -class NewFloatingTieredPackagePrice(TypedDict, total=False): +class NewFloatingTieredWithMinimumPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -824,12 +826,12 @@ class NewFloatingTieredPackagePrice(TypedDict, total=False): item_id: Required[str] """The id of the item the price will be associated with.""" - model_type: Required[Literal["tiered_package"]] + model_type: Required[Literal["tiered_with_minimum"]] name: Required[str] """The name of the price.""" - tiered_package_config: Required[Dict[str, object]] + tiered_with_minimum_config: Required[Dict[str, object]] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -852,7 +854,7 @@ class NewFloatingTieredPackagePrice(TypedDict, total=False): conversion_rate: Optional[float] """The per unit conversion rate of the price currency to the invoicing currency.""" - conversion_rate_config: Optional[NewFloatingTieredPackagePriceConversionRateConfig] + conversion_rate_config: Optional[NewFloatingTieredWithMinimumPriceConversionRateConfig] """The configuration for the rate of the price currency to the invoicing currency.""" dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] @@ -884,28 +886,28 @@ class NewFloatingTieredPackagePrice(TypedDict, total=False): """ -NewFloatingTieredPackagePriceConversionRateConfig: TypeAlias = Union[ +NewFloatingTieredWithMinimumPriceConversionRateConfig: TypeAlias = Union[ UnitConversionRateConfig, TieredConversionRateConfig ] -class NewFloatingGroupedTieredPrice(TypedDict, total=False): +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.""" - 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"]] + 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. @@ -927,7 +929,7 @@ class NewFloatingGroupedTieredPrice(TypedDict, total=False): conversion_rate: Optional[float] """The per unit conversion rate of the price currency to the invoicing currency.""" - conversion_rate_config: Optional[NewFloatingGroupedTieredPriceConversionRateConfig] + conversion_rate_config: Optional[NewFloatingPackageWithAllocationPriceConversionRateConfig] """The configuration for the rate of the price currency to the invoicing currency.""" dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] @@ -959,12 +961,12 @@ class NewFloatingGroupedTieredPrice(TypedDict, total=False): """ -NewFloatingGroupedTieredPriceConversionRateConfig: TypeAlias = Union[ +NewFloatingPackageWithAllocationPriceConversionRateConfig: TypeAlias = Union[ UnitConversionRateConfig, TieredConversionRateConfig ] -class NewFloatingMaxGroupTieredPackagePrice(TypedDict, total=False): +class NewFloatingTieredPackageWithMinimumPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -974,13 +976,13 @@ 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]] - - model_type: Required[Literal["max_group_tiered_package"]] + 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. @@ -1002,7 +1004,7 @@ class NewFloatingMaxGroupTieredPackagePrice(TypedDict, total=False): conversion_rate: Optional[float] """The per unit conversion rate of the price currency to the invoicing currency.""" - conversion_rate_config: Optional[NewFloatingMaxGroupTieredPackagePriceConversionRateConfig] + conversion_rate_config: Optional[NewFloatingTieredPackageWithMinimumPriceConversionRateConfig] """The configuration for the rate of the price currency to the invoicing currency.""" dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] @@ -1034,12 +1036,12 @@ class NewFloatingMaxGroupTieredPackagePrice(TypedDict, total=False): """ -NewFloatingMaxGroupTieredPackagePriceConversionRateConfig: TypeAlias = Union[ +NewFloatingTieredPackageWithMinimumPriceConversionRateConfig: TypeAlias = Union[ UnitConversionRateConfig, TieredConversionRateConfig ] -class NewFloatingTieredWithMinimumPrice(TypedDict, total=False): +class NewFloatingUnitWithPercentPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -1049,12 +1051,12 @@ class NewFloatingTieredWithMinimumPrice(TypedDict, total=False): item_id: Required[str] """The id of the item the price will be associated with.""" - model_type: Required[Literal["tiered_with_minimum"]] + model_type: Required[Literal["unit_with_percent"]] name: Required[str] """The name of the price.""" - tiered_with_minimum_config: Required[Dict[str, object]] + unit_with_percent_config: Required[Dict[str, object]] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -1077,7 +1079,7 @@ class NewFloatingTieredWithMinimumPrice(TypedDict, total=False): conversion_rate: Optional[float] """The per unit conversion rate of the price currency to the invoicing currency.""" - conversion_rate_config: Optional[NewFloatingTieredWithMinimumPriceConversionRateConfig] + conversion_rate_config: Optional[NewFloatingUnitWithPercentPriceConversionRateConfig] """The configuration for the rate of the price currency to the invoicing currency.""" dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] @@ -1109,12 +1111,12 @@ class NewFloatingTieredWithMinimumPrice(TypedDict, total=False): """ -NewFloatingTieredWithMinimumPriceConversionRateConfig: TypeAlias = Union[ +NewFloatingUnitWithPercentPriceConversionRateConfig: TypeAlias = Union[ UnitConversionRateConfig, TieredConversionRateConfig ] -class NewFloatingPackageWithAllocationPrice(TypedDict, total=False): +class NewFloatingTieredWithProrationPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -1124,12 +1126,12 @@ class NewFloatingPackageWithAllocationPrice(TypedDict, total=False): item_id: Required[str] """The id of the item the price will be associated with.""" - model_type: Required[Literal["package_with_allocation"]] + model_type: Required[Literal["tiered_with_proration"]] name: Required[str] """The name of the price.""" - package_with_allocation_config: Required[Dict[str, object]] + tiered_with_proration_config: Required[Dict[str, object]] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -1152,7 +1154,7 @@ class NewFloatingPackageWithAllocationPrice(TypedDict, total=False): conversion_rate: Optional[float] """The per unit conversion rate of the price currency to the invoicing currency.""" - conversion_rate_config: Optional[NewFloatingPackageWithAllocationPriceConversionRateConfig] + conversion_rate_config: Optional[NewFloatingTieredWithProrationPriceConversionRateConfig] """The configuration for the rate of the price currency to the invoicing currency.""" dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] @@ -1184,12 +1186,12 @@ class NewFloatingPackageWithAllocationPrice(TypedDict, total=False): """ -NewFloatingPackageWithAllocationPriceConversionRateConfig: TypeAlias = Union[ +NewFloatingTieredWithProrationPriceConversionRateConfig: TypeAlias = Union[ UnitConversionRateConfig, TieredConversionRateConfig ] -class NewFloatingTieredPackageWithMinimumPrice(TypedDict, total=False): +class NewFloatingUnitWithProrationPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -1199,12 +1201,12 @@ class NewFloatingTieredPackageWithMinimumPrice(TypedDict, total=False): item_id: Required[str] """The id of the item the price will be associated with.""" - model_type: Required[Literal["tiered_package_with_minimum"]] + model_type: Required[Literal["unit_with_proration"]] name: Required[str] """The name of the price.""" - tiered_package_with_minimum_config: Required[Dict[str, object]] + unit_with_proration_config: Required[Dict[str, object]] billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -1227,7 +1229,7 @@ class NewFloatingTieredPackageWithMinimumPrice(TypedDict, total=False): conversion_rate: Optional[float] """The per unit conversion rate of the price currency to the invoicing currency.""" - conversion_rate_config: Optional[NewFloatingTieredPackageWithMinimumPriceConversionRateConfig] + conversion_rate_config: Optional[NewFloatingUnitWithProrationPriceConversionRateConfig] """The configuration for the rate of the price currency to the invoicing currency.""" dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] @@ -1259,28 +1261,28 @@ class NewFloatingTieredPackageWithMinimumPrice(TypedDict, total=False): """ -NewFloatingTieredPackageWithMinimumPriceConversionRateConfig: TypeAlias = Union[ +NewFloatingUnitWithProrationPriceConversionRateConfig: TypeAlias = Union[ UnitConversionRateConfig, TieredConversionRateConfig ] -class NewFloatingUnitWithPercentPrice(TypedDict, total=False): +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[Dict[str, object]] + item_id: Required[str] """The id of the item the price will be associated with.""" - model_type: Required[Literal["unit_with_percent"]] + model_type: Required[Literal["grouped_allocation"]] 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. @@ -1302,7 +1304,7 @@ class NewFloatingUnitWithPercentPrice(TypedDict, total=False): conversion_rate: Optional[float] """The per unit conversion rate of the price currency to the invoicing currency.""" - conversion_rate_config: Optional[NewFloatingUnitWithPercentPriceConversionRateConfig] + conversion_rate_config: Optional[NewFloatingGroupedAllocationPriceConversionRateConfig] """The configuration for the rate of the price currency to the invoicing currency.""" dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] @@ -1334,28 +1336,28 @@ class NewFloatingUnitWithPercentPrice(TypedDict, total=False): """ -NewFloatingUnitWithPercentPriceConversionRateConfig: TypeAlias = Union[ +NewFloatingGroupedAllocationPriceConversionRateConfig: TypeAlias = Union[ UnitConversionRateConfig, TieredConversionRateConfig ] -class NewFloatingTieredWithProrationPrice(TypedDict, total=False): +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[Dict[str, object]] + item_id: Required[str] """The id of the item the price will be associated with.""" - model_type: Required[Literal["tiered_with_proration"]] + model_type: Required[Literal["grouped_with_prorated_minimum"]] 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. @@ -1377,7 +1379,7 @@ class NewFloatingTieredWithProrationPrice(TypedDict, total=False): conversion_rate: Optional[float] """The per unit conversion rate of the price currency to the invoicing currency.""" - conversion_rate_config: Optional[NewFloatingTieredWithProrationPriceConversionRateConfig] + conversion_rate_config: Optional[NewFloatingGroupedWithProratedMinimumPriceConversionRateConfig] """The configuration for the rate of the price currency to the invoicing currency.""" dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] @@ -1409,28 +1411,28 @@ class NewFloatingTieredWithProrationPrice(TypedDict, total=False): """ -NewFloatingTieredWithProrationPriceConversionRateConfig: TypeAlias = Union[ +NewFloatingGroupedWithProratedMinimumPriceConversionRateConfig: TypeAlias = Union[ UnitConversionRateConfig, TieredConversionRateConfig ] -class NewFloatingUnitWithProrationPrice(TypedDict, total=False): +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[Dict[str, object]] + item_id: Required[str] """The id of the item the price will be associated with.""" - model_type: Required[Literal["unit_with_proration"]] + model_type: Required[Literal["grouped_with_metered_minimum"]] 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. @@ -1452,7 +1454,7 @@ class NewFloatingUnitWithProrationPrice(TypedDict, total=False): conversion_rate: Optional[float] """The per unit conversion rate of the price currency to the invoicing currency.""" - conversion_rate_config: Optional[NewFloatingUnitWithProrationPriceConversionRateConfig] + conversion_rate_config: Optional[NewFloatingGroupedWithMeteredMinimumPriceConversionRateConfig] """The configuration for the rate of the price currency to the invoicing currency.""" dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] @@ -1484,24 +1486,24 @@ class NewFloatingUnitWithProrationPrice(TypedDict, total=False): """ -NewFloatingUnitWithProrationPriceConversionRateConfig: TypeAlias = Union[ +NewFloatingGroupedWithMeteredMinimumPriceConversionRateConfig: TypeAlias = Union[ UnitConversionRateConfig, TieredConversionRateConfig ] -class NewFloatingGroupedAllocationPrice(TypedDict, total=False): +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.""" - 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"]] + 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.""" @@ -1527,7 +1529,7 @@ class NewFloatingGroupedAllocationPrice(TypedDict, total=False): conversion_rate: Optional[float] """The per unit conversion rate of the price currency to the invoicing currency.""" - conversion_rate_config: Optional[NewFloatingGroupedAllocationPriceConversionRateConfig] + conversion_rate_config: Optional[NewFloatingMatrixWithDisplayNamePriceConversionRateConfig] """The configuration for the rate of the price currency to the invoicing currency.""" dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] @@ -1559,24 +1561,24 @@ class NewFloatingGroupedAllocationPrice(TypedDict, total=False): """ -NewFloatingGroupedAllocationPriceConversionRateConfig: TypeAlias = Union[ +NewFloatingMatrixWithDisplayNamePriceConversionRateConfig: TypeAlias = Union[ UnitConversionRateConfig, TieredConversionRateConfig ] -class NewFloatingGroupedWithProratedMinimumPrice(TypedDict, total=False): +class NewFloatingBulkWithProrationPrice(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.""" - 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"]] + model_type: Required[Literal["bulk_with_proration"]] name: Required[str] """The name of the price.""" @@ -1602,7 +1604,7 @@ class NewFloatingGroupedWithProratedMinimumPrice(TypedDict, total=False): conversion_rate: Optional[float] """The per unit conversion rate of the price currency to the invoicing currency.""" - conversion_rate_config: Optional[NewFloatingGroupedWithProratedMinimumPriceConversionRateConfig] + conversion_rate_config: Optional[NewFloatingBulkWithProrationPriceConversionRateConfig] """The configuration for the rate of the price currency to the invoicing currency.""" dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] @@ -1634,24 +1636,24 @@ class NewFloatingGroupedWithProratedMinimumPrice(TypedDict, total=False): """ -NewFloatingGroupedWithProratedMinimumPriceConversionRateConfig: TypeAlias = Union[ +NewFloatingBulkWithProrationPriceConversionRateConfig: TypeAlias = Union[ UnitConversionRateConfig, TieredConversionRateConfig ] -class NewFloatingGroupedWithMeteredMinimumPrice(TypedDict, total=False): +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_with_metered_minimum_config: Required[Dict[str, object]] + 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_with_metered_minimum"]] + model_type: Required[Literal["grouped_tiered_package"]] name: Required[str] """The name of the price.""" @@ -1677,7 +1679,7 @@ class NewFloatingGroupedWithMeteredMinimumPrice(TypedDict, total=False): conversion_rate: Optional[float] """The per unit conversion rate of the price currency to the invoicing currency.""" - conversion_rate_config: Optional[NewFloatingGroupedWithMeteredMinimumPriceConversionRateConfig] + conversion_rate_config: Optional[NewFloatingGroupedTieredPackagePriceConversionRateConfig] """The configuration for the rate of the price currency to the invoicing currency.""" dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] @@ -1709,12 +1711,12 @@ class NewFloatingGroupedWithMeteredMinimumPrice(TypedDict, total=False): """ -NewFloatingGroupedWithMeteredMinimumPriceConversionRateConfig: TypeAlias = Union[ +NewFloatingGroupedTieredPackagePriceConversionRateConfig: TypeAlias = Union[ UnitConversionRateConfig, TieredConversionRateConfig ] -class NewFloatingMatrixWithDisplayNamePrice(TypedDict, total=False): +class NewFloatingScalableMatrixWithUnitPricingPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -1724,13 +1726,13 @@ 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]] - - model_type: Required[Literal["matrix_with_display_name"]] + 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. @@ -1752,7 +1754,7 @@ class NewFloatingMatrixWithDisplayNamePrice(TypedDict, total=False): conversion_rate: Optional[float] """The per unit conversion rate of the price currency to the invoicing currency.""" - conversion_rate_config: Optional[NewFloatingMatrixWithDisplayNamePriceConversionRateConfig] + conversion_rate_config: Optional[NewFloatingScalableMatrixWithUnitPricingPriceConversionRateConfig] """The configuration for the rate of the price currency to the invoicing currency.""" dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] @@ -1784,14 +1786,12 @@ class NewFloatingMatrixWithDisplayNamePrice(TypedDict, total=False): """ -NewFloatingMatrixWithDisplayNamePriceConversionRateConfig: TypeAlias = Union[ +NewFloatingScalableMatrixWithUnitPricingPriceConversionRateConfig: TypeAlias = Union[ UnitConversionRateConfig, TieredConversionRateConfig ] -class NewFloatingBulkWithProrationPrice(TypedDict, total=False): - bulk_with_proration_config: Required[Dict[str, object]] - +class NewFloatingScalableMatrixWithTieredPricingPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -1801,11 +1801,13 @@ class NewFloatingBulkWithProrationPrice(TypedDict, total=False): item_id: Required[str] """The id of the item the price will be associated with.""" - model_type: Required[Literal["bulk_with_proration"]] + 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. @@ -1827,7 +1829,7 @@ class NewFloatingBulkWithProrationPrice(TypedDict, total=False): conversion_rate: Optional[float] """The per unit conversion rate of the price currency to the invoicing currency.""" - conversion_rate_config: Optional[NewFloatingBulkWithProrationPriceConversionRateConfig] + conversion_rate_config: Optional[NewFloatingScalableMatrixWithTieredPricingPriceConversionRateConfig] """The configuration for the rate of the price currency to the invoicing currency.""" dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] @@ -1859,24 +1861,24 @@ class NewFloatingBulkWithProrationPrice(TypedDict, total=False): """ -NewFloatingBulkWithProrationPriceConversionRateConfig: TypeAlias = Union[ +NewFloatingScalableMatrixWithTieredPricingPriceConversionRateConfig: TypeAlias = Union[ UnitConversionRateConfig, TieredConversionRateConfig ] -class NewFloatingGroupedTieredPackagePrice(TypedDict, total=False): +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]] + 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"]] + model_type: Required[Literal["cumulative_grouped_bulk"]] name: Required[str] """The name of the price.""" @@ -1902,7 +1904,7 @@ class NewFloatingGroupedTieredPackagePrice(TypedDict, total=False): conversion_rate: Optional[float] """The per unit conversion rate of the price currency to the invoicing currency.""" - conversion_rate_config: Optional[NewFloatingGroupedTieredPackagePriceConversionRateConfig] + conversion_rate_config: Optional[NewFloatingCumulativeGroupedBulkPriceConversionRateConfig] """The configuration for the rate of the price currency to the invoicing currency.""" dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] @@ -1934,28 +1936,28 @@ class NewFloatingGroupedTieredPackagePrice(TypedDict, total=False): """ -NewFloatingGroupedTieredPackagePriceConversionRateConfig: TypeAlias = Union[ +NewFloatingCumulativeGroupedBulkPriceConversionRateConfig: TypeAlias = Union[ UnitConversionRateConfig, TieredConversionRateConfig ] -class NewFloatingScalableMatrixWithUnitPricingPrice(TypedDict, total=False): +class NewFloatingGroupedWithMinMaxThresholdsPrice(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_min_max_thresholds_config: Required[Dict[str, object]] + item_id: Required[str] """The id of the item the price will be associated with.""" - model_type: Required[Literal["scalable_matrix_with_unit_pricing"]] + model_type: Required[Literal["grouped_with_min_max_thresholds"]] 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. @@ -1977,7 +1979,7 @@ class NewFloatingScalableMatrixWithUnitPricingPrice(TypedDict, total=False): conversion_rate: Optional[float] """The per unit conversion rate of the price currency to the invoicing currency.""" - conversion_rate_config: Optional[NewFloatingScalableMatrixWithUnitPricingPriceConversionRateConfig] + conversion_rate_config: Optional[NewFloatingGroupedWithMinMaxThresholdsPriceConversionRateConfig] """The configuration for the rate of the price currency to the invoicing currency.""" dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] @@ -2009,12 +2011,12 @@ class NewFloatingScalableMatrixWithUnitPricingPrice(TypedDict, total=False): """ -NewFloatingScalableMatrixWithUnitPricingPriceConversionRateConfig: TypeAlias = Union[ +NewFloatingGroupedWithMinMaxThresholdsPriceConversionRateConfig: TypeAlias = Union[ UnitConversionRateConfig, TieredConversionRateConfig ] -class NewFloatingScalableMatrixWithTieredPricingPrice(TypedDict, total=False): +class NewFloatingMinimumCompositePrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -2024,13 +2026,13 @@ class NewFloatingScalableMatrixWithTieredPricingPrice(TypedDict, total=False): item_id: Required[str] """The id of the item the price will be associated with.""" - model_type: Required[Literal["scalable_matrix_with_tiered_pricing"]] + minimum_config: Required[NewFloatingMinimumCompositePriceMinimumConfig] + + model_type: Required[Literal["minimum"]] 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. @@ -2052,7 +2054,7 @@ class NewFloatingScalableMatrixWithTieredPricingPrice(TypedDict, total=False): conversion_rate: Optional[float] """The per unit conversion rate of the price currency to the invoicing currency.""" - conversion_rate_config: Optional[NewFloatingScalableMatrixWithTieredPricingPriceConversionRateConfig] + conversion_rate_config: Optional[NewFloatingMinimumCompositePriceConversionRateConfig] """The configuration for the rate of the price currency to the invoicing currency.""" dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] @@ -2084,82 +2086,18 @@ class NewFloatingScalableMatrixWithTieredPricingPrice(TypedDict, total=False): """ -NewFloatingScalableMatrixWithTieredPricingPriceConversionRateConfig: TypeAlias = Union[ - UnitConversionRateConfig, TieredConversionRateConfig -] - - -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]] - - 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[NewBillingCycleConfiguration] - """ - 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.""" - - conversion_rate_config: Optional[NewFloatingCumulativeGroupedBulkPriceConversionRateConfig] - """The configuration for the rate of the price currency to the invoicing currency.""" - - dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] - """For dimensional price: specifies a price group and dimension values""" - - 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[NewBillingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. +class NewFloatingMinimumCompositePriceMinimumConfig(TypedDict, total=False): + minimum_amount: Required[str] + """The minimum amount to apply""" - If unspecified, a single invoice is produced per billing cycle. + prorated: Optional[bool] """ - - 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`. + By default, subtotals from minimum composite prices are prorated based on the + service period. Set to false to disable proration. """ -NewFloatingCumulativeGroupedBulkPriceConversionRateConfig: TypeAlias = Union[ +NewFloatingMinimumCompositePriceConversionRateConfig: TypeAlias = Union[ UnitConversionRateConfig, TieredConversionRateConfig ] @@ -2169,9 +2107,6 @@ class NewFloatingCumulativeGroupedBulkPrice(TypedDict, total=False): NewFloatingMatrixPrice, NewFloatingMatrixWithAllocationPrice, NewFloatingTieredPrice, - NewFloatingTieredBPSPrice, - NewFloatingBPSPrice, - NewFloatingBulkBPSPrice, NewFloatingBulkPrice, NewFloatingThresholdTotalAmountPrice, NewFloatingTieredPackagePrice, @@ -2192,4 +2127,6 @@ class NewFloatingCumulativeGroupedBulkPrice(TypedDict, total=False): NewFloatingScalableMatrixWithUnitPricingPrice, NewFloatingScalableMatrixWithTieredPricingPrice, NewFloatingCumulativeGroupedBulkPrice, + NewFloatingGroupedWithMinMaxThresholdsPrice, + NewFloatingMinimumCompositePrice, ] diff --git a/src/orb/types/price_evaluate_multiple_params.py b/src/orb/types/price_evaluate_multiple_params.py index 4587cb96..0610f565 100644 --- a/src/orb/types/price_evaluate_multiple_params.py +++ b/src/orb/types/price_evaluate_multiple_params.py @@ -2,21 +2,24 @@ from __future__ import annotations -from typing import List, Union, Iterable, Optional +from typing import Dict, Union, Iterable, Optional from datetime import datetime -from typing_extensions import Required, Annotated, TypeAlias, TypedDict +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from .._types import SequenceNotStr from .._utils import PropertyInfo -from .shared_params.new_floating_bps_price import NewFloatingBPSPrice from .shared_params.new_floating_bulk_price import NewFloatingBulkPrice from .shared_params.new_floating_unit_price import NewFloatingUnitPrice from .shared_params.new_floating_matrix_price import NewFloatingMatrixPrice from .shared_params.new_floating_tiered_price import NewFloatingTieredPrice from .shared_params.new_floating_package_price import NewFloatingPackagePrice -from .shared_params.new_floating_bulk_bps_price import NewFloatingBulkBPSPrice -from .shared_params.new_floating_tiered_bps_price import NewFloatingTieredBPSPrice +from .shared_params.unit_conversion_rate_config import UnitConversionRateConfig +from .shared_params.tiered_conversion_rate_config import TieredConversionRateConfig +from .shared_params.new_billing_cycle_configuration import NewBillingCycleConfiguration from .shared_params.new_floating_grouped_tiered_price import NewFloatingGroupedTieredPrice from .shared_params.new_floating_tiered_package_price import NewFloatingTieredPackagePrice +from .shared_params.new_dimensional_price_configuration import NewDimensionalPriceConfiguration +from .shared_params.new_floating_minimum_composite_price import NewFloatingMinimumCompositePrice from .shared_params.new_floating_unit_with_percent_price import NewFloatingUnitWithPercentPrice from .shared_params.new_floating_grouped_allocation_price import NewFloatingGroupedAllocationPrice from .shared_params.new_floating_bulk_with_proration_price import NewFloatingBulkWithProrationPrice @@ -40,7 +43,13 @@ NewFloatingScalableMatrixWithTieredPricingPrice, ) -__all__ = ["PriceEvaluateMultipleParams", "PriceEvaluation", "PriceEvaluationPrice"] +__all__ = [ + "PriceEvaluateMultipleParams", + "PriceEvaluation", + "PriceEvaluationPrice", + "PriceEvaluationPriceNewFloatingGroupedWithMinMaxThresholdsPrice", + "PriceEvaluationPriceNewFloatingGroupedWithMinMaxThresholdsPriceConversionRateConfig", +] class PriceEvaluateMultipleParams(TypedDict, total=False): @@ -60,15 +69,89 @@ class PriceEvaluateMultipleParams(TypedDict, total=False): """List of prices to evaluate (max 100)""" +PriceEvaluationPriceNewFloatingGroupedWithMinMaxThresholdsPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class PriceEvaluationPriceNewFloatingGroupedWithMinMaxThresholdsPrice(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_min_max_thresholds_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_min_max_thresholds"]] + + 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[NewBillingCycleConfiguration] + """ + 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.""" + + conversion_rate_config: Optional[ + PriceEvaluationPriceNewFloatingGroupedWithMinMaxThresholdsPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + 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[NewBillingCycleConfiguration] + """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`. + """ + + PriceEvaluationPrice: TypeAlias = Union[ NewFloatingUnitPrice, NewFloatingPackagePrice, NewFloatingMatrixPrice, NewFloatingMatrixWithAllocationPrice, NewFloatingTieredPrice, - NewFloatingTieredBPSPrice, - NewFloatingBPSPrice, - NewFloatingBulkBPSPrice, NewFloatingBulkPrice, NewFloatingThresholdTotalAmountPrice, NewFloatingTieredPackagePrice, @@ -89,6 +172,8 @@ class PriceEvaluateMultipleParams(TypedDict, total=False): NewFloatingScalableMatrixWithUnitPricingPrice, NewFloatingScalableMatrixWithTieredPricingPrice, NewFloatingCumulativeGroupedBulkPrice, + PriceEvaluationPriceNewFloatingGroupedWithMinMaxThresholdsPrice, + NewFloatingMinimumCompositePrice, ] @@ -103,7 +188,7 @@ class PriceEvaluation(TypedDict, total=False): filter the underlying billable metric """ - grouping_keys: List[str] + grouping_keys: SequenceNotStr[str] """ Properties (or [computed properties](/extensibility/advanced-metrics#computed-properties)) used diff --git a/src/orb/types/price_evaluate_params.py b/src/orb/types/price_evaluate_params.py index 12dc1d8e..fa8d6b66 100644 --- a/src/orb/types/price_evaluate_params.py +++ b/src/orb/types/price_evaluate_params.py @@ -2,10 +2,11 @@ from __future__ import annotations -from typing import List, Union, Optional +from typing import Union, Optional from datetime import datetime from typing_extensions import Required, Annotated, TypedDict +from .._types import SequenceNotStr from .._utils import PropertyInfo __all__ = ["PriceEvaluateParams"] @@ -31,7 +32,7 @@ class PriceEvaluateParams(TypedDict, total=False): filter the underlying billable metric """ - grouping_keys: List[str] + grouping_keys: SequenceNotStr[str] """ Properties (or [computed properties](/extensibility/advanced-metrics#computed-properties)) used diff --git a/src/orb/types/price_evaluate_preview_events_params.py b/src/orb/types/price_evaluate_preview_events_params.py index 187942a9..f1843234 100644 --- a/src/orb/types/price_evaluate_preview_events_params.py +++ b/src/orb/types/price_evaluate_preview_events_params.py @@ -2,21 +2,24 @@ from __future__ import annotations -from typing import Dict, List, Union, Iterable, Optional +from typing import Dict, Union, Iterable, Optional from datetime import datetime -from typing_extensions import Required, Annotated, TypeAlias, TypedDict +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from .._types import SequenceNotStr from .._utils import PropertyInfo -from .shared_params.new_floating_bps_price import NewFloatingBPSPrice from .shared_params.new_floating_bulk_price import NewFloatingBulkPrice from .shared_params.new_floating_unit_price import NewFloatingUnitPrice from .shared_params.new_floating_matrix_price import NewFloatingMatrixPrice from .shared_params.new_floating_tiered_price import NewFloatingTieredPrice from .shared_params.new_floating_package_price import NewFloatingPackagePrice -from .shared_params.new_floating_bulk_bps_price import NewFloatingBulkBPSPrice -from .shared_params.new_floating_tiered_bps_price import NewFloatingTieredBPSPrice +from .shared_params.unit_conversion_rate_config import UnitConversionRateConfig +from .shared_params.tiered_conversion_rate_config import TieredConversionRateConfig +from .shared_params.new_billing_cycle_configuration import NewBillingCycleConfiguration from .shared_params.new_floating_grouped_tiered_price import NewFloatingGroupedTieredPrice from .shared_params.new_floating_tiered_package_price import NewFloatingTieredPackagePrice +from .shared_params.new_dimensional_price_configuration import NewDimensionalPriceConfiguration +from .shared_params.new_floating_minimum_composite_price import NewFloatingMinimumCompositePrice from .shared_params.new_floating_unit_with_percent_price import NewFloatingUnitWithPercentPrice from .shared_params.new_floating_grouped_allocation_price import NewFloatingGroupedAllocationPrice from .shared_params.new_floating_bulk_with_proration_price import NewFloatingBulkWithProrationPrice @@ -40,7 +43,14 @@ NewFloatingScalableMatrixWithTieredPricingPrice, ) -__all__ = ["PriceEvaluatePreviewEventsParams", "Event", "PriceEvaluation", "PriceEvaluationPrice"] +__all__ = [ + "PriceEvaluatePreviewEventsParams", + "Event", + "PriceEvaluation", + "PriceEvaluationPrice", + "PriceEvaluationPriceNewFloatingGroupedWithMinMaxThresholdsPrice", + "PriceEvaluationPriceNewFloatingGroupedWithMinMaxThresholdsPriceConversionRateConfig", +] class PriceEvaluatePreviewEventsParams(TypedDict, total=False): @@ -91,15 +101,89 @@ class Event(TypedDict, total=False): """ +PriceEvaluationPriceNewFloatingGroupedWithMinMaxThresholdsPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class PriceEvaluationPriceNewFloatingGroupedWithMinMaxThresholdsPrice(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_min_max_thresholds_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_min_max_thresholds"]] + + 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[NewBillingCycleConfiguration] + """ + 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.""" + + conversion_rate_config: Optional[ + PriceEvaluationPriceNewFloatingGroupedWithMinMaxThresholdsPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + 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[NewBillingCycleConfiguration] + """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`. + """ + + PriceEvaluationPrice: TypeAlias = Union[ NewFloatingUnitPrice, NewFloatingPackagePrice, NewFloatingMatrixPrice, NewFloatingMatrixWithAllocationPrice, NewFloatingTieredPrice, - NewFloatingTieredBPSPrice, - NewFloatingBPSPrice, - NewFloatingBulkBPSPrice, NewFloatingBulkPrice, NewFloatingThresholdTotalAmountPrice, NewFloatingTieredPackagePrice, @@ -120,6 +204,8 @@ class Event(TypedDict, total=False): NewFloatingScalableMatrixWithUnitPricingPrice, NewFloatingScalableMatrixWithTieredPricingPrice, NewFloatingCumulativeGroupedBulkPrice, + PriceEvaluationPriceNewFloatingGroupedWithMinMaxThresholdsPrice, + NewFloatingMinimumCompositePrice, ] @@ -134,7 +220,7 @@ class PriceEvaluation(TypedDict, total=False): filter the underlying billable metric """ - grouping_keys: List[str] + grouping_keys: SequenceNotStr[str] """ Properties (or [computed properties](/extensibility/advanced-metrics#computed-properties)) used diff --git a/src/orb/types/shared/__init__.py b/src/orb/types/shared/__init__.py index 5fb8f1f4..2744f465 100644 --- a/src/orb/types/shared/__init__.py +++ b/src/orb/types/shared/__init__.py @@ -6,12 +6,10 @@ from .invoice import Invoice as Invoice from .maximum import Maximum as Maximum from .minimum import Minimum as Minimum -from .bps_tier import BPSTier as BPSTier from .discount import Discount as Discount from .bulk_tier import BulkTier as BulkTier from .item_slim import ItemSlim as ItemSlim from .allocation import Allocation as Allocation -from .bps_config import BPSConfig as BPSConfig from .tax_amount import TaxAmount as TaxAmount from .bulk_config import BulkConfig as BulkConfig from .credit_note import CreditNote as CreditNote @@ -21,7 +19,6 @@ from .unit_config import UnitConfig as UnitConfig from .invoice_tiny import InvoiceTiny as InvoiceTiny from .matrix_value import MatrixValue as MatrixValue -from .bulk_bps_tier import BulkBPSTier as BulkBPSTier from .matrix_config import MatrixConfig as MatrixConfig from .tiered_config import TieredConfig as TieredConfig from .package_config import PackageConfig as PackageConfig @@ -31,7 +28,6 @@ from .usage_discount import UsageDiscount as UsageDiscount from .aggregated_cost import AggregatedCost as AggregatedCost from .amount_discount import AmountDiscount as AmountDiscount -from .bulk_bps_config import BulkBPSConfig as BulkBPSConfig from .customer_tax_id import CustomerTaxID as CustomerTaxID from .credit_note_tiny import CreditNoteTiny as CreditNoteTiny from .maximum_interval import MaximumInterval as MaximumInterval @@ -39,8 +35,6 @@ from .coupon_redemption import CouponRedemption as CouponRedemption from .custom_expiration import CustomExpiration as CustomExpiration from .customer_minified import CustomerMinified as CustomerMinified -from .tiered_bps_config import TieredBPSConfig as TieredBPSConfig -from .new_plan_bps_price import NewPlanBPSPrice as NewPlanBPSPrice from .new_usage_discount import NewUsageDiscount as NewUsageDiscount from .tier_sub_line_item import TierSubLineItem as TierSubLineItem from .adjustment_interval import AdjustmentInterval as AdjustmentInterval @@ -58,27 +52,23 @@ from .new_plan_tiered_price import NewPlanTieredPrice as NewPlanTieredPrice from .subscription_minified import SubscriptionMinified as SubscriptionMinified from .invoice_level_discount import InvoiceLevelDiscount as InvoiceLevelDiscount -from .new_floating_bps_price import NewFloatingBPSPrice as NewFloatingBPSPrice from .new_plan_package_price import NewPlanPackagePrice as NewPlanPackagePrice from .sub_line_item_grouping import SubLineItemGrouping as SubLineItemGrouping from .transform_price_filter import TransformPriceFilter as TransformPriceFilter from .new_floating_bulk_price import NewFloatingBulkPrice as NewFloatingBulkPrice from .new_floating_unit_price import NewFloatingUnitPrice as NewFloatingUnitPrice from .new_percentage_discount import NewPercentageDiscount as NewPercentageDiscount -from .new_plan_bulk_bps_price import NewPlanBulkBPSPrice as NewPlanBulkBPSPrice from .subscription_trial_info import SubscriptionTrialInfo as SubscriptionTrialInfo from .usage_discount_interval import UsageDiscountInterval as UsageDiscountInterval from .amount_discount_interval import AmountDiscountInterval as AmountDiscountInterval from .new_floating_matrix_price import NewFloatingMatrixPrice as NewFloatingMatrixPrice from .new_floating_tiered_price import NewFloatingTieredPrice as NewFloatingTieredPrice -from .new_plan_tiered_bps_price import NewPlanTieredBPSPrice as NewPlanTieredBPSPrice from .new_floating_package_price import NewFloatingPackagePrice as NewFloatingPackagePrice from .billing_cycle_configuration import BillingCycleConfiguration as BillingCycleConfiguration from .billing_cycle_relative_date import BillingCycleRelativeDate as BillingCycleRelativeDate from .conversion_rate_unit_config import ConversionRateUnitConfig as ConversionRateUnitConfig from .monetary_maximum_adjustment import MonetaryMaximumAdjustment as MonetaryMaximumAdjustment from .monetary_minimum_adjustment import MonetaryMinimumAdjustment as MonetaryMinimumAdjustment -from .new_floating_bulk_bps_price import NewFloatingBulkBPSPrice as NewFloatingBulkBPSPrice from .sub_line_item_matrix_config import SubLineItemMatrixConfig as SubLineItemMatrixConfig from .unit_conversion_rate_config import UnitConversionRateConfig as UnitConversionRateConfig from .percentage_discount_interval import PercentageDiscountInterval as PercentageDiscountInterval @@ -86,7 +76,6 @@ from .conversion_rate_tiered_config import ConversionRateTieredConfig as ConversionRateTieredConfig from .fixed_fee_quantity_transition import FixedFeeQuantityTransition as FixedFeeQuantityTransition from .matrix_with_allocation_config import MatrixWithAllocationConfig as MatrixWithAllocationConfig -from .new_floating_tiered_bps_price import NewFloatingTieredBPSPrice as NewFloatingTieredBPSPrice from .new_plan_grouped_tiered_price import NewPlanGroupedTieredPrice as NewPlanGroupedTieredPrice from .new_plan_tiered_package_price import NewPlanTieredPackagePrice as NewPlanTieredPackagePrice from .plan_phase_maximum_adjustment import PlanPhaseMaximumAdjustment as PlanPhaseMaximumAdjustment @@ -95,6 +84,7 @@ from .changed_subscription_resources import ChangedSubscriptionResources as ChangedSubscriptionResources from .dimensional_price_configuration import DimensionalPriceConfiguration as DimensionalPriceConfiguration from .new_billing_cycle_configuration import NewBillingCycleConfiguration as NewBillingCycleConfiguration +from .new_plan_minimum_composite_price import NewPlanMinimumCompositePrice as NewPlanMinimumCompositePrice from .new_plan_unit_with_percent_price import NewPlanUnitWithPercentPrice as NewPlanUnitWithPercentPrice from .fixed_fee_quantity_schedule_entry import FixedFeeQuantityScheduleEntry as FixedFeeQuantityScheduleEntry from .new_floating_grouped_tiered_price import NewFloatingGroupedTieredPrice as NewFloatingGroupedTieredPrice @@ -108,6 +98,7 @@ from .new_plan_unit_with_proration_price import NewPlanUnitWithProrationPrice as NewPlanUnitWithProrationPrice from .monetary_amount_discount_adjustment import MonetaryAmountDiscountAdjustment as MonetaryAmountDiscountAdjustment from .new_dimensional_price_configuration import NewDimensionalPriceConfiguration as NewDimensionalPriceConfiguration +from .new_floating_minimum_composite_price import NewFloatingMinimumCompositePrice as NewFloatingMinimumCompositePrice from .new_floating_unit_with_percent_price import NewFloatingUnitWithPercentPrice as NewFloatingUnitWithPercentPrice from .plan_phase_usage_discount_adjustment import PlanPhaseUsageDiscountAdjustment as PlanPhaseUsageDiscountAdjustment from .new_floating_grouped_allocation_price import ( diff --git a/src/orb/types/shared/bps_config.py b/src/orb/types/shared/bps_config.py deleted file mode 100644 index cf797e6c..00000000 --- a/src/orb/types/shared/bps_config.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel - -__all__ = ["BPSConfig"] - - -class BPSConfig(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/bps_tier.py b/src/orb/types/shared/bps_tier.py deleted file mode 100644 index b4bc5f66..00000000 --- a/src/orb/types/shared/bps_tier.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel - -__all__ = ["BPSTier"] - - -class BPSTier(BaseModel): - bps: float - """Per-event basis point rate""" - - minimum_amount: str - """Exclusive tier starting value""" - - maximum_amount: Optional[str] = None - """Inclusive tier ending value""" - - per_unit_maximum: Optional[str] = None - """Per unit maximum to charge""" diff --git a/src/orb/types/shared/bulk_bps_config.py b/src/orb/types/shared/bulk_bps_config.py deleted file mode 100644 index b054fa55..00000000 --- a/src/orb/types/shared/bulk_bps_config.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .bulk_bps_tier import BulkBPSTier - -__all__ = ["BulkBPSConfig"] - - -class BulkBPSConfig(BaseModel): - tiers: List[BulkBPSTier] - """ - 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_bps_tier.py b/src/orb/types/shared/bulk_bps_tier.py deleted file mode 100644 index 5d57d718..00000000 --- a/src/orb/types/shared/bulk_bps_tier.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel - -__all__ = ["BulkBPSTier"] - - -class BulkBPSTier(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""" diff --git a/src/orb/types/shared/invoice.py b/src/orb/types/shared/invoice.py index 08001a1a..5a47ebdf 100644 --- a/src/orb/types/shared/invoice.py +++ b/src/orb/types/shared/invoice.py @@ -99,6 +99,7 @@ class CustomerBalanceTransaction(BaseModel): "credit_note_voided", "overpayment_refund", "external_payment", + "small_invoice_carryover", ] amount: str @@ -232,7 +233,7 @@ class LineItem(BaseModel): """ subtotal: str - """The line amount before before any adjustments.""" + """The line amount before any adjustments.""" tax_amounts: List[TaxAmount] """An array of tax rates and their incurred tax amounts. @@ -262,6 +263,12 @@ class PaymentAttempt(BaseModel): payment_provider_id: Optional[str] = None """The ID of the payment attempt in the payment provider.""" + receipt_pdf: Optional[str] = None + """URL to the downloadable PDF version of the receipt. + + This field will be `null` for payment attempts that did not succeed. + """ + succeeded: bool """Whether the payment attempt succeeded.""" diff --git a/src/orb/types/shared/monetary_amount_discount_adjustment.py b/src/orb/types/shared/monetary_amount_discount_adjustment.py index 58031fcc..c2f91957 100644 --- a/src/orb/types/shared/monetary_amount_discount_adjustment.py +++ b/src/orb/types/shared/monetary_amount_discount_adjustment.py @@ -31,8 +31,8 @@ class MonetaryAmountDiscountAdjustment(BaseModel): is_invoice_level: bool """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. + True for adjustments that apply to an entire invoice, false for adjustments that + apply to only one price. """ reason: Optional[str] = None diff --git a/src/orb/types/shared/monetary_maximum_adjustment.py b/src/orb/types/shared/monetary_maximum_adjustment.py index f2d34c19..9212e455 100644 --- a/src/orb/types/shared/monetary_maximum_adjustment.py +++ b/src/orb/types/shared/monetary_maximum_adjustment.py @@ -25,8 +25,8 @@ class MonetaryMaximumAdjustment(BaseModel): is_invoice_level: bool """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. + True for adjustments that apply to an entire invoice, false for adjustments that + apply to only one price. """ maximum_amount: str diff --git a/src/orb/types/shared/monetary_minimum_adjustment.py b/src/orb/types/shared/monetary_minimum_adjustment.py index 5f9fceb7..682da5ab 100644 --- a/src/orb/types/shared/monetary_minimum_adjustment.py +++ b/src/orb/types/shared/monetary_minimum_adjustment.py @@ -25,8 +25,8 @@ class MonetaryMinimumAdjustment(BaseModel): is_invoice_level: bool """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. + True for adjustments that apply to an entire invoice, false for adjustments that + apply to only one price. """ item_id: str diff --git a/src/orb/types/shared/monetary_percentage_discount_adjustment.py b/src/orb/types/shared/monetary_percentage_discount_adjustment.py index 5b8ba5fb..0687da04 100644 --- a/src/orb/types/shared/monetary_percentage_discount_adjustment.py +++ b/src/orb/types/shared/monetary_percentage_discount_adjustment.py @@ -25,8 +25,8 @@ class MonetaryPercentageDiscountAdjustment(BaseModel): is_invoice_level: bool """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. + True for adjustments that apply to an entire invoice, false for adjustments that + apply to only one price. """ percentage_discount: float diff --git a/src/orb/types/shared/monetary_usage_discount_adjustment.py b/src/orb/types/shared/monetary_usage_discount_adjustment.py index 135cc4df..3d81c01c 100644 --- a/src/orb/types/shared/monetary_usage_discount_adjustment.py +++ b/src/orb/types/shared/monetary_usage_discount_adjustment.py @@ -25,8 +25,8 @@ class MonetaryUsageDiscountAdjustment(BaseModel): is_invoice_level: bool """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. + True for adjustments that apply to an entire invoice, false for adjustments that + apply to only one price. """ reason: Optional[str] = None diff --git a/src/orb/types/shared/new_floating_bps_price.py b/src/orb/types/shared/new_floating_bps_price.py deleted file mode 100644 index 1bdd7c61..00000000 --- a/src/orb/types/shared/new_floating_bps_price.py +++ /dev/null @@ -1,91 +0,0 @@ -# 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 import BPSConfig -from .unit_conversion_rate_config import UnitConversionRateConfig -from .tiered_conversion_rate_config import TieredConversionRateConfig -from .new_billing_cycle_configuration import NewBillingCycleConfiguration -from .new_dimensional_price_configuration import NewDimensionalPriceConfiguration - -__all__ = ["NewFloatingBPSPrice", "ConversionRateConfig"] - -ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), -] - - -class NewFloatingBPSPrice(BaseModel): - bps_config: BPSConfig - - 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[NewBillingCycleConfiguration] = 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.""" - - conversion_rate_config: Optional[ConversionRateConfig] = None - """The configuration for the rate of the price currency to the invoicing currency.""" - - dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] = None - """For dimensional price: specifies a price group and dimension values""" - - 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[NewBillingCycleConfiguration] = 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`. - """ diff --git a/src/orb/types/shared/new_floating_bulk_price.py b/src/orb/types/shared/new_floating_bulk_price.py index fdfa64bb..b87725ee 100644 --- a/src/orb/types/shared/new_floating_bulk_price.py +++ b/src/orb/types/shared/new_floating_bulk_price.py @@ -16,8 +16,7 @@ __all__ = ["NewFloatingBulkPrice", "ConversionRateConfig"] ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] diff --git a/src/orb/types/shared/new_floating_bulk_with_proration_price.py b/src/orb/types/shared/new_floating_bulk_with_proration_price.py index 581f551f..a54b7025 100644 --- a/src/orb/types/shared/new_floating_bulk_with_proration_price.py +++ b/src/orb/types/shared/new_floating_bulk_with_proration_price.py @@ -15,8 +15,7 @@ __all__ = ["NewFloatingBulkWithProrationPrice", "ConversionRateConfig"] ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] diff --git a/src/orb/types/shared/new_floating_cumulative_grouped_bulk_price.py b/src/orb/types/shared/new_floating_cumulative_grouped_bulk_price.py index 6a6b8ead..7e9e9ff1 100644 --- a/src/orb/types/shared/new_floating_cumulative_grouped_bulk_price.py +++ b/src/orb/types/shared/new_floating_cumulative_grouped_bulk_price.py @@ -15,8 +15,7 @@ __all__ = ["NewFloatingCumulativeGroupedBulkPrice", "ConversionRateConfig"] ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] diff --git a/src/orb/types/shared/new_floating_grouped_allocation_price.py b/src/orb/types/shared/new_floating_grouped_allocation_price.py index 8444b429..40b9c8e1 100644 --- a/src/orb/types/shared/new_floating_grouped_allocation_price.py +++ b/src/orb/types/shared/new_floating_grouped_allocation_price.py @@ -15,8 +15,7 @@ __all__ = ["NewFloatingGroupedAllocationPrice", "ConversionRateConfig"] ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] diff --git a/src/orb/types/shared/new_floating_grouped_tiered_package_price.py b/src/orb/types/shared/new_floating_grouped_tiered_package_price.py index c3c71210..b62a6346 100644 --- a/src/orb/types/shared/new_floating_grouped_tiered_package_price.py +++ b/src/orb/types/shared/new_floating_grouped_tiered_package_price.py @@ -15,8 +15,7 @@ __all__ = ["NewFloatingGroupedTieredPackagePrice", "ConversionRateConfig"] ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] diff --git a/src/orb/types/shared/new_floating_grouped_tiered_price.py b/src/orb/types/shared/new_floating_grouped_tiered_price.py index 905d4fc3..b50d846f 100644 --- a/src/orb/types/shared/new_floating_grouped_tiered_price.py +++ b/src/orb/types/shared/new_floating_grouped_tiered_price.py @@ -15,8 +15,7 @@ __all__ = ["NewFloatingGroupedTieredPrice", "ConversionRateConfig"] ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] diff --git a/src/orb/types/shared/new_floating_grouped_with_metered_minimum_price.py b/src/orb/types/shared/new_floating_grouped_with_metered_minimum_price.py index 02f000ce..cb1bf6e1 100644 --- a/src/orb/types/shared/new_floating_grouped_with_metered_minimum_price.py +++ b/src/orb/types/shared/new_floating_grouped_with_metered_minimum_price.py @@ -15,8 +15,7 @@ __all__ = ["NewFloatingGroupedWithMeteredMinimumPrice", "ConversionRateConfig"] ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] diff --git a/src/orb/types/shared/new_floating_grouped_with_prorated_minimum_price.py b/src/orb/types/shared/new_floating_grouped_with_prorated_minimum_price.py index aad0efac..9168a0ff 100644 --- a/src/orb/types/shared/new_floating_grouped_with_prorated_minimum_price.py +++ b/src/orb/types/shared/new_floating_grouped_with_prorated_minimum_price.py @@ -15,8 +15,7 @@ __all__ = ["NewFloatingGroupedWithProratedMinimumPrice", "ConversionRateConfig"] ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] diff --git a/src/orb/types/shared/new_floating_matrix_price.py b/src/orb/types/shared/new_floating_matrix_price.py index 3ce48b53..84a0936c 100644 --- a/src/orb/types/shared/new_floating_matrix_price.py +++ b/src/orb/types/shared/new_floating_matrix_price.py @@ -16,8 +16,7 @@ __all__ = ["NewFloatingMatrixPrice", "ConversionRateConfig"] ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] diff --git a/src/orb/types/shared/new_floating_matrix_with_allocation_price.py b/src/orb/types/shared/new_floating_matrix_with_allocation_price.py index 849f85c0..c93e20d0 100644 --- a/src/orb/types/shared/new_floating_matrix_with_allocation_price.py +++ b/src/orb/types/shared/new_floating_matrix_with_allocation_price.py @@ -16,8 +16,7 @@ __all__ = ["NewFloatingMatrixWithAllocationPrice", "ConversionRateConfig"] ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] diff --git a/src/orb/types/shared/new_floating_matrix_with_display_name_price.py b/src/orb/types/shared/new_floating_matrix_with_display_name_price.py index 9af7aeb6..13da424f 100644 --- a/src/orb/types/shared/new_floating_matrix_with_display_name_price.py +++ b/src/orb/types/shared/new_floating_matrix_with_display_name_price.py @@ -15,8 +15,7 @@ __all__ = ["NewFloatingMatrixWithDisplayNamePrice", "ConversionRateConfig"] ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] diff --git a/src/orb/types/shared/new_floating_max_group_tiered_package_price.py b/src/orb/types/shared/new_floating_max_group_tiered_package_price.py index 57051915..e78e3cc7 100644 --- a/src/orb/types/shared/new_floating_max_group_tiered_package_price.py +++ b/src/orb/types/shared/new_floating_max_group_tiered_package_price.py @@ -15,8 +15,7 @@ __all__ = ["NewFloatingMaxGroupTieredPackagePrice", "ConversionRateConfig"] ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] diff --git a/src/orb/types/shared/new_floating_bulk_bps_price.py b/src/orb/types/shared/new_floating_minimum_composite_price.py similarity index 81% rename from src/orb/types/shared/new_floating_bulk_bps_price.py rename to src/orb/types/shared/new_floating_minimum_composite_price.py index 1b95e9a6..d83f3e5b 100644 --- a/src/orb/types/shared/new_floating_bulk_bps_price.py +++ b/src/orb/types/shared/new_floating_minimum_composite_price.py @@ -7,23 +7,31 @@ from ..._utils import PropertyInfo from ..._models import BaseModel -from .bulk_bps_config import BulkBPSConfig from .unit_conversion_rate_config import UnitConversionRateConfig from .tiered_conversion_rate_config import TieredConversionRateConfig from .new_billing_cycle_configuration import NewBillingCycleConfiguration from .new_dimensional_price_configuration import NewDimensionalPriceConfiguration -__all__ = ["NewFloatingBulkBPSPrice", "ConversionRateConfig"] +__all__ = ["NewFloatingMinimumCompositePrice", "MinimumConfig", "ConversionRateConfig"] + + +class MinimumConfig(BaseModel): + minimum_amount: str + """The minimum amount to apply""" + + prorated: Optional[bool] = None + """ + By default, subtotals from minimum composite prices are prorated based on the + service period. Set to false to disable proration. + """ + ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] -class NewFloatingBulkBPSPrice(BaseModel): - bulk_bps_config: BulkBPSConfig - +class NewFloatingMinimumCompositePrice(BaseModel): cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] """The cadence to bill for this price on.""" @@ -33,7 +41,9 @@ class NewFloatingBulkBPSPrice(BaseModel): item_id: str """The id of the item the price will be associated with.""" - price_model_type: Literal["bulk_bps"] = FieldInfo(alias="model_type") + minimum_config: MinimumConfig + + price_model_type: Literal["minimum"] = FieldInfo(alias="model_type") name: str """The name of the price.""" diff --git a/src/orb/types/shared/new_floating_package_price.py b/src/orb/types/shared/new_floating_package_price.py index ea1d61db..4972c4e3 100644 --- a/src/orb/types/shared/new_floating_package_price.py +++ b/src/orb/types/shared/new_floating_package_price.py @@ -16,8 +16,7 @@ __all__ = ["NewFloatingPackagePrice", "ConversionRateConfig"] ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] diff --git a/src/orb/types/shared/new_floating_package_with_allocation_price.py b/src/orb/types/shared/new_floating_package_with_allocation_price.py index 00c38e38..4b750911 100644 --- a/src/orb/types/shared/new_floating_package_with_allocation_price.py +++ b/src/orb/types/shared/new_floating_package_with_allocation_price.py @@ -15,8 +15,7 @@ __all__ = ["NewFloatingPackageWithAllocationPrice", "ConversionRateConfig"] ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] diff --git a/src/orb/types/shared/new_floating_scalable_matrix_with_tiered_pricing_price.py b/src/orb/types/shared/new_floating_scalable_matrix_with_tiered_pricing_price.py index 4aecb772..8eaae8d0 100644 --- a/src/orb/types/shared/new_floating_scalable_matrix_with_tiered_pricing_price.py +++ b/src/orb/types/shared/new_floating_scalable_matrix_with_tiered_pricing_price.py @@ -15,8 +15,7 @@ __all__ = ["NewFloatingScalableMatrixWithTieredPricingPrice", "ConversionRateConfig"] ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] diff --git a/src/orb/types/shared/new_floating_scalable_matrix_with_unit_pricing_price.py b/src/orb/types/shared/new_floating_scalable_matrix_with_unit_pricing_price.py index d56955bc..0f5fc4d0 100644 --- a/src/orb/types/shared/new_floating_scalable_matrix_with_unit_pricing_price.py +++ b/src/orb/types/shared/new_floating_scalable_matrix_with_unit_pricing_price.py @@ -15,8 +15,7 @@ __all__ = ["NewFloatingScalableMatrixWithUnitPricingPrice", "ConversionRateConfig"] ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] diff --git a/src/orb/types/shared/new_floating_threshold_total_amount_price.py b/src/orb/types/shared/new_floating_threshold_total_amount_price.py index 99b0f96c..525addf2 100644 --- a/src/orb/types/shared/new_floating_threshold_total_amount_price.py +++ b/src/orb/types/shared/new_floating_threshold_total_amount_price.py @@ -15,8 +15,7 @@ __all__ = ["NewFloatingThresholdTotalAmountPrice", "ConversionRateConfig"] ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] diff --git a/src/orb/types/shared/new_floating_tiered_bps_price.py b/src/orb/types/shared/new_floating_tiered_bps_price.py deleted file mode 100644 index 836a3c0f..00000000 --- a/src/orb/types/shared/new_floating_tiered_bps_price.py +++ /dev/null @@ -1,91 +0,0 @@ -# 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 .tiered_bps_config import TieredBPSConfig -from .unit_conversion_rate_config import UnitConversionRateConfig -from .tiered_conversion_rate_config import TieredConversionRateConfig -from .new_billing_cycle_configuration import NewBillingCycleConfiguration -from .new_dimensional_price_configuration import NewDimensionalPriceConfiguration - -__all__ = ["NewFloatingTieredBPSPrice", "ConversionRateConfig"] - -ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), -] - - -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: TieredBPSConfig - - 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[NewBillingCycleConfiguration] = 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.""" - - conversion_rate_config: Optional[ConversionRateConfig] = None - """The configuration for the rate of the price currency to the invoicing currency.""" - - dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] = None - """For dimensional price: specifies a price group and dimension values""" - - 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[NewBillingCycleConfiguration] = 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`. - """ diff --git a/src/orb/types/shared/new_floating_tiered_package_price.py b/src/orb/types/shared/new_floating_tiered_package_price.py index 7969398a..4aae6693 100644 --- a/src/orb/types/shared/new_floating_tiered_package_price.py +++ b/src/orb/types/shared/new_floating_tiered_package_price.py @@ -15,8 +15,7 @@ __all__ = ["NewFloatingTieredPackagePrice", "ConversionRateConfig"] ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] diff --git a/src/orb/types/shared/new_floating_tiered_package_with_minimum_price.py b/src/orb/types/shared/new_floating_tiered_package_with_minimum_price.py index 7322b56c..7ddac55a 100644 --- a/src/orb/types/shared/new_floating_tiered_package_with_minimum_price.py +++ b/src/orb/types/shared/new_floating_tiered_package_with_minimum_price.py @@ -15,8 +15,7 @@ __all__ = ["NewFloatingTieredPackageWithMinimumPrice", "ConversionRateConfig"] ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] diff --git a/src/orb/types/shared/new_floating_tiered_price.py b/src/orb/types/shared/new_floating_tiered_price.py index b1ce31a2..02d75772 100644 --- a/src/orb/types/shared/new_floating_tiered_price.py +++ b/src/orb/types/shared/new_floating_tiered_price.py @@ -16,8 +16,7 @@ __all__ = ["NewFloatingTieredPrice", "ConversionRateConfig"] ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] diff --git a/src/orb/types/shared/new_floating_tiered_with_minimum_price.py b/src/orb/types/shared/new_floating_tiered_with_minimum_price.py index 9ffb9eb5..21aae358 100644 --- a/src/orb/types/shared/new_floating_tiered_with_minimum_price.py +++ b/src/orb/types/shared/new_floating_tiered_with_minimum_price.py @@ -15,8 +15,7 @@ __all__ = ["NewFloatingTieredWithMinimumPrice", "ConversionRateConfig"] ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] diff --git a/src/orb/types/shared/new_floating_tiered_with_proration_price.py b/src/orb/types/shared/new_floating_tiered_with_proration_price.py index ed9f09bf..673f2eba 100644 --- a/src/orb/types/shared/new_floating_tiered_with_proration_price.py +++ b/src/orb/types/shared/new_floating_tiered_with_proration_price.py @@ -15,8 +15,7 @@ __all__ = ["NewFloatingTieredWithProrationPrice", "ConversionRateConfig"] ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] diff --git a/src/orb/types/shared/new_floating_unit_price.py b/src/orb/types/shared/new_floating_unit_price.py index 4bf8e721..0fcbdc39 100644 --- a/src/orb/types/shared/new_floating_unit_price.py +++ b/src/orb/types/shared/new_floating_unit_price.py @@ -16,8 +16,7 @@ __all__ = ["NewFloatingUnitPrice", "ConversionRateConfig"] ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] diff --git a/src/orb/types/shared/new_floating_unit_with_percent_price.py b/src/orb/types/shared/new_floating_unit_with_percent_price.py index 6974172b..6b8a9259 100644 --- a/src/orb/types/shared/new_floating_unit_with_percent_price.py +++ b/src/orb/types/shared/new_floating_unit_with_percent_price.py @@ -15,8 +15,7 @@ __all__ = ["NewFloatingUnitWithPercentPrice", "ConversionRateConfig"] ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] diff --git a/src/orb/types/shared/new_floating_unit_with_proration_price.py b/src/orb/types/shared/new_floating_unit_with_proration_price.py index 2bc49f4c..a23ef532 100644 --- a/src/orb/types/shared/new_floating_unit_with_proration_price.py +++ b/src/orb/types/shared/new_floating_unit_with_proration_price.py @@ -15,8 +15,7 @@ __all__ = ["NewFloatingUnitWithProrationPrice", "ConversionRateConfig"] ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] diff --git a/src/orb/types/shared/new_plan_bps_price.py b/src/orb/types/shared/new_plan_bps_price.py deleted file mode 100644 index 1a0d6f79..00000000 --- a/src/orb/types/shared/new_plan_bps_price.py +++ /dev/null @@ -1,100 +0,0 @@ -# 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 import BPSConfig -from .unit_conversion_rate_config import UnitConversionRateConfig -from .tiered_conversion_rate_config import TieredConversionRateConfig -from .new_billing_cycle_configuration import NewBillingCycleConfiguration -from .new_dimensional_price_configuration import NewDimensionalPriceConfiguration - -__all__ = ["NewPlanBPSPrice", "ConversionRateConfig"] - -ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), -] - - -class NewPlanBPSPrice(BaseModel): - bps_config: BPSConfig - - 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[NewBillingCycleConfiguration] = 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.""" - - conversion_rate_config: Optional[ConversionRateConfig] = None - """The configuration for the 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. - """ - - dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] = None - """For dimensional price: specifies a price group and dimension values""" - - 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[NewBillingCycleConfiguration] = 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. - """ diff --git a/src/orb/types/shared/new_plan_bulk_price.py b/src/orb/types/shared/new_plan_bulk_price.py index aaf53526..8a333ec5 100644 --- a/src/orb/types/shared/new_plan_bulk_price.py +++ b/src/orb/types/shared/new_plan_bulk_price.py @@ -16,8 +16,7 @@ __all__ = ["NewPlanBulkPrice", "ConversionRateConfig"] ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] diff --git a/src/orb/types/shared/new_plan_bulk_with_proration_price.py b/src/orb/types/shared/new_plan_bulk_with_proration_price.py index 21e34766..e87bf88a 100644 --- a/src/orb/types/shared/new_plan_bulk_with_proration_price.py +++ b/src/orb/types/shared/new_plan_bulk_with_proration_price.py @@ -15,8 +15,7 @@ __all__ = ["NewPlanBulkWithProrationPrice", "ConversionRateConfig"] ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] diff --git a/src/orb/types/shared/new_plan_cumulative_grouped_bulk_price.py b/src/orb/types/shared/new_plan_cumulative_grouped_bulk_price.py index 30aef3f5..e0956b53 100644 --- a/src/orb/types/shared/new_plan_cumulative_grouped_bulk_price.py +++ b/src/orb/types/shared/new_plan_cumulative_grouped_bulk_price.py @@ -15,8 +15,7 @@ __all__ = ["NewPlanCumulativeGroupedBulkPrice", "ConversionRateConfig"] ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] diff --git a/src/orb/types/shared/new_plan_grouped_allocation_price.py b/src/orb/types/shared/new_plan_grouped_allocation_price.py index 91cb4428..a48509af 100644 --- a/src/orb/types/shared/new_plan_grouped_allocation_price.py +++ b/src/orb/types/shared/new_plan_grouped_allocation_price.py @@ -15,8 +15,7 @@ __all__ = ["NewPlanGroupedAllocationPrice", "ConversionRateConfig"] ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] diff --git a/src/orb/types/shared/new_plan_grouped_tiered_package_price.py b/src/orb/types/shared/new_plan_grouped_tiered_package_price.py index 82521871..0d1cc760 100644 --- a/src/orb/types/shared/new_plan_grouped_tiered_package_price.py +++ b/src/orb/types/shared/new_plan_grouped_tiered_package_price.py @@ -15,8 +15,7 @@ __all__ = ["NewPlanGroupedTieredPackagePrice", "ConversionRateConfig"] ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] diff --git a/src/orb/types/shared/new_plan_grouped_tiered_price.py b/src/orb/types/shared/new_plan_grouped_tiered_price.py index 1be2b1e3..a2b42317 100644 --- a/src/orb/types/shared/new_plan_grouped_tiered_price.py +++ b/src/orb/types/shared/new_plan_grouped_tiered_price.py @@ -15,8 +15,7 @@ __all__ = ["NewPlanGroupedTieredPrice", "ConversionRateConfig"] ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] diff --git a/src/orb/types/shared/new_plan_grouped_with_metered_minimum_price.py b/src/orb/types/shared/new_plan_grouped_with_metered_minimum_price.py index 6dce8c0b..2fd66cbd 100644 --- a/src/orb/types/shared/new_plan_grouped_with_metered_minimum_price.py +++ b/src/orb/types/shared/new_plan_grouped_with_metered_minimum_price.py @@ -15,8 +15,7 @@ __all__ = ["NewPlanGroupedWithMeteredMinimumPrice", "ConversionRateConfig"] ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] diff --git a/src/orb/types/shared/new_plan_grouped_with_prorated_minimum_price.py b/src/orb/types/shared/new_plan_grouped_with_prorated_minimum_price.py index ba366557..e31fb822 100644 --- a/src/orb/types/shared/new_plan_grouped_with_prorated_minimum_price.py +++ b/src/orb/types/shared/new_plan_grouped_with_prorated_minimum_price.py @@ -15,8 +15,7 @@ __all__ = ["NewPlanGroupedWithProratedMinimumPrice", "ConversionRateConfig"] ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] diff --git a/src/orb/types/shared/new_plan_matrix_price.py b/src/orb/types/shared/new_plan_matrix_price.py index c0464de0..d377305d 100644 --- a/src/orb/types/shared/new_plan_matrix_price.py +++ b/src/orb/types/shared/new_plan_matrix_price.py @@ -16,8 +16,7 @@ __all__ = ["NewPlanMatrixPrice", "ConversionRateConfig"] ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] diff --git a/src/orb/types/shared/new_plan_matrix_with_allocation_price.py b/src/orb/types/shared/new_plan_matrix_with_allocation_price.py index d42f93fa..ef2ca887 100644 --- a/src/orb/types/shared/new_plan_matrix_with_allocation_price.py +++ b/src/orb/types/shared/new_plan_matrix_with_allocation_price.py @@ -16,8 +16,7 @@ __all__ = ["NewPlanMatrixWithAllocationPrice", "ConversionRateConfig"] ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] diff --git a/src/orb/types/shared/new_plan_matrix_with_display_name_price.py b/src/orb/types/shared/new_plan_matrix_with_display_name_price.py index 0af3224c..f0e34144 100644 --- a/src/orb/types/shared/new_plan_matrix_with_display_name_price.py +++ b/src/orb/types/shared/new_plan_matrix_with_display_name_price.py @@ -15,8 +15,7 @@ __all__ = ["NewPlanMatrixWithDisplayNamePrice", "ConversionRateConfig"] ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] diff --git a/src/orb/types/shared/new_plan_max_group_tiered_package_price.py b/src/orb/types/shared/new_plan_max_group_tiered_package_price.py index 219fc4ea..8465b6ea 100644 --- a/src/orb/types/shared/new_plan_max_group_tiered_package_price.py +++ b/src/orb/types/shared/new_plan_max_group_tiered_package_price.py @@ -15,8 +15,7 @@ __all__ = ["NewPlanMaxGroupTieredPackagePrice", "ConversionRateConfig"] ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] diff --git a/src/orb/types/shared/new_plan_bulk_bps_price.py b/src/orb/types/shared/new_plan_minimum_composite_price.py similarity index 82% rename from src/orb/types/shared/new_plan_bulk_bps_price.py rename to src/orb/types/shared/new_plan_minimum_composite_price.py index d0d5d648..52174359 100644 --- a/src/orb/types/shared/new_plan_bulk_bps_price.py +++ b/src/orb/types/shared/new_plan_minimum_composite_price.py @@ -7,30 +7,40 @@ from ..._utils import PropertyInfo from ..._models import BaseModel -from .bulk_bps_config import BulkBPSConfig from .unit_conversion_rate_config import UnitConversionRateConfig from .tiered_conversion_rate_config import TieredConversionRateConfig from .new_billing_cycle_configuration import NewBillingCycleConfiguration from .new_dimensional_price_configuration import NewDimensionalPriceConfiguration -__all__ = ["NewPlanBulkBPSPrice", "ConversionRateConfig"] +__all__ = ["NewPlanMinimumCompositePrice", "MinimumConfig", "ConversionRateConfig"] + + +class MinimumConfig(BaseModel): + minimum_amount: str + """The minimum amount to apply""" + + prorated: Optional[bool] = None + """ + By default, subtotals from minimum composite prices are prorated based on the + service period. Set to false to disable proration. + """ + ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] -class NewPlanBulkBPSPrice(BaseModel): - bulk_bps_config: BulkBPSConfig - +class NewPlanMinimumCompositePrice(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["bulk_bps"] = FieldInfo(alias="model_type") + minimum_config: MinimumConfig + + price_model_type: Literal["minimum"] = FieldInfo(alias="model_type") name: str """The name of the price.""" diff --git a/src/orb/types/shared/new_plan_package_price.py b/src/orb/types/shared/new_plan_package_price.py index eeb5ca46..8c4b92b1 100644 --- a/src/orb/types/shared/new_plan_package_price.py +++ b/src/orb/types/shared/new_plan_package_price.py @@ -16,8 +16,7 @@ __all__ = ["NewPlanPackagePrice", "ConversionRateConfig"] ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] diff --git a/src/orb/types/shared/new_plan_package_with_allocation_price.py b/src/orb/types/shared/new_plan_package_with_allocation_price.py index 4fe90474..ee22d1fd 100644 --- a/src/orb/types/shared/new_plan_package_with_allocation_price.py +++ b/src/orb/types/shared/new_plan_package_with_allocation_price.py @@ -15,8 +15,7 @@ __all__ = ["NewPlanPackageWithAllocationPrice", "ConversionRateConfig"] ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] diff --git a/src/orb/types/shared/new_plan_scalable_matrix_with_tiered_pricing_price.py b/src/orb/types/shared/new_plan_scalable_matrix_with_tiered_pricing_price.py index b4fbf30c..5a346af7 100644 --- a/src/orb/types/shared/new_plan_scalable_matrix_with_tiered_pricing_price.py +++ b/src/orb/types/shared/new_plan_scalable_matrix_with_tiered_pricing_price.py @@ -15,8 +15,7 @@ __all__ = ["NewPlanScalableMatrixWithTieredPricingPrice", "ConversionRateConfig"] ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] diff --git a/src/orb/types/shared/new_plan_scalable_matrix_with_unit_pricing_price.py b/src/orb/types/shared/new_plan_scalable_matrix_with_unit_pricing_price.py index ab8f3500..3320f626 100644 --- a/src/orb/types/shared/new_plan_scalable_matrix_with_unit_pricing_price.py +++ b/src/orb/types/shared/new_plan_scalable_matrix_with_unit_pricing_price.py @@ -15,8 +15,7 @@ __all__ = ["NewPlanScalableMatrixWithUnitPricingPrice", "ConversionRateConfig"] ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] diff --git a/src/orb/types/shared/new_plan_threshold_total_amount_price.py b/src/orb/types/shared/new_plan_threshold_total_amount_price.py index 3a5a63b0..2dcc1c28 100644 --- a/src/orb/types/shared/new_plan_threshold_total_amount_price.py +++ b/src/orb/types/shared/new_plan_threshold_total_amount_price.py @@ -15,8 +15,7 @@ __all__ = ["NewPlanThresholdTotalAmountPrice", "ConversionRateConfig"] ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] diff --git a/src/orb/types/shared/new_plan_tier_with_proration_price.py b/src/orb/types/shared/new_plan_tier_with_proration_price.py index 252fbde0..143d66dc 100644 --- a/src/orb/types/shared/new_plan_tier_with_proration_price.py +++ b/src/orb/types/shared/new_plan_tier_with_proration_price.py @@ -15,8 +15,7 @@ __all__ = ["NewPlanTierWithProrationPrice", "ConversionRateConfig"] ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] diff --git a/src/orb/types/shared/new_plan_tiered_bps_price.py b/src/orb/types/shared/new_plan_tiered_bps_price.py deleted file mode 100644 index 28d84f68..00000000 --- a/src/orb/types/shared/new_plan_tiered_bps_price.py +++ /dev/null @@ -1,100 +0,0 @@ -# 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 .tiered_bps_config import TieredBPSConfig -from .unit_conversion_rate_config import UnitConversionRateConfig -from .tiered_conversion_rate_config import TieredConversionRateConfig -from .new_billing_cycle_configuration import NewBillingCycleConfiguration -from .new_dimensional_price_configuration import NewDimensionalPriceConfiguration - -__all__ = ["NewPlanTieredBPSPrice", "ConversionRateConfig"] - -ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), -] - - -class NewPlanTieredBPSPrice(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: TieredBPSConfig - - 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[NewBillingCycleConfiguration] = 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.""" - - conversion_rate_config: Optional[ConversionRateConfig] = None - """The configuration for the 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. - """ - - dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] = None - """For dimensional price: specifies a price group and dimension values""" - - 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[NewBillingCycleConfiguration] = 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. - """ diff --git a/src/orb/types/shared/new_plan_tiered_package_price.py b/src/orb/types/shared/new_plan_tiered_package_price.py index 91fe49fd..342c4ae4 100644 --- a/src/orb/types/shared/new_plan_tiered_package_price.py +++ b/src/orb/types/shared/new_plan_tiered_package_price.py @@ -15,8 +15,7 @@ __all__ = ["NewPlanTieredPackagePrice", "ConversionRateConfig"] ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] diff --git a/src/orb/types/shared/new_plan_tiered_package_with_minimum_price.py b/src/orb/types/shared/new_plan_tiered_package_with_minimum_price.py index 860e32fb..745b22f7 100644 --- a/src/orb/types/shared/new_plan_tiered_package_with_minimum_price.py +++ b/src/orb/types/shared/new_plan_tiered_package_with_minimum_price.py @@ -15,8 +15,7 @@ __all__ = ["NewPlanTieredPackageWithMinimumPrice", "ConversionRateConfig"] ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] diff --git a/src/orb/types/shared/new_plan_tiered_price.py b/src/orb/types/shared/new_plan_tiered_price.py index 3e1607c6..c163c9dc 100644 --- a/src/orb/types/shared/new_plan_tiered_price.py +++ b/src/orb/types/shared/new_plan_tiered_price.py @@ -16,8 +16,7 @@ __all__ = ["NewPlanTieredPrice", "ConversionRateConfig"] ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] diff --git a/src/orb/types/shared/new_plan_tiered_with_minimum_price.py b/src/orb/types/shared/new_plan_tiered_with_minimum_price.py index 6a2f9db4..3fa1db28 100644 --- a/src/orb/types/shared/new_plan_tiered_with_minimum_price.py +++ b/src/orb/types/shared/new_plan_tiered_with_minimum_price.py @@ -15,8 +15,7 @@ __all__ = ["NewPlanTieredWithMinimumPrice", "ConversionRateConfig"] ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] diff --git a/src/orb/types/shared/new_plan_unit_price.py b/src/orb/types/shared/new_plan_unit_price.py index e1d3f1e7..12bf5759 100644 --- a/src/orb/types/shared/new_plan_unit_price.py +++ b/src/orb/types/shared/new_plan_unit_price.py @@ -16,8 +16,7 @@ __all__ = ["NewPlanUnitPrice", "ConversionRateConfig"] ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] diff --git a/src/orb/types/shared/new_plan_unit_with_percent_price.py b/src/orb/types/shared/new_plan_unit_with_percent_price.py index a04f79e7..1a433372 100644 --- a/src/orb/types/shared/new_plan_unit_with_percent_price.py +++ b/src/orb/types/shared/new_plan_unit_with_percent_price.py @@ -15,8 +15,7 @@ __all__ = ["NewPlanUnitWithPercentPrice", "ConversionRateConfig"] ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] diff --git a/src/orb/types/shared/new_plan_unit_with_proration_price.py b/src/orb/types/shared/new_plan_unit_with_proration_price.py index fcea45f2..909e8229 100644 --- a/src/orb/types/shared/new_plan_unit_with_proration_price.py +++ b/src/orb/types/shared/new_plan_unit_with_proration_price.py @@ -15,8 +15,7 @@ __all__ = ["NewPlanUnitWithProrationPrice", "ConversionRateConfig"] ConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] diff --git a/src/orb/types/shared/plan_phase_amount_discount_adjustment.py b/src/orb/types/shared/plan_phase_amount_discount_adjustment.py index 69329d25..54a3e9e4 100644 --- a/src/orb/types/shared/plan_phase_amount_discount_adjustment.py +++ b/src/orb/types/shared/plan_phase_amount_discount_adjustment.py @@ -28,8 +28,8 @@ class PlanPhaseAmountDiscountAdjustment(BaseModel): is_invoice_level: bool """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. + True for adjustments that apply to an entire invoice, false for adjustments that + apply to only one price. """ plan_phase_order: Optional[int] = None diff --git a/src/orb/types/shared/plan_phase_maximum_adjustment.py b/src/orb/types/shared/plan_phase_maximum_adjustment.py index b1360895..56435fc4 100644 --- a/src/orb/types/shared/plan_phase_maximum_adjustment.py +++ b/src/orb/types/shared/plan_phase_maximum_adjustment.py @@ -22,8 +22,8 @@ class PlanPhaseMaximumAdjustment(BaseModel): is_invoice_level: bool """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. + True for adjustments that apply to an entire invoice, false for adjustments that + apply to only one price. """ maximum_amount: str diff --git a/src/orb/types/shared/plan_phase_minimum_adjustment.py b/src/orb/types/shared/plan_phase_minimum_adjustment.py index ceadb996..055c5424 100644 --- a/src/orb/types/shared/plan_phase_minimum_adjustment.py +++ b/src/orb/types/shared/plan_phase_minimum_adjustment.py @@ -22,8 +22,8 @@ class PlanPhaseMinimumAdjustment(BaseModel): is_invoice_level: bool """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. + True for adjustments that apply to an entire invoice, false for adjustments that + apply to only one price. """ item_id: str diff --git a/src/orb/types/shared/plan_phase_percentage_discount_adjustment.py b/src/orb/types/shared/plan_phase_percentage_discount_adjustment.py index 0ceec0ff..86068beb 100644 --- a/src/orb/types/shared/plan_phase_percentage_discount_adjustment.py +++ b/src/orb/types/shared/plan_phase_percentage_discount_adjustment.py @@ -22,8 +22,8 @@ class PlanPhasePercentageDiscountAdjustment(BaseModel): is_invoice_level: bool """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. + True for adjustments that apply to an entire invoice, false for adjustments that + apply to only one price. """ percentage_discount: float diff --git a/src/orb/types/shared/plan_phase_usage_discount_adjustment.py b/src/orb/types/shared/plan_phase_usage_discount_adjustment.py index b2bb1fec..bf7a764d 100644 --- a/src/orb/types/shared/plan_phase_usage_discount_adjustment.py +++ b/src/orb/types/shared/plan_phase_usage_discount_adjustment.py @@ -22,8 +22,8 @@ class PlanPhaseUsageDiscountAdjustment(BaseModel): is_invoice_level: bool """ - True for adjustments that apply to an entire invocice, false for adjustments - that apply to only one price. + True for adjustments that apply to an entire invoice, false for adjustments that + apply to only one price. """ plan_phase_order: Optional[int] = None diff --git a/src/orb/types/shared/price.py b/src/orb/types/shared/price.py index 5b4182ed..2beebf9a 100644 --- a/src/orb/types/shared/price.py +++ b/src/orb/types/shared/price.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, Union, Optional +from typing import Dict, List, Union, Optional from datetime import datetime from typing_extensions import Literal, Annotated, TypeAlias @@ -13,15 +13,13 @@ from ..._models import BaseModel from .item_slim import ItemSlim from .allocation import Allocation -from .bps_config import BPSConfig from .bulk_config import BulkConfig from .unit_config import UnitConfig from .matrix_config import MatrixConfig from .tiered_config import TieredConfig from .package_config import PackageConfig -from .bulk_bps_config import BulkBPSConfig -from .tiered_bps_config import TieredBPSConfig from .billable_metric_tiny import BillableMetricTiny +from .transform_price_filter import TransformPriceFilter from .billing_cycle_configuration import BillingCycleConfiguration from .unit_conversion_rate_config import UnitConversionRateConfig from .matrix_with_allocation_config import MatrixWithAllocationConfig @@ -38,12 +36,6 @@ "MatrixPriceConversionRateConfig", "TieredPrice", "TieredPriceConversionRateConfig", - "TieredBPSPrice", - "TieredBPSPriceConversionRateConfig", - "BPSPrice", - "BPSPriceConversionRateConfig", - "BulkBPSPrice", - "BulkBPSPriceConversionRateConfig", "BulkPrice", "BulkPriceConversionRateConfig", "ThresholdTotalAmountPrice", @@ -88,11 +80,13 @@ "CumulativeGroupedBulkPriceConversionRateConfig", "GroupedWithMinMaxThresholdsPrice", "GroupedWithMinMaxThresholdsPriceConversionRateConfig", + "MinimumCompositePrice", + "MinimumCompositePriceConversionRateConfig", + "MinimumCompositePriceMinimumConfig", ] UnitPriceConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -105,6 +99,8 @@ class UnitPrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + composite_price_filters: Optional[List[TransformPriceFilter]] = None + conversion_rate: Optional[float] = None conversion_rate_config: Optional[UnitPriceConversionRateConfig] = None @@ -161,8 +157,7 @@ class UnitPrice(BaseModel): PackagePriceConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -175,6 +170,8 @@ class PackagePrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + composite_price_filters: Optional[List[TransformPriceFilter]] = None + conversion_rate: Optional[float] = None conversion_rate_config: Optional[PackagePriceConversionRateConfig] = None @@ -231,8 +228,7 @@ class PackagePrice(BaseModel): MatrixPriceConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -245,6 +241,8 @@ class MatrixPrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + composite_price_filters: Optional[List[TransformPriceFilter]] = None + conversion_rate: Optional[float] = None conversion_rate_config: Optional[MatrixPriceConversionRateConfig] = None @@ -301,8 +299,7 @@ class MatrixPrice(BaseModel): TieredPriceConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -315,6 +312,8 @@ class TieredPrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + composite_price_filters: Optional[List[TransformPriceFilter]] = None + conversion_rate: Optional[float] = None conversion_rate_config: Optional[TieredPriceConversionRateConfig] = None @@ -370,219 +369,8 @@ class TieredPrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None -TieredBPSPriceConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), -] - - -class TieredBPSPrice(BaseModel): - id: str - - billable_metric: Optional[BillableMetricTiny] = None - - billing_cycle_configuration: BillingCycleConfiguration - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - conversion_rate_config: Optional[TieredBPSPriceConversionRateConfig] = None - - created_at: datetime - - credit_allocation: Optional[Allocation] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - invoicing_cycle_configuration: Optional[BillingCycleConfiguration] = None - - item: ItemSlim - - 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 - - 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"] - - replaces_price_id: Optional[str] = None - """The price id this price replaces. - - This price will take the place of the replaced price in plan version migrations. - """ - - tiered_bps_config: TieredBPSConfig - - dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None - - -BPSPriceConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), -] - - -class BPSPrice(BaseModel): - id: str - - billable_metric: Optional[BillableMetricTiny] = None - - billing_cycle_configuration: BillingCycleConfiguration - - bps_config: BPSConfig - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - conversion_rate_config: Optional[BPSPriceConversionRateConfig] = None - - created_at: datetime - - credit_allocation: Optional[Allocation] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - invoicing_cycle_configuration: Optional[BillingCycleConfiguration] = None - - item: ItemSlim - - 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 - - price_model_type: Literal["bps"] = FieldInfo(alias="model_type") - - name: str - - plan_phase_order: Optional[int] = None - - price_type: Literal["usage_price", "fixed_price"] - - replaces_price_id: Optional[str] = None - """The price id this price replaces. - - This price will take the place of the replaced price in plan version migrations. - """ - - dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None - - -BulkBPSPriceConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), -] - - -class BulkBPSPrice(BaseModel): - id: str - - billable_metric: Optional[BillableMetricTiny] = None - - billing_cycle_configuration: BillingCycleConfiguration - - bulk_bps_config: BulkBPSConfig - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - - conversion_rate: Optional[float] = None - - conversion_rate_config: Optional[BulkBPSPriceConversionRateConfig] = None - - created_at: datetime - - credit_allocation: Optional[Allocation] = None - - currency: str - - discount: Optional[Discount] = None - - external_price_id: Optional[str] = None - - fixed_price_quantity: Optional[float] = None - - invoicing_cycle_configuration: Optional[BillingCycleConfiguration] = None - - item: ItemSlim - - 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 - - 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"] - - replaces_price_id: Optional[str] = None - """The price id this price replaces. - - This price will take the place of the replaced price in plan version migrations. - """ - - dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None - - BulkPriceConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -597,6 +385,8 @@ class BulkPrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + composite_price_filters: Optional[List[TransformPriceFilter]] = None + conversion_rate: Optional[float] = None conversion_rate_config: Optional[BulkPriceConversionRateConfig] = None @@ -651,8 +441,7 @@ class BulkPrice(BaseModel): ThresholdTotalAmountPriceConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -665,6 +454,8 @@ class ThresholdTotalAmountPrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + composite_price_filters: Optional[List[TransformPriceFilter]] = None + conversion_rate: Optional[float] = None conversion_rate_config: Optional[ThresholdTotalAmountPriceConversionRateConfig] = None @@ -721,8 +512,7 @@ class ThresholdTotalAmountPrice(BaseModel): TieredPackagePriceConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -735,6 +525,8 @@ class TieredPackagePrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + composite_price_filters: Optional[List[TransformPriceFilter]] = None + conversion_rate: Optional[float] = None conversion_rate_config: Optional[TieredPackagePriceConversionRateConfig] = None @@ -791,8 +583,7 @@ class TieredPackagePrice(BaseModel): GroupedTieredPriceConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -805,6 +596,8 @@ class GroupedTieredPrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + composite_price_filters: Optional[List[TransformPriceFilter]] = None + conversion_rate: Optional[float] = None conversion_rate_config: Optional[GroupedTieredPriceConversionRateConfig] = None @@ -861,8 +654,7 @@ class GroupedTieredPrice(BaseModel): TieredWithMinimumPriceConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -875,6 +667,8 @@ class TieredWithMinimumPrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + composite_price_filters: Optional[List[TransformPriceFilter]] = None + conversion_rate: Optional[float] = None conversion_rate_config: Optional[TieredWithMinimumPriceConversionRateConfig] = None @@ -931,8 +725,7 @@ class TieredWithMinimumPrice(BaseModel): TieredPackageWithMinimumPriceConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -945,6 +738,8 @@ class TieredPackageWithMinimumPrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + composite_price_filters: Optional[List[TransformPriceFilter]] = None + conversion_rate: Optional[float] = None conversion_rate_config: Optional[TieredPackageWithMinimumPriceConversionRateConfig] = None @@ -1001,8 +796,7 @@ class TieredPackageWithMinimumPrice(BaseModel): PackageWithAllocationPriceConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -1015,6 +809,8 @@ class PackageWithAllocationPrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + composite_price_filters: Optional[List[TransformPriceFilter]] = None + conversion_rate: Optional[float] = None conversion_rate_config: Optional[PackageWithAllocationPriceConversionRateConfig] = None @@ -1071,8 +867,7 @@ class PackageWithAllocationPrice(BaseModel): UnitWithPercentPriceConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -1085,6 +880,8 @@ class UnitWithPercentPrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + composite_price_filters: Optional[List[TransformPriceFilter]] = None + conversion_rate: Optional[float] = None conversion_rate_config: Optional[UnitWithPercentPriceConversionRateConfig] = None @@ -1141,8 +938,7 @@ class UnitWithPercentPrice(BaseModel): MatrixWithAllocationPriceConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -1155,6 +951,8 @@ class MatrixWithAllocationPrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + composite_price_filters: Optional[List[TransformPriceFilter]] = None + conversion_rate: Optional[float] = None conversion_rate_config: Optional[MatrixWithAllocationPriceConversionRateConfig] = None @@ -1211,8 +1009,7 @@ class MatrixWithAllocationPrice(BaseModel): TieredWithProrationPriceConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -1225,6 +1022,8 @@ class TieredWithProrationPrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + composite_price_filters: Optional[List[TransformPriceFilter]] = None + conversion_rate: Optional[float] = None conversion_rate_config: Optional[TieredWithProrationPriceConversionRateConfig] = None @@ -1281,8 +1080,7 @@ class TieredWithProrationPrice(BaseModel): UnitWithProrationPriceConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -1295,6 +1093,8 @@ class UnitWithProrationPrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + composite_price_filters: Optional[List[TransformPriceFilter]] = None + conversion_rate: Optional[float] = None conversion_rate_config: Optional[UnitWithProrationPriceConversionRateConfig] = None @@ -1351,8 +1151,7 @@ class UnitWithProrationPrice(BaseModel): GroupedAllocationPriceConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -1365,6 +1164,8 @@ class GroupedAllocationPrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + composite_price_filters: Optional[List[TransformPriceFilter]] = None + conversion_rate: Optional[float] = None conversion_rate_config: Optional[GroupedAllocationPriceConversionRateConfig] = None @@ -1421,8 +1222,7 @@ class GroupedAllocationPrice(BaseModel): GroupedWithProratedMinimumPriceConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -1435,6 +1235,8 @@ class GroupedWithProratedMinimumPrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + composite_price_filters: Optional[List[TransformPriceFilter]] = None + conversion_rate: Optional[float] = None conversion_rate_config: Optional[GroupedWithProratedMinimumPriceConversionRateConfig] = None @@ -1491,8 +1293,7 @@ class GroupedWithProratedMinimumPrice(BaseModel): GroupedWithMeteredMinimumPriceConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -1505,6 +1306,8 @@ class GroupedWithMeteredMinimumPrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + composite_price_filters: Optional[List[TransformPriceFilter]] = None + conversion_rate: Optional[float] = None conversion_rate_config: Optional[GroupedWithMeteredMinimumPriceConversionRateConfig] = None @@ -1561,8 +1364,7 @@ class GroupedWithMeteredMinimumPrice(BaseModel): MatrixWithDisplayNamePriceConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -1575,6 +1377,8 @@ class MatrixWithDisplayNamePrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + composite_price_filters: Optional[List[TransformPriceFilter]] = None + conversion_rate: Optional[float] = None conversion_rate_config: Optional[MatrixWithDisplayNamePriceConversionRateConfig] = None @@ -1631,8 +1435,7 @@ class MatrixWithDisplayNamePrice(BaseModel): BulkWithProrationPriceConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -1647,6 +1450,8 @@ class BulkWithProrationPrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + composite_price_filters: Optional[List[TransformPriceFilter]] = None + conversion_rate: Optional[float] = None conversion_rate_config: Optional[BulkWithProrationPriceConversionRateConfig] = None @@ -1701,8 +1506,7 @@ class BulkWithProrationPrice(BaseModel): GroupedTieredPackagePriceConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -1715,6 +1519,8 @@ class GroupedTieredPackagePrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + composite_price_filters: Optional[List[TransformPriceFilter]] = None + conversion_rate: Optional[float] = None conversion_rate_config: Optional[GroupedTieredPackagePriceConversionRateConfig] = None @@ -1771,8 +1577,7 @@ class GroupedTieredPackagePrice(BaseModel): MaxGroupTieredPackagePriceConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -1785,6 +1590,8 @@ class MaxGroupTieredPackagePrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + composite_price_filters: Optional[List[TransformPriceFilter]] = None + conversion_rate: Optional[float] = None conversion_rate_config: Optional[MaxGroupTieredPackagePriceConversionRateConfig] = None @@ -1841,8 +1648,7 @@ class MaxGroupTieredPackagePrice(BaseModel): ScalableMatrixWithUnitPricingPriceConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -1855,6 +1661,8 @@ class ScalableMatrixWithUnitPricingPrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + composite_price_filters: Optional[List[TransformPriceFilter]] = None + conversion_rate: Optional[float] = None conversion_rate_config: Optional[ScalableMatrixWithUnitPricingPriceConversionRateConfig] = None @@ -1911,8 +1719,7 @@ class ScalableMatrixWithUnitPricingPrice(BaseModel): ScalableMatrixWithTieredPricingPriceConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -1925,6 +1732,8 @@ class ScalableMatrixWithTieredPricingPrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + composite_price_filters: Optional[List[TransformPriceFilter]] = None + conversion_rate: Optional[float] = None conversion_rate_config: Optional[ScalableMatrixWithTieredPricingPriceConversionRateConfig] = None @@ -1981,8 +1790,7 @@ class ScalableMatrixWithTieredPricingPrice(BaseModel): CumulativeGroupedBulkPriceConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -1995,6 +1803,8 @@ class CumulativeGroupedBulkPrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + composite_price_filters: Optional[List[TransformPriceFilter]] = None + conversion_rate: Optional[float] = None conversion_rate_config: Optional[CumulativeGroupedBulkPriceConversionRateConfig] = None @@ -2051,8 +1861,7 @@ class CumulativeGroupedBulkPrice(BaseModel): GroupedWithMinMaxThresholdsPriceConversionRateConfig: TypeAlias = Annotated[ - Union[UnitConversionRateConfig, TieredConversionRateConfig, None], - PropertyInfo(discriminator="conversion_rate_type"), + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -2065,6 +1874,8 @@ class GroupedWithMinMaxThresholdsPrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + composite_price_filters: Optional[List[TransformPriceFilter]] = None + conversion_rate: Optional[float] = None conversion_rate_config: Optional[GroupedWithMinMaxThresholdsPriceConversionRateConfig] = None @@ -2120,15 +1931,94 @@ class GroupedWithMinMaxThresholdsPrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None +MinimumCompositePriceConversionRateConfig: TypeAlias = Annotated[ + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") +] + + +class MinimumCompositePriceMinimumConfig(BaseModel): + minimum_amount: str + """The minimum amount to apply""" + + prorated: Optional[bool] = None + """ + By default, subtotals from minimum composite prices are prorated based on the + service period. Set to false to disable proration. + """ + + +class MinimumCompositePrice(BaseModel): + id: str + + billable_metric: Optional[BillableMetricTiny] = None + + billing_cycle_configuration: BillingCycleConfiguration + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + composite_price_filters: Optional[List[TransformPriceFilter]] = None + + conversion_rate: Optional[float] = None + + conversion_rate_config: Optional[MinimumCompositePriceConversionRateConfig] = None + + created_at: datetime + + credit_allocation: Optional[Allocation] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + invoicing_cycle_configuration: Optional[BillingCycleConfiguration] = None + + item: ItemSlim + + 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 + + minimum_config: MinimumCompositePriceMinimumConfig + + price_model_type: Literal["minimum"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + replaces_price_id: Optional[str] = None + """The price id this price replaces. + + This price will take the place of the replaced price in plan version migrations. + """ + + dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None + + Price: TypeAlias = Annotated[ Union[ UnitPrice, PackagePrice, MatrixPrice, TieredPrice, - TieredBPSPrice, - BPSPrice, - BulkBPSPrice, BulkPrice, ThresholdTotalAmountPrice, TieredPackagePrice, @@ -2151,6 +2041,7 @@ class GroupedWithMinMaxThresholdsPrice(BaseModel): ScalableMatrixWithTieredPricingPrice, CumulativeGroupedBulkPrice, GroupedWithMinMaxThresholdsPrice, + MinimumCompositePrice, ], PropertyInfo(discriminator="price_model_type"), ] diff --git a/src/orb/types/shared/tiered_bps_config.py b/src/orb/types/shared/tiered_bps_config.py deleted file mode 100644 index 6f19158e..00000000 --- a/src/orb/types/shared/tiered_bps_config.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from .bps_tier import BPSTier -from ..._models import BaseModel - -__all__ = ["TieredBPSConfig"] - - -class TieredBPSConfig(BaseModel): - tiers: List[BPSTier] - """ - Tiers for a Graduated BPS pricing model, where usage is bucketed into specified - tiers - """ diff --git a/src/orb/types/shared_params/__init__.py b/src/orb/types/shared_params/__init__.py index ea8b71ca..4e40fc33 100644 --- a/src/orb/types/shared_params/__init__.py +++ b/src/orb/types/shared_params/__init__.py @@ -1,27 +1,21 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from .tier import Tier as Tier -from .bps_tier import BPSTier as BPSTier from .discount import Discount as Discount from .bulk_tier import BulkTier as BulkTier -from .bps_config import BPSConfig as BPSConfig from .bulk_config import BulkConfig as BulkConfig from .new_maximum import NewMaximum as NewMaximum from .new_minimum import NewMinimum as NewMinimum from .unit_config import UnitConfig as UnitConfig from .matrix_value import MatrixValue as MatrixValue -from .bulk_bps_tier import BulkBPSTier as BulkBPSTier from .matrix_config import MatrixConfig as MatrixConfig from .tiered_config import TieredConfig as TieredConfig from .package_config import PackageConfig as PackageConfig from .trial_discount import TrialDiscount as TrialDiscount from .usage_discount import UsageDiscount as UsageDiscount from .amount_discount import AmountDiscount as AmountDiscount -from .bulk_bps_config import BulkBPSConfig as BulkBPSConfig from .customer_tax_id import CustomerTaxID as CustomerTaxID from .custom_expiration import CustomExpiration as CustomExpiration -from .tiered_bps_config import TieredBPSConfig as TieredBPSConfig -from .new_plan_bps_price import NewPlanBPSPrice as NewPlanBPSPrice from .new_usage_discount import NewUsageDiscount as NewUsageDiscount from .new_amount_discount import NewAmountDiscount as NewAmountDiscount from .new_plan_bulk_price import NewPlanBulkPrice as NewPlanBulkPrice @@ -31,28 +25,24 @@ from .new_allocation_price import NewAllocationPrice as NewAllocationPrice from .new_plan_matrix_price import NewPlanMatrixPrice as NewPlanMatrixPrice from .new_plan_tiered_price import NewPlanTieredPrice as NewPlanTieredPrice -from .new_floating_bps_price import NewFloatingBPSPrice as NewFloatingBPSPrice from .new_plan_package_price import NewPlanPackagePrice as NewPlanPackagePrice from .transform_price_filter import TransformPriceFilter as TransformPriceFilter from .new_floating_bulk_price import NewFloatingBulkPrice as NewFloatingBulkPrice from .new_floating_unit_price import NewFloatingUnitPrice as NewFloatingUnitPrice from .new_percentage_discount import NewPercentageDiscount as NewPercentageDiscount -from .new_plan_bulk_bps_price import NewPlanBulkBPSPrice as NewPlanBulkBPSPrice from .new_floating_matrix_price import NewFloatingMatrixPrice as NewFloatingMatrixPrice from .new_floating_tiered_price import NewFloatingTieredPrice as NewFloatingTieredPrice -from .new_plan_tiered_bps_price import NewPlanTieredBPSPrice as NewPlanTieredBPSPrice from .new_floating_package_price import NewFloatingPackagePrice as NewFloatingPackagePrice from .billing_cycle_relative_date import BillingCycleRelativeDate as BillingCycleRelativeDate from .conversion_rate_unit_config import ConversionRateUnitConfig as ConversionRateUnitConfig -from .new_floating_bulk_bps_price import NewFloatingBulkBPSPrice as NewFloatingBulkBPSPrice from .unit_conversion_rate_config import UnitConversionRateConfig as UnitConversionRateConfig from .conversion_rate_tiered_config import ConversionRateTieredConfig as ConversionRateTieredConfig from .matrix_with_allocation_config import MatrixWithAllocationConfig as MatrixWithAllocationConfig -from .new_floating_tiered_bps_price import NewFloatingTieredBPSPrice as NewFloatingTieredBPSPrice from .new_plan_grouped_tiered_price import NewPlanGroupedTieredPrice as NewPlanGroupedTieredPrice from .new_plan_tiered_package_price import NewPlanTieredPackagePrice as NewPlanTieredPackagePrice from .tiered_conversion_rate_config import TieredConversionRateConfig as TieredConversionRateConfig from .new_billing_cycle_configuration import NewBillingCycleConfiguration as NewBillingCycleConfiguration +from .new_plan_minimum_composite_price import NewPlanMinimumCompositePrice as NewPlanMinimumCompositePrice from .new_plan_unit_with_percent_price import NewPlanUnitWithPercentPrice as NewPlanUnitWithPercentPrice from .new_floating_grouped_tiered_price import NewFloatingGroupedTieredPrice as NewFloatingGroupedTieredPrice from .new_floating_tiered_package_price import NewFloatingTieredPackagePrice as NewFloatingTieredPackagePrice @@ -63,6 +53,7 @@ from .new_plan_tiered_with_minimum_price import NewPlanTieredWithMinimumPrice as NewPlanTieredWithMinimumPrice from .new_plan_unit_with_proration_price import NewPlanUnitWithProrationPrice as NewPlanUnitWithProrationPrice from .new_dimensional_price_configuration import NewDimensionalPriceConfiguration as NewDimensionalPriceConfiguration +from .new_floating_minimum_composite_price import NewFloatingMinimumCompositePrice as NewFloatingMinimumCompositePrice from .new_floating_unit_with_percent_price import NewFloatingUnitWithPercentPrice as NewFloatingUnitWithPercentPrice from .new_floating_grouped_allocation_price import ( NewFloatingGroupedAllocationPrice as NewFloatingGroupedAllocationPrice, diff --git a/src/orb/types/shared_params/amount_discount.py b/src/orb/types/shared_params/amount_discount.py index f3a9a023..9cc51153 100644 --- a/src/orb/types/shared_params/amount_discount.py +++ b/src/orb/types/shared_params/amount_discount.py @@ -2,9 +2,10 @@ from __future__ import annotations -from typing import List, Iterable, Optional +from typing import Iterable, Optional from typing_extensions import Literal, Required, TypedDict +from ..._types import SequenceNotStr from .transform_price_filter import TransformPriceFilter __all__ = ["AmountDiscount"] @@ -16,7 +17,7 @@ class AmountDiscount(TypedDict, total=False): discount_type: Required[Literal["amount"]] - applies_to_price_ids: Optional[List[str]] + applies_to_price_ids: Optional[SequenceNotStr[str]] """List of price_ids that this discount applies to. For plan/plan phase discounts, this can be a subset of prices. diff --git a/src/orb/types/shared_params/bps_config.py b/src/orb/types/shared_params/bps_config.py deleted file mode 100644 index ca9aa6c5..00000000 --- a/src/orb/types/shared_params/bps_config.py +++ /dev/null @@ -1,16 +0,0 @@ -# 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__ = ["BPSConfig"] - - -class BPSConfig(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/bps_tier.py b/src/orb/types/shared_params/bps_tier.py deleted file mode 100644 index 0dd432c8..00000000 --- a/src/orb/types/shared_params/bps_tier.py +++ /dev/null @@ -1,22 +0,0 @@ -# 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__ = ["BPSTier"] - - -class BPSTier(TypedDict, total=False): - bps: Required[float] - """Per-event basis point rate""" - - minimum_amount: Required[str] - """Exclusive tier starting value""" - - maximum_amount: Optional[str] - """Inclusive tier ending value""" - - per_unit_maximum: Optional[str] - """Per unit maximum to charge""" diff --git a/src/orb/types/shared_params/bulk_bps_config.py b/src/orb/types/shared_params/bulk_bps_config.py deleted file mode 100644 index 85ce027b..00000000 --- a/src/orb/types/shared_params/bulk_bps_config.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -from .bulk_bps_tier import BulkBPSTier - -__all__ = ["BulkBPSConfig"] - - -class BulkBPSConfig(TypedDict, total=False): - tiers: Required[Iterable[BulkBPSTier]] - """ - 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_bps_tier.py b/src/orb/types/shared_params/bulk_bps_tier.py deleted file mode 100644 index f63318e4..00000000 --- a/src/orb/types/shared_params/bulk_bps_tier.py +++ /dev/null @@ -1,19 +0,0 @@ -# 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__ = ["BulkBPSTier"] - - -class BulkBPSTier(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""" diff --git a/src/orb/types/shared_params/matrix_config.py b/src/orb/types/shared_params/matrix_config.py index e0534d71..915f3f7d 100644 --- a/src/orb/types/shared_params/matrix_config.py +++ b/src/orb/types/shared_params/matrix_config.py @@ -2,9 +2,10 @@ from __future__ import annotations -from typing import List, Iterable, Optional +from typing import Iterable, Optional from typing_extensions import Required, TypedDict +from ..._types import SequenceNotStr from .matrix_value import MatrixValue __all__ = ["MatrixConfig"] @@ -14,7 +15,7 @@ class MatrixConfig(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]]] + dimensions: Required[SequenceNotStr[Optional[str]]] """One or two event property values to evaluate matrix groups by""" matrix_values: Required[Iterable[MatrixValue]] diff --git a/src/orb/types/shared_params/matrix_value.py b/src/orb/types/shared_params/matrix_value.py index 51d5c5a0..530ecbab 100644 --- a/src/orb/types/shared_params/matrix_value.py +++ b/src/orb/types/shared_params/matrix_value.py @@ -2,14 +2,16 @@ from __future__ import annotations -from typing import List, Optional +from typing import Optional from typing_extensions import Required, TypedDict +from ..._types import SequenceNotStr + __all__ = ["MatrixValue"] class MatrixValue(TypedDict, total=False): - dimension_values: Required[List[Optional[str]]] + dimension_values: Required[SequenceNotStr[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 diff --git a/src/orb/types/shared_params/matrix_with_allocation_config.py b/src/orb/types/shared_params/matrix_with_allocation_config.py index 43011306..eb9ff0ea 100644 --- a/src/orb/types/shared_params/matrix_with_allocation_config.py +++ b/src/orb/types/shared_params/matrix_with_allocation_config.py @@ -2,9 +2,10 @@ from __future__ import annotations -from typing import List, Iterable, Optional +from typing import Iterable, Optional from typing_extensions import Required, TypedDict +from ..._types import SequenceNotStr from .matrix_value import MatrixValue __all__ = ["MatrixWithAllocationConfig"] @@ -17,7 +18,7 @@ class MatrixWithAllocationConfig(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]]] + dimensions: Required[SequenceNotStr[Optional[str]]] """One or two event property values to evaluate matrix groups by""" matrix_values: Required[Iterable[MatrixValue]] diff --git a/src/orb/types/shared_params/new_amount_discount.py b/src/orb/types/shared_params/new_amount_discount.py index 897c0b12..4bd6b048 100644 --- a/src/orb/types/shared_params/new_amount_discount.py +++ b/src/orb/types/shared_params/new_amount_discount.py @@ -2,9 +2,10 @@ from __future__ import annotations -from typing import List, Iterable, Optional +from typing import Iterable, Optional from typing_extensions import Literal, Required, TypedDict +from ..._types import SequenceNotStr from .transform_price_filter import TransformPriceFilter __all__ = ["NewAmountDiscount"] @@ -18,10 +19,10 @@ class NewAmountDiscount(TypedDict, total=False): applies_to_all: Optional[Literal[True]] """If set, the adjustment will apply to every price on the subscription.""" - applies_to_item_ids: Optional[List[str]] + applies_to_item_ids: Optional[SequenceNotStr[str]] """The set of item IDs to which this adjustment applies.""" - applies_to_price_ids: Optional[List[str]] + applies_to_price_ids: Optional[SequenceNotStr[str]] """The set of price IDs to which this adjustment applies.""" currency: Optional[str] diff --git a/src/orb/types/shared_params/new_dimensional_price_configuration.py b/src/orb/types/shared_params/new_dimensional_price_configuration.py index 5c13b0c9..a75a271e 100644 --- a/src/orb/types/shared_params/new_dimensional_price_configuration.py +++ b/src/orb/types/shared_params/new_dimensional_price_configuration.py @@ -2,14 +2,16 @@ from __future__ import annotations -from typing import List, Optional +from typing import Optional from typing_extensions import Required, TypedDict +from ..._types import SequenceNotStr + __all__ = ["NewDimensionalPriceConfiguration"] class NewDimensionalPriceConfiguration(TypedDict, total=False): - dimension_values: Required[List[str]] + dimension_values: Required[SequenceNotStr[str]] """ The list of dimension values matching (in order) the dimensions of the price group diff --git a/src/orb/types/shared_params/new_floating_bps_price.py b/src/orb/types/shared_params/new_floating_bps_price.py deleted file mode 100644 index 58f4be5d..00000000 --- a/src/orb/types/shared_params/new_floating_bps_price.py +++ /dev/null @@ -1,86 +0,0 @@ -# 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 import BPSConfig -from .unit_conversion_rate_config import UnitConversionRateConfig -from .tiered_conversion_rate_config import TieredConversionRateConfig -from .new_billing_cycle_configuration import NewBillingCycleConfiguration -from .new_dimensional_price_configuration import NewDimensionalPriceConfiguration - -__all__ = ["NewFloatingBPSPrice", "ConversionRateConfig"] - -ConversionRateConfig: TypeAlias = Union[UnitConversionRateConfig, TieredConversionRateConfig] - - -class NewFloatingBPSPrice(TypedDict, total=False): - bps_config: Required[BPSConfig] - - 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[NewBillingCycleConfiguration] - """ - 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.""" - - conversion_rate_config: Optional[ConversionRateConfig] - """The configuration for the rate of the price currency to the invoicing currency.""" - - dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] - """For dimensional price: specifies a price group and dimension values""" - - 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[NewBillingCycleConfiguration] - """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`. - """ diff --git a/src/orb/types/shared_params/new_floating_bulk_bps_price.py b/src/orb/types/shared_params/new_floating_bulk_bps_price.py deleted file mode 100644 index 6840841c..00000000 --- a/src/orb/types/shared_params/new_floating_bulk_bps_price.py +++ /dev/null @@ -1,86 +0,0 @@ -# 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 .bulk_bps_config import BulkBPSConfig -from .unit_conversion_rate_config import UnitConversionRateConfig -from .tiered_conversion_rate_config import TieredConversionRateConfig -from .new_billing_cycle_configuration import NewBillingCycleConfiguration -from .new_dimensional_price_configuration import NewDimensionalPriceConfiguration - -__all__ = ["NewFloatingBulkBPSPrice", "ConversionRateConfig"] - -ConversionRateConfig: TypeAlias = Union[UnitConversionRateConfig, TieredConversionRateConfig] - - -class NewFloatingBulkBPSPrice(TypedDict, total=False): - bulk_bps_config: Required[BulkBPSConfig] - - 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[NewBillingCycleConfiguration] - """ - 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.""" - - conversion_rate_config: Optional[ConversionRateConfig] - """The configuration for the rate of the price currency to the invoicing currency.""" - - dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] - """For dimensional price: specifies a price group and dimension values""" - - 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[NewBillingCycleConfiguration] - """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`. - """ diff --git a/src/orb/types/shared_params/new_floating_tiered_bps_price.py b/src/orb/types/shared_params/new_floating_minimum_composite_price.py similarity index 83% rename from src/orb/types/shared_params/new_floating_tiered_bps_price.py rename to src/orb/types/shared_params/new_floating_minimum_composite_price.py index 2e4cc40e..d47e923a 100644 --- a/src/orb/types/shared_params/new_floating_tiered_bps_price.py +++ b/src/orb/types/shared_params/new_floating_minimum_composite_price.py @@ -5,18 +5,29 @@ from typing import Dict, Union, Optional from typing_extensions import Literal, Required, TypeAlias, TypedDict -from .tiered_bps_config import TieredBPSConfig from .unit_conversion_rate_config import UnitConversionRateConfig from .tiered_conversion_rate_config import TieredConversionRateConfig from .new_billing_cycle_configuration import NewBillingCycleConfiguration from .new_dimensional_price_configuration import NewDimensionalPriceConfiguration -__all__ = ["NewFloatingTieredBPSPrice", "ConversionRateConfig"] +__all__ = ["NewFloatingMinimumCompositePrice", "MinimumConfig", "ConversionRateConfig"] + + +class MinimumConfig(TypedDict, total=False): + minimum_amount: Required[str] + """The minimum amount to apply""" + + prorated: Optional[bool] + """ + By default, subtotals from minimum composite prices are prorated based on the + service period. Set to false to disable proration. + """ + ConversionRateConfig: TypeAlias = Union[UnitConversionRateConfig, TieredConversionRateConfig] -class NewFloatingTieredBPSPrice(TypedDict, total=False): +class NewFloatingMinimumCompositePrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -26,13 +37,13 @@ class NewFloatingTieredBPSPrice(TypedDict, total=False): item_id: Required[str] """The id of the item the price will be associated with.""" - model_type: Required[Literal["tiered_bps"]] + minimum_config: Required[MinimumConfig] + + model_type: Required[Literal["minimum"]] name: Required[str] """The name of the price.""" - tiered_bps_config: Required[TieredBPSConfig] - billable_metric_id: Optional[str] """The id of the billable metric for the price. diff --git a/src/orb/types/shared_params/new_maximum.py b/src/orb/types/shared_params/new_maximum.py index d48ef79c..29e7f8a4 100644 --- a/src/orb/types/shared_params/new_maximum.py +++ b/src/orb/types/shared_params/new_maximum.py @@ -2,9 +2,10 @@ from __future__ import annotations -from typing import List, Iterable, Optional +from typing import Iterable, Optional from typing_extensions import Literal, Required, TypedDict +from ..._types import SequenceNotStr from .transform_price_filter import TransformPriceFilter __all__ = ["NewMaximum"] @@ -18,10 +19,10 @@ class NewMaximum(TypedDict, total=False): applies_to_all: Optional[Literal[True]] """If set, the adjustment will apply to every price on the subscription.""" - applies_to_item_ids: Optional[List[str]] + applies_to_item_ids: Optional[SequenceNotStr[str]] """The set of item IDs to which this adjustment applies.""" - applies_to_price_ids: Optional[List[str]] + applies_to_price_ids: Optional[SequenceNotStr[str]] """The set of price IDs to which this adjustment applies.""" currency: Optional[str] diff --git a/src/orb/types/shared_params/new_minimum.py b/src/orb/types/shared_params/new_minimum.py index 1ef634ec..2605d028 100644 --- a/src/orb/types/shared_params/new_minimum.py +++ b/src/orb/types/shared_params/new_minimum.py @@ -2,9 +2,10 @@ from __future__ import annotations -from typing import List, Iterable, Optional +from typing import Iterable, Optional from typing_extensions import Literal, Required, TypedDict +from ..._types import SequenceNotStr from .transform_price_filter import TransformPriceFilter __all__ = ["NewMinimum"] @@ -21,10 +22,10 @@ class NewMinimum(TypedDict, total=False): applies_to_all: Optional[Literal[True]] """If set, the adjustment will apply to every price on the subscription.""" - applies_to_item_ids: Optional[List[str]] + applies_to_item_ids: Optional[SequenceNotStr[str]] """The set of item IDs to which this adjustment applies.""" - applies_to_price_ids: Optional[List[str]] + applies_to_price_ids: Optional[SequenceNotStr[str]] """The set of price IDs to which this adjustment applies.""" currency: Optional[str] diff --git a/src/orb/types/shared_params/new_percentage_discount.py b/src/orb/types/shared_params/new_percentage_discount.py index 7bef4f38..1dd0eb52 100644 --- a/src/orb/types/shared_params/new_percentage_discount.py +++ b/src/orb/types/shared_params/new_percentage_discount.py @@ -2,9 +2,10 @@ from __future__ import annotations -from typing import List, Iterable, Optional +from typing import Iterable, Optional from typing_extensions import Literal, Required, TypedDict +from ..._types import SequenceNotStr from .transform_price_filter import TransformPriceFilter __all__ = ["NewPercentageDiscount"] @@ -18,10 +19,10 @@ class NewPercentageDiscount(TypedDict, total=False): applies_to_all: Optional[Literal[True]] """If set, the adjustment will apply to every price on the subscription.""" - applies_to_item_ids: Optional[List[str]] + applies_to_item_ids: Optional[SequenceNotStr[str]] """The set of item IDs to which this adjustment applies.""" - applies_to_price_ids: Optional[List[str]] + applies_to_price_ids: Optional[SequenceNotStr[str]] """The set of price IDs to which this adjustment applies.""" currency: Optional[str] diff --git a/src/orb/types/shared_params/new_plan_bps_price.py b/src/orb/types/shared_params/new_plan_bps_price.py deleted file mode 100644 index c4f7ebcd..00000000 --- a/src/orb/types/shared_params/new_plan_bps_price.py +++ /dev/null @@ -1,95 +0,0 @@ -# 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 import BPSConfig -from .unit_conversion_rate_config import UnitConversionRateConfig -from .tiered_conversion_rate_config import TieredConversionRateConfig -from .new_billing_cycle_configuration import NewBillingCycleConfiguration -from .new_dimensional_price_configuration import NewDimensionalPriceConfiguration - -__all__ = ["NewPlanBPSPrice", "ConversionRateConfig"] - -ConversionRateConfig: TypeAlias = Union[UnitConversionRateConfig, TieredConversionRateConfig] - - -class NewPlanBPSPrice(TypedDict, total=False): - bps_config: Required[BPSConfig] - - 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[NewBillingCycleConfiguration] - """ - 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.""" - - conversion_rate_config: Optional[ConversionRateConfig] - """The configuration for the 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. - """ - - dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] - """For dimensional price: specifies a price group and dimension values""" - - 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[NewBillingCycleConfiguration] - """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. - """ diff --git a/src/orb/types/shared_params/new_plan_bulk_bps_price.py b/src/orb/types/shared_params/new_plan_minimum_composite_price.py similarity index 84% rename from src/orb/types/shared_params/new_plan_bulk_bps_price.py rename to src/orb/types/shared_params/new_plan_minimum_composite_price.py index 79321ef3..a488fe23 100644 --- a/src/orb/types/shared_params/new_plan_bulk_bps_price.py +++ b/src/orb/types/shared_params/new_plan_minimum_composite_price.py @@ -5,27 +5,38 @@ from typing import Dict, Union, Optional from typing_extensions import Literal, Required, TypeAlias, TypedDict -from .bulk_bps_config import BulkBPSConfig from .unit_conversion_rate_config import UnitConversionRateConfig from .tiered_conversion_rate_config import TieredConversionRateConfig from .new_billing_cycle_configuration import NewBillingCycleConfiguration from .new_dimensional_price_configuration import NewDimensionalPriceConfiguration -__all__ = ["NewPlanBulkBPSPrice", "ConversionRateConfig"] +__all__ = ["NewPlanMinimumCompositePrice", "MinimumConfig", "ConversionRateConfig"] + + +class MinimumConfig(TypedDict, total=False): + minimum_amount: Required[str] + """The minimum amount to apply""" + + prorated: Optional[bool] + """ + By default, subtotals from minimum composite prices are prorated based on the + service period. Set to false to disable proration. + """ -ConversionRateConfig: TypeAlias = Union[UnitConversionRateConfig, TieredConversionRateConfig] +ConversionRateConfig: TypeAlias = Union[UnitConversionRateConfig, TieredConversionRateConfig] -class NewPlanBulkBPSPrice(TypedDict, total=False): - bulk_bps_config: Required[BulkBPSConfig] +class NewPlanMinimumCompositePrice(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["bulk_bps"]] + minimum_config: Required[MinimumConfig] + + model_type: Required[Literal["minimum"]] name: Required[str] """The name of the price.""" diff --git a/src/orb/types/shared_params/new_plan_tiered_bps_price.py b/src/orb/types/shared_params/new_plan_tiered_bps_price.py deleted file mode 100644 index b6854a82..00000000 --- a/src/orb/types/shared_params/new_plan_tiered_bps_price.py +++ /dev/null @@ -1,95 +0,0 @@ -# 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 .tiered_bps_config import TieredBPSConfig -from .unit_conversion_rate_config import UnitConversionRateConfig -from .tiered_conversion_rate_config import TieredConversionRateConfig -from .new_billing_cycle_configuration import NewBillingCycleConfiguration -from .new_dimensional_price_configuration import NewDimensionalPriceConfiguration - -__all__ = ["NewPlanTieredBPSPrice", "ConversionRateConfig"] - -ConversionRateConfig: TypeAlias = Union[UnitConversionRateConfig, TieredConversionRateConfig] - - -class NewPlanTieredBPSPrice(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[TieredBPSConfig] - - 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[NewBillingCycleConfiguration] - """ - 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.""" - - conversion_rate_config: Optional[ConversionRateConfig] - """The configuration for the 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. - """ - - dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] - """For dimensional price: specifies a price group and dimension values""" - - 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[NewBillingCycleConfiguration] - """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. - """ diff --git a/src/orb/types/shared_params/new_usage_discount.py b/src/orb/types/shared_params/new_usage_discount.py index 16b3b8de..2c781fe6 100644 --- a/src/orb/types/shared_params/new_usage_discount.py +++ b/src/orb/types/shared_params/new_usage_discount.py @@ -2,9 +2,10 @@ from __future__ import annotations -from typing import List, Iterable, Optional +from typing import Iterable, Optional from typing_extensions import Literal, Required, TypedDict +from ..._types import SequenceNotStr from .transform_price_filter import TransformPriceFilter __all__ = ["NewUsageDiscount"] @@ -18,10 +19,10 @@ class NewUsageDiscount(TypedDict, total=False): applies_to_all: Optional[Literal[True]] """If set, the adjustment will apply to every price on the subscription.""" - applies_to_item_ids: Optional[List[str]] + applies_to_item_ids: Optional[SequenceNotStr[str]] """The set of item IDs to which this adjustment applies.""" - applies_to_price_ids: Optional[List[str]] + applies_to_price_ids: Optional[SequenceNotStr[str]] """The set of price IDs to which this adjustment applies.""" currency: Optional[str] diff --git a/src/orb/types/shared_params/percentage_discount.py b/src/orb/types/shared_params/percentage_discount.py index 9d41a3a3..77870b74 100644 --- a/src/orb/types/shared_params/percentage_discount.py +++ b/src/orb/types/shared_params/percentage_discount.py @@ -2,9 +2,10 @@ from __future__ import annotations -from typing import List, Iterable, Optional +from typing import Iterable, Optional from typing_extensions import Literal, Required, TypedDict +from ..._types import SequenceNotStr from .transform_price_filter import TransformPriceFilter __all__ = ["PercentageDiscount"] @@ -19,7 +20,7 @@ class PercentageDiscount(TypedDict, total=False): This is a number between 0 and 1. """ - applies_to_price_ids: Optional[List[str]] + applies_to_price_ids: Optional[SequenceNotStr[str]] """List of price_ids that this discount applies to. For plan/plan phase discounts, this can be a subset of prices. diff --git a/src/orb/types/shared_params/tiered_bps_config.py b/src/orb/types/shared_params/tiered_bps_config.py deleted file mode 100644 index 1f636ff2..00000000 --- a/src/orb/types/shared_params/tiered_bps_config.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -from .bps_tier import BPSTier - -__all__ = ["TieredBPSConfig"] - - -class TieredBPSConfig(TypedDict, total=False): - tiers: Required[Iterable[BPSTier]] - """ - Tiers for a Graduated BPS pricing model, where usage is bucketed into specified - tiers - """ diff --git a/src/orb/types/shared_params/transform_price_filter.py b/src/orb/types/shared_params/transform_price_filter.py index 81298270..2a1ce1eb 100644 --- a/src/orb/types/shared_params/transform_price_filter.py +++ b/src/orb/types/shared_params/transform_price_filter.py @@ -2,9 +2,10 @@ from __future__ import annotations -from typing import List from typing_extensions import Literal, Required, TypedDict +from ..._types import SequenceNotStr + __all__ = ["TransformPriceFilter"] @@ -15,5 +16,5 @@ class TransformPriceFilter(TypedDict, total=False): operator: Required[Literal["includes", "excludes"]] """Should prices that match the filter be included or excluded.""" - values: Required[List[str]] + values: Required[SequenceNotStr[str]] """The IDs or values that match this filter.""" diff --git a/src/orb/types/shared_params/trial_discount.py b/src/orb/types/shared_params/trial_discount.py index 012c87b6..ef1ca9b5 100644 --- a/src/orb/types/shared_params/trial_discount.py +++ b/src/orb/types/shared_params/trial_discount.py @@ -2,9 +2,10 @@ from __future__ import annotations -from typing import List, Iterable, Optional +from typing import Iterable, Optional from typing_extensions import Literal, Required, TypedDict +from ..._types import SequenceNotStr from .transform_price_filter import TransformPriceFilter __all__ = ["TrialDiscount"] @@ -13,7 +14,7 @@ class TrialDiscount(TypedDict, total=False): discount_type: Required[Literal["trial"]] - applies_to_price_ids: Optional[List[str]] + applies_to_price_ids: Optional[SequenceNotStr[str]] """List of price_ids that this discount applies to. For plan/plan phase discounts, this can be a subset of prices. diff --git a/src/orb/types/shared_params/usage_discount.py b/src/orb/types/shared_params/usage_discount.py index 7df2679b..556c81cb 100644 --- a/src/orb/types/shared_params/usage_discount.py +++ b/src/orb/types/shared_params/usage_discount.py @@ -2,9 +2,10 @@ from __future__ import annotations -from typing import List, Iterable, Optional +from typing import Iterable, Optional from typing_extensions import Literal, Required, TypedDict +from ..._types import SequenceNotStr from .transform_price_filter import TransformPriceFilter __all__ = ["UsageDiscount"] @@ -19,7 +20,7 @@ class UsageDiscount(TypedDict, total=False): Number of usage units that this discount is for """ - applies_to_price_ids: Optional[List[str]] + applies_to_price_ids: Optional[SequenceNotStr[str]] """List of price_ids that this discount applies to. For plan/plan phase discounts, this can be a subset of prices. diff --git a/src/orb/types/subscription_create_params.py b/src/orb/types/subscription_create_params.py index 4be3ffee..851cd62e 100644 --- a/src/orb/types/subscription_create_params.py +++ b/src/orb/types/subscription_create_params.py @@ -2,15 +2,15 @@ from __future__ import annotations -from typing import Dict, List, Union, Iterable, Optional +from typing import Dict, Union, Iterable, Optional from datetime import datetime from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from .._types import SequenceNotStr from .._utils import PropertyInfo from .discount_override_param import DiscountOverrideParam from .shared_params.new_maximum import NewMaximum from .shared_params.new_minimum import NewMinimum -from .new_subscription_bps_price_param import NewSubscriptionBPSPriceParam from .shared_params.new_usage_discount import NewUsageDiscount from .new_subscription_bulk_price_param import NewSubscriptionBulkPriceParam from .new_subscription_unit_price_param import NewSubscriptionUnitPriceParam @@ -19,11 +19,13 @@ from .new_subscription_matrix_price_param import NewSubscriptionMatrixPriceParam from .new_subscription_tiered_price_param import NewSubscriptionTieredPriceParam from .new_subscription_package_price_param import NewSubscriptionPackagePriceParam -from .new_subscription_bulk_bps_price_param import NewSubscriptionBulkBPSPriceParam from .shared_params.new_percentage_discount import NewPercentageDiscount -from .new_subscription_tiered_bps_price_param import NewSubscriptionTieredBPSPriceParam +from .shared_params.unit_conversion_rate_config import UnitConversionRateConfig from .new_subscription_grouped_tiered_price_param import NewSubscriptionGroupedTieredPriceParam from .new_subscription_tiered_package_price_param import NewSubscriptionTieredPackagePriceParam +from .shared_params.tiered_conversion_rate_config import TieredConversionRateConfig +from .shared_params.new_billing_cycle_configuration import NewBillingCycleConfiguration +from .new_subscription_minimum_composite_price_param import NewSubscriptionMinimumCompositePriceParam from .new_subscription_unit_with_percent_price_param import NewSubscriptionUnitWithPercentPriceParam from .new_subscription_grouped_allocation_price_param import NewSubscriptionGroupedAllocationPriceParam from .new_subscription_bulk_with_proration_price_param import NewSubscriptionBulkWithProrationPriceParam @@ -31,6 +33,7 @@ from .new_subscription_tiered_with_minimum_price_param import NewSubscriptionTieredWithMinimumPriceParam from .new_subscription_unit_with_proration_price_param import NewSubscriptionUnitWithProrationPriceParam from .shared_params.billing_cycle_anchor_configuration import BillingCycleAnchorConfiguration +from .shared_params.new_dimensional_price_configuration import NewDimensionalPriceConfiguration from .new_subscription_grouped_tiered_package_price_param import NewSubscriptionGroupedTieredPackagePriceParam from .new_subscription_matrix_with_allocation_price_param import NewSubscriptionMatrixWithAllocationPriceParam from .new_subscription_threshold_total_amount_price_param import NewSubscriptionThresholdTotalAmountPriceParam @@ -58,12 +61,16 @@ "AddAdjustmentAdjustment", "AddPrice", "AddPricePrice", + "AddPricePriceNewSubscriptionGroupedWithMinMaxThresholdsPrice", + "AddPricePriceNewSubscriptionGroupedWithMinMaxThresholdsPriceConversionRateConfig", "RemoveAdjustment", "RemovePrice", "ReplaceAdjustment", "ReplaceAdjustmentAdjustment", "ReplacePrice", "ReplacePricePrice", + "ReplacePricePriceNewSubscriptionGroupedWithMinMaxThresholdsPrice", + "ReplacePricePriceNewSubscriptionGroupedWithMinMaxThresholdsPriceConversionRateConfig", ] @@ -225,7 +232,7 @@ class SubscriptionCreateParams(TypedDict, total=False): provided, the trial on the plan will be skipped. """ - usage_customer_ids: Optional[List[str]] + usage_customer_ids: Optional[SequenceNotStr[str]] """ A list of customer IDs whose usage events will be aggregated and billed under this subscription. By default, a subscription only considers usage events @@ -264,14 +271,95 @@ class AddAdjustment(TypedDict, total=False): """ +AddPricePriceNewSubscriptionGroupedWithMinMaxThresholdsPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPricePriceNewSubscriptionGroupedWithMinMaxThresholdsPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_with_min_max_thresholds_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_min_max_thresholds"]] + + 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[NewBillingCycleConfiguration] + """ + 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.""" + + conversion_rate_config: Optional[AddPricePriceNewSubscriptionGroupedWithMinMaxThresholdsPriceConversionRateConfig] + """The configuration for the 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. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + 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[NewBillingCycleConfiguration] + """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[ NewSubscriptionUnitPriceParam, NewSubscriptionPackagePriceParam, NewSubscriptionMatrixPriceParam, NewSubscriptionTieredPriceParam, - NewSubscriptionTieredBPSPriceParam, - NewSubscriptionBPSPriceParam, - NewSubscriptionBulkBPSPriceParam, NewSubscriptionBulkPriceParam, NewSubscriptionThresholdTotalAmountPriceParam, NewSubscriptionTieredPackagePriceParam, @@ -293,6 +381,8 @@ class AddAdjustment(TypedDict, total=False): NewSubscriptionMatrixWithAllocationPriceParam, NewSubscriptionTieredPackageWithMinimumPriceParam, NewSubscriptionGroupedTieredPriceParam, + AddPricePriceNewSubscriptionGroupedWithMinMaxThresholdsPrice, + NewSubscriptionMinimumCompositePriceParam, ] @@ -371,14 +461,97 @@ class ReplaceAdjustment(TypedDict, total=False): """The id of the adjustment on the plan to replace in the subscription.""" +ReplacePricePriceNewSubscriptionGroupedWithMinMaxThresholdsPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePricePriceNewSubscriptionGroupedWithMinMaxThresholdsPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_with_min_max_thresholds_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_min_max_thresholds"]] + + 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[NewBillingCycleConfiguration] + """ + 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.""" + + conversion_rate_config: Optional[ + ReplacePricePriceNewSubscriptionGroupedWithMinMaxThresholdsPriceConversionRateConfig + ] + """The configuration for the 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. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + 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[NewBillingCycleConfiguration] + """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[ NewSubscriptionUnitPriceParam, NewSubscriptionPackagePriceParam, NewSubscriptionMatrixPriceParam, NewSubscriptionTieredPriceParam, - NewSubscriptionTieredBPSPriceParam, - NewSubscriptionBPSPriceParam, - NewSubscriptionBulkBPSPriceParam, NewSubscriptionBulkPriceParam, NewSubscriptionThresholdTotalAmountPriceParam, NewSubscriptionTieredPackagePriceParam, @@ -400,6 +573,8 @@ class ReplaceAdjustment(TypedDict, total=False): NewSubscriptionMatrixWithAllocationPriceParam, NewSubscriptionTieredPackageWithMinimumPriceParam, NewSubscriptionGroupedTieredPriceParam, + ReplacePricePriceNewSubscriptionGroupedWithMinMaxThresholdsPrice, + NewSubscriptionMinimumCompositePriceParam, ] diff --git a/src/orb/types/subscription_list_params.py b/src/orb/types/subscription_list_params.py index 2919bebb..e43fd79c 100644 --- a/src/orb/types/subscription_list_params.py +++ b/src/orb/types/subscription_list_params.py @@ -2,10 +2,11 @@ from __future__ import annotations -from typing import List, Union, Optional +from typing import Union, Optional from datetime import datetime from typing_extensions import Literal, Annotated, TypedDict +from .._types import SequenceNotStr from .._utils import PropertyInfo __all__ = ["SubscriptionListParams"] @@ -27,9 +28,9 @@ class SubscriptionListParams(TypedDict, total=False): request. """ - customer_id: Optional[List[str]] + customer_id: Optional[SequenceNotStr[str]] - external_customer_id: Optional[List[str]] + external_customer_id: Optional[SequenceNotStr[str]] limit: int """The number of items to fetch. Defaults to 20.""" diff --git a/src/orb/types/subscription_price_intervals_params.py b/src/orb/types/subscription_price_intervals_params.py index ab7bb60a..39461d58 100644 --- a/src/orb/types/subscription_price_intervals_params.py +++ b/src/orb/types/subscription_price_intervals_params.py @@ -2,10 +2,11 @@ from __future__ import annotations -from typing import List, Union, Iterable, Optional +from typing import Dict, Union, Iterable, Optional from datetime import datetime from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from .._types import SequenceNotStr from .._utils import PropertyInfo from .shared_params.new_maximum import NewMaximum from .shared_params.new_minimum import NewMinimum @@ -13,17 +14,19 @@ from .shared_params.new_amount_discount import NewAmountDiscount from .shared.billing_cycle_relative_date import BillingCycleRelativeDate from .shared_params.new_allocation_price import NewAllocationPrice -from .shared_params.new_floating_bps_price import NewFloatingBPSPrice from .shared_params.new_floating_bulk_price import NewFloatingBulkPrice from .shared_params.new_floating_unit_price import NewFloatingUnitPrice from .shared_params.new_percentage_discount import NewPercentageDiscount from .shared_params.new_floating_matrix_price import NewFloatingMatrixPrice from .shared_params.new_floating_tiered_price import NewFloatingTieredPrice from .shared_params.new_floating_package_price import NewFloatingPackagePrice -from .shared_params.new_floating_bulk_bps_price import NewFloatingBulkBPSPrice -from .shared_params.new_floating_tiered_bps_price import NewFloatingTieredBPSPrice +from .shared_params.unit_conversion_rate_config import UnitConversionRateConfig +from .shared_params.tiered_conversion_rate_config import TieredConversionRateConfig +from .shared_params.new_billing_cycle_configuration import NewBillingCycleConfiguration from .shared_params.new_floating_grouped_tiered_price import NewFloatingGroupedTieredPrice from .shared_params.new_floating_tiered_package_price import NewFloatingTieredPackagePrice +from .shared_params.new_dimensional_price_configuration import NewDimensionalPriceConfiguration +from .shared_params.new_floating_minimum_composite_price import NewFloatingMinimumCompositePrice from .shared_params.new_floating_unit_with_percent_price import NewFloatingUnitWithPercentPrice from .shared_params.new_floating_grouped_allocation_price import NewFloatingGroupedAllocationPrice from .shared_params.new_floating_bulk_with_proration_price import NewFloatingBulkWithProrationPrice @@ -56,6 +59,8 @@ "AddDiscountUsageDiscountCreationParams", "AddFixedFeeQuantityTransition", "AddPrice", + "AddPriceNewFloatingGroupedWithMinMaxThresholdsPrice", + "AddPriceNewFloatingGroupedWithMinMaxThresholdsPriceConversionRateConfig", "AddAdjustment", "AddAdjustmentAdjustment", "Edit", @@ -127,15 +132,87 @@ class AddFixedFeeQuantityTransition(TypedDict, total=False): """The quantity of the fixed fee quantity transition.""" +AddPriceNewFloatingGroupedWithMinMaxThresholdsPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceNewFloatingGroupedWithMinMaxThresholdsPrice(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_min_max_thresholds_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_min_max_thresholds"]] + + 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[NewBillingCycleConfiguration] + """ + 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.""" + + conversion_rate_config: Optional[AddPriceNewFloatingGroupedWithMinMaxThresholdsPriceConversionRateConfig] + """The configuration for the rate of the price currency to the invoicing currency.""" + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + 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[NewBillingCycleConfiguration] + """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`. + """ + + AddPrice: TypeAlias = Union[ NewFloatingUnitPrice, NewFloatingPackagePrice, NewFloatingMatrixPrice, NewFloatingMatrixWithAllocationPrice, NewFloatingTieredPrice, - NewFloatingTieredBPSPrice, - NewFloatingBPSPrice, - NewFloatingBulkBPSPrice, NewFloatingBulkPrice, NewFloatingThresholdTotalAmountPrice, NewFloatingTieredPackagePrice, @@ -156,6 +233,8 @@ class AddFixedFeeQuantityTransition(TypedDict, total=False): NewFloatingScalableMatrixWithUnitPricingPrice, NewFloatingScalableMatrixWithTieredPricingPrice, NewFloatingCumulativeGroupedBulkPrice, + AddPriceNewFloatingGroupedWithMinMaxThresholdsPrice, + NewFloatingMinimumCompositePrice, ] @@ -212,7 +291,7 @@ class Add(TypedDict, total=False): price_id: Optional[str] """The id of the price to add to the subscription.""" - usage_customer_ids: Optional[List[str]] + usage_customer_ids: Optional[SequenceNotStr[str]] """ A list of customer IDs whose usage events will be aggregated and billed under this subscription. By default, a subscription only considers usage events @@ -229,9 +308,6 @@ class Add(TypedDict, total=False): class AddAdjustment(TypedDict, total=False): - adjustment: Required[AddAdjustmentAdjustment] - """The definition of a new adjustment to create and add to the subscription.""" - start_date: Required[ Annotated[Union[Union[str, datetime], BillingCycleRelativeDate], PropertyInfo(format="iso8601")] ] @@ -243,6 +319,16 @@ class AddAdjustment(TypedDict, total=False): and exclusive for in-arrears prices. """ + adjustment: Optional[AddAdjustmentAdjustment] + """The definition of a new adjustment to create and add to the subscription.""" + + adjustment_id: Optional[str] + """The ID of the adjustment to add to the subscription. + + Adjustment IDs can be re-used from existing subscriptions or plans, but + adjustments associated with coupon redemptions cannot be re-used. + """ + end_date: Annotated[Union[Union[str, datetime], BillingCycleRelativeDate, None], PropertyInfo(format="iso8601")] """The end date of the adjustment interval. @@ -299,7 +385,7 @@ class Edit(TypedDict, total=False): If not specified, the start date will not be updated. """ - usage_customer_ids: Optional[List[str]] + usage_customer_ids: Optional[SequenceNotStr[str]] """ A list of customer IDs whose usage events will be aggregated and billed under this subscription. By default, a subscription only considers usage events diff --git a/src/orb/types/subscription_schedule_plan_change_params.py b/src/orb/types/subscription_schedule_plan_change_params.py index 40044636..ef98f326 100644 --- a/src/orb/types/subscription_schedule_plan_change_params.py +++ b/src/orb/types/subscription_schedule_plan_change_params.py @@ -2,15 +2,15 @@ from __future__ import annotations -from typing import List, Union, Iterable, Optional +from typing import Dict, Union, Iterable, Optional from datetime import datetime from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from .._types import SequenceNotStr from .._utils import PropertyInfo from .discount_override_param import DiscountOverrideParam from .shared_params.new_maximum import NewMaximum from .shared_params.new_minimum import NewMinimum -from .new_subscription_bps_price_param import NewSubscriptionBPSPriceParam from .shared_params.new_usage_discount import NewUsageDiscount from .new_subscription_bulk_price_param import NewSubscriptionBulkPriceParam from .new_subscription_unit_price_param import NewSubscriptionUnitPriceParam @@ -19,11 +19,13 @@ from .new_subscription_matrix_price_param import NewSubscriptionMatrixPriceParam from .new_subscription_tiered_price_param import NewSubscriptionTieredPriceParam from .new_subscription_package_price_param import NewSubscriptionPackagePriceParam -from .new_subscription_bulk_bps_price_param import NewSubscriptionBulkBPSPriceParam from .shared_params.new_percentage_discount import NewPercentageDiscount -from .new_subscription_tiered_bps_price_param import NewSubscriptionTieredBPSPriceParam +from .shared_params.unit_conversion_rate_config import UnitConversionRateConfig from .new_subscription_grouped_tiered_price_param import NewSubscriptionGroupedTieredPriceParam from .new_subscription_tiered_package_price_param import NewSubscriptionTieredPackagePriceParam +from .shared_params.tiered_conversion_rate_config import TieredConversionRateConfig +from .shared_params.new_billing_cycle_configuration import NewBillingCycleConfiguration +from .new_subscription_minimum_composite_price_param import NewSubscriptionMinimumCompositePriceParam from .new_subscription_unit_with_percent_price_param import NewSubscriptionUnitWithPercentPriceParam from .new_subscription_grouped_allocation_price_param import NewSubscriptionGroupedAllocationPriceParam from .new_subscription_bulk_with_proration_price_param import NewSubscriptionBulkWithProrationPriceParam @@ -31,6 +33,7 @@ from .new_subscription_tiered_with_minimum_price_param import NewSubscriptionTieredWithMinimumPriceParam from .new_subscription_unit_with_proration_price_param import NewSubscriptionUnitWithProrationPriceParam from .shared_params.billing_cycle_anchor_configuration import BillingCycleAnchorConfiguration +from .shared_params.new_dimensional_price_configuration import NewDimensionalPriceConfiguration from .new_subscription_grouped_tiered_package_price_param import NewSubscriptionGroupedTieredPackagePriceParam from .new_subscription_matrix_with_allocation_price_param import NewSubscriptionMatrixWithAllocationPriceParam from .new_subscription_threshold_total_amount_price_param import NewSubscriptionThresholdTotalAmountPriceParam @@ -58,12 +61,16 @@ "AddAdjustmentAdjustment", "AddPrice", "AddPricePrice", + "AddPricePriceNewSubscriptionGroupedWithMinMaxThresholdsPrice", + "AddPricePriceNewSubscriptionGroupedWithMinMaxThresholdsPriceConversionRateConfig", "RemoveAdjustment", "RemovePrice", "ReplaceAdjustment", "ReplaceAdjustmentAdjustment", "ReplacePrice", "ReplacePricePrice", + "ReplacePricePriceNewSubscriptionGroupedWithMinMaxThresholdsPrice", + "ReplacePricePriceNewSubscriptionGroupedWithMinMaxThresholdsPriceConversionRateConfig", ] @@ -213,7 +220,7 @@ class SubscriptionSchedulePlanChangeParams(TypedDict, total=False): provided, the trial on the plan will be skipped. """ - usage_customer_ids: Optional[List[str]] + usage_customer_ids: Optional[SequenceNotStr[str]] """ A list of customer IDs whose usage events will be aggregated and billed under this subscription. By default, a subscription only considers usage events @@ -252,14 +259,95 @@ class AddAdjustment(TypedDict, total=False): """ +AddPricePriceNewSubscriptionGroupedWithMinMaxThresholdsPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPricePriceNewSubscriptionGroupedWithMinMaxThresholdsPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_with_min_max_thresholds_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_min_max_thresholds"]] + + 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[NewBillingCycleConfiguration] + """ + 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.""" + + conversion_rate_config: Optional[AddPricePriceNewSubscriptionGroupedWithMinMaxThresholdsPriceConversionRateConfig] + """The configuration for the 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. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + 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[NewBillingCycleConfiguration] + """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[ NewSubscriptionUnitPriceParam, NewSubscriptionPackagePriceParam, NewSubscriptionMatrixPriceParam, NewSubscriptionTieredPriceParam, - NewSubscriptionTieredBPSPriceParam, - NewSubscriptionBPSPriceParam, - NewSubscriptionBulkBPSPriceParam, NewSubscriptionBulkPriceParam, NewSubscriptionThresholdTotalAmountPriceParam, NewSubscriptionTieredPackagePriceParam, @@ -281,6 +369,8 @@ class AddAdjustment(TypedDict, total=False): NewSubscriptionMatrixWithAllocationPriceParam, NewSubscriptionTieredPackageWithMinimumPriceParam, NewSubscriptionGroupedTieredPriceParam, + AddPricePriceNewSubscriptionGroupedWithMinMaxThresholdsPrice, + NewSubscriptionMinimumCompositePriceParam, ] @@ -359,14 +449,97 @@ class ReplaceAdjustment(TypedDict, total=False): """The id of the adjustment on the plan to replace in the subscription.""" +ReplacePricePriceNewSubscriptionGroupedWithMinMaxThresholdsPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePricePriceNewSubscriptionGroupedWithMinMaxThresholdsPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_with_min_max_thresholds_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_min_max_thresholds"]] + + 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[NewBillingCycleConfiguration] + """ + 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.""" + + conversion_rate_config: Optional[ + ReplacePricePriceNewSubscriptionGroupedWithMinMaxThresholdsPriceConversionRateConfig + ] + """The configuration for the 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. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + 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[NewBillingCycleConfiguration] + """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[ NewSubscriptionUnitPriceParam, NewSubscriptionPackagePriceParam, NewSubscriptionMatrixPriceParam, NewSubscriptionTieredPriceParam, - NewSubscriptionTieredBPSPriceParam, - NewSubscriptionBPSPriceParam, - NewSubscriptionBulkBPSPriceParam, NewSubscriptionBulkPriceParam, NewSubscriptionThresholdTotalAmountPriceParam, NewSubscriptionTieredPackagePriceParam, @@ -388,6 +561,8 @@ class ReplaceAdjustment(TypedDict, total=False): NewSubscriptionMatrixWithAllocationPriceParam, NewSubscriptionTieredPackageWithMinimumPriceParam, NewSubscriptionGroupedTieredPriceParam, + ReplacePricePriceNewSubscriptionGroupedWithMinMaxThresholdsPrice, + NewSubscriptionMinimumCompositePriceParam, ] diff --git a/tests/api_resources/customers/credits/test_ledger.py b/tests/api_resources/customers/credits/test_ledger.py index fcba39b7..866dc610 100644 --- a/tests/api_resources/customers/credits/test_ledger.py +++ b/tests/api_resources/customers/credits/test_ledger.py @@ -101,6 +101,7 @@ def test_method_create_entry_with_all_params_overload_1(self, client: Orb) -> No invoice_settings={ "auto_collection": True, "net_terms": 0, + "custom_due_date": parse_date("2019-12-27"), "invoice_date": parse_date("2019-12-27"), "memo": "memo", "require_successful_payment": True, @@ -415,6 +416,7 @@ def test_method_create_entry_by_external_id_with_all_params_overload_1(self, cli invoice_settings={ "auto_collection": True, "net_terms": 0, + "custom_due_date": parse_date("2019-12-27"), "invoice_date": parse_date("2019-12-27"), "memo": "memo", "require_successful_payment": True, @@ -845,6 +847,7 @@ async def test_method_create_entry_with_all_params_overload_1(self, async_client invoice_settings={ "auto_collection": True, "net_terms": 0, + "custom_due_date": parse_date("2019-12-27"), "invoice_date": parse_date("2019-12-27"), "memo": "memo", "require_successful_payment": True, @@ -1159,6 +1162,7 @@ async def test_method_create_entry_by_external_id_with_all_params_overload_1(sel invoice_settings={ "auto_collection": True, "net_terms": 0, + "custom_due_date": parse_date("2019-12-27"), "invoice_date": parse_date("2019-12-27"), "memo": "memo", "require_successful_payment": True, diff --git a/tests/api_resources/test_customers.py b/tests/api_resources/test_customers.py index 2a712518..13ef949e 100644 --- a/tests/api_resources/test_customers.py +++ b/tests/api_resources/test_customers.py @@ -45,6 +45,7 @@ def test_method_create_with_all_params(self, client: Orb) -> None: }, additional_emails=["dev@stainless.com"], auto_collection=True, + auto_issuance=True, billing_address={ "city": "city", "country": "country", @@ -134,6 +135,7 @@ def test_method_update_with_all_params(self, client: Orb) -> None: }, additional_emails=["string"], auto_collection=True, + auto_issuance=True, billing_address={ "city": "city", "country": "country", @@ -456,6 +458,7 @@ def test_method_update_by_external_id_with_all_params(self, client: Orb) -> None }, additional_emails=["string"], auto_collection=True, + auto_issuance=True, billing_address={ "city": "city", "country": "country", @@ -559,6 +562,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No }, additional_emails=["dev@stainless.com"], auto_collection=True, + auto_issuance=True, billing_address={ "city": "city", "country": "country", @@ -648,6 +652,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncOrb) -> No }, additional_emails=["string"], auto_collection=True, + auto_issuance=True, billing_address={ "city": "city", "country": "country", @@ -982,6 +987,7 @@ async def test_method_update_by_external_id_with_all_params(self, async_client: }, additional_emails=["string"], auto_collection=True, + auto_issuance=True, billing_address={ "city": "city", "country": "country", diff --git a/tests/api_resources/test_invoices.py b/tests/api_resources/test_invoices.py index dcb05b7a..f7304550 100644 --- a/tests/api_resources/test_invoices.py +++ b/tests/api_resources/test_invoices.py @@ -71,6 +71,7 @@ def test_method_create_with_all_params(self, client: Orb) -> None: ], "reason": "reason", }, + due_date=parse_date("2023-09-22"), external_customer_id="external-customer-id", memo="An optional memo for my invoice.", metadata={"foo": "string"}, @@ -138,7 +139,9 @@ def test_method_update(self, client: Orb) -> None: def test_method_update_with_all_params(self, client: Orb) -> None: invoice = client.invoices.update( invoice_id="invoice_id", + due_date=parse_date("2023-09-22"), metadata={"foo": "string"}, + net_terms=0, ) assert_matches_type(Invoice, invoice, path=["response"]) @@ -521,6 +524,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No ], "reason": "reason", }, + due_date=parse_date("2023-09-22"), external_customer_id="external-customer-id", memo="An optional memo for my invoice.", metadata={"foo": "string"}, @@ -588,7 +592,9 @@ async def test_method_update(self, async_client: AsyncOrb) -> None: async def test_method_update_with_all_params(self, async_client: AsyncOrb) -> None: invoice = await async_client.invoices.update( invoice_id="invoice_id", + due_date=parse_date("2023-09-22"), metadata={"foo": "string"}, + net_terms=0, ) assert_matches_type(Invoice, invoice, path=["response"]) diff --git a/tests/api_resources/test_prices.py b/tests/api_resources/test_prices.py index 57cdf47e..6aacdd52 100644 --- a/tests/api_resources/test_prices.py +++ b/tests/api_resources/test_prices.py @@ -554,40 +554,31 @@ def test_streaming_response_create_overload_5(self, client: Orb) -> None: @parametrize def test_method_create_overload_6(self, client: Orb) -> None: price = client.prices.create( + bulk_config={"tiers": [{"unit_amount": "unit_amount"}]}, cadence="annual", currency="currency", item_id="item_id", - model_type="tiered_bps", + model_type="bulk", name="Annual fee", - tiered_bps_config={ - "tiers": [ - { - "bps": 0, - "minimum_amount": "minimum_amount", - } - ] - }, ) assert_matches_type(Price, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_6(self, client: Orb) -> None: price = client.prices.create( - cadence="annual", - currency="currency", - item_id="item_id", - model_type="tiered_bps", - name="Annual fee", - tiered_bps_config={ + bulk_config={ "tiers": [ { - "bps": 0, - "minimum_amount": "minimum_amount", - "maximum_amount": "maximum_amount", - "per_unit_maximum": "per_unit_maximum", + "unit_amount": "unit_amount", + "maximum_units": 0, } ] }, + cadence="annual", + currency="currency", + item_id="item_id", + model_type="bulk", + name="Annual fee", billable_metric_id="billable_metric_id", billed_in_advance=True, billing_cycle_configuration={ @@ -618,19 +609,12 @@ def test_method_create_with_all_params_overload_6(self, client: Orb) -> None: @parametrize def test_raw_response_create_overload_6(self, client: Orb) -> None: response = client.prices.with_raw_response.create( + bulk_config={"tiers": [{"unit_amount": "unit_amount"}]}, cadence="annual", currency="currency", item_id="item_id", - model_type="tiered_bps", + model_type="bulk", name="Annual fee", - tiered_bps_config={ - "tiers": [ - { - "bps": 0, - "minimum_amount": "minimum_amount", - } - ] - }, ) assert response.is_closed is True @@ -641,19 +625,12 @@ def test_raw_response_create_overload_6(self, client: Orb) -> None: @parametrize def test_streaming_response_create_overload_6(self, client: Orb) -> None: with client.prices.with_streaming_response.create( + bulk_config={"tiers": [{"unit_amount": "unit_amount"}]}, cadence="annual", currency="currency", item_id="item_id", - model_type="tiered_bps", + model_type="bulk", name="Annual fee", - tiered_bps_config={ - "tiers": [ - { - "bps": 0, - "minimum_amount": "minimum_amount", - } - ] - }, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -666,27 +643,24 @@ def test_streaming_response_create_overload_6(self, client: Orb) -> None: @parametrize def test_method_create_overload_7(self, client: Orb) -> None: price = client.prices.create( - bps_config={"bps": 0}, cadence="annual", currency="currency", item_id="item_id", - model_type="bps", + model_type="threshold_total_amount", name="Annual fee", + threshold_total_amount_config={"foo": "bar"}, ) assert_matches_type(Price, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_7(self, client: Orb) -> None: price = client.prices.create( - bps_config={ - "bps": 0, - "per_unit_maximum": "per_unit_maximum", - }, cadence="annual", currency="currency", item_id="item_id", - model_type="bps", + model_type="threshold_total_amount", name="Annual fee", + threshold_total_amount_config={"foo": "bar"}, billable_metric_id="billable_metric_id", billed_in_advance=True, billing_cycle_configuration={ @@ -717,12 +691,12 @@ def test_method_create_with_all_params_overload_7(self, client: Orb) -> None: @parametrize def test_raw_response_create_overload_7(self, client: Orb) -> None: response = client.prices.with_raw_response.create( - bps_config={"bps": 0}, cadence="annual", currency="currency", item_id="item_id", - model_type="bps", + model_type="threshold_total_amount", name="Annual fee", + threshold_total_amount_config={"foo": "bar"}, ) assert response.is_closed is True @@ -733,12 +707,12 @@ def test_raw_response_create_overload_7(self, client: Orb) -> None: @parametrize def test_streaming_response_create_overload_7(self, client: Orb) -> None: with client.prices.with_streaming_response.create( - bps_config={"bps": 0}, cadence="annual", currency="currency", item_id="item_id", - model_type="bps", + model_type="threshold_total_amount", name="Annual fee", + threshold_total_amount_config={"foo": "bar"}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -751,32 +725,24 @@ def test_streaming_response_create_overload_7(self, client: Orb) -> None: @parametrize def test_method_create_overload_8(self, client: Orb) -> None: price = client.prices.create( - bulk_bps_config={"tiers": [{"bps": 0}]}, cadence="annual", currency="currency", item_id="item_id", - model_type="bulk_bps", + model_type="tiered_package", name="Annual fee", + tiered_package_config={"foo": "bar"}, ) assert_matches_type(Price, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_8(self, client: Orb) -> None: price = client.prices.create( - bulk_bps_config={ - "tiers": [ - { - "bps": 0, - "maximum_amount": "maximum_amount", - "per_unit_maximum": "per_unit_maximum", - } - ] - }, cadence="annual", currency="currency", item_id="item_id", - model_type="bulk_bps", + model_type="tiered_package", name="Annual fee", + tiered_package_config={"foo": "bar"}, billable_metric_id="billable_metric_id", billed_in_advance=True, billing_cycle_configuration={ @@ -807,12 +773,12 @@ def test_method_create_with_all_params_overload_8(self, client: Orb) -> None: @parametrize def test_raw_response_create_overload_8(self, client: Orb) -> None: response = client.prices.with_raw_response.create( - bulk_bps_config={"tiers": [{"bps": 0}]}, cadence="annual", currency="currency", item_id="item_id", - model_type="bulk_bps", + model_type="tiered_package", name="Annual fee", + tiered_package_config={"foo": "bar"}, ) assert response.is_closed is True @@ -823,12 +789,12 @@ def test_raw_response_create_overload_8(self, client: Orb) -> None: @parametrize def test_streaming_response_create_overload_8(self, client: Orb) -> None: with client.prices.with_streaming_response.create( - bulk_bps_config={"tiers": [{"bps": 0}]}, cadence="annual", currency="currency", item_id="item_id", - model_type="bulk_bps", + model_type="tiered_package", name="Annual fee", + tiered_package_config={"foo": "bar"}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -841,11 +807,11 @@ def test_streaming_response_create_overload_8(self, client: Orb) -> None: @parametrize def test_method_create_overload_9(self, client: Orb) -> None: price = client.prices.create( - bulk_config={"tiers": [{"unit_amount": "unit_amount"}]}, cadence="annual", currency="currency", + grouped_tiered_config={"foo": "bar"}, item_id="item_id", - model_type="bulk", + model_type="grouped_tiered", name="Annual fee", ) assert_matches_type(Price, price, path=["response"]) @@ -853,18 +819,11 @@ def test_method_create_overload_9(self, client: Orb) -> None: @parametrize def test_method_create_with_all_params_overload_9(self, client: Orb) -> None: price = client.prices.create( - bulk_config={ - "tiers": [ - { - "unit_amount": "unit_amount", - "maximum_units": 0, - } - ] - }, cadence="annual", currency="currency", + grouped_tiered_config={"foo": "bar"}, item_id="item_id", - model_type="bulk", + model_type="grouped_tiered", name="Annual fee", billable_metric_id="billable_metric_id", billed_in_advance=True, @@ -896,11 +855,11 @@ def test_method_create_with_all_params_overload_9(self, client: Orb) -> None: @parametrize def test_raw_response_create_overload_9(self, client: Orb) -> None: response = client.prices.with_raw_response.create( - bulk_config={"tiers": [{"unit_amount": "unit_amount"}]}, cadence="annual", currency="currency", + grouped_tiered_config={"foo": "bar"}, item_id="item_id", - model_type="bulk", + model_type="grouped_tiered", name="Annual fee", ) @@ -912,11 +871,11 @@ def test_raw_response_create_overload_9(self, client: Orb) -> None: @parametrize def test_streaming_response_create_overload_9(self, client: Orb) -> None: with client.prices.with_streaming_response.create( - bulk_config={"tiers": [{"unit_amount": "unit_amount"}]}, cadence="annual", currency="currency", + grouped_tiered_config={"foo": "bar"}, item_id="item_id", - model_type="bulk", + model_type="grouped_tiered", name="Annual fee", ) as response: assert not response.is_closed @@ -933,9 +892,9 @@ def test_method_create_overload_10(self, client: Orb) -> None: cadence="annual", currency="currency", item_id="item_id", - model_type="threshold_total_amount", + max_group_tiered_package_config={"foo": "bar"}, + model_type="max_group_tiered_package", name="Annual fee", - threshold_total_amount_config={"foo": "bar"}, ) assert_matches_type(Price, price, path=["response"]) @@ -945,9 +904,9 @@ def test_method_create_with_all_params_overload_10(self, client: Orb) -> None: cadence="annual", currency="currency", item_id="item_id", - model_type="threshold_total_amount", + max_group_tiered_package_config={"foo": "bar"}, + model_type="max_group_tiered_package", name="Annual fee", - threshold_total_amount_config={"foo": "bar"}, billable_metric_id="billable_metric_id", billed_in_advance=True, billing_cycle_configuration={ @@ -981,9 +940,9 @@ def test_raw_response_create_overload_10(self, client: Orb) -> None: cadence="annual", currency="currency", item_id="item_id", - model_type="threshold_total_amount", + max_group_tiered_package_config={"foo": "bar"}, + model_type="max_group_tiered_package", name="Annual fee", - threshold_total_amount_config={"foo": "bar"}, ) assert response.is_closed is True @@ -997,9 +956,9 @@ def test_streaming_response_create_overload_10(self, client: Orb) -> None: cadence="annual", currency="currency", item_id="item_id", - model_type="threshold_total_amount", + max_group_tiered_package_config={"foo": "bar"}, + model_type="max_group_tiered_package", name="Annual fee", - threshold_total_amount_config={"foo": "bar"}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1015,9 +974,9 @@ def test_method_create_overload_11(self, client: Orb) -> None: cadence="annual", currency="currency", item_id="item_id", - model_type="tiered_package", + model_type="tiered_with_minimum", name="Annual fee", - tiered_package_config={"foo": "bar"}, + tiered_with_minimum_config={"foo": "bar"}, ) assert_matches_type(Price, price, path=["response"]) @@ -1027,9 +986,9 @@ def test_method_create_with_all_params_overload_11(self, client: Orb) -> None: cadence="annual", currency="currency", item_id="item_id", - model_type="tiered_package", + model_type="tiered_with_minimum", name="Annual fee", - tiered_package_config={"foo": "bar"}, + tiered_with_minimum_config={"foo": "bar"}, billable_metric_id="billable_metric_id", billed_in_advance=True, billing_cycle_configuration={ @@ -1063,9 +1022,9 @@ def test_raw_response_create_overload_11(self, client: Orb) -> None: cadence="annual", currency="currency", item_id="item_id", - model_type="tiered_package", + model_type="tiered_with_minimum", name="Annual fee", - tiered_package_config={"foo": "bar"}, + tiered_with_minimum_config={"foo": "bar"}, ) assert response.is_closed is True @@ -1079,9 +1038,9 @@ def test_streaming_response_create_overload_11(self, client: Orb) -> None: cadence="annual", currency="currency", item_id="item_id", - model_type="tiered_package", + model_type="tiered_with_minimum", name="Annual fee", - tiered_package_config={"foo": "bar"}, + tiered_with_minimum_config={"foo": "bar"}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1096,10 +1055,10 @@ def test_method_create_overload_12(self, client: Orb) -> None: price = client.prices.create( cadence="annual", currency="currency", - grouped_tiered_config={"foo": "bar"}, item_id="item_id", - model_type="grouped_tiered", + model_type="package_with_allocation", name="Annual fee", + package_with_allocation_config={"foo": "bar"}, ) assert_matches_type(Price, price, path=["response"]) @@ -1108,10 +1067,10 @@ def test_method_create_with_all_params_overload_12(self, client: Orb) -> None: price = client.prices.create( cadence="annual", currency="currency", - grouped_tiered_config={"foo": "bar"}, item_id="item_id", - model_type="grouped_tiered", + model_type="package_with_allocation", name="Annual fee", + package_with_allocation_config={"foo": "bar"}, billable_metric_id="billable_metric_id", billed_in_advance=True, billing_cycle_configuration={ @@ -1144,10 +1103,10 @@ def test_raw_response_create_overload_12(self, client: Orb) -> None: response = client.prices.with_raw_response.create( cadence="annual", currency="currency", - grouped_tiered_config={"foo": "bar"}, item_id="item_id", - model_type="grouped_tiered", + model_type="package_with_allocation", name="Annual fee", + package_with_allocation_config={"foo": "bar"}, ) assert response.is_closed is True @@ -1160,10 +1119,10 @@ def test_streaming_response_create_overload_12(self, client: Orb) -> None: with client.prices.with_streaming_response.create( cadence="annual", currency="currency", - grouped_tiered_config={"foo": "bar"}, item_id="item_id", - model_type="grouped_tiered", + model_type="package_with_allocation", name="Annual fee", + package_with_allocation_config={"foo": "bar"}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1179,9 +1138,9 @@ def test_method_create_overload_13(self, client: Orb) -> None: cadence="annual", currency="currency", item_id="item_id", - max_group_tiered_package_config={"foo": "bar"}, - model_type="max_group_tiered_package", + model_type="tiered_package_with_minimum", name="Annual fee", + tiered_package_with_minimum_config={"foo": "bar"}, ) assert_matches_type(Price, price, path=["response"]) @@ -1191,9 +1150,9 @@ def test_method_create_with_all_params_overload_13(self, client: Orb) -> None: cadence="annual", currency="currency", item_id="item_id", - max_group_tiered_package_config={"foo": "bar"}, - model_type="max_group_tiered_package", + model_type="tiered_package_with_minimum", name="Annual fee", + tiered_package_with_minimum_config={"foo": "bar"}, billable_metric_id="billable_metric_id", billed_in_advance=True, billing_cycle_configuration={ @@ -1227,9 +1186,9 @@ def test_raw_response_create_overload_13(self, client: Orb) -> None: cadence="annual", currency="currency", item_id="item_id", - max_group_tiered_package_config={"foo": "bar"}, - model_type="max_group_tiered_package", + model_type="tiered_package_with_minimum", name="Annual fee", + tiered_package_with_minimum_config={"foo": "bar"}, ) assert response.is_closed is True @@ -1243,9 +1202,9 @@ def test_streaming_response_create_overload_13(self, client: Orb) -> None: cadence="annual", currency="currency", item_id="item_id", - max_group_tiered_package_config={"foo": "bar"}, - model_type="max_group_tiered_package", + model_type="tiered_package_with_minimum", name="Annual fee", + tiered_package_with_minimum_config={"foo": "bar"}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1261,9 +1220,9 @@ def test_method_create_overload_14(self, client: Orb) -> None: cadence="annual", currency="currency", item_id="item_id", - model_type="tiered_with_minimum", + model_type="unit_with_percent", name="Annual fee", - tiered_with_minimum_config={"foo": "bar"}, + unit_with_percent_config={"foo": "bar"}, ) assert_matches_type(Price, price, path=["response"]) @@ -1273,9 +1232,9 @@ def test_method_create_with_all_params_overload_14(self, client: Orb) -> None: cadence="annual", currency="currency", item_id="item_id", - model_type="tiered_with_minimum", + model_type="unit_with_percent", name="Annual fee", - tiered_with_minimum_config={"foo": "bar"}, + unit_with_percent_config={"foo": "bar"}, billable_metric_id="billable_metric_id", billed_in_advance=True, billing_cycle_configuration={ @@ -1309,9 +1268,9 @@ def test_raw_response_create_overload_14(self, client: Orb) -> None: cadence="annual", currency="currency", item_id="item_id", - model_type="tiered_with_minimum", + model_type="unit_with_percent", name="Annual fee", - tiered_with_minimum_config={"foo": "bar"}, + unit_with_percent_config={"foo": "bar"}, ) assert response.is_closed is True @@ -1325,9 +1284,9 @@ def test_streaming_response_create_overload_14(self, client: Orb) -> None: cadence="annual", currency="currency", item_id="item_id", - model_type="tiered_with_minimum", + model_type="unit_with_percent", name="Annual fee", - tiered_with_minimum_config={"foo": "bar"}, + unit_with_percent_config={"foo": "bar"}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1343,9 +1302,9 @@ def test_method_create_overload_15(self, client: Orb) -> None: cadence="annual", currency="currency", item_id="item_id", - model_type="package_with_allocation", + model_type="tiered_with_proration", name="Annual fee", - package_with_allocation_config={"foo": "bar"}, + tiered_with_proration_config={"foo": "bar"}, ) assert_matches_type(Price, price, path=["response"]) @@ -1355,9 +1314,9 @@ def test_method_create_with_all_params_overload_15(self, client: Orb) -> None: cadence="annual", currency="currency", item_id="item_id", - model_type="package_with_allocation", + model_type="tiered_with_proration", name="Annual fee", - package_with_allocation_config={"foo": "bar"}, + tiered_with_proration_config={"foo": "bar"}, billable_metric_id="billable_metric_id", billed_in_advance=True, billing_cycle_configuration={ @@ -1391,9 +1350,9 @@ def test_raw_response_create_overload_15(self, client: Orb) -> None: cadence="annual", currency="currency", item_id="item_id", - model_type="package_with_allocation", + model_type="tiered_with_proration", name="Annual fee", - package_with_allocation_config={"foo": "bar"}, + tiered_with_proration_config={"foo": "bar"}, ) assert response.is_closed is True @@ -1407,9 +1366,9 @@ def test_streaming_response_create_overload_15(self, client: Orb) -> None: cadence="annual", currency="currency", item_id="item_id", - model_type="package_with_allocation", + model_type="tiered_with_proration", name="Annual fee", - package_with_allocation_config={"foo": "bar"}, + tiered_with_proration_config={"foo": "bar"}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1425,9 +1384,9 @@ def test_method_create_overload_16(self, client: Orb) -> None: cadence="annual", currency="currency", item_id="item_id", - model_type="tiered_package_with_minimum", + model_type="unit_with_proration", name="Annual fee", - tiered_package_with_minimum_config={"foo": "bar"}, + unit_with_proration_config={"foo": "bar"}, ) assert_matches_type(Price, price, path=["response"]) @@ -1437,9 +1396,9 @@ def test_method_create_with_all_params_overload_16(self, client: Orb) -> None: cadence="annual", currency="currency", item_id="item_id", - model_type="tiered_package_with_minimum", + model_type="unit_with_proration", name="Annual fee", - tiered_package_with_minimum_config={"foo": "bar"}, + unit_with_proration_config={"foo": "bar"}, billable_metric_id="billable_metric_id", billed_in_advance=True, billing_cycle_configuration={ @@ -1473,9 +1432,9 @@ def test_raw_response_create_overload_16(self, client: Orb) -> None: cadence="annual", currency="currency", item_id="item_id", - model_type="tiered_package_with_minimum", + model_type="unit_with_proration", name="Annual fee", - tiered_package_with_minimum_config={"foo": "bar"}, + unit_with_proration_config={"foo": "bar"}, ) assert response.is_closed is True @@ -1489,9 +1448,9 @@ def test_streaming_response_create_overload_16(self, client: Orb) -> None: cadence="annual", currency="currency", item_id="item_id", - model_type="tiered_package_with_minimum", + model_type="unit_with_proration", name="Annual fee", - tiered_package_with_minimum_config={"foo": "bar"}, + unit_with_proration_config={"foo": "bar"}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1506,10 +1465,10 @@ def test_method_create_overload_17(self, client: Orb) -> None: price = client.prices.create( cadence="annual", currency="currency", + grouped_allocation_config={"foo": "bar"}, item_id="item_id", - model_type="unit_with_percent", + model_type="grouped_allocation", name="Annual fee", - unit_with_percent_config={"foo": "bar"}, ) assert_matches_type(Price, price, path=["response"]) @@ -1518,10 +1477,10 @@ def test_method_create_with_all_params_overload_17(self, client: Orb) -> None: price = client.prices.create( cadence="annual", currency="currency", + grouped_allocation_config={"foo": "bar"}, item_id="item_id", - model_type="unit_with_percent", + model_type="grouped_allocation", name="Annual fee", - unit_with_percent_config={"foo": "bar"}, billable_metric_id="billable_metric_id", billed_in_advance=True, billing_cycle_configuration={ @@ -1554,10 +1513,10 @@ def test_raw_response_create_overload_17(self, client: Orb) -> None: response = client.prices.with_raw_response.create( cadence="annual", currency="currency", + grouped_allocation_config={"foo": "bar"}, item_id="item_id", - model_type="unit_with_percent", + model_type="grouped_allocation", name="Annual fee", - unit_with_percent_config={"foo": "bar"}, ) assert response.is_closed is True @@ -1570,10 +1529,10 @@ def test_streaming_response_create_overload_17(self, client: Orb) -> None: with client.prices.with_streaming_response.create( cadence="annual", currency="currency", + grouped_allocation_config={"foo": "bar"}, item_id="item_id", - model_type="unit_with_percent", + model_type="grouped_allocation", name="Annual fee", - unit_with_percent_config={"foo": "bar"}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1588,10 +1547,10 @@ def test_method_create_overload_18(self, client: Orb) -> None: price = client.prices.create( cadence="annual", currency="currency", + grouped_with_prorated_minimum_config={"foo": "bar"}, item_id="item_id", - model_type="tiered_with_proration", + model_type="grouped_with_prorated_minimum", name="Annual fee", - tiered_with_proration_config={"foo": "bar"}, ) assert_matches_type(Price, price, path=["response"]) @@ -1600,10 +1559,10 @@ def test_method_create_with_all_params_overload_18(self, client: Orb) -> None: price = client.prices.create( cadence="annual", currency="currency", + grouped_with_prorated_minimum_config={"foo": "bar"}, item_id="item_id", - model_type="tiered_with_proration", + model_type="grouped_with_prorated_minimum", name="Annual fee", - tiered_with_proration_config={"foo": "bar"}, billable_metric_id="billable_metric_id", billed_in_advance=True, billing_cycle_configuration={ @@ -1636,10 +1595,10 @@ def test_raw_response_create_overload_18(self, client: Orb) -> None: response = client.prices.with_raw_response.create( cadence="annual", currency="currency", + grouped_with_prorated_minimum_config={"foo": "bar"}, item_id="item_id", - model_type="tiered_with_proration", + model_type="grouped_with_prorated_minimum", name="Annual fee", - tiered_with_proration_config={"foo": "bar"}, ) assert response.is_closed is True @@ -1652,10 +1611,10 @@ def test_streaming_response_create_overload_18(self, client: Orb) -> None: with client.prices.with_streaming_response.create( cadence="annual", currency="currency", + grouped_with_prorated_minimum_config={"foo": "bar"}, item_id="item_id", - model_type="tiered_with_proration", + model_type="grouped_with_prorated_minimum", name="Annual fee", - tiered_with_proration_config={"foo": "bar"}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1670,10 +1629,10 @@ def test_method_create_overload_19(self, client: Orb) -> None: price = client.prices.create( cadence="annual", currency="currency", + grouped_with_metered_minimum_config={"foo": "bar"}, item_id="item_id", - model_type="unit_with_proration", + model_type="grouped_with_metered_minimum", name="Annual fee", - unit_with_proration_config={"foo": "bar"}, ) assert_matches_type(Price, price, path=["response"]) @@ -1682,10 +1641,10 @@ def test_method_create_with_all_params_overload_19(self, client: Orb) -> None: price = client.prices.create( cadence="annual", currency="currency", + grouped_with_metered_minimum_config={"foo": "bar"}, item_id="item_id", - model_type="unit_with_proration", + model_type="grouped_with_metered_minimum", name="Annual fee", - unit_with_proration_config={"foo": "bar"}, billable_metric_id="billable_metric_id", billed_in_advance=True, billing_cycle_configuration={ @@ -1718,10 +1677,10 @@ def test_raw_response_create_overload_19(self, client: Orb) -> None: response = client.prices.with_raw_response.create( cadence="annual", currency="currency", + grouped_with_metered_minimum_config={"foo": "bar"}, item_id="item_id", - model_type="unit_with_proration", + model_type="grouped_with_metered_minimum", name="Annual fee", - unit_with_proration_config={"foo": "bar"}, ) assert response.is_closed is True @@ -1734,10 +1693,10 @@ def test_streaming_response_create_overload_19(self, client: Orb) -> None: with client.prices.with_streaming_response.create( cadence="annual", currency="currency", + grouped_with_metered_minimum_config={"foo": "bar"}, item_id="item_id", - model_type="unit_with_proration", + model_type="grouped_with_metered_minimum", name="Annual fee", - unit_with_proration_config={"foo": "bar"}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1752,9 +1711,9 @@ def test_method_create_overload_20(self, client: Orb) -> None: price = client.prices.create( cadence="annual", currency="currency", - grouped_allocation_config={"foo": "bar"}, item_id="item_id", - model_type="grouped_allocation", + matrix_with_display_name_config={"foo": "bar"}, + model_type="matrix_with_display_name", name="Annual fee", ) assert_matches_type(Price, price, path=["response"]) @@ -1764,9 +1723,9 @@ def test_method_create_with_all_params_overload_20(self, client: Orb) -> None: price = client.prices.create( cadence="annual", currency="currency", - grouped_allocation_config={"foo": "bar"}, item_id="item_id", - model_type="grouped_allocation", + matrix_with_display_name_config={"foo": "bar"}, + model_type="matrix_with_display_name", name="Annual fee", billable_metric_id="billable_metric_id", billed_in_advance=True, @@ -1800,9 +1759,9 @@ def test_raw_response_create_overload_20(self, client: Orb) -> None: response = client.prices.with_raw_response.create( cadence="annual", currency="currency", - grouped_allocation_config={"foo": "bar"}, item_id="item_id", - model_type="grouped_allocation", + matrix_with_display_name_config={"foo": "bar"}, + model_type="matrix_with_display_name", name="Annual fee", ) @@ -1816,9 +1775,9 @@ def test_streaming_response_create_overload_20(self, client: Orb) -> None: with client.prices.with_streaming_response.create( cadence="annual", currency="currency", - grouped_allocation_config={"foo": "bar"}, item_id="item_id", - model_type="grouped_allocation", + matrix_with_display_name_config={"foo": "bar"}, + model_type="matrix_with_display_name", name="Annual fee", ) as response: assert not response.is_closed @@ -1832,11 +1791,11 @@ def test_streaming_response_create_overload_20(self, client: Orb) -> None: @parametrize def test_method_create_overload_21(self, client: Orb) -> None: price = client.prices.create( + bulk_with_proration_config={"foo": "bar"}, cadence="annual", currency="currency", - grouped_with_prorated_minimum_config={"foo": "bar"}, item_id="item_id", - model_type="grouped_with_prorated_minimum", + model_type="bulk_with_proration", name="Annual fee", ) assert_matches_type(Price, price, path=["response"]) @@ -1844,11 +1803,11 @@ def test_method_create_overload_21(self, client: Orb) -> None: @parametrize def test_method_create_with_all_params_overload_21(self, client: Orb) -> None: price = client.prices.create( + bulk_with_proration_config={"foo": "bar"}, cadence="annual", currency="currency", - grouped_with_prorated_minimum_config={"foo": "bar"}, item_id="item_id", - model_type="grouped_with_prorated_minimum", + model_type="bulk_with_proration", name="Annual fee", billable_metric_id="billable_metric_id", billed_in_advance=True, @@ -1880,11 +1839,11 @@ def test_method_create_with_all_params_overload_21(self, client: Orb) -> None: @parametrize def test_raw_response_create_overload_21(self, client: Orb) -> None: response = client.prices.with_raw_response.create( + bulk_with_proration_config={"foo": "bar"}, cadence="annual", currency="currency", - grouped_with_prorated_minimum_config={"foo": "bar"}, item_id="item_id", - model_type="grouped_with_prorated_minimum", + model_type="bulk_with_proration", name="Annual fee", ) @@ -1896,11 +1855,11 @@ def test_raw_response_create_overload_21(self, client: Orb) -> None: @parametrize def test_streaming_response_create_overload_21(self, client: Orb) -> None: with client.prices.with_streaming_response.create( + bulk_with_proration_config={"foo": "bar"}, cadence="annual", currency="currency", - grouped_with_prorated_minimum_config={"foo": "bar"}, item_id="item_id", - model_type="grouped_with_prorated_minimum", + model_type="bulk_with_proration", name="Annual fee", ) as response: assert not response.is_closed @@ -1916,9 +1875,9 @@ def test_method_create_overload_22(self, client: Orb) -> None: price = client.prices.create( cadence="annual", currency="currency", - grouped_with_metered_minimum_config={"foo": "bar"}, + grouped_tiered_package_config={"foo": "bar"}, item_id="item_id", - model_type="grouped_with_metered_minimum", + model_type="grouped_tiered_package", name="Annual fee", ) assert_matches_type(Price, price, path=["response"]) @@ -1928,9 +1887,9 @@ def test_method_create_with_all_params_overload_22(self, client: Orb) -> None: price = client.prices.create( cadence="annual", currency="currency", - grouped_with_metered_minimum_config={"foo": "bar"}, + grouped_tiered_package_config={"foo": "bar"}, item_id="item_id", - model_type="grouped_with_metered_minimum", + model_type="grouped_tiered_package", name="Annual fee", billable_metric_id="billable_metric_id", billed_in_advance=True, @@ -1964,9 +1923,9 @@ def test_raw_response_create_overload_22(self, client: Orb) -> None: response = client.prices.with_raw_response.create( cadence="annual", currency="currency", - grouped_with_metered_minimum_config={"foo": "bar"}, + grouped_tiered_package_config={"foo": "bar"}, item_id="item_id", - model_type="grouped_with_metered_minimum", + model_type="grouped_tiered_package", name="Annual fee", ) @@ -1980,9 +1939,9 @@ def test_streaming_response_create_overload_22(self, client: Orb) -> None: with client.prices.with_streaming_response.create( cadence="annual", currency="currency", - grouped_with_metered_minimum_config={"foo": "bar"}, + grouped_tiered_package_config={"foo": "bar"}, item_id="item_id", - model_type="grouped_with_metered_minimum", + model_type="grouped_tiered_package", name="Annual fee", ) as response: assert not response.is_closed @@ -1999,9 +1958,9 @@ def test_method_create_overload_23(self, client: Orb) -> None: cadence="annual", currency="currency", item_id="item_id", - matrix_with_display_name_config={"foo": "bar"}, - model_type="matrix_with_display_name", + model_type="scalable_matrix_with_unit_pricing", name="Annual fee", + scalable_matrix_with_unit_pricing_config={"foo": "bar"}, ) assert_matches_type(Price, price, path=["response"]) @@ -2011,9 +1970,9 @@ def test_method_create_with_all_params_overload_23(self, client: Orb) -> None: cadence="annual", currency="currency", item_id="item_id", - matrix_with_display_name_config={"foo": "bar"}, - model_type="matrix_with_display_name", + model_type="scalable_matrix_with_unit_pricing", name="Annual fee", + scalable_matrix_with_unit_pricing_config={"foo": "bar"}, billable_metric_id="billable_metric_id", billed_in_advance=True, billing_cycle_configuration={ @@ -2047,9 +2006,9 @@ def test_raw_response_create_overload_23(self, client: Orb) -> None: cadence="annual", currency="currency", item_id="item_id", - matrix_with_display_name_config={"foo": "bar"}, - model_type="matrix_with_display_name", + model_type="scalable_matrix_with_unit_pricing", name="Annual fee", + scalable_matrix_with_unit_pricing_config={"foo": "bar"}, ) assert response.is_closed is True @@ -2063,9 +2022,9 @@ def test_streaming_response_create_overload_23(self, client: Orb) -> None: cadence="annual", currency="currency", item_id="item_id", - matrix_with_display_name_config={"foo": "bar"}, - model_type="matrix_with_display_name", + model_type="scalable_matrix_with_unit_pricing", name="Annual fee", + scalable_matrix_with_unit_pricing_config={"foo": "bar"}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -2078,24 +2037,24 @@ def test_streaming_response_create_overload_23(self, client: Orb) -> None: @parametrize def test_method_create_overload_24(self, client: Orb) -> None: price = client.prices.create( - bulk_with_proration_config={"foo": "bar"}, cadence="annual", currency="currency", item_id="item_id", - model_type="bulk_with_proration", + model_type="scalable_matrix_with_tiered_pricing", name="Annual fee", + scalable_matrix_with_tiered_pricing_config={"foo": "bar"}, ) assert_matches_type(Price, price, path=["response"]) @parametrize def test_method_create_with_all_params_overload_24(self, client: Orb) -> None: price = client.prices.create( - bulk_with_proration_config={"foo": "bar"}, cadence="annual", currency="currency", item_id="item_id", - model_type="bulk_with_proration", + model_type="scalable_matrix_with_tiered_pricing", name="Annual fee", + scalable_matrix_with_tiered_pricing_config={"foo": "bar"}, billable_metric_id="billable_metric_id", billed_in_advance=True, billing_cycle_configuration={ @@ -2126,12 +2085,12 @@ def test_method_create_with_all_params_overload_24(self, client: Orb) -> None: @parametrize def test_raw_response_create_overload_24(self, client: Orb) -> None: response = client.prices.with_raw_response.create( - bulk_with_proration_config={"foo": "bar"}, cadence="annual", currency="currency", item_id="item_id", - model_type="bulk_with_proration", + model_type="scalable_matrix_with_tiered_pricing", name="Annual fee", + scalable_matrix_with_tiered_pricing_config={"foo": "bar"}, ) assert response.is_closed is True @@ -2142,12 +2101,12 @@ def test_raw_response_create_overload_24(self, client: Orb) -> None: @parametrize def test_streaming_response_create_overload_24(self, client: Orb) -> None: with client.prices.with_streaming_response.create( - bulk_with_proration_config={"foo": "bar"}, cadence="annual", currency="currency", item_id="item_id", - model_type="bulk_with_proration", + model_type="scalable_matrix_with_tiered_pricing", name="Annual fee", + scalable_matrix_with_tiered_pricing_config={"foo": "bar"}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -2161,10 +2120,10 @@ def test_streaming_response_create_overload_24(self, client: Orb) -> None: def test_method_create_overload_25(self, client: Orb) -> None: price = client.prices.create( cadence="annual", + cumulative_grouped_bulk_config={"foo": "bar"}, currency="currency", - grouped_tiered_package_config={"foo": "bar"}, item_id="item_id", - model_type="grouped_tiered_package", + model_type="cumulative_grouped_bulk", name="Annual fee", ) assert_matches_type(Price, price, path=["response"]) @@ -2173,10 +2132,10 @@ def test_method_create_overload_25(self, client: Orb) -> None: def test_method_create_with_all_params_overload_25(self, client: Orb) -> None: price = client.prices.create( cadence="annual", + cumulative_grouped_bulk_config={"foo": "bar"}, currency="currency", - grouped_tiered_package_config={"foo": "bar"}, item_id="item_id", - model_type="grouped_tiered_package", + model_type="cumulative_grouped_bulk", name="Annual fee", billable_metric_id="billable_metric_id", billed_in_advance=True, @@ -2209,10 +2168,10 @@ def test_method_create_with_all_params_overload_25(self, client: Orb) -> None: def test_raw_response_create_overload_25(self, client: Orb) -> None: response = client.prices.with_raw_response.create( cadence="annual", + cumulative_grouped_bulk_config={"foo": "bar"}, currency="currency", - grouped_tiered_package_config={"foo": "bar"}, item_id="item_id", - model_type="grouped_tiered_package", + model_type="cumulative_grouped_bulk", name="Annual fee", ) @@ -2225,10 +2184,10 @@ def test_raw_response_create_overload_25(self, client: Orb) -> None: def test_streaming_response_create_overload_25(self, client: Orb) -> None: with client.prices.with_streaming_response.create( cadence="annual", + cumulative_grouped_bulk_config={"foo": "bar"}, currency="currency", - grouped_tiered_package_config={"foo": "bar"}, item_id="item_id", - model_type="grouped_tiered_package", + model_type="cumulative_grouped_bulk", name="Annual fee", ) as response: assert not response.is_closed @@ -2244,10 +2203,10 @@ def test_method_create_overload_26(self, client: Orb) -> None: price = client.prices.create( cadence="annual", currency="currency", + grouped_with_min_max_thresholds_config={"foo": "bar"}, item_id="item_id", - model_type="scalable_matrix_with_unit_pricing", + model_type="grouped_with_min_max_thresholds", name="Annual fee", - scalable_matrix_with_unit_pricing_config={"foo": "bar"}, ) assert_matches_type(Price, price, path=["response"]) @@ -2256,10 +2215,10 @@ def test_method_create_with_all_params_overload_26(self, client: Orb) -> None: price = client.prices.create( cadence="annual", currency="currency", + grouped_with_min_max_thresholds_config={"foo": "bar"}, item_id="item_id", - model_type="scalable_matrix_with_unit_pricing", + model_type="grouped_with_min_max_thresholds", name="Annual fee", - scalable_matrix_with_unit_pricing_config={"foo": "bar"}, billable_metric_id="billable_metric_id", billed_in_advance=True, billing_cycle_configuration={ @@ -2292,10 +2251,10 @@ def test_raw_response_create_overload_26(self, client: Orb) -> None: response = client.prices.with_raw_response.create( cadence="annual", currency="currency", + grouped_with_min_max_thresholds_config={"foo": "bar"}, item_id="item_id", - model_type="scalable_matrix_with_unit_pricing", + model_type="grouped_with_min_max_thresholds", name="Annual fee", - scalable_matrix_with_unit_pricing_config={"foo": "bar"}, ) assert response.is_closed is True @@ -2308,10 +2267,10 @@ def test_streaming_response_create_overload_26(self, client: Orb) -> None: with client.prices.with_streaming_response.create( cadence="annual", currency="currency", + grouped_with_min_max_thresholds_config={"foo": "bar"}, item_id="item_id", - model_type="scalable_matrix_with_unit_pricing", + model_type="grouped_with_min_max_thresholds", name="Annual fee", - scalable_matrix_with_unit_pricing_config={"foo": "bar"}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -2327,9 +2286,9 @@ def test_method_create_overload_27(self, client: Orb) -> None: cadence="annual", currency="currency", item_id="item_id", - model_type="scalable_matrix_with_tiered_pricing", + minimum_config={"minimum_amount": "minimum_amount"}, + model_type="minimum", name="Annual fee", - scalable_matrix_with_tiered_pricing_config={"foo": "bar"}, ) assert_matches_type(Price, price, path=["response"]) @@ -2339,9 +2298,12 @@ def test_method_create_with_all_params_overload_27(self, client: Orb) -> None: cadence="annual", currency="currency", item_id="item_id", - model_type="scalable_matrix_with_tiered_pricing", + minimum_config={ + "minimum_amount": "minimum_amount", + "prorated": True, + }, + model_type="minimum", name="Annual fee", - scalable_matrix_with_tiered_pricing_config={"foo": "bar"}, billable_metric_id="billable_metric_id", billed_in_advance=True, billing_cycle_configuration={ @@ -2375,9 +2337,9 @@ def test_raw_response_create_overload_27(self, client: Orb) -> None: cadence="annual", currency="currency", item_id="item_id", - model_type="scalable_matrix_with_tiered_pricing", + minimum_config={"minimum_amount": "minimum_amount"}, + model_type="minimum", name="Annual fee", - scalable_matrix_with_tiered_pricing_config={"foo": "bar"}, ) assert response.is_closed is True @@ -2391,90 +2353,8 @@ def test_streaming_response_create_overload_27(self, client: Orb) -> None: cadence="annual", currency="currency", item_id="item_id", - model_type="scalable_matrix_with_tiered_pricing", - name="Annual fee", - scalable_matrix_with_tiered_pricing_config={"foo": "bar"}, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - price = response.parse() - assert_matches_type(Price, price, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_create_overload_28(self, client: Orb) -> None: - price = client.prices.create( - cadence="annual", - cumulative_grouped_bulk_config={"foo": "bar"}, - currency="currency", - item_id="item_id", - model_type="cumulative_grouped_bulk", - name="Annual fee", - ) - assert_matches_type(Price, price, path=["response"]) - - @parametrize - def test_method_create_with_all_params_overload_28(self, client: Orb) -> None: - price = client.prices.create( - cadence="annual", - cumulative_grouped_bulk_config={"foo": "bar"}, - currency="currency", - item_id="item_id", - model_type="cumulative_grouped_bulk", - name="Annual fee", - billable_metric_id="billable_metric_id", - billed_in_advance=True, - billing_cycle_configuration={ - "duration": 0, - "duration_unit": "day", - }, - conversion_rate=0, - conversion_rate_config={ - "conversion_rate_type": "unit", - "unit_config": {"unit_amount": "unit_amount"}, - }, - dimensional_price_configuration={ - "dimension_values": ["string"], - "dimensional_price_group_id": "dimensional_price_group_id", - "external_dimensional_price_group_id": "external_dimensional_price_group_id", - }, - external_price_id="external_price_id", - fixed_price_quantity=0, - invoice_grouping_key="x", - invoicing_cycle_configuration={ - "duration": 0, - "duration_unit": "day", - }, - metadata={"foo": "string"}, - ) - assert_matches_type(Price, price, path=["response"]) - - @parametrize - def test_raw_response_create_overload_28(self, client: Orb) -> None: - response = client.prices.with_raw_response.create( - cadence="annual", - cumulative_grouped_bulk_config={"foo": "bar"}, - currency="currency", - item_id="item_id", - model_type="cumulative_grouped_bulk", - name="Annual fee", - ) - - 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"]) - - @parametrize - def test_streaming_response_create_overload_28(self, client: Orb) -> None: - with client.prices.with_streaming_response.create( - cadence="annual", - cumulative_grouped_bulk_config={"foo": "bar"}, - currency="currency", - item_id="item_id", - model_type="cumulative_grouped_bulk", + minimum_config={"minimum_amount": "minimum_amount"}, + model_type="minimum", name="Annual fee", ) as response: assert not response.is_closed @@ -3374,40 +3254,31 @@ async def test_streaming_response_create_overload_5(self, async_client: AsyncOrb @parametrize async def test_method_create_overload_6(self, async_client: AsyncOrb) -> None: price = await async_client.prices.create( + bulk_config={"tiers": [{"unit_amount": "unit_amount"}]}, cadence="annual", currency="currency", item_id="item_id", - model_type="tiered_bps", + model_type="bulk", name="Annual fee", - tiered_bps_config={ - "tiers": [ - { - "bps": 0, - "minimum_amount": "minimum_amount", - } - ] - }, ) assert_matches_type(Price, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_6(self, async_client: AsyncOrb) -> None: price = await async_client.prices.create( - cadence="annual", - currency="currency", - item_id="item_id", - model_type="tiered_bps", - name="Annual fee", - tiered_bps_config={ + bulk_config={ "tiers": [ { - "bps": 0, - "minimum_amount": "minimum_amount", - "maximum_amount": "maximum_amount", - "per_unit_maximum": "per_unit_maximum", + "unit_amount": "unit_amount", + "maximum_units": 0, } ] }, + cadence="annual", + currency="currency", + item_id="item_id", + model_type="bulk", + name="Annual fee", billable_metric_id="billable_metric_id", billed_in_advance=True, billing_cycle_configuration={ @@ -3438,19 +3309,12 @@ async def test_method_create_with_all_params_overload_6(self, async_client: Asyn @parametrize async def test_raw_response_create_overload_6(self, async_client: AsyncOrb) -> None: response = await async_client.prices.with_raw_response.create( + bulk_config={"tiers": [{"unit_amount": "unit_amount"}]}, cadence="annual", currency="currency", item_id="item_id", - model_type="tiered_bps", + model_type="bulk", name="Annual fee", - tiered_bps_config={ - "tiers": [ - { - "bps": 0, - "minimum_amount": "minimum_amount", - } - ] - }, ) assert response.is_closed is True @@ -3461,19 +3325,12 @@ async def test_raw_response_create_overload_6(self, async_client: AsyncOrb) -> N @parametrize async def test_streaming_response_create_overload_6(self, async_client: AsyncOrb) -> None: async with async_client.prices.with_streaming_response.create( + bulk_config={"tiers": [{"unit_amount": "unit_amount"}]}, cadence="annual", currency="currency", item_id="item_id", - model_type="tiered_bps", + model_type="bulk", name="Annual fee", - tiered_bps_config={ - "tiers": [ - { - "bps": 0, - "minimum_amount": "minimum_amount", - } - ] - }, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -3486,27 +3343,24 @@ async def test_streaming_response_create_overload_6(self, async_client: AsyncOrb @parametrize async def test_method_create_overload_7(self, async_client: AsyncOrb) -> None: price = await async_client.prices.create( - bps_config={"bps": 0}, cadence="annual", currency="currency", item_id="item_id", - model_type="bps", + model_type="threshold_total_amount", name="Annual fee", + threshold_total_amount_config={"foo": "bar"}, ) assert_matches_type(Price, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_7(self, async_client: AsyncOrb) -> None: price = await async_client.prices.create( - bps_config={ - "bps": 0, - "per_unit_maximum": "per_unit_maximum", - }, cadence="annual", currency="currency", item_id="item_id", - model_type="bps", + model_type="threshold_total_amount", name="Annual fee", + threshold_total_amount_config={"foo": "bar"}, billable_metric_id="billable_metric_id", billed_in_advance=True, billing_cycle_configuration={ @@ -3537,12 +3391,12 @@ async def test_method_create_with_all_params_overload_7(self, async_client: Asyn @parametrize async def test_raw_response_create_overload_7(self, async_client: AsyncOrb) -> None: response = await async_client.prices.with_raw_response.create( - bps_config={"bps": 0}, cadence="annual", currency="currency", item_id="item_id", - model_type="bps", + model_type="threshold_total_amount", name="Annual fee", + threshold_total_amount_config={"foo": "bar"}, ) assert response.is_closed is True @@ -3553,12 +3407,12 @@ async def test_raw_response_create_overload_7(self, async_client: AsyncOrb) -> N @parametrize async def test_streaming_response_create_overload_7(self, async_client: AsyncOrb) -> None: async with async_client.prices.with_streaming_response.create( - bps_config={"bps": 0}, cadence="annual", currency="currency", item_id="item_id", - model_type="bps", + model_type="threshold_total_amount", name="Annual fee", + threshold_total_amount_config={"foo": "bar"}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -3571,32 +3425,24 @@ async def test_streaming_response_create_overload_7(self, async_client: AsyncOrb @parametrize async def test_method_create_overload_8(self, async_client: AsyncOrb) -> None: price = await async_client.prices.create( - bulk_bps_config={"tiers": [{"bps": 0}]}, cadence="annual", currency="currency", item_id="item_id", - model_type="bulk_bps", + model_type="tiered_package", name="Annual fee", + tiered_package_config={"foo": "bar"}, ) assert_matches_type(Price, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_8(self, async_client: AsyncOrb) -> None: price = await async_client.prices.create( - bulk_bps_config={ - "tiers": [ - { - "bps": 0, - "maximum_amount": "maximum_amount", - "per_unit_maximum": "per_unit_maximum", - } - ] - }, cadence="annual", currency="currency", item_id="item_id", - model_type="bulk_bps", + model_type="tiered_package", name="Annual fee", + tiered_package_config={"foo": "bar"}, billable_metric_id="billable_metric_id", billed_in_advance=True, billing_cycle_configuration={ @@ -3627,12 +3473,12 @@ async def test_method_create_with_all_params_overload_8(self, async_client: Asyn @parametrize async def test_raw_response_create_overload_8(self, async_client: AsyncOrb) -> None: response = await async_client.prices.with_raw_response.create( - bulk_bps_config={"tiers": [{"bps": 0}]}, cadence="annual", currency="currency", item_id="item_id", - model_type="bulk_bps", + model_type="tiered_package", name="Annual fee", + tiered_package_config={"foo": "bar"}, ) assert response.is_closed is True @@ -3643,12 +3489,12 @@ async def test_raw_response_create_overload_8(self, async_client: AsyncOrb) -> N @parametrize async def test_streaming_response_create_overload_8(self, async_client: AsyncOrb) -> None: async with async_client.prices.with_streaming_response.create( - bulk_bps_config={"tiers": [{"bps": 0}]}, cadence="annual", currency="currency", item_id="item_id", - model_type="bulk_bps", + model_type="tiered_package", name="Annual fee", + tiered_package_config={"foo": "bar"}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -3661,11 +3507,11 @@ async def test_streaming_response_create_overload_8(self, async_client: AsyncOrb @parametrize async def test_method_create_overload_9(self, async_client: AsyncOrb) -> None: price = await async_client.prices.create( - bulk_config={"tiers": [{"unit_amount": "unit_amount"}]}, cadence="annual", currency="currency", + grouped_tiered_config={"foo": "bar"}, item_id="item_id", - model_type="bulk", + model_type="grouped_tiered", name="Annual fee", ) assert_matches_type(Price, price, path=["response"]) @@ -3673,18 +3519,11 @@ async def test_method_create_overload_9(self, async_client: AsyncOrb) -> None: @parametrize async def test_method_create_with_all_params_overload_9(self, async_client: AsyncOrb) -> None: price = await async_client.prices.create( - bulk_config={ - "tiers": [ - { - "unit_amount": "unit_amount", - "maximum_units": 0, - } - ] - }, cadence="annual", currency="currency", + grouped_tiered_config={"foo": "bar"}, item_id="item_id", - model_type="bulk", + model_type="grouped_tiered", name="Annual fee", billable_metric_id="billable_metric_id", billed_in_advance=True, @@ -3716,11 +3555,11 @@ async def test_method_create_with_all_params_overload_9(self, async_client: Asyn @parametrize async def test_raw_response_create_overload_9(self, async_client: AsyncOrb) -> None: response = await async_client.prices.with_raw_response.create( - bulk_config={"tiers": [{"unit_amount": "unit_amount"}]}, cadence="annual", currency="currency", + grouped_tiered_config={"foo": "bar"}, item_id="item_id", - model_type="bulk", + model_type="grouped_tiered", name="Annual fee", ) @@ -3732,11 +3571,11 @@ async def test_raw_response_create_overload_9(self, async_client: AsyncOrb) -> N @parametrize async def test_streaming_response_create_overload_9(self, async_client: AsyncOrb) -> None: async with async_client.prices.with_streaming_response.create( - bulk_config={"tiers": [{"unit_amount": "unit_amount"}]}, cadence="annual", currency="currency", + grouped_tiered_config={"foo": "bar"}, item_id="item_id", - model_type="bulk", + model_type="grouped_tiered", name="Annual fee", ) as response: assert not response.is_closed @@ -3753,9 +3592,9 @@ async def test_method_create_overload_10(self, async_client: AsyncOrb) -> None: cadence="annual", currency="currency", item_id="item_id", - model_type="threshold_total_amount", + max_group_tiered_package_config={"foo": "bar"}, + model_type="max_group_tiered_package", name="Annual fee", - threshold_total_amount_config={"foo": "bar"}, ) assert_matches_type(Price, price, path=["response"]) @@ -3765,9 +3604,9 @@ async def test_method_create_with_all_params_overload_10(self, async_client: Asy cadence="annual", currency="currency", item_id="item_id", - model_type="threshold_total_amount", + max_group_tiered_package_config={"foo": "bar"}, + model_type="max_group_tiered_package", name="Annual fee", - threshold_total_amount_config={"foo": "bar"}, billable_metric_id="billable_metric_id", billed_in_advance=True, billing_cycle_configuration={ @@ -3801,9 +3640,9 @@ async def test_raw_response_create_overload_10(self, async_client: AsyncOrb) -> cadence="annual", currency="currency", item_id="item_id", - model_type="threshold_total_amount", + max_group_tiered_package_config={"foo": "bar"}, + model_type="max_group_tiered_package", name="Annual fee", - threshold_total_amount_config={"foo": "bar"}, ) assert response.is_closed is True @@ -3817,9 +3656,9 @@ async def test_streaming_response_create_overload_10(self, async_client: AsyncOr cadence="annual", currency="currency", item_id="item_id", - model_type="threshold_total_amount", + max_group_tiered_package_config={"foo": "bar"}, + model_type="max_group_tiered_package", name="Annual fee", - threshold_total_amount_config={"foo": "bar"}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -3835,9 +3674,9 @@ async def test_method_create_overload_11(self, async_client: AsyncOrb) -> None: cadence="annual", currency="currency", item_id="item_id", - model_type="tiered_package", + model_type="tiered_with_minimum", name="Annual fee", - tiered_package_config={"foo": "bar"}, + tiered_with_minimum_config={"foo": "bar"}, ) assert_matches_type(Price, price, path=["response"]) @@ -3847,9 +3686,9 @@ async def test_method_create_with_all_params_overload_11(self, async_client: Asy cadence="annual", currency="currency", item_id="item_id", - model_type="tiered_package", + model_type="tiered_with_minimum", name="Annual fee", - tiered_package_config={"foo": "bar"}, + tiered_with_minimum_config={"foo": "bar"}, billable_metric_id="billable_metric_id", billed_in_advance=True, billing_cycle_configuration={ @@ -3883,9 +3722,9 @@ async def test_raw_response_create_overload_11(self, async_client: AsyncOrb) -> cadence="annual", currency="currency", item_id="item_id", - model_type="tiered_package", + model_type="tiered_with_minimum", name="Annual fee", - tiered_package_config={"foo": "bar"}, + tiered_with_minimum_config={"foo": "bar"}, ) assert response.is_closed is True @@ -3899,9 +3738,9 @@ async def test_streaming_response_create_overload_11(self, async_client: AsyncOr cadence="annual", currency="currency", item_id="item_id", - model_type="tiered_package", + model_type="tiered_with_minimum", name="Annual fee", - tiered_package_config={"foo": "bar"}, + tiered_with_minimum_config={"foo": "bar"}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -3916,10 +3755,10 @@ async def test_method_create_overload_12(self, async_client: AsyncOrb) -> None: price = await async_client.prices.create( cadence="annual", currency="currency", - grouped_tiered_config={"foo": "bar"}, item_id="item_id", - model_type="grouped_tiered", + model_type="package_with_allocation", name="Annual fee", + package_with_allocation_config={"foo": "bar"}, ) assert_matches_type(Price, price, path=["response"]) @@ -3928,10 +3767,10 @@ async def test_method_create_with_all_params_overload_12(self, async_client: Asy price = await async_client.prices.create( cadence="annual", currency="currency", - grouped_tiered_config={"foo": "bar"}, item_id="item_id", - model_type="grouped_tiered", + model_type="package_with_allocation", name="Annual fee", + package_with_allocation_config={"foo": "bar"}, billable_metric_id="billable_metric_id", billed_in_advance=True, billing_cycle_configuration={ @@ -3964,10 +3803,10 @@ async def test_raw_response_create_overload_12(self, async_client: AsyncOrb) -> response = await async_client.prices.with_raw_response.create( cadence="annual", currency="currency", - grouped_tiered_config={"foo": "bar"}, item_id="item_id", - model_type="grouped_tiered", + model_type="package_with_allocation", name="Annual fee", + package_with_allocation_config={"foo": "bar"}, ) assert response.is_closed is True @@ -3980,10 +3819,10 @@ async def test_streaming_response_create_overload_12(self, async_client: AsyncOr async with async_client.prices.with_streaming_response.create( cadence="annual", currency="currency", - grouped_tiered_config={"foo": "bar"}, item_id="item_id", - model_type="grouped_tiered", + model_type="package_with_allocation", name="Annual fee", + package_with_allocation_config={"foo": "bar"}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -3999,9 +3838,9 @@ async def test_method_create_overload_13(self, async_client: AsyncOrb) -> None: cadence="annual", currency="currency", item_id="item_id", - max_group_tiered_package_config={"foo": "bar"}, - model_type="max_group_tiered_package", + model_type="tiered_package_with_minimum", name="Annual fee", + tiered_package_with_minimum_config={"foo": "bar"}, ) assert_matches_type(Price, price, path=["response"]) @@ -4011,9 +3850,9 @@ async def test_method_create_with_all_params_overload_13(self, async_client: Asy cadence="annual", currency="currency", item_id="item_id", - max_group_tiered_package_config={"foo": "bar"}, - model_type="max_group_tiered_package", + model_type="tiered_package_with_minimum", name="Annual fee", + tiered_package_with_minimum_config={"foo": "bar"}, billable_metric_id="billable_metric_id", billed_in_advance=True, billing_cycle_configuration={ @@ -4047,9 +3886,9 @@ async def test_raw_response_create_overload_13(self, async_client: AsyncOrb) -> cadence="annual", currency="currency", item_id="item_id", - max_group_tiered_package_config={"foo": "bar"}, - model_type="max_group_tiered_package", + model_type="tiered_package_with_minimum", name="Annual fee", + tiered_package_with_minimum_config={"foo": "bar"}, ) assert response.is_closed is True @@ -4063,9 +3902,9 @@ async def test_streaming_response_create_overload_13(self, async_client: AsyncOr cadence="annual", currency="currency", item_id="item_id", - max_group_tiered_package_config={"foo": "bar"}, - model_type="max_group_tiered_package", + model_type="tiered_package_with_minimum", name="Annual fee", + tiered_package_with_minimum_config={"foo": "bar"}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -4081,9 +3920,9 @@ async def test_method_create_overload_14(self, async_client: AsyncOrb) -> None: cadence="annual", currency="currency", item_id="item_id", - model_type="tiered_with_minimum", + model_type="unit_with_percent", name="Annual fee", - tiered_with_minimum_config={"foo": "bar"}, + unit_with_percent_config={"foo": "bar"}, ) assert_matches_type(Price, price, path=["response"]) @@ -4093,9 +3932,9 @@ async def test_method_create_with_all_params_overload_14(self, async_client: Asy cadence="annual", currency="currency", item_id="item_id", - model_type="tiered_with_minimum", + model_type="unit_with_percent", name="Annual fee", - tiered_with_minimum_config={"foo": "bar"}, + unit_with_percent_config={"foo": "bar"}, billable_metric_id="billable_metric_id", billed_in_advance=True, billing_cycle_configuration={ @@ -4129,9 +3968,9 @@ async def test_raw_response_create_overload_14(self, async_client: AsyncOrb) -> cadence="annual", currency="currency", item_id="item_id", - model_type="tiered_with_minimum", + model_type="unit_with_percent", name="Annual fee", - tiered_with_minimum_config={"foo": "bar"}, + unit_with_percent_config={"foo": "bar"}, ) assert response.is_closed is True @@ -4145,9 +3984,9 @@ async def test_streaming_response_create_overload_14(self, async_client: AsyncOr cadence="annual", currency="currency", item_id="item_id", - model_type="tiered_with_minimum", + model_type="unit_with_percent", name="Annual fee", - tiered_with_minimum_config={"foo": "bar"}, + unit_with_percent_config={"foo": "bar"}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -4163,9 +4002,9 @@ async def test_method_create_overload_15(self, async_client: AsyncOrb) -> None: cadence="annual", currency="currency", item_id="item_id", - model_type="package_with_allocation", + model_type="tiered_with_proration", name="Annual fee", - package_with_allocation_config={"foo": "bar"}, + tiered_with_proration_config={"foo": "bar"}, ) assert_matches_type(Price, price, path=["response"]) @@ -4175,9 +4014,9 @@ async def test_method_create_with_all_params_overload_15(self, async_client: Asy cadence="annual", currency="currency", item_id="item_id", - model_type="package_with_allocation", + model_type="tiered_with_proration", name="Annual fee", - package_with_allocation_config={"foo": "bar"}, + tiered_with_proration_config={"foo": "bar"}, billable_metric_id="billable_metric_id", billed_in_advance=True, billing_cycle_configuration={ @@ -4211,9 +4050,9 @@ async def test_raw_response_create_overload_15(self, async_client: AsyncOrb) -> cadence="annual", currency="currency", item_id="item_id", - model_type="package_with_allocation", + model_type="tiered_with_proration", name="Annual fee", - package_with_allocation_config={"foo": "bar"}, + tiered_with_proration_config={"foo": "bar"}, ) assert response.is_closed is True @@ -4227,9 +4066,9 @@ async def test_streaming_response_create_overload_15(self, async_client: AsyncOr cadence="annual", currency="currency", item_id="item_id", - model_type="package_with_allocation", + model_type="tiered_with_proration", name="Annual fee", - package_with_allocation_config={"foo": "bar"}, + tiered_with_proration_config={"foo": "bar"}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -4245,9 +4084,9 @@ async def test_method_create_overload_16(self, async_client: AsyncOrb) -> None: cadence="annual", currency="currency", item_id="item_id", - model_type="tiered_package_with_minimum", + model_type="unit_with_proration", name="Annual fee", - tiered_package_with_minimum_config={"foo": "bar"}, + unit_with_proration_config={"foo": "bar"}, ) assert_matches_type(Price, price, path=["response"]) @@ -4257,9 +4096,9 @@ async def test_method_create_with_all_params_overload_16(self, async_client: Asy cadence="annual", currency="currency", item_id="item_id", - model_type="tiered_package_with_minimum", + model_type="unit_with_proration", name="Annual fee", - tiered_package_with_minimum_config={"foo": "bar"}, + unit_with_proration_config={"foo": "bar"}, billable_metric_id="billable_metric_id", billed_in_advance=True, billing_cycle_configuration={ @@ -4293,9 +4132,9 @@ async def test_raw_response_create_overload_16(self, async_client: AsyncOrb) -> cadence="annual", currency="currency", item_id="item_id", - model_type="tiered_package_with_minimum", + model_type="unit_with_proration", name="Annual fee", - tiered_package_with_minimum_config={"foo": "bar"}, + unit_with_proration_config={"foo": "bar"}, ) assert response.is_closed is True @@ -4309,9 +4148,9 @@ async def test_streaming_response_create_overload_16(self, async_client: AsyncOr cadence="annual", currency="currency", item_id="item_id", - model_type="tiered_package_with_minimum", + model_type="unit_with_proration", name="Annual fee", - tiered_package_with_minimum_config={"foo": "bar"}, + unit_with_proration_config={"foo": "bar"}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -4326,10 +4165,10 @@ async def test_method_create_overload_17(self, async_client: AsyncOrb) -> None: price = await async_client.prices.create( cadence="annual", currency="currency", + grouped_allocation_config={"foo": "bar"}, item_id="item_id", - model_type="unit_with_percent", + model_type="grouped_allocation", name="Annual fee", - unit_with_percent_config={"foo": "bar"}, ) assert_matches_type(Price, price, path=["response"]) @@ -4338,10 +4177,10 @@ async def test_method_create_with_all_params_overload_17(self, async_client: Asy price = await async_client.prices.create( cadence="annual", currency="currency", + grouped_allocation_config={"foo": "bar"}, item_id="item_id", - model_type="unit_with_percent", + model_type="grouped_allocation", name="Annual fee", - unit_with_percent_config={"foo": "bar"}, billable_metric_id="billable_metric_id", billed_in_advance=True, billing_cycle_configuration={ @@ -4374,10 +4213,10 @@ async def test_raw_response_create_overload_17(self, async_client: AsyncOrb) -> response = await async_client.prices.with_raw_response.create( cadence="annual", currency="currency", + grouped_allocation_config={"foo": "bar"}, item_id="item_id", - model_type="unit_with_percent", + model_type="grouped_allocation", name="Annual fee", - unit_with_percent_config={"foo": "bar"}, ) assert response.is_closed is True @@ -4390,10 +4229,10 @@ async def test_streaming_response_create_overload_17(self, async_client: AsyncOr async with async_client.prices.with_streaming_response.create( cadence="annual", currency="currency", + grouped_allocation_config={"foo": "bar"}, item_id="item_id", - model_type="unit_with_percent", + model_type="grouped_allocation", name="Annual fee", - unit_with_percent_config={"foo": "bar"}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -4408,10 +4247,10 @@ async def test_method_create_overload_18(self, async_client: AsyncOrb) -> None: price = await async_client.prices.create( cadence="annual", currency="currency", + grouped_with_prorated_minimum_config={"foo": "bar"}, item_id="item_id", - model_type="tiered_with_proration", + model_type="grouped_with_prorated_minimum", name="Annual fee", - tiered_with_proration_config={"foo": "bar"}, ) assert_matches_type(Price, price, path=["response"]) @@ -4420,10 +4259,10 @@ async def test_method_create_with_all_params_overload_18(self, async_client: Asy price = await async_client.prices.create( cadence="annual", currency="currency", + grouped_with_prorated_minimum_config={"foo": "bar"}, item_id="item_id", - model_type="tiered_with_proration", + model_type="grouped_with_prorated_minimum", name="Annual fee", - tiered_with_proration_config={"foo": "bar"}, billable_metric_id="billable_metric_id", billed_in_advance=True, billing_cycle_configuration={ @@ -4456,10 +4295,10 @@ async def test_raw_response_create_overload_18(self, async_client: AsyncOrb) -> response = await async_client.prices.with_raw_response.create( cadence="annual", currency="currency", + grouped_with_prorated_minimum_config={"foo": "bar"}, item_id="item_id", - model_type="tiered_with_proration", + model_type="grouped_with_prorated_minimum", name="Annual fee", - tiered_with_proration_config={"foo": "bar"}, ) assert response.is_closed is True @@ -4472,10 +4311,10 @@ async def test_streaming_response_create_overload_18(self, async_client: AsyncOr async with async_client.prices.with_streaming_response.create( cadence="annual", currency="currency", + grouped_with_prorated_minimum_config={"foo": "bar"}, item_id="item_id", - model_type="tiered_with_proration", + model_type="grouped_with_prorated_minimum", name="Annual fee", - tiered_with_proration_config={"foo": "bar"}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -4490,10 +4329,10 @@ async def test_method_create_overload_19(self, async_client: AsyncOrb) -> None: price = await async_client.prices.create( cadence="annual", currency="currency", + grouped_with_metered_minimum_config={"foo": "bar"}, item_id="item_id", - model_type="unit_with_proration", + model_type="grouped_with_metered_minimum", name="Annual fee", - unit_with_proration_config={"foo": "bar"}, ) assert_matches_type(Price, price, path=["response"]) @@ -4502,10 +4341,10 @@ async def test_method_create_with_all_params_overload_19(self, async_client: Asy price = await async_client.prices.create( cadence="annual", currency="currency", + grouped_with_metered_minimum_config={"foo": "bar"}, item_id="item_id", - model_type="unit_with_proration", + model_type="grouped_with_metered_minimum", name="Annual fee", - unit_with_proration_config={"foo": "bar"}, billable_metric_id="billable_metric_id", billed_in_advance=True, billing_cycle_configuration={ @@ -4538,10 +4377,10 @@ async def test_raw_response_create_overload_19(self, async_client: AsyncOrb) -> response = await async_client.prices.with_raw_response.create( cadence="annual", currency="currency", + grouped_with_metered_minimum_config={"foo": "bar"}, item_id="item_id", - model_type="unit_with_proration", + model_type="grouped_with_metered_minimum", name="Annual fee", - unit_with_proration_config={"foo": "bar"}, ) assert response.is_closed is True @@ -4554,10 +4393,10 @@ async def test_streaming_response_create_overload_19(self, async_client: AsyncOr async with async_client.prices.with_streaming_response.create( cadence="annual", currency="currency", + grouped_with_metered_minimum_config={"foo": "bar"}, item_id="item_id", - model_type="unit_with_proration", + model_type="grouped_with_metered_minimum", name="Annual fee", - unit_with_proration_config={"foo": "bar"}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -4572,9 +4411,9 @@ async def test_method_create_overload_20(self, async_client: AsyncOrb) -> None: price = await async_client.prices.create( cadence="annual", currency="currency", - grouped_allocation_config={"foo": "bar"}, item_id="item_id", - model_type="grouped_allocation", + matrix_with_display_name_config={"foo": "bar"}, + model_type="matrix_with_display_name", name="Annual fee", ) assert_matches_type(Price, price, path=["response"]) @@ -4584,9 +4423,9 @@ async def test_method_create_with_all_params_overload_20(self, async_client: Asy price = await async_client.prices.create( cadence="annual", currency="currency", - grouped_allocation_config={"foo": "bar"}, item_id="item_id", - model_type="grouped_allocation", + matrix_with_display_name_config={"foo": "bar"}, + model_type="matrix_with_display_name", name="Annual fee", billable_metric_id="billable_metric_id", billed_in_advance=True, @@ -4620,9 +4459,9 @@ async def test_raw_response_create_overload_20(self, async_client: AsyncOrb) -> response = await async_client.prices.with_raw_response.create( cadence="annual", currency="currency", - grouped_allocation_config={"foo": "bar"}, item_id="item_id", - model_type="grouped_allocation", + matrix_with_display_name_config={"foo": "bar"}, + model_type="matrix_with_display_name", name="Annual fee", ) @@ -4636,9 +4475,9 @@ async def test_streaming_response_create_overload_20(self, async_client: AsyncOr async with async_client.prices.with_streaming_response.create( cadence="annual", currency="currency", - grouped_allocation_config={"foo": "bar"}, item_id="item_id", - model_type="grouped_allocation", + matrix_with_display_name_config={"foo": "bar"}, + model_type="matrix_with_display_name", name="Annual fee", ) as response: assert not response.is_closed @@ -4652,11 +4491,11 @@ async def test_streaming_response_create_overload_20(self, async_client: AsyncOr @parametrize async def test_method_create_overload_21(self, async_client: AsyncOrb) -> None: price = await async_client.prices.create( + bulk_with_proration_config={"foo": "bar"}, cadence="annual", currency="currency", - grouped_with_prorated_minimum_config={"foo": "bar"}, item_id="item_id", - model_type="grouped_with_prorated_minimum", + model_type="bulk_with_proration", name="Annual fee", ) assert_matches_type(Price, price, path=["response"]) @@ -4664,11 +4503,11 @@ async def test_method_create_overload_21(self, async_client: AsyncOrb) -> None: @parametrize async def test_method_create_with_all_params_overload_21(self, async_client: AsyncOrb) -> None: price = await async_client.prices.create( + bulk_with_proration_config={"foo": "bar"}, cadence="annual", currency="currency", - grouped_with_prorated_minimum_config={"foo": "bar"}, item_id="item_id", - model_type="grouped_with_prorated_minimum", + model_type="bulk_with_proration", name="Annual fee", billable_metric_id="billable_metric_id", billed_in_advance=True, @@ -4700,11 +4539,11 @@ async def test_method_create_with_all_params_overload_21(self, async_client: Asy @parametrize async def test_raw_response_create_overload_21(self, async_client: AsyncOrb) -> None: response = await async_client.prices.with_raw_response.create( + bulk_with_proration_config={"foo": "bar"}, cadence="annual", currency="currency", - grouped_with_prorated_minimum_config={"foo": "bar"}, item_id="item_id", - model_type="grouped_with_prorated_minimum", + model_type="bulk_with_proration", name="Annual fee", ) @@ -4716,11 +4555,11 @@ async def test_raw_response_create_overload_21(self, async_client: AsyncOrb) -> @parametrize async def test_streaming_response_create_overload_21(self, async_client: AsyncOrb) -> None: async with async_client.prices.with_streaming_response.create( + bulk_with_proration_config={"foo": "bar"}, cadence="annual", currency="currency", - grouped_with_prorated_minimum_config={"foo": "bar"}, item_id="item_id", - model_type="grouped_with_prorated_minimum", + model_type="bulk_with_proration", name="Annual fee", ) as response: assert not response.is_closed @@ -4736,9 +4575,9 @@ async def test_method_create_overload_22(self, async_client: AsyncOrb) -> None: price = await async_client.prices.create( cadence="annual", currency="currency", - grouped_with_metered_minimum_config={"foo": "bar"}, + grouped_tiered_package_config={"foo": "bar"}, item_id="item_id", - model_type="grouped_with_metered_minimum", + model_type="grouped_tiered_package", name="Annual fee", ) assert_matches_type(Price, price, path=["response"]) @@ -4748,9 +4587,9 @@ async def test_method_create_with_all_params_overload_22(self, async_client: Asy price = await async_client.prices.create( cadence="annual", currency="currency", - grouped_with_metered_minimum_config={"foo": "bar"}, + grouped_tiered_package_config={"foo": "bar"}, item_id="item_id", - model_type="grouped_with_metered_minimum", + model_type="grouped_tiered_package", name="Annual fee", billable_metric_id="billable_metric_id", billed_in_advance=True, @@ -4784,9 +4623,9 @@ async def test_raw_response_create_overload_22(self, async_client: AsyncOrb) -> response = await async_client.prices.with_raw_response.create( cadence="annual", currency="currency", - grouped_with_metered_minimum_config={"foo": "bar"}, + grouped_tiered_package_config={"foo": "bar"}, item_id="item_id", - model_type="grouped_with_metered_minimum", + model_type="grouped_tiered_package", name="Annual fee", ) @@ -4800,9 +4639,9 @@ async def test_streaming_response_create_overload_22(self, async_client: AsyncOr async with async_client.prices.with_streaming_response.create( cadence="annual", currency="currency", - grouped_with_metered_minimum_config={"foo": "bar"}, + grouped_tiered_package_config={"foo": "bar"}, item_id="item_id", - model_type="grouped_with_metered_minimum", + model_type="grouped_tiered_package", name="Annual fee", ) as response: assert not response.is_closed @@ -4819,9 +4658,9 @@ async def test_method_create_overload_23(self, async_client: AsyncOrb) -> None: cadence="annual", currency="currency", item_id="item_id", - matrix_with_display_name_config={"foo": "bar"}, - model_type="matrix_with_display_name", + model_type="scalable_matrix_with_unit_pricing", name="Annual fee", + scalable_matrix_with_unit_pricing_config={"foo": "bar"}, ) assert_matches_type(Price, price, path=["response"]) @@ -4831,9 +4670,9 @@ async def test_method_create_with_all_params_overload_23(self, async_client: Asy cadence="annual", currency="currency", item_id="item_id", - matrix_with_display_name_config={"foo": "bar"}, - model_type="matrix_with_display_name", + model_type="scalable_matrix_with_unit_pricing", name="Annual fee", + scalable_matrix_with_unit_pricing_config={"foo": "bar"}, billable_metric_id="billable_metric_id", billed_in_advance=True, billing_cycle_configuration={ @@ -4867,9 +4706,9 @@ async def test_raw_response_create_overload_23(self, async_client: AsyncOrb) -> cadence="annual", currency="currency", item_id="item_id", - matrix_with_display_name_config={"foo": "bar"}, - model_type="matrix_with_display_name", + model_type="scalable_matrix_with_unit_pricing", name="Annual fee", + scalable_matrix_with_unit_pricing_config={"foo": "bar"}, ) assert response.is_closed is True @@ -4883,9 +4722,9 @@ async def test_streaming_response_create_overload_23(self, async_client: AsyncOr cadence="annual", currency="currency", item_id="item_id", - matrix_with_display_name_config={"foo": "bar"}, - model_type="matrix_with_display_name", + model_type="scalable_matrix_with_unit_pricing", name="Annual fee", + scalable_matrix_with_unit_pricing_config={"foo": "bar"}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -4898,24 +4737,24 @@ async def test_streaming_response_create_overload_23(self, async_client: AsyncOr @parametrize async def test_method_create_overload_24(self, async_client: AsyncOrb) -> None: price = await async_client.prices.create( - bulk_with_proration_config={"foo": "bar"}, cadence="annual", currency="currency", item_id="item_id", - model_type="bulk_with_proration", + model_type="scalable_matrix_with_tiered_pricing", name="Annual fee", + scalable_matrix_with_tiered_pricing_config={"foo": "bar"}, ) assert_matches_type(Price, price, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_24(self, async_client: AsyncOrb) -> None: price = await async_client.prices.create( - bulk_with_proration_config={"foo": "bar"}, cadence="annual", currency="currency", item_id="item_id", - model_type="bulk_with_proration", + model_type="scalable_matrix_with_tiered_pricing", name="Annual fee", + scalable_matrix_with_tiered_pricing_config={"foo": "bar"}, billable_metric_id="billable_metric_id", billed_in_advance=True, billing_cycle_configuration={ @@ -4946,12 +4785,12 @@ async def test_method_create_with_all_params_overload_24(self, async_client: Asy @parametrize async def test_raw_response_create_overload_24(self, async_client: AsyncOrb) -> None: response = await async_client.prices.with_raw_response.create( - bulk_with_proration_config={"foo": "bar"}, cadence="annual", currency="currency", item_id="item_id", - model_type="bulk_with_proration", + model_type="scalable_matrix_with_tiered_pricing", name="Annual fee", + scalable_matrix_with_tiered_pricing_config={"foo": "bar"}, ) assert response.is_closed is True @@ -4962,12 +4801,12 @@ async def test_raw_response_create_overload_24(self, async_client: AsyncOrb) -> @parametrize async def test_streaming_response_create_overload_24(self, async_client: AsyncOrb) -> None: async with async_client.prices.with_streaming_response.create( - bulk_with_proration_config={"foo": "bar"}, cadence="annual", currency="currency", item_id="item_id", - model_type="bulk_with_proration", + model_type="scalable_matrix_with_tiered_pricing", name="Annual fee", + scalable_matrix_with_tiered_pricing_config={"foo": "bar"}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -4981,10 +4820,10 @@ async def test_streaming_response_create_overload_24(self, async_client: AsyncOr async def test_method_create_overload_25(self, async_client: AsyncOrb) -> None: price = await async_client.prices.create( cadence="annual", + cumulative_grouped_bulk_config={"foo": "bar"}, currency="currency", - grouped_tiered_package_config={"foo": "bar"}, item_id="item_id", - model_type="grouped_tiered_package", + model_type="cumulative_grouped_bulk", name="Annual fee", ) assert_matches_type(Price, price, path=["response"]) @@ -4993,10 +4832,10 @@ async def test_method_create_overload_25(self, async_client: AsyncOrb) -> None: async def test_method_create_with_all_params_overload_25(self, async_client: AsyncOrb) -> None: price = await async_client.prices.create( cadence="annual", + cumulative_grouped_bulk_config={"foo": "bar"}, currency="currency", - grouped_tiered_package_config={"foo": "bar"}, item_id="item_id", - model_type="grouped_tiered_package", + model_type="cumulative_grouped_bulk", name="Annual fee", billable_metric_id="billable_metric_id", billed_in_advance=True, @@ -5029,10 +4868,10 @@ async def test_method_create_with_all_params_overload_25(self, async_client: Asy async def test_raw_response_create_overload_25(self, async_client: AsyncOrb) -> None: response = await async_client.prices.with_raw_response.create( cadence="annual", + cumulative_grouped_bulk_config={"foo": "bar"}, currency="currency", - grouped_tiered_package_config={"foo": "bar"}, item_id="item_id", - model_type="grouped_tiered_package", + model_type="cumulative_grouped_bulk", name="Annual fee", ) @@ -5045,10 +4884,10 @@ async def test_raw_response_create_overload_25(self, async_client: AsyncOrb) -> async def test_streaming_response_create_overload_25(self, async_client: AsyncOrb) -> None: async with async_client.prices.with_streaming_response.create( cadence="annual", + cumulative_grouped_bulk_config={"foo": "bar"}, currency="currency", - grouped_tiered_package_config={"foo": "bar"}, item_id="item_id", - model_type="grouped_tiered_package", + model_type="cumulative_grouped_bulk", name="Annual fee", ) as response: assert not response.is_closed @@ -5064,10 +4903,10 @@ async def test_method_create_overload_26(self, async_client: AsyncOrb) -> None: price = await async_client.prices.create( cadence="annual", currency="currency", + grouped_with_min_max_thresholds_config={"foo": "bar"}, item_id="item_id", - model_type="scalable_matrix_with_unit_pricing", + model_type="grouped_with_min_max_thresholds", name="Annual fee", - scalable_matrix_with_unit_pricing_config={"foo": "bar"}, ) assert_matches_type(Price, price, path=["response"]) @@ -5076,10 +4915,10 @@ async def test_method_create_with_all_params_overload_26(self, async_client: Asy price = await async_client.prices.create( cadence="annual", currency="currency", + grouped_with_min_max_thresholds_config={"foo": "bar"}, item_id="item_id", - model_type="scalable_matrix_with_unit_pricing", + model_type="grouped_with_min_max_thresholds", name="Annual fee", - scalable_matrix_with_unit_pricing_config={"foo": "bar"}, billable_metric_id="billable_metric_id", billed_in_advance=True, billing_cycle_configuration={ @@ -5112,10 +4951,10 @@ async def test_raw_response_create_overload_26(self, async_client: AsyncOrb) -> response = await async_client.prices.with_raw_response.create( cadence="annual", currency="currency", + grouped_with_min_max_thresholds_config={"foo": "bar"}, item_id="item_id", - model_type="scalable_matrix_with_unit_pricing", + model_type="grouped_with_min_max_thresholds", name="Annual fee", - scalable_matrix_with_unit_pricing_config={"foo": "bar"}, ) assert response.is_closed is True @@ -5128,10 +4967,10 @@ async def test_streaming_response_create_overload_26(self, async_client: AsyncOr async with async_client.prices.with_streaming_response.create( cadence="annual", currency="currency", + grouped_with_min_max_thresholds_config={"foo": "bar"}, item_id="item_id", - model_type="scalable_matrix_with_unit_pricing", + model_type="grouped_with_min_max_thresholds", name="Annual fee", - scalable_matrix_with_unit_pricing_config={"foo": "bar"}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -5147,9 +4986,9 @@ async def test_method_create_overload_27(self, async_client: AsyncOrb) -> None: cadence="annual", currency="currency", item_id="item_id", - model_type="scalable_matrix_with_tiered_pricing", + minimum_config={"minimum_amount": "minimum_amount"}, + model_type="minimum", name="Annual fee", - scalable_matrix_with_tiered_pricing_config={"foo": "bar"}, ) assert_matches_type(Price, price, path=["response"]) @@ -5159,9 +4998,12 @@ async def test_method_create_with_all_params_overload_27(self, async_client: Asy cadence="annual", currency="currency", item_id="item_id", - model_type="scalable_matrix_with_tiered_pricing", + minimum_config={ + "minimum_amount": "minimum_amount", + "prorated": True, + }, + model_type="minimum", name="Annual fee", - scalable_matrix_with_tiered_pricing_config={"foo": "bar"}, billable_metric_id="billable_metric_id", billed_in_advance=True, billing_cycle_configuration={ @@ -5195,9 +5037,9 @@ async def test_raw_response_create_overload_27(self, async_client: AsyncOrb) -> cadence="annual", currency="currency", item_id="item_id", - model_type="scalable_matrix_with_tiered_pricing", + minimum_config={"minimum_amount": "minimum_amount"}, + model_type="minimum", name="Annual fee", - scalable_matrix_with_tiered_pricing_config={"foo": "bar"}, ) assert response.is_closed is True @@ -5211,90 +5053,8 @@ async def test_streaming_response_create_overload_27(self, async_client: AsyncOr cadence="annual", currency="currency", item_id="item_id", - model_type="scalable_matrix_with_tiered_pricing", - name="Annual fee", - scalable_matrix_with_tiered_pricing_config={"foo": "bar"}, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - price = await response.parse() - assert_matches_type(Price, price, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_create_overload_28(self, async_client: AsyncOrb) -> None: - price = await async_client.prices.create( - cadence="annual", - cumulative_grouped_bulk_config={"foo": "bar"}, - currency="currency", - item_id="item_id", - model_type="cumulative_grouped_bulk", - name="Annual fee", - ) - assert_matches_type(Price, price, path=["response"]) - - @parametrize - async def test_method_create_with_all_params_overload_28(self, async_client: AsyncOrb) -> None: - price = await async_client.prices.create( - cadence="annual", - cumulative_grouped_bulk_config={"foo": "bar"}, - currency="currency", - item_id="item_id", - model_type="cumulative_grouped_bulk", - name="Annual fee", - billable_metric_id="billable_metric_id", - billed_in_advance=True, - billing_cycle_configuration={ - "duration": 0, - "duration_unit": "day", - }, - conversion_rate=0, - conversion_rate_config={ - "conversion_rate_type": "unit", - "unit_config": {"unit_amount": "unit_amount"}, - }, - dimensional_price_configuration={ - "dimension_values": ["string"], - "dimensional_price_group_id": "dimensional_price_group_id", - "external_dimensional_price_group_id": "external_dimensional_price_group_id", - }, - external_price_id="external_price_id", - fixed_price_quantity=0, - invoice_grouping_key="x", - invoicing_cycle_configuration={ - "duration": 0, - "duration_unit": "day", - }, - metadata={"foo": "string"}, - ) - assert_matches_type(Price, price, path=["response"]) - - @parametrize - async def test_raw_response_create_overload_28(self, async_client: AsyncOrb) -> None: - response = await async_client.prices.with_raw_response.create( - cadence="annual", - cumulative_grouped_bulk_config={"foo": "bar"}, - currency="currency", - item_id="item_id", - model_type="cumulative_grouped_bulk", - name="Annual fee", - ) - - 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"]) - - @parametrize - async def test_streaming_response_create_overload_28(self, async_client: AsyncOrb) -> None: - async with async_client.prices.with_streaming_response.create( - cadence="annual", - cumulative_grouped_bulk_config={"foo": "bar"}, - currency="currency", - item_id="item_id", - model_type="cumulative_grouped_bulk", + minimum_config={"minimum_amount": "minimum_amount"}, + model_type="minimum", name="Annual fee", ) as response: assert not response.is_closed diff --git a/tests/api_resources/test_subscriptions.py b/tests/api_resources/test_subscriptions.py index 6607f896..473162db 100644 --- a/tests/api_resources/test_subscriptions.py +++ b/tests/api_resources/test_subscriptions.py @@ -684,6 +684,7 @@ def test_method_price_intervals_with_all_params(self, client: Orb) -> None: ], add_adjustments=[ { + "start_date": parse_datetime("2019-12-27T18:11:19.117Z"), "adjustment": { "adjustment_type": "percentage_discount", "percentage_discount": 0, @@ -701,7 +702,7 @@ def test_method_price_intervals_with_all_params(self, client: Orb) -> None: "is_invoice_level": True, "price_type": "usage", }, - "start_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "adjustment_id": "h74gfhdjvn7ujokd", "end_date": parse_datetime("2019-12-27T18:11:19.117Z"), } ], @@ -2008,6 +2009,7 @@ async def test_method_price_intervals_with_all_params(self, async_client: AsyncO ], add_adjustments=[ { + "start_date": parse_datetime("2019-12-27T18:11:19.117Z"), "adjustment": { "adjustment_type": "percentage_discount", "percentage_discount": 0, @@ -2025,7 +2027,7 @@ async def test_method_price_intervals_with_all_params(self, async_client: AsyncO "is_invoice_level": True, "price_type": "usage", }, - "start_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "adjustment_id": "h74gfhdjvn7ujokd", "end_date": parse_datetime("2019-12-27T18:11:19.117Z"), } ], diff --git a/tests/utils.py b/tests/utils.py index b9278ac2..da8e194f 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -4,7 +4,7 @@ import inspect import traceback import contextlib -from typing import Any, TypeVar, Iterator, cast +from typing import Any, TypeVar, Iterator, Sequence, cast from datetime import date, datetime from typing_extensions import Literal, get_args, get_origin, assert_type @@ -15,6 +15,7 @@ is_list_type, is_union_type, extract_type_arg, + is_sequence_type, is_annotated_type, is_type_alias_type, ) @@ -71,6 +72,13 @@ def assert_matches_type( if is_list_type(type_): return _assert_list_type(type_, value) + if is_sequence_type(type_): + assert isinstance(value, Sequence) + inner_type = get_args(type_)[0] + for entry in value: # type: ignore + assert_type(inner_type, entry) # type: ignore + return + if origin == str: assert isinstance(value, str) elif origin == int: