Skip to content

Commit

Permalink
fix(api)!: endpoint expects amount of new allocation price to be a st…
Browse files Browse the repository at this point in the history
…ring, 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.
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Jun 25, 2024
1 parent 9076f38 commit cb8992b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion src/orb/types/subscription_price_intervals_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]]
Expand Down
12 changes: 6 additions & 6 deletions tests/api_resources/test_subscriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down Expand Up @@ -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,
},
Expand Down Expand Up @@ -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,
},
Expand Down Expand Up @@ -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,
},
Expand Down Expand Up @@ -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,
},
Expand Down Expand Up @@ -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,
},
Expand Down

0 comments on commit cb8992b

Please sign in to comment.