diff --git a/.release-please-manifest.json b/.release-please-manifest.json index c032d311..69e5aa20 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "4.22.0" + ".": "4.23.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index fd40002f..4b69c08a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 118 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-26020bd285825dac04bf642a414ea07c786fc6e42ee6bbcf795e11f8db426519.yml -openapi_spec_hash: 897fedec83f0960539b3aa4ec0e3308d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-297c7ce95bc0aa1ac6f324a487515f49b8a30b74eb9d39ca9dcd2d9cf065f0ef.yml +openapi_spec_hash: 29e9af981bc78379336079bb4208c54d config_hash: 1f73a949b649ecfe6ec68ba1bb459dc2 diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a9e9f72..470c5d14 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 4.23.0 (2025-10-06) + +Full Changelog: [v4.22.0...v4.23.0](https://github.com/orbcorp/orb-python/compare/v4.22.0...v4.23.0) + +### Features + +* **api:** api update ([4d3c2f4](https://github.com/orbcorp/orb-python/commit/4d3c2f4646e6b64edde2d0bc7eb4701f1aa60a87)) + ## 4.22.0 (2025-10-03) Full Changelog: [v4.21.0...v4.22.0](https://github.com/orbcorp/orb-python/compare/v4.21.0...v4.22.0) diff --git a/pyproject.toml b/pyproject.toml index 4ece3be5..84d39aa3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "orb-billing" -version = "4.22.0" +version = "4.23.0" description = "The official Python library for the orb API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/orb/_version.py b/src/orb/_version.py index bb7f9619..4ddd5870 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.22.0" # x-release-please-version +__version__ = "4.23.0" # x-release-please-version diff --git a/src/orb/resources/prices/prices.py b/src/orb/resources/prices/prices.py index 8620a82b..5af99d3a 100644 --- a/src/orb/resources/prices/prices.py +++ b/src/orb/resources/prices/prices.py @@ -2671,6 +2671,102 @@ def create( """ ... + @overload + def create( + self, + *, + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], + currency: str, + event_output_config: price_create_params.NewFloatingEventOutputPriceEventOutputConfig, + item_id: str, + model_type: Literal["event_output"], + name: str, + billable_metric_id: Optional[str] | Omit = omit, + billed_in_advance: Optional[bool] | Omit = omit, + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + conversion_rate: Optional[float] | Omit = omit, + conversion_rate_config: Optional[price_create_params.NewFloatingEventOutputPriceConversionRateConfig] + | Omit = omit, + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | Omit = omit, + external_price_id: Optional[str] | Omit = omit, + fixed_price_quantity: Optional[float] | Omit = omit, + invoice_grouping_key: Optional[str] | Omit = omit, + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> Price: + """ + This endpoint is used to create a [price](/product-catalog/price-configuration). + A price created using this endpoint is always an add-on, meaning that it's not + associated with a specific plan and can instead be individually added to + subscriptions, including subscriptions on different plans. + + An `external_price_id` can be optionally specified as an alias to allow + ergonomic interaction with prices in the Orb API. + + See the [Price resource](/product-catalog/price-configuration) for the + specification of different price model configurations possible in this endpoint. + + Args: + cadence: The cadence to bill for this price on. + + currency: An ISO 4217 currency string for which this price is billed in. + + event_output_config: Configuration for event_output pricing + + item_id: The id of the item the price will be associated with. + + model_type: The pricing model type + + name: The name of the price. + + billable_metric_id: The id of the billable metric for the price. Only needed if the price is + usage-based. + + billed_in_advance: If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + + billing_cycle_configuration: For custom cadence: specifies the duration of the billing period in days or + months. + + conversion_rate: The per unit conversion rate of the price currency to the invoicing currency. + + conversion_rate_config: The configuration for the rate of the price currency to the invoicing currency. + + dimensional_price_configuration: For dimensional price: specifies a price group and dimension values + + external_price_id: An alias for the price. + + fixed_price_quantity: If the Price represents a fixed cost, this represents the quantity of units + applied. + + invoice_grouping_key: The property used to group this price on an invoice + + invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. + If unspecified, a single invoice is produced per billing cycle. + + metadata: User-specified key/value pairs for the resource. Individual keys can be removed + by setting the value to `null`, and the entire metadata mapping can be cleared + by setting `metadata` to `null`. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + ... + @required_args( ["cadence", "currency", "item_id", "model_type", "name", "unit_config"], ["cadence", "currency", "item_id", "model_type", "name", "tiered_config"], @@ -2699,6 +2795,7 @@ def create( ["cadence", "currency", "item_id", "model_type", "name", "scalable_matrix_with_tiered_pricing_config"], ["cadence", "cumulative_grouped_bulk_config", "currency", "item_id", "model_type", "name"], ["cadence", "currency", "item_id", "minimum_config", "model_type", "name"], + ["cadence", "currency", "event_output_config", "item_id", "model_type", "name"], ) def create( self, @@ -2732,7 +2829,8 @@ def create( | Literal["scalable_matrix_with_unit_pricing"] | Literal["scalable_matrix_with_tiered_pricing"] | Literal["cumulative_grouped_bulk"] - | Literal["minimum"], + | Literal["minimum"] + | Literal["event_output"], name: str, unit_config: UnitConfig | Omit = omit, billable_metric_id: Optional[str] | Omit = omit, @@ -2766,6 +2864,7 @@ def create( | Optional[price_create_params.NewFloatingScalableMatrixWithTieredPricingPriceConversionRateConfig] | Optional[price_create_params.NewFloatingCumulativeGroupedBulkPriceConversionRateConfig] | Optional[price_create_params.NewFloatingMinimumCompositePriceConversionRateConfig] + | Optional[price_create_params.NewFloatingEventOutputPriceConversionRateConfig] | Omit = omit, dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | Omit = omit, external_price_id: Optional[str] | Omit = omit, @@ -2817,6 +2916,7 @@ def create( cumulative_grouped_bulk_config: price_create_params.NewFloatingCumulativeGroupedBulkPriceCumulativeGroupedBulkConfig | Omit = omit, minimum_config: price_create_params.NewFloatingMinimumCompositePriceMinimumConfig | Omit = omit, + event_output_config: price_create_params.NewFloatingEventOutputPriceEventOutputConfig | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -2874,6 +2974,7 @@ def create( "scalable_matrix_with_tiered_pricing_config": scalable_matrix_with_tiered_pricing_config, "cumulative_grouped_bulk_config": cumulative_grouped_bulk_config, "minimum_config": minimum_config, + "event_output_config": event_output_config, }, price_create_params.PriceCreateParams, ), @@ -5919,6 +6020,102 @@ async def create( """ ... + @overload + async def create( + self, + *, + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], + currency: str, + event_output_config: price_create_params.NewFloatingEventOutputPriceEventOutputConfig, + item_id: str, + model_type: Literal["event_output"], + name: str, + billable_metric_id: Optional[str] | Omit = omit, + billed_in_advance: Optional[bool] | Omit = omit, + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + conversion_rate: Optional[float] | Omit = omit, + conversion_rate_config: Optional[price_create_params.NewFloatingEventOutputPriceConversionRateConfig] + | Omit = omit, + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | Omit = omit, + external_price_id: Optional[str] | Omit = omit, + fixed_price_quantity: Optional[float] | Omit = omit, + invoice_grouping_key: Optional[str] | Omit = omit, + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> Price: + """ + This endpoint is used to create a [price](/product-catalog/price-configuration). + A price created using this endpoint is always an add-on, meaning that it's not + associated with a specific plan and can instead be individually added to + subscriptions, including subscriptions on different plans. + + An `external_price_id` can be optionally specified as an alias to allow + ergonomic interaction with prices in the Orb API. + + See the [Price resource](/product-catalog/price-configuration) for the + specification of different price model configurations possible in this endpoint. + + Args: + cadence: The cadence to bill for this price on. + + currency: An ISO 4217 currency string for which this price is billed in. + + event_output_config: Configuration for event_output pricing + + item_id: The id of the item the price will be associated with. + + model_type: The pricing model type + + name: The name of the price. + + billable_metric_id: The id of the billable metric for the price. Only needed if the price is + usage-based. + + billed_in_advance: If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + + billing_cycle_configuration: For custom cadence: specifies the duration of the billing period in days or + months. + + conversion_rate: The per unit conversion rate of the price currency to the invoicing currency. + + conversion_rate_config: The configuration for the rate of the price currency to the invoicing currency. + + dimensional_price_configuration: For dimensional price: specifies a price group and dimension values + + external_price_id: An alias for the price. + + fixed_price_quantity: If the Price represents a fixed cost, this represents the quantity of units + applied. + + invoice_grouping_key: The property used to group this price on an invoice + + invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. + If unspecified, a single invoice is produced per billing cycle. + + metadata: User-specified key/value pairs for the resource. Individual keys can be removed + by setting the value to `null`, and the entire metadata mapping can be cleared + by setting `metadata` to `null`. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + ... + @required_args( ["cadence", "currency", "item_id", "model_type", "name", "unit_config"], ["cadence", "currency", "item_id", "model_type", "name", "tiered_config"], @@ -5947,6 +6144,7 @@ async def create( ["cadence", "currency", "item_id", "model_type", "name", "scalable_matrix_with_tiered_pricing_config"], ["cadence", "cumulative_grouped_bulk_config", "currency", "item_id", "model_type", "name"], ["cadence", "currency", "item_id", "minimum_config", "model_type", "name"], + ["cadence", "currency", "event_output_config", "item_id", "model_type", "name"], ) async def create( self, @@ -5980,7 +6178,8 @@ async def create( | Literal["scalable_matrix_with_unit_pricing"] | Literal["scalable_matrix_with_tiered_pricing"] | Literal["cumulative_grouped_bulk"] - | Literal["minimum"], + | Literal["minimum"] + | Literal["event_output"], name: str, unit_config: UnitConfig | Omit = omit, billable_metric_id: Optional[str] | Omit = omit, @@ -6014,6 +6213,7 @@ async def create( | Optional[price_create_params.NewFloatingScalableMatrixWithTieredPricingPriceConversionRateConfig] | Optional[price_create_params.NewFloatingCumulativeGroupedBulkPriceConversionRateConfig] | Optional[price_create_params.NewFloatingMinimumCompositePriceConversionRateConfig] + | Optional[price_create_params.NewFloatingEventOutputPriceConversionRateConfig] | Omit = omit, dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | Omit = omit, external_price_id: Optional[str] | Omit = omit, @@ -6065,6 +6265,7 @@ async def create( cumulative_grouped_bulk_config: price_create_params.NewFloatingCumulativeGroupedBulkPriceCumulativeGroupedBulkConfig | Omit = omit, minimum_config: price_create_params.NewFloatingMinimumCompositePriceMinimumConfig | Omit = omit, + event_output_config: price_create_params.NewFloatingEventOutputPriceEventOutputConfig | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -6122,6 +6323,7 @@ async def create( "scalable_matrix_with_tiered_pricing_config": scalable_matrix_with_tiered_pricing_config, "cumulative_grouped_bulk_config": cumulative_grouped_bulk_config, "minimum_config": minimum_config, + "event_output_config": event_output_config, }, price_create_params.PriceCreateParams, ), 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 bb5abaca..88993c84 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 @@ -56,6 +56,9 @@ "AddPricePriceNewPlanGroupedWithMinMaxThresholdsPrice", "AddPricePriceNewPlanGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig", "AddPricePriceNewPlanGroupedWithMinMaxThresholdsPriceConversionRateConfig", + "AddPricePriceNewPlanEventOutputPrice", + "AddPricePriceNewPlanEventOutputPriceEventOutputConfig", + "AddPricePriceNewPlanEventOutputPriceConversionRateConfig", "RemoveAdjustment", "RemovePrice", "ReplaceAdjustment", @@ -69,6 +72,9 @@ "ReplacePricePriceNewPlanGroupedWithMinMaxThresholdsPrice", "ReplacePricePriceNewPlanGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig", "ReplacePricePriceNewPlanGroupedWithMinMaxThresholdsPriceConversionRateConfig", + "ReplacePricePriceNewPlanEventOutputPrice", + "ReplacePricePriceNewPlanEventOutputPriceEventOutputConfig", + "ReplacePricePriceNewPlanEventOutputPriceConversionRateConfig", ] @@ -315,6 +321,103 @@ class AddPricePriceNewPlanGroupedWithMinMaxThresholdsPrice(TypedDict, total=Fals """ +class AddPricePriceNewPlanEventOutputPriceEventOutputConfig(TypedDict, total=False): + unit_rating_key: Required[str] + """The key in the event data to extract the unit rate from.""" + + grouping_key: Optional[str] + """An optional key in the event data to group by (e.g., event ID). + + All events will also be grouped by their unit rate. + """ + + +AddPricePriceNewPlanEventOutputPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPricePriceNewPlanEventOutputPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + event_output_config: Required[AddPricePriceNewPlanEventOutputPriceEventOutputConfig] + """Configuration for event_output pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["event_output"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[AddPricePriceNewPlanEventOutputPriceConversionRateConfig] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + AddPricePrice: TypeAlias = Union[ NewPlanUnitPrice, NewPlanTieredPrice, @@ -343,6 +446,7 @@ class AddPricePriceNewPlanGroupedWithMinMaxThresholdsPrice(TypedDict, total=Fals NewPlanScalableMatrixWithTieredPricingPrice, NewPlanCumulativeGroupedBulkPrice, NewPlanMinimumCompositePrice, + AddPricePriceNewPlanEventOutputPrice, ] @@ -593,6 +697,103 @@ class ReplacePricePriceNewPlanGroupedWithMinMaxThresholdsPrice(TypedDict, total= """ +class ReplacePricePriceNewPlanEventOutputPriceEventOutputConfig(TypedDict, total=False): + unit_rating_key: Required[str] + """The key in the event data to extract the unit rate from.""" + + grouping_key: Optional[str] + """An optional key in the event data to group by (e.g., event ID). + + All events will also be grouped by their unit rate. + """ + + +ReplacePricePriceNewPlanEventOutputPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePricePriceNewPlanEventOutputPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + event_output_config: Required[ReplacePricePriceNewPlanEventOutputPriceEventOutputConfig] + """Configuration for event_output pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["event_output"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ReplacePricePriceNewPlanEventOutputPriceConversionRateConfig] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + ReplacePricePrice: TypeAlias = Union[ NewPlanUnitPrice, NewPlanTieredPrice, @@ -621,6 +822,7 @@ class ReplacePricePriceNewPlanGroupedWithMinMaxThresholdsPrice(TypedDict, total= NewPlanScalableMatrixWithTieredPricingPrice, NewPlanCumulativeGroupedBulkPrice, NewPlanMinimumCompositePrice, + ReplacePricePriceNewPlanEventOutputPrice, ] diff --git a/src/orb/types/beta_create_plan_version_params.py b/src/orb/types/beta_create_plan_version_params.py index 2fbc9076..8fc1ae78 100644 --- a/src/orb/types/beta_create_plan_version_params.py +++ b/src/orb/types/beta_create_plan_version_params.py @@ -56,6 +56,9 @@ "AddPricePriceNewPlanGroupedWithMinMaxThresholdsPrice", "AddPricePriceNewPlanGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig", "AddPricePriceNewPlanGroupedWithMinMaxThresholdsPriceConversionRateConfig", + "AddPricePriceNewPlanEventOutputPrice", + "AddPricePriceNewPlanEventOutputPriceEventOutputConfig", + "AddPricePriceNewPlanEventOutputPriceConversionRateConfig", "RemoveAdjustment", "RemovePrice", "ReplaceAdjustment", @@ -69,6 +72,9 @@ "ReplacePricePriceNewPlanGroupedWithMinMaxThresholdsPrice", "ReplacePricePriceNewPlanGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig", "ReplacePricePriceNewPlanGroupedWithMinMaxThresholdsPriceConversionRateConfig", + "ReplacePricePriceNewPlanEventOutputPrice", + "ReplacePricePriceNewPlanEventOutputPriceEventOutputConfig", + "ReplacePricePriceNewPlanEventOutputPriceConversionRateConfig", ] @@ -315,6 +321,103 @@ class AddPricePriceNewPlanGroupedWithMinMaxThresholdsPrice(TypedDict, total=Fals """ +class AddPricePriceNewPlanEventOutputPriceEventOutputConfig(TypedDict, total=False): + unit_rating_key: Required[str] + """The key in the event data to extract the unit rate from.""" + + grouping_key: Optional[str] + """An optional key in the event data to group by (e.g., event ID). + + All events will also be grouped by their unit rate. + """ + + +AddPricePriceNewPlanEventOutputPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPricePriceNewPlanEventOutputPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + event_output_config: Required[AddPricePriceNewPlanEventOutputPriceEventOutputConfig] + """Configuration for event_output pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["event_output"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[AddPricePriceNewPlanEventOutputPriceConversionRateConfig] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + AddPricePrice: TypeAlias = Union[ NewPlanUnitPrice, NewPlanTieredPrice, @@ -343,6 +446,7 @@ class AddPricePriceNewPlanGroupedWithMinMaxThresholdsPrice(TypedDict, total=Fals NewPlanScalableMatrixWithTieredPricingPrice, NewPlanCumulativeGroupedBulkPrice, NewPlanMinimumCompositePrice, + AddPricePriceNewPlanEventOutputPrice, ] @@ -593,6 +697,103 @@ class ReplacePricePriceNewPlanGroupedWithMinMaxThresholdsPrice(TypedDict, total= """ +class ReplacePricePriceNewPlanEventOutputPriceEventOutputConfig(TypedDict, total=False): + unit_rating_key: Required[str] + """The key in the event data to extract the unit rate from.""" + + grouping_key: Optional[str] + """An optional key in the event data to group by (e.g., event ID). + + All events will also be grouped by their unit rate. + """ + + +ReplacePricePriceNewPlanEventOutputPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePricePriceNewPlanEventOutputPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + event_output_config: Required[ReplacePricePriceNewPlanEventOutputPriceEventOutputConfig] + """Configuration for event_output pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["event_output"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ReplacePricePriceNewPlanEventOutputPriceConversionRateConfig] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + ReplacePricePrice: TypeAlias = Union[ NewPlanUnitPrice, NewPlanTieredPrice, @@ -621,6 +822,7 @@ class ReplacePricePriceNewPlanGroupedWithMinMaxThresholdsPrice(TypedDict, total= NewPlanScalableMatrixWithTieredPricingPrice, NewPlanCumulativeGroupedBulkPrice, NewPlanMinimumCompositePrice, + ReplacePricePriceNewPlanEventOutputPrice, ] diff --git a/src/orb/types/item.py b/src/orb/types/item.py index 819f82f8..14e1ee31 100644 --- a/src/orb/types/item.py +++ b/src/orb/types/item.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, List +from typing import Dict, List, Optional from datetime import datetime from typing_extensions import Literal @@ -13,16 +13,24 @@ class ExternalConnection(BaseModel): external_connection_name: Literal[ "stripe", "quickbooks", "bill.com", "netsuite", "taxjar", "avalara", "anrok", "numeral" ] + """The name of the external system this item is connected to.""" external_entity_id: str + """The identifier of this item in the external system.""" class Item(BaseModel): id: str + """The Orb-assigned unique identifier for the item.""" created_at: datetime + """The time at which the item was created.""" external_connections: List[ExternalConnection] + """ + A list of external connections for this item, used to sync with external + invoicing and tax systems. + """ metadata: Dict[str, str] """User specified key-value pairs for the resource. @@ -33,3 +41,7 @@ class Item(BaseModel): """ name: str + """The name of the item.""" + + archived_at: Optional[datetime] = None + """The time at which the item was archived. If null, the item is not archived.""" diff --git a/src/orb/types/item_update_params.py b/src/orb/types/item_update_params.py index 2087a12d..360eaca8 100644 --- a/src/orb/types/item_update_params.py +++ b/src/orb/types/item_update_params.py @@ -25,5 +25,7 @@ class ExternalConnection(TypedDict, total=False): external_connection_name: Required[ Literal["stripe", "quickbooks", "bill.com", "netsuite", "taxjar", "avalara", "anrok", "numeral"] ] + """The name of the external system this item is connected to.""" external_entity_id: Required[str] + """The identifier of this item in the external system.""" diff --git a/src/orb/types/plan_create_params.py b/src/orb/types/plan_create_params.py index 090d4c20..c41e9f58 100644 --- a/src/orb/types/plan_create_params.py +++ b/src/orb/types/plan_create_params.py @@ -54,6 +54,9 @@ "PricePriceNewPlanGroupedWithMinMaxThresholdsPrice", "PricePriceNewPlanGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig", "PricePriceNewPlanGroupedWithMinMaxThresholdsPriceConversionRateConfig", + "PricePriceNewPlanEventOutputPrice", + "PricePriceNewPlanEventOutputPriceEventOutputConfig", + "PricePriceNewPlanEventOutputPriceConversionRateConfig", "Adjustment", "AdjustmentAdjustment", "PlanPhase", @@ -319,6 +322,103 @@ class PricePriceNewPlanGroupedWithMinMaxThresholdsPrice(TypedDict, total=False): """ +class PricePriceNewPlanEventOutputPriceEventOutputConfig(TypedDict, total=False): + unit_rating_key: Required[str] + """The key in the event data to extract the unit rate from.""" + + grouping_key: Optional[str] + """An optional key in the event data to group by (e.g., event ID). + + All events will also be grouped by their unit rate. + """ + + +PricePriceNewPlanEventOutputPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class PricePriceNewPlanEventOutputPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + event_output_config: Required[PricePriceNewPlanEventOutputPriceEventOutputConfig] + """Configuration for event_output pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["event_output"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[PricePriceNewPlanEventOutputPriceConversionRateConfig] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + PricePrice: TypeAlias = Union[ NewPlanUnitPrice, NewPlanTieredPrice, @@ -347,6 +447,7 @@ class PricePriceNewPlanGroupedWithMinMaxThresholdsPrice(TypedDict, total=False): NewPlanScalableMatrixWithTieredPricingPrice, NewPlanCumulativeGroupedBulkPrice, NewPlanMinimumCompositePrice, + PricePriceNewPlanEventOutputPrice, ] diff --git a/src/orb/types/price_create_params.py b/src/orb/types/price_create_params.py index fc68c12b..04203133 100644 --- a/src/orb/types/price_create_params.py +++ b/src/orb/types/price_create_params.py @@ -109,6 +109,9 @@ "NewFloatingMinimumCompositePrice", "NewFloatingMinimumCompositePriceMinimumConfig", "NewFloatingMinimumCompositePriceConversionRateConfig", + "NewFloatingEventOutputPrice", + "NewFloatingEventOutputPriceEventOutputConfig", + "NewFloatingEventOutputPriceConversionRateConfig", ] @@ -2591,6 +2594,92 @@ class NewFloatingMinimumCompositePriceMinimumConfig(TypedDict, total=False): UnitConversionRateConfig, TieredConversionRateConfig ] + +class NewFloatingEventOutputPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + event_output_config: Required[NewFloatingEventOutputPriceEventOutputConfig] + """Configuration for event_output pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["event_output"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[NewFloatingEventOutputPriceConversionRateConfig] + """The configuration for the rate of the price currency to the invoicing currency.""" + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + +class NewFloatingEventOutputPriceEventOutputConfig(TypedDict, total=False): + unit_rating_key: Required[str] + """The key in the event data to extract the unit rate from.""" + + grouping_key: Optional[str] + """An optional key in the event data to group by (e.g., event ID). + + All events will also be grouped by their unit rate. + """ + + +NewFloatingEventOutputPriceConversionRateConfig: TypeAlias = Union[UnitConversionRateConfig, TieredConversionRateConfig] + PriceCreateParams: TypeAlias = Union[ NewFloatingUnitPrice, NewFloatingTieredPrice, @@ -2619,4 +2708,5 @@ class NewFloatingMinimumCompositePriceMinimumConfig(TypedDict, total=False): NewFloatingScalableMatrixWithTieredPricingPrice, NewFloatingCumulativeGroupedBulkPrice, NewFloatingMinimumCompositePrice, + NewFloatingEventOutputPrice, ] diff --git a/src/orb/types/price_evaluate_multiple_params.py b/src/orb/types/price_evaluate_multiple_params.py index 3cf2bc6d..ddc020e1 100644 --- a/src/orb/types/price_evaluate_multiple_params.py +++ b/src/orb/types/price_evaluate_multiple_params.py @@ -50,6 +50,9 @@ "PriceEvaluationPriceNewFloatingGroupedWithMinMaxThresholdsPrice", "PriceEvaluationPriceNewFloatingGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig", "PriceEvaluationPriceNewFloatingGroupedWithMinMaxThresholdsPriceConversionRateConfig", + "PriceEvaluationPriceNewFloatingEventOutputPrice", + "PriceEvaluationPriceNewFloatingEventOutputPriceEventOutputConfig", + "PriceEvaluationPriceNewFloatingEventOutputPriceConversionRateConfig", ] @@ -167,6 +170,94 @@ class PriceEvaluationPriceNewFloatingGroupedWithMinMaxThresholdsPrice(TypedDict, """ +class PriceEvaluationPriceNewFloatingEventOutputPriceEventOutputConfig(TypedDict, total=False): + unit_rating_key: Required[str] + """The key in the event data to extract the unit rate from.""" + + grouping_key: Optional[str] + """An optional key in the event data to group by (e.g., event ID). + + All events will also be grouped by their unit rate. + """ + + +PriceEvaluationPriceNewFloatingEventOutputPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class PriceEvaluationPriceNewFloatingEventOutputPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + event_output_config: Required[PriceEvaluationPriceNewFloatingEventOutputPriceEventOutputConfig] + """Configuration for event_output pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["event_output"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[PriceEvaluationPriceNewFloatingEventOutputPriceConversionRateConfig] + """The configuration for the rate of the price currency to the invoicing currency.""" + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + PriceEvaluationPrice: TypeAlias = Union[ NewFloatingUnitPrice, NewFloatingTieredPrice, @@ -195,6 +286,7 @@ class PriceEvaluationPriceNewFloatingGroupedWithMinMaxThresholdsPrice(TypedDict, NewFloatingScalableMatrixWithTieredPricingPrice, NewFloatingCumulativeGroupedBulkPrice, NewFloatingMinimumCompositePrice, + PriceEvaluationPriceNewFloatingEventOutputPrice, ] diff --git a/src/orb/types/price_evaluate_preview_events_params.py b/src/orb/types/price_evaluate_preview_events_params.py index 8838236c..dad841be 100644 --- a/src/orb/types/price_evaluate_preview_events_params.py +++ b/src/orb/types/price_evaluate_preview_events_params.py @@ -51,6 +51,9 @@ "PriceEvaluationPriceNewFloatingGroupedWithMinMaxThresholdsPrice", "PriceEvaluationPriceNewFloatingGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig", "PriceEvaluationPriceNewFloatingGroupedWithMinMaxThresholdsPriceConversionRateConfig", + "PriceEvaluationPriceNewFloatingEventOutputPrice", + "PriceEvaluationPriceNewFloatingEventOutputPriceEventOutputConfig", + "PriceEvaluationPriceNewFloatingEventOutputPriceConversionRateConfig", ] @@ -199,6 +202,94 @@ class PriceEvaluationPriceNewFloatingGroupedWithMinMaxThresholdsPrice(TypedDict, """ +class PriceEvaluationPriceNewFloatingEventOutputPriceEventOutputConfig(TypedDict, total=False): + unit_rating_key: Required[str] + """The key in the event data to extract the unit rate from.""" + + grouping_key: Optional[str] + """An optional key in the event data to group by (e.g., event ID). + + All events will also be grouped by their unit rate. + """ + + +PriceEvaluationPriceNewFloatingEventOutputPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class PriceEvaluationPriceNewFloatingEventOutputPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + event_output_config: Required[PriceEvaluationPriceNewFloatingEventOutputPriceEventOutputConfig] + """Configuration for event_output pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["event_output"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[PriceEvaluationPriceNewFloatingEventOutputPriceConversionRateConfig] + """The configuration for the rate of the price currency to the invoicing currency.""" + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + PriceEvaluationPrice: TypeAlias = Union[ NewFloatingUnitPrice, NewFloatingTieredPrice, @@ -227,6 +318,7 @@ class PriceEvaluationPriceNewFloatingGroupedWithMinMaxThresholdsPrice(TypedDict, NewFloatingScalableMatrixWithTieredPricingPrice, NewFloatingCumulativeGroupedBulkPrice, NewFloatingMinimumCompositePrice, + PriceEvaluationPriceNewFloatingEventOutputPrice, ] diff --git a/src/orb/types/shared/item_slim.py b/src/orb/types/shared/item_slim.py index c35092ea..89976334 100644 --- a/src/orb/types/shared/item_slim.py +++ b/src/orb/types/shared/item_slim.py @@ -7,5 +7,7 @@ class ItemSlim(BaseModel): id: str + """The Orb-assigned unique identifier for the item.""" name: str + """The name of the item.""" diff --git a/src/orb/types/shared/price.py b/src/orb/types/shared/price.py index 10bc028b..3895d8b5 100644 --- a/src/orb/types/shared/price.py +++ b/src/orb/types/shared/price.py @@ -119,6 +119,9 @@ "MinimumCompositePrice", "MinimumCompositePriceConversionRateConfig", "MinimumCompositePriceMinimumConfig", + "EventOutputPrice", + "EventOutputPriceConversionRateConfig", + "EventOutputPriceEventOutputConfig", ] UnitPriceConversionRateConfig: TypeAlias = Annotated[ @@ -158,6 +161,10 @@ class UnitPrice(BaseModel): invoicing_cycle_configuration: Optional[BillingCycleConfiguration] = None item: ItemSlim + """ + A minimal representation of an Item containing only the essential identifying + information. + """ maximum: Optional[Maximum] = None @@ -233,6 +240,10 @@ class TieredPrice(BaseModel): invoicing_cycle_configuration: Optional[BillingCycleConfiguration] = None item: ItemSlim + """ + A minimal representation of an Item containing only the essential identifying + information. + """ maximum: Optional[Maximum] = None @@ -311,6 +322,10 @@ class BulkPrice(BaseModel): invoicing_cycle_configuration: Optional[BillingCycleConfiguration] = None item: ItemSlim + """ + A minimal representation of an Item containing only the essential identifying + information. + """ maximum: Optional[Maximum] = None @@ -383,6 +398,10 @@ class PackagePrice(BaseModel): invoicing_cycle_configuration: Optional[BillingCycleConfiguration] = None item: ItemSlim + """ + A minimal representation of an Item containing only the essential identifying + information. + """ maximum: Optional[Maximum] = None @@ -458,6 +477,10 @@ class MatrixPrice(BaseModel): invoicing_cycle_configuration: Optional[BillingCycleConfiguration] = None item: ItemSlim + """ + A minimal representation of an Item containing only the essential identifying + information. + """ matrix_config: MatrixConfig """Configuration for matrix pricing""" @@ -552,6 +575,10 @@ class ThresholdTotalAmountPrice(BaseModel): invoicing_cycle_configuration: Optional[BillingCycleConfiguration] = None item: ItemSlim + """ + A minimal representation of an Item containing only the essential identifying + information. + """ maximum: Optional[Maximum] = None @@ -648,6 +675,10 @@ class TieredPackagePrice(BaseModel): invoicing_cycle_configuration: Optional[BillingCycleConfiguration] = None item: ItemSlim + """ + A minimal representation of an Item containing only the essential identifying + information. + """ maximum: Optional[Maximum] = None @@ -748,6 +779,10 @@ class TieredWithMinimumPrice(BaseModel): invoicing_cycle_configuration: Optional[BillingCycleConfiguration] = None item: ItemSlim + """ + A minimal representation of an Item containing only the essential identifying + information. + """ maximum: Optional[Maximum] = None @@ -845,6 +880,10 @@ class GroupedTieredPrice(BaseModel): invoicing_cycle_configuration: Optional[BillingCycleConfiguration] = None item: ItemSlim + """ + A minimal representation of an Item containing only the essential identifying + information. + """ maximum: Optional[Maximum] = None @@ -939,6 +978,10 @@ class TieredPackageWithMinimumPrice(BaseModel): invoicing_cycle_configuration: Optional[BillingCycleConfiguration] = None item: ItemSlim + """ + A minimal representation of an Item containing only the essential identifying + information. + """ maximum: Optional[Maximum] = None @@ -1025,6 +1068,10 @@ class PackageWithAllocationPrice(BaseModel): invoicing_cycle_configuration: Optional[BillingCycleConfiguration] = None item: ItemSlim + """ + A minimal representation of an Item containing only the essential identifying + information. + """ maximum: Optional[Maximum] = None @@ -1108,6 +1155,10 @@ class UnitWithPercentPrice(BaseModel): invoicing_cycle_configuration: Optional[BillingCycleConfiguration] = None item: ItemSlim + """ + A minimal representation of an Item containing only the essential identifying + information. + """ maximum: Optional[Maximum] = None @@ -1183,6 +1234,10 @@ class MatrixWithAllocationPrice(BaseModel): invoicing_cycle_configuration: Optional[BillingCycleConfiguration] = None item: ItemSlim + """ + A minimal representation of an Item containing only the essential identifying + information. + """ matrix_with_allocation_config: MatrixWithAllocationConfig """Configuration for matrix_with_allocation pricing""" @@ -1274,6 +1329,10 @@ class TieredWithProrationPrice(BaseModel): invoicing_cycle_configuration: Optional[BillingCycleConfiguration] = None item: ItemSlim + """ + A minimal representation of an Item containing only the essential identifying + information. + """ maximum: Optional[Maximum] = None @@ -1354,6 +1413,10 @@ class UnitWithProrationPrice(BaseModel): invoicing_cycle_configuration: Optional[BillingCycleConfiguration] = None item: ItemSlim + """ + A minimal representation of an Item containing only the essential identifying + information. + """ maximum: Optional[Maximum] = None @@ -1443,6 +1506,10 @@ class GroupedAllocationPrice(BaseModel): invoicing_cycle_configuration: Optional[BillingCycleConfiguration] = None item: ItemSlim + """ + A minimal representation of an Item containing only the essential identifying + information. + """ maximum: Optional[Maximum] = None @@ -1531,6 +1598,10 @@ class BulkWithProrationPrice(BaseModel): invoicing_cycle_configuration: Optional[BillingCycleConfiguration] = None item: ItemSlim + """ + A minimal representation of an Item containing only the essential identifying + information. + """ maximum: Optional[Maximum] = None @@ -1617,6 +1688,10 @@ class GroupedWithProratedMinimumPrice(BaseModel): invoicing_cycle_configuration: Optional[BillingCycleConfiguration] = None item: ItemSlim + """ + A minimal representation of an Item containing only the essential identifying + information. + """ maximum: Optional[Maximum] = None @@ -1734,6 +1809,10 @@ class GroupedWithMeteredMinimumPrice(BaseModel): invoicing_cycle_configuration: Optional[BillingCycleConfiguration] = None item: ItemSlim + """ + A minimal representation of an Item containing only the essential identifying + information. + """ maximum: Optional[Maximum] = None @@ -1823,6 +1902,10 @@ class GroupedWithMinMaxThresholdsPrice(BaseModel): invoicing_cycle_configuration: Optional[BillingCycleConfiguration] = None item: ItemSlim + """ + A minimal representation of an Item containing only the essential identifying + information. + """ maximum: Optional[Maximum] = None @@ -1914,6 +1997,10 @@ class MatrixWithDisplayNamePrice(BaseModel): invoicing_cycle_configuration: Optional[BillingCycleConfiguration] = None item: ItemSlim + """ + A minimal representation of an Item containing only the essential identifying + information. + """ matrix_with_display_name_config: MatrixWithDisplayNamePriceMatrixWithDisplayNameConfig """Configuration for matrix_with_display_name pricing""" @@ -2014,6 +2101,10 @@ class GroupedTieredPackagePrice(BaseModel): invoicing_cycle_configuration: Optional[BillingCycleConfiguration] = None item: ItemSlim + """ + A minimal representation of an Item containing only the essential identifying + information. + """ maximum: Optional[Maximum] = None @@ -2107,6 +2198,10 @@ class MaxGroupTieredPackagePrice(BaseModel): invoicing_cycle_configuration: Optional[BillingCycleConfiguration] = None item: ItemSlim + """ + A minimal representation of an Item containing only the essential identifying + information. + """ max_group_tiered_package_config: MaxGroupTieredPackagePriceMaxGroupTieredPackageConfig """Configuration for max_group_tiered_package pricing""" @@ -2212,6 +2307,10 @@ class ScalableMatrixWithUnitPricingPrice(BaseModel): invoicing_cycle_configuration: Optional[BillingCycleConfiguration] = None item: ItemSlim + """ + A minimal representation of an Item containing only the essential identifying + information. + """ maximum: Optional[Maximum] = None @@ -2322,6 +2421,10 @@ class ScalableMatrixWithTieredPricingPrice(BaseModel): invoicing_cycle_configuration: Optional[BillingCycleConfiguration] = None item: ItemSlim + """ + A minimal representation of an Item containing only the essential identifying + information. + """ maximum: Optional[Maximum] = None @@ -2421,6 +2524,10 @@ class CumulativeGroupedBulkPrice(BaseModel): invoicing_cycle_configuration: Optional[BillingCycleConfiguration] = None item: ItemSlim + """ + A minimal representation of an Item containing only the essential identifying + information. + """ maximum: Optional[Maximum] = None @@ -2501,6 +2608,10 @@ class MinimumCompositePrice(BaseModel): invoicing_cycle_configuration: Optional[BillingCycleConfiguration] = None item: ItemSlim + """ + A minimal representation of an Item containing only the essential identifying + information. + """ maximum: Optional[Maximum] = None @@ -2539,6 +2650,96 @@ class MinimumCompositePrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None +EventOutputPriceConversionRateConfig: TypeAlias = Annotated[ + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") +] + + +class EventOutputPriceEventOutputConfig(BaseModel): + unit_rating_key: str + """The key in the event data to extract the unit rate from.""" + + grouping_key: Optional[str] = None + """An optional key in the event data to group by (e.g., event ID). + + All events will also be grouped by their unit rate. + """ + + +class EventOutputPrice(BaseModel): + id: str + + billable_metric: Optional[BillableMetricTiny] = None + + billing_cycle_configuration: BillingCycleConfiguration + + billing_mode: Literal["in_advance", "in_arrear"] + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + composite_price_filters: Optional[List[TransformPriceFilter]] = None + + conversion_rate: Optional[float] = None + + conversion_rate_config: Optional[EventOutputPriceConversionRateConfig] = None + + created_at: datetime + + credit_allocation: Optional[Allocation] = None + + currency: str + + discount: Optional[Discount] = None + + event_output_config: EventOutputPriceEventOutputConfig + """Configuration for event_output pricing""" + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + invoicing_cycle_configuration: Optional[BillingCycleConfiguration] = None + + item: ItemSlim + """ + A minimal representation of an Item containing only the essential identifying + information. + """ + + maximum: Optional[Maximum] = None + + maximum_amount: Optional[str] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + minimum: Optional[Minimum] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["event_output"] = FieldInfo(alias="model_type") + """The pricing model type""" + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price", "composite_price"] + + replaces_price_id: Optional[str] = None + """The price id this price replaces. + + This price will take the place of the replaced price in plan version migrations. + """ + + dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None + + Price: TypeAlias = Annotated[ Union[ UnitPrice, @@ -2568,6 +2769,7 @@ class MinimumCompositePrice(BaseModel): ScalableMatrixWithTieredPricingPrice, CumulativeGroupedBulkPrice, MinimumCompositePrice, + EventOutputPrice, ], PropertyInfo(discriminator="price_model_type"), ] diff --git a/src/orb/types/subscription_create_params.py b/src/orb/types/subscription_create_params.py index 93fe7d74..1d2cf474 100644 --- a/src/orb/types/subscription_create_params.py +++ b/src/orb/types/subscription_create_params.py @@ -67,6 +67,9 @@ "AddPricePriceNewSubscriptionGroupedWithMinMaxThresholdsPrice", "AddPricePriceNewSubscriptionGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig", "AddPricePriceNewSubscriptionGroupedWithMinMaxThresholdsPriceConversionRateConfig", + "AddPricePriceNewSubscriptionEventOutputPrice", + "AddPricePriceNewSubscriptionEventOutputPriceEventOutputConfig", + "AddPricePriceNewSubscriptionEventOutputPriceConversionRateConfig", "RemoveAdjustment", "RemovePrice", "ReplaceAdjustment", @@ -80,6 +83,9 @@ "ReplacePricePriceNewSubscriptionGroupedWithMinMaxThresholdsPrice", "ReplacePricePriceNewSubscriptionGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig", "ReplacePricePriceNewSubscriptionGroupedWithMinMaxThresholdsPriceConversionRateConfig", + "ReplacePricePriceNewSubscriptionEventOutputPrice", + "ReplacePricePriceNewSubscriptionEventOutputPriceEventOutputConfig", + "ReplacePricePriceNewSubscriptionEventOutputPriceConversionRateConfig", ] @@ -488,6 +494,103 @@ class AddPricePriceNewSubscriptionGroupedWithMinMaxThresholdsPrice(TypedDict, to """ +class AddPricePriceNewSubscriptionEventOutputPriceEventOutputConfig(TypedDict, total=False): + unit_rating_key: Required[str] + """The key in the event data to extract the unit rate from.""" + + grouping_key: Optional[str] + """An optional key in the event data to group by (e.g., event ID). + + All events will also be grouped by their unit rate. + """ + + +AddPricePriceNewSubscriptionEventOutputPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPricePriceNewSubscriptionEventOutputPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + event_output_config: Required[AddPricePriceNewSubscriptionEventOutputPriceEventOutputConfig] + """Configuration for event_output pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["event_output"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[AddPricePriceNewSubscriptionEventOutputPriceConversionRateConfig] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + AddPricePrice: TypeAlias = Union[ NewSubscriptionUnitPriceParam, NewSubscriptionTieredPriceParam, @@ -516,6 +619,7 @@ class AddPricePriceNewSubscriptionGroupedWithMinMaxThresholdsPrice(TypedDict, to NewSubscriptionScalableMatrixWithTieredPricingPriceParam, NewSubscriptionCumulativeGroupedBulkPriceParam, NewSubscriptionMinimumCompositePriceParam, + AddPricePriceNewSubscriptionEventOutputPrice, ] @@ -804,6 +908,103 @@ class ReplacePricePriceNewSubscriptionGroupedWithMinMaxThresholdsPrice(TypedDict """ +class ReplacePricePriceNewSubscriptionEventOutputPriceEventOutputConfig(TypedDict, total=False): + unit_rating_key: Required[str] + """The key in the event data to extract the unit rate from.""" + + grouping_key: Optional[str] + """An optional key in the event data to group by (e.g., event ID). + + All events will also be grouped by their unit rate. + """ + + +ReplacePricePriceNewSubscriptionEventOutputPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePricePriceNewSubscriptionEventOutputPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + event_output_config: Required[ReplacePricePriceNewSubscriptionEventOutputPriceEventOutputConfig] + """Configuration for event_output pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["event_output"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ReplacePricePriceNewSubscriptionEventOutputPriceConversionRateConfig] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + ReplacePricePrice: TypeAlias = Union[ NewSubscriptionUnitPriceParam, NewSubscriptionTieredPriceParam, @@ -832,6 +1033,7 @@ class ReplacePricePriceNewSubscriptionGroupedWithMinMaxThresholdsPrice(TypedDict NewSubscriptionScalableMatrixWithTieredPricingPriceParam, NewSubscriptionCumulativeGroupedBulkPriceParam, NewSubscriptionMinimumCompositePriceParam, + ReplacePricePriceNewSubscriptionEventOutputPrice, ] diff --git a/src/orb/types/subscription_price_intervals_params.py b/src/orb/types/subscription_price_intervals_params.py index 88e5e50e..59349dd4 100644 --- a/src/orb/types/subscription_price_intervals_params.py +++ b/src/orb/types/subscription_price_intervals_params.py @@ -62,6 +62,9 @@ "AddPriceNewFloatingGroupedWithMinMaxThresholdsPrice", "AddPriceNewFloatingGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig", "AddPriceNewFloatingGroupedWithMinMaxThresholdsPriceConversionRateConfig", + "AddPriceNewFloatingEventOutputPrice", + "AddPriceNewFloatingEventOutputPriceEventOutputConfig", + "AddPriceNewFloatingEventOutputPriceConversionRateConfig", "AddAdjustment", "AddAdjustmentAdjustment", "Edit", @@ -226,6 +229,94 @@ class AddPriceNewFloatingGroupedWithMinMaxThresholdsPrice(TypedDict, total=False """ +class AddPriceNewFloatingEventOutputPriceEventOutputConfig(TypedDict, total=False): + unit_rating_key: Required[str] + """The key in the event data to extract the unit rate from.""" + + grouping_key: Optional[str] + """An optional key in the event data to group by (e.g., event ID). + + All events will also be grouped by their unit rate. + """ + + +AddPriceNewFloatingEventOutputPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceNewFloatingEventOutputPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + event_output_config: Required[AddPriceNewFloatingEventOutputPriceEventOutputConfig] + """Configuration for event_output pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["event_output"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[AddPriceNewFloatingEventOutputPriceConversionRateConfig] + """The configuration for the rate of the price currency to the invoicing currency.""" + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + AddPrice: TypeAlias = Union[ NewFloatingUnitPrice, NewFloatingTieredPrice, @@ -254,6 +345,7 @@ class AddPriceNewFloatingGroupedWithMinMaxThresholdsPrice(TypedDict, total=False NewFloatingScalableMatrixWithTieredPricingPrice, NewFloatingCumulativeGroupedBulkPrice, NewFloatingMinimumCompositePrice, + AddPriceNewFloatingEventOutputPrice, ] diff --git a/src/orb/types/subscription_schedule_plan_change_params.py b/src/orb/types/subscription_schedule_plan_change_params.py index cfc32943..31f52a36 100644 --- a/src/orb/types/subscription_schedule_plan_change_params.py +++ b/src/orb/types/subscription_schedule_plan_change_params.py @@ -67,6 +67,9 @@ "AddPricePriceNewSubscriptionGroupedWithMinMaxThresholdsPrice", "AddPricePriceNewSubscriptionGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig", "AddPricePriceNewSubscriptionGroupedWithMinMaxThresholdsPriceConversionRateConfig", + "AddPricePriceNewSubscriptionEventOutputPrice", + "AddPricePriceNewSubscriptionEventOutputPriceEventOutputConfig", + "AddPricePriceNewSubscriptionEventOutputPriceConversionRateConfig", "RemoveAdjustment", "RemovePrice", "ReplaceAdjustment", @@ -80,6 +83,9 @@ "ReplacePricePriceNewSubscriptionGroupedWithMinMaxThresholdsPrice", "ReplacePricePriceNewSubscriptionGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig", "ReplacePricePriceNewSubscriptionGroupedWithMinMaxThresholdsPriceConversionRateConfig", + "ReplacePricePriceNewSubscriptionEventOutputPrice", + "ReplacePricePriceNewSubscriptionEventOutputPriceEventOutputConfig", + "ReplacePricePriceNewSubscriptionEventOutputPriceConversionRateConfig", ] @@ -476,6 +482,103 @@ class AddPricePriceNewSubscriptionGroupedWithMinMaxThresholdsPrice(TypedDict, to """ +class AddPricePriceNewSubscriptionEventOutputPriceEventOutputConfig(TypedDict, total=False): + unit_rating_key: Required[str] + """The key in the event data to extract the unit rate from.""" + + grouping_key: Optional[str] + """An optional key in the event data to group by (e.g., event ID). + + All events will also be grouped by their unit rate. + """ + + +AddPricePriceNewSubscriptionEventOutputPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPricePriceNewSubscriptionEventOutputPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + event_output_config: Required[AddPricePriceNewSubscriptionEventOutputPriceEventOutputConfig] + """Configuration for event_output pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["event_output"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[AddPricePriceNewSubscriptionEventOutputPriceConversionRateConfig] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + AddPricePrice: TypeAlias = Union[ NewSubscriptionUnitPriceParam, NewSubscriptionTieredPriceParam, @@ -504,6 +607,7 @@ class AddPricePriceNewSubscriptionGroupedWithMinMaxThresholdsPrice(TypedDict, to NewSubscriptionScalableMatrixWithTieredPricingPriceParam, NewSubscriptionCumulativeGroupedBulkPriceParam, NewSubscriptionMinimumCompositePriceParam, + AddPricePriceNewSubscriptionEventOutputPrice, ] @@ -792,6 +896,103 @@ class ReplacePricePriceNewSubscriptionGroupedWithMinMaxThresholdsPrice(TypedDict """ +class ReplacePricePriceNewSubscriptionEventOutputPriceEventOutputConfig(TypedDict, total=False): + unit_rating_key: Required[str] + """The key in the event data to extract the unit rate from.""" + + grouping_key: Optional[str] + """An optional key in the event data to group by (e.g., event ID). + + All events will also be grouped by their unit rate. + """ + + +ReplacePricePriceNewSubscriptionEventOutputPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePricePriceNewSubscriptionEventOutputPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + event_output_config: Required[ReplacePricePriceNewSubscriptionEventOutputPriceEventOutputConfig] + """Configuration for event_output pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["event_output"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ReplacePricePriceNewSubscriptionEventOutputPriceConversionRateConfig] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + ReplacePricePrice: TypeAlias = Union[ NewSubscriptionUnitPriceParam, NewSubscriptionTieredPriceParam, @@ -820,6 +1021,7 @@ class ReplacePricePriceNewSubscriptionGroupedWithMinMaxThresholdsPrice(TypedDict NewSubscriptionScalableMatrixWithTieredPricingPriceParam, NewSubscriptionCumulativeGroupedBulkPriceParam, NewSubscriptionMinimumCompositePriceParam, + ReplacePricePriceNewSubscriptionEventOutputPrice, ] diff --git a/tests/api_resources/test_prices.py b/tests/api_resources/test_prices.py index f343290b..bcfcc30e 100644 --- a/tests/api_resources/test_prices.py +++ b/tests/api_resources/test_prices.py @@ -3092,6 +3092,91 @@ def test_streaming_response_create_overload_27(self, client: Orb) -> None: assert cast(Any, response.is_closed) is True + @parametrize + def test_method_create_overload_28(self, client: Orb) -> None: + price = client.prices.create( + cadence="annual", + currency="currency", + event_output_config={"unit_rating_key": "x"}, + item_id="item_id", + model_type="event_output", + name="Annual fee", + ) + assert_matches_type(Price, price, path=["response"]) + + @parametrize + def test_method_create_with_all_params_overload_28(self, client: Orb) -> None: + price = client.prices.create( + cadence="annual", + currency="currency", + event_output_config={ + "unit_rating_key": "x", + "grouping_key": "grouping_key", + }, + item_id="item_id", + model_type="event_output", + name="Annual fee", + billable_metric_id="billable_metric_id", + billed_in_advance=True, + billing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, + conversion_rate=0, + conversion_rate_config={ + "conversion_rate_type": "unit", + "unit_config": {"unit_amount": "unit_amount"}, + }, + dimensional_price_configuration={ + "dimension_values": ["string"], + "dimensional_price_group_id": "dimensional_price_group_id", + "external_dimensional_price_group_id": "external_dimensional_price_group_id", + }, + external_price_id="external_price_id", + fixed_price_quantity=0, + invoice_grouping_key="x", + invoicing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, + metadata={"foo": "string"}, + ) + assert_matches_type(Price, price, path=["response"]) + + @parametrize + def test_raw_response_create_overload_28(self, client: Orb) -> None: + response = client.prices.with_raw_response.create( + cadence="annual", + currency="currency", + event_output_config={"unit_rating_key": "x"}, + item_id="item_id", + model_type="event_output", + name="Annual fee", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + price = response.parse() + assert_matches_type(Price, price, path=["response"]) + + @parametrize + def test_streaming_response_create_overload_28(self, client: Orb) -> None: + with client.prices.with_streaming_response.create( + cadence="annual", + currency="currency", + event_output_config={"unit_rating_key": "x"}, + item_id="item_id", + model_type="event_output", + name="Annual fee", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + price = response.parse() + assert_matches_type(Price, price, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize def test_method_update(self, client: Orb) -> None: price = client.prices.update( @@ -6519,6 +6604,91 @@ async def test_streaming_response_create_overload_27(self, async_client: AsyncOr assert cast(Any, response.is_closed) is True + @parametrize + async def test_method_create_overload_28(self, async_client: AsyncOrb) -> None: + price = await async_client.prices.create( + cadence="annual", + currency="currency", + event_output_config={"unit_rating_key": "x"}, + item_id="item_id", + model_type="event_output", + name="Annual fee", + ) + assert_matches_type(Price, price, path=["response"]) + + @parametrize + async def test_method_create_with_all_params_overload_28(self, async_client: AsyncOrb) -> None: + price = await async_client.prices.create( + cadence="annual", + currency="currency", + event_output_config={ + "unit_rating_key": "x", + "grouping_key": "grouping_key", + }, + item_id="item_id", + model_type="event_output", + name="Annual fee", + billable_metric_id="billable_metric_id", + billed_in_advance=True, + billing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, + conversion_rate=0, + conversion_rate_config={ + "conversion_rate_type": "unit", + "unit_config": {"unit_amount": "unit_amount"}, + }, + dimensional_price_configuration={ + "dimension_values": ["string"], + "dimensional_price_group_id": "dimensional_price_group_id", + "external_dimensional_price_group_id": "external_dimensional_price_group_id", + }, + external_price_id="external_price_id", + fixed_price_quantity=0, + invoice_grouping_key="x", + invoicing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, + metadata={"foo": "string"}, + ) + assert_matches_type(Price, price, path=["response"]) + + @parametrize + async def test_raw_response_create_overload_28(self, async_client: AsyncOrb) -> None: + response = await async_client.prices.with_raw_response.create( + cadence="annual", + currency="currency", + event_output_config={"unit_rating_key": "x"}, + item_id="item_id", + model_type="event_output", + name="Annual fee", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + price = response.parse() + assert_matches_type(Price, price, path=["response"]) + + @parametrize + async def test_streaming_response_create_overload_28(self, async_client: AsyncOrb) -> None: + async with async_client.prices.with_streaming_response.create( + cadence="annual", + currency="currency", + event_output_config={"unit_rating_key": "x"}, + item_id="item_id", + model_type="event_output", + name="Annual fee", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + price = await response.parse() + assert_matches_type(Price, price, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize async def test_method_update(self, async_client: AsyncOrb) -> None: price = await async_client.prices.update(