Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Jul 15, 2024
1 parent a6be9e9 commit 1412cfe
Show file tree
Hide file tree
Showing 16 changed files with 40 additions and 39 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
pull_request:
branches:
- main
- next

jobs:
lint:
Expand Down
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 48
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome%2Fmetronome-640c4d54c542cc7c00227b484ed677e88fc79dcdf17c526a49615c9ae0500432.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome%2Fmetronome-860ef8a22818c70f942949a6d8b3e9be3673d005539ed310dc90ca3dbf0261fb.yml
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

This library provides convenient access to the Metronome REST API from server-side TypeScript or JavaScript.

The REST API documentation can be found [on docs.metronome.com](https://docs.metronome.com). The full API of this library can be found in [api.md](api.md).
The REST API documentation can be found on [docs.metronome.com](https://docs.metronome.com). The full API of this library can be found in [api.md](api.md).

## Installation

Expand Down
8 changes: 4 additions & 4 deletions tests/api-resources/alerts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ describe('resource alerts', () => {
credit_grant_type_filters: ['enterprise'],
credit_type_id: '2714e483-4ff1-48e4-9e25-ac732e8f24f2',
custom_field_filters: [
{ entity: 'Contract', key: 'string', value: 'string' },
{ entity: 'Contract', key: 'string', value: 'string' },
{ entity: 'Contract', key: 'string', value: 'string' },
{ entity: 'Contract', key: 'key', value: 'value' },
{ entity: 'Contract', key: 'key', value: 'value' },
{ entity: 'Contract', key: 'key', value: 'value' },
],
customer_id: '4db51251-61de-4bfe-b9ce-495e244f3491',
evaluate_on_create: true,
group_key_filter: { key: 'string', value: 'string' },
group_key_filter: { key: 'key', value: 'value' },
invoice_types_filter: [
'PLAN_ARREARS, SCHEDULED, USAGE, CORRECTION, CREDIT_PURCHASE, or SEAT_PURCHASE',
'PLAN_ARREARS, SCHEDULED, USAGE, CORRECTION, CREDIT_PURCHASE, or SEAT_PURCHASE',
Expand Down
6 changes: 3 additions & 3 deletions tests/api-resources/audit-logs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ describe('resource auditLogs', () => {
{
ending_before: '2019-12-27T18:11:19.117Z',
limit: 1,
next_page: 'string',
resource_id: 'string',
resource_type: 'string',
next_page: 'next_page',
resource_id: 'resource_id',
resource_type: 'resource_type',
sort: 'date_asc',
starting_on: '2019-12-27T18:11:19.117Z',
},
Expand Down
2 changes: 1 addition & 1 deletion tests/api-resources/billable-metrics.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ describe('resource billableMetrics', () => {
await expect(
metronome.billableMetrics.list(
'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
{ limit: 1, next_page: 'string', on_current_plan: true },
{ limit: 1, next_page: 'next_page', on_current_plan: true },
{ path: '/_stainless_unknown_path' },
),
).rejects.toThrow(Metronome.NotFoundError);
Expand Down
6 changes: 3 additions & 3 deletions tests/api-resources/credit-grants.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ describe('resource creditGrants', () => {
metronome.creditGrants.list(
{
limit: 1,
next_page: 'string',
next_page: 'next_page',
credit_grant_ids: [
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
Expand Down Expand Up @@ -135,7 +135,7 @@ describe('resource creditGrants', () => {
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
await expect(
metronome.creditGrants.listCreditTypes(
{ limit: 1, next_page: 'string' },
{ limit: 1, next_page: 'next_page' },
{ path: '/_stainless_unknown_path' },
),
).rejects.toThrow(Metronome.NotFoundError);
Expand Down Expand Up @@ -164,7 +164,7 @@ describe('resource creditGrants', () => {
await expect(
metronome.creditGrants.listEntries(
{
next_page: 'string',
next_page: 'next_page',
credit_type_ids: ['2714e483-4ff1-48e4-9e25-ac732e8f24f2'],
customer_ids: ['6a37bb88-8538-48c5-b37b-a41c836328bd'],
ending_before: '2021-02-01T00:00:00Z',
Expand Down
2 changes: 1 addition & 1 deletion tests/api-resources/custom-fields.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ describe('resource customFields', () => {
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
await expect(
metronome.customFields.listKeys(
{ next_page: 'string', entities: ['customer', 'credit_grant'] },
{ next_page: 'next_page', entities: ['customer', 'credit_grant'] },
{ path: '/_stainless_unknown_path' },
),
).rejects.toThrow(Metronome.NotFoundError);
Expand Down
2 changes: 1 addition & 1 deletion tests/api-resources/customers/alerts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ describe('resource alerts', () => {
test('list: required and optional params', async () => {
const response = await metronome.customers.alerts.list({
customer_id: '9b85c1c1-5238-4f2a-a409-61412905e1e1',
next_page: 'string',
next_page: 'next_page',
alert_statuses: ['enabled'],
});
});
Expand Down
2 changes: 1 addition & 1 deletion tests/api-resources/customers/billing-config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('resource billingConfig', () => {
'stripe',
{
billing_provider_customer_id: 'cus_AJ6y20bjkOOayM',
aws_product_code: 'string',
aws_product_code: 'aws_product_code',
aws_region: 'af-south-1',
stripe_collection_method: 'charge_automatically',
},
Expand Down
12 changes: 6 additions & 6 deletions tests/api-resources/customers/customers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ describe('resource customers', () => {
name: 'Example, Inc.',
billing_config: {
billing_provider_type: 'aws_marketplace',
billing_provider_customer_id: 'string',
billing_provider_customer_id: 'billing_provider_customer_id',
stripe_collection_method: 'charge_automatically',
aws_product_code: 'string',
aws_product_code: 'aws_product_code',
aws_region: 'af-south-1',
},
custom_fields: { foo: 'string' },
Expand Down Expand Up @@ -80,9 +80,9 @@ describe('resource customers', () => {
metronome.customers.list(
{
customer_ids: ['string', 'string', 'string'],
ingest_alias: 'string',
ingest_alias: 'ingest_alias',
limit: 1,
next_page: 'string',
next_page: 'next_page',
only_archived: true,
salesforce_account_ids: ['string', 'string', 'string'],
},
Expand Down Expand Up @@ -131,7 +131,7 @@ describe('resource customers', () => {
await expect(
metronome.customers.listBillableMetrics(
'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
{ limit: 1, next_page: 'string', on_current_plan: true },
{ limit: 1, next_page: 'next_page', on_current_plan: true },
{ path: '/_stainless_unknown_path' },
),
).rejects.toThrow(Metronome.NotFoundError);
Expand All @@ -156,7 +156,7 @@ describe('resource customers', () => {
ending_before: '2019-12-27T18:11:19.117Z',
starting_on: '2019-12-27T18:11:19.117Z',
limit: 1,
next_page: 'string',
next_page: 'next_page',
});
});

Expand Down
6 changes: 3 additions & 3 deletions tests/api-resources/customers/invoices.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@ describe('resource invoices', () => {
metronome.customers.invoices.list(
'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
{
credit_type_id: 'string',
credit_type_id: 'credit_type_id',
ending_before: '2019-12-27T18:11:19.117Z',
limit: 1,
next_page: 'string',
next_page: 'next_page',
skip_zero_qty_line_items: true,
sort: 'date_asc',
starting_on: '2019-12-27T18:11:19.117Z',
status: 'string',
status: 'status',
},
{ path: '/_stainless_unknown_path' },
),
Expand Down
6 changes: 3 additions & 3 deletions tests/api-resources/customers/plans.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe('resource plans', () => {
await expect(
metronome.customers.plans.list(
'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
{ limit: 1, next_page: 'string' },
{ limit: 1, next_page: 'next_page' },
{ path: '/_stainless_unknown_path' },
),
).rejects.toThrow(Metronome.NotFoundError);
Expand Down Expand Up @@ -103,7 +103,7 @@ describe('resource plans', () => {
start_period: 0,
},
],
trial_spec: { length_in_days: 0, spending_cap: { credit_type_id: 'string', amount: 0 } },
trial_spec: { length_in_days: 0, spending_cap: { credit_type_id: 'credit_type_id', amount: 0 } },
});
});

Expand Down Expand Up @@ -175,7 +175,7 @@ describe('resource plans', () => {
metronome.customers.plans.listPriceAdjustments(
'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
'7aa11640-0703-4600-8eb9-293f535a6b74',
{ limit: 1, next_page: 'string' },
{ limit: 1, next_page: 'next_page' },
{ path: '/_stainless_unknown_path' },
),
).rejects.toThrow(Metronome.NotFoundError);
Expand Down
6 changes: 3 additions & 3 deletions tests/api-resources/dashboards.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ describe('resource dashboards', () => {
dashboard: 'invoices',
color_overrides: [{ name: 'Gray_dark', value: '#ff0000' }],
dashboard_options: [
{ key: 'string', value: 'string' },
{ key: 'string', value: 'string' },
{ key: 'string', value: 'string' },
{ key: 'key', value: 'value' },
{ key: 'key', value: 'value' },
{ key: 'key', value: 'value' },
],
});
});
Expand Down
6 changes: 3 additions & 3 deletions tests/api-resources/plans.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('resource plans', () => {
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(
metronome.plans.list({ limit: 1, next_page: 'string' }, { path: '/_stainless_unknown_path' }),
metronome.plans.list({ limit: 1, next_page: 'next_page' }, { path: '/_stainless_unknown_path' }),
).rejects.toThrow(Metronome.NotFoundError);
});

Expand Down Expand Up @@ -79,7 +79,7 @@ describe('resource plans', () => {
await expect(
metronome.plans.listCharges(
'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
{ limit: 1, next_page: 'string' },
{ limit: 1, next_page: 'next_page' },
{ path: '/_stainless_unknown_path' },
),
).rejects.toThrow(Metronome.NotFoundError);
Expand Down Expand Up @@ -110,7 +110,7 @@ describe('resource plans', () => {
await expect(
metronome.plans.listCustomers(
'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
{ limit: 1, next_page: 'string', status: 'all' },
{ limit: 1, next_page: 'next_page', status: 'all' },
{ path: '/_stainless_unknown_path' },
),
).rejects.toThrow(Metronome.NotFoundError);
Expand Down
10 changes: 5 additions & 5 deletions tests/api-resources/usage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ describe('resource usage', () => {
ending_before: '2021-01-03T00:00:00Z',
starting_on: '2021-01-01T00:00:00Z',
window_size: 'day',
next_page: 'string',
next_page: 'next_page',
billable_metrics: [
{ id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', group_by: { key: 'string', values: ['x'] } },
{ id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', group_by: { key: 'string', values: ['x'] } },
{ id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', group_by: { key: 'string', values: ['x'] } },
{ id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', group_by: { key: 'key', values: ['x'] } },
{ id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', group_by: { key: 'key', values: ['x'] } },
{ id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', group_by: { key: 'key', values: ['x'] } },
],
customer_ids: [
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
Expand Down Expand Up @@ -94,7 +94,7 @@ describe('resource usage', () => {
customer_id: '04ca7e72-4229-4a6e-ab11-9f7376fccbcb',
window_size: 'day',
limit: 1,
next_page: 'string',
next_page: 'next_page',
current_period: true,
ending_before: '2021-01-03T00:00:00Z',
group_by: { key: 'region', values: ['US-East', 'US-West', 'EU-Central'] },
Expand Down

0 comments on commit 1412cfe

Please sign in to comment.