diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 0664537e..0fa2b83a 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "4.46.1" + ".": "4.46.2" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index b7ed1b28..92f7736e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 4.46.2 (2025-12-09) + +Full Changelog: [v4.46.1...v4.46.2](https://github.com/orbcorp/orb-python/compare/v4.46.1...v4.46.2) + +### Chores + +* add missing docstrings ([073bfcb](https://github.com/orbcorp/orb-python/commit/073bfcb247316e483dc732908e7c0ab0d42a3551)) + ## 4.46.1 (2025-12-08) Full Changelog: [v4.46.0...v4.46.1](https://github.com/orbcorp/orb-python/compare/v4.46.0...v4.46.1) diff --git a/pyproject.toml b/pyproject.toml index 19630bae..fea6d673 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "orb-billing" -version = "4.46.1" +version = "4.46.2" description = "The official Python library for the orb API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/orb/_version.py b/src/orb/_version.py index 993df18a..eb7503db 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.46.1" # x-release-please-version +__version__ = "4.46.2" # x-release-please-version diff --git a/src/orb/resources/webhooks.py b/src/orb/resources/webhooks.py index 2c5e9c7c..48c321fa 100644 --- a/src/orb/resources/webhooks.py +++ b/src/orb/resources/webhooks.py @@ -56,7 +56,11 @@ def verify_signature( now = datetime.now(tz=timezone.utc) try: - timestamp = datetime.fromisoformat(msg_timestamp).astimezone() + timestamp = datetime.fromisoformat(msg_timestamp) + # If the timestamp doesn't have timezone info, assume it's UTC + if timestamp.tzinfo is None: + timestamp = timestamp.replace(tzinfo=timezone.utc) + timestamp = timestamp.astimezone() except Exception as err: raise ValueError("Invalid signature headers. Could not convert to timestamp") from err @@ -140,7 +144,11 @@ def verify_signature( now = datetime.now(tz=timezone.utc) try: - timestamp = datetime.fromisoformat(msg_timestamp).astimezone() + timestamp = datetime.fromisoformat(msg_timestamp) + # If the timestamp doesn't have timezone info, assume it's UTC + if timestamp.tzinfo is None: + timestamp = timestamp.replace(tzinfo=timezone.utc) + timestamp = timestamp.astimezone() except Exception as err: raise ValueError("Invalid signature headers. Could not convert to timestamp") from err diff --git a/src/orb/types/alert.py b/src/orb/types/alert.py index f6669b14..0e92f504 100644 --- a/src/orb/types/alert.py +++ b/src/orb/types/alert.py @@ -13,10 +13,14 @@ class Metric(BaseModel): + """The metric the alert applies to.""" + id: str class Plan(BaseModel): + """The plan the alert applies to.""" + id: Optional[str] = None external_plan_id: Optional[str] = None @@ -32,6 +36,8 @@ class Plan(BaseModel): class BalanceAlertStatus(BaseModel): + """Alert status is used to determine if an alert is currently in-alert or not.""" + in_alert: bool """Whether the alert is currently in-alert or not.""" @@ -40,6 +46,13 @@ class BalanceAlertStatus(BaseModel): class Alert(BaseModel): + """ + [Alerts within Orb](/product-catalog/configuring-alerts) monitor spending, + usage, or credit balance and trigger webhooks when a threshold is exceeded. + + Alerts created through the API can be scoped to either customers or subscriptions. + """ + id: str """Also referred to as alert_id in this documentation.""" 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 6f22d131..3d784cc8 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 @@ -140,6 +140,8 @@ class AddAdjustment(TypedDict, total=False): class AddPricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigFilter(TypedDict, total=False): + """Configuration for a single property filter""" + property_key: Required[str] """Event property key to filter on""" @@ -148,6 +150,8 @@ class AddPricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigFilter(TypedD class AddPricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigTier(TypedDict, total=False): + """Configuration for a single bulk pricing tier""" + unit_amount: Required[str] """Amount per unit""" @@ -156,6 +160,8 @@ class AddPricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigTier(TypedDic class AddPricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfig(TypedDict, total=False): + """Configuration for bulk_with_filters pricing""" + filters: Required[Iterable[AddPricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigFilter]] """Property filters to apply (all must match)""" @@ -250,6 +256,8 @@ class AddPricePriceNewPlanBulkWithFiltersPrice(TypedDict, total=False): class AddPricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfigTier(TypedDict, total=False): + """Configuration for a single tiered with proration tier""" + tier_lower_bound: Required[str] """Inclusive tier starting value""" @@ -258,6 +266,8 @@ class AddPricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfigTier( class AddPricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfig(TypedDict, total=False): + """Configuration for tiered_with_proration pricing""" + tiers: Required[Iterable[AddPricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfigTier]] """ Tiers for rating based on total usage quantities into the specified tier with @@ -352,6 +362,8 @@ class AddPricePriceNewPlanTieredWithProrationPrice(TypedDict, total=False): class AddPricePriceNewPlanGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig(TypedDict, total=False): + """Configuration for grouped_with_min_max_thresholds pricing""" + grouping_key: Required[str] """The event property used to group before applying thresholds""" @@ -454,6 +466,8 @@ class AddPricePriceNewPlanGroupedWithMinMaxThresholdsPrice(TypedDict, total=Fals class AddPricePriceNewPlanCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig(TypedDict, total=False): + """Configuration for cumulative_grouped_allocation pricing""" + cumulative_allocation: Required[str] """The overall allocation across all groups""" @@ -556,6 +570,8 @@ class AddPricePriceNewPlanCumulativeGroupedAllocationPrice(TypedDict, total=Fals class AddPricePriceNewPlanPercentCompositePricePercentConfig(TypedDict, total=False): + """Configuration for percent pricing""" + percent: Required[float] """What percent of the component subtotals to charge""" @@ -647,6 +663,8 @@ class AddPricePriceNewPlanPercentCompositePrice(TypedDict, total=False): class AddPricePriceNewPlanEventOutputPriceEventOutputConfig(TypedDict, total=False): + """Configuration for event_output pricing""" + unit_rating_key: Required[str] """The key in the event data to extract the unit rate from.""" @@ -829,6 +847,8 @@ class ReplaceAdjustment(TypedDict, total=False): class ReplacePricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigFilter(TypedDict, total=False): + """Configuration for a single property filter""" + property_key: Required[str] """Event property key to filter on""" @@ -837,6 +857,8 @@ class ReplacePricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigFilter(Ty class ReplacePricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigTier(TypedDict, total=False): + """Configuration for a single bulk pricing tier""" + unit_amount: Required[str] """Amount per unit""" @@ -845,6 +867,8 @@ class ReplacePricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigTier(Type class ReplacePricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfig(TypedDict, total=False): + """Configuration for bulk_with_filters pricing""" + filters: Required[Iterable[ReplacePricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigFilter]] """Property filters to apply (all must match)""" @@ -939,6 +963,8 @@ class ReplacePricePriceNewPlanBulkWithFiltersPrice(TypedDict, total=False): class ReplacePricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfigTier(TypedDict, total=False): + """Configuration for a single tiered with proration tier""" + tier_lower_bound: Required[str] """Inclusive tier starting value""" @@ -947,6 +973,8 @@ class ReplacePricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfigT class ReplacePricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfig(TypedDict, total=False): + """Configuration for tiered_with_proration pricing""" + tiers: Required[Iterable[ReplacePricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfigTier]] """ Tiers for rating based on total usage quantities into the specified tier with @@ -1041,6 +1069,8 @@ class ReplacePricePriceNewPlanTieredWithProrationPrice(TypedDict, total=False): class ReplacePricePriceNewPlanGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig(TypedDict, total=False): + """Configuration for grouped_with_min_max_thresholds pricing""" + grouping_key: Required[str] """The event property used to group before applying thresholds""" @@ -1143,6 +1173,8 @@ class ReplacePricePriceNewPlanGroupedWithMinMaxThresholdsPrice(TypedDict, total= class ReplacePricePriceNewPlanCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig(TypedDict, total=False): + """Configuration for cumulative_grouped_allocation pricing""" + cumulative_allocation: Required[str] """The overall allocation across all groups""" @@ -1245,6 +1277,8 @@ class ReplacePricePriceNewPlanCumulativeGroupedAllocationPrice(TypedDict, total= class ReplacePricePriceNewPlanPercentCompositePricePercentConfig(TypedDict, total=False): + """Configuration for percent pricing""" + percent: Required[float] """What percent of the component subtotals to charge""" @@ -1336,6 +1370,8 @@ class ReplacePricePriceNewPlanPercentCompositePrice(TypedDict, total=False): class ReplacePricePriceNewPlanEventOutputPriceEventOutputConfig(TypedDict, total=False): + """Configuration for event_output pricing""" + unit_rating_key: Required[str] """The key in the event data to extract the unit rate from.""" diff --git a/src/orb/types/beta_create_plan_version_params.py b/src/orb/types/beta_create_plan_version_params.py index 3b12717f..a8af9be6 100644 --- a/src/orb/types/beta_create_plan_version_params.py +++ b/src/orb/types/beta_create_plan_version_params.py @@ -140,6 +140,8 @@ class AddAdjustment(TypedDict, total=False): class AddPricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigFilter(TypedDict, total=False): + """Configuration for a single property filter""" + property_key: Required[str] """Event property key to filter on""" @@ -148,6 +150,8 @@ class AddPricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigFilter(TypedD class AddPricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigTier(TypedDict, total=False): + """Configuration for a single bulk pricing tier""" + unit_amount: Required[str] """Amount per unit""" @@ -156,6 +160,8 @@ class AddPricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigTier(TypedDic class AddPricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfig(TypedDict, total=False): + """Configuration for bulk_with_filters pricing""" + filters: Required[Iterable[AddPricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigFilter]] """Property filters to apply (all must match)""" @@ -250,6 +256,8 @@ class AddPricePriceNewPlanBulkWithFiltersPrice(TypedDict, total=False): class AddPricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfigTier(TypedDict, total=False): + """Configuration for a single tiered with proration tier""" + tier_lower_bound: Required[str] """Inclusive tier starting value""" @@ -258,6 +266,8 @@ class AddPricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfigTier( class AddPricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfig(TypedDict, total=False): + """Configuration for tiered_with_proration pricing""" + tiers: Required[Iterable[AddPricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfigTier]] """ Tiers for rating based on total usage quantities into the specified tier with @@ -352,6 +362,8 @@ class AddPricePriceNewPlanTieredWithProrationPrice(TypedDict, total=False): class AddPricePriceNewPlanGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig(TypedDict, total=False): + """Configuration for grouped_with_min_max_thresholds pricing""" + grouping_key: Required[str] """The event property used to group before applying thresholds""" @@ -454,6 +466,8 @@ class AddPricePriceNewPlanGroupedWithMinMaxThresholdsPrice(TypedDict, total=Fals class AddPricePriceNewPlanCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig(TypedDict, total=False): + """Configuration for cumulative_grouped_allocation pricing""" + cumulative_allocation: Required[str] """The overall allocation across all groups""" @@ -556,6 +570,8 @@ class AddPricePriceNewPlanCumulativeGroupedAllocationPrice(TypedDict, total=Fals class AddPricePriceNewPlanPercentCompositePricePercentConfig(TypedDict, total=False): + """Configuration for percent pricing""" + percent: Required[float] """What percent of the component subtotals to charge""" @@ -647,6 +663,8 @@ class AddPricePriceNewPlanPercentCompositePrice(TypedDict, total=False): class AddPricePriceNewPlanEventOutputPriceEventOutputConfig(TypedDict, total=False): + """Configuration for event_output pricing""" + unit_rating_key: Required[str] """The key in the event data to extract the unit rate from.""" @@ -829,6 +847,8 @@ class ReplaceAdjustment(TypedDict, total=False): class ReplacePricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigFilter(TypedDict, total=False): + """Configuration for a single property filter""" + property_key: Required[str] """Event property key to filter on""" @@ -837,6 +857,8 @@ class ReplacePricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigFilter(Ty class ReplacePricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigTier(TypedDict, total=False): + """Configuration for a single bulk pricing tier""" + unit_amount: Required[str] """Amount per unit""" @@ -845,6 +867,8 @@ class ReplacePricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigTier(Type class ReplacePricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfig(TypedDict, total=False): + """Configuration for bulk_with_filters pricing""" + filters: Required[Iterable[ReplacePricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigFilter]] """Property filters to apply (all must match)""" @@ -939,6 +963,8 @@ class ReplacePricePriceNewPlanBulkWithFiltersPrice(TypedDict, total=False): class ReplacePricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfigTier(TypedDict, total=False): + """Configuration for a single tiered with proration tier""" + tier_lower_bound: Required[str] """Inclusive tier starting value""" @@ -947,6 +973,8 @@ class ReplacePricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfigT class ReplacePricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfig(TypedDict, total=False): + """Configuration for tiered_with_proration pricing""" + tiers: Required[Iterable[ReplacePricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfigTier]] """ Tiers for rating based on total usage quantities into the specified tier with @@ -1041,6 +1069,8 @@ class ReplacePricePriceNewPlanTieredWithProrationPrice(TypedDict, total=False): class ReplacePricePriceNewPlanGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig(TypedDict, total=False): + """Configuration for grouped_with_min_max_thresholds pricing""" + grouping_key: Required[str] """The event property used to group before applying thresholds""" @@ -1143,6 +1173,8 @@ class ReplacePricePriceNewPlanGroupedWithMinMaxThresholdsPrice(TypedDict, total= class ReplacePricePriceNewPlanCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig(TypedDict, total=False): + """Configuration for cumulative_grouped_allocation pricing""" + cumulative_allocation: Required[str] """The overall allocation across all groups""" @@ -1245,6 +1277,8 @@ class ReplacePricePriceNewPlanCumulativeGroupedAllocationPrice(TypedDict, total= class ReplacePricePriceNewPlanPercentCompositePricePercentConfig(TypedDict, total=False): + """Configuration for percent pricing""" + percent: Required[float] """What percent of the component subtotals to charge""" @@ -1336,6 +1370,8 @@ class ReplacePricePriceNewPlanPercentCompositePrice(TypedDict, total=False): class ReplacePricePriceNewPlanEventOutputPriceEventOutputConfig(TypedDict, total=False): + """Configuration for event_output pricing""" + unit_rating_key: Required[str] """The key in the event data to extract the unit rate from.""" diff --git a/src/orb/types/billable_metric.py b/src/orb/types/billable_metric.py index ac70464c..e618c404 100644 --- a/src/orb/types/billable_metric.py +++ b/src/orb/types/billable_metric.py @@ -10,6 +10,11 @@ class BillableMetric(BaseModel): + """ + The Metric resource represents a calculation of a quantity based on events. + Metrics are defined by the query that transforms raw usage events into meaningful values for your customers. + """ + id: str description: Optional[str] = None diff --git a/src/orb/types/coupon.py b/src/orb/types/coupon.py index c0ac61bd..1e77708e 100644 --- a/src/orb/types/coupon.py +++ b/src/orb/types/coupon.py @@ -15,6 +15,10 @@ class Coupon(BaseModel): + """ + A coupon represents a reusable discount configuration that can be applied either as a fixed or percentage amount to an invoice or subscription. Coupons are activated using a redemption code, which applies the discount to a subscription or invoice. The duration of a coupon determines how long it remains available for use by end users. + """ + id: str """Also referred to as coupon_id in this documentation.""" diff --git a/src/orb/types/customer.py b/src/orb/types/customer.py index a0849c85..462dd56b 100644 --- a/src/orb/types/customer.py +++ b/src/orb/types/customer.py @@ -21,6 +21,8 @@ class Hierarchy(BaseModel): + """The hierarchical relationships for this customer.""" + children: List[CustomerMinified] parent: Optional[CustomerMinified] = None @@ -53,6 +55,10 @@ class PaymentConfigurationPaymentProvider(BaseModel): class PaymentConfiguration(BaseModel): + """ + Payment configuration for the customer, applicable when using Orb Invoicing with a supported payment provider such as Stripe. + """ + payment_providers: Optional[List[PaymentConfigurationPaymentProvider]] = None """Provider-specific payment configuration.""" @@ -62,6 +68,23 @@ class ReportingConfiguration(BaseModel): class Customer(BaseModel): + """ + A customer is a buyer of your products, and the other party to the billing relationship. + + In Orb, customers are assigned system generated identifiers automatically, but it's often desirable to have these + match existing identifiers in your system. To avoid having to denormalize Orb ID information, you can pass in an + `external_customer_id` with your own identifier. See + [Customer ID Aliases](/events-and-metrics/customer-aliases) for further information about how these + aliases work in Orb. + + In addition to having an identifier in your system, a customer may exist in a payment provider solution like + Stripe. Use the `payment_provider_id` and the `payment_provider` enum field to express this mapping. + + A customer also has a timezone (from the standard [IANA timezone database](https://www.iana.org/time-zones)), which + defaults to your account's timezone. See [Timezone localization](/essentials/timezones) for + information on what this timezone parameter influences within Orb. + """ + id: str additional_emails: List[str] diff --git a/src/orb/types/customer_create_params.py b/src/orb/types/customer_create_params.py index 1086c7cc..0f156b3c 100644 --- a/src/orb/types/customer_create_params.py +++ b/src/orb/types/customer_create_params.py @@ -285,6 +285,10 @@ class PaymentConfigurationPaymentProvider(TypedDict, total=False): class PaymentConfiguration(TypedDict, total=False): + """ + Payment configuration for the customer, applicable when using Orb Invoicing with a supported payment provider such as Stripe. + """ + payment_providers: Iterable[PaymentConfigurationPaymentProvider] """Provider-specific payment configuration.""" diff --git a/src/orb/types/customer_update_by_external_id_params.py b/src/orb/types/customer_update_by_external_id_params.py index 7ff55d1d..110aa0a1 100644 --- a/src/orb/types/customer_update_by_external_id_params.py +++ b/src/orb/types/customer_update_by_external_id_params.py @@ -280,6 +280,10 @@ class PaymentConfigurationPaymentProvider(TypedDict, total=False): class PaymentConfiguration(TypedDict, total=False): + """ + Payment configuration for the customer, applicable when using Orb Invoicing with a supported payment provider such as Stripe. + """ + payment_providers: Iterable[PaymentConfigurationPaymentProvider] """Provider-specific payment configuration.""" diff --git a/src/orb/types/customer_update_params.py b/src/orb/types/customer_update_params.py index be75c0a7..5f611158 100644 --- a/src/orb/types/customer_update_params.py +++ b/src/orb/types/customer_update_params.py @@ -280,6 +280,10 @@ class PaymentConfigurationPaymentProvider(TypedDict, total=False): class PaymentConfiguration(TypedDict, total=False): + """ + Payment configuration for the customer, applicable when using Orb Invoicing with a supported payment provider such as Stripe. + """ + payment_providers: Iterable[PaymentConfigurationPaymentProvider] """Provider-specific payment configuration.""" diff --git a/src/orb/types/customers/credit_list_by_external_id_response.py b/src/orb/types/customers/credit_list_by_external_id_response.py index aecee49a..aeda2c6e 100644 --- a/src/orb/types/customers/credit_list_by_external_id_response.py +++ b/src/orb/types/customers/credit_list_by_external_id_response.py @@ -10,6 +10,8 @@ class Filter(BaseModel): + """A PriceFilter that only allows item_id field for block filters.""" + field: Literal["item_id"] """The property of the price the block applies to. Only item_id is supported.""" diff --git a/src/orb/types/customers/credit_list_response.py b/src/orb/types/customers/credit_list_response.py index 7de7e991..d024eaf7 100644 --- a/src/orb/types/customers/credit_list_response.py +++ b/src/orb/types/customers/credit_list_response.py @@ -10,6 +10,8 @@ class Filter(BaseModel): + """A PriceFilter that only allows item_id field for block filters.""" + field: Literal["item_id"] """The property of the price the block applies to. Only item_id is supported.""" diff --git a/src/orb/types/customers/credits/ledger_create_entry_by_external_id_params.py b/src/orb/types/customers/credits/ledger_create_entry_by_external_id_params.py index 05d8b6ea..598e681b 100644 --- a/src/orb/types/customers/credits/ledger_create_entry_by_external_id_params.py +++ b/src/orb/types/customers/credits/ledger_create_entry_by_external_id_params.py @@ -83,6 +83,8 @@ class AddIncrementCreditLedgerEntryRequestParams(TypedDict, total=False): class AddIncrementCreditLedgerEntryRequestParamsFilter(TypedDict, total=False): + """A PriceFilter that only allows item_id field for block filters.""" + field: Required[Literal["item_id"]] """The property of the price the block applies to. Only item_id is supported.""" @@ -94,6 +96,10 @@ class AddIncrementCreditLedgerEntryRequestParamsFilter(TypedDict, total=False): class AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings(TypedDict, total=False): + """ + Passing `invoice_settings` automatically generates an invoice for the newly added credits. If `invoice_settings` is passed, you must specify per_unit_cost_basis, as the calculation of the invoice total is done on that basis. + """ + auto_collection: Required[bool] """ Whether the credits purchase invoice should auto collect with the customer's diff --git a/src/orb/types/customers/credits/ledger_create_entry_params.py b/src/orb/types/customers/credits/ledger_create_entry_params.py index 55843f66..b0b47f75 100644 --- a/src/orb/types/customers/credits/ledger_create_entry_params.py +++ b/src/orb/types/customers/credits/ledger_create_entry_params.py @@ -83,6 +83,8 @@ class AddIncrementCreditLedgerEntryRequestParams(TypedDict, total=False): class AddIncrementCreditLedgerEntryRequestParamsFilter(TypedDict, total=False): + """A PriceFilter that only allows item_id field for block filters.""" + field: Required[Literal["item_id"]] """The property of the price the block applies to. Only item_id is supported.""" @@ -94,6 +96,10 @@ class AddIncrementCreditLedgerEntryRequestParamsFilter(TypedDict, total=False): class AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings(TypedDict, total=False): + """ + Passing `invoice_settings` automatically generates an invoice for the newly added credits. If `invoice_settings` is passed, you must specify per_unit_cost_basis, as the calculation of the invoice total is done on that basis. + """ + auto_collection: Required[bool] """ Whether the credits purchase invoice should auto collect with the customer's diff --git a/src/orb/types/customers/credits/top_up_create_by_external_id_params.py b/src/orb/types/customers/credits/top_up_create_by_external_id_params.py index 3683f420..189d8c61 100644 --- a/src/orb/types/customers/credits/top_up_create_by_external_id_params.py +++ b/src/orb/types/customers/credits/top_up_create_by_external_id_params.py @@ -52,6 +52,8 @@ class TopUpCreateByExternalIDParams(TypedDict, total=False): class InvoiceSettings(TypedDict, total=False): + """Settings for invoices generated by triggered top-ups.""" + auto_collection: Required[bool] """ Whether the credits purchase invoice should auto collect with the customer's diff --git a/src/orb/types/customers/credits/top_up_create_params.py b/src/orb/types/customers/credits/top_up_create_params.py index 6c7ee856..7ffef30b 100644 --- a/src/orb/types/customers/credits/top_up_create_params.py +++ b/src/orb/types/customers/credits/top_up_create_params.py @@ -52,6 +52,8 @@ class TopUpCreateParams(TypedDict, total=False): class InvoiceSettings(TypedDict, total=False): + """Settings for invoices generated by triggered top-ups.""" + auto_collection: Required[bool] """ Whether the credits purchase invoice should auto collect with the customer's diff --git a/src/orb/types/dimensional_price_group.py b/src/orb/types/dimensional_price_group.py index da103128..5d196e00 100644 --- a/src/orb/types/dimensional_price_group.py +++ b/src/orb/types/dimensional_price_group.py @@ -8,6 +8,11 @@ class DimensionalPriceGroup(BaseModel): + """ + A dimensional price group is used to partition the result of a billable metric by a set of dimensions. Prices in a + price group must specify the parition used to derive their usage. + """ + id: str billable_metric_id: str diff --git a/src/orb/types/event_ingest_response.py b/src/orb/types/event_ingest_response.py index 933e18c8..92fcf7d3 100644 --- a/src/orb/types/event_ingest_response.py +++ b/src/orb/types/event_ingest_response.py @@ -19,6 +19,10 @@ class ValidationFailed(BaseModel): class Debug(BaseModel): + """ + Optional debug information (only present when debug=true is passed to the endpoint). Contains ingested and duplicate event idempotency keys. + """ + duplicate: List[str] ingested: List[str] diff --git a/src/orb/types/event_search_response.py b/src/orb/types/event_search_response.py index 75324545..9c252c48 100644 --- a/src/orb/types/event_search_response.py +++ b/src/orb/types/event_search_response.py @@ -9,6 +9,12 @@ class Data(BaseModel): + """ + The [Event](/core-concepts#event) resource represents a usage event that has been created for a + customer. Events are the core of Orb's usage-based billing model, and are used to calculate the usage charges for + a given billing period. + """ + id: str """A unique value, generated by the client, that is used to de-duplicate events. diff --git a/src/orb/types/events/backfill_close_response.py b/src/orb/types/events/backfill_close_response.py index 058edebe..79725b60 100644 --- a/src/orb/types/events/backfill_close_response.py +++ b/src/orb/types/events/backfill_close_response.py @@ -10,6 +10,10 @@ class BackfillCloseResponse(BaseModel): + """ + A backfill represents an update to historical usage data, adding or replacing events in a timeframe. + """ + id: str close_time: Optional[datetime] = None diff --git a/src/orb/types/events/backfill_create_response.py b/src/orb/types/events/backfill_create_response.py index 90e185d5..0f74914f 100644 --- a/src/orb/types/events/backfill_create_response.py +++ b/src/orb/types/events/backfill_create_response.py @@ -10,6 +10,10 @@ class BackfillCreateResponse(BaseModel): + """ + A backfill represents an update to historical usage data, adding or replacing events in a timeframe. + """ + id: str close_time: Optional[datetime] = None diff --git a/src/orb/types/events/backfill_fetch_response.py b/src/orb/types/events/backfill_fetch_response.py index 2c253373..182bc201 100644 --- a/src/orb/types/events/backfill_fetch_response.py +++ b/src/orb/types/events/backfill_fetch_response.py @@ -10,6 +10,10 @@ class BackfillFetchResponse(BaseModel): + """ + A backfill represents an update to historical usage data, adding or replacing events in a timeframe. + """ + id: str close_time: Optional[datetime] = None diff --git a/src/orb/types/events/backfill_list_response.py b/src/orb/types/events/backfill_list_response.py index b470ba1f..2db0a724 100644 --- a/src/orb/types/events/backfill_list_response.py +++ b/src/orb/types/events/backfill_list_response.py @@ -10,6 +10,10 @@ class BackfillListResponse(BaseModel): + """ + A backfill represents an update to historical usage data, adding or replacing events in a timeframe. + """ + id: str close_time: Optional[datetime] = None diff --git a/src/orb/types/events/backfill_revert_response.py b/src/orb/types/events/backfill_revert_response.py index 52ec1314..949ac1b2 100644 --- a/src/orb/types/events/backfill_revert_response.py +++ b/src/orb/types/events/backfill_revert_response.py @@ -10,6 +10,10 @@ class BackfillRevertResponse(BaseModel): + """ + A backfill represents an update to historical usage data, adding or replacing events in a timeframe. + """ + id: str close_time: Optional[datetime] = None diff --git a/src/orb/types/events/event_volumes.py b/src/orb/types/events/event_volumes.py index f9852aac..f9e84b32 100644 --- a/src/orb/types/events/event_volumes.py +++ b/src/orb/types/events/event_volumes.py @@ -9,6 +9,12 @@ class Data(BaseModel): + """An EventVolume contains the event volume ingested in an hourly window. + + The timestamp used + for the aggregation is the `timestamp` datetime field on events. + """ + count: int """The number of events ingested with a timestamp between the timeframe""" diff --git a/src/orb/types/item.py b/src/orb/types/item.py index 14e1ee31..c25cd993 100644 --- a/src/orb/types/item.py +++ b/src/orb/types/item.py @@ -10,6 +10,10 @@ class ExternalConnection(BaseModel): + """ + Represents a connection between an Item and an external system for invoicing or tax calculation purposes. + """ + external_connection_name: Literal[ "stripe", "quickbooks", "bill.com", "netsuite", "taxjar", "avalara", "anrok", "numeral" ] @@ -20,6 +24,12 @@ class ExternalConnection(BaseModel): class Item(BaseModel): + """The Item resource represents a sellable product or good. + + Items are associated with all line items, billable metrics, + and prices and are used for defining external sync behavior for invoices and tax calculation purposes. + """ + id: str """The Orb-assigned unique identifier for the item.""" diff --git a/src/orb/types/item_update_params.py b/src/orb/types/item_update_params.py index 360eaca8..d9504846 100644 --- a/src/orb/types/item_update_params.py +++ b/src/orb/types/item_update_params.py @@ -22,6 +22,10 @@ class ItemUpdateParams(TypedDict, total=False): class ExternalConnection(TypedDict, total=False): + """ + Represents a connection between an Item and an external system for invoicing or tax calculation purposes. + """ + external_connection_name: Required[ Literal["stripe", "quickbooks", "bill.com", "netsuite", "taxjar", "avalara", "anrok", "numeral"] ] diff --git a/src/orb/types/new_subscription_bulk_with_proration_price_param.py b/src/orb/types/new_subscription_bulk_with_proration_price_param.py index 018b15f4..b9b24e36 100644 --- a/src/orb/types/new_subscription_bulk_with_proration_price_param.py +++ b/src/orb/types/new_subscription_bulk_with_proration_price_param.py @@ -19,6 +19,8 @@ class BulkWithProrationConfigTier(TypedDict, total=False): + """Configuration for a single bulk pricing tier with proration""" + unit_amount: Required[str] """Cost per unit""" @@ -27,6 +29,8 @@ class BulkWithProrationConfigTier(TypedDict, total=False): class BulkWithProrationConfig(TypedDict, total=False): + """Configuration for bulk_with_proration pricing""" + tiers: Required[Iterable[BulkWithProrationConfigTier]] """Bulk tiers for rating based on total usage volume""" diff --git a/src/orb/types/new_subscription_cumulative_grouped_bulk_price_param.py b/src/orb/types/new_subscription_cumulative_grouped_bulk_price_param.py index 4b91391a..54589a78 100644 --- a/src/orb/types/new_subscription_cumulative_grouped_bulk_price_param.py +++ b/src/orb/types/new_subscription_cumulative_grouped_bulk_price_param.py @@ -19,6 +19,8 @@ class CumulativeGroupedBulkConfigDimensionValue(TypedDict, total=False): + """Configuration for a dimension value entry""" + grouping_key: Required[str] """Grouping key value""" @@ -30,6 +32,8 @@ class CumulativeGroupedBulkConfigDimensionValue(TypedDict, total=False): class CumulativeGroupedBulkConfig(TypedDict, total=False): + """Configuration for cumulative_grouped_bulk pricing""" + dimension_values: Required[Iterable[CumulativeGroupedBulkConfigDimensionValue]] """Each tier lower bound must have the same group of values.""" diff --git a/src/orb/types/new_subscription_grouped_allocation_price_param.py b/src/orb/types/new_subscription_grouped_allocation_price_param.py index 1c73bc8c..a64935bc 100644 --- a/src/orb/types/new_subscription_grouped_allocation_price_param.py +++ b/src/orb/types/new_subscription_grouped_allocation_price_param.py @@ -14,6 +14,8 @@ class GroupedAllocationConfig(TypedDict, total=False): + """Configuration for grouped_allocation pricing""" + allocation: Required[str] """Usage allocation per group""" diff --git a/src/orb/types/new_subscription_grouped_tiered_package_price_param.py b/src/orb/types/new_subscription_grouped_tiered_package_price_param.py index 8f1e0f90..fb6fd9e4 100644 --- a/src/orb/types/new_subscription_grouped_tiered_package_price_param.py +++ b/src/orb/types/new_subscription_grouped_tiered_package_price_param.py @@ -19,6 +19,8 @@ class GroupedTieredPackageConfigTier(TypedDict, total=False): + """Configuration for a single tier""" + per_unit: Required[str] """Price per package""" @@ -27,6 +29,8 @@ class GroupedTieredPackageConfigTier(TypedDict, total=False): class GroupedTieredPackageConfig(TypedDict, total=False): + """Configuration for grouped_tiered_package pricing""" + grouping_key: Required[str] """The event property used to group before tiering""" diff --git a/src/orb/types/new_subscription_grouped_tiered_price_param.py b/src/orb/types/new_subscription_grouped_tiered_price_param.py index 0e79dadd..e3d963bb 100644 --- a/src/orb/types/new_subscription_grouped_tiered_price_param.py +++ b/src/orb/types/new_subscription_grouped_tiered_price_param.py @@ -19,6 +19,8 @@ class GroupedTieredConfigTier(TypedDict, total=False): + """Configuration for a single tier""" + tier_lower_bound: Required[str] """Tier lower bound""" @@ -27,6 +29,8 @@ class GroupedTieredConfigTier(TypedDict, total=False): class GroupedTieredConfig(TypedDict, total=False): + """Configuration for grouped_tiered pricing""" + grouping_key: Required[str] """The billable metric property used to group before tiering""" diff --git a/src/orb/types/new_subscription_grouped_with_metered_minimum_price_param.py b/src/orb/types/new_subscription_grouped_with_metered_minimum_price_param.py index 1652fe37..c34859d0 100644 --- a/src/orb/types/new_subscription_grouped_with_metered_minimum_price_param.py +++ b/src/orb/types/new_subscription_grouped_with_metered_minimum_price_param.py @@ -20,6 +20,8 @@ class GroupedWithMeteredMinimumConfigScalingFactor(TypedDict, total=False): + """Configuration for a scaling factor""" + scaling_factor: Required[str] """Scaling factor""" @@ -28,6 +30,8 @@ class GroupedWithMeteredMinimumConfigScalingFactor(TypedDict, total=False): class GroupedWithMeteredMinimumConfigUnitAmount(TypedDict, total=False): + """Configuration for a unit amount""" + pricing_value: Required[str] """Pricing value""" @@ -36,6 +40,8 @@ class GroupedWithMeteredMinimumConfigUnitAmount(TypedDict, total=False): class GroupedWithMeteredMinimumConfig(TypedDict, total=False): + """Configuration for grouped_with_metered_minimum pricing""" + grouping_key: Required[str] """Used to partition the usage into groups. diff --git a/src/orb/types/new_subscription_grouped_with_prorated_minimum_price_param.py b/src/orb/types/new_subscription_grouped_with_prorated_minimum_price_param.py index 9dbc811b..393aff68 100644 --- a/src/orb/types/new_subscription_grouped_with_prorated_minimum_price_param.py +++ b/src/orb/types/new_subscription_grouped_with_prorated_minimum_price_param.py @@ -18,6 +18,8 @@ class GroupedWithProratedMinimumConfig(TypedDict, total=False): + """Configuration for grouped_with_prorated_minimum pricing""" + grouping_key: Required[str] """How to determine the groups that should each have a minimum""" diff --git a/src/orb/types/new_subscription_matrix_with_display_name_price_param.py b/src/orb/types/new_subscription_matrix_with_display_name_price_param.py index 4a436e96..759521de 100644 --- a/src/orb/types/new_subscription_matrix_with_display_name_price_param.py +++ b/src/orb/types/new_subscription_matrix_with_display_name_price_param.py @@ -19,6 +19,8 @@ class MatrixWithDisplayNameConfigUnitAmount(TypedDict, total=False): + """Configuration for a unit amount item""" + dimension_value: Required[str] """The dimension value""" @@ -30,6 +32,8 @@ class MatrixWithDisplayNameConfigUnitAmount(TypedDict, total=False): class MatrixWithDisplayNameConfig(TypedDict, total=False): + """Configuration for matrix_with_display_name pricing""" + dimension: Required[str] """Used to determine the unit rate""" diff --git a/src/orb/types/new_subscription_max_group_tiered_package_price_param.py b/src/orb/types/new_subscription_max_group_tiered_package_price_param.py index 4849ba34..41a4869e 100644 --- a/src/orb/types/new_subscription_max_group_tiered_package_price_param.py +++ b/src/orb/types/new_subscription_max_group_tiered_package_price_param.py @@ -19,6 +19,8 @@ class MaxGroupTieredPackageConfigTier(TypedDict, total=False): + """Configuration for a single tier""" + tier_lower_bound: Required[str] """Tier lower bound""" @@ -27,6 +29,8 @@ class MaxGroupTieredPackageConfigTier(TypedDict, total=False): class MaxGroupTieredPackageConfig(TypedDict, total=False): + """Configuration for max_group_tiered_package pricing""" + grouping_key: Required[str] """ The event property used to group before tiering the group with the highest value diff --git a/src/orb/types/new_subscription_minimum_composite_price_param.py b/src/orb/types/new_subscription_minimum_composite_price_param.py index 81a29249..0d5dadf5 100644 --- a/src/orb/types/new_subscription_minimum_composite_price_param.py +++ b/src/orb/types/new_subscription_minimum_composite_price_param.py @@ -14,6 +14,8 @@ class MinimumConfig(TypedDict, total=False): + """Configuration for minimum pricing""" + minimum_amount: Required[str] """The minimum amount to apply""" diff --git a/src/orb/types/new_subscription_package_with_allocation_price_param.py b/src/orb/types/new_subscription_package_with_allocation_price_param.py index c6f1d709..a7ed8f9e 100644 --- a/src/orb/types/new_subscription_package_with_allocation_price_param.py +++ b/src/orb/types/new_subscription_package_with_allocation_price_param.py @@ -14,6 +14,8 @@ class PackageWithAllocationConfig(TypedDict, total=False): + """Configuration for package_with_allocation pricing""" + allocation: Required[str] """Usage allocation""" diff --git a/src/orb/types/new_subscription_scalable_matrix_with_tiered_pricing_price_param.py b/src/orb/types/new_subscription_scalable_matrix_with_tiered_pricing_price_param.py index 57a8793b..b502aa55 100644 --- a/src/orb/types/new_subscription_scalable_matrix_with_tiered_pricing_price_param.py +++ b/src/orb/types/new_subscription_scalable_matrix_with_tiered_pricing_price_param.py @@ -20,6 +20,8 @@ class ScalableMatrixWithTieredPricingConfigMatrixScalingFactor(TypedDict, total=False): + """Configuration for a single matrix scaling factor""" + first_dimension_value: Required[str] """First dimension value""" @@ -31,6 +33,8 @@ class ScalableMatrixWithTieredPricingConfigMatrixScalingFactor(TypedDict, total= class ScalableMatrixWithTieredPricingConfigTier(TypedDict, total=False): + """Configuration for a single tier entry with business logic""" + tier_lower_bound: Required[str] """Tier lower bound""" @@ -39,6 +43,8 @@ class ScalableMatrixWithTieredPricingConfigTier(TypedDict, total=False): class ScalableMatrixWithTieredPricingConfig(TypedDict, total=False): + """Configuration for scalable_matrix_with_tiered_pricing pricing""" + first_dimension: Required[str] """Used for the scalable matrix first dimension""" diff --git a/src/orb/types/new_subscription_scalable_matrix_with_unit_pricing_price_param.py b/src/orb/types/new_subscription_scalable_matrix_with_unit_pricing_price_param.py index 031d2b22..5a849ab7 100644 --- a/src/orb/types/new_subscription_scalable_matrix_with_unit_pricing_price_param.py +++ b/src/orb/types/new_subscription_scalable_matrix_with_unit_pricing_price_param.py @@ -19,6 +19,8 @@ class ScalableMatrixWithUnitPricingConfigMatrixScalingFactor(TypedDict, total=False): + """Configuration for a single matrix scaling factor""" + first_dimension_value: Required[str] """First dimension value""" @@ -30,6 +32,8 @@ class ScalableMatrixWithUnitPricingConfigMatrixScalingFactor(TypedDict, total=Fa class ScalableMatrixWithUnitPricingConfig(TypedDict, total=False): + """Configuration for scalable_matrix_with_unit_pricing pricing""" + first_dimension: Required[str] """Used to determine the unit rate""" diff --git a/src/orb/types/new_subscription_threshold_total_amount_price_param.py b/src/orb/types/new_subscription_threshold_total_amount_price_param.py index eecc9c10..714da2a4 100644 --- a/src/orb/types/new_subscription_threshold_total_amount_price_param.py +++ b/src/orb/types/new_subscription_threshold_total_amount_price_param.py @@ -19,6 +19,8 @@ class ThresholdTotalAmountConfigConsumptionTable(TypedDict, total=False): + """Configuration for a single threshold""" + threshold: Required[str] """Quantity threshold""" @@ -27,6 +29,8 @@ class ThresholdTotalAmountConfigConsumptionTable(TypedDict, total=False): class ThresholdTotalAmountConfig(TypedDict, total=False): + """Configuration for threshold_total_amount pricing""" + consumption_table: Required[Iterable[ThresholdTotalAmountConfigConsumptionTable]] """ When the quantity consumed passes a provided threshold, the configured total diff --git a/src/orb/types/new_subscription_tiered_package_price_param.py b/src/orb/types/new_subscription_tiered_package_price_param.py index f217a5e5..d6da3e02 100644 --- a/src/orb/types/new_subscription_tiered_package_price_param.py +++ b/src/orb/types/new_subscription_tiered_package_price_param.py @@ -19,6 +19,8 @@ class TieredPackageConfigTier(TypedDict, total=False): + """Configuration for a single tier with business logic""" + per_unit: Required[str] """Price per package""" @@ -27,6 +29,8 @@ class TieredPackageConfigTier(TypedDict, total=False): class TieredPackageConfig(TypedDict, total=False): + """Configuration for tiered_package pricing""" + package_size: Required[str] """Package size""" diff --git a/src/orb/types/new_subscription_tiered_package_with_minimum_price_param.py b/src/orb/types/new_subscription_tiered_package_with_minimum_price_param.py index 6ab22397..33469ec2 100644 --- a/src/orb/types/new_subscription_tiered_package_with_minimum_price_param.py +++ b/src/orb/types/new_subscription_tiered_package_with_minimum_price_param.py @@ -19,6 +19,8 @@ class TieredPackageWithMinimumConfigTier(TypedDict, total=False): + """Configuration for a single tier""" + minimum_amount: Required[str] """Minimum amount""" @@ -30,6 +32,8 @@ class TieredPackageWithMinimumConfigTier(TypedDict, total=False): class TieredPackageWithMinimumConfig(TypedDict, total=False): + """Configuration for tiered_package_with_minimum pricing""" + package_size: Required[float] """Package size""" diff --git a/src/orb/types/new_subscription_tiered_with_minimum_price_param.py b/src/orb/types/new_subscription_tiered_with_minimum_price_param.py index 9c7dfbe4..ce0001ce 100644 --- a/src/orb/types/new_subscription_tiered_with_minimum_price_param.py +++ b/src/orb/types/new_subscription_tiered_with_minimum_price_param.py @@ -19,6 +19,8 @@ class TieredWithMinimumConfigTier(TypedDict, total=False): + """Configuration for a single tier""" + minimum_amount: Required[str] """Minimum amount""" @@ -30,6 +32,8 @@ class TieredWithMinimumConfigTier(TypedDict, total=False): class TieredWithMinimumConfig(TypedDict, total=False): + """Configuration for tiered_with_minimum pricing""" + tiers: Required[Iterable[TieredWithMinimumConfigTier]] """Tiered pricing with a minimum amount dependent on the volume tier. diff --git a/src/orb/types/new_subscription_unit_with_percent_price_param.py b/src/orb/types/new_subscription_unit_with_percent_price_param.py index 2a0d1c6e..f6605f2d 100644 --- a/src/orb/types/new_subscription_unit_with_percent_price_param.py +++ b/src/orb/types/new_subscription_unit_with_percent_price_param.py @@ -14,6 +14,8 @@ class UnitWithPercentConfig(TypedDict, total=False): + """Configuration for unit_with_percent pricing""" + percent: Required[str] """What percent, out of 100, of the calculated total to charge""" diff --git a/src/orb/types/new_subscription_unit_with_proration_price_param.py b/src/orb/types/new_subscription_unit_with_proration_price_param.py index 30220c0a..e8f43577 100644 --- a/src/orb/types/new_subscription_unit_with_proration_price_param.py +++ b/src/orb/types/new_subscription_unit_with_proration_price_param.py @@ -14,6 +14,8 @@ class UnitWithProrationConfig(TypedDict, total=False): + """Configuration for unit_with_proration pricing""" + unit_amount: Required[str] """Rate per unit of usage""" diff --git a/src/orb/types/plan.py b/src/orb/types/plan.py index 25eb312d..27c4a19c 100644 --- a/src/orb/types/plan.py +++ b/src/orb/types/plan.py @@ -31,6 +31,10 @@ class BasePlan(BaseModel): + """ + Legacy field representing the parent plan if the current plan is a 'child plan', overriding prices from the parent. + """ + id: Optional[str] = None external_plan_id: Optional[str] = None @@ -87,6 +91,12 @@ class TrialConfig(BaseModel): class Plan(BaseModel): + """ + The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be subscribed to by a + customer. Plans define the billing behavior of the subscription. You can see more about how to configure prices + in the [Price resource](/reference/price). + """ + id: str adjustments: List[Adjustment] diff --git a/src/orb/types/plan_create_params.py b/src/orb/types/plan_create_params.py index 23b66751..b8bc2085 100644 --- a/src/orb/types/plan_create_params.py +++ b/src/orb/types/plan_create_params.py @@ -130,6 +130,8 @@ class PlanCreateParams(TypedDict, total=False): class PricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigFilter(TypedDict, total=False): + """Configuration for a single property filter""" + property_key: Required[str] """Event property key to filter on""" @@ -138,6 +140,8 @@ class PricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigFilter(TypedDict class PricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigTier(TypedDict, total=False): + """Configuration for a single bulk pricing tier""" + unit_amount: Required[str] """Amount per unit""" @@ -146,6 +150,8 @@ class PricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigTier(TypedDict, class PricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfig(TypedDict, total=False): + """Configuration for bulk_with_filters pricing""" + filters: Required[Iterable[PricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigFilter]] """Property filters to apply (all must match)""" @@ -240,6 +246,8 @@ class PricePriceNewPlanBulkWithFiltersPrice(TypedDict, total=False): class PricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfigTier(TypedDict, total=False): + """Configuration for a single tiered with proration tier""" + tier_lower_bound: Required[str] """Inclusive tier starting value""" @@ -248,6 +256,8 @@ class PricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfigTier(Typ class PricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfig(TypedDict, total=False): + """Configuration for tiered_with_proration pricing""" + tiers: Required[Iterable[PricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfigTier]] """ Tiers for rating based on total usage quantities into the specified tier with @@ -342,6 +352,8 @@ class PricePriceNewPlanTieredWithProrationPrice(TypedDict, total=False): class PricePriceNewPlanGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig(TypedDict, total=False): + """Configuration for grouped_with_min_max_thresholds pricing""" + grouping_key: Required[str] """The event property used to group before applying thresholds""" @@ -444,6 +456,8 @@ class PricePriceNewPlanGroupedWithMinMaxThresholdsPrice(TypedDict, total=False): class PricePriceNewPlanCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig(TypedDict, total=False): + """Configuration for cumulative_grouped_allocation pricing""" + cumulative_allocation: Required[str] """The overall allocation across all groups""" @@ -546,6 +560,8 @@ class PricePriceNewPlanCumulativeGroupedAllocationPrice(TypedDict, total=False): class PricePriceNewPlanPercentCompositePricePercentConfig(TypedDict, total=False): + """Configuration for percent pricing""" + percent: Required[float] """What percent of the component subtotals to charge""" @@ -637,6 +653,8 @@ class PricePriceNewPlanPercentCompositePrice(TypedDict, total=False): class PricePriceNewPlanEventOutputPriceEventOutputConfig(TypedDict, total=False): + """Configuration for event_output pricing""" + unit_rating_key: Required[str] """The key in the event data to extract the unit rate from.""" diff --git a/src/orb/types/plan_version.py b/src/orb/types/plan_version.py index 42e944ad..ce10f087 100644 --- a/src/orb/types/plan_version.py +++ b/src/orb/types/plan_version.py @@ -29,6 +29,10 @@ class PlanVersion(BaseModel): + """ + The PlanVersion resource represents the prices and adjustments present on a specific version of a plan. + """ + adjustments: List[Adjustment] """Adjustments for this plan. diff --git a/src/orb/types/price_create_params.py b/src/orb/types/price_create_params.py index ff714f42..84385797 100644 --- a/src/orb/types/price_create_params.py +++ b/src/orb/types/price_create_params.py @@ -424,6 +424,8 @@ class NewFloatingBulkWithFiltersPrice(TypedDict, total=False): class NewFloatingBulkWithFiltersPriceBulkWithFiltersConfigFilter(TypedDict, total=False): + """Configuration for a single property filter""" + property_key: Required[str] """Event property key to filter on""" @@ -432,6 +434,8 @@ class NewFloatingBulkWithFiltersPriceBulkWithFiltersConfigFilter(TypedDict, tota class NewFloatingBulkWithFiltersPriceBulkWithFiltersConfigTier(TypedDict, total=False): + """Configuration for a single bulk pricing tier""" + unit_amount: Required[str] """Amount per unit""" @@ -440,6 +444,8 @@ class NewFloatingBulkWithFiltersPriceBulkWithFiltersConfigTier(TypedDict, total= class NewFloatingBulkWithFiltersPriceBulkWithFiltersConfig(TypedDict, total=False): + """Configuration for bulk_with_filters pricing""" + filters: Required[Iterable[NewFloatingBulkWithFiltersPriceBulkWithFiltersConfigFilter]] """Property filters to apply (all must match)""" @@ -675,6 +681,8 @@ class NewFloatingThresholdTotalAmountPrice(TypedDict, total=False): class NewFloatingThresholdTotalAmountPriceThresholdTotalAmountConfigConsumptionTable(TypedDict, total=False): + """Configuration for a single threshold""" + threshold: Required[str] """Quantity threshold""" @@ -683,6 +691,8 @@ class NewFloatingThresholdTotalAmountPriceThresholdTotalAmountConfigConsumptionT class NewFloatingThresholdTotalAmountPriceThresholdTotalAmountConfig(TypedDict, total=False): + """Configuration for threshold_total_amount pricing""" + consumption_table: Required[ Iterable[NewFloatingThresholdTotalAmountPriceThresholdTotalAmountConfigConsumptionTable] ] @@ -773,6 +783,8 @@ class NewFloatingTieredPackagePrice(TypedDict, total=False): class NewFloatingTieredPackagePriceTieredPackageConfigTier(TypedDict, total=False): + """Configuration for a single tier with business logic""" + per_unit: Required[str] """Price per package""" @@ -781,6 +793,8 @@ class NewFloatingTieredPackagePriceTieredPackageConfigTier(TypedDict, total=Fals class NewFloatingTieredPackagePriceTieredPackageConfig(TypedDict, total=False): + """Configuration for tiered_package pricing""" + package_size: Required[str] """Package size""" @@ -871,6 +885,8 @@ class NewFloatingTieredWithMinimumPrice(TypedDict, total=False): class NewFloatingTieredWithMinimumPriceTieredWithMinimumConfigTier(TypedDict, total=False): + """Configuration for a single tier""" + minimum_amount: Required[str] """Minimum amount""" @@ -882,6 +898,8 @@ class NewFloatingTieredWithMinimumPriceTieredWithMinimumConfigTier(TypedDict, to class NewFloatingTieredWithMinimumPriceTieredWithMinimumConfig(TypedDict, total=False): + """Configuration for tiered_with_minimum pricing""" + tiers: Required[Iterable[NewFloatingTieredWithMinimumPriceTieredWithMinimumConfigTier]] """Tiered pricing with a minimum amount dependent on the volume tier. @@ -973,6 +991,8 @@ class NewFloatingGroupedTieredPrice(TypedDict, total=False): class NewFloatingGroupedTieredPriceGroupedTieredConfigTier(TypedDict, total=False): + """Configuration for a single tier""" + tier_lower_bound: Required[str] """Tier lower bound""" @@ -981,6 +1001,8 @@ class NewFloatingGroupedTieredPriceGroupedTieredConfigTier(TypedDict, total=Fals class NewFloatingGroupedTieredPriceGroupedTieredConfig(TypedDict, total=False): + """Configuration for grouped_tiered pricing""" + grouping_key: Required[str] """The billable metric property used to group before tiering""" @@ -1069,6 +1091,8 @@ class NewFloatingTieredPackageWithMinimumPrice(TypedDict, total=False): class NewFloatingTieredPackageWithMinimumPriceTieredPackageWithMinimumConfigTier(TypedDict, total=False): + """Configuration for a single tier""" + minimum_amount: Required[str] """Minimum amount""" @@ -1080,6 +1104,8 @@ class NewFloatingTieredPackageWithMinimumPriceTieredPackageWithMinimumConfigTier class NewFloatingTieredPackageWithMinimumPriceTieredPackageWithMinimumConfig(TypedDict, total=False): + """Configuration for tiered_package_with_minimum pricing""" + package_size: Required[float] """Package size""" @@ -1168,6 +1194,8 @@ class NewFloatingPackageWithAllocationPrice(TypedDict, total=False): class NewFloatingPackageWithAllocationPricePackageWithAllocationConfig(TypedDict, total=False): + """Configuration for package_with_allocation pricing""" + allocation: Required[str] """Usage allocation""" @@ -1256,6 +1284,8 @@ class NewFloatingUnitWithPercentPrice(TypedDict, total=False): class NewFloatingUnitWithPercentPriceUnitWithPercentConfig(TypedDict, total=False): + """Configuration for unit_with_percent pricing""" + percent: Required[str] """What percent, out of 100, of the calculated total to charge""" @@ -1418,6 +1448,8 @@ class NewFloatingTieredWithProrationPrice(TypedDict, total=False): class NewFloatingTieredWithProrationPriceTieredWithProrationConfigTier(TypedDict, total=False): + """Configuration for a single tiered with proration tier""" + tier_lower_bound: Required[str] """Inclusive tier starting value""" @@ -1426,6 +1458,8 @@ class NewFloatingTieredWithProrationPriceTieredWithProrationConfigTier(TypedDict class NewFloatingTieredWithProrationPriceTieredWithProrationConfig(TypedDict, total=False): + """Configuration for tiered_with_proration pricing""" + tiers: Required[Iterable[NewFloatingTieredWithProrationPriceTieredWithProrationConfigTier]] """ Tiers for rating based on total usage quantities into the specified tier with @@ -1511,6 +1545,8 @@ class NewFloatingUnitWithProrationPrice(TypedDict, total=False): class NewFloatingUnitWithProrationPriceUnitWithProrationConfig(TypedDict, total=False): + """Configuration for unit_with_proration pricing""" + unit_amount: Required[str] """Rate per unit of usage""" @@ -1593,6 +1629,8 @@ class NewFloatingGroupedAllocationPrice(TypedDict, total=False): class NewFloatingGroupedAllocationPriceGroupedAllocationConfig(TypedDict, total=False): + """Configuration for grouped_allocation pricing""" + allocation: Required[str] """Usage allocation per group""" @@ -1681,6 +1719,8 @@ class NewFloatingBulkWithProrationPrice(TypedDict, total=False): class NewFloatingBulkWithProrationPriceBulkWithProrationConfigTier(TypedDict, total=False): + """Configuration for a single bulk pricing tier with proration""" + unit_amount: Required[str] """Cost per unit""" @@ -1689,6 +1729,8 @@ class NewFloatingBulkWithProrationPriceBulkWithProrationConfigTier(TypedDict, to class NewFloatingBulkWithProrationPriceBulkWithProrationConfig(TypedDict, total=False): + """Configuration for bulk_with_proration pricing""" + tiers: Required[Iterable[NewFloatingBulkWithProrationPriceBulkWithProrationConfigTier]] """Bulk tiers for rating based on total usage volume""" @@ -1773,6 +1815,8 @@ class NewFloatingGroupedWithProratedMinimumPrice(TypedDict, total=False): class NewFloatingGroupedWithProratedMinimumPriceGroupedWithProratedMinimumConfig(TypedDict, total=False): + """Configuration for grouped_with_prorated_minimum pricing""" + grouping_key: Required[str] """How to determine the groups that should each have a minimum""" @@ -1863,6 +1907,8 @@ class NewFloatingGroupedWithMeteredMinimumPrice(TypedDict, total=False): class NewFloatingGroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfigScalingFactor(TypedDict, total=False): + """Configuration for a scaling factor""" + scaling_factor: Required[str] """Scaling factor""" @@ -1871,6 +1917,8 @@ class NewFloatingGroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfigSc class NewFloatingGroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfigUnitAmount(TypedDict, total=False): + """Configuration for a unit amount""" + pricing_value: Required[str] """Pricing value""" @@ -1879,6 +1927,8 @@ class NewFloatingGroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfigUn class NewFloatingGroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfig(TypedDict, total=False): + """Configuration for grouped_with_metered_minimum pricing""" + grouping_key: Required[str] """Used to partition the usage into groups. @@ -1986,6 +2036,8 @@ class NewFloatingGroupedWithMinMaxThresholdsPrice(TypedDict, total=False): class NewFloatingGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig(TypedDict, total=False): + """Configuration for grouped_with_min_max_thresholds pricing""" + grouping_key: Required[str] """The event property used to group before applying thresholds""" @@ -2077,6 +2129,8 @@ class NewFloatingMatrixWithDisplayNamePrice(TypedDict, total=False): class NewFloatingMatrixWithDisplayNamePriceMatrixWithDisplayNameConfigUnitAmount(TypedDict, total=False): + """Configuration for a unit amount item""" + dimension_value: Required[str] """The dimension value""" @@ -2088,6 +2142,8 @@ class NewFloatingMatrixWithDisplayNamePriceMatrixWithDisplayNameConfigUnitAmount class NewFloatingMatrixWithDisplayNamePriceMatrixWithDisplayNameConfig(TypedDict, total=False): + """Configuration for matrix_with_display_name pricing""" + dimension: Required[str] """Used to determine the unit rate""" @@ -2173,6 +2229,8 @@ class NewFloatingGroupedTieredPackagePrice(TypedDict, total=False): class NewFloatingGroupedTieredPackagePriceGroupedTieredPackageConfigTier(TypedDict, total=False): + """Configuration for a single tier""" + per_unit: Required[str] """Price per package""" @@ -2181,6 +2239,8 @@ class NewFloatingGroupedTieredPackagePriceGroupedTieredPackageConfigTier(TypedDi class NewFloatingGroupedTieredPackagePriceGroupedTieredPackageConfig(TypedDict, total=False): + """Configuration for grouped_tiered_package pricing""" + grouping_key: Required[str] """The event property used to group before tiering""" @@ -2272,6 +2332,8 @@ class NewFloatingMaxGroupTieredPackagePrice(TypedDict, total=False): class NewFloatingMaxGroupTieredPackagePriceMaxGroupTieredPackageConfigTier(TypedDict, total=False): + """Configuration for a single tier""" + tier_lower_bound: Required[str] """Tier lower bound""" @@ -2280,6 +2342,8 @@ class NewFloatingMaxGroupTieredPackagePriceMaxGroupTieredPackageConfigTier(Typed class NewFloatingMaxGroupTieredPackagePriceMaxGroupTieredPackageConfig(TypedDict, total=False): + """Configuration for max_group_tiered_package pricing""" + grouping_key: Required[str] """ The event property used to group before tiering the group with the highest value @@ -2374,6 +2438,8 @@ class NewFloatingScalableMatrixWithUnitPricingPrice(TypedDict, total=False): class NewFloatingScalableMatrixWithUnitPricingPriceScalableMatrixWithUnitPricingConfigMatrixScalingFactor( TypedDict, total=False ): + """Configuration for a single matrix scaling factor""" + first_dimension_value: Required[str] """First dimension value""" @@ -2385,6 +2451,8 @@ class NewFloatingScalableMatrixWithUnitPricingPriceScalableMatrixWithUnitPricing class NewFloatingScalableMatrixWithUnitPricingPriceScalableMatrixWithUnitPricingConfig(TypedDict, total=False): + """Configuration for scalable_matrix_with_unit_pricing pricing""" + first_dimension: Required[str] """Used to determine the unit rate""" @@ -2485,6 +2553,8 @@ class NewFloatingScalableMatrixWithTieredPricingPrice(TypedDict, total=False): class NewFloatingScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfigMatrixScalingFactor( TypedDict, total=False ): + """Configuration for a single matrix scaling factor""" + first_dimension_value: Required[str] """First dimension value""" @@ -2496,6 +2566,8 @@ class NewFloatingScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPri class NewFloatingScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfigTier(TypedDict, total=False): + """Configuration for a single tier entry with business logic""" + tier_lower_bound: Required[str] """Tier lower bound""" @@ -2504,6 +2576,8 @@ class NewFloatingScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPri class NewFloatingScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfig(TypedDict, total=False): + """Configuration for scalable_matrix_with_tiered_pricing pricing""" + first_dimension: Required[str] """Used for the scalable matrix first dimension""" @@ -2599,6 +2673,8 @@ class NewFloatingCumulativeGroupedBulkPrice(TypedDict, total=False): class NewFloatingCumulativeGroupedBulkPriceCumulativeGroupedBulkConfigDimensionValue(TypedDict, total=False): + """Configuration for a dimension value entry""" + grouping_key: Required[str] """Grouping key value""" @@ -2610,6 +2686,8 @@ class NewFloatingCumulativeGroupedBulkPriceCumulativeGroupedBulkConfigDimensionV class NewFloatingCumulativeGroupedBulkPriceCumulativeGroupedBulkConfig(TypedDict, total=False): + """Configuration for cumulative_grouped_bulk pricing""" + dimension_values: Required[Iterable[NewFloatingCumulativeGroupedBulkPriceCumulativeGroupedBulkConfigDimensionValue]] """Each tier lower bound must have the same group of values.""" @@ -2697,6 +2775,8 @@ class NewFloatingCumulativeGroupedAllocationPrice(TypedDict, total=False): class NewFloatingCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig(TypedDict, total=False): + """Configuration for cumulative_grouped_allocation pricing""" + cumulative_allocation: Required[str] """The overall allocation across all groups""" @@ -2788,6 +2868,8 @@ class NewFloatingMinimumCompositePrice(TypedDict, total=False): class NewFloatingMinimumCompositePriceMinimumConfig(TypedDict, total=False): + """Configuration for minimum pricing""" + minimum_amount: Required[str] """The minimum amount to apply""" @@ -2873,6 +2955,8 @@ class NewFloatingPercentCompositePrice(TypedDict, total=False): class NewFloatingPercentCompositePricePercentConfig(TypedDict, total=False): + """Configuration for percent pricing""" + percent: Required[float] """What percent of the component subtotals to charge""" @@ -2955,6 +3039,8 @@ class NewFloatingEventOutputPrice(TypedDict, total=False): class NewFloatingEventOutputPriceEventOutputConfig(TypedDict, total=False): + """Configuration for event_output pricing""" + unit_rating_key: Required[str] """The key in the event data to extract the unit rate from.""" diff --git a/src/orb/types/price_evaluate_multiple_params.py b/src/orb/types/price_evaluate_multiple_params.py index 331a1026..7de46291 100644 --- a/src/orb/types/price_evaluate_multiple_params.py +++ b/src/orb/types/price_evaluate_multiple_params.py @@ -85,6 +85,8 @@ class PriceEvaluateMultipleParams(TypedDict, total=False): class PriceEvaluationPriceNewFloatingBulkWithFiltersPriceBulkWithFiltersConfigFilter(TypedDict, total=False): + """Configuration for a single property filter""" + property_key: Required[str] """Event property key to filter on""" @@ -93,6 +95,8 @@ class PriceEvaluationPriceNewFloatingBulkWithFiltersPriceBulkWithFiltersConfigFi class PriceEvaluationPriceNewFloatingBulkWithFiltersPriceBulkWithFiltersConfigTier(TypedDict, total=False): + """Configuration for a single bulk pricing tier""" + unit_amount: Required[str] """Amount per unit""" @@ -101,6 +105,8 @@ class PriceEvaluationPriceNewFloatingBulkWithFiltersPriceBulkWithFiltersConfigTi class PriceEvaluationPriceNewFloatingBulkWithFiltersPriceBulkWithFiltersConfig(TypedDict, total=False): + """Configuration for bulk_with_filters pricing""" + filters: Required[Iterable[PriceEvaluationPriceNewFloatingBulkWithFiltersPriceBulkWithFiltersConfigFilter]] """Property filters to apply (all must match)""" @@ -188,6 +194,8 @@ class PriceEvaluationPriceNewFloatingBulkWithFiltersPrice(TypedDict, total=False class PriceEvaluationPriceNewFloatingGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig( TypedDict, total=False ): + """Configuration for grouped_with_min_max_thresholds pricing""" + grouping_key: Required[str] """The event property used to group before applying thresholds""" @@ -285,6 +293,8 @@ class PriceEvaluationPriceNewFloatingGroupedWithMinMaxThresholdsPrice(TypedDict, class PriceEvaluationPriceNewFloatingCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig( TypedDict, total=False ): + """Configuration for cumulative_grouped_allocation pricing""" + cumulative_allocation: Required[str] """The overall allocation across all groups""" @@ -380,6 +390,8 @@ class PriceEvaluationPriceNewFloatingCumulativeGroupedAllocationPrice(TypedDict, class PriceEvaluationPriceNewFloatingPercentCompositePricePercentConfig(TypedDict, total=False): + """Configuration for percent pricing""" + percent: Required[float] """What percent of the component subtotals to charge""" @@ -462,6 +474,8 @@ class PriceEvaluationPriceNewFloatingPercentCompositePrice(TypedDict, total=Fals class PriceEvaluationPriceNewFloatingEventOutputPriceEventOutputConfig(TypedDict, total=False): + """Configuration for event_output pricing""" + unit_rating_key: Required[str] """The key in the event data to extract the unit rate from.""" diff --git a/src/orb/types/price_evaluate_preview_events_params.py b/src/orb/types/price_evaluate_preview_events_params.py index a490430a..a82ba3b5 100644 --- a/src/orb/types/price_evaluate_preview_events_params.py +++ b/src/orb/types/price_evaluate_preview_events_params.py @@ -117,6 +117,8 @@ class Event(TypedDict, total=False): class PriceEvaluationPriceNewFloatingBulkWithFiltersPriceBulkWithFiltersConfigFilter(TypedDict, total=False): + """Configuration for a single property filter""" + property_key: Required[str] """Event property key to filter on""" @@ -125,6 +127,8 @@ class PriceEvaluationPriceNewFloatingBulkWithFiltersPriceBulkWithFiltersConfigFi class PriceEvaluationPriceNewFloatingBulkWithFiltersPriceBulkWithFiltersConfigTier(TypedDict, total=False): + """Configuration for a single bulk pricing tier""" + unit_amount: Required[str] """Amount per unit""" @@ -133,6 +137,8 @@ class PriceEvaluationPriceNewFloatingBulkWithFiltersPriceBulkWithFiltersConfigTi class PriceEvaluationPriceNewFloatingBulkWithFiltersPriceBulkWithFiltersConfig(TypedDict, total=False): + """Configuration for bulk_with_filters pricing""" + filters: Required[Iterable[PriceEvaluationPriceNewFloatingBulkWithFiltersPriceBulkWithFiltersConfigFilter]] """Property filters to apply (all must match)""" @@ -220,6 +226,8 @@ class PriceEvaluationPriceNewFloatingBulkWithFiltersPrice(TypedDict, total=False class PriceEvaluationPriceNewFloatingGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig( TypedDict, total=False ): + """Configuration for grouped_with_min_max_thresholds pricing""" + grouping_key: Required[str] """The event property used to group before applying thresholds""" @@ -317,6 +325,8 @@ class PriceEvaluationPriceNewFloatingGroupedWithMinMaxThresholdsPrice(TypedDict, class PriceEvaluationPriceNewFloatingCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig( TypedDict, total=False ): + """Configuration for cumulative_grouped_allocation pricing""" + cumulative_allocation: Required[str] """The overall allocation across all groups""" @@ -412,6 +422,8 @@ class PriceEvaluationPriceNewFloatingCumulativeGroupedAllocationPrice(TypedDict, class PriceEvaluationPriceNewFloatingPercentCompositePricePercentConfig(TypedDict, total=False): + """Configuration for percent pricing""" + percent: Required[float] """What percent of the component subtotals to charge""" @@ -494,6 +506,8 @@ class PriceEvaluationPriceNewFloatingPercentCompositePrice(TypedDict, total=Fals class PriceEvaluationPriceNewFloatingEventOutputPriceEventOutputConfig(TypedDict, total=False): + """Configuration for event_output pricing""" + unit_rating_key: Required[str] """The key in the event data to extract the unit rate from.""" diff --git a/src/orb/types/shared/bulk_config.py b/src/orb/types/shared/bulk_config.py index cc95e5c5..1bba5545 100644 --- a/src/orb/types/shared/bulk_config.py +++ b/src/orb/types/shared/bulk_config.py @@ -9,5 +9,7 @@ class BulkConfig(BaseModel): + """Configuration for bulk pricing""" + tiers: List[BulkTier] """Bulk tiers for rating based on total usage volume""" diff --git a/src/orb/types/shared/bulk_tier.py b/src/orb/types/shared/bulk_tier.py index 993a07e9..bd514c29 100644 --- a/src/orb/types/shared/bulk_tier.py +++ b/src/orb/types/shared/bulk_tier.py @@ -8,6 +8,8 @@ class BulkTier(BaseModel): + """Configuration for a single bulk pricing tier""" + unit_amount: str """Amount per unit""" diff --git a/src/orb/types/shared/credit_note.py b/src/orb/types/shared/credit_note.py index 4c7e6f23..b728b6a8 100644 --- a/src/orb/types/shared/credit_note.py +++ b/src/orb/types/shared/credit_note.py @@ -74,6 +74,8 @@ class MaximumAmountAdjustmentAppliesToPrice(BaseModel): class MaximumAmountAdjustment(BaseModel): + """The maximum amount applied on the original invoice""" + amount_applied: str discount_type: Literal["percentage"] @@ -104,6 +106,11 @@ class Discount(BaseModel): class CreditNote(BaseModel): + """ + The [Credit Note](/invoicing/credit-notes) resource represents a credit that has been applied to a + particular invoice. + """ + id: str """The Orb id of this credit note.""" diff --git a/src/orb/types/shared/customer_tax_id.py b/src/orb/types/shared/customer_tax_id.py index 916e27d7..88289de5 100644 --- a/src/orb/types/shared/customer_tax_id.py +++ b/src/orb/types/shared/customer_tax_id.py @@ -8,6 +8,154 @@ class CustomerTaxID(BaseModel): + """ + Tax IDs are commonly required to be displayed on customer invoices, which are added to the headers of invoices. + + + ### Supported Tax ID Countries and Types + + + | Country | Type | Description | + |---------|------|-------------| + | Albania | `al_tin` | Albania Tax Identification Number | + | Andorra | `ad_nrt` | Andorran NRT Number | + | Angola | `ao_tin` | Angola Tax Identification Number | + | Argentina | `ar_cuit` | Argentinian Tax ID Number | + | Armenia | `am_tin` | Armenia Tax Identification Number | + | Aruba | `aw_tin` | Aruba Tax Identification Number | + | Australia | `au_abn` | Australian Business Number (AU ABN) | + | Australia | `au_arn` | Australian Taxation Office Reference Number | + | Austria | `eu_vat` | European VAT Number | + | Azerbaijan | `az_tin` | Azerbaijan Tax Identification Number | + | Bahamas | `bs_tin` | Bahamas Tax Identification Number | + | Bahrain | `bh_vat` | Bahraini VAT Number | + | Bangladesh | `bd_bin` | Bangladesh Business Identification Number | + | Barbados | `bb_tin` | Barbados Tax Identification Number | + | Belarus | `by_tin` | Belarus TIN Number | + | Belgium | `eu_vat` | European VAT Number | + | Benin | `bj_ifu` | Benin Tax Identification Number (Identifiant Fiscal Unique) | + | Bolivia | `bo_tin` | Bolivian Tax ID | + | Bosnia and Herzegovina | `ba_tin` | Bosnia and Herzegovina Tax Identification Number | + | Brazil | `br_cnpj` | Brazilian CNPJ Number | + | Brazil | `br_cpf` | Brazilian CPF Number | + | Bulgaria | `bg_uic` | Bulgaria Unified Identification Code | + | Bulgaria | `eu_vat` | European VAT Number | + | Burkina Faso | `bf_ifu` | Burkina Faso Tax Identification Number (Numéro d'Identifiant Fiscal Unique) | + | Cambodia | `kh_tin` | Cambodia Tax Identification Number | + | Cameroon | `cm_niu` | Cameroon Tax Identification Number (Numéro d'Identifiant fiscal Unique) | + | Canada | `ca_bn` | Canadian BN | + | Canada | `ca_gst_hst` | Canadian GST/HST Number | + | Canada | `ca_pst_bc` | Canadian PST Number (British Columbia) | + | Canada | `ca_pst_mb` | Canadian PST Number (Manitoba) | + | Canada | `ca_pst_sk` | Canadian PST Number (Saskatchewan) | + | Canada | `ca_qst` | Canadian QST Number (Québec) | + | Cape Verde | `cv_nif` | Cape Verde Tax Identification Number (Número de Identificação Fiscal) | + | Chile | `cl_tin` | Chilean TIN | + | China | `cn_tin` | Chinese Tax ID | + | Colombia | `co_nit` | Colombian NIT Number | + | Congo-Kinshasa | `cd_nif` | Congo (DR) Tax Identification Number (Número de Identificação Fiscal) | + | Costa Rica | `cr_tin` | Costa Rican Tax ID | + | Croatia | `eu_vat` | European VAT Number | + | Croatia | `hr_oib` | Croatian Personal Identification Number (OIB) | + | Cyprus | `eu_vat` | European VAT Number | + | Czech Republic | `eu_vat` | European VAT Number | + | Denmark | `eu_vat` | European VAT Number | + | Dominican Republic | `do_rcn` | Dominican RCN Number | + | Ecuador | `ec_ruc` | Ecuadorian RUC Number | + | Egypt | `eg_tin` | Egyptian Tax Identification Number | + | El Salvador | `sv_nit` | El Salvadorian NIT Number | + | Estonia | `eu_vat` | European VAT Number | + | Ethiopia | `et_tin` | Ethiopia Tax Identification Number | + | European Union | `eu_oss_vat` | European One Stop Shop VAT Number for non-Union scheme | + | Finland | `eu_vat` | European VAT Number | + | France | `eu_vat` | European VAT Number | + | Georgia | `ge_vat` | Georgian VAT | + | Germany | `de_stn` | German Tax Number (Steuernummer) | + | Germany | `eu_vat` | European VAT Number | + | Greece | `eu_vat` | European VAT Number | + | Guinea | `gn_nif` | Guinea Tax Identification Number (Número de Identificação Fiscal) | + | Hong Kong | `hk_br` | Hong Kong BR Number | + | Hungary | `eu_vat` | European VAT Number | + | Hungary | `hu_tin` | Hungary Tax Number (adószám) | + | Iceland | `is_vat` | Icelandic VAT | + | India | `in_gst` | Indian GST Number | + | Indonesia | `id_npwp` | Indonesian NPWP Number | + | Ireland | `eu_vat` | European VAT Number | + | Israel | `il_vat` | Israel VAT | + | Italy | `eu_vat` | European VAT Number | + | Japan | `jp_cn` | Japanese Corporate Number (*Hōjin Bangō*) | + | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (*Tōroku Kokugai Jigyōsha no Tōroku Bangō*) | + | Japan | `jp_trn` | Japanese Tax Registration Number (*Tōroku Bangō*) | + | Kazakhstan | `kz_bin` | Kazakhstani Business Identification Number | + | Kenya | `ke_pin` | Kenya Revenue Authority Personal Identification Number | + | Kyrgyzstan | `kg_tin` | Kyrgyzstan Tax Identification Number | + | Laos | `la_tin` | Laos Tax Identification Number | + | Latvia | `eu_vat` | European VAT Number | + | Liechtenstein | `li_uid` | Liechtensteinian UID Number | + | Liechtenstein | `li_vat` | Liechtenstein VAT Number | + | Lithuania | `eu_vat` | European VAT Number | + | Luxembourg | `eu_vat` | European VAT Number | + | Malaysia | `my_frp` | Malaysian FRP Number | + | Malaysia | `my_itn` | Malaysian ITN | + | Malaysia | `my_sst` | Malaysian SST Number | + | Malta | `eu_vat` | European VAT Number | + | Mauritania | `mr_nif` | Mauritania Tax Identification Number (Número de Identificação Fiscal) | + | Mexico | `mx_rfc` | Mexican RFC Number | + | Moldova | `md_vat` | Moldova VAT Number | + | Montenegro | `me_pib` | Montenegro PIB Number | + | Morocco | `ma_vat` | Morocco VAT Number | + | Nepal | `np_pan` | Nepal PAN Number | + | Netherlands | `eu_vat` | European VAT Number | + | New Zealand | `nz_gst` | New Zealand GST Number | + | Nigeria | `ng_tin` | Nigerian Tax Identification Number | + | North Macedonia | `mk_vat` | North Macedonia VAT Number | + | Northern Ireland | `eu_vat` | Northern Ireland VAT Number | + | Norway | `no_vat` | Norwegian VAT Number | + | Norway | `no_voec` | Norwegian VAT on e-commerce Number | + | Oman | `om_vat` | Omani VAT Number | + | Peru | `pe_ruc` | Peruvian RUC Number | + | Philippines | `ph_tin` | Philippines Tax Identification Number | + | Poland | `eu_vat` | European VAT Number | + | Portugal | `eu_vat` | European VAT Number | + | Romania | `eu_vat` | European VAT Number | + | Romania | `ro_tin` | Romanian Tax ID Number | + | Russia | `ru_inn` | Russian INN | + | Russia | `ru_kpp` | Russian KPP | + | Saudi Arabia | `sa_vat` | Saudi Arabia VAT | + | Senegal | `sn_ninea` | Senegal NINEA Number | + | Serbia | `rs_pib` | Serbian PIB Number | + | Singapore | `sg_gst` | Singaporean GST | + | Singapore | `sg_uen` | Singaporean UEN | + | Slovakia | `eu_vat` | European VAT Number | + | Slovenia | `eu_vat` | European VAT Number | + | Slovenia | `si_tin` | Slovenia Tax Number (davčna številka) | + | South Africa | `za_vat` | South African VAT Number | + | South Korea | `kr_brn` | Korean BRN | + | Spain | `es_cif` | Spanish NIF Number (previously Spanish CIF Number) | + | Spain | `eu_vat` | European VAT Number | + | Suriname | `sr_fin` | Suriname FIN Number | + | Sweden | `eu_vat` | European VAT Number | + | Switzerland | `ch_uid` | Switzerland UID Number | + | Switzerland | `ch_vat` | Switzerland VAT Number | + | Taiwan | `tw_vat` | Taiwanese VAT | + | Tajikistan | `tj_tin` | Tajikistan Tax Identification Number | + | Tanzania | `tz_vat` | Tanzania VAT Number | + | Thailand | `th_vat` | Thai VAT | + | Turkey | `tr_tin` | Turkish Tax Identification Number | + | Uganda | `ug_tin` | Uganda Tax Identification Number | + | Ukraine | `ua_vat` | Ukrainian VAT | + | United Arab Emirates | `ae_trn` | United Arab Emirates TRN | + | United Kingdom | `gb_vat` | United Kingdom VAT Number | + | United States | `us_ein` | United States EIN | + | Uruguay | `uy_ruc` | Uruguayan RUC Number | + | Uzbekistan | `uz_tin` | Uzbekistan TIN Number | + | Uzbekistan | `uz_vat` | Uzbekistan VAT Number | + | Venezuela | `ve_rif` | Venezuelan RIF Number | + | Vietnam | `vn_tin` | Vietnamese Tax ID Number | + | Zambia | `zm_tin` | Zambia Tax Identification Number | + | Zimbabwe | `zw_tin` | Zimbabwe Tax Identification Number | + """ + country: Literal[ "AD", "AE", diff --git a/src/orb/types/shared/invoice.py b/src/orb/types/shared/invoice.py index 958244d6..dd4f6599 100644 --- a/src/orb/types/shared/invoice.py +++ b/src/orb/types/shared/invoice.py @@ -258,6 +258,13 @@ class PaymentAttempt(BaseModel): class Invoice(BaseModel): + """ + An [`Invoice`](/core-concepts#invoice) is a fundamental billing entity, representing the request for payment for + a single subscription. This includes a set of line items, which correspond to prices in the subscription's plan and + can represent fixed recurring fees or usage-based fees. They are generated at the end of a billing period, or as + the result of an action, such as a cancellation. + """ + id: str amount_due: str diff --git a/src/orb/types/shared/item_slim.py b/src/orb/types/shared/item_slim.py index 89976334..7d8cce68 100644 --- a/src/orb/types/shared/item_slim.py +++ b/src/orb/types/shared/item_slim.py @@ -6,6 +6,10 @@ class ItemSlim(BaseModel): + """ + A minimal representation of an Item containing only the essential identifying information. + """ + id: str """The Orb-assigned unique identifier for the item.""" diff --git a/src/orb/types/shared/matrix_config.py b/src/orb/types/shared/matrix_config.py index 718ab94d..4cafc220 100644 --- a/src/orb/types/shared/matrix_config.py +++ b/src/orb/types/shared/matrix_config.py @@ -9,6 +9,8 @@ class MatrixConfig(BaseModel): + """Configuration for matrix pricing""" + default_unit_amount: str """Default per unit rate for any usage not bucketed into a specified matrix_value""" diff --git a/src/orb/types/shared/matrix_value.py b/src/orb/types/shared/matrix_value.py index 1f808898..c905043f 100644 --- a/src/orb/types/shared/matrix_value.py +++ b/src/orb/types/shared/matrix_value.py @@ -8,6 +8,8 @@ class MatrixValue(BaseModel): + """Configuration for a single matrix value""" + dimension_values: List[Optional[str]] """One or two matrix keys to filter usage to this Matrix value by""" diff --git a/src/orb/types/shared/matrix_with_allocation_config.py b/src/orb/types/shared/matrix_with_allocation_config.py index bc935fe9..e632f982 100644 --- a/src/orb/types/shared/matrix_with_allocation_config.py +++ b/src/orb/types/shared/matrix_with_allocation_config.py @@ -8,6 +8,8 @@ class MatrixValue(BaseModel): + """Configuration for a single matrix value""" + dimension_values: List[Optional[str]] """One or two matrix keys to filter usage to this Matrix value by. @@ -20,6 +22,8 @@ class MatrixValue(BaseModel): class MatrixWithAllocationConfig(BaseModel): + """Configuration for matrix pricing with usage allocation""" + allocation: str """Usage allocation""" diff --git a/src/orb/types/shared/new_allocation_price.py b/src/orb/types/shared/new_allocation_price.py index c2234fb6..7fd7c397 100644 --- a/src/orb/types/shared/new_allocation_price.py +++ b/src/orb/types/shared/new_allocation_price.py @@ -10,6 +10,8 @@ class Filter(BaseModel): + """A PriceFilter that only allows item_id field for block filters.""" + field: Literal["item_id"] """The property of the price the block applies to. Only item_id is supported.""" diff --git a/src/orb/types/shared/new_floating_bulk_with_proration_price.py b/src/orb/types/shared/new_floating_bulk_with_proration_price.py index 39253426..163d902c 100644 --- a/src/orb/types/shared/new_floating_bulk_with_proration_price.py +++ b/src/orb/types/shared/new_floating_bulk_with_proration_price.py @@ -21,6 +21,8 @@ class BulkWithProrationConfigTier(BaseModel): + """Configuration for a single bulk pricing tier with proration""" + unit_amount: str """Cost per unit""" @@ -29,6 +31,8 @@ class BulkWithProrationConfigTier(BaseModel): class BulkWithProrationConfig(BaseModel): + """Configuration for bulk_with_proration pricing""" + tiers: List[BulkWithProrationConfigTier] """Bulk tiers for rating based on total usage volume""" diff --git a/src/orb/types/shared/new_floating_cumulative_grouped_bulk_price.py b/src/orb/types/shared/new_floating_cumulative_grouped_bulk_price.py index 21bdd4f6..8f834f1e 100644 --- a/src/orb/types/shared/new_floating_cumulative_grouped_bulk_price.py +++ b/src/orb/types/shared/new_floating_cumulative_grouped_bulk_price.py @@ -21,6 +21,8 @@ class CumulativeGroupedBulkConfigDimensionValue(BaseModel): + """Configuration for a dimension value entry""" + grouping_key: str """Grouping key value""" @@ -32,6 +34,8 @@ class CumulativeGroupedBulkConfigDimensionValue(BaseModel): class CumulativeGroupedBulkConfig(BaseModel): + """Configuration for cumulative_grouped_bulk pricing""" + dimension_values: List[CumulativeGroupedBulkConfigDimensionValue] """Each tier lower bound must have the same group of values.""" diff --git a/src/orb/types/shared/new_floating_grouped_allocation_price.py b/src/orb/types/shared/new_floating_grouped_allocation_price.py index 66b0ab81..c9b7fd0f 100644 --- a/src/orb/types/shared/new_floating_grouped_allocation_price.py +++ b/src/orb/types/shared/new_floating_grouped_allocation_price.py @@ -16,6 +16,8 @@ class GroupedAllocationConfig(BaseModel): + """Configuration for grouped_allocation pricing""" + allocation: str """Usage allocation per group""" diff --git a/src/orb/types/shared/new_floating_grouped_tiered_package_price.py b/src/orb/types/shared/new_floating_grouped_tiered_package_price.py index 559fd9e3..93ad98c2 100644 --- a/src/orb/types/shared/new_floating_grouped_tiered_package_price.py +++ b/src/orb/types/shared/new_floating_grouped_tiered_package_price.py @@ -21,6 +21,8 @@ class GroupedTieredPackageConfigTier(BaseModel): + """Configuration for a single tier""" + per_unit: str """Price per package""" @@ -29,6 +31,8 @@ class GroupedTieredPackageConfigTier(BaseModel): class GroupedTieredPackageConfig(BaseModel): + """Configuration for grouped_tiered_package pricing""" + grouping_key: str """The event property used to group before tiering""" diff --git a/src/orb/types/shared/new_floating_grouped_tiered_price.py b/src/orb/types/shared/new_floating_grouped_tiered_price.py index 90821412..a2b2928c 100644 --- a/src/orb/types/shared/new_floating_grouped_tiered_price.py +++ b/src/orb/types/shared/new_floating_grouped_tiered_price.py @@ -16,6 +16,8 @@ class GroupedTieredConfigTier(BaseModel): + """Configuration for a single tier""" + tier_lower_bound: str """Tier lower bound""" @@ -24,6 +26,8 @@ class GroupedTieredConfigTier(BaseModel): class GroupedTieredConfig(BaseModel): + """Configuration for grouped_tiered pricing""" + grouping_key: str """The billable metric property used to group before tiering""" diff --git a/src/orb/types/shared/new_floating_grouped_with_metered_minimum_price.py b/src/orb/types/shared/new_floating_grouped_with_metered_minimum_price.py index da6d97d2..5ddc77de 100644 --- a/src/orb/types/shared/new_floating_grouped_with_metered_minimum_price.py +++ b/src/orb/types/shared/new_floating_grouped_with_metered_minimum_price.py @@ -22,6 +22,8 @@ class GroupedWithMeteredMinimumConfigScalingFactor(BaseModel): + """Configuration for a scaling factor""" + scaling_factor: str """Scaling factor""" @@ -30,6 +32,8 @@ class GroupedWithMeteredMinimumConfigScalingFactor(BaseModel): class GroupedWithMeteredMinimumConfigUnitAmount(BaseModel): + """Configuration for a unit amount""" + pricing_value: str """Pricing value""" @@ -38,6 +42,8 @@ class GroupedWithMeteredMinimumConfigUnitAmount(BaseModel): class GroupedWithMeteredMinimumConfig(BaseModel): + """Configuration for grouped_with_metered_minimum pricing""" + grouping_key: str """Used to partition the usage into groups. diff --git a/src/orb/types/shared/new_floating_grouped_with_prorated_minimum_price.py b/src/orb/types/shared/new_floating_grouped_with_prorated_minimum_price.py index e3705b23..9fe63313 100644 --- a/src/orb/types/shared/new_floating_grouped_with_prorated_minimum_price.py +++ b/src/orb/types/shared/new_floating_grouped_with_prorated_minimum_price.py @@ -16,6 +16,8 @@ class GroupedWithProratedMinimumConfig(BaseModel): + """Configuration for grouped_with_prorated_minimum pricing""" + grouping_key: str """How to determine the groups that should each have a minimum""" diff --git a/src/orb/types/shared/new_floating_matrix_with_display_name_price.py b/src/orb/types/shared/new_floating_matrix_with_display_name_price.py index 2ccdbccc..807b1a3a 100644 --- a/src/orb/types/shared/new_floating_matrix_with_display_name_price.py +++ b/src/orb/types/shared/new_floating_matrix_with_display_name_price.py @@ -21,6 +21,8 @@ class MatrixWithDisplayNameConfigUnitAmount(BaseModel): + """Configuration for a unit amount item""" + dimension_value: str """The dimension value""" @@ -32,6 +34,8 @@ class MatrixWithDisplayNameConfigUnitAmount(BaseModel): class MatrixWithDisplayNameConfig(BaseModel): + """Configuration for matrix_with_display_name pricing""" + dimension: str """Used to determine the unit rate""" diff --git a/src/orb/types/shared/new_floating_max_group_tiered_package_price.py b/src/orb/types/shared/new_floating_max_group_tiered_package_price.py index abf19951..eef1239a 100644 --- a/src/orb/types/shared/new_floating_max_group_tiered_package_price.py +++ b/src/orb/types/shared/new_floating_max_group_tiered_package_price.py @@ -21,6 +21,8 @@ class MaxGroupTieredPackageConfigTier(BaseModel): + """Configuration for a single tier""" + tier_lower_bound: str """Tier lower bound""" @@ -29,6 +31,8 @@ class MaxGroupTieredPackageConfigTier(BaseModel): class MaxGroupTieredPackageConfig(BaseModel): + """Configuration for max_group_tiered_package pricing""" + grouping_key: str """ The event property used to group before tiering the group with the highest value diff --git a/src/orb/types/shared/new_floating_minimum_composite_price.py b/src/orb/types/shared/new_floating_minimum_composite_price.py index b8d1db20..6f11f920 100644 --- a/src/orb/types/shared/new_floating_minimum_composite_price.py +++ b/src/orb/types/shared/new_floating_minimum_composite_price.py @@ -16,6 +16,8 @@ class MinimumConfig(BaseModel): + """Configuration for minimum pricing""" + minimum_amount: str """The minimum amount to apply""" diff --git a/src/orb/types/shared/new_floating_package_with_allocation_price.py b/src/orb/types/shared/new_floating_package_with_allocation_price.py index a0aadb96..a57f29fd 100644 --- a/src/orb/types/shared/new_floating_package_with_allocation_price.py +++ b/src/orb/types/shared/new_floating_package_with_allocation_price.py @@ -16,6 +16,8 @@ class PackageWithAllocationConfig(BaseModel): + """Configuration for package_with_allocation pricing""" + allocation: str """Usage allocation""" diff --git a/src/orb/types/shared/new_floating_scalable_matrix_with_tiered_pricing_price.py b/src/orb/types/shared/new_floating_scalable_matrix_with_tiered_pricing_price.py index 6278f0b6..9120aaa3 100644 --- a/src/orb/types/shared/new_floating_scalable_matrix_with_tiered_pricing_price.py +++ b/src/orb/types/shared/new_floating_scalable_matrix_with_tiered_pricing_price.py @@ -22,6 +22,8 @@ class ScalableMatrixWithTieredPricingConfigMatrixScalingFactor(BaseModel): + """Configuration for a single matrix scaling factor""" + first_dimension_value: str """First dimension value""" @@ -33,6 +35,8 @@ class ScalableMatrixWithTieredPricingConfigMatrixScalingFactor(BaseModel): class ScalableMatrixWithTieredPricingConfigTier(BaseModel): + """Configuration for a single tier entry with business logic""" + tier_lower_bound: str """Tier lower bound""" @@ -41,6 +45,8 @@ class ScalableMatrixWithTieredPricingConfigTier(BaseModel): class ScalableMatrixWithTieredPricingConfig(BaseModel): + """Configuration for scalable_matrix_with_tiered_pricing pricing""" + first_dimension: str """Used for the scalable matrix first dimension""" diff --git a/src/orb/types/shared/new_floating_scalable_matrix_with_unit_pricing_price.py b/src/orb/types/shared/new_floating_scalable_matrix_with_unit_pricing_price.py index 37e6d755..a77b4db9 100644 --- a/src/orb/types/shared/new_floating_scalable_matrix_with_unit_pricing_price.py +++ b/src/orb/types/shared/new_floating_scalable_matrix_with_unit_pricing_price.py @@ -21,6 +21,8 @@ class ScalableMatrixWithUnitPricingConfigMatrixScalingFactor(BaseModel): + """Configuration for a single matrix scaling factor""" + first_dimension_value: str """First dimension value""" @@ -32,6 +34,8 @@ class ScalableMatrixWithUnitPricingConfigMatrixScalingFactor(BaseModel): class ScalableMatrixWithUnitPricingConfig(BaseModel): + """Configuration for scalable_matrix_with_unit_pricing pricing""" + first_dimension: str """Used to determine the unit rate""" diff --git a/src/orb/types/shared/new_floating_threshold_total_amount_price.py b/src/orb/types/shared/new_floating_threshold_total_amount_price.py index 66ed6c64..d435b771 100644 --- a/src/orb/types/shared/new_floating_threshold_total_amount_price.py +++ b/src/orb/types/shared/new_floating_threshold_total_amount_price.py @@ -21,6 +21,8 @@ class ThresholdTotalAmountConfigConsumptionTable(BaseModel): + """Configuration for a single threshold""" + threshold: str """Quantity threshold""" @@ -29,6 +31,8 @@ class ThresholdTotalAmountConfigConsumptionTable(BaseModel): class ThresholdTotalAmountConfig(BaseModel): + """Configuration for threshold_total_amount pricing""" + consumption_table: List[ThresholdTotalAmountConfigConsumptionTable] """ When the quantity consumed passes a provided threshold, the configured total diff --git a/src/orb/types/shared/new_floating_tiered_package_price.py b/src/orb/types/shared/new_floating_tiered_package_price.py index 1a216ccb..2e0762a1 100644 --- a/src/orb/types/shared/new_floating_tiered_package_price.py +++ b/src/orb/types/shared/new_floating_tiered_package_price.py @@ -16,6 +16,8 @@ class TieredPackageConfigTier(BaseModel): + """Configuration for a single tier with business logic""" + per_unit: str """Price per package""" @@ -24,6 +26,8 @@ class TieredPackageConfigTier(BaseModel): class TieredPackageConfig(BaseModel): + """Configuration for tiered_package pricing""" + package_size: str """Package size""" diff --git a/src/orb/types/shared/new_floating_tiered_package_with_minimum_price.py b/src/orb/types/shared/new_floating_tiered_package_with_minimum_price.py index 03412314..4bc035cc 100644 --- a/src/orb/types/shared/new_floating_tiered_package_with_minimum_price.py +++ b/src/orb/types/shared/new_floating_tiered_package_with_minimum_price.py @@ -21,6 +21,8 @@ class TieredPackageWithMinimumConfigTier(BaseModel): + """Configuration for a single tier""" + minimum_amount: str """Minimum amount""" @@ -32,6 +34,8 @@ class TieredPackageWithMinimumConfigTier(BaseModel): class TieredPackageWithMinimumConfig(BaseModel): + """Configuration for tiered_package_with_minimum pricing""" + package_size: float """Package size""" diff --git a/src/orb/types/shared/new_floating_tiered_with_minimum_price.py b/src/orb/types/shared/new_floating_tiered_with_minimum_price.py index 5be0fdb0..0d057bac 100644 --- a/src/orb/types/shared/new_floating_tiered_with_minimum_price.py +++ b/src/orb/types/shared/new_floating_tiered_with_minimum_price.py @@ -21,6 +21,8 @@ class TieredWithMinimumConfigTier(BaseModel): + """Configuration for a single tier""" + minimum_amount: str """Minimum amount""" @@ -32,6 +34,8 @@ class TieredWithMinimumConfigTier(BaseModel): class TieredWithMinimumConfig(BaseModel): + """Configuration for tiered_with_minimum pricing""" + tiers: List[TieredWithMinimumConfigTier] """Tiered pricing with a minimum amount dependent on the volume tier. diff --git a/src/orb/types/shared/new_floating_tiered_with_proration_price.py b/src/orb/types/shared/new_floating_tiered_with_proration_price.py index 7122a96c..3703d8ea 100644 --- a/src/orb/types/shared/new_floating_tiered_with_proration_price.py +++ b/src/orb/types/shared/new_floating_tiered_with_proration_price.py @@ -21,6 +21,8 @@ class TieredWithProrationConfigTier(BaseModel): + """Configuration for a single tiered with proration tier""" + tier_lower_bound: str """Inclusive tier starting value""" @@ -29,6 +31,8 @@ class TieredWithProrationConfigTier(BaseModel): class TieredWithProrationConfig(BaseModel): + """Configuration for tiered_with_proration pricing""" + tiers: List[TieredWithProrationConfigTier] """ Tiers for rating based on total usage quantities into the specified tier with diff --git a/src/orb/types/shared/new_floating_unit_with_percent_price.py b/src/orb/types/shared/new_floating_unit_with_percent_price.py index 1d00c9c7..09b03b45 100644 --- a/src/orb/types/shared/new_floating_unit_with_percent_price.py +++ b/src/orb/types/shared/new_floating_unit_with_percent_price.py @@ -16,6 +16,8 @@ class UnitWithPercentConfig(BaseModel): + """Configuration for unit_with_percent pricing""" + percent: str """What percent, out of 100, of the calculated total to charge""" diff --git a/src/orb/types/shared/new_floating_unit_with_proration_price.py b/src/orb/types/shared/new_floating_unit_with_proration_price.py index ced5474d..a4dee285 100644 --- a/src/orb/types/shared/new_floating_unit_with_proration_price.py +++ b/src/orb/types/shared/new_floating_unit_with_proration_price.py @@ -16,6 +16,8 @@ class UnitWithProrationConfig(BaseModel): + """Configuration for unit_with_proration pricing""" + unit_amount: str """Rate per unit of usage""" diff --git a/src/orb/types/shared/new_plan_bulk_with_proration_price.py b/src/orb/types/shared/new_plan_bulk_with_proration_price.py index 67d53efa..3ff0b7a4 100644 --- a/src/orb/types/shared/new_plan_bulk_with_proration_price.py +++ b/src/orb/types/shared/new_plan_bulk_with_proration_price.py @@ -21,6 +21,8 @@ class BulkWithProrationConfigTier(BaseModel): + """Configuration for a single bulk pricing tier with proration""" + unit_amount: str """Cost per unit""" @@ -29,6 +31,8 @@ class BulkWithProrationConfigTier(BaseModel): class BulkWithProrationConfig(BaseModel): + """Configuration for bulk_with_proration pricing""" + tiers: List[BulkWithProrationConfigTier] """Bulk tiers for rating based on total usage volume""" diff --git a/src/orb/types/shared/new_plan_cumulative_grouped_bulk_price.py b/src/orb/types/shared/new_plan_cumulative_grouped_bulk_price.py index 0a0903f0..8c40b7c8 100644 --- a/src/orb/types/shared/new_plan_cumulative_grouped_bulk_price.py +++ b/src/orb/types/shared/new_plan_cumulative_grouped_bulk_price.py @@ -21,6 +21,8 @@ class CumulativeGroupedBulkConfigDimensionValue(BaseModel): + """Configuration for a dimension value entry""" + grouping_key: str """Grouping key value""" @@ -32,6 +34,8 @@ class CumulativeGroupedBulkConfigDimensionValue(BaseModel): class CumulativeGroupedBulkConfig(BaseModel): + """Configuration for cumulative_grouped_bulk pricing""" + dimension_values: List[CumulativeGroupedBulkConfigDimensionValue] """Each tier lower bound must have the same group of values.""" diff --git a/src/orb/types/shared/new_plan_grouped_allocation_price.py b/src/orb/types/shared/new_plan_grouped_allocation_price.py index 9dab4cd9..333ac5eb 100644 --- a/src/orb/types/shared/new_plan_grouped_allocation_price.py +++ b/src/orb/types/shared/new_plan_grouped_allocation_price.py @@ -16,6 +16,8 @@ class GroupedAllocationConfig(BaseModel): + """Configuration for grouped_allocation pricing""" + allocation: str """Usage allocation per group""" diff --git a/src/orb/types/shared/new_plan_grouped_tiered_package_price.py b/src/orb/types/shared/new_plan_grouped_tiered_package_price.py index 73b62d2d..465c5d8f 100644 --- a/src/orb/types/shared/new_plan_grouped_tiered_package_price.py +++ b/src/orb/types/shared/new_plan_grouped_tiered_package_price.py @@ -21,6 +21,8 @@ class GroupedTieredPackageConfigTier(BaseModel): + """Configuration for a single tier""" + per_unit: str """Price per package""" @@ -29,6 +31,8 @@ class GroupedTieredPackageConfigTier(BaseModel): class GroupedTieredPackageConfig(BaseModel): + """Configuration for grouped_tiered_package pricing""" + grouping_key: str """The event property used to group before tiering""" diff --git a/src/orb/types/shared/new_plan_grouped_tiered_price.py b/src/orb/types/shared/new_plan_grouped_tiered_price.py index 43d4be8d..80f1231c 100644 --- a/src/orb/types/shared/new_plan_grouped_tiered_price.py +++ b/src/orb/types/shared/new_plan_grouped_tiered_price.py @@ -16,6 +16,8 @@ class GroupedTieredConfigTier(BaseModel): + """Configuration for a single tier""" + tier_lower_bound: str """Tier lower bound""" @@ -24,6 +26,8 @@ class GroupedTieredConfigTier(BaseModel): class GroupedTieredConfig(BaseModel): + """Configuration for grouped_tiered pricing""" + grouping_key: str """The billable metric property used to group before tiering""" diff --git a/src/orb/types/shared/new_plan_grouped_with_metered_minimum_price.py b/src/orb/types/shared/new_plan_grouped_with_metered_minimum_price.py index a668c08a..1fcb439b 100644 --- a/src/orb/types/shared/new_plan_grouped_with_metered_minimum_price.py +++ b/src/orb/types/shared/new_plan_grouped_with_metered_minimum_price.py @@ -22,6 +22,8 @@ class GroupedWithMeteredMinimumConfigScalingFactor(BaseModel): + """Configuration for a scaling factor""" + scaling_factor: str """Scaling factor""" @@ -30,6 +32,8 @@ class GroupedWithMeteredMinimumConfigScalingFactor(BaseModel): class GroupedWithMeteredMinimumConfigUnitAmount(BaseModel): + """Configuration for a unit amount""" + pricing_value: str """Pricing value""" @@ -38,6 +42,8 @@ class GroupedWithMeteredMinimumConfigUnitAmount(BaseModel): class GroupedWithMeteredMinimumConfig(BaseModel): + """Configuration for grouped_with_metered_minimum pricing""" + grouping_key: str """Used to partition the usage into groups. diff --git a/src/orb/types/shared/new_plan_grouped_with_prorated_minimum_price.py b/src/orb/types/shared/new_plan_grouped_with_prorated_minimum_price.py index 8a241807..1f426c39 100644 --- a/src/orb/types/shared/new_plan_grouped_with_prorated_minimum_price.py +++ b/src/orb/types/shared/new_plan_grouped_with_prorated_minimum_price.py @@ -16,6 +16,8 @@ class GroupedWithProratedMinimumConfig(BaseModel): + """Configuration for grouped_with_prorated_minimum pricing""" + grouping_key: str """How to determine the groups that should each have a minimum""" diff --git a/src/orb/types/shared/new_plan_matrix_with_display_name_price.py b/src/orb/types/shared/new_plan_matrix_with_display_name_price.py index 53c1649f..19b4ec22 100644 --- a/src/orb/types/shared/new_plan_matrix_with_display_name_price.py +++ b/src/orb/types/shared/new_plan_matrix_with_display_name_price.py @@ -21,6 +21,8 @@ class MatrixWithDisplayNameConfigUnitAmount(BaseModel): + """Configuration for a unit amount item""" + dimension_value: str """The dimension value""" @@ -32,6 +34,8 @@ class MatrixWithDisplayNameConfigUnitAmount(BaseModel): class MatrixWithDisplayNameConfig(BaseModel): + """Configuration for matrix_with_display_name pricing""" + dimension: str """Used to determine the unit rate""" diff --git a/src/orb/types/shared/new_plan_max_group_tiered_package_price.py b/src/orb/types/shared/new_plan_max_group_tiered_package_price.py index cf0ff3f9..f11b210f 100644 --- a/src/orb/types/shared/new_plan_max_group_tiered_package_price.py +++ b/src/orb/types/shared/new_plan_max_group_tiered_package_price.py @@ -21,6 +21,8 @@ class MaxGroupTieredPackageConfigTier(BaseModel): + """Configuration for a single tier""" + tier_lower_bound: str """Tier lower bound""" @@ -29,6 +31,8 @@ class MaxGroupTieredPackageConfigTier(BaseModel): class MaxGroupTieredPackageConfig(BaseModel): + """Configuration for max_group_tiered_package pricing""" + grouping_key: str """ The event property used to group before tiering the group with the highest value diff --git a/src/orb/types/shared/new_plan_minimum_composite_price.py b/src/orb/types/shared/new_plan_minimum_composite_price.py index 7888c81c..3723a761 100644 --- a/src/orb/types/shared/new_plan_minimum_composite_price.py +++ b/src/orb/types/shared/new_plan_minimum_composite_price.py @@ -16,6 +16,8 @@ class MinimumConfig(BaseModel): + """Configuration for minimum pricing""" + minimum_amount: str """The minimum amount to apply""" diff --git a/src/orb/types/shared/new_plan_package_with_allocation_price.py b/src/orb/types/shared/new_plan_package_with_allocation_price.py index 86fa1476..9ce311f8 100644 --- a/src/orb/types/shared/new_plan_package_with_allocation_price.py +++ b/src/orb/types/shared/new_plan_package_with_allocation_price.py @@ -16,6 +16,8 @@ class PackageWithAllocationConfig(BaseModel): + """Configuration for package_with_allocation pricing""" + allocation: str """Usage allocation""" diff --git a/src/orb/types/shared/new_plan_scalable_matrix_with_tiered_pricing_price.py b/src/orb/types/shared/new_plan_scalable_matrix_with_tiered_pricing_price.py index 69b0a537..eaa0a1b4 100644 --- a/src/orb/types/shared/new_plan_scalable_matrix_with_tiered_pricing_price.py +++ b/src/orb/types/shared/new_plan_scalable_matrix_with_tiered_pricing_price.py @@ -22,6 +22,8 @@ class ScalableMatrixWithTieredPricingConfigMatrixScalingFactor(BaseModel): + """Configuration for a single matrix scaling factor""" + first_dimension_value: str """First dimension value""" @@ -33,6 +35,8 @@ class ScalableMatrixWithTieredPricingConfigMatrixScalingFactor(BaseModel): class ScalableMatrixWithTieredPricingConfigTier(BaseModel): + """Configuration for a single tier entry with business logic""" + tier_lower_bound: str """Tier lower bound""" @@ -41,6 +45,8 @@ class ScalableMatrixWithTieredPricingConfigTier(BaseModel): class ScalableMatrixWithTieredPricingConfig(BaseModel): + """Configuration for scalable_matrix_with_tiered_pricing pricing""" + first_dimension: str """Used for the scalable matrix first dimension""" diff --git a/src/orb/types/shared/new_plan_scalable_matrix_with_unit_pricing_price.py b/src/orb/types/shared/new_plan_scalable_matrix_with_unit_pricing_price.py index 91608c5d..17d71383 100644 --- a/src/orb/types/shared/new_plan_scalable_matrix_with_unit_pricing_price.py +++ b/src/orb/types/shared/new_plan_scalable_matrix_with_unit_pricing_price.py @@ -21,6 +21,8 @@ class ScalableMatrixWithUnitPricingConfigMatrixScalingFactor(BaseModel): + """Configuration for a single matrix scaling factor""" + first_dimension_value: str """First dimension value""" @@ -32,6 +34,8 @@ class ScalableMatrixWithUnitPricingConfigMatrixScalingFactor(BaseModel): class ScalableMatrixWithUnitPricingConfig(BaseModel): + """Configuration for scalable_matrix_with_unit_pricing pricing""" + first_dimension: str """Used to determine the unit rate""" diff --git a/src/orb/types/shared/new_plan_threshold_total_amount_price.py b/src/orb/types/shared/new_plan_threshold_total_amount_price.py index d66b222c..24bfdecd 100644 --- a/src/orb/types/shared/new_plan_threshold_total_amount_price.py +++ b/src/orb/types/shared/new_plan_threshold_total_amount_price.py @@ -21,6 +21,8 @@ class ThresholdTotalAmountConfigConsumptionTable(BaseModel): + """Configuration for a single threshold""" + threshold: str """Quantity threshold""" @@ -29,6 +31,8 @@ class ThresholdTotalAmountConfigConsumptionTable(BaseModel): class ThresholdTotalAmountConfig(BaseModel): + """Configuration for threshold_total_amount pricing""" + consumption_table: List[ThresholdTotalAmountConfigConsumptionTable] """ When the quantity consumed passes a provided threshold, the configured total diff --git a/src/orb/types/shared/new_plan_tiered_package_price.py b/src/orb/types/shared/new_plan_tiered_package_price.py index 4bfebae2..bb983558 100644 --- a/src/orb/types/shared/new_plan_tiered_package_price.py +++ b/src/orb/types/shared/new_plan_tiered_package_price.py @@ -16,6 +16,8 @@ class TieredPackageConfigTier(BaseModel): + """Configuration for a single tier with business logic""" + per_unit: str """Price per package""" @@ -24,6 +26,8 @@ class TieredPackageConfigTier(BaseModel): class TieredPackageConfig(BaseModel): + """Configuration for tiered_package pricing""" + package_size: str """Package size""" diff --git a/src/orb/types/shared/new_plan_tiered_package_with_minimum_price.py b/src/orb/types/shared/new_plan_tiered_package_with_minimum_price.py index 1f063109..e813a404 100644 --- a/src/orb/types/shared/new_plan_tiered_package_with_minimum_price.py +++ b/src/orb/types/shared/new_plan_tiered_package_with_minimum_price.py @@ -21,6 +21,8 @@ class TieredPackageWithMinimumConfigTier(BaseModel): + """Configuration for a single tier""" + minimum_amount: str """Minimum amount""" @@ -32,6 +34,8 @@ class TieredPackageWithMinimumConfigTier(BaseModel): class TieredPackageWithMinimumConfig(BaseModel): + """Configuration for tiered_package_with_minimum pricing""" + package_size: float """Package size""" diff --git a/src/orb/types/shared/new_plan_tiered_with_minimum_price.py b/src/orb/types/shared/new_plan_tiered_with_minimum_price.py index 36bafb4a..ad4c1ff7 100644 --- a/src/orb/types/shared/new_plan_tiered_with_minimum_price.py +++ b/src/orb/types/shared/new_plan_tiered_with_minimum_price.py @@ -21,6 +21,8 @@ class TieredWithMinimumConfigTier(BaseModel): + """Configuration for a single tier""" + minimum_amount: str """Minimum amount""" @@ -32,6 +34,8 @@ class TieredWithMinimumConfigTier(BaseModel): class TieredWithMinimumConfig(BaseModel): + """Configuration for tiered_with_minimum pricing""" + tiers: List[TieredWithMinimumConfigTier] """Tiered pricing with a minimum amount dependent on the volume tier. diff --git a/src/orb/types/shared/new_plan_unit_with_percent_price.py b/src/orb/types/shared/new_plan_unit_with_percent_price.py index b7f2fcb9..e810a8fc 100644 --- a/src/orb/types/shared/new_plan_unit_with_percent_price.py +++ b/src/orb/types/shared/new_plan_unit_with_percent_price.py @@ -16,6 +16,8 @@ class UnitWithPercentConfig(BaseModel): + """Configuration for unit_with_percent pricing""" + percent: str """What percent, out of 100, of the calculated total to charge""" diff --git a/src/orb/types/shared/new_plan_unit_with_proration_price.py b/src/orb/types/shared/new_plan_unit_with_proration_price.py index dadd7917..0aaf8979 100644 --- a/src/orb/types/shared/new_plan_unit_with_proration_price.py +++ b/src/orb/types/shared/new_plan_unit_with_proration_price.py @@ -16,6 +16,8 @@ class UnitWithProrationConfig(BaseModel): + """Configuration for unit_with_proration pricing""" + unit_amount: str """Rate per unit of usage""" diff --git a/src/orb/types/shared/package_config.py b/src/orb/types/shared/package_config.py index 1ae628bc..fc4f1001 100644 --- a/src/orb/types/shared/package_config.py +++ b/src/orb/types/shared/package_config.py @@ -6,6 +6,8 @@ class PackageConfig(BaseModel): + """Configuration for package pricing""" + package_amount: str """A currency amount to rate usage by""" diff --git a/src/orb/types/shared/price.py b/src/orb/types/shared/price.py index e6dcb4fa..077ab399 100644 --- a/src/orb/types/shared/price.py +++ b/src/orb/types/shared/price.py @@ -437,6 +437,8 @@ class BulkPrice(BaseModel): class BulkWithFiltersPriceBulkWithFiltersConfigFilter(BaseModel): + """Configuration for a single property filter""" + property_key: str """Event property key to filter on""" @@ -445,6 +447,8 @@ class BulkWithFiltersPriceBulkWithFiltersConfigFilter(BaseModel): class BulkWithFiltersPriceBulkWithFiltersConfigTier(BaseModel): + """Configuration for a single bulk pricing tier""" + unit_amount: str """Amount per unit""" @@ -453,6 +457,8 @@ class BulkWithFiltersPriceBulkWithFiltersConfigTier(BaseModel): class BulkWithFiltersPriceBulkWithFiltersConfig(BaseModel): + """Configuration for bulk_with_filters pricing""" + filters: List[BulkWithFiltersPriceBulkWithFiltersConfigFilter] """Property filters to apply (all must match)""" @@ -747,6 +753,8 @@ class ThresholdTotalAmountPriceCompositePriceFilter(BaseModel): class ThresholdTotalAmountPriceThresholdTotalAmountConfigConsumptionTable(BaseModel): + """Configuration for a single threshold""" + threshold: str """Quantity threshold""" @@ -755,6 +763,8 @@ class ThresholdTotalAmountPriceThresholdTotalAmountConfigConsumptionTable(BaseMo class ThresholdTotalAmountPriceThresholdTotalAmountConfig(BaseModel): + """Configuration for threshold_total_amount pricing""" + consumption_table: List[ThresholdTotalAmountPriceThresholdTotalAmountConfigConsumptionTable] """ When the quantity consumed passes a provided threshold, the configured total @@ -856,6 +866,8 @@ class TieredPackagePriceCompositePriceFilter(BaseModel): class TieredPackagePriceTieredPackageConfigTier(BaseModel): + """Configuration for a single tier with business logic""" + per_unit: str """Price per package""" @@ -864,6 +876,8 @@ class TieredPackagePriceTieredPackageConfigTier(BaseModel): class TieredPackagePriceTieredPackageConfig(BaseModel): + """Configuration for tiered_package pricing""" + package_size: str """Package size""" @@ -967,6 +981,8 @@ class TieredWithMinimumPriceCompositePriceFilter(BaseModel): class TieredWithMinimumPriceTieredWithMinimumConfigTier(BaseModel): + """Configuration for a single tier""" + minimum_amount: str """Minimum amount""" @@ -978,6 +994,8 @@ class TieredWithMinimumPriceTieredWithMinimumConfigTier(BaseModel): class TieredWithMinimumPriceTieredWithMinimumConfig(BaseModel): + """Configuration for tiered_with_minimum pricing""" + tiers: List[TieredWithMinimumPriceTieredWithMinimumConfigTier] """Tiered pricing with a minimum amount dependent on the volume tier. @@ -1082,6 +1100,8 @@ class GroupedTieredPriceCompositePriceFilter(BaseModel): class GroupedTieredPriceGroupedTieredConfigTier(BaseModel): + """Configuration for a single tier""" + tier_lower_bound: str """Tier lower bound""" @@ -1090,6 +1110,8 @@ class GroupedTieredPriceGroupedTieredConfigTier(BaseModel): class GroupedTieredPriceGroupedTieredConfig(BaseModel): + """Configuration for grouped_tiered pricing""" + grouping_key: str """The billable metric property used to group before tiering""" @@ -1191,6 +1213,8 @@ class TieredPackageWithMinimumPriceCompositePriceFilter(BaseModel): class TieredPackageWithMinimumPriceTieredPackageWithMinimumConfigTier(BaseModel): + """Configuration for a single tier""" + minimum_amount: str """Minimum amount""" @@ -1202,6 +1226,8 @@ class TieredPackageWithMinimumPriceTieredPackageWithMinimumConfigTier(BaseModel) class TieredPackageWithMinimumPriceTieredPackageWithMinimumConfig(BaseModel): + """Configuration for tiered_package_with_minimum pricing""" + package_size: float """Package size""" @@ -1303,6 +1329,8 @@ class PackageWithAllocationPriceCompositePriceFilter(BaseModel): class PackageWithAllocationPricePackageWithAllocationConfig(BaseModel): + """Configuration for package_with_allocation pricing""" + allocation: str """Usage allocation""" @@ -1404,6 +1432,8 @@ class UnitWithPercentPriceCompositePriceFilter(BaseModel): class UnitWithPercentPriceUnitWithPercentConfig(BaseModel): + """Configuration for unit_with_percent pricing""" + percent: str """What percent, out of 100, of the calculated total to charge""" @@ -1592,6 +1622,8 @@ class TieredWithProrationPriceCompositePriceFilter(BaseModel): class TieredWithProrationPriceTieredWithProrationConfigTier(BaseModel): + """Configuration for a single tiered with proration tier""" + tier_lower_bound: str """Inclusive tier starting value""" @@ -1600,6 +1632,8 @@ class TieredWithProrationPriceTieredWithProrationConfigTier(BaseModel): class TieredWithProrationPriceTieredWithProrationConfig(BaseModel): + """Configuration for tiered_with_proration pricing""" + tiers: List[TieredWithProrationPriceTieredWithProrationConfigTier] """ Tiers for rating based on total usage quantities into the specified tier with @@ -1698,6 +1732,8 @@ class UnitWithProrationPriceCompositePriceFilter(BaseModel): class UnitWithProrationPriceUnitWithProrationConfig(BaseModel): + """Configuration for unit_with_proration pricing""" + unit_amount: str """Rate per unit of usage""" @@ -1793,6 +1829,8 @@ class GroupedAllocationPriceCompositePriceFilter(BaseModel): class GroupedAllocationPriceGroupedAllocationConfig(BaseModel): + """Configuration for grouped_allocation pricing""" + allocation: str """Usage allocation per group""" @@ -1878,6 +1916,8 @@ class GroupedAllocationPrice(BaseModel): class BulkWithProrationPriceBulkWithProrationConfigTier(BaseModel): + """Configuration for a single bulk pricing tier with proration""" + unit_amount: str """Cost per unit""" @@ -1886,6 +1926,8 @@ class BulkWithProrationPriceBulkWithProrationConfigTier(BaseModel): class BulkWithProrationPriceBulkWithProrationConfig(BaseModel): + """Configuration for bulk_with_proration pricing""" + tiers: List[BulkWithProrationPriceBulkWithProrationConfigTier] """Bulk tiers for rating based on total usage volume""" @@ -1997,6 +2039,8 @@ class GroupedWithProratedMinimumPriceCompositePriceFilter(BaseModel): class GroupedWithProratedMinimumPriceGroupedWithProratedMinimumConfig(BaseModel): + """Configuration for grouped_with_prorated_minimum pricing""" + grouping_key: str """How to determine the groups that should each have a minimum""" @@ -2098,6 +2142,8 @@ class GroupedWithMeteredMinimumPriceCompositePriceFilter(BaseModel): class GroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfigScalingFactor(BaseModel): + """Configuration for a scaling factor""" + scaling_factor: str """Scaling factor""" @@ -2106,6 +2152,8 @@ class GroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfigScalingFactor class GroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfigUnitAmount(BaseModel): + """Configuration for a unit amount""" + pricing_value: str """Pricing value""" @@ -2114,6 +2162,8 @@ class GroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfigUnitAmount(Ba class GroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfig(BaseModel): + """Configuration for grouped_with_metered_minimum pricing""" + grouping_key: str """Used to partition the usage into groups. @@ -2230,6 +2280,8 @@ class GroupedWithMinMaxThresholdsPriceCompositePriceFilter(BaseModel): class GroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig(BaseModel): + """Configuration for grouped_with_min_max_thresholds pricing""" + grouping_key: str """The event property used to group before applying thresholds""" @@ -2334,6 +2386,8 @@ class MatrixWithDisplayNamePriceCompositePriceFilter(BaseModel): class MatrixWithDisplayNamePriceMatrixWithDisplayNameConfigUnitAmount(BaseModel): + """Configuration for a unit amount item""" + dimension_value: str """The dimension value""" @@ -2345,6 +2399,8 @@ class MatrixWithDisplayNamePriceMatrixWithDisplayNameConfigUnitAmount(BaseModel) class MatrixWithDisplayNamePriceMatrixWithDisplayNameConfig(BaseModel): + """Configuration for matrix_with_display_name pricing""" + dimension: str """Used to determine the unit rate""" @@ -2443,6 +2499,8 @@ class GroupedTieredPackagePriceCompositePriceFilter(BaseModel): class GroupedTieredPackagePriceGroupedTieredPackageConfigTier(BaseModel): + """Configuration for a single tier""" + per_unit: str """Price per package""" @@ -2451,6 +2509,8 @@ class GroupedTieredPackagePriceGroupedTieredPackageConfigTier(BaseModel): class GroupedTieredPackagePriceGroupedTieredPackageConfig(BaseModel): + """Configuration for grouped_tiered_package pricing""" + grouping_key: str """The event property used to group before tiering""" @@ -2555,6 +2615,8 @@ class MaxGroupTieredPackagePriceCompositePriceFilter(BaseModel): class MaxGroupTieredPackagePriceMaxGroupTieredPackageConfigTier(BaseModel): + """Configuration for a single tier""" + tier_lower_bound: str """Tier lower bound""" @@ -2563,6 +2625,8 @@ class MaxGroupTieredPackagePriceMaxGroupTieredPackageConfigTier(BaseModel): class MaxGroupTieredPackagePriceMaxGroupTieredPackageConfig(BaseModel): + """Configuration for max_group_tiered_package pricing""" + grouping_key: str """ The event property used to group before tiering the group with the highest value @@ -2666,6 +2730,8 @@ class ScalableMatrixWithUnitPricingPriceCompositePriceFilter(BaseModel): class ScalableMatrixWithUnitPricingPriceScalableMatrixWithUnitPricingConfigMatrixScalingFactor(BaseModel): + """Configuration for a single matrix scaling factor""" + first_dimension_value: str """First dimension value""" @@ -2677,6 +2743,8 @@ class ScalableMatrixWithUnitPricingPriceScalableMatrixWithUnitPricingConfigMatri class ScalableMatrixWithUnitPricingPriceScalableMatrixWithUnitPricingConfig(BaseModel): + """Configuration for scalable_matrix_with_unit_pricing pricing""" + first_dimension: str """Used to determine the unit rate""" @@ -2786,6 +2854,8 @@ class ScalableMatrixWithTieredPricingPriceCompositePriceFilter(BaseModel): class ScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfigMatrixScalingFactor(BaseModel): + """Configuration for a single matrix scaling factor""" + first_dimension_value: str """First dimension value""" @@ -2797,6 +2867,8 @@ class ScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfigM class ScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfigTier(BaseModel): + """Configuration for a single tier entry with business logic""" + tier_lower_bound: str """Tier lower bound""" @@ -2805,6 +2877,8 @@ class ScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfigT class ScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfig(BaseModel): + """Configuration for scalable_matrix_with_tiered_pricing pricing""" + first_dimension: str """Used for the scalable matrix first dimension""" @@ -2913,6 +2987,8 @@ class CumulativeGroupedBulkPriceCompositePriceFilter(BaseModel): class CumulativeGroupedBulkPriceCumulativeGroupedBulkConfigDimensionValue(BaseModel): + """Configuration for a dimension value entry""" + grouping_key: str """Grouping key value""" @@ -2924,6 +3000,8 @@ class CumulativeGroupedBulkPriceCumulativeGroupedBulkConfigDimensionValue(BaseMo class CumulativeGroupedBulkPriceCumulativeGroupedBulkConfig(BaseModel): + """Configuration for cumulative_grouped_bulk pricing""" + dimension_values: List[CumulativeGroupedBulkPriceCumulativeGroupedBulkConfigDimensionValue] """Each tier lower bound must have the same group of values.""" @@ -3022,6 +3100,8 @@ class CumulativeGroupedAllocationPriceCompositePriceFilter(BaseModel): class CumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig(BaseModel): + """Configuration for cumulative_grouped_allocation pricing""" + cumulative_allocation: str """The overall allocation across all groups""" @@ -3126,6 +3206,8 @@ class MinimumCompositePriceCompositePriceFilter(BaseModel): class MinimumCompositePriceMinimumConfig(BaseModel): + """Configuration for minimum pricing""" + minimum_amount: str """The minimum amount to apply""" @@ -3224,6 +3306,8 @@ class PercentCompositePriceCompositePriceFilter(BaseModel): class PercentCompositePricePercentConfig(BaseModel): + """Configuration for percent pricing""" + percent: float """What percent of the component subtotals to charge""" @@ -3319,6 +3403,8 @@ class EventOutputPriceCompositePriceFilter(BaseModel): class EventOutputPriceEventOutputConfig(BaseModel): + """Configuration for event_output pricing""" + unit_rating_key: str """The key in the event data to extract the unit rate from.""" diff --git a/src/orb/types/shared/price_interval.py b/src/orb/types/shared/price_interval.py index f2805398..6240931b 100644 --- a/src/orb/types/shared/price_interval.py +++ b/src/orb/types/shared/price_interval.py @@ -11,6 +11,11 @@ class PriceInterval(BaseModel): + """ + The Price Interval resource represents a period of time for which a price will bill on a subscription. A + subscription’s price intervals define its billing behavior. + """ + id: str billing_cycle_day: int diff --git a/src/orb/types/shared/tier.py b/src/orb/types/shared/tier.py index f0874550..b17676a9 100644 --- a/src/orb/types/shared/tier.py +++ b/src/orb/types/shared/tier.py @@ -8,6 +8,8 @@ class Tier(BaseModel): + """Configuration for a single tier""" + first_unit: float """Exclusive tier starting value""" diff --git a/src/orb/types/shared/tiered_config.py b/src/orb/types/shared/tiered_config.py index fa173f26..ac4c2e46 100644 --- a/src/orb/types/shared/tiered_config.py +++ b/src/orb/types/shared/tiered_config.py @@ -9,6 +9,8 @@ class TieredConfig(BaseModel): + """Configuration for tiered pricing""" + tiers: List[Tier] """Tiers for rating based on total usage quantities into the specified tier""" diff --git a/src/orb/types/shared/unit_config.py b/src/orb/types/shared/unit_config.py index b8b15658..04fae258 100644 --- a/src/orb/types/shared/unit_config.py +++ b/src/orb/types/shared/unit_config.py @@ -8,6 +8,8 @@ class UnitConfig(BaseModel): + """Configuration for unit pricing""" + unit_amount: str """Rate per unit of usage""" diff --git a/src/orb/types/shared_params/bulk_config.py b/src/orb/types/shared_params/bulk_config.py index b4ca0907..6c7bdb24 100644 --- a/src/orb/types/shared_params/bulk_config.py +++ b/src/orb/types/shared_params/bulk_config.py @@ -11,5 +11,7 @@ class BulkConfig(TypedDict, total=False): + """Configuration for bulk pricing""" + tiers: Required[Iterable[BulkTier]] """Bulk tiers for rating based on total usage volume""" diff --git a/src/orb/types/shared_params/bulk_tier.py b/src/orb/types/shared_params/bulk_tier.py index 15dd5d03..1bac9c59 100644 --- a/src/orb/types/shared_params/bulk_tier.py +++ b/src/orb/types/shared_params/bulk_tier.py @@ -9,6 +9,8 @@ class BulkTier(TypedDict, total=False): + """Configuration for a single bulk pricing tier""" + unit_amount: Required[str] """Amount per unit""" diff --git a/src/orb/types/shared_params/customer_tax_id.py b/src/orb/types/shared_params/customer_tax_id.py index 170e64f2..23389fe1 100644 --- a/src/orb/types/shared_params/customer_tax_id.py +++ b/src/orb/types/shared_params/customer_tax_id.py @@ -8,6 +8,154 @@ class CustomerTaxID(TypedDict, total=False): + """ + Tax IDs are commonly required to be displayed on customer invoices, which are added to the headers of invoices. + + + ### Supported Tax ID Countries and Types + + + | Country | Type | Description | + |---------|------|-------------| + | Albania | `al_tin` | Albania Tax Identification Number | + | Andorra | `ad_nrt` | Andorran NRT Number | + | Angola | `ao_tin` | Angola Tax Identification Number | + | Argentina | `ar_cuit` | Argentinian Tax ID Number | + | Armenia | `am_tin` | Armenia Tax Identification Number | + | Aruba | `aw_tin` | Aruba Tax Identification Number | + | Australia | `au_abn` | Australian Business Number (AU ABN) | + | Australia | `au_arn` | Australian Taxation Office Reference Number | + | Austria | `eu_vat` | European VAT Number | + | Azerbaijan | `az_tin` | Azerbaijan Tax Identification Number | + | Bahamas | `bs_tin` | Bahamas Tax Identification Number | + | Bahrain | `bh_vat` | Bahraini VAT Number | + | Bangladesh | `bd_bin` | Bangladesh Business Identification Number | + | Barbados | `bb_tin` | Barbados Tax Identification Number | + | Belarus | `by_tin` | Belarus TIN Number | + | Belgium | `eu_vat` | European VAT Number | + | Benin | `bj_ifu` | Benin Tax Identification Number (Identifiant Fiscal Unique) | + | Bolivia | `bo_tin` | Bolivian Tax ID | + | Bosnia and Herzegovina | `ba_tin` | Bosnia and Herzegovina Tax Identification Number | + | Brazil | `br_cnpj` | Brazilian CNPJ Number | + | Brazil | `br_cpf` | Brazilian CPF Number | + | Bulgaria | `bg_uic` | Bulgaria Unified Identification Code | + | Bulgaria | `eu_vat` | European VAT Number | + | Burkina Faso | `bf_ifu` | Burkina Faso Tax Identification Number (Numéro d'Identifiant Fiscal Unique) | + | Cambodia | `kh_tin` | Cambodia Tax Identification Number | + | Cameroon | `cm_niu` | Cameroon Tax Identification Number (Numéro d'Identifiant fiscal Unique) | + | Canada | `ca_bn` | Canadian BN | + | Canada | `ca_gst_hst` | Canadian GST/HST Number | + | Canada | `ca_pst_bc` | Canadian PST Number (British Columbia) | + | Canada | `ca_pst_mb` | Canadian PST Number (Manitoba) | + | Canada | `ca_pst_sk` | Canadian PST Number (Saskatchewan) | + | Canada | `ca_qst` | Canadian QST Number (Québec) | + | Cape Verde | `cv_nif` | Cape Verde Tax Identification Number (Número de Identificação Fiscal) | + | Chile | `cl_tin` | Chilean TIN | + | China | `cn_tin` | Chinese Tax ID | + | Colombia | `co_nit` | Colombian NIT Number | + | Congo-Kinshasa | `cd_nif` | Congo (DR) Tax Identification Number (Número de Identificação Fiscal) | + | Costa Rica | `cr_tin` | Costa Rican Tax ID | + | Croatia | `eu_vat` | European VAT Number | + | Croatia | `hr_oib` | Croatian Personal Identification Number (OIB) | + | Cyprus | `eu_vat` | European VAT Number | + | Czech Republic | `eu_vat` | European VAT Number | + | Denmark | `eu_vat` | European VAT Number | + | Dominican Republic | `do_rcn` | Dominican RCN Number | + | Ecuador | `ec_ruc` | Ecuadorian RUC Number | + | Egypt | `eg_tin` | Egyptian Tax Identification Number | + | El Salvador | `sv_nit` | El Salvadorian NIT Number | + | Estonia | `eu_vat` | European VAT Number | + | Ethiopia | `et_tin` | Ethiopia Tax Identification Number | + | European Union | `eu_oss_vat` | European One Stop Shop VAT Number for non-Union scheme | + | Finland | `eu_vat` | European VAT Number | + | France | `eu_vat` | European VAT Number | + | Georgia | `ge_vat` | Georgian VAT | + | Germany | `de_stn` | German Tax Number (Steuernummer) | + | Germany | `eu_vat` | European VAT Number | + | Greece | `eu_vat` | European VAT Number | + | Guinea | `gn_nif` | Guinea Tax Identification Number (Número de Identificação Fiscal) | + | Hong Kong | `hk_br` | Hong Kong BR Number | + | Hungary | `eu_vat` | European VAT Number | + | Hungary | `hu_tin` | Hungary Tax Number (adószám) | + | Iceland | `is_vat` | Icelandic VAT | + | India | `in_gst` | Indian GST Number | + | Indonesia | `id_npwp` | Indonesian NPWP Number | + | Ireland | `eu_vat` | European VAT Number | + | Israel | `il_vat` | Israel VAT | + | Italy | `eu_vat` | European VAT Number | + | Japan | `jp_cn` | Japanese Corporate Number (*Hōjin Bangō*) | + | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (*Tōroku Kokugai Jigyōsha no Tōroku Bangō*) | + | Japan | `jp_trn` | Japanese Tax Registration Number (*Tōroku Bangō*) | + | Kazakhstan | `kz_bin` | Kazakhstani Business Identification Number | + | Kenya | `ke_pin` | Kenya Revenue Authority Personal Identification Number | + | Kyrgyzstan | `kg_tin` | Kyrgyzstan Tax Identification Number | + | Laos | `la_tin` | Laos Tax Identification Number | + | Latvia | `eu_vat` | European VAT Number | + | Liechtenstein | `li_uid` | Liechtensteinian UID Number | + | Liechtenstein | `li_vat` | Liechtenstein VAT Number | + | Lithuania | `eu_vat` | European VAT Number | + | Luxembourg | `eu_vat` | European VAT Number | + | Malaysia | `my_frp` | Malaysian FRP Number | + | Malaysia | `my_itn` | Malaysian ITN | + | Malaysia | `my_sst` | Malaysian SST Number | + | Malta | `eu_vat` | European VAT Number | + | Mauritania | `mr_nif` | Mauritania Tax Identification Number (Número de Identificação Fiscal) | + | Mexico | `mx_rfc` | Mexican RFC Number | + | Moldova | `md_vat` | Moldova VAT Number | + | Montenegro | `me_pib` | Montenegro PIB Number | + | Morocco | `ma_vat` | Morocco VAT Number | + | Nepal | `np_pan` | Nepal PAN Number | + | Netherlands | `eu_vat` | European VAT Number | + | New Zealand | `nz_gst` | New Zealand GST Number | + | Nigeria | `ng_tin` | Nigerian Tax Identification Number | + | North Macedonia | `mk_vat` | North Macedonia VAT Number | + | Northern Ireland | `eu_vat` | Northern Ireland VAT Number | + | Norway | `no_vat` | Norwegian VAT Number | + | Norway | `no_voec` | Norwegian VAT on e-commerce Number | + | Oman | `om_vat` | Omani VAT Number | + | Peru | `pe_ruc` | Peruvian RUC Number | + | Philippines | `ph_tin` | Philippines Tax Identification Number | + | Poland | `eu_vat` | European VAT Number | + | Portugal | `eu_vat` | European VAT Number | + | Romania | `eu_vat` | European VAT Number | + | Romania | `ro_tin` | Romanian Tax ID Number | + | Russia | `ru_inn` | Russian INN | + | Russia | `ru_kpp` | Russian KPP | + | Saudi Arabia | `sa_vat` | Saudi Arabia VAT | + | Senegal | `sn_ninea` | Senegal NINEA Number | + | Serbia | `rs_pib` | Serbian PIB Number | + | Singapore | `sg_gst` | Singaporean GST | + | Singapore | `sg_uen` | Singaporean UEN | + | Slovakia | `eu_vat` | European VAT Number | + | Slovenia | `eu_vat` | European VAT Number | + | Slovenia | `si_tin` | Slovenia Tax Number (davčna številka) | + | South Africa | `za_vat` | South African VAT Number | + | South Korea | `kr_brn` | Korean BRN | + | Spain | `es_cif` | Spanish NIF Number (previously Spanish CIF Number) | + | Spain | `eu_vat` | European VAT Number | + | Suriname | `sr_fin` | Suriname FIN Number | + | Sweden | `eu_vat` | European VAT Number | + | Switzerland | `ch_uid` | Switzerland UID Number | + | Switzerland | `ch_vat` | Switzerland VAT Number | + | Taiwan | `tw_vat` | Taiwanese VAT | + | Tajikistan | `tj_tin` | Tajikistan Tax Identification Number | + | Tanzania | `tz_vat` | Tanzania VAT Number | + | Thailand | `th_vat` | Thai VAT | + | Turkey | `tr_tin` | Turkish Tax Identification Number | + | Uganda | `ug_tin` | Uganda Tax Identification Number | + | Ukraine | `ua_vat` | Ukrainian VAT | + | United Arab Emirates | `ae_trn` | United Arab Emirates TRN | + | United Kingdom | `gb_vat` | United Kingdom VAT Number | + | United States | `us_ein` | United States EIN | + | Uruguay | `uy_ruc` | Uruguayan RUC Number | + | Uzbekistan | `uz_tin` | Uzbekistan TIN Number | + | Uzbekistan | `uz_vat` | Uzbekistan VAT Number | + | Venezuela | `ve_rif` | Venezuelan RIF Number | + | Vietnam | `vn_tin` | Vietnamese Tax ID Number | + | Zambia | `zm_tin` | Zambia Tax Identification Number | + | Zimbabwe | `zw_tin` | Zimbabwe Tax Identification Number | + """ + country: Required[ Literal[ "AD", diff --git a/src/orb/types/shared_params/matrix_config.py b/src/orb/types/shared_params/matrix_config.py index 1a182af6..94ba879b 100644 --- a/src/orb/types/shared_params/matrix_config.py +++ b/src/orb/types/shared_params/matrix_config.py @@ -12,6 +12,8 @@ class MatrixConfig(TypedDict, total=False): + """Configuration for matrix pricing""" + default_unit_amount: Required[str] """Default per unit rate for any usage not bucketed into a specified matrix_value""" diff --git a/src/orb/types/shared_params/matrix_value.py b/src/orb/types/shared_params/matrix_value.py index 8c01e7b9..b6879ac4 100644 --- a/src/orb/types/shared_params/matrix_value.py +++ b/src/orb/types/shared_params/matrix_value.py @@ -11,6 +11,8 @@ class MatrixValue(TypedDict, total=False): + """Configuration for a single matrix value""" + dimension_values: Required[SequenceNotStr[Optional[str]]] """One or two matrix keys to filter usage to this Matrix value by""" diff --git a/src/orb/types/shared_params/matrix_with_allocation_config.py b/src/orb/types/shared_params/matrix_with_allocation_config.py index 4da9383e..30af0b0d 100644 --- a/src/orb/types/shared_params/matrix_with_allocation_config.py +++ b/src/orb/types/shared_params/matrix_with_allocation_config.py @@ -11,6 +11,8 @@ class MatrixValue(TypedDict, total=False): + """Configuration for a single matrix value""" + dimension_values: Required[SequenceNotStr[Optional[str]]] """One or two matrix keys to filter usage to this Matrix value by. @@ -23,6 +25,8 @@ class MatrixValue(TypedDict, total=False): class MatrixWithAllocationConfig(TypedDict, total=False): + """Configuration for matrix pricing with usage allocation""" + allocation: Required[str] """Usage allocation""" diff --git a/src/orb/types/shared_params/new_allocation_price.py b/src/orb/types/shared_params/new_allocation_price.py index 8d42e881..9655e4e8 100644 --- a/src/orb/types/shared_params/new_allocation_price.py +++ b/src/orb/types/shared_params/new_allocation_price.py @@ -12,6 +12,8 @@ class Filter(TypedDict, total=False): + """A PriceFilter that only allows item_id field for block filters.""" + field: Required[Literal["item_id"]] """The property of the price the block applies to. Only item_id is supported.""" diff --git a/src/orb/types/shared_params/new_floating_bulk_with_proration_price.py b/src/orb/types/shared_params/new_floating_bulk_with_proration_price.py index d558b2c9..c6f60854 100644 --- a/src/orb/types/shared_params/new_floating_bulk_with_proration_price.py +++ b/src/orb/types/shared_params/new_floating_bulk_with_proration_price.py @@ -19,6 +19,8 @@ class BulkWithProrationConfigTier(TypedDict, total=False): + """Configuration for a single bulk pricing tier with proration""" + unit_amount: Required[str] """Cost per unit""" @@ -27,6 +29,8 @@ class BulkWithProrationConfigTier(TypedDict, total=False): class BulkWithProrationConfig(TypedDict, total=False): + """Configuration for bulk_with_proration pricing""" + tiers: Required[Iterable[BulkWithProrationConfigTier]] """Bulk tiers for rating based on total usage volume""" diff --git a/src/orb/types/shared_params/new_floating_cumulative_grouped_bulk_price.py b/src/orb/types/shared_params/new_floating_cumulative_grouped_bulk_price.py index c366e61c..9a33588b 100644 --- a/src/orb/types/shared_params/new_floating_cumulative_grouped_bulk_price.py +++ b/src/orb/types/shared_params/new_floating_cumulative_grouped_bulk_price.py @@ -19,6 +19,8 @@ class CumulativeGroupedBulkConfigDimensionValue(TypedDict, total=False): + """Configuration for a dimension value entry""" + grouping_key: Required[str] """Grouping key value""" @@ -30,6 +32,8 @@ class CumulativeGroupedBulkConfigDimensionValue(TypedDict, total=False): class CumulativeGroupedBulkConfig(TypedDict, total=False): + """Configuration for cumulative_grouped_bulk pricing""" + dimension_values: Required[Iterable[CumulativeGroupedBulkConfigDimensionValue]] """Each tier lower bound must have the same group of values.""" diff --git a/src/orb/types/shared_params/new_floating_grouped_allocation_price.py b/src/orb/types/shared_params/new_floating_grouped_allocation_price.py index f4eab386..94dac2f1 100644 --- a/src/orb/types/shared_params/new_floating_grouped_allocation_price.py +++ b/src/orb/types/shared_params/new_floating_grouped_allocation_price.py @@ -14,6 +14,8 @@ class GroupedAllocationConfig(TypedDict, total=False): + """Configuration for grouped_allocation pricing""" + allocation: Required[str] """Usage allocation per group""" diff --git a/src/orb/types/shared_params/new_floating_grouped_tiered_package_price.py b/src/orb/types/shared_params/new_floating_grouped_tiered_package_price.py index b13138ee..8443ce0c 100644 --- a/src/orb/types/shared_params/new_floating_grouped_tiered_package_price.py +++ b/src/orb/types/shared_params/new_floating_grouped_tiered_package_price.py @@ -19,6 +19,8 @@ class GroupedTieredPackageConfigTier(TypedDict, total=False): + """Configuration for a single tier""" + per_unit: Required[str] """Price per package""" @@ -27,6 +29,8 @@ class GroupedTieredPackageConfigTier(TypedDict, total=False): class GroupedTieredPackageConfig(TypedDict, total=False): + """Configuration for grouped_tiered_package pricing""" + grouping_key: Required[str] """The event property used to group before tiering""" diff --git a/src/orb/types/shared_params/new_floating_grouped_tiered_price.py b/src/orb/types/shared_params/new_floating_grouped_tiered_price.py index 2f2d7c92..51225cc0 100644 --- a/src/orb/types/shared_params/new_floating_grouped_tiered_price.py +++ b/src/orb/types/shared_params/new_floating_grouped_tiered_price.py @@ -14,6 +14,8 @@ class GroupedTieredConfigTier(TypedDict, total=False): + """Configuration for a single tier""" + tier_lower_bound: Required[str] """Tier lower bound""" @@ -22,6 +24,8 @@ class GroupedTieredConfigTier(TypedDict, total=False): class GroupedTieredConfig(TypedDict, total=False): + """Configuration for grouped_tiered pricing""" + grouping_key: Required[str] """The billable metric property used to group before tiering""" diff --git a/src/orb/types/shared_params/new_floating_grouped_with_metered_minimum_price.py b/src/orb/types/shared_params/new_floating_grouped_with_metered_minimum_price.py index 09cc4afc..dd4d8c37 100644 --- a/src/orb/types/shared_params/new_floating_grouped_with_metered_minimum_price.py +++ b/src/orb/types/shared_params/new_floating_grouped_with_metered_minimum_price.py @@ -20,6 +20,8 @@ class GroupedWithMeteredMinimumConfigScalingFactor(TypedDict, total=False): + """Configuration for a scaling factor""" + scaling_factor: Required[str] """Scaling factor""" @@ -28,6 +30,8 @@ class GroupedWithMeteredMinimumConfigScalingFactor(TypedDict, total=False): class GroupedWithMeteredMinimumConfigUnitAmount(TypedDict, total=False): + """Configuration for a unit amount""" + pricing_value: Required[str] """Pricing value""" @@ -36,6 +40,8 @@ class GroupedWithMeteredMinimumConfigUnitAmount(TypedDict, total=False): class GroupedWithMeteredMinimumConfig(TypedDict, total=False): + """Configuration for grouped_with_metered_minimum pricing""" + grouping_key: Required[str] """Used to partition the usage into groups. diff --git a/src/orb/types/shared_params/new_floating_grouped_with_prorated_minimum_price.py b/src/orb/types/shared_params/new_floating_grouped_with_prorated_minimum_price.py index 489dcaaf..f34b268d 100644 --- a/src/orb/types/shared_params/new_floating_grouped_with_prorated_minimum_price.py +++ b/src/orb/types/shared_params/new_floating_grouped_with_prorated_minimum_price.py @@ -14,6 +14,8 @@ class GroupedWithProratedMinimumConfig(TypedDict, total=False): + """Configuration for grouped_with_prorated_minimum pricing""" + grouping_key: Required[str] """How to determine the groups that should each have a minimum""" diff --git a/src/orb/types/shared_params/new_floating_matrix_with_display_name_price.py b/src/orb/types/shared_params/new_floating_matrix_with_display_name_price.py index 3afbf5a0..cb8ce9db 100644 --- a/src/orb/types/shared_params/new_floating_matrix_with_display_name_price.py +++ b/src/orb/types/shared_params/new_floating_matrix_with_display_name_price.py @@ -19,6 +19,8 @@ class MatrixWithDisplayNameConfigUnitAmount(TypedDict, total=False): + """Configuration for a unit amount item""" + dimension_value: Required[str] """The dimension value""" @@ -30,6 +32,8 @@ class MatrixWithDisplayNameConfigUnitAmount(TypedDict, total=False): class MatrixWithDisplayNameConfig(TypedDict, total=False): + """Configuration for matrix_with_display_name pricing""" + dimension: Required[str] """Used to determine the unit rate""" diff --git a/src/orb/types/shared_params/new_floating_max_group_tiered_package_price.py b/src/orb/types/shared_params/new_floating_max_group_tiered_package_price.py index 6fce2b51..36e244ed 100644 --- a/src/orb/types/shared_params/new_floating_max_group_tiered_package_price.py +++ b/src/orb/types/shared_params/new_floating_max_group_tiered_package_price.py @@ -19,6 +19,8 @@ class MaxGroupTieredPackageConfigTier(TypedDict, total=False): + """Configuration for a single tier""" + tier_lower_bound: Required[str] """Tier lower bound""" @@ -27,6 +29,8 @@ class MaxGroupTieredPackageConfigTier(TypedDict, total=False): class MaxGroupTieredPackageConfig(TypedDict, total=False): + """Configuration for max_group_tiered_package pricing""" + grouping_key: Required[str] """ The event property used to group before tiering the group with the highest value diff --git a/src/orb/types/shared_params/new_floating_minimum_composite_price.py b/src/orb/types/shared_params/new_floating_minimum_composite_price.py index 1c8e4bc5..6f7b54dc 100644 --- a/src/orb/types/shared_params/new_floating_minimum_composite_price.py +++ b/src/orb/types/shared_params/new_floating_minimum_composite_price.py @@ -14,6 +14,8 @@ class MinimumConfig(TypedDict, total=False): + """Configuration for minimum pricing""" + minimum_amount: Required[str] """The minimum amount to apply""" diff --git a/src/orb/types/shared_params/new_floating_package_with_allocation_price.py b/src/orb/types/shared_params/new_floating_package_with_allocation_price.py index 7728b3d2..98d66bf5 100644 --- a/src/orb/types/shared_params/new_floating_package_with_allocation_price.py +++ b/src/orb/types/shared_params/new_floating_package_with_allocation_price.py @@ -14,6 +14,8 @@ class PackageWithAllocationConfig(TypedDict, total=False): + """Configuration for package_with_allocation pricing""" + allocation: Required[str] """Usage allocation""" diff --git a/src/orb/types/shared_params/new_floating_scalable_matrix_with_tiered_pricing_price.py b/src/orb/types/shared_params/new_floating_scalable_matrix_with_tiered_pricing_price.py index 02ec608c..41b56031 100644 --- a/src/orb/types/shared_params/new_floating_scalable_matrix_with_tiered_pricing_price.py +++ b/src/orb/types/shared_params/new_floating_scalable_matrix_with_tiered_pricing_price.py @@ -20,6 +20,8 @@ class ScalableMatrixWithTieredPricingConfigMatrixScalingFactor(TypedDict, total=False): + """Configuration for a single matrix scaling factor""" + first_dimension_value: Required[str] """First dimension value""" @@ -31,6 +33,8 @@ class ScalableMatrixWithTieredPricingConfigMatrixScalingFactor(TypedDict, total= class ScalableMatrixWithTieredPricingConfigTier(TypedDict, total=False): + """Configuration for a single tier entry with business logic""" + tier_lower_bound: Required[str] """Tier lower bound""" @@ -39,6 +43,8 @@ class ScalableMatrixWithTieredPricingConfigTier(TypedDict, total=False): class ScalableMatrixWithTieredPricingConfig(TypedDict, total=False): + """Configuration for scalable_matrix_with_tiered_pricing pricing""" + first_dimension: Required[str] """Used for the scalable matrix first dimension""" diff --git a/src/orb/types/shared_params/new_floating_scalable_matrix_with_unit_pricing_price.py b/src/orb/types/shared_params/new_floating_scalable_matrix_with_unit_pricing_price.py index 03f0bde2..9f876992 100644 --- a/src/orb/types/shared_params/new_floating_scalable_matrix_with_unit_pricing_price.py +++ b/src/orb/types/shared_params/new_floating_scalable_matrix_with_unit_pricing_price.py @@ -19,6 +19,8 @@ class ScalableMatrixWithUnitPricingConfigMatrixScalingFactor(TypedDict, total=False): + """Configuration for a single matrix scaling factor""" + first_dimension_value: Required[str] """First dimension value""" @@ -30,6 +32,8 @@ class ScalableMatrixWithUnitPricingConfigMatrixScalingFactor(TypedDict, total=Fa class ScalableMatrixWithUnitPricingConfig(TypedDict, total=False): + """Configuration for scalable_matrix_with_unit_pricing pricing""" + first_dimension: Required[str] """Used to determine the unit rate""" diff --git a/src/orb/types/shared_params/new_floating_threshold_total_amount_price.py b/src/orb/types/shared_params/new_floating_threshold_total_amount_price.py index dd2407c4..d881ec84 100644 --- a/src/orb/types/shared_params/new_floating_threshold_total_amount_price.py +++ b/src/orb/types/shared_params/new_floating_threshold_total_amount_price.py @@ -19,6 +19,8 @@ class ThresholdTotalAmountConfigConsumptionTable(TypedDict, total=False): + """Configuration for a single threshold""" + threshold: Required[str] """Quantity threshold""" @@ -27,6 +29,8 @@ class ThresholdTotalAmountConfigConsumptionTable(TypedDict, total=False): class ThresholdTotalAmountConfig(TypedDict, total=False): + """Configuration for threshold_total_amount pricing""" + consumption_table: Required[Iterable[ThresholdTotalAmountConfigConsumptionTable]] """ When the quantity consumed passes a provided threshold, the configured total diff --git a/src/orb/types/shared_params/new_floating_tiered_package_price.py b/src/orb/types/shared_params/new_floating_tiered_package_price.py index 9ee2dc6e..4b013f92 100644 --- a/src/orb/types/shared_params/new_floating_tiered_package_price.py +++ b/src/orb/types/shared_params/new_floating_tiered_package_price.py @@ -14,6 +14,8 @@ class TieredPackageConfigTier(TypedDict, total=False): + """Configuration for a single tier with business logic""" + per_unit: Required[str] """Price per package""" @@ -22,6 +24,8 @@ class TieredPackageConfigTier(TypedDict, total=False): class TieredPackageConfig(TypedDict, total=False): + """Configuration for tiered_package pricing""" + package_size: Required[str] """Package size""" diff --git a/src/orb/types/shared_params/new_floating_tiered_package_with_minimum_price.py b/src/orb/types/shared_params/new_floating_tiered_package_with_minimum_price.py index 192557db..27dc00a1 100644 --- a/src/orb/types/shared_params/new_floating_tiered_package_with_minimum_price.py +++ b/src/orb/types/shared_params/new_floating_tiered_package_with_minimum_price.py @@ -19,6 +19,8 @@ class TieredPackageWithMinimumConfigTier(TypedDict, total=False): + """Configuration for a single tier""" + minimum_amount: Required[str] """Minimum amount""" @@ -30,6 +32,8 @@ class TieredPackageWithMinimumConfigTier(TypedDict, total=False): class TieredPackageWithMinimumConfig(TypedDict, total=False): + """Configuration for tiered_package_with_minimum pricing""" + package_size: Required[float] """Package size""" diff --git a/src/orb/types/shared_params/new_floating_tiered_with_minimum_price.py b/src/orb/types/shared_params/new_floating_tiered_with_minimum_price.py index b7af73ee..8b92b07e 100644 --- a/src/orb/types/shared_params/new_floating_tiered_with_minimum_price.py +++ b/src/orb/types/shared_params/new_floating_tiered_with_minimum_price.py @@ -19,6 +19,8 @@ class TieredWithMinimumConfigTier(TypedDict, total=False): + """Configuration for a single tier""" + minimum_amount: Required[str] """Minimum amount""" @@ -30,6 +32,8 @@ class TieredWithMinimumConfigTier(TypedDict, total=False): class TieredWithMinimumConfig(TypedDict, total=False): + """Configuration for tiered_with_minimum pricing""" + tiers: Required[Iterable[TieredWithMinimumConfigTier]] """Tiered pricing with a minimum amount dependent on the volume tier. diff --git a/src/orb/types/shared_params/new_floating_tiered_with_proration_price.py b/src/orb/types/shared_params/new_floating_tiered_with_proration_price.py index 6a668abb..483a5ab6 100644 --- a/src/orb/types/shared_params/new_floating_tiered_with_proration_price.py +++ b/src/orb/types/shared_params/new_floating_tiered_with_proration_price.py @@ -19,6 +19,8 @@ class TieredWithProrationConfigTier(TypedDict, total=False): + """Configuration for a single tiered with proration tier""" + tier_lower_bound: Required[str] """Inclusive tier starting value""" @@ -27,6 +29,8 @@ class TieredWithProrationConfigTier(TypedDict, total=False): class TieredWithProrationConfig(TypedDict, total=False): + """Configuration for tiered_with_proration pricing""" + tiers: Required[Iterable[TieredWithProrationConfigTier]] """ Tiers for rating based on total usage quantities into the specified tier with diff --git a/src/orb/types/shared_params/new_floating_unit_with_percent_price.py b/src/orb/types/shared_params/new_floating_unit_with_percent_price.py index f4c3f97f..991d2ed9 100644 --- a/src/orb/types/shared_params/new_floating_unit_with_percent_price.py +++ b/src/orb/types/shared_params/new_floating_unit_with_percent_price.py @@ -14,6 +14,8 @@ class UnitWithPercentConfig(TypedDict, total=False): + """Configuration for unit_with_percent pricing""" + percent: Required[str] """What percent, out of 100, of the calculated total to charge""" diff --git a/src/orb/types/shared_params/new_floating_unit_with_proration_price.py b/src/orb/types/shared_params/new_floating_unit_with_proration_price.py index 9be1a23b..16010cf5 100644 --- a/src/orb/types/shared_params/new_floating_unit_with_proration_price.py +++ b/src/orb/types/shared_params/new_floating_unit_with_proration_price.py @@ -14,6 +14,8 @@ class UnitWithProrationConfig(TypedDict, total=False): + """Configuration for unit_with_proration pricing""" + unit_amount: Required[str] """Rate per unit of usage""" diff --git a/src/orb/types/shared_params/new_plan_bulk_with_proration_price.py b/src/orb/types/shared_params/new_plan_bulk_with_proration_price.py index a64dd3ae..b2091bd1 100644 --- a/src/orb/types/shared_params/new_plan_bulk_with_proration_price.py +++ b/src/orb/types/shared_params/new_plan_bulk_with_proration_price.py @@ -19,6 +19,8 @@ class BulkWithProrationConfigTier(TypedDict, total=False): + """Configuration for a single bulk pricing tier with proration""" + unit_amount: Required[str] """Cost per unit""" @@ -27,6 +29,8 @@ class BulkWithProrationConfigTier(TypedDict, total=False): class BulkWithProrationConfig(TypedDict, total=False): + """Configuration for bulk_with_proration pricing""" + tiers: Required[Iterable[BulkWithProrationConfigTier]] """Bulk tiers for rating based on total usage volume""" diff --git a/src/orb/types/shared_params/new_plan_cumulative_grouped_bulk_price.py b/src/orb/types/shared_params/new_plan_cumulative_grouped_bulk_price.py index 52e6ec62..e99df53f 100644 --- a/src/orb/types/shared_params/new_plan_cumulative_grouped_bulk_price.py +++ b/src/orb/types/shared_params/new_plan_cumulative_grouped_bulk_price.py @@ -19,6 +19,8 @@ class CumulativeGroupedBulkConfigDimensionValue(TypedDict, total=False): + """Configuration for a dimension value entry""" + grouping_key: Required[str] """Grouping key value""" @@ -30,6 +32,8 @@ class CumulativeGroupedBulkConfigDimensionValue(TypedDict, total=False): class CumulativeGroupedBulkConfig(TypedDict, total=False): + """Configuration for cumulative_grouped_bulk pricing""" + dimension_values: Required[Iterable[CumulativeGroupedBulkConfigDimensionValue]] """Each tier lower bound must have the same group of values.""" diff --git a/src/orb/types/shared_params/new_plan_grouped_allocation_price.py b/src/orb/types/shared_params/new_plan_grouped_allocation_price.py index 67b7c72f..e2700481 100644 --- a/src/orb/types/shared_params/new_plan_grouped_allocation_price.py +++ b/src/orb/types/shared_params/new_plan_grouped_allocation_price.py @@ -14,6 +14,8 @@ class GroupedAllocationConfig(TypedDict, total=False): + """Configuration for grouped_allocation pricing""" + allocation: Required[str] """Usage allocation per group""" diff --git a/src/orb/types/shared_params/new_plan_grouped_tiered_package_price.py b/src/orb/types/shared_params/new_plan_grouped_tiered_package_price.py index 26d663eb..61b8e954 100644 --- a/src/orb/types/shared_params/new_plan_grouped_tiered_package_price.py +++ b/src/orb/types/shared_params/new_plan_grouped_tiered_package_price.py @@ -19,6 +19,8 @@ class GroupedTieredPackageConfigTier(TypedDict, total=False): + """Configuration for a single tier""" + per_unit: Required[str] """Price per package""" @@ -27,6 +29,8 @@ class GroupedTieredPackageConfigTier(TypedDict, total=False): class GroupedTieredPackageConfig(TypedDict, total=False): + """Configuration for grouped_tiered_package pricing""" + grouping_key: Required[str] """The event property used to group before tiering""" diff --git a/src/orb/types/shared_params/new_plan_grouped_tiered_price.py b/src/orb/types/shared_params/new_plan_grouped_tiered_price.py index 3bc086e4..021e5286 100644 --- a/src/orb/types/shared_params/new_plan_grouped_tiered_price.py +++ b/src/orb/types/shared_params/new_plan_grouped_tiered_price.py @@ -14,6 +14,8 @@ class GroupedTieredConfigTier(TypedDict, total=False): + """Configuration for a single tier""" + tier_lower_bound: Required[str] """Tier lower bound""" @@ -22,6 +24,8 @@ class GroupedTieredConfigTier(TypedDict, total=False): class GroupedTieredConfig(TypedDict, total=False): + """Configuration for grouped_tiered pricing""" + grouping_key: Required[str] """The billable metric property used to group before tiering""" diff --git a/src/orb/types/shared_params/new_plan_grouped_with_metered_minimum_price.py b/src/orb/types/shared_params/new_plan_grouped_with_metered_minimum_price.py index 27dbc416..ecf93c84 100644 --- a/src/orb/types/shared_params/new_plan_grouped_with_metered_minimum_price.py +++ b/src/orb/types/shared_params/new_plan_grouped_with_metered_minimum_price.py @@ -20,6 +20,8 @@ class GroupedWithMeteredMinimumConfigScalingFactor(TypedDict, total=False): + """Configuration for a scaling factor""" + scaling_factor: Required[str] """Scaling factor""" @@ -28,6 +30,8 @@ class GroupedWithMeteredMinimumConfigScalingFactor(TypedDict, total=False): class GroupedWithMeteredMinimumConfigUnitAmount(TypedDict, total=False): + """Configuration for a unit amount""" + pricing_value: Required[str] """Pricing value""" @@ -36,6 +40,8 @@ class GroupedWithMeteredMinimumConfigUnitAmount(TypedDict, total=False): class GroupedWithMeteredMinimumConfig(TypedDict, total=False): + """Configuration for grouped_with_metered_minimum pricing""" + grouping_key: Required[str] """Used to partition the usage into groups. diff --git a/src/orb/types/shared_params/new_plan_grouped_with_prorated_minimum_price.py b/src/orb/types/shared_params/new_plan_grouped_with_prorated_minimum_price.py index b358bade..a27e09eb 100644 --- a/src/orb/types/shared_params/new_plan_grouped_with_prorated_minimum_price.py +++ b/src/orb/types/shared_params/new_plan_grouped_with_prorated_minimum_price.py @@ -14,6 +14,8 @@ class GroupedWithProratedMinimumConfig(TypedDict, total=False): + """Configuration for grouped_with_prorated_minimum pricing""" + grouping_key: Required[str] """How to determine the groups that should each have a minimum""" diff --git a/src/orb/types/shared_params/new_plan_matrix_with_display_name_price.py b/src/orb/types/shared_params/new_plan_matrix_with_display_name_price.py index 7822f6ee..7db6380d 100644 --- a/src/orb/types/shared_params/new_plan_matrix_with_display_name_price.py +++ b/src/orb/types/shared_params/new_plan_matrix_with_display_name_price.py @@ -19,6 +19,8 @@ class MatrixWithDisplayNameConfigUnitAmount(TypedDict, total=False): + """Configuration for a unit amount item""" + dimension_value: Required[str] """The dimension value""" @@ -30,6 +32,8 @@ class MatrixWithDisplayNameConfigUnitAmount(TypedDict, total=False): class MatrixWithDisplayNameConfig(TypedDict, total=False): + """Configuration for matrix_with_display_name pricing""" + dimension: Required[str] """Used to determine the unit rate""" diff --git a/src/orb/types/shared_params/new_plan_max_group_tiered_package_price.py b/src/orb/types/shared_params/new_plan_max_group_tiered_package_price.py index 4c574233..6bda5f79 100644 --- a/src/orb/types/shared_params/new_plan_max_group_tiered_package_price.py +++ b/src/orb/types/shared_params/new_plan_max_group_tiered_package_price.py @@ -19,6 +19,8 @@ class MaxGroupTieredPackageConfigTier(TypedDict, total=False): + """Configuration for a single tier""" + tier_lower_bound: Required[str] """Tier lower bound""" @@ -27,6 +29,8 @@ class MaxGroupTieredPackageConfigTier(TypedDict, total=False): class MaxGroupTieredPackageConfig(TypedDict, total=False): + """Configuration for max_group_tiered_package pricing""" + grouping_key: Required[str] """ The event property used to group before tiering the group with the highest value diff --git a/src/orb/types/shared_params/new_plan_minimum_composite_price.py b/src/orb/types/shared_params/new_plan_minimum_composite_price.py index 45fe6b83..66f2fec6 100644 --- a/src/orb/types/shared_params/new_plan_minimum_composite_price.py +++ b/src/orb/types/shared_params/new_plan_minimum_composite_price.py @@ -14,6 +14,8 @@ class MinimumConfig(TypedDict, total=False): + """Configuration for minimum pricing""" + minimum_amount: Required[str] """The minimum amount to apply""" diff --git a/src/orb/types/shared_params/new_plan_package_with_allocation_price.py b/src/orb/types/shared_params/new_plan_package_with_allocation_price.py index 430f5861..496ba702 100644 --- a/src/orb/types/shared_params/new_plan_package_with_allocation_price.py +++ b/src/orb/types/shared_params/new_plan_package_with_allocation_price.py @@ -14,6 +14,8 @@ class PackageWithAllocationConfig(TypedDict, total=False): + """Configuration for package_with_allocation pricing""" + allocation: Required[str] """Usage allocation""" diff --git a/src/orb/types/shared_params/new_plan_scalable_matrix_with_tiered_pricing_price.py b/src/orb/types/shared_params/new_plan_scalable_matrix_with_tiered_pricing_price.py index 4d02a548..878b2c45 100644 --- a/src/orb/types/shared_params/new_plan_scalable_matrix_with_tiered_pricing_price.py +++ b/src/orb/types/shared_params/new_plan_scalable_matrix_with_tiered_pricing_price.py @@ -20,6 +20,8 @@ class ScalableMatrixWithTieredPricingConfigMatrixScalingFactor(TypedDict, total=False): + """Configuration for a single matrix scaling factor""" + first_dimension_value: Required[str] """First dimension value""" @@ -31,6 +33,8 @@ class ScalableMatrixWithTieredPricingConfigMatrixScalingFactor(TypedDict, total= class ScalableMatrixWithTieredPricingConfigTier(TypedDict, total=False): + """Configuration for a single tier entry with business logic""" + tier_lower_bound: Required[str] """Tier lower bound""" @@ -39,6 +43,8 @@ class ScalableMatrixWithTieredPricingConfigTier(TypedDict, total=False): class ScalableMatrixWithTieredPricingConfig(TypedDict, total=False): + """Configuration for scalable_matrix_with_tiered_pricing pricing""" + first_dimension: Required[str] """Used for the scalable matrix first dimension""" diff --git a/src/orb/types/shared_params/new_plan_scalable_matrix_with_unit_pricing_price.py b/src/orb/types/shared_params/new_plan_scalable_matrix_with_unit_pricing_price.py index 6fd976c6..e97cfcc7 100644 --- a/src/orb/types/shared_params/new_plan_scalable_matrix_with_unit_pricing_price.py +++ b/src/orb/types/shared_params/new_plan_scalable_matrix_with_unit_pricing_price.py @@ -19,6 +19,8 @@ class ScalableMatrixWithUnitPricingConfigMatrixScalingFactor(TypedDict, total=False): + """Configuration for a single matrix scaling factor""" + first_dimension_value: Required[str] """First dimension value""" @@ -30,6 +32,8 @@ class ScalableMatrixWithUnitPricingConfigMatrixScalingFactor(TypedDict, total=Fa class ScalableMatrixWithUnitPricingConfig(TypedDict, total=False): + """Configuration for scalable_matrix_with_unit_pricing pricing""" + first_dimension: Required[str] """Used to determine the unit rate""" diff --git a/src/orb/types/shared_params/new_plan_threshold_total_amount_price.py b/src/orb/types/shared_params/new_plan_threshold_total_amount_price.py index ef1e9330..6d013105 100644 --- a/src/orb/types/shared_params/new_plan_threshold_total_amount_price.py +++ b/src/orb/types/shared_params/new_plan_threshold_total_amount_price.py @@ -19,6 +19,8 @@ class ThresholdTotalAmountConfigConsumptionTable(TypedDict, total=False): + """Configuration for a single threshold""" + threshold: Required[str] """Quantity threshold""" @@ -27,6 +29,8 @@ class ThresholdTotalAmountConfigConsumptionTable(TypedDict, total=False): class ThresholdTotalAmountConfig(TypedDict, total=False): + """Configuration for threshold_total_amount pricing""" + consumption_table: Required[Iterable[ThresholdTotalAmountConfigConsumptionTable]] """ When the quantity consumed passes a provided threshold, the configured total diff --git a/src/orb/types/shared_params/new_plan_tiered_package_price.py b/src/orb/types/shared_params/new_plan_tiered_package_price.py index 72696ec5..b5a61c43 100644 --- a/src/orb/types/shared_params/new_plan_tiered_package_price.py +++ b/src/orb/types/shared_params/new_plan_tiered_package_price.py @@ -14,6 +14,8 @@ class TieredPackageConfigTier(TypedDict, total=False): + """Configuration for a single tier with business logic""" + per_unit: Required[str] """Price per package""" @@ -22,6 +24,8 @@ class TieredPackageConfigTier(TypedDict, total=False): class TieredPackageConfig(TypedDict, total=False): + """Configuration for tiered_package pricing""" + package_size: Required[str] """Package size""" diff --git a/src/orb/types/shared_params/new_plan_tiered_package_with_minimum_price.py b/src/orb/types/shared_params/new_plan_tiered_package_with_minimum_price.py index 8dc0826c..ae6dcea2 100644 --- a/src/orb/types/shared_params/new_plan_tiered_package_with_minimum_price.py +++ b/src/orb/types/shared_params/new_plan_tiered_package_with_minimum_price.py @@ -19,6 +19,8 @@ class TieredPackageWithMinimumConfigTier(TypedDict, total=False): + """Configuration for a single tier""" + minimum_amount: Required[str] """Minimum amount""" @@ -30,6 +32,8 @@ class TieredPackageWithMinimumConfigTier(TypedDict, total=False): class TieredPackageWithMinimumConfig(TypedDict, total=False): + """Configuration for tiered_package_with_minimum pricing""" + package_size: Required[float] """Package size""" diff --git a/src/orb/types/shared_params/new_plan_tiered_with_minimum_price.py b/src/orb/types/shared_params/new_plan_tiered_with_minimum_price.py index 2089ad16..1b32c6be 100644 --- a/src/orb/types/shared_params/new_plan_tiered_with_minimum_price.py +++ b/src/orb/types/shared_params/new_plan_tiered_with_minimum_price.py @@ -19,6 +19,8 @@ class TieredWithMinimumConfigTier(TypedDict, total=False): + """Configuration for a single tier""" + minimum_amount: Required[str] """Minimum amount""" @@ -30,6 +32,8 @@ class TieredWithMinimumConfigTier(TypedDict, total=False): class TieredWithMinimumConfig(TypedDict, total=False): + """Configuration for tiered_with_minimum pricing""" + tiers: Required[Iterable[TieredWithMinimumConfigTier]] """Tiered pricing with a minimum amount dependent on the volume tier. diff --git a/src/orb/types/shared_params/new_plan_unit_with_percent_price.py b/src/orb/types/shared_params/new_plan_unit_with_percent_price.py index 8b6eafe8..6aa47863 100644 --- a/src/orb/types/shared_params/new_plan_unit_with_percent_price.py +++ b/src/orb/types/shared_params/new_plan_unit_with_percent_price.py @@ -14,6 +14,8 @@ class UnitWithPercentConfig(TypedDict, total=False): + """Configuration for unit_with_percent pricing""" + percent: Required[str] """What percent, out of 100, of the calculated total to charge""" diff --git a/src/orb/types/shared_params/new_plan_unit_with_proration_price.py b/src/orb/types/shared_params/new_plan_unit_with_proration_price.py index 0c72b3f7..a8d41ed4 100644 --- a/src/orb/types/shared_params/new_plan_unit_with_proration_price.py +++ b/src/orb/types/shared_params/new_plan_unit_with_proration_price.py @@ -14,6 +14,8 @@ class UnitWithProrationConfig(TypedDict, total=False): + """Configuration for unit_with_proration pricing""" + unit_amount: Required[str] """Rate per unit of usage""" diff --git a/src/orb/types/shared_params/package_config.py b/src/orb/types/shared_params/package_config.py index ad4f51be..f37339fd 100644 --- a/src/orb/types/shared_params/package_config.py +++ b/src/orb/types/shared_params/package_config.py @@ -8,6 +8,8 @@ class PackageConfig(TypedDict, total=False): + """Configuration for package pricing""" + package_amount: Required[str] """A currency amount to rate usage by""" diff --git a/src/orb/types/shared_params/tier.py b/src/orb/types/shared_params/tier.py index 23fa0b61..cf66df3c 100644 --- a/src/orb/types/shared_params/tier.py +++ b/src/orb/types/shared_params/tier.py @@ -9,6 +9,8 @@ class Tier(TypedDict, total=False): + """Configuration for a single tier""" + first_unit: Required[float] """Exclusive tier starting value""" diff --git a/src/orb/types/shared_params/tiered_config.py b/src/orb/types/shared_params/tiered_config.py index f5d1c264..31c9dc11 100644 --- a/src/orb/types/shared_params/tiered_config.py +++ b/src/orb/types/shared_params/tiered_config.py @@ -11,6 +11,8 @@ class TieredConfig(TypedDict, total=False): + """Configuration for tiered pricing""" + tiers: Required[Iterable[Tier]] """Tiers for rating based on total usage quantities into the specified tier""" diff --git a/src/orb/types/shared_params/unit_config.py b/src/orb/types/shared_params/unit_config.py index 2a41542c..ed96da86 100644 --- a/src/orb/types/shared_params/unit_config.py +++ b/src/orb/types/shared_params/unit_config.py @@ -8,6 +8,8 @@ class UnitConfig(TypedDict, total=False): + """Configuration for unit pricing""" + unit_amount: Required[str] """Rate per unit of usage""" diff --git a/src/orb/types/subscription.py b/src/orb/types/subscription.py index cac64a05..19145ee2 100644 --- a/src/orb/types/subscription.py +++ b/src/orb/types/subscription.py @@ -30,6 +30,22 @@ class Subscription(BaseModel): + """ + A [subscription](/core-concepts#subscription) represents the purchase of a plan by a customer. + + By default, subscriptions begin on the day that they're created and renew automatically for each billing cycle at + the cadence that's configured in the plan definition. + + Subscriptions also default to **beginning of month alignment**, which means the first invoice issued for the + subscription will have pro-rated charges between the `start_date` and the first of the following month. Subsequent + billing periods will always start and end on a month boundary (e.g. subsequent month starts for monthly billing). + + Depending on the plan configuration, any _flat_ recurring fees will be billed either at the beginning (in-advance) + or end (in-arrears) of each billing cycle. Plans default to **in-advance billing**. Usage-based fees are billed in + arrears as usage is accumulated. In the normal course of events, you can expect an invoice to contain usage-based + charges for the previous period, and a recurring fee for the following period. + """ + id: str active_plan_phase_order: Optional[int] = None diff --git a/src/orb/types/subscription_change_apply_response.py b/src/orb/types/subscription_change_apply_response.py index e35c12df..5670c50c 100644 --- a/src/orb/types/subscription_change_apply_response.py +++ b/src/orb/types/subscription_change_apply_response.py @@ -11,6 +11,12 @@ class SubscriptionChangeApplyResponse(BaseModel): + """ + A subscription change represents a desired new subscription / pending change to an existing subscription. It + is a way to first preview the effects on the subscription as well as any changes/creation of invoices + (see `subscription.changed_resources`). + """ + id: str change_type: str diff --git a/src/orb/types/subscription_change_cancel_response.py b/src/orb/types/subscription_change_cancel_response.py index 2be25608..996fa3c0 100644 --- a/src/orb/types/subscription_change_cancel_response.py +++ b/src/orb/types/subscription_change_cancel_response.py @@ -11,6 +11,12 @@ class SubscriptionChangeCancelResponse(BaseModel): + """ + A subscription change represents a desired new subscription / pending change to an existing subscription. It + is a way to first preview the effects on the subscription as well as any changes/creation of invoices + (see `subscription.changed_resources`). + """ + id: str change_type: str diff --git a/src/orb/types/subscription_change_retrieve_response.py b/src/orb/types/subscription_change_retrieve_response.py index 1e327bba..2cd2a723 100644 --- a/src/orb/types/subscription_change_retrieve_response.py +++ b/src/orb/types/subscription_change_retrieve_response.py @@ -11,6 +11,12 @@ class SubscriptionChangeRetrieveResponse(BaseModel): + """ + A subscription change represents a desired new subscription / pending change to an existing subscription. It + is a way to first preview the effects on the subscription as well as any changes/creation of invoices + (see `subscription.changed_resources`). + """ + id: str change_type: str diff --git a/src/orb/types/subscription_create_params.py b/src/orb/types/subscription_create_params.py index 47d4c6e5..b87ae181 100644 --- a/src/orb/types/subscription_create_params.py +++ b/src/orb/types/subscription_create_params.py @@ -309,6 +309,8 @@ class AddAdjustment(TypedDict, total=False): class AddPricePriceNewSubscriptionBulkWithFiltersPriceBulkWithFiltersConfigFilter(TypedDict, total=False): + """Configuration for a single property filter""" + property_key: Required[str] """Event property key to filter on""" @@ -317,6 +319,8 @@ class AddPricePriceNewSubscriptionBulkWithFiltersPriceBulkWithFiltersConfigFilte class AddPricePriceNewSubscriptionBulkWithFiltersPriceBulkWithFiltersConfigTier(TypedDict, total=False): + """Configuration for a single bulk pricing tier""" + unit_amount: Required[str] """Amount per unit""" @@ -325,6 +329,8 @@ class AddPricePriceNewSubscriptionBulkWithFiltersPriceBulkWithFiltersConfigTier( class AddPricePriceNewSubscriptionBulkWithFiltersPriceBulkWithFiltersConfig(TypedDict, total=False): + """Configuration for bulk_with_filters pricing""" + filters: Required[Iterable[AddPricePriceNewSubscriptionBulkWithFiltersPriceBulkWithFiltersConfigFilter]] """Property filters to apply (all must match)""" @@ -419,6 +425,8 @@ class AddPricePriceNewSubscriptionBulkWithFiltersPrice(TypedDict, total=False): class AddPricePriceNewSubscriptionTieredWithProrationPriceTieredWithProrationConfigTier(TypedDict, total=False): + """Configuration for a single tiered with proration tier""" + tier_lower_bound: Required[str] """Inclusive tier starting value""" @@ -427,6 +435,8 @@ class AddPricePriceNewSubscriptionTieredWithProrationPriceTieredWithProrationCon class AddPricePriceNewSubscriptionTieredWithProrationPriceTieredWithProrationConfig(TypedDict, total=False): + """Configuration for tiered_with_proration pricing""" + tiers: Required[Iterable[AddPricePriceNewSubscriptionTieredWithProrationPriceTieredWithProrationConfigTier]] """ Tiers for rating based on total usage quantities into the specified tier with @@ -525,6 +535,8 @@ class AddPricePriceNewSubscriptionTieredWithProrationPrice(TypedDict, total=Fals class AddPricePriceNewSubscriptionGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig( TypedDict, total=False ): + """Configuration for grouped_with_min_max_thresholds pricing""" + grouping_key: Required[str] """The event property used to group before applying thresholds""" @@ -629,6 +641,8 @@ class AddPricePriceNewSubscriptionGroupedWithMinMaxThresholdsPrice(TypedDict, to class AddPricePriceNewSubscriptionCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig( TypedDict, total=False ): + """Configuration for cumulative_grouped_allocation pricing""" + cumulative_allocation: Required[str] """The overall allocation across all groups""" @@ -731,6 +745,8 @@ class AddPricePriceNewSubscriptionCumulativeGroupedAllocationPrice(TypedDict, to class AddPricePriceNewSubscriptionPercentCompositePricePercentConfig(TypedDict, total=False): + """Configuration for percent pricing""" + percent: Required[float] """What percent of the component subtotals to charge""" @@ -822,6 +838,8 @@ class AddPricePriceNewSubscriptionPercentCompositePrice(TypedDict, total=False): class AddPricePriceNewSubscriptionEventOutputPriceEventOutputConfig(TypedDict, total=False): + """Configuration for event_output pricing""" + unit_rating_key: Required[str] """The key in the event data to extract the unit rate from.""" @@ -1036,6 +1054,8 @@ class ReplaceAdjustment(TypedDict, total=False): class ReplacePricePriceNewSubscriptionBulkWithFiltersPriceBulkWithFiltersConfigFilter(TypedDict, total=False): + """Configuration for a single property filter""" + property_key: Required[str] """Event property key to filter on""" @@ -1044,6 +1064,8 @@ class ReplacePricePriceNewSubscriptionBulkWithFiltersPriceBulkWithFiltersConfigF class ReplacePricePriceNewSubscriptionBulkWithFiltersPriceBulkWithFiltersConfigTier(TypedDict, total=False): + """Configuration for a single bulk pricing tier""" + unit_amount: Required[str] """Amount per unit""" @@ -1052,6 +1074,8 @@ class ReplacePricePriceNewSubscriptionBulkWithFiltersPriceBulkWithFiltersConfigT class ReplacePricePriceNewSubscriptionBulkWithFiltersPriceBulkWithFiltersConfig(TypedDict, total=False): + """Configuration for bulk_with_filters pricing""" + filters: Required[Iterable[ReplacePricePriceNewSubscriptionBulkWithFiltersPriceBulkWithFiltersConfigFilter]] """Property filters to apply (all must match)""" @@ -1146,6 +1170,8 @@ class ReplacePricePriceNewSubscriptionBulkWithFiltersPrice(TypedDict, total=Fals class ReplacePricePriceNewSubscriptionTieredWithProrationPriceTieredWithProrationConfigTier(TypedDict, total=False): + """Configuration for a single tiered with proration tier""" + tier_lower_bound: Required[str] """Inclusive tier starting value""" @@ -1154,6 +1180,8 @@ class ReplacePricePriceNewSubscriptionTieredWithProrationPriceTieredWithProratio class ReplacePricePriceNewSubscriptionTieredWithProrationPriceTieredWithProrationConfig(TypedDict, total=False): + """Configuration for tiered_with_proration pricing""" + tiers: Required[Iterable[ReplacePricePriceNewSubscriptionTieredWithProrationPriceTieredWithProrationConfigTier]] """ Tiers for rating based on total usage quantities into the specified tier with @@ -1252,6 +1280,8 @@ class ReplacePricePriceNewSubscriptionTieredWithProrationPrice(TypedDict, total= class ReplacePricePriceNewSubscriptionGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig( TypedDict, total=False ): + """Configuration for grouped_with_min_max_thresholds pricing""" + grouping_key: Required[str] """The event property used to group before applying thresholds""" @@ -1358,6 +1388,8 @@ class ReplacePricePriceNewSubscriptionGroupedWithMinMaxThresholdsPrice(TypedDict class ReplacePricePriceNewSubscriptionCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig( TypedDict, total=False ): + """Configuration for cumulative_grouped_allocation pricing""" + cumulative_allocation: Required[str] """The overall allocation across all groups""" @@ -1462,6 +1494,8 @@ class ReplacePricePriceNewSubscriptionCumulativeGroupedAllocationPrice(TypedDict class ReplacePricePriceNewSubscriptionPercentCompositePricePercentConfig(TypedDict, total=False): + """Configuration for percent pricing""" + percent: Required[float] """What percent of the component subtotals to charge""" @@ -1553,6 +1587,8 @@ class ReplacePricePriceNewSubscriptionPercentCompositePrice(TypedDict, total=Fal class ReplacePricePriceNewSubscriptionEventOutputPriceEventOutputConfig(TypedDict, total=False): + """Configuration for event_output pricing""" + unit_rating_key: Required[str] """The key in the event data to extract the unit rate from.""" diff --git a/src/orb/types/subscription_price_intervals_params.py b/src/orb/types/subscription_price_intervals_params.py index 06df53fd..a1fce592 100644 --- a/src/orb/types/subscription_price_intervals_params.py +++ b/src/orb/types/subscription_price_intervals_params.py @@ -154,6 +154,8 @@ class AddFixedFeeQuantityTransition(TypedDict, total=False): class AddPriceNewFloatingBulkWithFiltersPriceBulkWithFiltersConfigFilter(TypedDict, total=False): + """Configuration for a single property filter""" + property_key: Required[str] """Event property key to filter on""" @@ -162,6 +164,8 @@ class AddPriceNewFloatingBulkWithFiltersPriceBulkWithFiltersConfigFilter(TypedDi class AddPriceNewFloatingBulkWithFiltersPriceBulkWithFiltersConfigTier(TypedDict, total=False): + """Configuration for a single bulk pricing tier""" + unit_amount: Required[str] """Amount per unit""" @@ -170,6 +174,8 @@ class AddPriceNewFloatingBulkWithFiltersPriceBulkWithFiltersConfigTier(TypedDict class AddPriceNewFloatingBulkWithFiltersPriceBulkWithFiltersConfig(TypedDict, total=False): + """Configuration for bulk_with_filters pricing""" + filters: Required[Iterable[AddPriceNewFloatingBulkWithFiltersPriceBulkWithFiltersConfigFilter]] """Property filters to apply (all must match)""" @@ -255,6 +261,8 @@ class AddPriceNewFloatingBulkWithFiltersPrice(TypedDict, total=False): class AddPriceNewFloatingGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig(TypedDict, total=False): + """Configuration for grouped_with_min_max_thresholds pricing""" + grouping_key: Required[str] """The event property used to group before applying thresholds""" @@ -348,6 +356,8 @@ class AddPriceNewFloatingGroupedWithMinMaxThresholdsPrice(TypedDict, total=False class AddPriceNewFloatingCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig(TypedDict, total=False): + """Configuration for cumulative_grouped_allocation pricing""" + cumulative_allocation: Required[str] """The overall allocation across all groups""" @@ -441,6 +451,8 @@ class AddPriceNewFloatingCumulativeGroupedAllocationPrice(TypedDict, total=False class AddPriceNewFloatingPercentCompositePricePercentConfig(TypedDict, total=False): + """Configuration for percent pricing""" + percent: Required[float] """What percent of the component subtotals to charge""" @@ -523,6 +535,8 @@ class AddPriceNewFloatingPercentCompositePrice(TypedDict, total=False): class AddPriceNewFloatingEventOutputPriceEventOutputConfig(TypedDict, total=False): + """Configuration for event_output pricing""" + unit_rating_key: Required[str] """The key in the event data to extract the unit rate from.""" diff --git a/src/orb/types/subscription_schedule_plan_change_params.py b/src/orb/types/subscription_schedule_plan_change_params.py index 2862f63e..7d0313d2 100644 --- a/src/orb/types/subscription_schedule_plan_change_params.py +++ b/src/orb/types/subscription_schedule_plan_change_params.py @@ -297,6 +297,8 @@ class AddAdjustment(TypedDict, total=False): class AddPricePriceNewSubscriptionBulkWithFiltersPriceBulkWithFiltersConfigFilter(TypedDict, total=False): + """Configuration for a single property filter""" + property_key: Required[str] """Event property key to filter on""" @@ -305,6 +307,8 @@ class AddPricePriceNewSubscriptionBulkWithFiltersPriceBulkWithFiltersConfigFilte class AddPricePriceNewSubscriptionBulkWithFiltersPriceBulkWithFiltersConfigTier(TypedDict, total=False): + """Configuration for a single bulk pricing tier""" + unit_amount: Required[str] """Amount per unit""" @@ -313,6 +317,8 @@ class AddPricePriceNewSubscriptionBulkWithFiltersPriceBulkWithFiltersConfigTier( class AddPricePriceNewSubscriptionBulkWithFiltersPriceBulkWithFiltersConfig(TypedDict, total=False): + """Configuration for bulk_with_filters pricing""" + filters: Required[Iterable[AddPricePriceNewSubscriptionBulkWithFiltersPriceBulkWithFiltersConfigFilter]] """Property filters to apply (all must match)""" @@ -407,6 +413,8 @@ class AddPricePriceNewSubscriptionBulkWithFiltersPrice(TypedDict, total=False): class AddPricePriceNewSubscriptionTieredWithProrationPriceTieredWithProrationConfigTier(TypedDict, total=False): + """Configuration for a single tiered with proration tier""" + tier_lower_bound: Required[str] """Inclusive tier starting value""" @@ -415,6 +423,8 @@ class AddPricePriceNewSubscriptionTieredWithProrationPriceTieredWithProrationCon class AddPricePriceNewSubscriptionTieredWithProrationPriceTieredWithProrationConfig(TypedDict, total=False): + """Configuration for tiered_with_proration pricing""" + tiers: Required[Iterable[AddPricePriceNewSubscriptionTieredWithProrationPriceTieredWithProrationConfigTier]] """ Tiers for rating based on total usage quantities into the specified tier with @@ -513,6 +523,8 @@ class AddPricePriceNewSubscriptionTieredWithProrationPrice(TypedDict, total=Fals class AddPricePriceNewSubscriptionGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig( TypedDict, total=False ): + """Configuration for grouped_with_min_max_thresholds pricing""" + grouping_key: Required[str] """The event property used to group before applying thresholds""" @@ -617,6 +629,8 @@ class AddPricePriceNewSubscriptionGroupedWithMinMaxThresholdsPrice(TypedDict, to class AddPricePriceNewSubscriptionCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig( TypedDict, total=False ): + """Configuration for cumulative_grouped_allocation pricing""" + cumulative_allocation: Required[str] """The overall allocation across all groups""" @@ -719,6 +733,8 @@ class AddPricePriceNewSubscriptionCumulativeGroupedAllocationPrice(TypedDict, to class AddPricePriceNewSubscriptionPercentCompositePricePercentConfig(TypedDict, total=False): + """Configuration for percent pricing""" + percent: Required[float] """What percent of the component subtotals to charge""" @@ -810,6 +826,8 @@ class AddPricePriceNewSubscriptionPercentCompositePrice(TypedDict, total=False): class AddPricePriceNewSubscriptionEventOutputPriceEventOutputConfig(TypedDict, total=False): + """Configuration for event_output pricing""" + unit_rating_key: Required[str] """The key in the event data to extract the unit rate from.""" @@ -1024,6 +1042,8 @@ class ReplaceAdjustment(TypedDict, total=False): class ReplacePricePriceNewSubscriptionBulkWithFiltersPriceBulkWithFiltersConfigFilter(TypedDict, total=False): + """Configuration for a single property filter""" + property_key: Required[str] """Event property key to filter on""" @@ -1032,6 +1052,8 @@ class ReplacePricePriceNewSubscriptionBulkWithFiltersPriceBulkWithFiltersConfigF class ReplacePricePriceNewSubscriptionBulkWithFiltersPriceBulkWithFiltersConfigTier(TypedDict, total=False): + """Configuration for a single bulk pricing tier""" + unit_amount: Required[str] """Amount per unit""" @@ -1040,6 +1062,8 @@ class ReplacePricePriceNewSubscriptionBulkWithFiltersPriceBulkWithFiltersConfigT class ReplacePricePriceNewSubscriptionBulkWithFiltersPriceBulkWithFiltersConfig(TypedDict, total=False): + """Configuration for bulk_with_filters pricing""" + filters: Required[Iterable[ReplacePricePriceNewSubscriptionBulkWithFiltersPriceBulkWithFiltersConfigFilter]] """Property filters to apply (all must match)""" @@ -1134,6 +1158,8 @@ class ReplacePricePriceNewSubscriptionBulkWithFiltersPrice(TypedDict, total=Fals class ReplacePricePriceNewSubscriptionTieredWithProrationPriceTieredWithProrationConfigTier(TypedDict, total=False): + """Configuration for a single tiered with proration tier""" + tier_lower_bound: Required[str] """Inclusive tier starting value""" @@ -1142,6 +1168,8 @@ class ReplacePricePriceNewSubscriptionTieredWithProrationPriceTieredWithProratio class ReplacePricePriceNewSubscriptionTieredWithProrationPriceTieredWithProrationConfig(TypedDict, total=False): + """Configuration for tiered_with_proration pricing""" + tiers: Required[Iterable[ReplacePricePriceNewSubscriptionTieredWithProrationPriceTieredWithProrationConfigTier]] """ Tiers for rating based on total usage quantities into the specified tier with @@ -1240,6 +1268,8 @@ class ReplacePricePriceNewSubscriptionTieredWithProrationPrice(TypedDict, total= class ReplacePricePriceNewSubscriptionGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig( TypedDict, total=False ): + """Configuration for grouped_with_min_max_thresholds pricing""" + grouping_key: Required[str] """The event property used to group before applying thresholds""" @@ -1346,6 +1376,8 @@ class ReplacePricePriceNewSubscriptionGroupedWithMinMaxThresholdsPrice(TypedDict class ReplacePricePriceNewSubscriptionCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig( TypedDict, total=False ): + """Configuration for cumulative_grouped_allocation pricing""" + cumulative_allocation: Required[str] """The overall allocation across all groups""" @@ -1450,6 +1482,8 @@ class ReplacePricePriceNewSubscriptionCumulativeGroupedAllocationPrice(TypedDict class ReplacePricePriceNewSubscriptionPercentCompositePricePercentConfig(TypedDict, total=False): + """Configuration for percent pricing""" + percent: Required[float] """What percent of the component subtotals to charge""" @@ -1541,6 +1575,8 @@ class ReplacePricePriceNewSubscriptionPercentCompositePrice(TypedDict, total=Fal class ReplacePricePriceNewSubscriptionEventOutputPriceEventOutputConfig(TypedDict, total=False): + """Configuration for event_output pricing""" + unit_rating_key: Required[str] """The key in the event data to extract the unit rate from.""" diff --git a/src/orb/types/threshold.py b/src/orb/types/threshold.py index 41cacd44..6b889abb 100644 --- a/src/orb/types/threshold.py +++ b/src/orb/types/threshold.py @@ -6,6 +6,10 @@ class Threshold(BaseModel): + """ + Thresholds are used to define the conditions under which an alert will be triggered. + """ + value: float """The value at which an alert will fire. diff --git a/src/orb/types/threshold_param.py b/src/orb/types/threshold_param.py index 0ff3e877..a175e35c 100644 --- a/src/orb/types/threshold_param.py +++ b/src/orb/types/threshold_param.py @@ -8,6 +8,10 @@ class ThresholdParam(TypedDict, total=False): + """ + Thresholds are used to define the conditions under which an alert will be triggered. + """ + value: Required[float] """The value at which an alert will fire. diff --git a/tests/api_resources/test_webhooks.py b/tests/api_resources/test_webhooks.py index ff269d5e..2ac0b7a1 100644 --- a/tests/api_resources/test_webhooks.py +++ b/tests/api_resources/test_webhooks.py @@ -4,7 +4,7 @@ import os from typing import Any, cast -from datetime import datetime, timedelta +from datetime import datetime, timezone, timedelta import pytest import time_machine @@ -18,7 +18,11 @@ class TestWebhooks: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) timestamp = "2024-03-27T15:42:29.551" - fake_now = datetime.fromisoformat(timestamp).astimezone() + # Fix: Ensure fake_now matches how webhook timestamps are now parsed (UTC assumption) + fake_now_dt = datetime.fromisoformat(timestamp) + if fake_now_dt.tzinfo is None: + fake_now_dt = fake_now_dt.replace(tzinfo=timezone.utc) + fake_now = fake_now_dt.astimezone() payload = """{"id": "o4mmewpfNNTnjfZc", "created_at": "2024-03-27T15:42:29+00:00", "type": "resource_event.test", "properties": {"message": "A test webhook from Orb. Happy testing!"}}""" signature = "9d25de966891ab0bc18754faf8d83d0980b44ae330fcc130b41a6cf3daf1f391" @@ -106,12 +110,98 @@ def test_verify_signature(self, client: Orb) -> None: secret=secret, ) + def test_microsecond_precision_issue_fixed(self, client: Orb) -> None: + """Test that the webhook timestamp parsing issue is fixed for the reported examples.""" + import hmac + import hashlib + + secret = self.secret + + # Test cases from the reported issue - these should all work now + test_cases = [ + ("2025-08-08T21:35:11.531998+00:00", "2025-08-08T21:35:11.445"), + ("2025-08-08T21:32:02.585239+00:00", "2025-08-08T21:32:02.497"), + ("2025-08-08T21:35:42.810490+00:00", "2025-08-08T21:35:42.660"), + ] + + for _, (system_time_str, webhook_timestamp) in enumerate(test_cases, 1): + system_time = datetime.fromisoformat(system_time_str) + + # Generate the correct signature + to_sign = f"v1:{webhook_timestamp}:{self.payload}".encode("utf-8") + signature = hmac.new(secret.encode("utf-8"), to_sign, hashlib.sha256).hexdigest() + + with time_machine.travel(system_time): + # This should now work without raising "Webhook timestamp is too new" + client.webhooks.verify_signature( + payload=self.payload, + headers={"X-Orb-Timestamp": webhook_timestamp, "X-Orb-Signature": f"v1={signature}"}, + secret=secret, + ) + + # Also test the unwrap method + result = client.webhooks.unwrap( + payload=self.payload, + headers={"X-Orb-Timestamp": webhook_timestamp, "X-Orb-Signature": f"v1={signature}"}, + secret=secret, + ) + assert result is not None + + def test_timezone_aware_timestamps_still_work(self, client: Orb) -> None: + """Test that webhook timestamps with explicit timezone info still work.""" + import hmac + import hashlib + from datetime import timezone + + secret = self.secret + + # Test with explicit UTC timezone + system_time = datetime(2025, 8, 8, 21, 35, 11, 531998, tzinfo=timezone.utc) + webhook_timestamp = "2025-08-08T21:35:11.445+00:00" # Explicit UTC + + to_sign = f"v1:{webhook_timestamp}:{self.payload}".encode("utf-8") + signature = hmac.new(secret.encode("utf-8"), to_sign, hashlib.sha256).hexdigest() + + with time_machine.travel(system_time): + client.webhooks.verify_signature( + payload=self.payload, + headers={"X-Orb-Timestamp": webhook_timestamp, "X-Orb-Signature": f"v1={signature}"}, + secret=secret, + ) + + def test_webhook_timestamp_actually_too_new(self, client: Orb) -> None: + """Test that webhooks that are genuinely too new are still rejected.""" + import hmac + import hashlib + from datetime import timezone + + secret = self.secret + + # Set system time to be much earlier than webhook timestamp (more than 5 minute tolerance) + system_time = datetime(2025, 8, 8, 21, 30, 0, 0, tzinfo=timezone.utc) + webhook_timestamp = "2025-08-08T21:36:00.000" # 6 minutes later - should be rejected + + to_sign = f"v1:{webhook_timestamp}:{self.payload}".encode("utf-8") + signature = hmac.new(secret.encode("utf-8"), to_sign, hashlib.sha256).hexdigest() + + with time_machine.travel(system_time): + with pytest.raises(ValueError, match="Webhook timestamp is too new"): + client.webhooks.verify_signature( + payload=self.payload, + headers={"X-Orb-Timestamp": webhook_timestamp, "X-Orb-Signature": f"v1={signature}"}, + secret=secret, + ) + class TestAsyncWebhooks: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) timestamp = "2024-03-27T15:42:29.551" - fake_now = datetime.fromisoformat(timestamp).astimezone() + # Fix: Ensure fake_now matches how webhook timestamps are now parsed (UTC assumption) + fake_now_dt = datetime.fromisoformat(timestamp) + if fake_now_dt.tzinfo is None: + fake_now_dt = fake_now_dt.replace(tzinfo=timezone.utc) + fake_now = fake_now_dt.astimezone() payload = """{"id": "o4mmewpfNNTnjfZc", "created_at": "2024-03-27T15:42:29+00:00", "type": "resource_event.test", "properties": {"message": "A test webhook from Orb. Happy testing!"}}""" signature = "9d25de966891ab0bc18754faf8d83d0980b44ae330fcc130b41a6cf3daf1f391"