diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 81e5e657..cd95c250 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "4.27.0" + ".": "4.28.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index d2bd16b2..320998e1 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-2b5eeb4a60cbec92f80b4a54f33c2d17b36cbac4739886f737108f2ad74ff12d.yml -openapi_spec_hash: ebbe8419f5831506de5b4c0b4eb56acf +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-828c91953d2351040fdd4d90a3d9eafd09f9d240c4f6ce0441b7a10c06c1c722.yml +openapi_spec_hash: c82bc88563f80f600e59e22014d4cec4 config_hash: 1f73a949b649ecfe6ec68ba1bb459dc2 diff --git a/CHANGELOG.md b/CHANGELOG.md index 920b02ae..adb7cef7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 4.28.0 (2025-10-17) + +Full Changelog: [v4.27.0...v4.28.0](https://github.com/orbcorp/orb-python/compare/v4.27.0...v4.28.0) + +### Features + +* **api:** api update ([7d3610c](https://github.com/orbcorp/orb-python/commit/7d3610c1cfb01912098febdfce8148e36811fac5)) + + +### Chores + +* bump `httpx-aiohttp` version to 0.1.9 ([e5d3c14](https://github.com/orbcorp/orb-python/commit/e5d3c14ead233cb6a49277d20fc1a71123a7a744)) + ## 4.27.0 (2025-10-15) Full Changelog: [v4.26.0...v4.27.0](https://github.com/orbcorp/orb-python/compare/v4.26.0...v4.27.0) diff --git a/api.md b/api.md index 7da7b873..5081e822 100644 --- a/api.md +++ b/api.md @@ -127,7 +127,6 @@ from orb.types import ( TierSubLineItem, TieredConfig, TieredConversionRateConfig, - TransformPriceFilter, TrialDiscount, UnitConfig, UnitConversionRateConfig, diff --git a/pyproject.toml b/pyproject.toml index ed4ab678..1073fe47 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "orb-billing" -version = "4.27.0" +version = "4.28.0" description = "The official Python library for the orb API" dynamic = ["readme"] license = "Apache-2.0" @@ -39,7 +39,7 @@ Homepage = "https://github.com/orbcorp/orb-python" Repository = "https://github.com/orbcorp/orb-python" [project.optional-dependencies] -aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.8"] +aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.9"] [tool.rye] managed = true diff --git a/requirements-dev.lock b/requirements-dev.lock index 121aba44..637ed60f 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -56,7 +56,7 @@ httpx==0.28.1 # via httpx-aiohttp # via orb-billing # via respx -httpx-aiohttp==0.1.8 +httpx-aiohttp==0.1.9 # via orb-billing idna==3.4 # via anyio diff --git a/requirements.lock b/requirements.lock index c5d72751..a71568fb 100644 --- a/requirements.lock +++ b/requirements.lock @@ -43,7 +43,7 @@ httpcore==1.0.9 httpx==0.28.1 # via httpx-aiohttp # via orb-billing -httpx-aiohttp==0.1.8 +httpx-aiohttp==0.1.9 # via orb-billing idna==3.4 # via anyio diff --git a/src/orb/_version.py b/src/orb/_version.py index 000ecd18..c5f6c105 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.27.0" # x-release-please-version +__version__ = "4.28.0" # x-release-please-version diff --git a/src/orb/types/__init__.py b/src/orb/types/__init__.py index eff5c583..59ff1e6c 100644 --- a/src/orb/types/__init__.py +++ b/src/orb/types/__init__.py @@ -62,7 +62,6 @@ NewFloatingBulkPrice as NewFloatingBulkPrice, NewFloatingUnitPrice as NewFloatingUnitPrice, SubscriptionMinified as SubscriptionMinified, - TransformPriceFilter as TransformPriceFilter, NewPercentageDiscount as NewPercentageDiscount, SubscriptionTrialInfo as SubscriptionTrialInfo, UsageDiscountInterval as UsageDiscountInterval, 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 c6e60525..b4731697 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 @@ -542,6 +542,13 @@ class AddPricePriceNewPlanEventOutputPriceEventOutputConfig(TypedDict, total=Fal unit_rating_key: Required[str] """The key in the event data to extract the unit rate from.""" + default_unit_rate: Optional[str] + """ + If provided, this amount will be used as the unit rate when an event does not + have a value for the `unit_rating_key`. If not provided, events missing a unit + rate will be ignored. + """ + grouping_key: Optional[str] """An optional key in the event data to group by (e.g., event ID). @@ -1121,6 +1128,13 @@ class ReplacePricePriceNewPlanEventOutputPriceEventOutputConfig(TypedDict, total unit_rating_key: Required[str] """The key in the event data to extract the unit rate from.""" + default_unit_rate: Optional[str] + """ + If provided, this amount will be used as the unit rate when an event does not + have a value for the `unit_rating_key`. If not provided, events missing a unit + rate will be ignored. + """ + grouping_key: Optional[str] """An optional key in the event data to group by (e.g., event ID). diff --git a/src/orb/types/beta_create_plan_version_params.py b/src/orb/types/beta_create_plan_version_params.py index 26adecd8..b87b7c4d 100644 --- a/src/orb/types/beta_create_plan_version_params.py +++ b/src/orb/types/beta_create_plan_version_params.py @@ -542,6 +542,13 @@ class AddPricePriceNewPlanEventOutputPriceEventOutputConfig(TypedDict, total=Fal unit_rating_key: Required[str] """The key in the event data to extract the unit rate from.""" + default_unit_rate: Optional[str] + """ + If provided, this amount will be used as the unit rate when an event does not + have a value for the `unit_rating_key`. If not provided, events missing a unit + rate will be ignored. + """ + grouping_key: Optional[str] """An optional key in the event data to group by (e.g., event ID). @@ -1121,6 +1128,13 @@ class ReplacePricePriceNewPlanEventOutputPriceEventOutputConfig(TypedDict, total unit_rating_key: Required[str] """The key in the event data to extract the unit rate from.""" + default_unit_rate: Optional[str] + """ + If provided, this amount will be used as the unit rate when an event does not + have a value for the `unit_rating_key`. If not provided, events missing a unit + rate will be ignored. + """ + grouping_key: Optional[str] """An optional key in the event data to group by (e.g., event ID). diff --git a/src/orb/types/customers/credits/affected_block.py b/src/orb/types/customers/credits/affected_block.py index 0009bd21..3bf8428d 100644 --- a/src/orb/types/customers/credits/affected_block.py +++ b/src/orb/types/customers/credits/affected_block.py @@ -1,16 +1,30 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from ...._models import BaseModel -__all__ = ["AffectedBlock"] +__all__ = ["AffectedBlock", "BlockFilter"] + + +class BlockFilter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" class AffectedBlock(BaseModel): id: str + block_filters: Optional[List[BlockFilter]] = None + expiry_date: Optional[datetime] = None per_unit_cost_basis: Optional[str] = None diff --git a/src/orb/types/plan_create_params.py b/src/orb/types/plan_create_params.py index c58cba71..653232e1 100644 --- a/src/orb/types/plan_create_params.py +++ b/src/orb/types/plan_create_params.py @@ -535,6 +535,13 @@ class PricePriceNewPlanEventOutputPriceEventOutputConfig(TypedDict, total=False) unit_rating_key: Required[str] """The key in the event data to extract the unit rate from.""" + default_unit_rate: Optional[str] + """ + If provided, this amount will be used as the unit rate when an event does not + have a value for the `unit_rating_key`. If not provided, events missing a unit + rate will be ignored. + """ + grouping_key: Optional[str] """An optional key in the event data to group by (e.g., event ID). diff --git a/src/orb/types/price_create_params.py b/src/orb/types/price_create_params.py index daad783d..726c4fff 100644 --- a/src/orb/types/price_create_params.py +++ b/src/orb/types/price_create_params.py @@ -2862,6 +2862,13 @@ class NewFloatingEventOutputPriceEventOutputConfig(TypedDict, total=False): unit_rating_key: Required[str] """The key in the event data to extract the unit rate from.""" + default_unit_rate: Optional[str] + """ + If provided, this amount will be used as the unit rate when an event does not + have a value for the `unit_rating_key`. If not provided, events missing a unit + rate will be ignored. + """ + grouping_key: Optional[str] """An optional key in the event data to group by (e.g., event ID). diff --git a/src/orb/types/price_evaluate_multiple_params.py b/src/orb/types/price_evaluate_multiple_params.py index 15554dec..8dffa2bd 100644 --- a/src/orb/types/price_evaluate_multiple_params.py +++ b/src/orb/types/price_evaluate_multiple_params.py @@ -365,6 +365,13 @@ class PriceEvaluationPriceNewFloatingEventOutputPriceEventOutputConfig(TypedDict unit_rating_key: Required[str] """The key in the event data to extract the unit rate from.""" + default_unit_rate: Optional[str] + """ + If provided, this amount will be used as the unit rate when an event does not + have a value for the `unit_rating_key`. If not provided, events missing a unit + rate will be ignored. + """ + grouping_key: Optional[str] """An optional key in the event data to group by (e.g., event ID). diff --git a/src/orb/types/price_evaluate_preview_events_params.py b/src/orb/types/price_evaluate_preview_events_params.py index ac91d16e..f5645b35 100644 --- a/src/orb/types/price_evaluate_preview_events_params.py +++ b/src/orb/types/price_evaluate_preview_events_params.py @@ -397,6 +397,13 @@ class PriceEvaluationPriceNewFloatingEventOutputPriceEventOutputConfig(TypedDict unit_rating_key: Required[str] """The key in the event data to extract the unit rate from.""" + default_unit_rate: Optional[str] + """ + If provided, this amount will be used as the unit rate when an event does not + have a value for the `unit_rating_key`. If not provided, events missing a unit + rate will be ignored. + """ + grouping_key: Optional[str] """An optional key in the event data to group by (e.g., event ID). diff --git a/src/orb/types/shared/__init__.py b/src/orb/types/shared/__init__.py index cd4d6376..6087ac0f 100644 --- a/src/orb/types/shared/__init__.py +++ b/src/orb/types/shared/__init__.py @@ -53,7 +53,6 @@ from .invoice_level_discount import InvoiceLevelDiscount as InvoiceLevelDiscount 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 diff --git a/src/orb/types/shared/amount_discount.py b/src/orb/types/shared/amount_discount.py index c2db3e28..e2d3506f 100644 --- a/src/orb/types/shared/amount_discount.py +++ b/src/orb/types/shared/amount_discount.py @@ -4,9 +4,19 @@ from typing_extensions import Literal from ..._models import BaseModel -from .transform_price_filter import TransformPriceFilter -__all__ = ["AmountDiscount"] +__all__ = ["AmountDiscount", "Filter"] + + +class Filter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" class AmountDiscount(BaseModel): @@ -21,7 +31,7 @@ class AmountDiscount(BaseModel): For plan/plan phase discounts, this can be a subset of prices. """ - filters: Optional[List[TransformPriceFilter]] = None + filters: Optional[List[Filter]] = None """The filters that determine which prices to apply this discount to.""" reason: Optional[str] = None diff --git a/src/orb/types/shared/amount_discount_interval.py b/src/orb/types/shared/amount_discount_interval.py index 448c1e46..50b35e83 100644 --- a/src/orb/types/shared/amount_discount_interval.py +++ b/src/orb/types/shared/amount_discount_interval.py @@ -5,9 +5,19 @@ from typing_extensions import Literal from ..._models import BaseModel -from .transform_price_filter import TransformPriceFilter -__all__ = ["AmountDiscountInterval"] +__all__ = ["AmountDiscountInterval", "Filter"] + + +class Filter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" class AmountDiscountInterval(BaseModel): @@ -22,7 +32,7 @@ class AmountDiscountInterval(BaseModel): end_date: Optional[datetime] = None """The end date of the discount interval.""" - filters: List[TransformPriceFilter] + filters: List[Filter] """The filters that determine which prices this discount interval applies to.""" start_date: datetime diff --git a/src/orb/types/shared/maximum.py b/src/orb/types/shared/maximum.py index 406311c3..c4d6d314 100644 --- a/src/orb/types/shared/maximum.py +++ b/src/orb/types/shared/maximum.py @@ -1,11 +1,22 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List +from typing_extensions import Literal from ..._models import BaseModel -from .transform_price_filter import TransformPriceFilter -__all__ = ["Maximum"] +__all__ = ["Maximum", "Filter"] + + +class Filter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" class Maximum(BaseModel): @@ -15,7 +26,7 @@ class Maximum(BaseModel): For plan/plan phase maximums, this can be a subset of prices. """ - filters: List[TransformPriceFilter] + filters: List[Filter] """The filters that determine which prices to apply this maximum to.""" maximum_amount: str diff --git a/src/orb/types/shared/maximum_interval.py b/src/orb/types/shared/maximum_interval.py index 2193a269..34f903d0 100644 --- a/src/orb/types/shared/maximum_interval.py +++ b/src/orb/types/shared/maximum_interval.py @@ -2,11 +2,22 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from ..._models import BaseModel -from .transform_price_filter import TransformPriceFilter -__all__ = ["MaximumInterval"] +__all__ = ["MaximumInterval", "Filter"] + + +class Filter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" class MaximumInterval(BaseModel): @@ -16,7 +27,7 @@ class MaximumInterval(BaseModel): end_date: Optional[datetime] = None """The end date of the maximum interval.""" - filters: List[TransformPriceFilter] + filters: List[Filter] """The filters that determine which prices this maximum interval applies to.""" maximum_amount: str diff --git a/src/orb/types/shared/minimum.py b/src/orb/types/shared/minimum.py index a8c00b84..c5d7a162 100644 --- a/src/orb/types/shared/minimum.py +++ b/src/orb/types/shared/minimum.py @@ -1,11 +1,22 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List +from typing_extensions import Literal from ..._models import BaseModel -from .transform_price_filter import TransformPriceFilter -__all__ = ["Minimum"] +__all__ = ["Minimum", "Filter"] + + +class Filter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" class Minimum(BaseModel): @@ -15,7 +26,7 @@ class Minimum(BaseModel): For plan/plan phase minimums, this can be a subset of prices. """ - filters: List[TransformPriceFilter] + filters: List[Filter] """The filters that determine which prices to apply this minimum to.""" minimum_amount: str diff --git a/src/orb/types/shared/minimum_interval.py b/src/orb/types/shared/minimum_interval.py index 6aaf514b..94e8bddc 100644 --- a/src/orb/types/shared/minimum_interval.py +++ b/src/orb/types/shared/minimum_interval.py @@ -2,11 +2,22 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from ..._models import BaseModel -from .transform_price_filter import TransformPriceFilter -__all__ = ["MinimumInterval"] +__all__ = ["MinimumInterval", "Filter"] + + +class Filter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" class MinimumInterval(BaseModel): @@ -16,7 +27,7 @@ class MinimumInterval(BaseModel): end_date: Optional[datetime] = None """The end date of the minimum interval.""" - filters: List[TransformPriceFilter] + filters: List[Filter] """The filters that determine which prices this minimum interval applies to.""" minimum_amount: str diff --git a/src/orb/types/shared/monetary_amount_discount_adjustment.py b/src/orb/types/shared/monetary_amount_discount_adjustment.py index c2f91957..1896ce77 100644 --- a/src/orb/types/shared/monetary_amount_discount_adjustment.py +++ b/src/orb/types/shared/monetary_amount_discount_adjustment.py @@ -4,9 +4,19 @@ from typing_extensions import Literal from ..._models import BaseModel -from .transform_price_filter import TransformPriceFilter -__all__ = ["MonetaryAmountDiscountAdjustment"] +__all__ = ["MonetaryAmountDiscountAdjustment", "Filter"] + + +class Filter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" class MonetaryAmountDiscountAdjustment(BaseModel): @@ -26,7 +36,7 @@ class MonetaryAmountDiscountAdjustment(BaseModel): applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" - filters: List[TransformPriceFilter] + filters: List[Filter] """The filters that determine which prices to apply this adjustment to.""" is_invoice_level: bool diff --git a/src/orb/types/shared/monetary_maximum_adjustment.py b/src/orb/types/shared/monetary_maximum_adjustment.py index 9212e455..9a814dde 100644 --- a/src/orb/types/shared/monetary_maximum_adjustment.py +++ b/src/orb/types/shared/monetary_maximum_adjustment.py @@ -4,9 +4,19 @@ from typing_extensions import Literal from ..._models import BaseModel -from .transform_price_filter import TransformPriceFilter -__all__ = ["MonetaryMaximumAdjustment"] +__all__ = ["MonetaryMaximumAdjustment", "Filter"] + + +class Filter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" class MonetaryMaximumAdjustment(BaseModel): @@ -20,7 +30,7 @@ class MonetaryMaximumAdjustment(BaseModel): applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" - filters: List[TransformPriceFilter] + filters: List[Filter] """The filters that determine which prices to apply this adjustment to.""" is_invoice_level: bool diff --git a/src/orb/types/shared/monetary_minimum_adjustment.py b/src/orb/types/shared/monetary_minimum_adjustment.py index 682da5ab..f7b3939f 100644 --- a/src/orb/types/shared/monetary_minimum_adjustment.py +++ b/src/orb/types/shared/monetary_minimum_adjustment.py @@ -4,9 +4,19 @@ from typing_extensions import Literal from ..._models import BaseModel -from .transform_price_filter import TransformPriceFilter -__all__ = ["MonetaryMinimumAdjustment"] +__all__ = ["MonetaryMinimumAdjustment", "Filter"] + + +class Filter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" class MonetaryMinimumAdjustment(BaseModel): @@ -20,7 +30,7 @@ class MonetaryMinimumAdjustment(BaseModel): applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" - filters: List[TransformPriceFilter] + filters: List[Filter] """The filters that determine which prices to apply this adjustment to.""" is_invoice_level: bool diff --git a/src/orb/types/shared/monetary_percentage_discount_adjustment.py b/src/orb/types/shared/monetary_percentage_discount_adjustment.py index 0687da04..be0cd7fe 100644 --- a/src/orb/types/shared/monetary_percentage_discount_adjustment.py +++ b/src/orb/types/shared/monetary_percentage_discount_adjustment.py @@ -4,9 +4,19 @@ from typing_extensions import Literal from ..._models import BaseModel -from .transform_price_filter import TransformPriceFilter -__all__ = ["MonetaryPercentageDiscountAdjustment"] +__all__ = ["MonetaryPercentageDiscountAdjustment", "Filter"] + + +class Filter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" class MonetaryPercentageDiscountAdjustment(BaseModel): @@ -20,7 +30,7 @@ class MonetaryPercentageDiscountAdjustment(BaseModel): applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" - filters: List[TransformPriceFilter] + filters: List[Filter] """The filters that determine which prices to apply this adjustment to.""" is_invoice_level: bool diff --git a/src/orb/types/shared/monetary_usage_discount_adjustment.py b/src/orb/types/shared/monetary_usage_discount_adjustment.py index 3d81c01c..3a3c959a 100644 --- a/src/orb/types/shared/monetary_usage_discount_adjustment.py +++ b/src/orb/types/shared/monetary_usage_discount_adjustment.py @@ -4,9 +4,19 @@ from typing_extensions import Literal from ..._models import BaseModel -from .transform_price_filter import TransformPriceFilter -__all__ = ["MonetaryUsageDiscountAdjustment"] +__all__ = ["MonetaryUsageDiscountAdjustment", "Filter"] + + +class Filter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" class MonetaryUsageDiscountAdjustment(BaseModel): @@ -20,7 +30,7 @@ class MonetaryUsageDiscountAdjustment(BaseModel): applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" - filters: List[TransformPriceFilter] + filters: List[Filter] """The filters that determine which prices to apply this adjustment to.""" is_invoice_level: bool diff --git a/src/orb/types/shared/new_amount_discount.py b/src/orb/types/shared/new_amount_discount.py index 629ab377..6e811d1c 100644 --- a/src/orb/types/shared/new_amount_discount.py +++ b/src/orb/types/shared/new_amount_discount.py @@ -4,9 +4,19 @@ from typing_extensions import Literal from ..._models import BaseModel -from .transform_price_filter import TransformPriceFilter -__all__ = ["NewAmountDiscount"] +__all__ = ["NewAmountDiscount", "Filter"] + + +class Filter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" class NewAmountDiscount(BaseModel): @@ -26,7 +36,7 @@ class NewAmountDiscount(BaseModel): currency: Optional[str] = None """If set, only prices in the specified currency will have the adjustment applied.""" - filters: Optional[List[TransformPriceFilter]] = None + filters: Optional[List[Filter]] = None """A list of filters that determine which prices this adjustment will apply to.""" is_invoice_level: Optional[bool] = None diff --git a/src/orb/types/shared/new_maximum.py b/src/orb/types/shared/new_maximum.py index 4b29fe7f..3200e6e0 100644 --- a/src/orb/types/shared/new_maximum.py +++ b/src/orb/types/shared/new_maximum.py @@ -4,9 +4,19 @@ from typing_extensions import Literal from ..._models import BaseModel -from .transform_price_filter import TransformPriceFilter -__all__ = ["NewMaximum"] +__all__ = ["NewMaximum", "Filter"] + + +class Filter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" class NewMaximum(BaseModel): @@ -26,7 +36,7 @@ class NewMaximum(BaseModel): currency: Optional[str] = None """If set, only prices in the specified currency will have the adjustment applied.""" - filters: Optional[List[TransformPriceFilter]] = None + filters: Optional[List[Filter]] = None """A list of filters that determine which prices this adjustment will apply to.""" is_invoice_level: Optional[bool] = None diff --git a/src/orb/types/shared/new_minimum.py b/src/orb/types/shared/new_minimum.py index 003d6c87..03ffecf9 100644 --- a/src/orb/types/shared/new_minimum.py +++ b/src/orb/types/shared/new_minimum.py @@ -4,9 +4,19 @@ from typing_extensions import Literal from ..._models import BaseModel -from .transform_price_filter import TransformPriceFilter -__all__ = ["NewMinimum"] +__all__ = ["NewMinimum", "Filter"] + + +class Filter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" class NewMinimum(BaseModel): @@ -29,7 +39,7 @@ class NewMinimum(BaseModel): currency: Optional[str] = None """If set, only prices in the specified currency will have the adjustment applied.""" - filters: Optional[List[TransformPriceFilter]] = None + filters: Optional[List[Filter]] = None """A list of filters that determine which prices this adjustment will apply to.""" is_invoice_level: Optional[bool] = None diff --git a/src/orb/types/shared/new_percentage_discount.py b/src/orb/types/shared/new_percentage_discount.py index 46e5d15a..675ff1f8 100644 --- a/src/orb/types/shared/new_percentage_discount.py +++ b/src/orb/types/shared/new_percentage_discount.py @@ -4,9 +4,19 @@ from typing_extensions import Literal from ..._models import BaseModel -from .transform_price_filter import TransformPriceFilter -__all__ = ["NewPercentageDiscount"] +__all__ = ["NewPercentageDiscount", "Filter"] + + +class Filter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" class NewPercentageDiscount(BaseModel): @@ -26,7 +36,7 @@ class NewPercentageDiscount(BaseModel): currency: Optional[str] = None """If set, only prices in the specified currency will have the adjustment applied.""" - filters: Optional[List[TransformPriceFilter]] = None + filters: Optional[List[Filter]] = None """A list of filters that determine which prices this adjustment will apply to.""" is_invoice_level: Optional[bool] = None diff --git a/src/orb/types/shared/new_usage_discount.py b/src/orb/types/shared/new_usage_discount.py index be7a6fb3..986cf09e 100644 --- a/src/orb/types/shared/new_usage_discount.py +++ b/src/orb/types/shared/new_usage_discount.py @@ -4,9 +4,19 @@ from typing_extensions import Literal from ..._models import BaseModel -from .transform_price_filter import TransformPriceFilter -__all__ = ["NewUsageDiscount"] +__all__ = ["NewUsageDiscount", "Filter"] + + +class Filter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" class NewUsageDiscount(BaseModel): @@ -26,7 +36,7 @@ class NewUsageDiscount(BaseModel): currency: Optional[str] = None """If set, only prices in the specified currency will have the adjustment applied.""" - filters: Optional[List[TransformPriceFilter]] = None + filters: Optional[List[Filter]] = None """A list of filters that determine which prices this adjustment will apply to.""" is_invoice_level: Optional[bool] = None diff --git a/src/orb/types/shared/percentage_discount.py b/src/orb/types/shared/percentage_discount.py index cddd4faa..3fb86bb5 100644 --- a/src/orb/types/shared/percentage_discount.py +++ b/src/orb/types/shared/percentage_discount.py @@ -4,9 +4,19 @@ from typing_extensions import Literal from ..._models import BaseModel -from .transform_price_filter import TransformPriceFilter -__all__ = ["PercentageDiscount"] +__all__ = ["PercentageDiscount", "Filter"] + + +class Filter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" class PercentageDiscount(BaseModel): @@ -24,7 +34,7 @@ class PercentageDiscount(BaseModel): For plan/plan phase discounts, this can be a subset of prices. """ - filters: Optional[List[TransformPriceFilter]] = None + filters: Optional[List[Filter]] = None """The filters that determine which prices to apply this discount to.""" reason: Optional[str] = None diff --git a/src/orb/types/shared/percentage_discount_interval.py b/src/orb/types/shared/percentage_discount_interval.py index 5165d945..8b3b559c 100644 --- a/src/orb/types/shared/percentage_discount_interval.py +++ b/src/orb/types/shared/percentage_discount_interval.py @@ -5,9 +5,19 @@ from typing_extensions import Literal from ..._models import BaseModel -from .transform_price_filter import TransformPriceFilter -__all__ = ["PercentageDiscountInterval"] +__all__ = ["PercentageDiscountInterval", "Filter"] + + +class Filter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" class PercentageDiscountInterval(BaseModel): @@ -19,7 +29,7 @@ class PercentageDiscountInterval(BaseModel): end_date: Optional[datetime] = None """The end date of the discount interval.""" - filters: List[TransformPriceFilter] + filters: List[Filter] """The filters that determine which prices this discount interval applies to.""" percentage_discount: float 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 54a3e9e4..0aff9f2b 100644 --- a/src/orb/types/shared/plan_phase_amount_discount_adjustment.py +++ b/src/orb/types/shared/plan_phase_amount_discount_adjustment.py @@ -4,9 +4,19 @@ from typing_extensions import Literal from ..._models import BaseModel -from .transform_price_filter import TransformPriceFilter -__all__ = ["PlanPhaseAmountDiscountAdjustment"] +__all__ = ["PlanPhaseAmountDiscountAdjustment", "Filter"] + + +class Filter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" class PlanPhaseAmountDiscountAdjustment(BaseModel): @@ -23,7 +33,7 @@ class PlanPhaseAmountDiscountAdjustment(BaseModel): applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" - filters: List[TransformPriceFilter] + filters: List[Filter] """The filters that determine which prices to apply this adjustment to.""" is_invoice_level: bool diff --git a/src/orb/types/shared/plan_phase_maximum_adjustment.py b/src/orb/types/shared/plan_phase_maximum_adjustment.py index 56435fc4..f86df6d2 100644 --- a/src/orb/types/shared/plan_phase_maximum_adjustment.py +++ b/src/orb/types/shared/plan_phase_maximum_adjustment.py @@ -4,9 +4,19 @@ from typing_extensions import Literal from ..._models import BaseModel -from .transform_price_filter import TransformPriceFilter -__all__ = ["PlanPhaseMaximumAdjustment"] +__all__ = ["PlanPhaseMaximumAdjustment", "Filter"] + + +class Filter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" class PlanPhaseMaximumAdjustment(BaseModel): @@ -17,7 +27,7 @@ class PlanPhaseMaximumAdjustment(BaseModel): applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" - filters: List[TransformPriceFilter] + filters: List[Filter] """The filters that determine which prices to apply this adjustment to.""" is_invoice_level: bool diff --git a/src/orb/types/shared/plan_phase_minimum_adjustment.py b/src/orb/types/shared/plan_phase_minimum_adjustment.py index 055c5424..a360bf4d 100644 --- a/src/orb/types/shared/plan_phase_minimum_adjustment.py +++ b/src/orb/types/shared/plan_phase_minimum_adjustment.py @@ -4,9 +4,19 @@ from typing_extensions import Literal from ..._models import BaseModel -from .transform_price_filter import TransformPriceFilter -__all__ = ["PlanPhaseMinimumAdjustment"] +__all__ = ["PlanPhaseMinimumAdjustment", "Filter"] + + +class Filter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" class PlanPhaseMinimumAdjustment(BaseModel): @@ -17,7 +27,7 @@ class PlanPhaseMinimumAdjustment(BaseModel): applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" - filters: List[TransformPriceFilter] + filters: List[Filter] """The filters that determine which prices to apply this adjustment to.""" is_invoice_level: bool 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 86068beb..78f3119d 100644 --- a/src/orb/types/shared/plan_phase_percentage_discount_adjustment.py +++ b/src/orb/types/shared/plan_phase_percentage_discount_adjustment.py @@ -4,9 +4,19 @@ from typing_extensions import Literal from ..._models import BaseModel -from .transform_price_filter import TransformPriceFilter -__all__ = ["PlanPhasePercentageDiscountAdjustment"] +__all__ = ["PlanPhasePercentageDiscountAdjustment", "Filter"] + + +class Filter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" class PlanPhasePercentageDiscountAdjustment(BaseModel): @@ -17,7 +27,7 @@ class PlanPhasePercentageDiscountAdjustment(BaseModel): applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" - filters: List[TransformPriceFilter] + filters: List[Filter] """The filters that determine which prices to apply this adjustment to.""" is_invoice_level: bool 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 bf7a764d..a4691305 100644 --- a/src/orb/types/shared/plan_phase_usage_discount_adjustment.py +++ b/src/orb/types/shared/plan_phase_usage_discount_adjustment.py @@ -4,9 +4,19 @@ from typing_extensions import Literal from ..._models import BaseModel -from .transform_price_filter import TransformPriceFilter -__all__ = ["PlanPhaseUsageDiscountAdjustment"] +__all__ = ["PlanPhaseUsageDiscountAdjustment", "Filter"] + + +class Filter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" class PlanPhaseUsageDiscountAdjustment(BaseModel): @@ -17,7 +27,7 @@ class PlanPhaseUsageDiscountAdjustment(BaseModel): applies_to_price_ids: List[str] """The price IDs that this adjustment applies to.""" - filters: List[TransformPriceFilter] + filters: List[Filter] """The filters that determine which prices to apply this adjustment to.""" is_invoice_level: bool diff --git a/src/orb/types/shared/price.py b/src/orb/types/shared/price.py index 49773efa..f591adb3 100644 --- a/src/orb/types/shared/price.py +++ b/src/orb/types/shared/price.py @@ -19,7 +19,6 @@ from .tiered_config import TieredConfig from .package_config import PackageConfig 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 @@ -29,109 +28,151 @@ __all__ = [ "Price", "UnitPrice", + "UnitPriceCompositePriceFilter", "UnitPriceConversionRateConfig", "TieredPrice", + "TieredPriceCompositePriceFilter", "TieredPriceConversionRateConfig", "BulkPrice", + "BulkPriceCompositePriceFilter", "BulkPriceConversionRateConfig", "BulkWithFiltersPrice", "BulkWithFiltersPriceBulkWithFiltersConfig", "BulkWithFiltersPriceBulkWithFiltersConfigFilter", "BulkWithFiltersPriceBulkWithFiltersConfigTier", + "BulkWithFiltersPriceCompositePriceFilter", "BulkWithFiltersPriceConversionRateConfig", "PackagePrice", + "PackagePriceCompositePriceFilter", "PackagePriceConversionRateConfig", "MatrixPrice", + "MatrixPriceCompositePriceFilter", "MatrixPriceConversionRateConfig", "ThresholdTotalAmountPrice", + "ThresholdTotalAmountPriceCompositePriceFilter", "ThresholdTotalAmountPriceConversionRateConfig", "ThresholdTotalAmountPriceThresholdTotalAmountConfig", "ThresholdTotalAmountPriceThresholdTotalAmountConfigConsumptionTable", "TieredPackagePrice", + "TieredPackagePriceCompositePriceFilter", "TieredPackagePriceConversionRateConfig", "TieredPackagePriceTieredPackageConfig", "TieredPackagePriceTieredPackageConfigTier", "TieredWithMinimumPrice", + "TieredWithMinimumPriceCompositePriceFilter", "TieredWithMinimumPriceConversionRateConfig", "TieredWithMinimumPriceTieredWithMinimumConfig", "TieredWithMinimumPriceTieredWithMinimumConfigTier", "GroupedTieredPrice", + "GroupedTieredPriceCompositePriceFilter", "GroupedTieredPriceConversionRateConfig", "GroupedTieredPriceGroupedTieredConfig", "GroupedTieredPriceGroupedTieredConfigTier", "TieredPackageWithMinimumPrice", + "TieredPackageWithMinimumPriceCompositePriceFilter", "TieredPackageWithMinimumPriceConversionRateConfig", "TieredPackageWithMinimumPriceTieredPackageWithMinimumConfig", "TieredPackageWithMinimumPriceTieredPackageWithMinimumConfigTier", "PackageWithAllocationPrice", + "PackageWithAllocationPriceCompositePriceFilter", "PackageWithAllocationPriceConversionRateConfig", "PackageWithAllocationPricePackageWithAllocationConfig", "UnitWithPercentPrice", + "UnitWithPercentPriceCompositePriceFilter", "UnitWithPercentPriceConversionRateConfig", "UnitWithPercentPriceUnitWithPercentConfig", "MatrixWithAllocationPrice", + "MatrixWithAllocationPriceCompositePriceFilter", "MatrixWithAllocationPriceConversionRateConfig", "TieredWithProrationPrice", + "TieredWithProrationPriceCompositePriceFilter", "TieredWithProrationPriceConversionRateConfig", "TieredWithProrationPriceTieredWithProrationConfig", "TieredWithProrationPriceTieredWithProrationConfigTier", "UnitWithProrationPrice", + "UnitWithProrationPriceCompositePriceFilter", "UnitWithProrationPriceConversionRateConfig", "UnitWithProrationPriceUnitWithProrationConfig", "GroupedAllocationPrice", + "GroupedAllocationPriceCompositePriceFilter", "GroupedAllocationPriceConversionRateConfig", "GroupedAllocationPriceGroupedAllocationConfig", "BulkWithProrationPrice", "BulkWithProrationPriceBulkWithProrationConfig", "BulkWithProrationPriceBulkWithProrationConfigTier", + "BulkWithProrationPriceCompositePriceFilter", "BulkWithProrationPriceConversionRateConfig", "GroupedWithProratedMinimumPrice", + "GroupedWithProratedMinimumPriceCompositePriceFilter", "GroupedWithProratedMinimumPriceConversionRateConfig", "GroupedWithProratedMinimumPriceGroupedWithProratedMinimumConfig", "GroupedWithMeteredMinimumPrice", + "GroupedWithMeteredMinimumPriceCompositePriceFilter", "GroupedWithMeteredMinimumPriceConversionRateConfig", "GroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfig", "GroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfigScalingFactor", "GroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfigUnitAmount", "GroupedWithMinMaxThresholdsPrice", + "GroupedWithMinMaxThresholdsPriceCompositePriceFilter", "GroupedWithMinMaxThresholdsPriceConversionRateConfig", "GroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig", "MatrixWithDisplayNamePrice", + "MatrixWithDisplayNamePriceCompositePriceFilter", "MatrixWithDisplayNamePriceConversionRateConfig", "MatrixWithDisplayNamePriceMatrixWithDisplayNameConfig", "MatrixWithDisplayNamePriceMatrixWithDisplayNameConfigUnitAmount", "GroupedTieredPackagePrice", + "GroupedTieredPackagePriceCompositePriceFilter", "GroupedTieredPackagePriceConversionRateConfig", "GroupedTieredPackagePriceGroupedTieredPackageConfig", "GroupedTieredPackagePriceGroupedTieredPackageConfigTier", "MaxGroupTieredPackagePrice", + "MaxGroupTieredPackagePriceCompositePriceFilter", "MaxGroupTieredPackagePriceConversionRateConfig", "MaxGroupTieredPackagePriceMaxGroupTieredPackageConfig", "MaxGroupTieredPackagePriceMaxGroupTieredPackageConfigTier", "ScalableMatrixWithUnitPricingPrice", + "ScalableMatrixWithUnitPricingPriceCompositePriceFilter", "ScalableMatrixWithUnitPricingPriceConversionRateConfig", "ScalableMatrixWithUnitPricingPriceScalableMatrixWithUnitPricingConfig", "ScalableMatrixWithUnitPricingPriceScalableMatrixWithUnitPricingConfigMatrixScalingFactor", "ScalableMatrixWithTieredPricingPrice", + "ScalableMatrixWithTieredPricingPriceCompositePriceFilter", "ScalableMatrixWithTieredPricingPriceConversionRateConfig", "ScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfig", "ScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfigMatrixScalingFactor", "ScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfigTier", "CumulativeGroupedBulkPrice", + "CumulativeGroupedBulkPriceCompositePriceFilter", "CumulativeGroupedBulkPriceConversionRateConfig", "CumulativeGroupedBulkPriceCumulativeGroupedBulkConfig", "CumulativeGroupedBulkPriceCumulativeGroupedBulkConfigDimensionValue", "MinimumCompositePrice", + "MinimumCompositePriceCompositePriceFilter", "MinimumCompositePriceConversionRateConfig", "MinimumCompositePriceMinimumConfig", "PercentCompositePrice", + "PercentCompositePriceCompositePriceFilter", "PercentCompositePriceConversionRateConfig", "PercentCompositePricePercentConfig", "EventOutputPrice", + "EventOutputPriceCompositePriceFilter", "EventOutputPriceConversionRateConfig", "EventOutputPriceEventOutputConfig", ] + +class UnitPriceCompositePriceFilter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" + + UnitPriceConversionRateConfig: TypeAlias = Annotated[ Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -148,7 +189,7 @@ class UnitPrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - composite_price_filters: Optional[List[TransformPriceFilter]] = None + composite_price_filters: Optional[List[UnitPriceCompositePriceFilter]] = None conversion_rate: Optional[float] = None @@ -211,6 +252,17 @@ class UnitPrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None +class TieredPriceCompositePriceFilter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" + + TieredPriceConversionRateConfig: TypeAlias = Annotated[ Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -227,7 +279,7 @@ class TieredPrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - composite_price_filters: Optional[List[TransformPriceFilter]] = None + composite_price_filters: Optional[List[TieredPriceCompositePriceFilter]] = None conversion_rate: Optional[float] = None @@ -290,6 +342,17 @@ class TieredPrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None +class BulkPriceCompositePriceFilter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" + + BulkPriceConversionRateConfig: TypeAlias = Annotated[ Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -309,7 +372,7 @@ class BulkPrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - composite_price_filters: Optional[List[TransformPriceFilter]] = None + composite_price_filters: Optional[List[BulkPriceCompositePriceFilter]] = None conversion_rate: Optional[float] = None @@ -393,6 +456,17 @@ class BulkWithFiltersPriceBulkWithFiltersConfig(BaseModel): """Bulk tiers for rating based on total usage volume""" +class BulkWithFiltersPriceCompositePriceFilter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" + + BulkWithFiltersPriceConversionRateConfig: TypeAlias = Annotated[ Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -412,7 +486,7 @@ class BulkWithFiltersPrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - composite_price_filters: Optional[List[TransformPriceFilter]] = None + composite_price_filters: Optional[List[BulkWithFiltersPriceCompositePriceFilter]] = None conversion_rate: Optional[float] = None @@ -472,6 +546,17 @@ class BulkWithFiltersPrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None +class PackagePriceCompositePriceFilter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" + + PackagePriceConversionRateConfig: TypeAlias = Annotated[ Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -488,7 +573,7 @@ class PackagePrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - composite_price_filters: Optional[List[TransformPriceFilter]] = None + composite_price_filters: Optional[List[PackagePriceCompositePriceFilter]] = None conversion_rate: Optional[float] = None @@ -551,6 +636,17 @@ class PackagePrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None +class MatrixPriceCompositePriceFilter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" + + MatrixPriceConversionRateConfig: TypeAlias = Annotated[ Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -567,7 +663,7 @@ class MatrixPrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - composite_price_filters: Optional[List[TransformPriceFilter]] = None + composite_price_filters: Optional[List[MatrixPriceCompositePriceFilter]] = None conversion_rate: Optional[float] = None @@ -630,6 +726,17 @@ class MatrixPrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None +class ThresholdTotalAmountPriceCompositePriceFilter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" + + ThresholdTotalAmountPriceConversionRateConfig: TypeAlias = Annotated[ Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -665,7 +772,7 @@ class ThresholdTotalAmountPrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - composite_price_filters: Optional[List[TransformPriceFilter]] = None + composite_price_filters: Optional[List[ThresholdTotalAmountPriceCompositePriceFilter]] = None conversion_rate: Optional[float] = None @@ -728,6 +835,17 @@ class ThresholdTotalAmountPrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None +class TieredPackagePriceCompositePriceFilter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" + + TieredPackagePriceConversionRateConfig: TypeAlias = Annotated[ Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -765,7 +883,7 @@ class TieredPackagePrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - composite_price_filters: Optional[List[TransformPriceFilter]] = None + composite_price_filters: Optional[List[TieredPackagePriceCompositePriceFilter]] = None conversion_rate: Optional[float] = None @@ -828,6 +946,17 @@ class TieredPackagePrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None +class TieredWithMinimumPriceCompositePriceFilter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" + + TieredWithMinimumPriceConversionRateConfig: TypeAlias = Annotated[ Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -869,7 +998,7 @@ class TieredWithMinimumPrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - composite_price_filters: Optional[List[TransformPriceFilter]] = None + composite_price_filters: Optional[List[TieredWithMinimumPriceCompositePriceFilter]] = None conversion_rate: Optional[float] = None @@ -932,6 +1061,17 @@ class TieredWithMinimumPrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None +class GroupedTieredPriceCompositePriceFilter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" + + GroupedTieredPriceConversionRateConfig: TypeAlias = Annotated[ Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -967,7 +1107,7 @@ class GroupedTieredPrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - composite_price_filters: Optional[List[TransformPriceFilter]] = None + composite_price_filters: Optional[List[GroupedTieredPriceCompositePriceFilter]] = None conversion_rate: Optional[float] = None @@ -1030,6 +1170,17 @@ class GroupedTieredPrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None +class TieredPackageWithMinimumPriceCompositePriceFilter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" + + TieredPackageWithMinimumPriceConversionRateConfig: TypeAlias = Annotated[ Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -1068,7 +1219,7 @@ class TieredPackageWithMinimumPrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - composite_price_filters: Optional[List[TransformPriceFilter]] = None + composite_price_filters: Optional[List[TieredPackageWithMinimumPriceCompositePriceFilter]] = None conversion_rate: Optional[float] = None @@ -1131,6 +1282,17 @@ class TieredPackageWithMinimumPrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None +class PackageWithAllocationPriceCompositePriceFilter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" + + PackageWithAllocationPriceConversionRateConfig: TypeAlias = Annotated[ Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -1158,7 +1320,7 @@ class PackageWithAllocationPrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - composite_price_filters: Optional[List[TransformPriceFilter]] = None + composite_price_filters: Optional[List[PackageWithAllocationPriceCompositePriceFilter]] = None conversion_rate: Optional[float] = None @@ -1221,6 +1383,17 @@ class PackageWithAllocationPrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None +class UnitWithPercentPriceCompositePriceFilter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" + + UnitWithPercentPriceConversionRateConfig: TypeAlias = Annotated[ Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -1245,7 +1418,7 @@ class UnitWithPercentPrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - composite_price_filters: Optional[List[TransformPriceFilter]] = None + composite_price_filters: Optional[List[UnitWithPercentPriceCompositePriceFilter]] = None conversion_rate: Optional[float] = None @@ -1308,6 +1481,17 @@ class UnitWithPercentPrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None +class MatrixWithAllocationPriceCompositePriceFilter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" + + MatrixWithAllocationPriceConversionRateConfig: TypeAlias = Annotated[ Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -1324,7 +1508,7 @@ class MatrixWithAllocationPrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - composite_price_filters: Optional[List[TransformPriceFilter]] = None + composite_price_filters: Optional[List[MatrixWithAllocationPriceCompositePriceFilter]] = None conversion_rate: Optional[float] = None @@ -1387,6 +1571,17 @@ class MatrixWithAllocationPrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None +class TieredWithProrationPriceCompositePriceFilter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" + + TieredWithProrationPriceConversionRateConfig: TypeAlias = Annotated[ Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -1419,7 +1614,7 @@ class TieredWithProrationPrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - composite_price_filters: Optional[List[TransformPriceFilter]] = None + composite_price_filters: Optional[List[TieredWithProrationPriceCompositePriceFilter]] = None conversion_rate: Optional[float] = None @@ -1482,6 +1677,17 @@ class TieredWithProrationPrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None +class UnitWithProrationPriceCompositePriceFilter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" + + UnitWithProrationPriceConversionRateConfig: TypeAlias = Annotated[ Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -1503,7 +1709,7 @@ class UnitWithProrationPrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - composite_price_filters: Optional[List[TransformPriceFilter]] = None + composite_price_filters: Optional[List[UnitWithProrationPriceCompositePriceFilter]] = None conversion_rate: Optional[float] = None @@ -1566,6 +1772,17 @@ class UnitWithProrationPrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None +class GroupedAllocationPriceCompositePriceFilter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" + + GroupedAllocationPriceConversionRateConfig: TypeAlias = Annotated[ Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -1593,7 +1810,7 @@ class GroupedAllocationPrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - composite_price_filters: Optional[List[TransformPriceFilter]] = None + composite_price_filters: Optional[List[GroupedAllocationPriceCompositePriceFilter]] = None conversion_rate: Optional[float] = None @@ -1669,6 +1886,17 @@ class BulkWithProrationPriceBulkWithProrationConfig(BaseModel): """Bulk tiers for rating based on total usage volume""" +class BulkWithProrationPriceCompositePriceFilter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" + + BulkWithProrationPriceConversionRateConfig: TypeAlias = Annotated[ Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -1688,7 +1916,7 @@ class BulkWithProrationPrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - composite_price_filters: Optional[List[TransformPriceFilter]] = None + composite_price_filters: Optional[List[BulkWithProrationPriceCompositePriceFilter]] = None conversion_rate: Optional[float] = None @@ -1748,6 +1976,17 @@ class BulkWithProrationPrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None +class GroupedWithProratedMinimumPriceCompositePriceFilter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" + + GroupedWithProratedMinimumPriceConversionRateConfig: TypeAlias = Annotated[ Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -1775,7 +2014,7 @@ class GroupedWithProratedMinimumPrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - composite_price_filters: Optional[List[TransformPriceFilter]] = None + composite_price_filters: Optional[List[GroupedWithProratedMinimumPriceCompositePriceFilter]] = None conversion_rate: Optional[float] = None @@ -1838,6 +2077,17 @@ class GroupedWithProratedMinimumPrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None +class GroupedWithMeteredMinimumPriceCompositePriceFilter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" + + GroupedWithMeteredMinimumPriceConversionRateConfig: TypeAlias = Annotated[ Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -1896,7 +2146,7 @@ class GroupedWithMeteredMinimumPrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - composite_price_filters: Optional[List[TransformPriceFilter]] = None + composite_price_filters: Optional[List[GroupedWithMeteredMinimumPriceCompositePriceFilter]] = None conversion_rate: Optional[float] = None @@ -1959,6 +2209,17 @@ class GroupedWithMeteredMinimumPrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None +class GroupedWithMinMaxThresholdsPriceCompositePriceFilter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" + + GroupedWithMinMaxThresholdsPriceConversionRateConfig: TypeAlias = Annotated[ Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -1989,7 +2250,7 @@ class GroupedWithMinMaxThresholdsPrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - composite_price_filters: Optional[List[TransformPriceFilter]] = None + composite_price_filters: Optional[List[GroupedWithMinMaxThresholdsPriceCompositePriceFilter]] = None conversion_rate: Optional[float] = None @@ -2052,6 +2313,17 @@ class GroupedWithMinMaxThresholdsPrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None +class MatrixWithDisplayNamePriceCompositePriceFilter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" + + MatrixWithDisplayNamePriceConversionRateConfig: TypeAlias = Annotated[ Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -2087,7 +2359,7 @@ class MatrixWithDisplayNamePrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - composite_price_filters: Optional[List[TransformPriceFilter]] = None + composite_price_filters: Optional[List[MatrixWithDisplayNamePriceCompositePriceFilter]] = None conversion_rate: Optional[float] = None @@ -2150,6 +2422,17 @@ class MatrixWithDisplayNamePrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None +class GroupedTieredPackagePriceCompositePriceFilter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" + + GroupedTieredPackagePriceConversionRateConfig: TypeAlias = Annotated[ Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -2188,7 +2471,7 @@ class GroupedTieredPackagePrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - composite_price_filters: Optional[List[TransformPriceFilter]] = None + composite_price_filters: Optional[List[GroupedTieredPackagePriceCompositePriceFilter]] = None conversion_rate: Optional[float] = None @@ -2251,6 +2534,17 @@ class GroupedTieredPackagePrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None +class MaxGroupTieredPackagePriceCompositePriceFilter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" + + MaxGroupTieredPackagePriceConversionRateConfig: TypeAlias = Annotated[ Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -2288,7 +2582,7 @@ class MaxGroupTieredPackagePrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - composite_price_filters: Optional[List[TransformPriceFilter]] = None + composite_price_filters: Optional[List[MaxGroupTieredPackagePriceCompositePriceFilter]] = None conversion_rate: Optional[float] = None @@ -2351,6 +2645,17 @@ class MaxGroupTieredPackagePrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None +class ScalableMatrixWithUnitPricingPriceCompositePriceFilter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" + + ScalableMatrixWithUnitPricingPriceConversionRateConfig: TypeAlias = Annotated[ Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -2397,7 +2702,7 @@ class ScalableMatrixWithUnitPricingPrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - composite_price_filters: Optional[List[TransformPriceFilter]] = None + composite_price_filters: Optional[List[ScalableMatrixWithUnitPricingPriceCompositePriceFilter]] = None conversion_rate: Optional[float] = None @@ -2460,6 +2765,17 @@ class ScalableMatrixWithUnitPricingPrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None +class ScalableMatrixWithTieredPricingPriceCompositePriceFilter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" + + ScalableMatrixWithTieredPricingPriceConversionRateConfig: TypeAlias = Annotated[ Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -2511,7 +2827,7 @@ class ScalableMatrixWithTieredPricingPrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - composite_price_filters: Optional[List[TransformPriceFilter]] = None + composite_price_filters: Optional[List[ScalableMatrixWithTieredPricingPriceCompositePriceFilter]] = None conversion_rate: Optional[float] = None @@ -2576,6 +2892,17 @@ class ScalableMatrixWithTieredPricingPrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None +class CumulativeGroupedBulkPriceCompositePriceFilter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" + + CumulativeGroupedBulkPriceConversionRateConfig: TypeAlias = Annotated[ Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -2611,7 +2938,7 @@ class CumulativeGroupedBulkPrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - composite_price_filters: Optional[List[TransformPriceFilter]] = None + composite_price_filters: Optional[List[CumulativeGroupedBulkPriceCompositePriceFilter]] = None conversion_rate: Optional[float] = None @@ -2674,6 +3001,17 @@ class CumulativeGroupedBulkPrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None +class MinimumCompositePriceCompositePriceFilter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" + + MinimumCompositePriceConversionRateConfig: TypeAlias = Annotated[ Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -2698,7 +3036,7 @@ class MinimumCompositePrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - composite_price_filters: Optional[List[TransformPriceFilter]] = None + composite_price_filters: Optional[List[MinimumCompositePriceCompositePriceFilter]] = None conversion_rate: Optional[float] = None @@ -2761,6 +3099,17 @@ class MinimumCompositePrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None +class PercentCompositePriceCompositePriceFilter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" + + PercentCompositePriceConversionRateConfig: TypeAlias = Annotated[ Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -2782,7 +3131,7 @@ class PercentCompositePrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - composite_price_filters: Optional[List[TransformPriceFilter]] = None + composite_price_filters: Optional[List[PercentCompositePriceCompositePriceFilter]] = None conversion_rate: Optional[float] = None @@ -2845,6 +3194,17 @@ class PercentCompositePrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None +class EventOutputPriceCompositePriceFilter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" + + EventOutputPriceConversionRateConfig: TypeAlias = Annotated[ Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -2854,6 +3214,13 @@ class EventOutputPriceEventOutputConfig(BaseModel): unit_rating_key: str """The key in the event data to extract the unit rate from.""" + default_unit_rate: Optional[str] = None + """ + If provided, this amount will be used as the unit rate when an event does not + have a value for the `unit_rating_key`. If not provided, events missing a unit + rate will be ignored. + """ + grouping_key: Optional[str] = None """An optional key in the event data to group by (e.g., event ID). @@ -2872,7 +3239,7 @@ class EventOutputPrice(BaseModel): cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - composite_price_filters: Optional[List[TransformPriceFilter]] = None + composite_price_filters: Optional[List[EventOutputPriceCompositePriceFilter]] = None conversion_rate: Optional[float] = None diff --git a/src/orb/types/shared/transform_price_filter.py b/src/orb/types/shared/transform_price_filter.py deleted file mode 100644 index 64218996..00000000 --- a/src/orb/types/shared/transform_price_filter.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["TransformPriceFilter"] - - -class TransformPriceFilter(BaseModel): - field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] - """The property of the price to filter on.""" - - operator: Literal["includes", "excludes"] - """Should prices that match the filter be included or excluded.""" - - values: List[str] - """The IDs or values that match this filter.""" diff --git a/src/orb/types/shared/trial_discount.py b/src/orb/types/shared/trial_discount.py index 9f6f43fc..a39fa8dd 100644 --- a/src/orb/types/shared/trial_discount.py +++ b/src/orb/types/shared/trial_discount.py @@ -4,9 +4,19 @@ from typing_extensions import Literal from ..._models import BaseModel -from .transform_price_filter import TransformPriceFilter -__all__ = ["TrialDiscount"] +__all__ = ["TrialDiscount", "Filter"] + + +class Filter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" class TrialDiscount(BaseModel): @@ -18,7 +28,7 @@ class TrialDiscount(BaseModel): For plan/plan phase discounts, this can be a subset of prices. """ - filters: Optional[List[TransformPriceFilter]] = None + filters: Optional[List[Filter]] = None """The filters that determine which prices to apply this discount to.""" reason: Optional[str] = None diff --git a/src/orb/types/shared/usage_discount.py b/src/orb/types/shared/usage_discount.py index 72b4d523..34548a0e 100644 --- a/src/orb/types/shared/usage_discount.py +++ b/src/orb/types/shared/usage_discount.py @@ -4,9 +4,19 @@ from typing_extensions import Literal from ..._models import BaseModel -from .transform_price_filter import TransformPriceFilter -__all__ = ["UsageDiscount"] +__all__ = ["UsageDiscount", "Filter"] + + +class Filter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" class UsageDiscount(BaseModel): @@ -24,7 +34,7 @@ class UsageDiscount(BaseModel): For plan/plan phase discounts, this can be a subset of prices. """ - filters: Optional[List[TransformPriceFilter]] = None + filters: Optional[List[Filter]] = None """The filters that determine which prices to apply this discount to.""" reason: Optional[str] = None diff --git a/src/orb/types/shared/usage_discount_interval.py b/src/orb/types/shared/usage_discount_interval.py index 3d5b93aa..909b34dd 100644 --- a/src/orb/types/shared/usage_discount_interval.py +++ b/src/orb/types/shared/usage_discount_interval.py @@ -5,9 +5,19 @@ from typing_extensions import Literal from ..._models import BaseModel -from .transform_price_filter import TransformPriceFilter -__all__ = ["UsageDiscountInterval"] +__all__ = ["UsageDiscountInterval", "Filter"] + + +class Filter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" class UsageDiscountInterval(BaseModel): @@ -19,7 +29,7 @@ class UsageDiscountInterval(BaseModel): end_date: Optional[datetime] = None """The end date of the discount interval.""" - filters: List[TransformPriceFilter] + filters: List[Filter] """The filters that determine which prices this discount interval applies to.""" start_date: datetime diff --git a/src/orb/types/shared_params/__init__.py b/src/orb/types/shared_params/__init__.py index 96706705..1e5dbc25 100644 --- a/src/orb/types/shared_params/__init__.py +++ b/src/orb/types/shared_params/__init__.py @@ -26,7 +26,6 @@ from .new_plan_matrix_price import NewPlanMatrixPrice as NewPlanMatrixPrice from .new_plan_tiered_price import NewPlanTieredPrice as NewPlanTieredPrice 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 diff --git a/src/orb/types/shared_params/amount_discount.py b/src/orb/types/shared_params/amount_discount.py index 9cc51153..035026dc 100644 --- a/src/orb/types/shared_params/amount_discount.py +++ b/src/orb/types/shared_params/amount_discount.py @@ -6,9 +6,19 @@ from typing_extensions import Literal, Required, TypedDict from ..._types import SequenceNotStr -from .transform_price_filter import TransformPriceFilter -__all__ = ["AmountDiscount"] +__all__ = ["AmountDiscount", "Filter"] + + +class Filter(TypedDict, total=False): + field: Required[Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"]] + """The property of the price to filter on.""" + + operator: Required[Literal["includes", "excludes"]] + """Should prices that match the filter be included or excluded.""" + + values: Required[SequenceNotStr[str]] + """The IDs or values that match this filter.""" class AmountDiscount(TypedDict, total=False): @@ -23,7 +33,7 @@ class AmountDiscount(TypedDict, total=False): For plan/plan phase discounts, this can be a subset of prices. """ - filters: Optional[Iterable[TransformPriceFilter]] + filters: Optional[Iterable[Filter]] """The filters that determine which prices to apply this discount to.""" reason: Optional[str] diff --git a/src/orb/types/shared_params/new_amount_discount.py b/src/orb/types/shared_params/new_amount_discount.py index 4bd6b048..ad213823 100644 --- a/src/orb/types/shared_params/new_amount_discount.py +++ b/src/orb/types/shared_params/new_amount_discount.py @@ -6,9 +6,19 @@ from typing_extensions import Literal, Required, TypedDict from ..._types import SequenceNotStr -from .transform_price_filter import TransformPriceFilter -__all__ = ["NewAmountDiscount"] +__all__ = ["NewAmountDiscount", "Filter"] + + +class Filter(TypedDict, total=False): + field: Required[Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"]] + """The property of the price to filter on.""" + + operator: Required[Literal["includes", "excludes"]] + """Should prices that match the filter be included or excluded.""" + + values: Required[SequenceNotStr[str]] + """The IDs or values that match this filter.""" class NewAmountDiscount(TypedDict, total=False): @@ -28,7 +38,7 @@ class NewAmountDiscount(TypedDict, total=False): currency: Optional[str] """If set, only prices in the specified currency will have the adjustment applied.""" - filters: Optional[Iterable[TransformPriceFilter]] + filters: Optional[Iterable[Filter]] """A list of filters that determine which prices this adjustment will apply to.""" is_invoice_level: bool diff --git a/src/orb/types/shared_params/new_maximum.py b/src/orb/types/shared_params/new_maximum.py index 29e7f8a4..f79bfe25 100644 --- a/src/orb/types/shared_params/new_maximum.py +++ b/src/orb/types/shared_params/new_maximum.py @@ -6,9 +6,19 @@ from typing_extensions import Literal, Required, TypedDict from ..._types import SequenceNotStr -from .transform_price_filter import TransformPriceFilter -__all__ = ["NewMaximum"] +__all__ = ["NewMaximum", "Filter"] + + +class Filter(TypedDict, total=False): + field: Required[Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"]] + """The property of the price to filter on.""" + + operator: Required[Literal["includes", "excludes"]] + """Should prices that match the filter be included or excluded.""" + + values: Required[SequenceNotStr[str]] + """The IDs or values that match this filter.""" class NewMaximum(TypedDict, total=False): @@ -28,7 +38,7 @@ class NewMaximum(TypedDict, total=False): currency: Optional[str] """If set, only prices in the specified currency will have the adjustment applied.""" - filters: Optional[Iterable[TransformPriceFilter]] + filters: Optional[Iterable[Filter]] """A list of filters that determine which prices this adjustment will apply to.""" is_invoice_level: bool diff --git a/src/orb/types/shared_params/new_minimum.py b/src/orb/types/shared_params/new_minimum.py index 2605d028..0c1bb520 100644 --- a/src/orb/types/shared_params/new_minimum.py +++ b/src/orb/types/shared_params/new_minimum.py @@ -6,9 +6,19 @@ from typing_extensions import Literal, Required, TypedDict from ..._types import SequenceNotStr -from .transform_price_filter import TransformPriceFilter -__all__ = ["NewMinimum"] +__all__ = ["NewMinimum", "Filter"] + + +class Filter(TypedDict, total=False): + field: Required[Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"]] + """The property of the price to filter on.""" + + operator: Required[Literal["includes", "excludes"]] + """Should prices that match the filter be included or excluded.""" + + values: Required[SequenceNotStr[str]] + """The IDs or values that match this filter.""" class NewMinimum(TypedDict, total=False): @@ -31,7 +41,7 @@ class NewMinimum(TypedDict, total=False): currency: Optional[str] """If set, only prices in the specified currency will have the adjustment applied.""" - filters: Optional[Iterable[TransformPriceFilter]] + filters: Optional[Iterable[Filter]] """A list of filters that determine which prices this adjustment will apply to.""" is_invoice_level: bool diff --git a/src/orb/types/shared_params/new_percentage_discount.py b/src/orb/types/shared_params/new_percentage_discount.py index 1dd0eb52..b227a57f 100644 --- a/src/orb/types/shared_params/new_percentage_discount.py +++ b/src/orb/types/shared_params/new_percentage_discount.py @@ -6,9 +6,19 @@ from typing_extensions import Literal, Required, TypedDict from ..._types import SequenceNotStr -from .transform_price_filter import TransformPriceFilter -__all__ = ["NewPercentageDiscount"] +__all__ = ["NewPercentageDiscount", "Filter"] + + +class Filter(TypedDict, total=False): + field: Required[Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"]] + """The property of the price to filter on.""" + + operator: Required[Literal["includes", "excludes"]] + """Should prices that match the filter be included or excluded.""" + + values: Required[SequenceNotStr[str]] + """The IDs or values that match this filter.""" class NewPercentageDiscount(TypedDict, total=False): @@ -28,7 +38,7 @@ class NewPercentageDiscount(TypedDict, total=False): currency: Optional[str] """If set, only prices in the specified currency will have the adjustment applied.""" - filters: Optional[Iterable[TransformPriceFilter]] + filters: Optional[Iterable[Filter]] """A list of filters that determine which prices this adjustment will apply to.""" is_invoice_level: bool diff --git a/src/orb/types/shared_params/new_usage_discount.py b/src/orb/types/shared_params/new_usage_discount.py index 2c781fe6..7f285264 100644 --- a/src/orb/types/shared_params/new_usage_discount.py +++ b/src/orb/types/shared_params/new_usage_discount.py @@ -6,9 +6,19 @@ from typing_extensions import Literal, Required, TypedDict from ..._types import SequenceNotStr -from .transform_price_filter import TransformPriceFilter -__all__ = ["NewUsageDiscount"] +__all__ = ["NewUsageDiscount", "Filter"] + + +class Filter(TypedDict, total=False): + field: Required[Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"]] + """The property of the price to filter on.""" + + operator: Required[Literal["includes", "excludes"]] + """Should prices that match the filter be included or excluded.""" + + values: Required[SequenceNotStr[str]] + """The IDs or values that match this filter.""" class NewUsageDiscount(TypedDict, total=False): @@ -28,7 +38,7 @@ class NewUsageDiscount(TypedDict, total=False): currency: Optional[str] """If set, only prices in the specified currency will have the adjustment applied.""" - filters: Optional[Iterable[TransformPriceFilter]] + filters: Optional[Iterable[Filter]] """A list of filters that determine which prices this adjustment will apply to.""" is_invoice_level: bool diff --git a/src/orb/types/shared_params/percentage_discount.py b/src/orb/types/shared_params/percentage_discount.py index 77870b74..bdd842fb 100644 --- a/src/orb/types/shared_params/percentage_discount.py +++ b/src/orb/types/shared_params/percentage_discount.py @@ -6,9 +6,19 @@ from typing_extensions import Literal, Required, TypedDict from ..._types import SequenceNotStr -from .transform_price_filter import TransformPriceFilter -__all__ = ["PercentageDiscount"] +__all__ = ["PercentageDiscount", "Filter"] + + +class Filter(TypedDict, total=False): + field: Required[Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"]] + """The property of the price to filter on.""" + + operator: Required[Literal["includes", "excludes"]] + """Should prices that match the filter be included or excluded.""" + + values: Required[SequenceNotStr[str]] + """The IDs or values that match this filter.""" class PercentageDiscount(TypedDict, total=False): @@ -26,7 +36,7 @@ class PercentageDiscount(TypedDict, total=False): For plan/plan phase discounts, this can be a subset of prices. """ - filters: Optional[Iterable[TransformPriceFilter]] + filters: Optional[Iterable[Filter]] """The filters that determine which prices to apply this discount to.""" reason: Optional[str] diff --git a/src/orb/types/shared_params/transform_price_filter.py b/src/orb/types/shared_params/transform_price_filter.py deleted file mode 100644 index 2a1ce1eb..00000000 --- a/src/orb/types/shared_params/transform_price_filter.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal, Required, TypedDict - -from ..._types import SequenceNotStr - -__all__ = ["TransformPriceFilter"] - - -class TransformPriceFilter(TypedDict, total=False): - field: Required[Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"]] - """The property of the price to filter on.""" - - operator: Required[Literal["includes", "excludes"]] - """Should prices that match the filter be included or excluded.""" - - 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 ef1ca9b5..f2af6d5d 100644 --- a/src/orb/types/shared_params/trial_discount.py +++ b/src/orb/types/shared_params/trial_discount.py @@ -6,9 +6,19 @@ from typing_extensions import Literal, Required, TypedDict from ..._types import SequenceNotStr -from .transform_price_filter import TransformPriceFilter -__all__ = ["TrialDiscount"] +__all__ = ["TrialDiscount", "Filter"] + + +class Filter(TypedDict, total=False): + field: Required[Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"]] + """The property of the price to filter on.""" + + operator: Required[Literal["includes", "excludes"]] + """Should prices that match the filter be included or excluded.""" + + values: Required[SequenceNotStr[str]] + """The IDs or values that match this filter.""" class TrialDiscount(TypedDict, total=False): @@ -20,7 +30,7 @@ class TrialDiscount(TypedDict, total=False): For plan/plan phase discounts, this can be a subset of prices. """ - filters: Optional[Iterable[TransformPriceFilter]] + filters: Optional[Iterable[Filter]] """The filters that determine which prices to apply this discount to.""" reason: Optional[str] diff --git a/src/orb/types/shared_params/usage_discount.py b/src/orb/types/shared_params/usage_discount.py index 556c81cb..d26dcbc6 100644 --- a/src/orb/types/shared_params/usage_discount.py +++ b/src/orb/types/shared_params/usage_discount.py @@ -6,9 +6,19 @@ from typing_extensions import Literal, Required, TypedDict from ..._types import SequenceNotStr -from .transform_price_filter import TransformPriceFilter -__all__ = ["UsageDiscount"] +__all__ = ["UsageDiscount", "Filter"] + + +class Filter(TypedDict, total=False): + field: Required[Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"]] + """The property of the price to filter on.""" + + operator: Required[Literal["includes", "excludes"]] + """Should prices that match the filter be included or excluded.""" + + values: Required[SequenceNotStr[str]] + """The IDs or values that match this filter.""" class UsageDiscount(TypedDict, total=False): @@ -26,7 +36,7 @@ class UsageDiscount(TypedDict, total=False): For plan/plan phase discounts, this can be a subset of prices. """ - filters: Optional[Iterable[TransformPriceFilter]] + filters: Optional[Iterable[Filter]] """The filters that determine which prices to apply this discount to.""" reason: Optional[str] diff --git a/src/orb/types/subscription_create_params.py b/src/orb/types/subscription_create_params.py index 992e0079..dceed6e1 100644 --- a/src/orb/types/subscription_create_params.py +++ b/src/orb/types/subscription_create_params.py @@ -715,6 +715,13 @@ class AddPricePriceNewSubscriptionEventOutputPriceEventOutputConfig(TypedDict, t unit_rating_key: Required[str] """The key in the event data to extract the unit rate from.""" + default_unit_rate: Optional[str] + """ + If provided, this amount will be used as the unit rate when an event does not + have a value for the `unit_rating_key`. If not provided, events missing a unit + rate will be ignored. + """ + grouping_key: Optional[str] """An optional key in the event data to group by (e.g., event ID). @@ -1332,6 +1339,13 @@ class ReplacePricePriceNewSubscriptionEventOutputPriceEventOutputConfig(TypedDic unit_rating_key: Required[str] """The key in the event data to extract the unit rate from.""" + default_unit_rate: Optional[str] + """ + If provided, this amount will be used as the unit rate when an event does not + have a value for the `unit_rating_key`. If not provided, events missing a unit + rate will be ignored. + """ + grouping_key: Optional[str] """An optional key in the event data to group by (e.g., event ID). diff --git a/src/orb/types/subscription_price_intervals_params.py b/src/orb/types/subscription_price_intervals_params.py index 432d2516..09f87d0b 100644 --- a/src/orb/types/subscription_price_intervals_params.py +++ b/src/orb/types/subscription_price_intervals_params.py @@ -424,6 +424,13 @@ class AddPriceNewFloatingEventOutputPriceEventOutputConfig(TypedDict, total=Fals unit_rating_key: Required[str] """The key in the event data to extract the unit rate from.""" + default_unit_rate: Optional[str] + """ + If provided, this amount will be used as the unit rate when an event does not + have a value for the `unit_rating_key`. If not provided, events missing a unit + rate will be ignored. + """ + grouping_key: Optional[str] """An optional key in the event data to group by (e.g., event ID). diff --git a/src/orb/types/subscription_schedule_plan_change_params.py b/src/orb/types/subscription_schedule_plan_change_params.py index 40418eb9..c5017d98 100644 --- a/src/orb/types/subscription_schedule_plan_change_params.py +++ b/src/orb/types/subscription_schedule_plan_change_params.py @@ -703,6 +703,13 @@ class AddPricePriceNewSubscriptionEventOutputPriceEventOutputConfig(TypedDict, t unit_rating_key: Required[str] """The key in the event data to extract the unit rate from.""" + default_unit_rate: Optional[str] + """ + If provided, this amount will be used as the unit rate when an event does not + have a value for the `unit_rating_key`. If not provided, events missing a unit + rate will be ignored. + """ + grouping_key: Optional[str] """An optional key in the event data to group by (e.g., event ID). @@ -1320,6 +1327,13 @@ class ReplacePricePriceNewSubscriptionEventOutputPriceEventOutputConfig(TypedDic unit_rating_key: Required[str] """The key in the event data to extract the unit rate from.""" + default_unit_rate: Optional[str] + """ + If provided, this amount will be used as the unit rate when an event does not + have a value for the `unit_rating_key`. If not provided, events missing a unit + rate will be ignored. + """ + grouping_key: Optional[str] """An optional key in the event data to group by (e.g., event ID). diff --git a/tests/api_resources/test_prices.py b/tests/api_resources/test_prices.py index c4cb6031..9aedb4e2 100644 --- a/tests/api_resources/test_prices.py +++ b/tests/api_resources/test_prices.py @@ -3316,6 +3316,7 @@ def test_method_create_with_all_params_overload_30(self, client: Orb) -> None: currency="currency", event_output_config={ "unit_rating_key": "x", + "default_unit_rate": "default_unit_rate", "grouping_key": "grouping_key", }, item_id="item_id", @@ -7033,6 +7034,7 @@ async def test_method_create_with_all_params_overload_30(self, async_client: Asy currency="currency", event_output_config={ "unit_rating_key": "x", + "default_unit_rate": "default_unit_rate", "grouping_key": "grouping_key", }, item_id="item_id",