From dc573e48b5dda28ef03944c11590daa67e8b054e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 16 Aug 2024 01:19:34 +0000 Subject: [PATCH 1/2] feat(api): OpenAPI spec update via Stainless API (#349) --- .stats.yml | 2 +- src/orb/resources/prices/prices.py | 168 +++++++++++++++++- src/orb/types/plan_create_params.py | 57 ++++++ src/orb/types/price.py | 104 +++++++++++ src/orb/types/price_create_params.py | 54 ++++++ .../subscription_price_intervals_params.py | 54 ++++++ tests/api_resources/test_prices.py | 130 ++++++++++++++ 7 files changed, 566 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index fa5ec939..e1699c46 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 91 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-303379b9db577b964d46fe908e8226e95c60435b11ddd8685bf2fa99c57f4320.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-8cdbf902afe6295b1eee73576b55f8461c36179fd59e5f12cfeb6a3372c08904.yml diff --git a/src/orb/resources/prices/prices.py b/src/orb/resources/prices/prices.py index bd12131b..ffa9a700 100644 --- a/src/orb/resources/prices/prices.py +++ b/src/orb/resources/prices/prices.py @@ -1452,6 +1452,84 @@ def create( """ ... + @overload + def create( + self, + *, + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], + currency: str, + grouped_allocation_config: Dict[str, object], + item_id: str, + model_type: Literal["grouped_allocation"], + name: str, + billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, + billed_in_advance: Optional[bool] | 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, + 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. + + 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 + + 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"], @@ -1471,6 +1549,7 @@ def create( ["cadence", "currency", "item_id", "model_type", "name", "unit_with_percent_config"], ["cadence", "currency", "item_id", "model_type", "name", "tiered_with_proration_config"], ["cadence", "currency", "item_id", "model_type", "name", "unit_with_proration_config"], + ["cadence", "currency", "grouped_allocation_config", "item_id", "model_type", "name"], ) def create( self, @@ -1495,7 +1574,8 @@ def create( | Literal["tiered_package_with_minimum"] | Literal["unit_with_percent"] | Literal["tiered_with_proration"] - | Literal["unit_with_proration"], + | Literal["unit_with_proration"] + | Literal["grouped_allocation"], name: str, unit_config: price_create_params.NewFloatingUnitPriceUnitConfig | NotGiven = NOT_GIVEN, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -1523,6 +1603,7 @@ def create( unit_with_percent_config: Dict[str, object] | NotGiven = NOT_GIVEN, tiered_with_proration_config: Dict[str, object] | NotGiven = NOT_GIVEN, unit_with_proration_config: Dict[str, object] | NotGiven = NOT_GIVEN, + grouped_allocation_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, @@ -1567,6 +1648,7 @@ def create( "unit_with_percent_config": unit_with_percent_config, "tiered_with_proration_config": tiered_with_proration_config, "unit_with_proration_config": unit_with_proration_config, + "grouped_allocation_config": grouped_allocation_config, }, price_create_params.PriceCreateParams, ), @@ -3229,6 +3311,84 @@ async def create( """ ... + @overload + async def create( + self, + *, + cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], + currency: str, + grouped_allocation_config: Dict[str, object], + item_id: str, + model_type: Literal["grouped_allocation"], + name: str, + billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, + billed_in_advance: Optional[bool] | 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, + 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. + + 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 + + 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"], @@ -3248,6 +3408,7 @@ async def create( ["cadence", "currency", "item_id", "model_type", "name", "unit_with_percent_config"], ["cadence", "currency", "item_id", "model_type", "name", "tiered_with_proration_config"], ["cadence", "currency", "item_id", "model_type", "name", "unit_with_proration_config"], + ["cadence", "currency", "grouped_allocation_config", "item_id", "model_type", "name"], ) async def create( self, @@ -3272,7 +3433,8 @@ async def create( | Literal["tiered_package_with_minimum"] | Literal["unit_with_percent"] | Literal["tiered_with_proration"] - | Literal["unit_with_proration"], + | Literal["unit_with_proration"] + | Literal["grouped_allocation"], name: str, unit_config: price_create_params.NewFloatingUnitPriceUnitConfig | NotGiven = NOT_GIVEN, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -3300,6 +3462,7 @@ async def create( unit_with_percent_config: Dict[str, object] | NotGiven = NOT_GIVEN, tiered_with_proration_config: Dict[str, object] | NotGiven = NOT_GIVEN, unit_with_proration_config: Dict[str, object] | NotGiven = NOT_GIVEN, + grouped_allocation_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, @@ -3344,6 +3507,7 @@ async def create( "unit_with_percent_config": unit_with_percent_config, "tiered_with_proration_config": tiered_with_proration_config, "unit_with_proration_config": unit_with_proration_config, + "grouped_allocation_config": grouped_allocation_config, }, price_create_params.PriceCreateParams, ), diff --git a/src/orb/types/plan_create_params.py b/src/orb/types/plan_create_params.py index 4a3e49fe..aa448315 100644 --- a/src/orb/types/plan_create_params.py +++ b/src/orb/types/plan_create_params.py @@ -36,6 +36,7 @@ "PriceNewPlanPackageWithAllocationPrice", "PriceNewPlanTierWithProrationPrice", "PriceNewPlanUnitWithProrationPrice", + "PriceNewPlanGroupedAllocationPrice", ] @@ -1025,6 +1026,61 @@ class PriceNewPlanUnitWithProrationPrice(TypedDict, total=False): """ +class PriceNewPlanGroupedAllocationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_allocation_config: Required[Dict[str, object]] + + item_id: Required[str] + """The id of the item the plan will be associated with.""" + + model_type: Required[Literal["grouped_allocation"]] + + 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. + """ + + 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""" + + 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, @@ -1041,4 +1097,5 @@ class PriceNewPlanUnitWithProrationPrice(TypedDict, total=False): PriceNewPlanPackageWithAllocationPrice, PriceNewPlanTierWithProrationPrice, PriceNewPlanUnitWithProrationPrice, + PriceNewPlanGroupedAllocationPrice, ] diff --git a/src/orb/types/price.py b/src/orb/types/price.py index ba4d6578..4f38e542 100644 --- a/src/orb/types/price.py +++ b/src/orb/types/price.py @@ -153,6 +153,13 @@ "UnitWithProrationPriceItem", "UnitWithProrationPriceMaximum", "UnitWithProrationPriceMinimum", + "GroupedAllocationPrice", + "GroupedAllocationPriceBillableMetric", + "GroupedAllocationPriceBillingCycleConfiguration", + "GroupedAllocationPriceCreditAllocation", + "GroupedAllocationPriceItem", + "GroupedAllocationPriceMaximum", + "GroupedAllocationPriceMinimum", ] @@ -2028,6 +2035,102 @@ class UnitWithProrationPrice(BaseModel): unit_with_proration_config: Dict[str, object] +class GroupedAllocationPriceBillableMetric(BaseModel): + id: str + + +class GroupedAllocationPriceBillingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + +class GroupedAllocationPriceCreditAllocation(BaseModel): + allows_rollover: bool + + currency: str + + +class GroupedAllocationPriceItem(BaseModel): + id: str + + name: str + + +class GroupedAllocationPriceMaximum(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 GroupedAllocationPriceMinimum(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 GroupedAllocationPrice(BaseModel): + id: str + + billable_metric: Optional[GroupedAllocationPriceBillableMetric] = None + + billing_cycle_configuration: Optional[GroupedAllocationPriceBillingCycleConfiguration] = None + + cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] + + conversion_rate: Optional[float] = None + + created_at: datetime + + credit_allocation: Optional[GroupedAllocationPriceCreditAllocation] = None + + currency: str + + discount: Optional[Discount] = None + + external_price_id: Optional[str] = None + + fixed_price_quantity: Optional[float] = None + + grouped_allocation_config: Dict[str, object] + + item: GroupedAllocationPriceItem + + maximum: Optional[GroupedAllocationPriceMaximum] = 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[GroupedAllocationPriceMinimum] = None + + minimum_amount: Optional[str] = None + + price_model_type: Literal["grouped_allocation"] = FieldInfo(alias="model_type") + + name: str + + plan_phase_order: Optional[int] = None + + price_type: Literal["usage_price", "fixed_price"] + + Price: TypeAlias = Annotated[ Union[ UnitPrice, @@ -2048,6 +2151,7 @@ class UnitWithProrationPrice(BaseModel): MatrixWithAllocationPrice, TieredWithProrationPrice, UnitWithProrationPrice, + GroupedAllocationPrice, ], PropertyInfo(discriminator="price_model_type"), ] diff --git a/src/orb/types/price_create_params.py b/src/orb/types/price_create_params.py index 9d2162b3..10d9885b 100644 --- a/src/orb/types/price_create_params.py +++ b/src/orb/types/price_create_params.py @@ -40,6 +40,7 @@ "NewFloatingUnitWithPercentPrice", "NewFloatingTieredWithProrationPrice", "NewFloatingUnitWithProrationPrice", + "NewFloatingGroupedAllocationPrice", ] @@ -1123,6 +1124,58 @@ class NewFloatingUnitWithProrationPrice(TypedDict, total=False): """ +class NewFloatingGroupedAllocationPrice(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.""" + + grouped_allocation_config: Required[Dict[str, object]] + + item_id: Required[str] + """The id of the item the plan will be associated with.""" + + model_type: Required[Literal["grouped_allocation"]] + + 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. + """ + + 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""" + + 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`. + """ + + PriceCreateParams: TypeAlias = Union[ NewFloatingUnitPrice, NewFloatingPackagePrice, @@ -1142,4 +1195,5 @@ class NewFloatingUnitWithProrationPrice(TypedDict, total=False): NewFloatingUnitWithPercentPrice, NewFloatingTieredWithProrationPrice, NewFloatingUnitWithProrationPrice, + NewFloatingGroupedAllocationPrice, ] diff --git a/src/orb/types/subscription_price_intervals_params.py b/src/orb/types/subscription_price_intervals_params.py index 6754171e..ccb2b76e 100644 --- a/src/orb/types/subscription_price_intervals_params.py +++ b/src/orb/types/subscription_price_intervals_params.py @@ -52,6 +52,7 @@ "AddPriceNewFloatingUnitWithPercentPrice", "AddPriceNewFloatingTieredWithProrationPrice", "AddPriceNewFloatingUnitWithProrationPrice", + "AddPriceNewFloatingGroupedAllocationPrice", "AddAdjustment", "AddAdjustmentAdjustment", "AddAdjustmentAdjustmentNewPercentageDiscount", @@ -1220,6 +1221,58 @@ class AddPriceNewFloatingUnitWithProrationPrice(TypedDict, total=False): """ +class AddPriceNewFloatingGroupedAllocationPrice(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.""" + + grouped_allocation_config: Required[Dict[str, object]] + + item_id: Required[str] + """The id of the item the plan will be associated with.""" + + model_type: Required[Literal["grouped_allocation"]] + + 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. + """ + + 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""" + + 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, @@ -1239,6 +1292,7 @@ class AddPriceNewFloatingUnitWithProrationPrice(TypedDict, total=False): AddPriceNewFloatingUnitWithPercentPrice, AddPriceNewFloatingTieredWithProrationPrice, AddPriceNewFloatingUnitWithProrationPrice, + AddPriceNewFloatingGroupedAllocationPrice, ] diff --git a/tests/api_resources/test_prices.py b/tests/api_resources/test_prices.py index 0999b97f..30e588cd 100644 --- a/tests/api_resources/test_prices.py +++ b/tests/api_resources/test_prices.py @@ -1527,6 +1527,71 @@ 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: + price = client.prices.create( + cadence="annual", + currency="currency", + grouped_allocation_config={"foo": "bar"}, + item_id="item_id", + model_type="grouped_allocation", + name="Annual fee", + ) + assert_matches_type(Price, price, path=["response"]) + + @parametrize + def test_method_create_with_all_params_overload_19(self, client: Orb) -> None: + price = client.prices.create( + cadence="annual", + currency="currency", + grouped_allocation_config={"foo": "bar"}, + item_id="item_id", + model_type="grouped_allocation", + name="Annual fee", + billable_metric_id="billable_metric_id", + billed_in_advance=True, + conversion_rate=0, + external_price_id="external_price_id", + fixed_price_quantity=0, + invoice_grouping_key="invoice_grouping_key", + metadata={"foo": "string"}, + ) + assert_matches_type(Price, price, path=["response"]) + + @parametrize + def test_raw_response_create_overload_19(self, client: Orb) -> None: + response = client.prices.with_raw_response.create( + cadence="annual", + currency="currency", + grouped_allocation_config={"foo": "bar"}, + item_id="item_id", + model_type="grouped_allocation", + 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_19(self, client: Orb) -> None: + with client.prices.with_streaming_response.create( + cadence="annual", + currency="currency", + grouped_allocation_config={"foo": "bar"}, + item_id="item_id", + model_type="grouped_allocation", + name="Annual fee", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + price = response.parse() + assert_matches_type(Price, price, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize def test_method_update(self, client: Orb) -> None: price = client.prices.update( @@ -3212,6 +3277,71 @@ 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: + price = await async_client.prices.create( + cadence="annual", + currency="currency", + grouped_allocation_config={"foo": "bar"}, + item_id="item_id", + model_type="grouped_allocation", + name="Annual fee", + ) + assert_matches_type(Price, price, path=["response"]) + + @parametrize + 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", + grouped_allocation_config={"foo": "bar"}, + item_id="item_id", + model_type="grouped_allocation", + name="Annual fee", + billable_metric_id="billable_metric_id", + billed_in_advance=True, + conversion_rate=0, + external_price_id="external_price_id", + fixed_price_quantity=0, + invoice_grouping_key="invoice_grouping_key", + metadata={"foo": "string"}, + ) + assert_matches_type(Price, price, path=["response"]) + + @parametrize + 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", + grouped_allocation_config={"foo": "bar"}, + item_id="item_id", + model_type="grouped_allocation", + 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_19(self, async_client: AsyncOrb) -> None: + async with async_client.prices.with_streaming_response.create( + cadence="annual", + currency="currency", + grouped_allocation_config={"foo": "bar"}, + item_id="item_id", + model_type="grouped_allocation", + name="Annual fee", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + price = await response.parse() + assert_matches_type(Price, price, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize async def test_method_update(self, async_client: AsyncOrb) -> None: price = await async_client.prices.update( From b06b35b6b1c504a561296f77b99dd789bc70f32a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 16 Aug 2024 01:19:55 +0000 Subject: [PATCH 2/2] release: 2.5.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ pyproject.toml | 2 +- src/orb/_version.py | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index b44b2870..4dedeaeb 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.4.0" + ".": "2.5.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index ab0cd62b..63d7d0c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 2.5.0 (2024-08-16) + +Full Changelog: [v2.4.0...v2.5.0](https://github.com/orbcorp/orb-python/compare/v2.4.0...v2.5.0) + +### Features + +* **api:** OpenAPI spec update via Stainless API ([#349](https://github.com/orbcorp/orb-python/issues/349)) ([dc573e4](https://github.com/orbcorp/orb-python/commit/dc573e48b5dda28ef03944c11590daa67e8b054e)) + ## 2.4.0 (2024-08-15) Full Changelog: [v2.3.0...v2.4.0](https://github.com/orbcorp/orb-python/compare/v2.3.0...v2.4.0) diff --git a/pyproject.toml b/pyproject.toml index 88fbb9a3..d8658eaf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "orb-billing" -version = "2.4.0" +version = "2.5.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 6b1abbce..b265b915 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.4.0" # x-release-please-version +__version__ = "2.5.0" # x-release-please-version