From 71281fc13a53085581f3a32e3f5ea1a13d345f3a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Oct 2025 01:31:16 +0000 Subject: [PATCH 1/2] feat(api): api update --- .stats.yml | 4 +- src/orb/resources/prices/prices.py | 202 ++++++++++++++++++ ...rnal_plan_id_create_plan_version_params.py | 190 ++++++++++++++++ .../types/beta_create_plan_version_params.py | 190 ++++++++++++++++ src/orb/types/plan_create_params.py | 95 ++++++++ src/orb/types/price_create_params.py | 86 ++++++++ .../types/price_evaluate_multiple_params.py | 86 ++++++++ .../price_evaluate_preview_events_params.py | 86 ++++++++ src/orb/types/shared/price.py | 88 ++++++++ src/orb/types/subscription_create_params.py | 190 ++++++++++++++++ .../subscription_price_intervals_params.py | 86 ++++++++ ...ubscription_schedule_plan_change_params.py | 190 ++++++++++++++++ tests/api_resources/test_prices.py | 176 ++++++++++++++- 13 files changed, 1661 insertions(+), 8 deletions(-) diff --git a/.stats.yml b/.stats.yml index 4b69c08a..3407ffd1 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-297c7ce95bc0aa1ac6f324a487515f49b8a30b74eb9d39ca9dcd2d9cf065f0ef.yml -openapi_spec_hash: 29e9af981bc78379336079bb4208c54d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-b070c1d97a6e3b400f43d2bce36c22ed89d432345b26374728c55dd0a20f0afa.yml +openapi_spec_hash: dba4ff52c381cda6159fc56d8b77eb32 config_hash: 1f73a949b649ecfe6ec68ba1bb459dc2 diff --git a/src/orb/resources/prices/prices.py b/src/orb/resources/prices/prices.py index 5af99d3a..902675cf 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, + item_id: str, + model_type: Literal["percent"], + name: str, + percent_config: price_create_params.NewFloatingPercentCompositePricePercentConfig, + 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.NewFloatingPercentCompositePriceConversionRateConfig] + | 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. + + 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. + + percent_config: Configuration for percent pricing + + billable_metric_id: The id of the billable metric for the price. Only needed if the price is + usage-based. + + billed_in_advance: If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + + billing_cycle_configuration: For custom cadence: specifies the duration of the billing period in days or + months. + + conversion_rate: The per unit conversion rate of the price currency to the invoicing currency. + + conversion_rate_config: The configuration for the rate of the price currency to the invoicing currency. + + dimensional_price_configuration: For dimensional price: specifies a price group and dimension values + + external_price_id: An alias for the price. + + fixed_price_quantity: If the Price represents a fixed cost, this represents the quantity of units + applied. + + invoice_grouping_key: The property used to group this price on an invoice + + invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. + If unspecified, a single invoice is produced per billing cycle. + + metadata: User-specified key/value pairs for the resource. Individual keys can be removed + by setting the value to `null`, and the entire metadata mapping can be cleared + by setting `metadata` to `null`. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + ... + @overload def create( self, @@ -2795,6 +2891,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", "item_id", "model_type", "name", "percent_config"], ["cadence", "currency", "event_output_config", "item_id", "model_type", "name"], ) def create( @@ -2830,6 +2927,7 @@ def create( | Literal["scalable_matrix_with_tiered_pricing"] | Literal["cumulative_grouped_bulk"] | Literal["minimum"] + | Literal["percent"] | Literal["event_output"], name: str, unit_config: UnitConfig | Omit = omit, @@ -2864,6 +2962,7 @@ def create( | Optional[price_create_params.NewFloatingScalableMatrixWithTieredPricingPriceConversionRateConfig] | Optional[price_create_params.NewFloatingCumulativeGroupedBulkPriceConversionRateConfig] | Optional[price_create_params.NewFloatingMinimumCompositePriceConversionRateConfig] + | Optional[price_create_params.NewFloatingPercentCompositePriceConversionRateConfig] | Optional[price_create_params.NewFloatingEventOutputPriceConversionRateConfig] | Omit = omit, dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | Omit = omit, @@ -2916,6 +3015,7 @@ def create( cumulative_grouped_bulk_config: price_create_params.NewFloatingCumulativeGroupedBulkPriceCumulativeGroupedBulkConfig | Omit = omit, minimum_config: price_create_params.NewFloatingMinimumCompositePriceMinimumConfig | Omit = omit, + percent_config: price_create_params.NewFloatingPercentCompositePricePercentConfig | 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. @@ -2974,6 +3074,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, + "percent_config": percent_config, "event_output_config": event_output_config, }, price_create_params.PriceCreateParams, @@ -6020,6 +6121,102 @@ async def create( """ ... + @overload + async def create( + self, + *, + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], + currency: str, + item_id: str, + model_type: Literal["percent"], + name: str, + percent_config: price_create_params.NewFloatingPercentCompositePricePercentConfig, + 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.NewFloatingPercentCompositePriceConversionRateConfig] + | 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. + + 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. + + percent_config: Configuration for percent pricing + + billable_metric_id: The id of the billable metric for the price. Only needed if the price is + usage-based. + + billed_in_advance: If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + + billing_cycle_configuration: For custom cadence: specifies the duration of the billing period in days or + months. + + conversion_rate: The per unit conversion rate of the price currency to the invoicing currency. + + conversion_rate_config: The configuration for the rate of the price currency to the invoicing currency. + + dimensional_price_configuration: For dimensional price: specifies a price group and dimension values + + external_price_id: An alias for the price. + + fixed_price_quantity: If the Price represents a fixed cost, this represents the quantity of units + applied. + + invoice_grouping_key: The property used to group this price on an invoice + + invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. + If unspecified, a single invoice is produced per billing cycle. + + metadata: User-specified key/value pairs for the resource. Individual keys can be removed + by setting the value to `null`, and the entire metadata mapping can be cleared + by setting `metadata` to `null`. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + ... + @overload async def create( self, @@ -6144,6 +6341,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", "item_id", "model_type", "name", "percent_config"], ["cadence", "currency", "event_output_config", "item_id", "model_type", "name"], ) async def create( @@ -6179,6 +6377,7 @@ async def create( | Literal["scalable_matrix_with_tiered_pricing"] | Literal["cumulative_grouped_bulk"] | Literal["minimum"] + | Literal["percent"] | Literal["event_output"], name: str, unit_config: UnitConfig | Omit = omit, @@ -6213,6 +6412,7 @@ async def create( | Optional[price_create_params.NewFloatingScalableMatrixWithTieredPricingPriceConversionRateConfig] | Optional[price_create_params.NewFloatingCumulativeGroupedBulkPriceConversionRateConfig] | Optional[price_create_params.NewFloatingMinimumCompositePriceConversionRateConfig] + | Optional[price_create_params.NewFloatingPercentCompositePriceConversionRateConfig] | Optional[price_create_params.NewFloatingEventOutputPriceConversionRateConfig] | Omit = omit, dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] | Omit = omit, @@ -6265,6 +6465,7 @@ async def create( cumulative_grouped_bulk_config: price_create_params.NewFloatingCumulativeGroupedBulkPriceCumulativeGroupedBulkConfig | Omit = omit, minimum_config: price_create_params.NewFloatingMinimumCompositePriceMinimumConfig | Omit = omit, + percent_config: price_create_params.NewFloatingPercentCompositePricePercentConfig | 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. @@ -6323,6 +6524,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, + "percent_config": percent_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 88993c84..57e95cc3 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", + "AddPricePriceNewPlanPercentCompositePrice", + "AddPricePriceNewPlanPercentCompositePricePercentConfig", + "AddPricePriceNewPlanPercentCompositePriceConversionRateConfig", "AddPricePriceNewPlanEventOutputPrice", "AddPricePriceNewPlanEventOutputPriceEventOutputConfig", "AddPricePriceNewPlanEventOutputPriceConversionRateConfig", @@ -72,6 +75,9 @@ "ReplacePricePriceNewPlanGroupedWithMinMaxThresholdsPrice", "ReplacePricePriceNewPlanGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig", "ReplacePricePriceNewPlanGroupedWithMinMaxThresholdsPriceConversionRateConfig", + "ReplacePricePriceNewPlanPercentCompositePrice", + "ReplacePricePriceNewPlanPercentCompositePricePercentConfig", + "ReplacePricePriceNewPlanPercentCompositePriceConversionRateConfig", "ReplacePricePriceNewPlanEventOutputPrice", "ReplacePricePriceNewPlanEventOutputPriceEventOutputConfig", "ReplacePricePriceNewPlanEventOutputPriceConversionRateConfig", @@ -321,6 +327,97 @@ class AddPricePriceNewPlanGroupedWithMinMaxThresholdsPrice(TypedDict, total=Fals """ +class AddPricePriceNewPlanPercentCompositePricePercentConfig(TypedDict, total=False): + percent: Required[float] + """What percent of the component subtotals to charge""" + + +AddPricePriceNewPlanPercentCompositePriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPricePriceNewPlanPercentCompositePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["percent"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + percent_config: Required[AddPricePriceNewPlanPercentCompositePricePercentConfig] + """Configuration for percent pricing""" + + 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[AddPricePriceNewPlanPercentCompositePriceConversionRateConfig] + """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. + """ + + class AddPricePriceNewPlanEventOutputPriceEventOutputConfig(TypedDict, total=False): unit_rating_key: Required[str] """The key in the event data to extract the unit rate from.""" @@ -446,6 +543,7 @@ class AddPricePriceNewPlanEventOutputPrice(TypedDict, total=False): NewPlanScalableMatrixWithTieredPricingPrice, NewPlanCumulativeGroupedBulkPrice, NewPlanMinimumCompositePrice, + AddPricePriceNewPlanPercentCompositePrice, AddPricePriceNewPlanEventOutputPrice, ] @@ -697,6 +795,97 @@ class ReplacePricePriceNewPlanGroupedWithMinMaxThresholdsPrice(TypedDict, total= """ +class ReplacePricePriceNewPlanPercentCompositePricePercentConfig(TypedDict, total=False): + percent: Required[float] + """What percent of the component subtotals to charge""" + + +ReplacePricePriceNewPlanPercentCompositePriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePricePriceNewPlanPercentCompositePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["percent"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + percent_config: Required[ReplacePricePriceNewPlanPercentCompositePricePercentConfig] + """Configuration for percent pricing""" + + 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[ReplacePricePriceNewPlanPercentCompositePriceConversionRateConfig] + """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. + """ + + class ReplacePricePriceNewPlanEventOutputPriceEventOutputConfig(TypedDict, total=False): unit_rating_key: Required[str] """The key in the event data to extract the unit rate from.""" @@ -822,6 +1011,7 @@ class ReplacePricePriceNewPlanEventOutputPrice(TypedDict, total=False): NewPlanScalableMatrixWithTieredPricingPrice, NewPlanCumulativeGroupedBulkPrice, NewPlanMinimumCompositePrice, + ReplacePricePriceNewPlanPercentCompositePrice, ReplacePricePriceNewPlanEventOutputPrice, ] diff --git a/src/orb/types/beta_create_plan_version_params.py b/src/orb/types/beta_create_plan_version_params.py index 8fc1ae78..c2bbf77f 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", + "AddPricePriceNewPlanPercentCompositePrice", + "AddPricePriceNewPlanPercentCompositePricePercentConfig", + "AddPricePriceNewPlanPercentCompositePriceConversionRateConfig", "AddPricePriceNewPlanEventOutputPrice", "AddPricePriceNewPlanEventOutputPriceEventOutputConfig", "AddPricePriceNewPlanEventOutputPriceConversionRateConfig", @@ -72,6 +75,9 @@ "ReplacePricePriceNewPlanGroupedWithMinMaxThresholdsPrice", "ReplacePricePriceNewPlanGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig", "ReplacePricePriceNewPlanGroupedWithMinMaxThresholdsPriceConversionRateConfig", + "ReplacePricePriceNewPlanPercentCompositePrice", + "ReplacePricePriceNewPlanPercentCompositePricePercentConfig", + "ReplacePricePriceNewPlanPercentCompositePriceConversionRateConfig", "ReplacePricePriceNewPlanEventOutputPrice", "ReplacePricePriceNewPlanEventOutputPriceEventOutputConfig", "ReplacePricePriceNewPlanEventOutputPriceConversionRateConfig", @@ -321,6 +327,97 @@ class AddPricePriceNewPlanGroupedWithMinMaxThresholdsPrice(TypedDict, total=Fals """ +class AddPricePriceNewPlanPercentCompositePricePercentConfig(TypedDict, total=False): + percent: Required[float] + """What percent of the component subtotals to charge""" + + +AddPricePriceNewPlanPercentCompositePriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPricePriceNewPlanPercentCompositePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["percent"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + percent_config: Required[AddPricePriceNewPlanPercentCompositePricePercentConfig] + """Configuration for percent pricing""" + + 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[AddPricePriceNewPlanPercentCompositePriceConversionRateConfig] + """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. + """ + + class AddPricePriceNewPlanEventOutputPriceEventOutputConfig(TypedDict, total=False): unit_rating_key: Required[str] """The key in the event data to extract the unit rate from.""" @@ -446,6 +543,7 @@ class AddPricePriceNewPlanEventOutputPrice(TypedDict, total=False): NewPlanScalableMatrixWithTieredPricingPrice, NewPlanCumulativeGroupedBulkPrice, NewPlanMinimumCompositePrice, + AddPricePriceNewPlanPercentCompositePrice, AddPricePriceNewPlanEventOutputPrice, ] @@ -697,6 +795,97 @@ class ReplacePricePriceNewPlanGroupedWithMinMaxThresholdsPrice(TypedDict, total= """ +class ReplacePricePriceNewPlanPercentCompositePricePercentConfig(TypedDict, total=False): + percent: Required[float] + """What percent of the component subtotals to charge""" + + +ReplacePricePriceNewPlanPercentCompositePriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePricePriceNewPlanPercentCompositePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["percent"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + percent_config: Required[ReplacePricePriceNewPlanPercentCompositePricePercentConfig] + """Configuration for percent pricing""" + + 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[ReplacePricePriceNewPlanPercentCompositePriceConversionRateConfig] + """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. + """ + + class ReplacePricePriceNewPlanEventOutputPriceEventOutputConfig(TypedDict, total=False): unit_rating_key: Required[str] """The key in the event data to extract the unit rate from.""" @@ -822,6 +1011,7 @@ class ReplacePricePriceNewPlanEventOutputPrice(TypedDict, total=False): NewPlanScalableMatrixWithTieredPricingPrice, NewPlanCumulativeGroupedBulkPrice, NewPlanMinimumCompositePrice, + ReplacePricePriceNewPlanPercentCompositePrice, ReplacePricePriceNewPlanEventOutputPrice, ] diff --git a/src/orb/types/plan_create_params.py b/src/orb/types/plan_create_params.py index c41e9f58..635d32ec 100644 --- a/src/orb/types/plan_create_params.py +++ b/src/orb/types/plan_create_params.py @@ -54,6 +54,9 @@ "PricePriceNewPlanGroupedWithMinMaxThresholdsPrice", "PricePriceNewPlanGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig", "PricePriceNewPlanGroupedWithMinMaxThresholdsPriceConversionRateConfig", + "PricePriceNewPlanPercentCompositePrice", + "PricePriceNewPlanPercentCompositePricePercentConfig", + "PricePriceNewPlanPercentCompositePriceConversionRateConfig", "PricePriceNewPlanEventOutputPrice", "PricePriceNewPlanEventOutputPriceEventOutputConfig", "PricePriceNewPlanEventOutputPriceConversionRateConfig", @@ -322,6 +325,97 @@ class PricePriceNewPlanGroupedWithMinMaxThresholdsPrice(TypedDict, total=False): """ +class PricePriceNewPlanPercentCompositePricePercentConfig(TypedDict, total=False): + percent: Required[float] + """What percent of the component subtotals to charge""" + + +PricePriceNewPlanPercentCompositePriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class PricePriceNewPlanPercentCompositePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["percent"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + percent_config: Required[PricePriceNewPlanPercentCompositePricePercentConfig] + """Configuration for percent pricing""" + + 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[PricePriceNewPlanPercentCompositePriceConversionRateConfig] + """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. + """ + + class PricePriceNewPlanEventOutputPriceEventOutputConfig(TypedDict, total=False): unit_rating_key: Required[str] """The key in the event data to extract the unit rate from.""" @@ -447,6 +541,7 @@ class PricePriceNewPlanEventOutputPrice(TypedDict, total=False): NewPlanScalableMatrixWithTieredPricingPrice, NewPlanCumulativeGroupedBulkPrice, NewPlanMinimumCompositePrice, + PricePriceNewPlanPercentCompositePrice, PricePriceNewPlanEventOutputPrice, ] diff --git a/src/orb/types/price_create_params.py b/src/orb/types/price_create_params.py index 04203133..fbbb0ccb 100644 --- a/src/orb/types/price_create_params.py +++ b/src/orb/types/price_create_params.py @@ -109,6 +109,9 @@ "NewFloatingMinimumCompositePrice", "NewFloatingMinimumCompositePriceMinimumConfig", "NewFloatingMinimumCompositePriceConversionRateConfig", + "NewFloatingPercentCompositePrice", + "NewFloatingPercentCompositePricePercentConfig", + "NewFloatingPercentCompositePriceConversionRateConfig", "NewFloatingEventOutputPrice", "NewFloatingEventOutputPriceEventOutputConfig", "NewFloatingEventOutputPriceConversionRateConfig", @@ -2595,6 +2598,88 @@ class NewFloatingMinimumCompositePriceMinimumConfig(TypedDict, total=False): ] +class NewFloatingPercentCompositePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["percent"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + percent_config: Required[NewFloatingPercentCompositePricePercentConfig] + """Configuration for percent pricing""" + + 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[NewFloatingPercentCompositePriceConversionRateConfig] + """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 NewFloatingPercentCompositePricePercentConfig(TypedDict, total=False): + percent: Required[float] + """What percent of the component subtotals to charge""" + + +NewFloatingPercentCompositePriceConversionRateConfig: TypeAlias = Union[ + 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.""" @@ -2708,5 +2793,6 @@ class NewFloatingEventOutputPriceEventOutputConfig(TypedDict, total=False): NewFloatingScalableMatrixWithTieredPricingPrice, NewFloatingCumulativeGroupedBulkPrice, NewFloatingMinimumCompositePrice, + NewFloatingPercentCompositePrice, NewFloatingEventOutputPrice, ] diff --git a/src/orb/types/price_evaluate_multiple_params.py b/src/orb/types/price_evaluate_multiple_params.py index ddc020e1..b1ff2a84 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", + "PriceEvaluationPriceNewFloatingPercentCompositePrice", + "PriceEvaluationPriceNewFloatingPercentCompositePricePercentConfig", + "PriceEvaluationPriceNewFloatingPercentCompositePriceConversionRateConfig", "PriceEvaluationPriceNewFloatingEventOutputPrice", "PriceEvaluationPriceNewFloatingEventOutputPriceEventOutputConfig", "PriceEvaluationPriceNewFloatingEventOutputPriceConversionRateConfig", @@ -170,6 +173,88 @@ class PriceEvaluationPriceNewFloatingGroupedWithMinMaxThresholdsPrice(TypedDict, """ +class PriceEvaluationPriceNewFloatingPercentCompositePricePercentConfig(TypedDict, total=False): + percent: Required[float] + """What percent of the component subtotals to charge""" + + +PriceEvaluationPriceNewFloatingPercentCompositePriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class PriceEvaluationPriceNewFloatingPercentCompositePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["percent"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + percent_config: Required[PriceEvaluationPriceNewFloatingPercentCompositePricePercentConfig] + """Configuration for percent pricing""" + + 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[PriceEvaluationPriceNewFloatingPercentCompositePriceConversionRateConfig] + """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 PriceEvaluationPriceNewFloatingEventOutputPriceEventOutputConfig(TypedDict, total=False): unit_rating_key: Required[str] """The key in the event data to extract the unit rate from.""" @@ -286,6 +371,7 @@ class PriceEvaluationPriceNewFloatingEventOutputPrice(TypedDict, total=False): NewFloatingScalableMatrixWithTieredPricingPrice, NewFloatingCumulativeGroupedBulkPrice, NewFloatingMinimumCompositePrice, + PriceEvaluationPriceNewFloatingPercentCompositePrice, PriceEvaluationPriceNewFloatingEventOutputPrice, ] diff --git a/src/orb/types/price_evaluate_preview_events_params.py b/src/orb/types/price_evaluate_preview_events_params.py index dad841be..b96b93d9 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", + "PriceEvaluationPriceNewFloatingPercentCompositePrice", + "PriceEvaluationPriceNewFloatingPercentCompositePricePercentConfig", + "PriceEvaluationPriceNewFloatingPercentCompositePriceConversionRateConfig", "PriceEvaluationPriceNewFloatingEventOutputPrice", "PriceEvaluationPriceNewFloatingEventOutputPriceEventOutputConfig", "PriceEvaluationPriceNewFloatingEventOutputPriceConversionRateConfig", @@ -202,6 +205,88 @@ class PriceEvaluationPriceNewFloatingGroupedWithMinMaxThresholdsPrice(TypedDict, """ +class PriceEvaluationPriceNewFloatingPercentCompositePricePercentConfig(TypedDict, total=False): + percent: Required[float] + """What percent of the component subtotals to charge""" + + +PriceEvaluationPriceNewFloatingPercentCompositePriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class PriceEvaluationPriceNewFloatingPercentCompositePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["percent"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + percent_config: Required[PriceEvaluationPriceNewFloatingPercentCompositePricePercentConfig] + """Configuration for percent pricing""" + + 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[PriceEvaluationPriceNewFloatingPercentCompositePriceConversionRateConfig] + """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 PriceEvaluationPriceNewFloatingEventOutputPriceEventOutputConfig(TypedDict, total=False): unit_rating_key: Required[str] """The key in the event data to extract the unit rate from.""" @@ -318,6 +403,7 @@ class PriceEvaluationPriceNewFloatingEventOutputPrice(TypedDict, total=False): NewFloatingScalableMatrixWithTieredPricingPrice, NewFloatingCumulativeGroupedBulkPrice, NewFloatingMinimumCompositePrice, + PriceEvaluationPriceNewFloatingPercentCompositePrice, PriceEvaluationPriceNewFloatingEventOutputPrice, ] diff --git a/src/orb/types/shared/price.py b/src/orb/types/shared/price.py index 3895d8b5..825c9745 100644 --- a/src/orb/types/shared/price.py +++ b/src/orb/types/shared/price.py @@ -119,6 +119,9 @@ "MinimumCompositePrice", "MinimumCompositePriceConversionRateConfig", "MinimumCompositePriceMinimumConfig", + "PercentCompositePrice", + "PercentCompositePriceConversionRateConfig", + "PercentCompositePricePercentConfig", "EventOutputPrice", "EventOutputPriceConversionRateConfig", "EventOutputPriceEventOutputConfig", @@ -2650,6 +2653,90 @@ class MinimumCompositePrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None +PercentCompositePriceConversionRateConfig: TypeAlias = Annotated[ + Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") +] + + +class PercentCompositePricePercentConfig(BaseModel): + percent: float + """What percent of the component subtotals to charge""" + + +class PercentCompositePrice(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[PercentCompositePriceConversionRateConfig] = None + + created_at: datetime + + credit_allocation: Optional[Allocation] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + invoicing_cycle_configuration: Optional[BillingCycleConfiguration] = None + + item: ItemSlim + """ + 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["percent"] = FieldInfo(alias="model_type") + """The pricing model type""" + + name: str + + percent_config: PercentCompositePricePercentConfig + """Configuration for percent pricing""" + + 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 + + EventOutputPriceConversionRateConfig: TypeAlias = Annotated[ Union[UnitConversionRateConfig, TieredConversionRateConfig], PropertyInfo(discriminator="conversion_rate_type") ] @@ -2769,6 +2856,7 @@ class EventOutputPrice(BaseModel): ScalableMatrixWithTieredPricingPrice, CumulativeGroupedBulkPrice, MinimumCompositePrice, + PercentCompositePrice, 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 1d2cf474..d626ed02 100644 --- a/src/orb/types/subscription_create_params.py +++ b/src/orb/types/subscription_create_params.py @@ -67,6 +67,9 @@ "AddPricePriceNewSubscriptionGroupedWithMinMaxThresholdsPrice", "AddPricePriceNewSubscriptionGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig", "AddPricePriceNewSubscriptionGroupedWithMinMaxThresholdsPriceConversionRateConfig", + "AddPricePriceNewSubscriptionPercentCompositePrice", + "AddPricePriceNewSubscriptionPercentCompositePricePercentConfig", + "AddPricePriceNewSubscriptionPercentCompositePriceConversionRateConfig", "AddPricePriceNewSubscriptionEventOutputPrice", "AddPricePriceNewSubscriptionEventOutputPriceEventOutputConfig", "AddPricePriceNewSubscriptionEventOutputPriceConversionRateConfig", @@ -83,6 +86,9 @@ "ReplacePricePriceNewSubscriptionGroupedWithMinMaxThresholdsPrice", "ReplacePricePriceNewSubscriptionGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig", "ReplacePricePriceNewSubscriptionGroupedWithMinMaxThresholdsPriceConversionRateConfig", + "ReplacePricePriceNewSubscriptionPercentCompositePrice", + "ReplacePricePriceNewSubscriptionPercentCompositePricePercentConfig", + "ReplacePricePriceNewSubscriptionPercentCompositePriceConversionRateConfig", "ReplacePricePriceNewSubscriptionEventOutputPrice", "ReplacePricePriceNewSubscriptionEventOutputPriceEventOutputConfig", "ReplacePricePriceNewSubscriptionEventOutputPriceConversionRateConfig", @@ -494,6 +500,97 @@ class AddPricePriceNewSubscriptionGroupedWithMinMaxThresholdsPrice(TypedDict, to """ +class AddPricePriceNewSubscriptionPercentCompositePricePercentConfig(TypedDict, total=False): + percent: Required[float] + """What percent of the component subtotals to charge""" + + +AddPricePriceNewSubscriptionPercentCompositePriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPricePriceNewSubscriptionPercentCompositePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["percent"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + percent_config: Required[AddPricePriceNewSubscriptionPercentCompositePricePercentConfig] + """Configuration for percent pricing""" + + 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[AddPricePriceNewSubscriptionPercentCompositePriceConversionRateConfig] + """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. + """ + + class AddPricePriceNewSubscriptionEventOutputPriceEventOutputConfig(TypedDict, total=False): unit_rating_key: Required[str] """The key in the event data to extract the unit rate from.""" @@ -619,6 +716,7 @@ class AddPricePriceNewSubscriptionEventOutputPrice(TypedDict, total=False): NewSubscriptionScalableMatrixWithTieredPricingPriceParam, NewSubscriptionCumulativeGroupedBulkPriceParam, NewSubscriptionMinimumCompositePriceParam, + AddPricePriceNewSubscriptionPercentCompositePrice, AddPricePriceNewSubscriptionEventOutputPrice, ] @@ -908,6 +1006,97 @@ class ReplacePricePriceNewSubscriptionGroupedWithMinMaxThresholdsPrice(TypedDict """ +class ReplacePricePriceNewSubscriptionPercentCompositePricePercentConfig(TypedDict, total=False): + percent: Required[float] + """What percent of the component subtotals to charge""" + + +ReplacePricePriceNewSubscriptionPercentCompositePriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePricePriceNewSubscriptionPercentCompositePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["percent"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + percent_config: Required[ReplacePricePriceNewSubscriptionPercentCompositePricePercentConfig] + """Configuration for percent pricing""" + + 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[ReplacePricePriceNewSubscriptionPercentCompositePriceConversionRateConfig] + """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. + """ + + class ReplacePricePriceNewSubscriptionEventOutputPriceEventOutputConfig(TypedDict, total=False): unit_rating_key: Required[str] """The key in the event data to extract the unit rate from.""" @@ -1033,6 +1222,7 @@ class ReplacePricePriceNewSubscriptionEventOutputPrice(TypedDict, total=False): NewSubscriptionScalableMatrixWithTieredPricingPriceParam, NewSubscriptionCumulativeGroupedBulkPriceParam, NewSubscriptionMinimumCompositePriceParam, + ReplacePricePriceNewSubscriptionPercentCompositePrice, ReplacePricePriceNewSubscriptionEventOutputPrice, ] diff --git a/src/orb/types/subscription_price_intervals_params.py b/src/orb/types/subscription_price_intervals_params.py index 59349dd4..a07c7421 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", + "AddPriceNewFloatingPercentCompositePrice", + "AddPriceNewFloatingPercentCompositePricePercentConfig", + "AddPriceNewFloatingPercentCompositePriceConversionRateConfig", "AddPriceNewFloatingEventOutputPrice", "AddPriceNewFloatingEventOutputPriceEventOutputConfig", "AddPriceNewFloatingEventOutputPriceConversionRateConfig", @@ -229,6 +232,88 @@ class AddPriceNewFloatingGroupedWithMinMaxThresholdsPrice(TypedDict, total=False """ +class AddPriceNewFloatingPercentCompositePricePercentConfig(TypedDict, total=False): + percent: Required[float] + """What percent of the component subtotals to charge""" + + +AddPriceNewFloatingPercentCompositePriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceNewFloatingPercentCompositePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + currency: Required[str] + """An ISO 4217 currency string for which this price is billed in.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["percent"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + percent_config: Required[AddPriceNewFloatingPercentCompositePricePercentConfig] + """Configuration for percent pricing""" + + 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[AddPriceNewFloatingPercentCompositePriceConversionRateConfig] + """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 AddPriceNewFloatingEventOutputPriceEventOutputConfig(TypedDict, total=False): unit_rating_key: Required[str] """The key in the event data to extract the unit rate from.""" @@ -345,6 +430,7 @@ class AddPriceNewFloatingEventOutputPrice(TypedDict, total=False): NewFloatingScalableMatrixWithTieredPricingPrice, NewFloatingCumulativeGroupedBulkPrice, NewFloatingMinimumCompositePrice, + AddPriceNewFloatingPercentCompositePrice, AddPriceNewFloatingEventOutputPrice, ] diff --git a/src/orb/types/subscription_schedule_plan_change_params.py b/src/orb/types/subscription_schedule_plan_change_params.py index 31f52a36..3dc830f4 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", + "AddPricePriceNewSubscriptionPercentCompositePrice", + "AddPricePriceNewSubscriptionPercentCompositePricePercentConfig", + "AddPricePriceNewSubscriptionPercentCompositePriceConversionRateConfig", "AddPricePriceNewSubscriptionEventOutputPrice", "AddPricePriceNewSubscriptionEventOutputPriceEventOutputConfig", "AddPricePriceNewSubscriptionEventOutputPriceConversionRateConfig", @@ -83,6 +86,9 @@ "ReplacePricePriceNewSubscriptionGroupedWithMinMaxThresholdsPrice", "ReplacePricePriceNewSubscriptionGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig", "ReplacePricePriceNewSubscriptionGroupedWithMinMaxThresholdsPriceConversionRateConfig", + "ReplacePricePriceNewSubscriptionPercentCompositePrice", + "ReplacePricePriceNewSubscriptionPercentCompositePricePercentConfig", + "ReplacePricePriceNewSubscriptionPercentCompositePriceConversionRateConfig", "ReplacePricePriceNewSubscriptionEventOutputPrice", "ReplacePricePriceNewSubscriptionEventOutputPriceEventOutputConfig", "ReplacePricePriceNewSubscriptionEventOutputPriceConversionRateConfig", @@ -482,6 +488,97 @@ class AddPricePriceNewSubscriptionGroupedWithMinMaxThresholdsPrice(TypedDict, to """ +class AddPricePriceNewSubscriptionPercentCompositePricePercentConfig(TypedDict, total=False): + percent: Required[float] + """What percent of the component subtotals to charge""" + + +AddPricePriceNewSubscriptionPercentCompositePriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPricePriceNewSubscriptionPercentCompositePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["percent"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + percent_config: Required[AddPricePriceNewSubscriptionPercentCompositePricePercentConfig] + """Configuration for percent pricing""" + + 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[AddPricePriceNewSubscriptionPercentCompositePriceConversionRateConfig] + """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. + """ + + class AddPricePriceNewSubscriptionEventOutputPriceEventOutputConfig(TypedDict, total=False): unit_rating_key: Required[str] """The key in the event data to extract the unit rate from.""" @@ -607,6 +704,7 @@ class AddPricePriceNewSubscriptionEventOutputPrice(TypedDict, total=False): NewSubscriptionScalableMatrixWithTieredPricingPriceParam, NewSubscriptionCumulativeGroupedBulkPriceParam, NewSubscriptionMinimumCompositePriceParam, + AddPricePriceNewSubscriptionPercentCompositePrice, AddPricePriceNewSubscriptionEventOutputPrice, ] @@ -896,6 +994,97 @@ class ReplacePricePriceNewSubscriptionGroupedWithMinMaxThresholdsPrice(TypedDict """ +class ReplacePricePriceNewSubscriptionPercentCompositePricePercentConfig(TypedDict, total=False): + percent: Required[float] + """What percent of the component subtotals to charge""" + + +ReplacePricePriceNewSubscriptionPercentCompositePriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePricePriceNewSubscriptionPercentCompositePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["percent"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + percent_config: Required[ReplacePricePriceNewSubscriptionPercentCompositePricePercentConfig] + """Configuration for percent pricing""" + + 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[ReplacePricePriceNewSubscriptionPercentCompositePriceConversionRateConfig] + """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. + """ + + class ReplacePricePriceNewSubscriptionEventOutputPriceEventOutputConfig(TypedDict, total=False): unit_rating_key: Required[str] """The key in the event data to extract the unit rate from.""" @@ -1021,6 +1210,7 @@ class ReplacePricePriceNewSubscriptionEventOutputPrice(TypedDict, total=False): NewSubscriptionScalableMatrixWithTieredPricingPriceParam, NewSubscriptionCumulativeGroupedBulkPriceParam, NewSubscriptionMinimumCompositePriceParam, + ReplacePricePriceNewSubscriptionPercentCompositePrice, ReplacePricePriceNewSubscriptionEventOutputPrice, ] diff --git a/tests/api_resources/test_prices.py b/tests/api_resources/test_prices.py index bcfcc30e..ae0b56bd 100644 --- a/tests/api_resources/test_prices.py +++ b/tests/api_resources/test_prices.py @@ -3094,6 +3094,88 @@ def test_streaming_response_create_overload_27(self, client: Orb) -> None: @parametrize def test_method_create_overload_28(self, client: Orb) -> None: + price = client.prices.create( + cadence="annual", + currency="currency", + item_id="item_id", + model_type="percent", + name="Annual fee", + percent_config={"percent": 0}, + ) + 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", + item_id="item_id", + model_type="percent", + name="Annual fee", + percent_config={"percent": 0}, + 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", + item_id="item_id", + model_type="percent", + name="Annual fee", + percent_config={"percent": 0}, + ) + + 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", + item_id="item_id", + model_type="percent", + name="Annual fee", + percent_config={"percent": 0}, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + price = response.parse() + assert_matches_type(Price, price, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_create_overload_29(self, client: Orb) -> None: price = client.prices.create( cadence="annual", currency="currency", @@ -3105,7 +3187,7 @@ def test_method_create_overload_28(self, client: Orb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - def test_method_create_with_all_params_overload_28(self, client: Orb) -> None: + def test_method_create_with_all_params_overload_29(self, client: Orb) -> None: price = client.prices.create( cadence="annual", currency="currency", @@ -3144,7 +3226,7 @@ def test_method_create_with_all_params_overload_28(self, client: Orb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - def test_raw_response_create_overload_28(self, client: Orb) -> None: + def test_raw_response_create_overload_29(self, client: Orb) -> None: response = client.prices.with_raw_response.create( cadence="annual", currency="currency", @@ -3160,7 +3242,7 @@ def test_raw_response_create_overload_28(self, client: Orb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - def test_streaming_response_create_overload_28(self, client: Orb) -> None: + def test_streaming_response_create_overload_29(self, client: Orb) -> None: with client.prices.with_streaming_response.create( cadence="annual", currency="currency", @@ -6606,6 +6688,88 @@ async def test_streaming_response_create_overload_27(self, async_client: AsyncOr @parametrize async def test_method_create_overload_28(self, async_client: AsyncOrb) -> None: + price = await async_client.prices.create( + cadence="annual", + currency="currency", + item_id="item_id", + model_type="percent", + name="Annual fee", + percent_config={"percent": 0}, + ) + 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", + item_id="item_id", + model_type="percent", + name="Annual fee", + percent_config={"percent": 0}, + 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", + item_id="item_id", + model_type="percent", + name="Annual fee", + percent_config={"percent": 0}, + ) + + 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", + item_id="item_id", + model_type="percent", + name="Annual fee", + percent_config={"percent": 0}, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + price = await response.parse() + assert_matches_type(Price, price, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_create_overload_29(self, async_client: AsyncOrb) -> None: price = await async_client.prices.create( cadence="annual", currency="currency", @@ -6617,7 +6781,7 @@ async def test_method_create_overload_28(self, async_client: AsyncOrb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - async def test_method_create_with_all_params_overload_28(self, async_client: AsyncOrb) -> None: + async def test_method_create_with_all_params_overload_29(self, async_client: AsyncOrb) -> None: price = await async_client.prices.create( cadence="annual", currency="currency", @@ -6656,7 +6820,7 @@ async def test_method_create_with_all_params_overload_28(self, async_client: Asy assert_matches_type(Price, price, path=["response"]) @parametrize - async def test_raw_response_create_overload_28(self, async_client: AsyncOrb) -> None: + async def test_raw_response_create_overload_29(self, async_client: AsyncOrb) -> None: response = await async_client.prices.with_raw_response.create( cadence="annual", currency="currency", @@ -6672,7 +6836,7 @@ async def test_raw_response_create_overload_28(self, async_client: AsyncOrb) -> assert_matches_type(Price, price, path=["response"]) @parametrize - async def test_streaming_response_create_overload_28(self, async_client: AsyncOrb) -> None: + async def test_streaming_response_create_overload_29(self, async_client: AsyncOrb) -> None: async with async_client.prices.with_streaming_response.create( cadence="annual", currency="currency", From ab35e315e4c2e426f2afbb58fa0d6877862fed23 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Oct 2025 01:31:35 +0000 Subject: [PATCH 2/2] release: 4.24.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ pyproject.toml | 2 +- src/orb/_version.py | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 69e5aa20..0f2463a3 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "4.23.0" + ".": "4.24.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 470c5d14..fbc972bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 4.24.0 (2025-10-07) + +Full Changelog: [v4.23.0...v4.24.0](https://github.com/orbcorp/orb-python/compare/v4.23.0...v4.24.0) + +### Features + +* **api:** api update ([71281fc](https://github.com/orbcorp/orb-python/commit/71281fc13a53085581f3a32e3f5ea1a13d345f3a)) + ## 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) diff --git a/pyproject.toml b/pyproject.toml index 84d39aa3..c142c0d8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "orb-billing" -version = "4.23.0" +version = "4.24.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 4ddd5870..975c0923 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.23.0" # x-release-please-version +__version__ = "4.24.0" # x-release-please-version