diff --git a/.stats.yml b/.stats.yml index 0c16dd10..ae59be0a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 103 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-8663e8fc543041d9694eddcd2f7e9784611369606700f99340e6dc80607b2dfa.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-0dbb8ba730f755468357ebda41332664e8396faf29a6a6a64ad37cf35cf70d0c.yml diff --git a/src/orb/resources/prices/prices.py b/src/orb/resources/prices/prices.py index 3a43c82e..b8ba0dfc 100644 --- a/src/orb/resources/prices/prices.py +++ b/src/orb/resources/prices/prices.py @@ -2304,6 +2304,188 @@ def create( """ ... + @overload + def create( + self, + *, + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], + currency: str, + item_id: str, + model_type: Literal["scalable_matrix_with_unit_pricing"], + name: str, + scalable_matrix_with_unit_pricing_config: Dict[str, object], + billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, + billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingScalableMatrixWithUnitPricingPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, + conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, + external_price_id: Optional[str] | NotGiven = NOT_GIVEN, + fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, + invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, + metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> Price: + """ + This endpoint is used to create a [price](/product-catalog/price-configuration). + A price created using this endpoint is always an add-on, meaning that it’s not + associated with a specific plan and can instead be individually added to + subscriptions, including subscriptions on different plans. + + An `external_price_id` can be optionally specified as an alias to allow + ergonomic interaction with prices in the Orb API. + + See the [Price resource](/product-catalog/price-configuration) for the + specification of different price model configurations possible in this endpoint. + + Args: + cadence: The cadence to bill for this price on. + + currency: An ISO 4217 currency string for which this price is billed in. + + item_id: The id of the item the plan will be associated with. + + name: The name of the price. + + billable_metric_id: The id of the billable metric for the price. Only needed if the price is + usage-based. + + billed_in_advance: If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + + billing_cycle_configuration: For custom cadence: specifies the duration of the billing period in days or + months. + + conversion_rate: The per unit conversion rate of the price currency to the invoicing currency. + + 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, + *, + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], + currency: str, + item_id: str, + model_type: Literal["scalable_matrix_with_tiered_pricing"], + name: str, + scalable_matrix_with_tiered_pricing_config: Dict[str, object], + billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, + billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingScalableMatrixWithTieredPricingPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, + conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, + external_price_id: Optional[str] | NotGiven = NOT_GIVEN, + fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, + invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, + metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> Price: + """ + This endpoint is used to create a [price](/product-catalog/price-configuration). + A price created using this endpoint is always an add-on, meaning that it’s not + associated with a specific plan and can instead be individually added to + subscriptions, including subscriptions on different plans. + + An `external_price_id` can be optionally specified as an alias to allow + ergonomic interaction with prices in the Orb API. + + See the [Price resource](/product-catalog/price-configuration) for the + specification of different price model configurations possible in this endpoint. + + Args: + cadence: The cadence to bill for this price on. + + currency: An ISO 4217 currency string for which this price is billed in. + + item_id: The id of the item the plan will be associated with. + + name: The name of the price. + + billable_metric_id: The id of the billable metric for the price. Only needed if the price is + usage-based. + + billed_in_advance: If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + + billing_cycle_configuration: For custom cadence: specifies the duration of the billing period in days or + months. + + conversion_rate: The per unit conversion rate of the price currency to the invoicing currency. + + 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", "package_config"], @@ -2330,6 +2512,8 @@ def create( ["cadence", "currency", "item_id", "matrix_with_display_name_config", "model_type", "name"], ["bulk_with_proration_config", "cadence", "currency", "item_id", "model_type", "name"], ["cadence", "currency", "grouped_tiered_package_config", "item_id", "model_type", "name"], + ["cadence", "currency", "item_id", "model_type", "name", "scalable_matrix_with_unit_pricing_config"], + ["cadence", "currency", "item_id", "model_type", "name", "scalable_matrix_with_tiered_pricing_config"], ) def create( self, @@ -2361,7 +2545,9 @@ def create( | Literal["grouped_with_metered_minimum"] | Literal["matrix_with_display_name"] | Literal["bulk_with_proration"] - | Literal["grouped_tiered_package"], + | Literal["grouped_tiered_package"] + | Literal["scalable_matrix_with_unit_pricing"] + | Literal["scalable_matrix_with_tiered_pricing"], name: str, unit_config: price_create_params.NewFloatingUnitPriceUnitConfig | NotGiven = NOT_GIVEN, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -2400,6 +2586,8 @@ def create( matrix_with_display_name_config: Dict[str, object] | NotGiven = NOT_GIVEN, bulk_with_proration_config: Dict[str, object] | NotGiven = NOT_GIVEN, grouped_tiered_package_config: Dict[str, object] | NotGiven = NOT_GIVEN, + scalable_matrix_with_unit_pricing_config: Dict[str, object] | NotGiven = NOT_GIVEN, + scalable_matrix_with_tiered_pricing_config: Dict[str, object] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -2453,6 +2641,8 @@ def create( "matrix_with_display_name_config": matrix_with_display_name_config, "bulk_with_proration_config": bulk_with_proration_config, "grouped_tiered_package_config": grouped_tiered_package_config, + "scalable_matrix_with_unit_pricing_config": scalable_matrix_with_unit_pricing_config, + "scalable_matrix_with_tiered_pricing_config": scalable_matrix_with_tiered_pricing_config, }, price_create_params.PriceCreateParams, ), @@ -4967,6 +5157,188 @@ 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["scalable_matrix_with_unit_pricing"], + name: str, + scalable_matrix_with_unit_pricing_config: Dict[str, object], + billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, + billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingScalableMatrixWithUnitPricingPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, + conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, + external_price_id: Optional[str] | NotGiven = NOT_GIVEN, + fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, + invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, + metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> Price: + """ + This endpoint is used to create a [price](/product-catalog/price-configuration). + A price created using this endpoint is always an add-on, meaning that it’s not + associated with a specific plan and can instead be individually added to + subscriptions, including subscriptions on different plans. + + An `external_price_id` can be optionally specified as an alias to allow + ergonomic interaction with prices in the Orb API. + + See the [Price resource](/product-catalog/price-configuration) for the + specification of different price model configurations possible in this endpoint. + + Args: + cadence: The cadence to bill for this price on. + + currency: An ISO 4217 currency string for which this price is billed in. + + item_id: The id of the item the plan will be associated with. + + name: The name of the price. + + billable_metric_id: The id of the billable metric for the price. Only needed if the price is + usage-based. + + billed_in_advance: If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + + billing_cycle_configuration: For custom cadence: specifies the duration of the billing period in days or + months. + + conversion_rate: The per unit conversion rate of the price currency to the invoicing currency. + + 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, + *, + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], + currency: str, + item_id: str, + model_type: Literal["scalable_matrix_with_tiered_pricing"], + name: str, + scalable_matrix_with_tiered_pricing_config: Dict[str, object], + billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, + billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingScalableMatrixWithTieredPricingPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, + conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, + external_price_id: Optional[str] | NotGiven = NOT_GIVEN, + fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, + invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, + metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> Price: + """ + This endpoint is used to create a [price](/product-catalog/price-configuration). + A price created using this endpoint is always an add-on, meaning that it’s not + associated with a specific plan and can instead be individually added to + subscriptions, including subscriptions on different plans. + + An `external_price_id` can be optionally specified as an alias to allow + ergonomic interaction with prices in the Orb API. + + See the [Price resource](/product-catalog/price-configuration) for the + specification of different price model configurations possible in this endpoint. + + Args: + cadence: The cadence to bill for this price on. + + currency: An ISO 4217 currency string for which this price is billed in. + + item_id: The id of the item the plan will be associated with. + + name: The name of the price. + + billable_metric_id: The id of the billable metric for the price. Only needed if the price is + usage-based. + + billed_in_advance: If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + + billing_cycle_configuration: For custom cadence: specifies the duration of the billing period in days or + months. + + conversion_rate: The per unit conversion rate of the price currency to the invoicing currency. + + 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", "package_config"], @@ -4993,6 +5365,8 @@ async def create( ["cadence", "currency", "item_id", "matrix_with_display_name_config", "model_type", "name"], ["bulk_with_proration_config", "cadence", "currency", "item_id", "model_type", "name"], ["cadence", "currency", "grouped_tiered_package_config", "item_id", "model_type", "name"], + ["cadence", "currency", "item_id", "model_type", "name", "scalable_matrix_with_unit_pricing_config"], + ["cadence", "currency", "item_id", "model_type", "name", "scalable_matrix_with_tiered_pricing_config"], ) async def create( self, @@ -5024,7 +5398,9 @@ async def create( | Literal["grouped_with_metered_minimum"] | Literal["matrix_with_display_name"] | Literal["bulk_with_proration"] - | Literal["grouped_tiered_package"], + | Literal["grouped_tiered_package"] + | Literal["scalable_matrix_with_unit_pricing"] + | Literal["scalable_matrix_with_tiered_pricing"], name: str, unit_config: price_create_params.NewFloatingUnitPriceUnitConfig | NotGiven = NOT_GIVEN, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -5063,6 +5439,8 @@ async def create( matrix_with_display_name_config: Dict[str, object] | NotGiven = NOT_GIVEN, bulk_with_proration_config: Dict[str, object] | NotGiven = NOT_GIVEN, grouped_tiered_package_config: Dict[str, object] | NotGiven = NOT_GIVEN, + scalable_matrix_with_unit_pricing_config: Dict[str, object] | NotGiven = NOT_GIVEN, + scalable_matrix_with_tiered_pricing_config: Dict[str, object] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -5116,6 +5494,8 @@ async def create( "matrix_with_display_name_config": matrix_with_display_name_config, "bulk_with_proration_config": bulk_with_proration_config, "grouped_tiered_package_config": grouped_tiered_package_config, + "scalable_matrix_with_unit_pricing_config": scalable_matrix_with_unit_pricing_config, + "scalable_matrix_with_tiered_pricing_config": scalable_matrix_with_tiered_pricing_config, }, price_create_params.PriceCreateParams, ), diff --git a/src/orb/types/invoice.py b/src/orb/types/invoice.py index e3c51e72..7a5f2987 100644 --- a/src/orb/types/invoice.py +++ b/src/orb/types/invoice.py @@ -21,6 +21,12 @@ "CustomerBalanceTransactionInvoice", "CustomerTaxID", "LineItem", + "LineItemAdjustment", + "LineItemAdjustmentAmountDiscountAdjustment", + "LineItemAdjustmentPercentageDiscountAdjustment", + "LineItemAdjustmentUsageDiscountAdjustment", + "LineItemAdjustmentMinimumAdjustment", + "LineItemAdjustmentMaximumAdjustment", "LineItemMaximum", "LineItemMinimum", "LineItemSubLineItem", @@ -319,6 +325,156 @@ class CustomerTaxID(BaseModel): value: str +class LineItemAdjustmentAmountDiscountAdjustment(BaseModel): + id: str + + adjustment_type: Literal["amount_discount"] + + amount_discount: str + """ + The amount by which to discount the prices this adjustment applies to in a given + billing period. + """ + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + that apply to only one price. + """ + + plan_phase_order: Optional[int] = None + """The plan phase in which this adjustment is active.""" + + reason: Optional[str] = None + """The reason for the adjustment.""" + + +class LineItemAdjustmentPercentageDiscountAdjustment(BaseModel): + id: str + + adjustment_type: Literal["percentage_discount"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + that apply to only one price. + """ + + percentage_discount: float + """ + The percentage (as a value between 0 and 1) by which to discount the price + intervals this adjustment applies to in a given billing period. + """ + + plan_phase_order: Optional[int] = None + """The plan phase in which this adjustment is active.""" + + reason: Optional[str] = None + """The reason for the adjustment.""" + + +class LineItemAdjustmentUsageDiscountAdjustment(BaseModel): + id: str + + adjustment_type: Literal["usage_discount"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + that apply to only one price. + """ + + plan_phase_order: Optional[int] = None + """The plan phase in which this adjustment is active.""" + + reason: Optional[str] = None + """The reason for the adjustment.""" + + usage_discount: float + """ + The number of usage units by which to discount the price this adjustment applies + to in a given billing period. + """ + + +class LineItemAdjustmentMinimumAdjustment(BaseModel): + id: str + + adjustment_type: Literal["minimum"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + that apply to only one price. + """ + + item_id: str + """The item ID that revenue from this minimum will be attributed to.""" + + minimum_amount: str + """ + The minimum amount to charge in a given billing period for the prices this + adjustment applies to. + """ + + plan_phase_order: Optional[int] = None + """The plan phase in which this adjustment is active.""" + + reason: Optional[str] = None + """The reason for the adjustment.""" + + +class LineItemAdjustmentMaximumAdjustment(BaseModel): + id: str + + adjustment_type: Literal["maximum"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + that apply to only one price. + """ + + maximum_amount: str + """ + The maximum amount to charge in a given billing period for the prices this + adjustment applies to. + """ + + plan_phase_order: Optional[int] = None + """The plan phase in which this adjustment is active.""" + + reason: Optional[str] = None + """The reason for the adjustment.""" + + +LineItemAdjustment: TypeAlias = Annotated[ + Union[ + LineItemAdjustmentAmountDiscountAdjustment, + LineItemAdjustmentPercentageDiscountAdjustment, + LineItemAdjustmentUsageDiscountAdjustment, + LineItemAdjustmentMinimumAdjustment, + LineItemAdjustmentMaximumAdjustment, + ], + PropertyInfo(discriminator="adjustment_type"), +] + + class LineItemMaximum(BaseModel): applies_to_price_ids: List[str] """List of price_ids that this maximum amount applies to. @@ -441,9 +597,21 @@ class LineItem(BaseModel): id: str """A unique ID for this line item.""" + adjusted_subtotal: str + """ + The line amount after any adjustments, before overage conversion, credits and + partial invoicing. + """ + + adjustments: List[LineItemAdjustment] + """All adjustments applied to the line item.""" + amount: str """The final amount after any discounts or minimums.""" + credits_applied: str + """The number of credits used""" + discount: Optional[Discount] = None end_date: datetime @@ -457,16 +625,23 @@ class LineItem(BaseModel): """ maximum: Optional[LineItemMaximum] = None + """This field is deprecated in favor of `adjustments`.""" maximum_amount: Optional[str] = None + """This field is deprecated in favor of `adjustments`.""" minimum: Optional[LineItemMinimum] = None + """This field is deprecated in favor of `adjustments`.""" minimum_amount: Optional[str] = None + """This field is deprecated in favor of `adjustments`.""" name: str """The name of the price associated with this line item.""" + partially_invoiced_amount: str + """Any amount applied from a partial invoice""" + price: Optional[Price] = None """ The Price resource represents a price that can be billed on a subscription, diff --git a/src/orb/types/invoice_fetch_upcoming_response.py b/src/orb/types/invoice_fetch_upcoming_response.py index eafb79b5..bd2310b2 100644 --- a/src/orb/types/invoice_fetch_upcoming_response.py +++ b/src/orb/types/invoice_fetch_upcoming_response.py @@ -21,6 +21,12 @@ "CustomerBalanceTransactionInvoice", "CustomerTaxID", "LineItem", + "LineItemAdjustment", + "LineItemAdjustmentAmountDiscountAdjustment", + "LineItemAdjustmentPercentageDiscountAdjustment", + "LineItemAdjustmentUsageDiscountAdjustment", + "LineItemAdjustmentMinimumAdjustment", + "LineItemAdjustmentMaximumAdjustment", "LineItemMaximum", "LineItemMinimum", "LineItemSubLineItem", @@ -319,6 +325,156 @@ class CustomerTaxID(BaseModel): value: str +class LineItemAdjustmentAmountDiscountAdjustment(BaseModel): + id: str + + adjustment_type: Literal["amount_discount"] + + amount_discount: str + """ + The amount by which to discount the prices this adjustment applies to in a given + billing period. + """ + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + that apply to only one price. + """ + + plan_phase_order: Optional[int] = None + """The plan phase in which this adjustment is active.""" + + reason: Optional[str] = None + """The reason for the adjustment.""" + + +class LineItemAdjustmentPercentageDiscountAdjustment(BaseModel): + id: str + + adjustment_type: Literal["percentage_discount"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + that apply to only one price. + """ + + percentage_discount: float + """ + The percentage (as a value between 0 and 1) by which to discount the price + intervals this adjustment applies to in a given billing period. + """ + + plan_phase_order: Optional[int] = None + """The plan phase in which this adjustment is active.""" + + reason: Optional[str] = None + """The reason for the adjustment.""" + + +class LineItemAdjustmentUsageDiscountAdjustment(BaseModel): + id: str + + adjustment_type: Literal["usage_discount"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + that apply to only one price. + """ + + plan_phase_order: Optional[int] = None + """The plan phase in which this adjustment is active.""" + + reason: Optional[str] = None + """The reason for the adjustment.""" + + usage_discount: float + """ + The number of usage units by which to discount the price this adjustment applies + to in a given billing period. + """ + + +class LineItemAdjustmentMinimumAdjustment(BaseModel): + id: str + + adjustment_type: Literal["minimum"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + that apply to only one price. + """ + + item_id: str + """The item ID that revenue from this minimum will be attributed to.""" + + minimum_amount: str + """ + The minimum amount to charge in a given billing period for the prices this + adjustment applies to. + """ + + plan_phase_order: Optional[int] = None + """The plan phase in which this adjustment is active.""" + + reason: Optional[str] = None + """The reason for the adjustment.""" + + +class LineItemAdjustmentMaximumAdjustment(BaseModel): + id: str + + adjustment_type: Literal["maximum"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + that apply to only one price. + """ + + maximum_amount: str + """ + The maximum amount to charge in a given billing period for the prices this + adjustment applies to. + """ + + plan_phase_order: Optional[int] = None + """The plan phase in which this adjustment is active.""" + + reason: Optional[str] = None + """The reason for the adjustment.""" + + +LineItemAdjustment: TypeAlias = Annotated[ + Union[ + LineItemAdjustmentAmountDiscountAdjustment, + LineItemAdjustmentPercentageDiscountAdjustment, + LineItemAdjustmentUsageDiscountAdjustment, + LineItemAdjustmentMinimumAdjustment, + LineItemAdjustmentMaximumAdjustment, + ], + PropertyInfo(discriminator="adjustment_type"), +] + + class LineItemMaximum(BaseModel): applies_to_price_ids: List[str] """List of price_ids that this maximum amount applies to. @@ -441,9 +597,21 @@ class LineItem(BaseModel): id: str """A unique ID for this line item.""" + adjusted_subtotal: str + """ + The line amount after any adjustments, before overage conversion, credits and + partial invoicing. + """ + + adjustments: List[LineItemAdjustment] + """All adjustments applied to the line item.""" + amount: str """The final amount after any discounts or minimums.""" + credits_applied: str + """The number of credits used""" + discount: Optional[Discount] = None end_date: datetime @@ -457,16 +625,23 @@ class LineItem(BaseModel): """ maximum: Optional[LineItemMaximum] = None + """This field is deprecated in favor of `adjustments`.""" maximum_amount: Optional[str] = None + """This field is deprecated in favor of `adjustments`.""" minimum: Optional[LineItemMinimum] = None + """This field is deprecated in favor of `adjustments`.""" minimum_amount: Optional[str] = None + """This field is deprecated in favor of `adjustments`.""" name: str """The name of the price associated with this line item.""" + partially_invoiced_amount: str + """Any amount applied from a partial invoice""" + price: Optional[Price] = None """ The Price resource represents a price that can be billed on a subscription, diff --git a/src/orb/types/invoice_line_item_create_response.py b/src/orb/types/invoice_line_item_create_response.py index 5588d5f5..4593d8a8 100644 --- a/src/orb/types/invoice_line_item_create_response.py +++ b/src/orb/types/invoice_line_item_create_response.py @@ -11,6 +11,12 @@ __all__ = [ "InvoiceLineItemCreateResponse", + "Adjustment", + "AdjustmentAmountDiscountAdjustment", + "AdjustmentPercentageDiscountAdjustment", + "AdjustmentUsageDiscountAdjustment", + "AdjustmentMinimumAdjustment", + "AdjustmentMaximumAdjustment", "Maximum", "Minimum", "SubLineItem", @@ -26,6 +32,156 @@ ] +class AdjustmentAmountDiscountAdjustment(BaseModel): + id: str + + adjustment_type: Literal["amount_discount"] + + amount_discount: str + """ + The amount by which to discount the prices this adjustment applies to in a given + billing period. + """ + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + that apply to only one price. + """ + + plan_phase_order: Optional[int] = None + """The plan phase in which this adjustment is active.""" + + reason: Optional[str] = None + """The reason for the adjustment.""" + + +class AdjustmentPercentageDiscountAdjustment(BaseModel): + id: str + + adjustment_type: Literal["percentage_discount"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + that apply to only one price. + """ + + percentage_discount: float + """ + The percentage (as a value between 0 and 1) by which to discount the price + intervals this adjustment applies to in a given billing period. + """ + + plan_phase_order: Optional[int] = None + """The plan phase in which this adjustment is active.""" + + reason: Optional[str] = None + """The reason for the adjustment.""" + + +class AdjustmentUsageDiscountAdjustment(BaseModel): + id: str + + adjustment_type: Literal["usage_discount"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + that apply to only one price. + """ + + plan_phase_order: Optional[int] = None + """The plan phase in which this adjustment is active.""" + + reason: Optional[str] = None + """The reason for the adjustment.""" + + usage_discount: float + """ + The number of usage units by which to discount the price this adjustment applies + to in a given billing period. + """ + + +class AdjustmentMinimumAdjustment(BaseModel): + id: str + + adjustment_type: Literal["minimum"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + that apply to only one price. + """ + + item_id: str + """The item ID that revenue from this minimum will be attributed to.""" + + minimum_amount: str + """ + The minimum amount to charge in a given billing period for the prices this + adjustment applies to. + """ + + plan_phase_order: Optional[int] = None + """The plan phase in which this adjustment is active.""" + + reason: Optional[str] = None + """The reason for the adjustment.""" + + +class AdjustmentMaximumAdjustment(BaseModel): + id: str + + adjustment_type: Literal["maximum"] + + applies_to_price_ids: List[str] + """The price IDs that this adjustment applies to.""" + + is_invoice_level: bool + """ + True for adjustments that apply to an entire invocice, false for adjustments + that apply to only one price. + """ + + maximum_amount: str + """ + The maximum amount to charge in a given billing period for the prices this + adjustment applies to. + """ + + plan_phase_order: Optional[int] = None + """The plan phase in which this adjustment is active.""" + + reason: Optional[str] = None + """The reason for the adjustment.""" + + +Adjustment: TypeAlias = Annotated[ + Union[ + AdjustmentAmountDiscountAdjustment, + AdjustmentPercentageDiscountAdjustment, + AdjustmentUsageDiscountAdjustment, + AdjustmentMinimumAdjustment, + AdjustmentMaximumAdjustment, + ], + PropertyInfo(discriminator="adjustment_type"), +] + + class Maximum(BaseModel): applies_to_price_ids: List[str] """List of price_ids that this maximum amount applies to. @@ -146,9 +302,21 @@ class InvoiceLineItemCreateResponse(BaseModel): id: str """A unique ID for this line item.""" + adjusted_subtotal: str + """ + The line amount after any adjustments, before overage conversion, credits and + partial invoicing. + """ + + adjustments: List[Adjustment] + """All adjustments applied to the line item.""" + amount: str """The final amount after any discounts or minimums.""" + credits_applied: str + """The number of credits used""" + discount: Optional[Discount] = None end_date: datetime @@ -162,16 +330,23 @@ class InvoiceLineItemCreateResponse(BaseModel): """ maximum: Optional[Maximum] = None + """This field is deprecated in favor of `adjustments`.""" maximum_amount: Optional[str] = None + """This field is deprecated in favor of `adjustments`.""" minimum: Optional[Minimum] = None + """This field is deprecated in favor of `adjustments`.""" minimum_amount: Optional[str] = None + """This field is deprecated in favor of `adjustments`.""" name: str """The name of the price associated with this line item.""" + partially_invoiced_amount: str + """Any amount applied from a partial invoice""" + price: Optional[Price] = None """ The Price resource represents a price that can be billed on a subscription, diff --git a/src/orb/types/plan_create_params.py b/src/orb/types/plan_create_params.py index f1f8abe5..076bbf2b 100644 --- a/src/orb/types/plan_create_params.py +++ b/src/orb/types/plan_create_params.py @@ -87,6 +87,12 @@ "PriceNewPlanMaxGroupTieredPackagePrice", "PriceNewPlanMaxGroupTieredPackagePriceBillingCycleConfiguration", "PriceNewPlanMaxGroupTieredPackagePriceInvoicingCycleConfiguration", + "PriceNewPlanScalableMatrixWithUnitPricingPrice", + "PriceNewPlanScalableMatrixWithUnitPricingPriceBillingCycleConfiguration", + "PriceNewPlanScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration", + "PriceNewPlanScalableMatrixWithTieredPricingPrice", + "PriceNewPlanScalableMatrixWithTieredPricingPriceBillingCycleConfiguration", + "PriceNewPlanScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration", ] @@ -2077,6 +2083,172 @@ class PriceNewPlanMaxGroupTieredPackagePrice(TypedDict, total=False): """ +class PriceNewPlanScalableMatrixWithUnitPricingPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewPlanScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewPlanScalableMatrixWithUnitPricingPrice(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 plan will be associated with.""" + + model_type: Required[Literal["scalable_matrix_with_unit_pricing"]] + + name: Required[str] + """The name of the price.""" + + scalable_matrix_with_unit_pricing_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + 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[PriceNewPlanScalableMatrixWithUnitPricingPriceBillingCycleConfiguration] + """ + 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.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + 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[PriceNewPlanScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration] + """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 PriceNewPlanScalableMatrixWithTieredPricingPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewPlanScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewPlanScalableMatrixWithTieredPricingPrice(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 plan will be associated with.""" + + model_type: Required[Literal["scalable_matrix_with_tiered_pricing"]] + + name: Required[str] + """The name of the price.""" + + scalable_matrix_with_tiered_pricing_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + 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[PriceNewPlanScalableMatrixWithTieredPricingPriceBillingCycleConfiguration] + """ + 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.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + 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[PriceNewPlanScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration] + """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`. + """ + + Price: TypeAlias = Union[ PriceNewPlanUnitPrice, PriceNewPlanPackagePrice, @@ -2100,4 +2272,6 @@ class PriceNewPlanMaxGroupTieredPackagePrice(TypedDict, total=False): PriceNewPlanBulkWithProrationPrice, PriceNewPlanGroupedTieredPackagePrice, PriceNewPlanMaxGroupTieredPackagePrice, + PriceNewPlanScalableMatrixWithUnitPricingPrice, + PriceNewPlanScalableMatrixWithTieredPricingPrice, ] diff --git a/src/orb/types/price.py b/src/orb/types/price.py index fdbc3f97..feac3c8d 100644 --- a/src/orb/types/price.py +++ b/src/orb/types/price.py @@ -21,6 +21,7 @@ "UnitPriceMaximum", "UnitPriceMinimum", "UnitPriceUnitConfig", + "UnitPriceDimensionalPriceConfiguration", "PackagePrice", "PackagePriceBillableMetric", "PackagePriceBillingCycleConfiguration", @@ -30,6 +31,7 @@ "PackagePriceMaximum", "PackagePriceMinimum", "PackagePricePackageConfig", + "PackagePriceDimensionalPriceConfiguration", "MatrixPrice", "MatrixPriceBillableMetric", "MatrixPriceBillingCycleConfiguration", @@ -40,6 +42,7 @@ "MatrixPriceMatrixConfigMatrixValue", "MatrixPriceMaximum", "MatrixPriceMinimum", + "MatrixPriceDimensionalPriceConfiguration", "TieredPrice", "TieredPriceBillableMetric", "TieredPriceBillingCycleConfiguration", @@ -50,6 +53,7 @@ "TieredPriceMinimum", "TieredPriceTieredConfig", "TieredPriceTieredConfigTier", + "TieredPriceDimensionalPriceConfiguration", "TieredBpsPrice", "TieredBpsPriceBillableMetric", "TieredBpsPriceBillingCycleConfiguration", @@ -60,6 +64,7 @@ "TieredBpsPriceMinimum", "TieredBpsPriceTieredBpsConfig", "TieredBpsPriceTieredBpsConfigTier", + "TieredBpsPriceDimensionalPriceConfiguration", "BpsPrice", "BpsPriceBillableMetric", "BpsPriceBillingCycleConfiguration", @@ -69,6 +74,7 @@ "BpsPriceItem", "BpsPriceMaximum", "BpsPriceMinimum", + "BpsPriceDimensionalPriceConfiguration", "BulkBpsPrice", "BulkBpsPriceBillableMetric", "BulkBpsPriceBillingCycleConfiguration", @@ -79,6 +85,7 @@ "BulkBpsPriceItem", "BulkBpsPriceMaximum", "BulkBpsPriceMinimum", + "BulkBpsPriceDimensionalPriceConfiguration", "BulkPrice", "BulkPriceBillableMetric", "BulkPriceBillingCycleConfiguration", @@ -89,6 +96,7 @@ "BulkPriceItem", "BulkPriceMaximum", "BulkPriceMinimum", + "BulkPriceDimensionalPriceConfiguration", "ThresholdTotalAmountPrice", "ThresholdTotalAmountPriceBillableMetric", "ThresholdTotalAmountPriceBillingCycleConfiguration", @@ -97,6 +105,7 @@ "ThresholdTotalAmountPriceItem", "ThresholdTotalAmountPriceMaximum", "ThresholdTotalAmountPriceMinimum", + "ThresholdTotalAmountPriceDimensionalPriceConfiguration", "TieredPackagePrice", "TieredPackagePriceBillableMetric", "TieredPackagePriceBillingCycleConfiguration", @@ -105,6 +114,7 @@ "TieredPackagePriceItem", "TieredPackagePriceMaximum", "TieredPackagePriceMinimum", + "TieredPackagePriceDimensionalPriceConfiguration", "GroupedTieredPrice", "GroupedTieredPriceBillableMetric", "GroupedTieredPriceBillingCycleConfiguration", @@ -113,6 +123,7 @@ "GroupedTieredPriceItem", "GroupedTieredPriceMaximum", "GroupedTieredPriceMinimum", + "GroupedTieredPriceDimensionalPriceConfiguration", "TieredWithMinimumPrice", "TieredWithMinimumPriceBillableMetric", "TieredWithMinimumPriceBillingCycleConfiguration", @@ -121,6 +132,7 @@ "TieredWithMinimumPriceItem", "TieredWithMinimumPriceMaximum", "TieredWithMinimumPriceMinimum", + "TieredWithMinimumPriceDimensionalPriceConfiguration", "TieredPackageWithMinimumPrice", "TieredPackageWithMinimumPriceBillableMetric", "TieredPackageWithMinimumPriceBillingCycleConfiguration", @@ -129,6 +141,7 @@ "TieredPackageWithMinimumPriceItem", "TieredPackageWithMinimumPriceMaximum", "TieredPackageWithMinimumPriceMinimum", + "TieredPackageWithMinimumPriceDimensionalPriceConfiguration", "PackageWithAllocationPrice", "PackageWithAllocationPriceBillableMetric", "PackageWithAllocationPriceBillingCycleConfiguration", @@ -137,6 +150,7 @@ "PackageWithAllocationPriceItem", "PackageWithAllocationPriceMaximum", "PackageWithAllocationPriceMinimum", + "PackageWithAllocationPriceDimensionalPriceConfiguration", "UnitWithPercentPrice", "UnitWithPercentPriceBillableMetric", "UnitWithPercentPriceBillingCycleConfiguration", @@ -145,6 +159,7 @@ "UnitWithPercentPriceItem", "UnitWithPercentPriceMaximum", "UnitWithPercentPriceMinimum", + "UnitWithPercentPriceDimensionalPriceConfiguration", "MatrixWithAllocationPrice", "MatrixWithAllocationPriceBillableMetric", "MatrixWithAllocationPriceBillingCycleConfiguration", @@ -155,6 +170,7 @@ "MatrixWithAllocationPriceMatrixWithAllocationConfigMatrixValue", "MatrixWithAllocationPriceMaximum", "MatrixWithAllocationPriceMinimum", + "MatrixWithAllocationPriceDimensionalPriceConfiguration", "TieredWithProrationPrice", "TieredWithProrationPriceBillableMetric", "TieredWithProrationPriceBillingCycleConfiguration", @@ -163,6 +179,7 @@ "TieredWithProrationPriceItem", "TieredWithProrationPriceMaximum", "TieredWithProrationPriceMinimum", + "TieredWithProrationPriceDimensionalPriceConfiguration", "UnitWithProrationPrice", "UnitWithProrationPriceBillableMetric", "UnitWithProrationPriceBillingCycleConfiguration", @@ -171,6 +188,7 @@ "UnitWithProrationPriceItem", "UnitWithProrationPriceMaximum", "UnitWithProrationPriceMinimum", + "UnitWithProrationPriceDimensionalPriceConfiguration", "GroupedAllocationPrice", "GroupedAllocationPriceBillableMetric", "GroupedAllocationPriceBillingCycleConfiguration", @@ -179,6 +197,7 @@ "GroupedAllocationPriceItem", "GroupedAllocationPriceMaximum", "GroupedAllocationPriceMinimum", + "GroupedAllocationPriceDimensionalPriceConfiguration", "GroupedWithProratedMinimumPrice", "GroupedWithProratedMinimumPriceBillableMetric", "GroupedWithProratedMinimumPriceBillingCycleConfiguration", @@ -187,6 +206,7 @@ "GroupedWithProratedMinimumPriceItem", "GroupedWithProratedMinimumPriceMaximum", "GroupedWithProratedMinimumPriceMinimum", + "GroupedWithProratedMinimumPriceDimensionalPriceConfiguration", "GroupedWithMeteredMinimumPrice", "GroupedWithMeteredMinimumPriceBillableMetric", "GroupedWithMeteredMinimumPriceBillingCycleConfiguration", @@ -195,6 +215,7 @@ "GroupedWithMeteredMinimumPriceItem", "GroupedWithMeteredMinimumPriceMaximum", "GroupedWithMeteredMinimumPriceMinimum", + "GroupedWithMeteredMinimumPriceDimensionalPriceConfiguration", "MatrixWithDisplayNamePrice", "MatrixWithDisplayNamePriceBillableMetric", "MatrixWithDisplayNamePriceBillingCycleConfiguration", @@ -203,6 +224,7 @@ "MatrixWithDisplayNamePriceItem", "MatrixWithDisplayNamePriceMaximum", "MatrixWithDisplayNamePriceMinimum", + "MatrixWithDisplayNamePriceDimensionalPriceConfiguration", "BulkWithProrationPrice", "BulkWithProrationPriceBillableMetric", "BulkWithProrationPriceBillingCycleConfiguration", @@ -211,6 +233,7 @@ "BulkWithProrationPriceItem", "BulkWithProrationPriceMaximum", "BulkWithProrationPriceMinimum", + "BulkWithProrationPriceDimensionalPriceConfiguration", "GroupedTieredPackagePrice", "GroupedTieredPackagePriceBillableMetric", "GroupedTieredPackagePriceBillingCycleConfiguration", @@ -219,6 +242,7 @@ "GroupedTieredPackagePriceItem", "GroupedTieredPackagePriceMaximum", "GroupedTieredPackagePriceMinimum", + "GroupedTieredPackagePriceDimensionalPriceConfiguration", "MaxGroupTieredPackagePrice", "MaxGroupTieredPackagePriceBillableMetric", "MaxGroupTieredPackagePriceBillingCycleConfiguration", @@ -227,6 +251,25 @@ "MaxGroupTieredPackagePriceItem", "MaxGroupTieredPackagePriceMaximum", "MaxGroupTieredPackagePriceMinimum", + "MaxGroupTieredPackagePriceDimensionalPriceConfiguration", + "ScalableMatrixWithUnitPricingPrice", + "ScalableMatrixWithUnitPricingPriceBillableMetric", + "ScalableMatrixWithUnitPricingPriceBillingCycleConfiguration", + "ScalableMatrixWithUnitPricingPriceCreditAllocation", + "ScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration", + "ScalableMatrixWithUnitPricingPriceItem", + "ScalableMatrixWithUnitPricingPriceMaximum", + "ScalableMatrixWithUnitPricingPriceMinimum", + "ScalableMatrixWithUnitPricingPriceDimensionalPriceConfiguration", + "ScalableMatrixWithTieredPricingPrice", + "ScalableMatrixWithTieredPricingPriceBillableMetric", + "ScalableMatrixWithTieredPricingPriceBillingCycleConfiguration", + "ScalableMatrixWithTieredPricingPriceCreditAllocation", + "ScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration", + "ScalableMatrixWithTieredPricingPriceItem", + "ScalableMatrixWithTieredPricingPriceMaximum", + "ScalableMatrixWithTieredPricingPriceMinimum", + "ScalableMatrixWithTieredPricingPriceDimensionalPriceConfiguration", ] @@ -285,6 +328,12 @@ class UnitPriceUnitConfig(BaseModel): """Rate per unit of usage""" +class UnitPriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + class UnitPrice(BaseModel): id: str @@ -338,6 +387,8 @@ class UnitPrice(BaseModel): unit_config: UnitPriceUnitConfig + dimensional_price_configuration: Optional[UnitPriceDimensionalPriceConfiguration] = None + class PackagePriceBillableMetric(BaseModel): id: str @@ -401,6 +452,12 @@ class PackagePricePackageConfig(BaseModel): """ +class PackagePriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + class PackagePrice(BaseModel): id: str @@ -454,6 +511,8 @@ class PackagePrice(BaseModel): price_type: Literal["usage_price", "fixed_price"] + dimensional_price_configuration: Optional[PackagePriceDimensionalPriceConfiguration] = None + class MatrixPriceBillableMetric(BaseModel): id: str @@ -528,6 +587,12 @@ class MatrixPriceMinimum(BaseModel): """Minimum amount applied""" +class MatrixPriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + class MatrixPrice(BaseModel): id: str @@ -581,6 +646,8 @@ class MatrixPrice(BaseModel): price_type: Literal["usage_price", "fixed_price"] + dimensional_price_configuration: Optional[MatrixPriceDimensionalPriceConfiguration] = None + class TieredPriceBillableMetric(BaseModel): id: str @@ -648,6 +715,12 @@ class TieredPriceTieredConfig(BaseModel): """Tiers for rating based on total usage quantities into the specified tier""" +class TieredPriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + class TieredPrice(BaseModel): id: str @@ -701,6 +774,8 @@ class TieredPrice(BaseModel): tiered_config: TieredPriceTieredConfig + dimensional_price_configuration: Optional[TieredPriceDimensionalPriceConfiguration] = None + class TieredBpsPriceBillableMetric(BaseModel): id: str @@ -774,6 +849,12 @@ class TieredBpsPriceTieredBpsConfig(BaseModel): """ +class TieredBpsPriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + class TieredBpsPrice(BaseModel): id: str @@ -827,6 +908,8 @@ class TieredBpsPrice(BaseModel): tiered_bps_config: TieredBpsPriceTieredBpsConfig + dimensional_price_configuration: Optional[TieredBpsPriceDimensionalPriceConfiguration] = None + class BpsPriceBillableMetric(BaseModel): id: str @@ -886,6 +969,12 @@ class BpsPriceMinimum(BaseModel): """Minimum amount applied""" +class BpsPriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + class BpsPrice(BaseModel): id: str @@ -939,6 +1028,8 @@ class BpsPrice(BaseModel): price_type: Literal["usage_price", "fixed_price"] + dimensional_price_configuration: Optional[BpsPriceDimensionalPriceConfiguration] = None + class BulkBpsPriceBillableMetric(BaseModel): id: str @@ -1009,6 +1100,12 @@ class BulkBpsPriceMinimum(BaseModel): """Minimum amount applied""" +class BulkBpsPriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + class BulkBpsPrice(BaseModel): id: str @@ -1062,6 +1159,8 @@ class BulkBpsPrice(BaseModel): price_type: Literal["usage_price", "fixed_price"] + dimensional_price_configuration: Optional[BulkBpsPriceDimensionalPriceConfiguration] = None + class BulkPriceBillableMetric(BaseModel): id: str @@ -1126,6 +1225,12 @@ class BulkPriceMinimum(BaseModel): """Minimum amount applied""" +class BulkPriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + class BulkPrice(BaseModel): id: str @@ -1179,6 +1284,8 @@ class BulkPrice(BaseModel): price_type: Literal["usage_price", "fixed_price"] + dimensional_price_configuration: Optional[BulkPriceDimensionalPriceConfiguration] = None + class ThresholdTotalAmountPriceBillableMetric(BaseModel): id: str @@ -1230,6 +1337,12 @@ class ThresholdTotalAmountPriceMinimum(BaseModel): """Minimum amount applied""" +class ThresholdTotalAmountPriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + class ThresholdTotalAmountPrice(BaseModel): id: str @@ -1283,6 +1396,8 @@ class ThresholdTotalAmountPrice(BaseModel): threshold_total_amount_config: Dict[str, object] + dimensional_price_configuration: Optional[ThresholdTotalAmountPriceDimensionalPriceConfiguration] = None + class TieredPackagePriceBillableMetric(BaseModel): id: str @@ -1334,6 +1449,12 @@ class TieredPackagePriceMinimum(BaseModel): """Minimum amount applied""" +class TieredPackagePriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + class TieredPackagePrice(BaseModel): id: str @@ -1387,6 +1508,8 @@ class TieredPackagePrice(BaseModel): tiered_package_config: Dict[str, object] + dimensional_price_configuration: Optional[TieredPackagePriceDimensionalPriceConfiguration] = None + class GroupedTieredPriceBillableMetric(BaseModel): id: str @@ -1438,6 +1561,12 @@ class GroupedTieredPriceMinimum(BaseModel): """Minimum amount applied""" +class GroupedTieredPriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + class GroupedTieredPrice(BaseModel): id: str @@ -1491,6 +1620,8 @@ class GroupedTieredPrice(BaseModel): price_type: Literal["usage_price", "fixed_price"] + dimensional_price_configuration: Optional[GroupedTieredPriceDimensionalPriceConfiguration] = None + class TieredWithMinimumPriceBillableMetric(BaseModel): id: str @@ -1542,6 +1673,12 @@ class TieredWithMinimumPriceMinimum(BaseModel): """Minimum amount applied""" +class TieredWithMinimumPriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + class TieredWithMinimumPrice(BaseModel): id: str @@ -1595,6 +1732,8 @@ class TieredWithMinimumPrice(BaseModel): tiered_with_minimum_config: Dict[str, object] + dimensional_price_configuration: Optional[TieredWithMinimumPriceDimensionalPriceConfiguration] = None + class TieredPackageWithMinimumPriceBillableMetric(BaseModel): id: str @@ -1646,6 +1785,12 @@ class TieredPackageWithMinimumPriceMinimum(BaseModel): """Minimum amount applied""" +class TieredPackageWithMinimumPriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + class TieredPackageWithMinimumPrice(BaseModel): id: str @@ -1699,6 +1844,8 @@ class TieredPackageWithMinimumPrice(BaseModel): tiered_package_with_minimum_config: Dict[str, object] + dimensional_price_configuration: Optional[TieredPackageWithMinimumPriceDimensionalPriceConfiguration] = None + class PackageWithAllocationPriceBillableMetric(BaseModel): id: str @@ -1750,6 +1897,12 @@ class PackageWithAllocationPriceMinimum(BaseModel): """Minimum amount applied""" +class PackageWithAllocationPriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + class PackageWithAllocationPrice(BaseModel): id: str @@ -1803,6 +1956,8 @@ class PackageWithAllocationPrice(BaseModel): price_type: Literal["usage_price", "fixed_price"] + dimensional_price_configuration: Optional[PackageWithAllocationPriceDimensionalPriceConfiguration] = None + class UnitWithPercentPriceBillableMetric(BaseModel): id: str @@ -1854,6 +2009,12 @@ class UnitWithPercentPriceMinimum(BaseModel): """Minimum amount applied""" +class UnitWithPercentPriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + class UnitWithPercentPrice(BaseModel): id: str @@ -1907,6 +2068,8 @@ class UnitWithPercentPrice(BaseModel): unit_with_percent_config: Dict[str, object] + dimensional_price_configuration: Optional[UnitWithPercentPriceDimensionalPriceConfiguration] = None + class MatrixWithAllocationPriceBillableMetric(BaseModel): id: str @@ -1984,6 +2147,12 @@ class MatrixWithAllocationPriceMinimum(BaseModel): """Minimum amount applied""" +class MatrixWithAllocationPriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + class MatrixWithAllocationPrice(BaseModel): id: str @@ -2037,6 +2206,8 @@ class MatrixWithAllocationPrice(BaseModel): price_type: Literal["usage_price", "fixed_price"] + dimensional_price_configuration: Optional[MatrixWithAllocationPriceDimensionalPriceConfiguration] = None + class TieredWithProrationPriceBillableMetric(BaseModel): id: str @@ -2088,6 +2259,12 @@ class TieredWithProrationPriceMinimum(BaseModel): """Minimum amount applied""" +class TieredWithProrationPriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + class TieredWithProrationPrice(BaseModel): id: str @@ -2141,6 +2318,8 @@ class TieredWithProrationPrice(BaseModel): tiered_with_proration_config: Dict[str, object] + dimensional_price_configuration: Optional[TieredWithProrationPriceDimensionalPriceConfiguration] = None + class UnitWithProrationPriceBillableMetric(BaseModel): id: str @@ -2192,6 +2371,12 @@ class UnitWithProrationPriceMinimum(BaseModel): """Minimum amount applied""" +class UnitWithProrationPriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + class UnitWithProrationPrice(BaseModel): id: str @@ -2245,6 +2430,8 @@ class UnitWithProrationPrice(BaseModel): unit_with_proration_config: Dict[str, object] + dimensional_price_configuration: Optional[UnitWithProrationPriceDimensionalPriceConfiguration] = None + class GroupedAllocationPriceBillableMetric(BaseModel): id: str @@ -2296,6 +2483,12 @@ class GroupedAllocationPriceMinimum(BaseModel): """Minimum amount applied""" +class GroupedAllocationPriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + class GroupedAllocationPrice(BaseModel): id: str @@ -2349,6 +2542,8 @@ class GroupedAllocationPrice(BaseModel): price_type: Literal["usage_price", "fixed_price"] + dimensional_price_configuration: Optional[GroupedAllocationPriceDimensionalPriceConfiguration] = None + class GroupedWithProratedMinimumPriceBillableMetric(BaseModel): id: str @@ -2400,6 +2595,12 @@ class GroupedWithProratedMinimumPriceMinimum(BaseModel): """Minimum amount applied""" +class GroupedWithProratedMinimumPriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + class GroupedWithProratedMinimumPrice(BaseModel): id: str @@ -2453,6 +2654,8 @@ class GroupedWithProratedMinimumPrice(BaseModel): price_type: Literal["usage_price", "fixed_price"] + dimensional_price_configuration: Optional[GroupedWithProratedMinimumPriceDimensionalPriceConfiguration] = None + class GroupedWithMeteredMinimumPriceBillableMetric(BaseModel): id: str @@ -2504,6 +2707,12 @@ class GroupedWithMeteredMinimumPriceMinimum(BaseModel): """Minimum amount applied""" +class GroupedWithMeteredMinimumPriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + class GroupedWithMeteredMinimumPrice(BaseModel): id: str @@ -2557,6 +2766,8 @@ class GroupedWithMeteredMinimumPrice(BaseModel): price_type: Literal["usage_price", "fixed_price"] + dimensional_price_configuration: Optional[GroupedWithMeteredMinimumPriceDimensionalPriceConfiguration] = None + class MatrixWithDisplayNamePriceBillableMetric(BaseModel): id: str @@ -2608,6 +2819,12 @@ class MatrixWithDisplayNamePriceMinimum(BaseModel): """Minimum amount applied""" +class MatrixWithDisplayNamePriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + class MatrixWithDisplayNamePrice(BaseModel): id: str @@ -2661,6 +2878,8 @@ class MatrixWithDisplayNamePrice(BaseModel): price_type: Literal["usage_price", "fixed_price"] + dimensional_price_configuration: Optional[MatrixWithDisplayNamePriceDimensionalPriceConfiguration] = None + class BulkWithProrationPriceBillableMetric(BaseModel): id: str @@ -2712,6 +2931,12 @@ class BulkWithProrationPriceMinimum(BaseModel): """Minimum amount applied""" +class BulkWithProrationPriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + class BulkWithProrationPrice(BaseModel): id: str @@ -2765,6 +2990,8 @@ class BulkWithProrationPrice(BaseModel): price_type: Literal["usage_price", "fixed_price"] + dimensional_price_configuration: Optional[BulkWithProrationPriceDimensionalPriceConfiguration] = None + class GroupedTieredPackagePriceBillableMetric(BaseModel): id: str @@ -2816,6 +3043,12 @@ class GroupedTieredPackagePriceMinimum(BaseModel): """Minimum amount applied""" +class GroupedTieredPackagePriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + class GroupedTieredPackagePrice(BaseModel): id: str @@ -2869,6 +3102,8 @@ class GroupedTieredPackagePrice(BaseModel): price_type: Literal["usage_price", "fixed_price"] + dimensional_price_configuration: Optional[GroupedTieredPackagePriceDimensionalPriceConfiguration] = None + class MaxGroupTieredPackagePriceBillableMetric(BaseModel): id: str @@ -2920,6 +3155,12 @@ class MaxGroupTieredPackagePriceMinimum(BaseModel): """Minimum amount applied""" +class MaxGroupTieredPackagePriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + class MaxGroupTieredPackagePrice(BaseModel): id: str @@ -2973,6 +3214,232 @@ class MaxGroupTieredPackagePrice(BaseModel): price_type: Literal["usage_price", "fixed_price"] + dimensional_price_configuration: Optional[MaxGroupTieredPackagePriceDimensionalPriceConfiguration] = None + + +class ScalableMatrixWithUnitPricingPriceBillableMetric(BaseModel): + id: str + + +class ScalableMatrixWithUnitPricingPriceBillingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class ScalableMatrixWithUnitPricingPriceCreditAllocation(BaseModel): + allows_rollover: bool + + currency: str + + +class ScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class ScalableMatrixWithUnitPricingPriceItem(BaseModel): + id: str + + name: str + + +class ScalableMatrixWithUnitPricingPriceMaximum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this maximum amount applies to. + + For plan/plan phase maximums, this can be a subset of prices. + """ + + maximum_amount: str + """Maximum amount applied""" + + +class ScalableMatrixWithUnitPricingPriceMinimum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this minimum amount applies to. + + For plan/plan phase minimums, this can be a subset of prices. + """ + + minimum_amount: str + """Minimum amount applied""" + + +class ScalableMatrixWithUnitPricingPriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + +class ScalableMatrixWithUnitPricingPrice(BaseModel): + id: str + + billable_metric: Optional[ScalableMatrixWithUnitPricingPriceBillableMetric] = None + + billing_cycle_configuration: ScalableMatrixWithUnitPricingPriceBillingCycleConfiguration + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[ScalableMatrixWithUnitPricingPriceCreditAllocation] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + invoicing_cycle_configuration: Optional[ScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration] = None + + item: ScalableMatrixWithUnitPricingPriceItem + + maximum: Optional[ScalableMatrixWithUnitPricingPriceMaximum] = 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[ScalableMatrixWithUnitPricingPriceMinimum] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["scalable_matrix_with_unit_pricing"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + scalable_matrix_with_unit_pricing_config: Dict[str, object] + + dimensional_price_configuration: Optional[ScalableMatrixWithUnitPricingPriceDimensionalPriceConfiguration] = None + + +class ScalableMatrixWithTieredPricingPriceBillableMetric(BaseModel): + id: str + + +class ScalableMatrixWithTieredPricingPriceBillingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class ScalableMatrixWithTieredPricingPriceCreditAllocation(BaseModel): + allows_rollover: bool + + currency: str + + +class ScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class ScalableMatrixWithTieredPricingPriceItem(BaseModel): + id: str + + name: str + + +class ScalableMatrixWithTieredPricingPriceMaximum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this maximum amount applies to. + + For plan/plan phase maximums, this can be a subset of prices. + """ + + maximum_amount: str + """Maximum amount applied""" + + +class ScalableMatrixWithTieredPricingPriceMinimum(BaseModel): + applies_to_price_ids: List[str] + """List of price_ids that this minimum amount applies to. + + For plan/plan phase minimums, this can be a subset of prices. + """ + + minimum_amount: str + """Minimum amount applied""" + + +class ScalableMatrixWithTieredPricingPriceDimensionalPriceConfiguration(BaseModel): + dimension_values: List[str] + + dimensional_price_group_id: str + + +class ScalableMatrixWithTieredPricingPrice(BaseModel): + id: str + + billable_metric: Optional[ScalableMatrixWithTieredPricingPriceBillableMetric] = None + + billing_cycle_configuration: ScalableMatrixWithTieredPricingPriceBillingCycleConfiguration + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[ScalableMatrixWithTieredPricingPriceCreditAllocation] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + invoicing_cycle_configuration: Optional[ScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration] = None + + item: ScalableMatrixWithTieredPricingPriceItem + + maximum: Optional[ScalableMatrixWithTieredPricingPriceMaximum] = 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[ScalableMatrixWithTieredPricingPriceMinimum] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["scalable_matrix_with_tiered_pricing"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + scalable_matrix_with_tiered_pricing_config: Dict[str, object] + + dimensional_price_configuration: Optional[ScalableMatrixWithTieredPricingPriceDimensionalPriceConfiguration] = None + Price: TypeAlias = Annotated[ Union[ @@ -3001,6 +3468,8 @@ class MaxGroupTieredPackagePrice(BaseModel): BulkWithProrationPrice, GroupedTieredPackagePrice, MaxGroupTieredPackagePrice, + ScalableMatrixWithUnitPricingPrice, + ScalableMatrixWithTieredPricingPrice, ], PropertyInfo(discriminator="price_model_type"), ] diff --git a/src/orb/types/price_create_params.py b/src/orb/types/price_create_params.py index 52959684..88789702 100644 --- a/src/orb/types/price_create_params.py +++ b/src/orb/types/price_create_params.py @@ -97,6 +97,12 @@ "NewFloatingGroupedTieredPackagePrice", "NewFloatingGroupedTieredPackagePriceBillingCycleConfiguration", "NewFloatingGroupedTieredPackagePriceInvoicingCycleConfiguration", + "NewFloatingScalableMatrixWithUnitPricingPrice", + "NewFloatingScalableMatrixWithUnitPricingPriceBillingCycleConfiguration", + "NewFloatingScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration", + "NewFloatingScalableMatrixWithTieredPricingPrice", + "NewFloatingScalableMatrixWithTieredPricingPriceBillingCycleConfiguration", + "NewFloatingScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration", ] @@ -2244,6 +2250,166 @@ class NewFloatingGroupedTieredPackagePriceInvoicingCycleConfiguration(TypedDict, """The unit of billing period duration.""" +class NewFloatingScalableMatrixWithUnitPricingPrice(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 plan will be associated with.""" + + model_type: Required[Literal["scalable_matrix_with_unit_pricing"]] + + name: Required[str] + """The name of the price.""" + + scalable_matrix_with_unit_pricing_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + 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[NewFloatingScalableMatrixWithUnitPricingPriceBillingCycleConfiguration] + """ + 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.""" + + 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[NewFloatingScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration] + """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 NewFloatingScalableMatrixWithUnitPricingPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class NewFloatingScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class NewFloatingScalableMatrixWithTieredPricingPrice(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 plan will be associated with.""" + + model_type: Required[Literal["scalable_matrix_with_tiered_pricing"]] + + name: Required[str] + """The name of the price.""" + + scalable_matrix_with_tiered_pricing_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + 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[NewFloatingScalableMatrixWithTieredPricingPriceBillingCycleConfiguration] + """ + 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.""" + + 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[NewFloatingScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration] + """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 NewFloatingScalableMatrixWithTieredPricingPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class NewFloatingScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + PriceCreateParams: TypeAlias = Union[ NewFloatingUnitPrice, NewFloatingPackagePrice, @@ -2270,4 +2436,6 @@ class NewFloatingGroupedTieredPackagePriceInvoicingCycleConfiguration(TypedDict, NewFloatingMatrixWithDisplayNamePrice, NewFloatingBulkWithProrationPrice, NewFloatingGroupedTieredPackagePrice, + NewFloatingScalableMatrixWithUnitPricingPrice, + NewFloatingScalableMatrixWithTieredPricingPrice, ] diff --git a/src/orb/types/subscription_price_intervals_params.py b/src/orb/types/subscription_price_intervals_params.py index e342375c..dcc68fc5 100644 --- a/src/orb/types/subscription_price_intervals_params.py +++ b/src/orb/types/subscription_price_intervals_params.py @@ -109,6 +109,12 @@ "AddPriceNewFloatingGroupedTieredPackagePrice", "AddPriceNewFloatingGroupedTieredPackagePriceBillingCycleConfiguration", "AddPriceNewFloatingGroupedTieredPackagePriceInvoicingCycleConfiguration", + "AddPriceNewFloatingScalableMatrixWithUnitPricingPrice", + "AddPriceNewFloatingScalableMatrixWithUnitPricingPriceBillingCycleConfiguration", + "AddPriceNewFloatingScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration", + "AddPriceNewFloatingScalableMatrixWithTieredPricingPrice", + "AddPriceNewFloatingScalableMatrixWithTieredPricingPriceBillingCycleConfiguration", + "AddPriceNewFloatingScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration", "AddAdjustment", "AddAdjustmentAdjustment", "AddAdjustmentAdjustmentNewPercentageDiscount", @@ -2346,6 +2352,174 @@ class AddPriceNewFloatingGroupedTieredPackagePrice(TypedDict, total=False): """ +class AddPriceNewFloatingScalableMatrixWithUnitPricingPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingScalableMatrixWithUnitPricingPrice(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 plan will be associated with.""" + + model_type: Required[Literal["scalable_matrix_with_unit_pricing"]] + + name: Required[str] + """The name of the price.""" + + scalable_matrix_with_unit_pricing_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + 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[ + AddPriceNewFloatingScalableMatrixWithUnitPricingPriceBillingCycleConfiguration + ] + """ + 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.""" + + 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[ + AddPriceNewFloatingScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration + ] + """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 AddPriceNewFloatingScalableMatrixWithTieredPricingPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingScalableMatrixWithTieredPricingPrice(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 plan will be associated with.""" + + model_type: Required[Literal["scalable_matrix_with_tiered_pricing"]] + + name: Required[str] + """The name of the price.""" + + scalable_matrix_with_tiered_pricing_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + 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[ + AddPriceNewFloatingScalableMatrixWithTieredPricingPriceBillingCycleConfiguration + ] + """ + 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.""" + + 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[ + AddPriceNewFloatingScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration + ] + """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[ AddPriceNewFloatingUnitPrice, AddPriceNewFloatingPackagePrice, @@ -2372,6 +2546,8 @@ class AddPriceNewFloatingGroupedTieredPackagePrice(TypedDict, total=False): AddPriceNewFloatingMatrixWithDisplayNamePrice, AddPriceNewFloatingBulkWithProrationPrice, AddPriceNewFloatingGroupedTieredPackagePrice, + AddPriceNewFloatingScalableMatrixWithUnitPricingPrice, + AddPriceNewFloatingScalableMatrixWithTieredPricingPrice, ] diff --git a/tests/api_resources/test_prices.py b/tests/api_resources/test_prices.py index c8481357..096edc04 100644 --- a/tests/api_resources/test_prices.py +++ b/tests/api_resources/test_prices.py @@ -2012,6 +2012,152 @@ def test_streaming_response_create_overload_25(self, client: Orb) -> None: assert cast(Any, response.is_closed) is True + @parametrize + def test_method_create_overload_26(self, client: Orb) -> None: + price = client.prices.create( + cadence="annual", + currency="currency", + item_id="item_id", + model_type="scalable_matrix_with_unit_pricing", + name="Annual fee", + scalable_matrix_with_unit_pricing_config={"foo": "bar"}, + ) + assert_matches_type(Price, price, path=["response"]) + + @parametrize + def test_method_create_with_all_params_overload_26(self, client: Orb) -> None: + price = client.prices.create( + cadence="annual", + currency="currency", + item_id="item_id", + model_type="scalable_matrix_with_unit_pricing", + name="Annual fee", + scalable_matrix_with_unit_pricing_config={"foo": "bar"}, + billable_metric_id="billable_metric_id", + billed_in_advance=True, + billing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, + conversion_rate=0, + external_price_id="external_price_id", + fixed_price_quantity=0, + invoice_grouping_key="invoice_grouping_key", + 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_26(self, client: Orb) -> None: + response = client.prices.with_raw_response.create( + cadence="annual", + currency="currency", + item_id="item_id", + model_type="scalable_matrix_with_unit_pricing", + name="Annual fee", + scalable_matrix_with_unit_pricing_config={"foo": "bar"}, + ) + + 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_26(self, client: Orb) -> None: + with client.prices.with_streaming_response.create( + cadence="annual", + currency="currency", + item_id="item_id", + model_type="scalable_matrix_with_unit_pricing", + name="Annual fee", + scalable_matrix_with_unit_pricing_config={"foo": "bar"}, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + price = response.parse() + assert_matches_type(Price, price, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_create_overload_27(self, client: Orb) -> None: + price = client.prices.create( + cadence="annual", + currency="currency", + item_id="item_id", + model_type="scalable_matrix_with_tiered_pricing", + name="Annual fee", + scalable_matrix_with_tiered_pricing_config={"foo": "bar"}, + ) + assert_matches_type(Price, price, path=["response"]) + + @parametrize + def test_method_create_with_all_params_overload_27(self, client: Orb) -> None: + price = client.prices.create( + cadence="annual", + currency="currency", + item_id="item_id", + model_type="scalable_matrix_with_tiered_pricing", + name="Annual fee", + scalable_matrix_with_tiered_pricing_config={"foo": "bar"}, + billable_metric_id="billable_metric_id", + billed_in_advance=True, + billing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, + conversion_rate=0, + external_price_id="external_price_id", + fixed_price_quantity=0, + invoice_grouping_key="invoice_grouping_key", + 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_27(self, client: Orb) -> None: + response = client.prices.with_raw_response.create( + cadence="annual", + currency="currency", + item_id="item_id", + model_type="scalable_matrix_with_tiered_pricing", + name="Annual fee", + scalable_matrix_with_tiered_pricing_config={"foo": "bar"}, + ) + + 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_27(self, client: Orb) -> None: + with client.prices.with_streaming_response.create( + cadence="annual", + currency="currency", + item_id="item_id", + model_type="scalable_matrix_with_tiered_pricing", + name="Annual fee", + scalable_matrix_with_tiered_pricing_config={"foo": "bar"}, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + price = response.parse() + assert_matches_type(Price, price, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize def test_method_update(self, client: Orb) -> None: price = client.prices.update( @@ -4182,6 +4328,152 @@ async def test_streaming_response_create_overload_25(self, async_client: AsyncOr assert cast(Any, response.is_closed) is True + @parametrize + async def test_method_create_overload_26(self, async_client: AsyncOrb) -> None: + price = await async_client.prices.create( + cadence="annual", + currency="currency", + item_id="item_id", + model_type="scalable_matrix_with_unit_pricing", + name="Annual fee", + scalable_matrix_with_unit_pricing_config={"foo": "bar"}, + ) + assert_matches_type(Price, price, path=["response"]) + + @parametrize + async def test_method_create_with_all_params_overload_26(self, async_client: AsyncOrb) -> None: + price = await async_client.prices.create( + cadence="annual", + currency="currency", + item_id="item_id", + model_type="scalable_matrix_with_unit_pricing", + name="Annual fee", + scalable_matrix_with_unit_pricing_config={"foo": "bar"}, + billable_metric_id="billable_metric_id", + billed_in_advance=True, + billing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, + conversion_rate=0, + external_price_id="external_price_id", + fixed_price_quantity=0, + invoice_grouping_key="invoice_grouping_key", + 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_26(self, async_client: AsyncOrb) -> None: + response = await async_client.prices.with_raw_response.create( + cadence="annual", + currency="currency", + item_id="item_id", + model_type="scalable_matrix_with_unit_pricing", + name="Annual fee", + scalable_matrix_with_unit_pricing_config={"foo": "bar"}, + ) + + 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_26(self, async_client: AsyncOrb) -> None: + async with async_client.prices.with_streaming_response.create( + cadence="annual", + currency="currency", + item_id="item_id", + model_type="scalable_matrix_with_unit_pricing", + name="Annual fee", + scalable_matrix_with_unit_pricing_config={"foo": "bar"}, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + 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_27(self, async_client: AsyncOrb) -> None: + price = await async_client.prices.create( + cadence="annual", + currency="currency", + item_id="item_id", + model_type="scalable_matrix_with_tiered_pricing", + name="Annual fee", + scalable_matrix_with_tiered_pricing_config={"foo": "bar"}, + ) + assert_matches_type(Price, price, path=["response"]) + + @parametrize + async def test_method_create_with_all_params_overload_27(self, async_client: AsyncOrb) -> None: + price = await async_client.prices.create( + cadence="annual", + currency="currency", + item_id="item_id", + model_type="scalable_matrix_with_tiered_pricing", + name="Annual fee", + scalable_matrix_with_tiered_pricing_config={"foo": "bar"}, + billable_metric_id="billable_metric_id", + billed_in_advance=True, + billing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, + conversion_rate=0, + external_price_id="external_price_id", + fixed_price_quantity=0, + invoice_grouping_key="invoice_grouping_key", + 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_27(self, async_client: AsyncOrb) -> None: + response = await async_client.prices.with_raw_response.create( + cadence="annual", + currency="currency", + item_id="item_id", + model_type="scalable_matrix_with_tiered_pricing", + name="Annual fee", + scalable_matrix_with_tiered_pricing_config={"foo": "bar"}, + ) + + 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_27(self, async_client: AsyncOrb) -> None: + async with async_client.prices.with_streaming_response.create( + cadence="annual", + currency="currency", + item_id="item_id", + model_type="scalable_matrix_with_tiered_pricing", + name="Annual fee", + scalable_matrix_with_tiered_pricing_config={"foo": "bar"}, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + price = await response.parse() + assert_matches_type(Price, price, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize async def test_method_update(self, async_client: AsyncOrb) -> None: price = await async_client.prices.update(