diff --git a/.stats.yml b/.stats.yml index 73e6990..ad50dbe 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 89 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb-762f50aa6ea13f42e719339aa5cb31233984499720a7be832182357f949927a1.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb-03945a99974ac1e7218fd458dceef31887a249cc048bcbbbe3828c1d893f95ea.yml diff --git a/src/resources/events/events.ts b/src/resources/events/events.ts index 77e71b6..c8b86d2 100644 --- a/src/resources/events/events.ts +++ b/src/resources/events/events.ts @@ -226,12 +226,10 @@ export class Events extends APIResource { * We validate the following: * * - Exactly one of `customer_id` and `external_customer_id` should be specified. - * - If specified, `customer_id` must identify a Customer resource within Orb. We - * do not support sending events for customers that have not been provisioned. - * Similarly, if specified, `external_customer_id` must be an identifier that is - * associated with an Orb Customer resource. Note: During our initial integration - * period, this enforcement will be temporarily turned into a warning to ensure - * smooth customer migration. + * - If the `customer_id` is specified, the customer in Orb must exist. + * - If the `external_customer_id` is specified, the customer in Orb does not need + * to exist. Events will be attributed to any future customers with the + * `external_customer_id` on subscription creation. * - `timestamp` must conform to ISO 8601 and represent a timestamp at most 1 hour * in the future. This timestamp should be sent in UTC timezone (no timezone * offset). diff --git a/src/resources/subscriptions.ts b/src/resources/subscriptions.ts index 1d94c32..f20759d 100644 --- a/src/resources/subscriptions.ts +++ b/src/resources/subscriptions.ts @@ -2087,7 +2087,7 @@ export interface SubscriptionCreateParams { net_terms?: number | null; - per_credit_overage_amount?: string | null; + per_credit_overage_amount?: number | null; /** * The plan that the given subscription should be switched to. Note that either @@ -4827,7 +4827,7 @@ export interface SubscriptionSchedulePlanChangeParams { */ invoicing_threshold?: string | null; - per_credit_overage_amount?: string | null; + per_credit_overage_amount?: number | null; /** * The plan that the given subscription should be switched to. Note that either diff --git a/tests/api-resources/alerts.test.ts b/tests/api-resources/alerts.test.ts index 16e2242..6953ee8 100644 --- a/tests/api-resources/alerts.test.ts +++ b/tests/api-resources/alerts.test.ts @@ -58,7 +58,7 @@ describe('resource alerts', () => { cursor: 'string', customer_id: 'string', external_customer_id: 'string', - limit: 0, + limit: 1, subscription_id: 'string', }, { path: '/_stainless_unknown_path' }, diff --git a/tests/api-resources/coupons/coupons.test.ts b/tests/api-resources/coupons/coupons.test.ts index 53fa3c3..c4f59b4 100644 --- a/tests/api-resources/coupons/coupons.test.ts +++ b/tests/api-resources/coupons/coupons.test.ts @@ -28,7 +28,7 @@ describe('resource coupons', () => { discount: { discount_type: 'percentage', percentage_discount: 0 }, redemption_code: 'HALFOFF', duration_in_months: 12, - max_redemptions: 0, + max_redemptions: 1, }); }); @@ -52,7 +52,7 @@ describe('resource coupons', () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( orb.coupons.list( - { cursor: 'string', limit: 0, redemption_code: 'string', show_archived: true }, + { cursor: 'string', limit: 1, redemption_code: 'string', show_archived: true }, { path: '/_stainless_unknown_path' }, ), ).rejects.toThrow(Orb.NotFoundError); diff --git a/tests/api-resources/coupons/subscriptions.test.ts b/tests/api-resources/coupons/subscriptions.test.ts index fb72c2f..772d152 100644 --- a/tests/api-resources/coupons/subscriptions.test.ts +++ b/tests/api-resources/coupons/subscriptions.test.ts @@ -32,7 +32,7 @@ describe('resource subscriptions', () => { await expect( orb.coupons.subscriptions.list( 'string', - { cursor: 'string', limit: 0 }, + { cursor: 'string', limit: 1 }, { path: '/_stainless_unknown_path' }, ), ).rejects.toThrow(Orb.NotFoundError); diff --git a/tests/api-resources/credit-notes.test.ts b/tests/api-resources/credit-notes.test.ts index 15e26bb..ff8779f 100644 --- a/tests/api-resources/credit-notes.test.ts +++ b/tests/api-resources/credit-notes.test.ts @@ -30,7 +30,7 @@ describe('resource creditNotes', () => { test('list: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - orb.creditNotes.list({ cursor: 'string', limit: 0 }, { path: '/_stainless_unknown_path' }), + orb.creditNotes.list({ cursor: 'string', limit: 1 }, { path: '/_stainless_unknown_path' }), ).rejects.toThrow(Orb.NotFoundError); }); diff --git a/tests/api-resources/customers/balance-transactions.test.ts b/tests/api-resources/customers/balance-transactions.test.ts index 2f3b86c..dd5547d 100644 --- a/tests/api-resources/customers/balance-transactions.test.ts +++ b/tests/api-resources/customers/balance-transactions.test.ts @@ -56,7 +56,7 @@ describe('resource balanceTransactions', () => { 'string', { cursor: 'string', - limit: 0, + limit: 1, 'operation_time[gt]': '2019-12-27T18:11:19.117Z', 'operation_time[gte]': '2019-12-27T18:11:19.117Z', 'operation_time[lt]': '2019-12-27T18:11:19.117Z', diff --git a/tests/api-resources/customers/credits/credits.test.ts b/tests/api-resources/customers/credits/credits.test.ts index 3cb81b8..c3c33a7 100644 --- a/tests/api-resources/customers/credits/credits.test.ts +++ b/tests/api-resources/customers/credits/credits.test.ts @@ -32,7 +32,7 @@ describe('resource credits', () => { await expect( orb.customers.credits.list( 'string', - { currency: 'string', cursor: 'string', limit: 0 }, + { currency: 'string', cursor: 'string', limit: 1 }, { path: '/_stainless_unknown_path' }, ), ).rejects.toThrow(Orb.NotFoundError); @@ -61,7 +61,7 @@ describe('resource credits', () => { await expect( orb.customers.credits.listByExternalId( 'string', - { currency: 'string', cursor: 'string', limit: 0 }, + { currency: 'string', cursor: 'string', limit: 1 }, { path: '/_stainless_unknown_path' }, ), ).rejects.toThrow(Orb.NotFoundError); diff --git a/tests/api-resources/customers/credits/ledger.test.ts b/tests/api-resources/customers/credits/ledger.test.ts index 10d57a3..fd6d287 100644 --- a/tests/api-resources/customers/credits/ledger.test.ts +++ b/tests/api-resources/customers/credits/ledger.test.ts @@ -41,7 +41,7 @@ describe('resource ledger', () => { cursor: 'string', entry_status: 'committed', entry_type: 'increment', - limit: 0, + limit: 1, minimum_amount: 'string', }, { path: '/_stainless_unknown_path' }, @@ -147,7 +147,7 @@ describe('resource ledger', () => { cursor: 'string', entry_status: 'committed', entry_type: 'increment', - limit: 0, + limit: 1, minimum_amount: 'string', }, { path: '/_stainless_unknown_path' }, diff --git a/tests/api-resources/customers/credits/top-ups.test.ts b/tests/api-resources/customers/credits/top-ups.test.ts index d30096e..a23255c 100644 --- a/tests/api-resources/customers/credits/top-ups.test.ts +++ b/tests/api-resources/customers/credits/top-ups.test.ts @@ -66,7 +66,7 @@ describe('resource topUps', () => { await expect( orb.customers.credits.topUps.list( 'string', - { cursor: 'string', limit: 0 }, + { cursor: 'string', limit: 1 }, { path: '/_stainless_unknown_path' }, ), ).rejects.toThrow(Orb.NotFoundError); @@ -167,7 +167,7 @@ describe('resource topUps', () => { await expect( orb.customers.credits.topUps.listByExternalId( 'string', - { cursor: 'string', limit: 0 }, + { cursor: 'string', limit: 1 }, { path: '/_stainless_unknown_path' }, ), ).rejects.toThrow(Orb.NotFoundError); diff --git a/tests/api-resources/customers/customers.test.ts b/tests/api-resources/customers/customers.test.ts index e54bb56..d8c3662 100644 --- a/tests/api-resources/customers/customers.test.ts +++ b/tests/api-resources/customers/customers.test.ts @@ -154,7 +154,7 @@ describe('resource customers', () => { 'created_at[lt]': '2019-12-27T18:11:19.117Z', 'created_at[lte]': '2019-12-27T18:11:19.117Z', cursor: 'string', - limit: 0, + limit: 1, }, { path: '/_stainless_unknown_path' }, ), diff --git a/tests/api-resources/events/backfills.test.ts b/tests/api-resources/events/backfills.test.ts index 17f83f5..0af37eb 100644 --- a/tests/api-resources/events/backfills.test.ts +++ b/tests/api-resources/events/backfills.test.ts @@ -55,7 +55,7 @@ describe('resource backfills', () => { test('list: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - orb.events.backfills.list({ cursor: 'string', limit: 0 }, { path: '/_stainless_unknown_path' }), + orb.events.backfills.list({ cursor: 'string', limit: 1 }, { path: '/_stainless_unknown_path' }), ).rejects.toThrow(Orb.NotFoundError); }); diff --git a/tests/api-resources/invoices.test.ts b/tests/api-resources/invoices.test.ts index bd02a9e..0cc89eb 100644 --- a/tests/api-resources/invoices.test.ts +++ b/tests/api-resources/invoices.test.ts @@ -132,7 +132,7 @@ describe('resource invoices', () => { 'invoice_date[lt]': '2019-12-27T18:11:19.117Z', 'invoice_date[lte]': '2019-12-27T18:11:19.117Z', is_recurring: true, - limit: 0, + limit: 1, status: ['draft', 'issued', 'paid'], subscription_id: 'string', }, diff --git a/tests/api-resources/items.test.ts b/tests/api-resources/items.test.ts index 43b0302..879e374 100644 --- a/tests/api-resources/items.test.ts +++ b/tests/api-resources/items.test.ts @@ -43,7 +43,7 @@ describe('resource items', () => { test('list: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - orb.items.list({ cursor: 'string', limit: 0 }, { path: '/_stainless_unknown_path' }), + orb.items.list({ cursor: 'string', limit: 1 }, { path: '/_stainless_unknown_path' }), ).rejects.toThrow(Orb.NotFoundError); }); diff --git a/tests/api-resources/metrics.test.ts b/tests/api-resources/metrics.test.ts index 1031a16..c0f4e38 100644 --- a/tests/api-resources/metrics.test.ts +++ b/tests/api-resources/metrics.test.ts @@ -61,7 +61,7 @@ describe('resource metrics', () => { 'created_at[lt]': '2019-12-27T18:11:19.117Z', 'created_at[lte]': '2019-12-27T18:11:19.117Z', cursor: 'string', - limit: 0, + limit: 1, }, { path: '/_stainless_unknown_path' }, ), diff --git a/tests/api-resources/plans/plans.test.ts b/tests/api-resources/plans/plans.test.ts index 8e148d3..a50d24a 100644 --- a/tests/api-resources/plans/plans.test.ts +++ b/tests/api-resources/plans/plans.test.ts @@ -114,7 +114,7 @@ describe('resource plans', () => { 'created_at[lt]': '2019-12-27T18:11:19.117Z', 'created_at[lte]': '2019-12-27T18:11:19.117Z', cursor: 'string', - limit: 0, + limit: 1, status: 'active', }, { path: '/_stainless_unknown_path' }, diff --git a/tests/api-resources/prices/prices.test.ts b/tests/api-resources/prices/prices.test.ts index 5971a91..9fc0a4b 100644 --- a/tests/api-resources/prices/prices.test.ts +++ b/tests/api-resources/prices/prices.test.ts @@ -63,7 +63,7 @@ describe('resource prices', () => { test('list: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - orb.prices.list({ cursor: 'string', limit: 0 }, { path: '/_stainless_unknown_path' }), + orb.prices.list({ cursor: 'string', limit: 1 }, { path: '/_stainless_unknown_path' }), ).rejects.toThrow(Orb.NotFoundError); }); diff --git a/tests/api-resources/subscriptions.test.ts b/tests/api-resources/subscriptions.test.ts index 233466c..551606d 100644 --- a/tests/api-resources/subscriptions.test.ts +++ b/tests/api-resources/subscriptions.test.ts @@ -48,7 +48,7 @@ describe('resource subscriptions', () => { invoicing_threshold: 'string', metadata: { foo: 'string' }, net_terms: 0, - per_credit_overage_amount: 'string', + per_credit_overage_amount: 0, plan_id: 'ZMwNQefe7J3ecf7W', price_overrides: [ { @@ -178,7 +178,7 @@ describe('resource subscriptions', () => { cursor: 'string', customer_id: 'string', external_customer_id: 'string', - limit: 0, + limit: 1, status: 'active', }, { path: '/_stainless_unknown_path' }, @@ -280,7 +280,7 @@ describe('resource subscriptions', () => { 'string', { cursor: 'string', - limit: 0, + limit: 1, 'start_date[gt]': '2019-12-27T18:11:19.117Z', 'start_date[gte]': '2019-12-27T18:11:19.117Z', 'start_date[lt]': '2019-12-27T18:11:19.117Z', @@ -526,7 +526,7 @@ describe('resource subscriptions', () => { external_plan_id: 'ZMwNQefe7J3ecf7W', initial_phase_order: 2, invoicing_threshold: '10.00', - per_credit_overage_amount: 'string', + per_credit_overage_amount: 0, plan_id: 'ZMwNQefe7J3ecf7W', price_overrides: [ {