From 35be459dffadcd63890aa9ae4f9f6a4f37ab51aa Mon Sep 17 00:00:00 2001 From: Stainless Bot Date: Tue, 25 Jun 2024 12:44:17 +0000 Subject: [PATCH] fix(api)!: endpoint expects amount of new allocation price to be a string, not a number # 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/resources/subscriptions.ts | 2 +- tests/api-resources/subscriptions.test.ts | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.stats.yml b/.stats.yml index ca9f987..020ff6d 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/resources/subscriptions.ts b/src/resources/subscriptions.ts index 61e9d75..fc9df9d 100644 --- a/src/resources/subscriptions.ts +++ b/src/resources/subscriptions.ts @@ -3679,7 +3679,7 @@ export namespace SubscriptionPriceIntervalsParams { /** * An amount of the currency to allocate to the customer at the specified cadence. */ - amount: number; + amount: string; /** * The cadence at which to allocate the amount to the customer. diff --git a/tests/api-resources/subscriptions.test.ts b/tests/api-resources/subscriptions.test.ts index 8c1bd8f..2a15183 100644 --- a/tests/api-resources/subscriptions.test.ts +++ b/tests/api-resources/subscriptions.test.ts @@ -383,7 +383,7 @@ describe('resource subscriptions', () => { }, allocation_price: { currency: 'USD', - amount: 0, + amount: '10.00', cadence: 'monthly', expires_at_end_of_cadence: true, }, @@ -421,7 +421,7 @@ describe('resource subscriptions', () => { }, allocation_price: { currency: 'USD', - amount: 0, + amount: '10.00', cadence: 'monthly', expires_at_end_of_cadence: true, }, @@ -459,7 +459,7 @@ describe('resource subscriptions', () => { }, allocation_price: { currency: 'USD', - amount: 0, + amount: '10.00', cadence: 'monthly', expires_at_end_of_cadence: true, },