diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 02bd31d3..8428ab92 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.21.0" + ".": "2.22.0" } diff --git a/.stats.yml b/.stats.yml index b1872c09..eeba5cf5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 101 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-1720084d65e39f50455fe3a8756afc68fedf57306a727f92e4d020c28878df87.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-11f40c15fa889d9752019e8a35b82d2e7a3d42f2b42c850b469f120a5b2c47ba.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 24b87d4d..e8f8d1df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## 2.22.0 (2025-01-16) + +Full Changelog: [v2.21.0...v2.22.0](https://github.com/orbcorp/orb-python/compare/v2.21.0...v2.22.0) + +### Features + +* **api:** api update ([#491](https://github.com/orbcorp/orb-python/issues/491)) ([1f41a57](https://github.com/orbcorp/orb-python/commit/1f41a57f91218d275d85428d85458d6310aa15c4)) +* **api:** api update ([#492](https://github.com/orbcorp/orb-python/issues/492)) ([8f48b6a](https://github.com/orbcorp/orb-python/commit/8f48b6aae6927aad5347f83fabf9c86059425dfe)) + + +### Chores + +* **internal:** version bump ([#469](https://github.com/orbcorp/orb-python/issues/469)) ([0c32ed8](https://github.com/orbcorp/orb-python/commit/0c32ed802f75842cd86bd2f631fc4cff5349e490)) +* **internal:** version bump ([#489](https://github.com/orbcorp/orb-python/issues/489)) ([fe81c5e](https://github.com/orbcorp/orb-python/commit/fe81c5e9845f5848296e2b2d52fffe04b53040d7)) + ## 2.21.0 (2025-01-15) Full Changelog: [v2.20.0...v2.21.0](https://github.com/orbcorp/orb-python/compare/v2.20.0...v2.21.0) diff --git a/pyproject.toml b/pyproject.toml index c1f63b5e..967fa0c2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "orb-billing" -version = "2.21.0" +version = "2.22.0" description = "The official Python library for the orb API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/orb/_version.py b/src/orb/_version.py index db5740a0..a6d335f6 100644 --- a/src/orb/_version.py +++ b/src/orb/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "orb" -__version__ = "2.21.0" # x-release-please-version +__version__ = "2.22.0" # x-release-please-version diff --git a/src/orb/resources/prices/prices.py b/src/orb/resources/prices/prices.py index 79cfe6f3..ae751f6b 100644 --- a/src/orb/resources/prices/prices.py +++ b/src/orb/resources/prices/prices.py @@ -1133,6 +1133,98 @@ def create( """ ... + @overload + def create( + self, + *, + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], + currency: str, + item_id: str, + max_group_tiered_config: Dict[str, object], + model_type: Literal["max_group_tiered"], + name: str, + billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, + billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingMaxGroupTieredPriceBillingCycleConfiguration + ] + | 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.NewFloatingMaxGroupTieredPriceInvoicingCycleConfiguration + ] + | 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](../reference/price). + + 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](../reference/price) 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, @@ -2250,6 +2342,7 @@ def create( ["cadence", "currency", "item_id", "model_type", "name", "threshold_total_amount_config"], ["cadence", "currency", "item_id", "model_type", "name", "tiered_package_config"], ["cadence", "currency", "grouped_tiered_config", "item_id", "model_type", "name"], + ["cadence", "currency", "item_id", "max_group_tiered_config", "model_type", "name"], ["cadence", "currency", "item_id", "model_type", "name", "tiered_with_minimum_config"], ["cadence", "currency", "item_id", "model_type", "name", "package_with_allocation_config"], ["cadence", "currency", "item_id", "model_type", "name", "tiered_package_with_minimum_config"], @@ -2281,6 +2374,7 @@ def create( | Literal["threshold_total_amount"] | Literal["tiered_package"] | Literal["grouped_tiered"] + | Literal["max_group_tiered"] | Literal["tiered_with_minimum"] | Literal["package_with_allocation"] | Literal["tiered_package_with_minimum"] @@ -2318,6 +2412,7 @@ def create( threshold_total_amount_config: Dict[str, object] | NotGiven = NOT_GIVEN, tiered_package_config: Dict[str, object] | NotGiven = NOT_GIVEN, grouped_tiered_config: Dict[str, object] | NotGiven = NOT_GIVEN, + max_group_tiered_config: Dict[str, object] | NotGiven = NOT_GIVEN, tiered_with_minimum_config: Dict[str, object] | NotGiven = NOT_GIVEN, package_with_allocation_config: Dict[str, object] | NotGiven = NOT_GIVEN, tiered_package_with_minimum_config: Dict[str, object] | NotGiven = NOT_GIVEN, @@ -2370,6 +2465,7 @@ def create( "threshold_total_amount_config": threshold_total_amount_config, "tiered_package_config": tiered_package_config, "grouped_tiered_config": grouped_tiered_config, + "max_group_tiered_config": max_group_tiered_config, "tiered_with_minimum_config": tiered_with_minimum_config, "package_with_allocation_config": package_with_allocation_config, "tiered_package_with_minimum_config": tiered_package_with_minimum_config, @@ -3725,6 +3821,98 @@ async def create( """ ... + @overload + async def create( + self, + *, + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], + currency: str, + item_id: str, + max_group_tiered_config: Dict[str, object], + model_type: Literal["max_group_tiered"], + name: str, + billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, + billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingMaxGroupTieredPriceBillingCycleConfiguration + ] + | 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.NewFloatingMaxGroupTieredPriceInvoicingCycleConfiguration + ] + | 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](../reference/price). + + 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](../reference/price) 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, @@ -4842,6 +5030,7 @@ async def create( ["cadence", "currency", "item_id", "model_type", "name", "threshold_total_amount_config"], ["cadence", "currency", "item_id", "model_type", "name", "tiered_package_config"], ["cadence", "currency", "grouped_tiered_config", "item_id", "model_type", "name"], + ["cadence", "currency", "item_id", "max_group_tiered_config", "model_type", "name"], ["cadence", "currency", "item_id", "model_type", "name", "tiered_with_minimum_config"], ["cadence", "currency", "item_id", "model_type", "name", "package_with_allocation_config"], ["cadence", "currency", "item_id", "model_type", "name", "tiered_package_with_minimum_config"], @@ -4873,6 +5062,7 @@ async def create( | Literal["threshold_total_amount"] | Literal["tiered_package"] | Literal["grouped_tiered"] + | Literal["max_group_tiered"] | Literal["tiered_with_minimum"] | Literal["package_with_allocation"] | Literal["tiered_package_with_minimum"] @@ -4910,6 +5100,7 @@ async def create( threshold_total_amount_config: Dict[str, object] | NotGiven = NOT_GIVEN, tiered_package_config: Dict[str, object] | NotGiven = NOT_GIVEN, grouped_tiered_config: Dict[str, object] | NotGiven = NOT_GIVEN, + max_group_tiered_config: Dict[str, object] | NotGiven = NOT_GIVEN, tiered_with_minimum_config: Dict[str, object] | NotGiven = NOT_GIVEN, package_with_allocation_config: Dict[str, object] | NotGiven = NOT_GIVEN, tiered_package_with_minimum_config: Dict[str, object] | NotGiven = NOT_GIVEN, @@ -4962,6 +5153,7 @@ async def create( "threshold_total_amount_config": threshold_total_amount_config, "tiered_package_config": tiered_package_config, "grouped_tiered_config": grouped_tiered_config, + "max_group_tiered_config": max_group_tiered_config, "tiered_with_minimum_config": tiered_with_minimum_config, "package_with_allocation_config": package_with_allocation_config, "tiered_package_with_minimum_config": tiered_package_with_minimum_config, diff --git a/src/orb/resources/subscriptions.py b/src/orb/resources/subscriptions.py index a377b5fa..96863c6c 100644 --- a/src/orb/resources/subscriptions.py +++ b/src/orb/resources/subscriptions.py @@ -1578,7 +1578,8 @@ def schedule_plan_change( billing cycle alignment. change_date: The date that the plan change should take effect. This parameter can only be - passed if the `change_option` is `requested_date`. + passed if the `change_option` is `requested_date`. If a date with no time is + passed, the plan change will happen at midnight in the customer's timezone. coupon_redemption_code: Redemption code to be used for this subscription. If the coupon cannot be found by its redemption code, or cannot be redeemed, an error response will be @@ -3541,7 +3542,8 @@ async def schedule_plan_change( billing cycle alignment. change_date: The date that the plan change should take effect. This parameter can only be - passed if the `change_option` is `requested_date`. + passed if the `change_option` is `requested_date`. If a date with no time is + passed, the plan change will happen at midnight in the customer's timezone. coupon_redemption_code: Redemption code to be used for this subscription. If the coupon cannot be found by its redemption code, or cannot be redeemed, an error response will be diff --git a/src/orb/types/plan_create_params.py b/src/orb/types/plan_create_params.py index 9c4e0060..3acff665 100644 --- a/src/orb/types/plan_create_params.py +++ b/src/orb/types/plan_create_params.py @@ -84,6 +84,9 @@ "PriceNewPlanGroupedTieredPackagePrice", "PriceNewPlanGroupedTieredPackagePriceBillingCycleConfiguration", "PriceNewPlanGroupedTieredPackagePriceInvoicingCycleConfiguration", + "PriceNewPlanMaxGroupTieredPrice", + "PriceNewPlanMaxGroupTieredPriceBillingCycleConfiguration", + "PriceNewPlanMaxGroupTieredPriceInvoicingCycleConfiguration", ] @@ -1991,6 +1994,89 @@ class PriceNewPlanGroupedTieredPackagePrice(TypedDict, total=False): """ +class PriceNewPlanMaxGroupTieredPriceBillingCycleConfiguration(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 PriceNewPlanMaxGroupTieredPriceInvoicingCycleConfiguration(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 PriceNewPlanMaxGroupTieredPrice(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.""" + + max_group_tiered_config: Required[Dict[str, object]] + + model_type: Required[Literal["max_group_tiered"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[PriceNewPlanMaxGroupTieredPriceBillingCycleConfiguration] + """ + 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[PriceNewPlanMaxGroupTieredPriceInvoicingCycleConfiguration] + """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, @@ -2013,4 +2099,5 @@ class PriceNewPlanGroupedTieredPackagePrice(TypedDict, total=False): PriceNewPlanMatrixWithDisplayNamePrice, PriceNewPlanBulkWithProrationPrice, PriceNewPlanGroupedTieredPackagePrice, + PriceNewPlanMaxGroupTieredPrice, ] diff --git a/src/orb/types/price.py b/src/orb/types/price.py index 3273da59..394bc23b 100644 --- a/src/orb/types/price.py +++ b/src/orb/types/price.py @@ -219,6 +219,14 @@ "GroupedTieredPackagePriceItem", "GroupedTieredPackagePriceMaximum", "GroupedTieredPackagePriceMinimum", + "MaxGroupTieredPrice", + "MaxGroupTieredPriceBillableMetric", + "MaxGroupTieredPriceBillingCycleConfiguration", + "MaxGroupTieredPriceCreditAllocation", + "MaxGroupTieredPriceInvoicingCycleConfiguration", + "MaxGroupTieredPriceItem", + "MaxGroupTieredPriceMaximum", + "MaxGroupTieredPriceMinimum", ] @@ -2862,6 +2870,110 @@ class GroupedTieredPackagePrice(BaseModel): price_type: Literal["usage_price", "fixed_price"] +class MaxGroupTieredPriceBillableMetric(BaseModel): + id: str + + +class MaxGroupTieredPriceBillingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class MaxGroupTieredPriceCreditAllocation(BaseModel): + allows_rollover: bool + + currency: str + + +class MaxGroupTieredPriceInvoicingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class MaxGroupTieredPriceItem(BaseModel): + id: str + + name: str + + +class MaxGroupTieredPriceMaximum(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 MaxGroupTieredPriceMinimum(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 MaxGroupTieredPrice(BaseModel): + id: str + + billable_metric: Optional[MaxGroupTieredPriceBillableMetric] = None + + billing_cycle_configuration: MaxGroupTieredPriceBillingCycleConfiguration + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[MaxGroupTieredPriceCreditAllocation] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + invoicing_cycle_configuration: Optional[MaxGroupTieredPriceInvoicingCycleConfiguration] = None + + item: MaxGroupTieredPriceItem + + max_group_tiered_config: Dict[str, object] + + maximum: Optional[MaxGroupTieredPriceMaximum] = 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[MaxGroupTieredPriceMinimum] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["max_group_tiered"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + Price: TypeAlias = Annotated[ Union[ UnitPrice, @@ -2888,6 +3000,7 @@ class GroupedTieredPackagePrice(BaseModel): MatrixWithDisplayNamePrice, BulkWithProrationPrice, GroupedTieredPackagePrice, + MaxGroupTieredPrice, ], PropertyInfo(discriminator="price_model_type"), ] diff --git a/src/orb/types/price_create_params.py b/src/orb/types/price_create_params.py index 25e40b1d..0dfd571b 100644 --- a/src/orb/types/price_create_params.py +++ b/src/orb/types/price_create_params.py @@ -58,6 +58,9 @@ "NewFloatingGroupedTieredPrice", "NewFloatingGroupedTieredPriceBillingCycleConfiguration", "NewFloatingGroupedTieredPriceInvoicingCycleConfiguration", + "NewFloatingMaxGroupTieredPrice", + "NewFloatingMaxGroupTieredPriceBillingCycleConfiguration", + "NewFloatingMaxGroupTieredPriceInvoicingCycleConfiguration", "NewFloatingTieredWithMinimumPrice", "NewFloatingTieredWithMinimumPriceBillingCycleConfiguration", "NewFloatingTieredWithMinimumPriceInvoicingCycleConfiguration", @@ -1201,6 +1204,86 @@ class NewFloatingGroupedTieredPriceInvoicingCycleConfiguration(TypedDict, total= """The unit of billing period duration.""" +class NewFloatingMaxGroupTieredPrice(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.""" + + max_group_tiered_config: Required[Dict[str, object]] + + model_type: Required[Literal["max_group_tiered"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewFloatingMaxGroupTieredPriceBillingCycleConfiguration] + """ + 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[NewFloatingMaxGroupTieredPriceInvoicingCycleConfiguration] + """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 NewFloatingMaxGroupTieredPriceBillingCycleConfiguration(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 NewFloatingMaxGroupTieredPriceInvoicingCycleConfiguration(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 NewFloatingTieredWithMinimumPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -2174,6 +2257,7 @@ class NewFloatingGroupedTieredPackagePriceInvoicingCycleConfiguration(TypedDict, NewFloatingThresholdTotalAmountPrice, NewFloatingTieredPackagePrice, NewFloatingGroupedTieredPrice, + NewFloatingMaxGroupTieredPrice, NewFloatingTieredWithMinimumPrice, NewFloatingPackageWithAllocationPrice, NewFloatingTieredPackageWithMinimumPrice, diff --git a/src/orb/types/subscription_price_intervals_params.py b/src/orb/types/subscription_price_intervals_params.py index 6718c2e8..e9575b0a 100644 --- a/src/orb/types/subscription_price_intervals_params.py +++ b/src/orb/types/subscription_price_intervals_params.py @@ -70,6 +70,9 @@ "AddPriceNewFloatingGroupedTieredPrice", "AddPriceNewFloatingGroupedTieredPriceBillingCycleConfiguration", "AddPriceNewFloatingGroupedTieredPriceInvoicingCycleConfiguration", + "AddPriceNewFloatingMaxGroupTieredPrice", + "AddPriceNewFloatingMaxGroupTieredPriceBillingCycleConfiguration", + "AddPriceNewFloatingMaxGroupTieredPriceInvoicingCycleConfiguration", "AddPriceNewFloatingTieredWithMinimumPrice", "AddPriceNewFloatingTieredWithMinimumPriceBillingCycleConfiguration", "AddPriceNewFloatingTieredWithMinimumPriceInvoicingCycleConfiguration", @@ -1299,6 +1302,86 @@ class AddPriceNewFloatingGroupedTieredPrice(TypedDict, total=False): """ +class AddPriceNewFloatingMaxGroupTieredPriceBillingCycleConfiguration(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 AddPriceNewFloatingMaxGroupTieredPriceInvoicingCycleConfiguration(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 AddPriceNewFloatingMaxGroupTieredPrice(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.""" + + max_group_tiered_config: Required[Dict[str, object]] + + model_type: Required[Literal["max_group_tiered"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPriceNewFloatingMaxGroupTieredPriceBillingCycleConfiguration] + """ + 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[AddPriceNewFloatingMaxGroupTieredPriceInvoicingCycleConfiguration] + """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 AddPriceNewFloatingTieredWithMinimumPriceBillingCycleConfiguration(TypedDict, total=False): duration: Required[int] """The duration of the billing period.""" @@ -2276,6 +2359,7 @@ class AddPriceNewFloatingGroupedTieredPackagePrice(TypedDict, total=False): AddPriceNewFloatingThresholdTotalAmountPrice, AddPriceNewFloatingTieredPackagePrice, AddPriceNewFloatingGroupedTieredPrice, + AddPriceNewFloatingMaxGroupTieredPrice, AddPriceNewFloatingTieredWithMinimumPrice, AddPriceNewFloatingPackageWithAllocationPrice, AddPriceNewFloatingTieredPackageWithMinimumPrice, diff --git a/src/orb/types/subscription_schedule_plan_change_params.py b/src/orb/types/subscription_schedule_plan_change_params.py index 6b3c7074..49d63699 100644 --- a/src/orb/types/subscription_schedule_plan_change_params.py +++ b/src/orb/types/subscription_schedule_plan_change_params.py @@ -212,7 +212,9 @@ class SubscriptionSchedulePlanChangeParams(TypedDict, total=False): change_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] """The date that the plan change should take effect. - This parameter can only be passed if the `change_option` is `requested_date`. + This parameter can only be passed if the `change_option` is `requested_date`. If + a date with no time is passed, the plan change will happen at midnight in the + customer's timezone. """ coupon_redemption_code: Optional[str] diff --git a/tests/api_resources/test_prices.py b/tests/api_resources/test_prices.py index 12f7757b..1c56c2be 100644 --- a/tests/api_resources/test_prices.py +++ b/tests/api_resources/test_prices.py @@ -1065,6 +1065,79 @@ def test_streaming_response_create_overload_12(self, client: Orb) -> None: @parametrize def test_method_create_overload_13(self, client: Orb) -> None: + price = client.prices.create( + cadence="annual", + currency="currency", + item_id="item_id", + max_group_tiered_config={"foo": "bar"}, + model_type="max_group_tiered", + name="Annual fee", + ) + assert_matches_type(Price, price, path=["response"]) + + @parametrize + def test_method_create_with_all_params_overload_13(self, client: Orb) -> None: + price = client.prices.create( + cadence="annual", + currency="currency", + item_id="item_id", + max_group_tiered_config={"foo": "bar"}, + model_type="max_group_tiered", + name="Annual fee", + 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_13(self, client: Orb) -> None: + response = client.prices.with_raw_response.create( + cadence="annual", + currency="currency", + item_id="item_id", + max_group_tiered_config={"foo": "bar"}, + model_type="max_group_tiered", + name="Annual fee", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + price = response.parse() + assert_matches_type(Price, price, path=["response"]) + + @parametrize + def test_streaming_response_create_overload_13(self, client: Orb) -> None: + with client.prices.with_streaming_response.create( + cadence="annual", + currency="currency", + item_id="item_id", + max_group_tiered_config={"foo": "bar"}, + model_type="max_group_tiered", + name="Annual fee", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + price = response.parse() + assert_matches_type(Price, price, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_create_overload_14(self, client: Orb) -> None: price = client.prices.create( cadence="annual", currency="currency", @@ -1076,7 +1149,7 @@ def test_method_create_overload_13(self, client: Orb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - def test_method_create_with_all_params_overload_13(self, client: Orb) -> None: + def test_method_create_with_all_params_overload_14(self, client: Orb) -> None: price = client.prices.create( cadence="annual", currency="currency", @@ -1103,7 +1176,7 @@ def test_method_create_with_all_params_overload_13(self, client: Orb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - def test_raw_response_create_overload_13(self, client: Orb) -> None: + def test_raw_response_create_overload_14(self, client: Orb) -> None: response = client.prices.with_raw_response.create( cadence="annual", currency="currency", @@ -1119,7 +1192,7 @@ def test_raw_response_create_overload_13(self, client: Orb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - def test_streaming_response_create_overload_13(self, client: Orb) -> None: + def test_streaming_response_create_overload_14(self, client: Orb) -> None: with client.prices.with_streaming_response.create( cadence="annual", currency="currency", @@ -1137,7 +1210,7 @@ def test_streaming_response_create_overload_13(self, client: Orb) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_method_create_overload_14(self, client: Orb) -> None: + def test_method_create_overload_15(self, client: Orb) -> None: price = client.prices.create( cadence="annual", currency="currency", @@ -1149,7 +1222,7 @@ def test_method_create_overload_14(self, client: Orb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - def test_method_create_with_all_params_overload_14(self, client: Orb) -> None: + def test_method_create_with_all_params_overload_15(self, client: Orb) -> None: price = client.prices.create( cadence="annual", currency="currency", @@ -1176,7 +1249,7 @@ def test_method_create_with_all_params_overload_14(self, client: Orb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - def test_raw_response_create_overload_14(self, client: Orb) -> None: + def test_raw_response_create_overload_15(self, client: Orb) -> None: response = client.prices.with_raw_response.create( cadence="annual", currency="currency", @@ -1192,7 +1265,7 @@ def test_raw_response_create_overload_14(self, client: Orb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - def test_streaming_response_create_overload_14(self, client: Orb) -> None: + def test_streaming_response_create_overload_15(self, client: Orb) -> None: with client.prices.with_streaming_response.create( cadence="annual", currency="currency", @@ -1210,7 +1283,7 @@ def test_streaming_response_create_overload_14(self, client: Orb) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_method_create_overload_15(self, client: Orb) -> None: + def test_method_create_overload_16(self, client: Orb) -> None: price = client.prices.create( cadence="annual", currency="currency", @@ -1222,7 +1295,7 @@ def test_method_create_overload_15(self, client: Orb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - def test_method_create_with_all_params_overload_15(self, client: Orb) -> None: + def test_method_create_with_all_params_overload_16(self, client: Orb) -> None: price = client.prices.create( cadence="annual", currency="currency", @@ -1249,7 +1322,7 @@ def test_method_create_with_all_params_overload_15(self, client: Orb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - def test_raw_response_create_overload_15(self, client: Orb) -> None: + def test_raw_response_create_overload_16(self, client: Orb) -> None: response = client.prices.with_raw_response.create( cadence="annual", currency="currency", @@ -1265,7 +1338,7 @@ def test_raw_response_create_overload_15(self, client: Orb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - def test_streaming_response_create_overload_15(self, client: Orb) -> None: + def test_streaming_response_create_overload_16(self, client: Orb) -> None: with client.prices.with_streaming_response.create( cadence="annual", currency="currency", @@ -1283,7 +1356,7 @@ def test_streaming_response_create_overload_15(self, client: Orb) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_method_create_overload_16(self, client: Orb) -> None: + def test_method_create_overload_17(self, client: Orb) -> None: price = client.prices.create( cadence="annual", currency="currency", @@ -1295,7 +1368,7 @@ def test_method_create_overload_16(self, client: Orb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - def test_method_create_with_all_params_overload_16(self, client: Orb) -> None: + def test_method_create_with_all_params_overload_17(self, client: Orb) -> None: price = client.prices.create( cadence="annual", currency="currency", @@ -1322,7 +1395,7 @@ def test_method_create_with_all_params_overload_16(self, client: Orb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - def test_raw_response_create_overload_16(self, client: Orb) -> None: + def test_raw_response_create_overload_17(self, client: Orb) -> None: response = client.prices.with_raw_response.create( cadence="annual", currency="currency", @@ -1338,7 +1411,7 @@ def test_raw_response_create_overload_16(self, client: Orb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - def test_streaming_response_create_overload_16(self, client: Orb) -> None: + def test_streaming_response_create_overload_17(self, client: Orb) -> None: with client.prices.with_streaming_response.create( cadence="annual", currency="currency", @@ -1356,7 +1429,7 @@ def test_streaming_response_create_overload_16(self, client: Orb) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_method_create_overload_17(self, client: Orb) -> None: + def test_method_create_overload_18(self, client: Orb) -> None: price = client.prices.create( cadence="annual", currency="currency", @@ -1368,7 +1441,7 @@ def test_method_create_overload_17(self, client: Orb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - def test_method_create_with_all_params_overload_17(self, client: Orb) -> None: + def test_method_create_with_all_params_overload_18(self, client: Orb) -> None: price = client.prices.create( cadence="annual", currency="currency", @@ -1395,7 +1468,7 @@ def test_method_create_with_all_params_overload_17(self, client: Orb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - def test_raw_response_create_overload_17(self, client: Orb) -> None: + def test_raw_response_create_overload_18(self, client: Orb) -> None: response = client.prices.with_raw_response.create( cadence="annual", currency="currency", @@ -1411,7 +1484,7 @@ def test_raw_response_create_overload_17(self, client: Orb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - def test_streaming_response_create_overload_17(self, client: Orb) -> None: + def test_streaming_response_create_overload_18(self, client: Orb) -> None: with client.prices.with_streaming_response.create( cadence="annual", currency="currency", @@ -1429,7 +1502,7 @@ def test_streaming_response_create_overload_17(self, client: Orb) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_method_create_overload_18(self, client: Orb) -> None: + def test_method_create_overload_19(self, client: Orb) -> None: price = client.prices.create( cadence="annual", currency="currency", @@ -1441,7 +1514,7 @@ def test_method_create_overload_18(self, client: Orb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - def test_method_create_with_all_params_overload_18(self, client: Orb) -> None: + def test_method_create_with_all_params_overload_19(self, client: Orb) -> None: price = client.prices.create( cadence="annual", currency="currency", @@ -1468,7 +1541,7 @@ def test_method_create_with_all_params_overload_18(self, client: Orb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - def test_raw_response_create_overload_18(self, client: Orb) -> None: + def test_raw_response_create_overload_19(self, client: Orb) -> None: response = client.prices.with_raw_response.create( cadence="annual", currency="currency", @@ -1484,7 +1557,7 @@ def test_raw_response_create_overload_18(self, client: Orb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - def test_streaming_response_create_overload_18(self, client: Orb) -> None: + def test_streaming_response_create_overload_19(self, client: Orb) -> None: with client.prices.with_streaming_response.create( cadence="annual", currency="currency", @@ -1502,7 +1575,7 @@ def test_streaming_response_create_overload_18(self, client: Orb) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_method_create_overload_19(self, client: Orb) -> None: + def test_method_create_overload_20(self, client: Orb) -> None: price = client.prices.create( cadence="annual", currency="currency", @@ -1514,7 +1587,7 @@ def test_method_create_overload_19(self, client: Orb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - def test_method_create_with_all_params_overload_19(self, client: Orb) -> None: + def test_method_create_with_all_params_overload_20(self, client: Orb) -> None: price = client.prices.create( cadence="annual", currency="currency", @@ -1541,7 +1614,7 @@ def test_method_create_with_all_params_overload_19(self, client: Orb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - def test_raw_response_create_overload_19(self, client: Orb) -> None: + def test_raw_response_create_overload_20(self, client: Orb) -> None: response = client.prices.with_raw_response.create( cadence="annual", currency="currency", @@ -1557,7 +1630,7 @@ def test_raw_response_create_overload_19(self, client: Orb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - def test_streaming_response_create_overload_19(self, client: Orb) -> None: + def test_streaming_response_create_overload_20(self, client: Orb) -> None: with client.prices.with_streaming_response.create( cadence="annual", currency="currency", @@ -1575,7 +1648,7 @@ def test_streaming_response_create_overload_19(self, client: Orb) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_method_create_overload_20(self, client: Orb) -> None: + def test_method_create_overload_21(self, client: Orb) -> None: price = client.prices.create( cadence="annual", currency="currency", @@ -1587,7 +1660,7 @@ def test_method_create_overload_20(self, client: Orb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - def test_method_create_with_all_params_overload_20(self, client: Orb) -> None: + def test_method_create_with_all_params_overload_21(self, client: Orb) -> None: price = client.prices.create( cadence="annual", currency="currency", @@ -1614,7 +1687,7 @@ def test_method_create_with_all_params_overload_20(self, client: Orb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - def test_raw_response_create_overload_20(self, client: Orb) -> None: + def test_raw_response_create_overload_21(self, client: Orb) -> None: response = client.prices.with_raw_response.create( cadence="annual", currency="currency", @@ -1630,7 +1703,7 @@ def test_raw_response_create_overload_20(self, client: Orb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - def test_streaming_response_create_overload_20(self, client: Orb) -> None: + def test_streaming_response_create_overload_21(self, client: Orb) -> None: with client.prices.with_streaming_response.create( cadence="annual", currency="currency", @@ -1648,7 +1721,7 @@ def test_streaming_response_create_overload_20(self, client: Orb) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_method_create_overload_21(self, client: Orb) -> None: + def test_method_create_overload_22(self, client: Orb) -> None: price = client.prices.create( cadence="annual", currency="currency", @@ -1660,7 +1733,7 @@ def test_method_create_overload_21(self, client: Orb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - def test_method_create_with_all_params_overload_21(self, client: Orb) -> None: + def test_method_create_with_all_params_overload_22(self, client: Orb) -> None: price = client.prices.create( cadence="annual", currency="currency", @@ -1687,7 +1760,7 @@ def test_method_create_with_all_params_overload_21(self, client: Orb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - def test_raw_response_create_overload_21(self, client: Orb) -> None: + def test_raw_response_create_overload_22(self, client: Orb) -> None: response = client.prices.with_raw_response.create( cadence="annual", currency="currency", @@ -1703,7 +1776,7 @@ def test_raw_response_create_overload_21(self, client: Orb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - def test_streaming_response_create_overload_21(self, client: Orb) -> None: + def test_streaming_response_create_overload_22(self, client: Orb) -> None: with client.prices.with_streaming_response.create( cadence="annual", currency="currency", @@ -1721,7 +1794,7 @@ def test_streaming_response_create_overload_21(self, client: Orb) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_method_create_overload_22(self, client: Orb) -> None: + def test_method_create_overload_23(self, client: Orb) -> None: price = client.prices.create( cadence="annual", currency="currency", @@ -1733,7 +1806,7 @@ def test_method_create_overload_22(self, client: Orb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - def test_method_create_with_all_params_overload_22(self, client: Orb) -> None: + def test_method_create_with_all_params_overload_23(self, client: Orb) -> None: price = client.prices.create( cadence="annual", currency="currency", @@ -1760,7 +1833,7 @@ def test_method_create_with_all_params_overload_22(self, client: Orb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - def test_raw_response_create_overload_22(self, client: Orb) -> None: + def test_raw_response_create_overload_23(self, client: Orb) -> None: response = client.prices.with_raw_response.create( cadence="annual", currency="currency", @@ -1776,7 +1849,7 @@ def test_raw_response_create_overload_22(self, client: Orb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - def test_streaming_response_create_overload_22(self, client: Orb) -> None: + def test_streaming_response_create_overload_23(self, client: Orb) -> None: with client.prices.with_streaming_response.create( cadence="annual", currency="currency", @@ -1794,7 +1867,7 @@ def test_streaming_response_create_overload_22(self, client: Orb) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_method_create_overload_23(self, client: Orb) -> None: + def test_method_create_overload_24(self, client: Orb) -> None: price = client.prices.create( bulk_with_proration_config={"foo": "bar"}, cadence="annual", @@ -1806,7 +1879,7 @@ def test_method_create_overload_23(self, client: Orb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - def test_method_create_with_all_params_overload_23(self, client: Orb) -> None: + def test_method_create_with_all_params_overload_24(self, client: Orb) -> None: price = client.prices.create( bulk_with_proration_config={"foo": "bar"}, cadence="annual", @@ -1833,7 +1906,7 @@ def test_method_create_with_all_params_overload_23(self, client: Orb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - def test_raw_response_create_overload_23(self, client: Orb) -> None: + def test_raw_response_create_overload_24(self, client: Orb) -> None: response = client.prices.with_raw_response.create( bulk_with_proration_config={"foo": "bar"}, cadence="annual", @@ -1849,7 +1922,7 @@ def test_raw_response_create_overload_23(self, client: Orb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - def test_streaming_response_create_overload_23(self, client: Orb) -> None: + def test_streaming_response_create_overload_24(self, client: Orb) -> None: with client.prices.with_streaming_response.create( bulk_with_proration_config={"foo": "bar"}, cadence="annual", @@ -1867,7 +1940,7 @@ def test_streaming_response_create_overload_23(self, client: Orb) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_method_create_overload_24(self, client: Orb) -> None: + def test_method_create_overload_25(self, client: Orb) -> None: price = client.prices.create( cadence="annual", currency="currency", @@ -1879,7 +1952,7 @@ def test_method_create_overload_24(self, client: Orb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - def test_method_create_with_all_params_overload_24(self, client: Orb) -> None: + def test_method_create_with_all_params_overload_25(self, client: Orb) -> None: price = client.prices.create( cadence="annual", currency="currency", @@ -1906,7 +1979,7 @@ def test_method_create_with_all_params_overload_24(self, client: Orb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - def test_raw_response_create_overload_24(self, client: Orb) -> None: + def test_raw_response_create_overload_25(self, client: Orb) -> None: response = client.prices.with_raw_response.create( cadence="annual", currency="currency", @@ -1922,7 +1995,7 @@ def test_raw_response_create_overload_24(self, client: Orb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - def test_streaming_response_create_overload_24(self, client: Orb) -> None: + def test_streaming_response_create_overload_25(self, client: Orb) -> None: with client.prices.with_streaming_response.create( cadence="annual", currency="currency", @@ -3162,6 +3235,79 @@ async def test_streaming_response_create_overload_12(self, async_client: AsyncOr @parametrize async def test_method_create_overload_13(self, async_client: AsyncOrb) -> None: + price = await async_client.prices.create( + cadence="annual", + currency="currency", + item_id="item_id", + max_group_tiered_config={"foo": "bar"}, + model_type="max_group_tiered", + name="Annual fee", + ) + assert_matches_type(Price, price, path=["response"]) + + @parametrize + async def test_method_create_with_all_params_overload_13(self, async_client: AsyncOrb) -> None: + price = await async_client.prices.create( + cadence="annual", + currency="currency", + item_id="item_id", + max_group_tiered_config={"foo": "bar"}, + model_type="max_group_tiered", + name="Annual fee", + 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_13(self, async_client: AsyncOrb) -> None: + response = await async_client.prices.with_raw_response.create( + cadence="annual", + currency="currency", + item_id="item_id", + max_group_tiered_config={"foo": "bar"}, + model_type="max_group_tiered", + name="Annual fee", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + price = response.parse() + assert_matches_type(Price, price, path=["response"]) + + @parametrize + async def test_streaming_response_create_overload_13(self, async_client: AsyncOrb) -> None: + async with async_client.prices.with_streaming_response.create( + cadence="annual", + currency="currency", + item_id="item_id", + max_group_tiered_config={"foo": "bar"}, + model_type="max_group_tiered", + name="Annual fee", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + price = await response.parse() + assert_matches_type(Price, price, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_create_overload_14(self, async_client: AsyncOrb) -> None: price = await async_client.prices.create( cadence="annual", currency="currency", @@ -3173,7 +3319,7 @@ async def test_method_create_overload_13(self, async_client: AsyncOrb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - async def test_method_create_with_all_params_overload_13(self, async_client: AsyncOrb) -> None: + async def test_method_create_with_all_params_overload_14(self, async_client: AsyncOrb) -> None: price = await async_client.prices.create( cadence="annual", currency="currency", @@ -3200,7 +3346,7 @@ async def test_method_create_with_all_params_overload_13(self, async_client: Asy assert_matches_type(Price, price, path=["response"]) @parametrize - async def test_raw_response_create_overload_13(self, async_client: AsyncOrb) -> None: + async def test_raw_response_create_overload_14(self, async_client: AsyncOrb) -> None: response = await async_client.prices.with_raw_response.create( cadence="annual", currency="currency", @@ -3216,7 +3362,7 @@ async def test_raw_response_create_overload_13(self, async_client: AsyncOrb) -> assert_matches_type(Price, price, path=["response"]) @parametrize - async def test_streaming_response_create_overload_13(self, async_client: AsyncOrb) -> None: + async def test_streaming_response_create_overload_14(self, async_client: AsyncOrb) -> None: async with async_client.prices.with_streaming_response.create( cadence="annual", currency="currency", @@ -3234,7 +3380,7 @@ async def test_streaming_response_create_overload_13(self, async_client: AsyncOr assert cast(Any, response.is_closed) is True @parametrize - async def test_method_create_overload_14(self, async_client: AsyncOrb) -> None: + async def test_method_create_overload_15(self, async_client: AsyncOrb) -> None: price = await async_client.prices.create( cadence="annual", currency="currency", @@ -3246,7 +3392,7 @@ async def test_method_create_overload_14(self, async_client: AsyncOrb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - async def test_method_create_with_all_params_overload_14(self, async_client: AsyncOrb) -> None: + async def test_method_create_with_all_params_overload_15(self, async_client: AsyncOrb) -> None: price = await async_client.prices.create( cadence="annual", currency="currency", @@ -3273,7 +3419,7 @@ async def test_method_create_with_all_params_overload_14(self, async_client: Asy assert_matches_type(Price, price, path=["response"]) @parametrize - async def test_raw_response_create_overload_14(self, async_client: AsyncOrb) -> None: + async def test_raw_response_create_overload_15(self, async_client: AsyncOrb) -> None: response = await async_client.prices.with_raw_response.create( cadence="annual", currency="currency", @@ -3289,7 +3435,7 @@ async def test_raw_response_create_overload_14(self, async_client: AsyncOrb) -> assert_matches_type(Price, price, path=["response"]) @parametrize - async def test_streaming_response_create_overload_14(self, async_client: AsyncOrb) -> None: + async def test_streaming_response_create_overload_15(self, async_client: AsyncOrb) -> None: async with async_client.prices.with_streaming_response.create( cadence="annual", currency="currency", @@ -3307,7 +3453,7 @@ async def test_streaming_response_create_overload_14(self, async_client: AsyncOr assert cast(Any, response.is_closed) is True @parametrize - async def test_method_create_overload_15(self, async_client: AsyncOrb) -> None: + async def test_method_create_overload_16(self, async_client: AsyncOrb) -> None: price = await async_client.prices.create( cadence="annual", currency="currency", @@ -3319,7 +3465,7 @@ async def test_method_create_overload_15(self, async_client: AsyncOrb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - async def test_method_create_with_all_params_overload_15(self, async_client: AsyncOrb) -> None: + async def test_method_create_with_all_params_overload_16(self, async_client: AsyncOrb) -> None: price = await async_client.prices.create( cadence="annual", currency="currency", @@ -3346,7 +3492,7 @@ async def test_method_create_with_all_params_overload_15(self, async_client: Asy assert_matches_type(Price, price, path=["response"]) @parametrize - async def test_raw_response_create_overload_15(self, async_client: AsyncOrb) -> None: + async def test_raw_response_create_overload_16(self, async_client: AsyncOrb) -> None: response = await async_client.prices.with_raw_response.create( cadence="annual", currency="currency", @@ -3362,7 +3508,7 @@ async def test_raw_response_create_overload_15(self, async_client: AsyncOrb) -> assert_matches_type(Price, price, path=["response"]) @parametrize - async def test_streaming_response_create_overload_15(self, async_client: AsyncOrb) -> None: + async def test_streaming_response_create_overload_16(self, async_client: AsyncOrb) -> None: async with async_client.prices.with_streaming_response.create( cadence="annual", currency="currency", @@ -3380,7 +3526,7 @@ async def test_streaming_response_create_overload_15(self, async_client: AsyncOr assert cast(Any, response.is_closed) is True @parametrize - async def test_method_create_overload_16(self, async_client: AsyncOrb) -> None: + async def test_method_create_overload_17(self, async_client: AsyncOrb) -> None: price = await async_client.prices.create( cadence="annual", currency="currency", @@ -3392,7 +3538,7 @@ async def test_method_create_overload_16(self, async_client: AsyncOrb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - async def test_method_create_with_all_params_overload_16(self, async_client: AsyncOrb) -> None: + async def test_method_create_with_all_params_overload_17(self, async_client: AsyncOrb) -> None: price = await async_client.prices.create( cadence="annual", currency="currency", @@ -3419,7 +3565,7 @@ async def test_method_create_with_all_params_overload_16(self, async_client: Asy assert_matches_type(Price, price, path=["response"]) @parametrize - async def test_raw_response_create_overload_16(self, async_client: AsyncOrb) -> None: + async def test_raw_response_create_overload_17(self, async_client: AsyncOrb) -> None: response = await async_client.prices.with_raw_response.create( cadence="annual", currency="currency", @@ -3435,7 +3581,7 @@ async def test_raw_response_create_overload_16(self, async_client: AsyncOrb) -> assert_matches_type(Price, price, path=["response"]) @parametrize - async def test_streaming_response_create_overload_16(self, async_client: AsyncOrb) -> None: + async def test_streaming_response_create_overload_17(self, async_client: AsyncOrb) -> None: async with async_client.prices.with_streaming_response.create( cadence="annual", currency="currency", @@ -3453,7 +3599,7 @@ async def test_streaming_response_create_overload_16(self, async_client: AsyncOr assert cast(Any, response.is_closed) is True @parametrize - async def test_method_create_overload_17(self, async_client: AsyncOrb) -> None: + async def test_method_create_overload_18(self, async_client: AsyncOrb) -> None: price = await async_client.prices.create( cadence="annual", currency="currency", @@ -3465,7 +3611,7 @@ async def test_method_create_overload_17(self, async_client: AsyncOrb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - async def test_method_create_with_all_params_overload_17(self, async_client: AsyncOrb) -> None: + async def test_method_create_with_all_params_overload_18(self, async_client: AsyncOrb) -> None: price = await async_client.prices.create( cadence="annual", currency="currency", @@ -3492,7 +3638,7 @@ async def test_method_create_with_all_params_overload_17(self, async_client: Asy assert_matches_type(Price, price, path=["response"]) @parametrize - async def test_raw_response_create_overload_17(self, async_client: AsyncOrb) -> None: + async def test_raw_response_create_overload_18(self, async_client: AsyncOrb) -> None: response = await async_client.prices.with_raw_response.create( cadence="annual", currency="currency", @@ -3508,7 +3654,7 @@ async def test_raw_response_create_overload_17(self, async_client: AsyncOrb) -> assert_matches_type(Price, price, path=["response"]) @parametrize - async def test_streaming_response_create_overload_17(self, async_client: AsyncOrb) -> None: + async def test_streaming_response_create_overload_18(self, async_client: AsyncOrb) -> None: async with async_client.prices.with_streaming_response.create( cadence="annual", currency="currency", @@ -3526,7 +3672,7 @@ async def test_streaming_response_create_overload_17(self, async_client: AsyncOr assert cast(Any, response.is_closed) is True @parametrize - async def test_method_create_overload_18(self, async_client: AsyncOrb) -> None: + async def test_method_create_overload_19(self, async_client: AsyncOrb) -> None: price = await async_client.prices.create( cadence="annual", currency="currency", @@ -3538,7 +3684,7 @@ async def test_method_create_overload_18(self, async_client: AsyncOrb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - async def test_method_create_with_all_params_overload_18(self, async_client: AsyncOrb) -> None: + async def test_method_create_with_all_params_overload_19(self, async_client: AsyncOrb) -> None: price = await async_client.prices.create( cadence="annual", currency="currency", @@ -3565,7 +3711,7 @@ async def test_method_create_with_all_params_overload_18(self, async_client: Asy assert_matches_type(Price, price, path=["response"]) @parametrize - async def test_raw_response_create_overload_18(self, async_client: AsyncOrb) -> None: + async def test_raw_response_create_overload_19(self, async_client: AsyncOrb) -> None: response = await async_client.prices.with_raw_response.create( cadence="annual", currency="currency", @@ -3581,7 +3727,7 @@ async def test_raw_response_create_overload_18(self, async_client: AsyncOrb) -> assert_matches_type(Price, price, path=["response"]) @parametrize - async def test_streaming_response_create_overload_18(self, async_client: AsyncOrb) -> None: + async def test_streaming_response_create_overload_19(self, async_client: AsyncOrb) -> None: async with async_client.prices.with_streaming_response.create( cadence="annual", currency="currency", @@ -3599,7 +3745,7 @@ async def test_streaming_response_create_overload_18(self, async_client: AsyncOr assert cast(Any, response.is_closed) is True @parametrize - async def test_method_create_overload_19(self, async_client: AsyncOrb) -> None: + async def test_method_create_overload_20(self, async_client: AsyncOrb) -> None: price = await async_client.prices.create( cadence="annual", currency="currency", @@ -3611,7 +3757,7 @@ async def test_method_create_overload_19(self, async_client: AsyncOrb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - async def test_method_create_with_all_params_overload_19(self, async_client: AsyncOrb) -> None: + async def test_method_create_with_all_params_overload_20(self, async_client: AsyncOrb) -> None: price = await async_client.prices.create( cadence="annual", currency="currency", @@ -3638,7 +3784,7 @@ async def test_method_create_with_all_params_overload_19(self, async_client: Asy assert_matches_type(Price, price, path=["response"]) @parametrize - async def test_raw_response_create_overload_19(self, async_client: AsyncOrb) -> None: + async def test_raw_response_create_overload_20(self, async_client: AsyncOrb) -> None: response = await async_client.prices.with_raw_response.create( cadence="annual", currency="currency", @@ -3654,7 +3800,7 @@ async def test_raw_response_create_overload_19(self, async_client: AsyncOrb) -> assert_matches_type(Price, price, path=["response"]) @parametrize - async def test_streaming_response_create_overload_19(self, async_client: AsyncOrb) -> None: + async def test_streaming_response_create_overload_20(self, async_client: AsyncOrb) -> None: async with async_client.prices.with_streaming_response.create( cadence="annual", currency="currency", @@ -3672,7 +3818,7 @@ async def test_streaming_response_create_overload_19(self, async_client: AsyncOr assert cast(Any, response.is_closed) is True @parametrize - async def test_method_create_overload_20(self, async_client: AsyncOrb) -> None: + async def test_method_create_overload_21(self, async_client: AsyncOrb) -> None: price = await async_client.prices.create( cadence="annual", currency="currency", @@ -3684,7 +3830,7 @@ async def test_method_create_overload_20(self, async_client: AsyncOrb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - async def test_method_create_with_all_params_overload_20(self, async_client: AsyncOrb) -> None: + async def test_method_create_with_all_params_overload_21(self, async_client: AsyncOrb) -> None: price = await async_client.prices.create( cadence="annual", currency="currency", @@ -3711,7 +3857,7 @@ async def test_method_create_with_all_params_overload_20(self, async_client: Asy assert_matches_type(Price, price, path=["response"]) @parametrize - async def test_raw_response_create_overload_20(self, async_client: AsyncOrb) -> None: + async def test_raw_response_create_overload_21(self, async_client: AsyncOrb) -> None: response = await async_client.prices.with_raw_response.create( cadence="annual", currency="currency", @@ -3727,7 +3873,7 @@ async def test_raw_response_create_overload_20(self, async_client: AsyncOrb) -> assert_matches_type(Price, price, path=["response"]) @parametrize - async def test_streaming_response_create_overload_20(self, async_client: AsyncOrb) -> None: + async def test_streaming_response_create_overload_21(self, async_client: AsyncOrb) -> None: async with async_client.prices.with_streaming_response.create( cadence="annual", currency="currency", @@ -3745,7 +3891,7 @@ async def test_streaming_response_create_overload_20(self, async_client: AsyncOr assert cast(Any, response.is_closed) is True @parametrize - async def test_method_create_overload_21(self, async_client: AsyncOrb) -> None: + async def test_method_create_overload_22(self, async_client: AsyncOrb) -> None: price = await async_client.prices.create( cadence="annual", currency="currency", @@ -3757,7 +3903,7 @@ async def test_method_create_overload_21(self, async_client: AsyncOrb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - async def test_method_create_with_all_params_overload_21(self, async_client: AsyncOrb) -> None: + async def test_method_create_with_all_params_overload_22(self, async_client: AsyncOrb) -> None: price = await async_client.prices.create( cadence="annual", currency="currency", @@ -3784,7 +3930,7 @@ async def test_method_create_with_all_params_overload_21(self, async_client: Asy assert_matches_type(Price, price, path=["response"]) @parametrize - async def test_raw_response_create_overload_21(self, async_client: AsyncOrb) -> None: + async def test_raw_response_create_overload_22(self, async_client: AsyncOrb) -> None: response = await async_client.prices.with_raw_response.create( cadence="annual", currency="currency", @@ -3800,7 +3946,7 @@ async def test_raw_response_create_overload_21(self, async_client: AsyncOrb) -> assert_matches_type(Price, price, path=["response"]) @parametrize - async def test_streaming_response_create_overload_21(self, async_client: AsyncOrb) -> None: + async def test_streaming_response_create_overload_22(self, async_client: AsyncOrb) -> None: async with async_client.prices.with_streaming_response.create( cadence="annual", currency="currency", @@ -3818,7 +3964,7 @@ async def test_streaming_response_create_overload_21(self, async_client: AsyncOr assert cast(Any, response.is_closed) is True @parametrize - async def test_method_create_overload_22(self, async_client: AsyncOrb) -> None: + async def test_method_create_overload_23(self, async_client: AsyncOrb) -> None: price = await async_client.prices.create( cadence="annual", currency="currency", @@ -3830,7 +3976,7 @@ async def test_method_create_overload_22(self, async_client: AsyncOrb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - async def test_method_create_with_all_params_overload_22(self, async_client: AsyncOrb) -> None: + async def test_method_create_with_all_params_overload_23(self, async_client: AsyncOrb) -> None: price = await async_client.prices.create( cadence="annual", currency="currency", @@ -3857,7 +4003,7 @@ async def test_method_create_with_all_params_overload_22(self, async_client: Asy assert_matches_type(Price, price, path=["response"]) @parametrize - async def test_raw_response_create_overload_22(self, async_client: AsyncOrb) -> None: + async def test_raw_response_create_overload_23(self, async_client: AsyncOrb) -> None: response = await async_client.prices.with_raw_response.create( cadence="annual", currency="currency", @@ -3873,7 +4019,7 @@ async def test_raw_response_create_overload_22(self, async_client: AsyncOrb) -> assert_matches_type(Price, price, path=["response"]) @parametrize - async def test_streaming_response_create_overload_22(self, async_client: AsyncOrb) -> None: + async def test_streaming_response_create_overload_23(self, async_client: AsyncOrb) -> None: async with async_client.prices.with_streaming_response.create( cadence="annual", currency="currency", @@ -3891,7 +4037,7 @@ async def test_streaming_response_create_overload_22(self, async_client: AsyncOr assert cast(Any, response.is_closed) is True @parametrize - async def test_method_create_overload_23(self, async_client: AsyncOrb) -> None: + async def test_method_create_overload_24(self, async_client: AsyncOrb) -> None: price = await async_client.prices.create( bulk_with_proration_config={"foo": "bar"}, cadence="annual", @@ -3903,7 +4049,7 @@ async def test_method_create_overload_23(self, async_client: AsyncOrb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - async def test_method_create_with_all_params_overload_23(self, async_client: AsyncOrb) -> None: + async def test_method_create_with_all_params_overload_24(self, async_client: AsyncOrb) -> None: price = await async_client.prices.create( bulk_with_proration_config={"foo": "bar"}, cadence="annual", @@ -3930,7 +4076,7 @@ async def test_method_create_with_all_params_overload_23(self, async_client: Asy assert_matches_type(Price, price, path=["response"]) @parametrize - async def test_raw_response_create_overload_23(self, async_client: AsyncOrb) -> None: + async def test_raw_response_create_overload_24(self, async_client: AsyncOrb) -> None: response = await async_client.prices.with_raw_response.create( bulk_with_proration_config={"foo": "bar"}, cadence="annual", @@ -3946,7 +4092,7 @@ async def test_raw_response_create_overload_23(self, async_client: AsyncOrb) -> assert_matches_type(Price, price, path=["response"]) @parametrize - async def test_streaming_response_create_overload_23(self, async_client: AsyncOrb) -> None: + async def test_streaming_response_create_overload_24(self, async_client: AsyncOrb) -> None: async with async_client.prices.with_streaming_response.create( bulk_with_proration_config={"foo": "bar"}, cadence="annual", @@ -3964,7 +4110,7 @@ async def test_streaming_response_create_overload_23(self, async_client: AsyncOr assert cast(Any, response.is_closed) is True @parametrize - async def test_method_create_overload_24(self, async_client: AsyncOrb) -> None: + async def test_method_create_overload_25(self, async_client: AsyncOrb) -> None: price = await async_client.prices.create( cadence="annual", currency="currency", @@ -3976,7 +4122,7 @@ async def test_method_create_overload_24(self, async_client: AsyncOrb) -> None: assert_matches_type(Price, price, path=["response"]) @parametrize - async def test_method_create_with_all_params_overload_24(self, async_client: AsyncOrb) -> None: + async def test_method_create_with_all_params_overload_25(self, async_client: AsyncOrb) -> None: price = await async_client.prices.create( cadence="annual", currency="currency", @@ -4003,7 +4149,7 @@ async def test_method_create_with_all_params_overload_24(self, async_client: Asy assert_matches_type(Price, price, path=["response"]) @parametrize - async def test_raw_response_create_overload_24(self, async_client: AsyncOrb) -> None: + async def test_raw_response_create_overload_25(self, async_client: AsyncOrb) -> None: response = await async_client.prices.with_raw_response.create( cadence="annual", currency="currency", @@ -4019,7 +4165,7 @@ async def test_raw_response_create_overload_24(self, async_client: AsyncOrb) -> assert_matches_type(Price, price, path=["response"]) @parametrize - async def test_streaming_response_create_overload_24(self, async_client: AsyncOrb) -> None: + async def test_streaming_response_create_overload_25(self, async_client: AsyncOrb) -> None: async with async_client.prices.with_streaming_response.create( cadence="annual", currency="currency",