From cb8992bf23e9639a27d885e110966cb01acc3e61 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 25 Jun 2024 12:44:41 +0000 Subject: [PATCH] fix(api)!: endpoint expects amount of new allocation price to be a string, not a number (#297) # Migration This change is fixing the SDK to use the correct `string` type expected by the API. The spec was incorrectly specifying a type `number` but the endpoint expected a string. While this change is technically an SDK breaking change the previous types weren't accurately representing the API behaviour. To migrate, be sure to use a string representation of the new allocation price amount. --- .stats.yml | 2 +- src/orb/types/subscription_price_intervals_params.py | 2 +- tests/api_resources/test_subscriptions.py | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.stats.yml b/.stats.yml index ca9f9877..020ff6db 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 90 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb-aebc7faa75113d98ef7b57673cf7fce499c87b96afabe6c2ddc5e22badc3ef33.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb-2f2e1b9fbe79b0ed97d846a5a26937f421c162e559a2f85a82d7c6e432463f32.yml diff --git a/src/orb/types/subscription_price_intervals_params.py b/src/orb/types/subscription_price_intervals_params.py index a13f70e0..47048bbe 100644 --- a/src/orb/types/subscription_price_intervals_params.py +++ b/src/orb/types/subscription_price_intervals_params.py @@ -79,7 +79,7 @@ class SubscriptionPriceIntervalsParams(TypedDict, total=False): class AddAllocationPrice(TypedDict, total=False): - amount: Required[float] + amount: Required[str] """An amount of the currency to allocate to the customer at the specified cadence.""" cadence: Required[Literal["one_time", "monthly", "quarterly", "semi_annual", "annual"]] diff --git a/tests/api_resources/test_subscriptions.py b/tests/api_resources/test_subscriptions.py index 60df4e75..359c89b3 100644 --- a/tests/api_resources/test_subscriptions.py +++ b/tests/api_resources/test_subscriptions.py @@ -503,7 +503,7 @@ def test_method_price_intervals_with_all_params(self, client: Orb) -> None: }, "allocation_price": { "currency": "USD", - "amount": 0, + "amount": "10.00", "cadence": "monthly", "expires_at_end_of_cadence": True, }, @@ -559,7 +559,7 @@ def test_method_price_intervals_with_all_params(self, client: Orb) -> None: }, "allocation_price": { "currency": "USD", - "amount": 0, + "amount": "10.00", "cadence": "monthly", "expires_at_end_of_cadence": True, }, @@ -615,7 +615,7 @@ def test_method_price_intervals_with_all_params(self, client: Orb) -> None: }, "allocation_price": { "currency": "USD", - "amount": 0, + "amount": "10.00", "cadence": "monthly", "expires_at_end_of_cadence": True, }, @@ -1618,7 +1618,7 @@ async def test_method_price_intervals_with_all_params(self, async_client: AsyncO }, "allocation_price": { "currency": "USD", - "amount": 0, + "amount": "10.00", "cadence": "monthly", "expires_at_end_of_cadence": True, }, @@ -1674,7 +1674,7 @@ async def test_method_price_intervals_with_all_params(self, async_client: AsyncO }, "allocation_price": { "currency": "USD", - "amount": 0, + "amount": "10.00", "cadence": "monthly", "expires_at_end_of_cadence": True, }, @@ -1730,7 +1730,7 @@ async def test_method_price_intervals_with_all_params(self, async_client: AsyncO }, "allocation_price": { "currency": "USD", - "amount": 0, + "amount": "10.00", "cadence": "monthly", "expires_at_end_of_cadence": True, },