Skip to content

Commit

Permalink
feat(api): updates (#200)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed May 13, 2024
1 parent 794c13f commit 61505d5
Show file tree
Hide file tree
Showing 19 changed files with 30 additions and 32 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: 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
10 changes: 4 additions & 6 deletions src/resources/events/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
4 changes: 2 additions & 2 deletions src/resources/subscriptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/api-resources/alerts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' },
Expand Down
4 changes: 2 additions & 2 deletions tests/api-resources/coupons/coupons.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
});

Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion tests/api-resources/coupons/subscriptions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion tests/api-resources/credit-notes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});

Expand Down
2 changes: 1 addition & 1 deletion tests/api-resources/customers/balance-transactions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
4 changes: 2 additions & 2 deletions tests/api-resources/customers/credits/credits.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions tests/api-resources/customers/credits/ledger.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' },
Expand Down Expand Up @@ -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' },
Expand Down
4 changes: 2 additions & 2 deletions tests/api-resources/customers/credits/top-ups.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion tests/api-resources/customers/customers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' },
),
Expand Down
2 changes: 1 addition & 1 deletion tests/api-resources/events/backfills.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});

Expand Down
2 changes: 1 addition & 1 deletion tests/api-resources/invoices.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
Expand Down
2 changes: 1 addition & 1 deletion tests/api-resources/items.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});

Expand Down
2 changes: 1 addition & 1 deletion tests/api-resources/metrics.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' },
),
Expand Down
2 changes: 1 addition & 1 deletion tests/api-resources/plans/plans.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' },
Expand Down
2 changes: 1 addition & 1 deletion tests/api-resources/prices/prices.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});

Expand Down
8 changes: 4 additions & 4 deletions tests/api-resources/subscriptions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
{
Expand Down Expand Up @@ -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' },
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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: [
{
Expand Down

0 comments on commit 61505d5

Please sign in to comment.