diff --git a/.stats.yml b/.stats.yml index 9711ed3..e39b31a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 91 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome%2Fmetronome-ebf6ec71381ac4de43a238b439ff137f915f48cdb2533b8422d069cebece35c2.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome%2Fmetronome-d04cc2dc5a1f1bd278783a02c8bbf246f850ce53fe63d7d43cb9df69fae02429.yml diff --git a/src/resources/billable-metrics.ts b/src/resources/billable-metrics.ts index 975b7bc..38def17 100644 --- a/src/resources/billable-metrics.ts +++ b/src/resources/billable-metrics.ts @@ -96,6 +96,12 @@ export namespace BillableMetricRetrieveResponse { */ aggregation_type?: 'COUNT' | 'LATEST' | 'MAX' | 'SUM' | 'UNIQUE'; + /** + * RFC 3339 timestamp indicating when the billable metric was archived. If not + * provided, the billable metric is not archived. + */ + archived_at?: string; + custom_fields?: Record; /** @@ -146,6 +152,12 @@ export interface BillableMetricListResponse { */ aggregation_type?: 'COUNT' | 'LATEST' | 'MAX' | 'SUM' | 'UNIQUE'; + /** + * RFC 3339 timestamp indicating when the billable metric was archived. If not + * provided, the billable metric is not archived. + */ + archived_at?: string; + custom_fields?: Record; /** @@ -229,7 +241,12 @@ export interface BillableMetricRetrieveParams { billable_metric_id: string; } -export interface BillableMetricListParams extends CursorPageParams {} +export interface BillableMetricListParams extends CursorPageParams { + /** + * If true, the list of returned metrics will include archived metrics + */ + include_archived?: boolean; +} export interface BillableMetricArchiveParams { id: string; diff --git a/src/resources/customers/customers.ts b/src/resources/customers/customers.ts index 217c517..cc0ac2f 100644 --- a/src/resources/customers/customers.ts +++ b/src/resources/customers/customers.ts @@ -322,6 +322,12 @@ export interface CustomerListBillableMetricsResponse { */ aggregation_type?: 'COUNT' | 'LATEST' | 'MAX' | 'SUM' | 'UNIQUE'; + /** + * RFC 3339 timestamp indicating when the billable metric was archived. If not + * provided, the billable metric is not archived. + */ + archived_at?: string; + custom_fields?: Record; /** @@ -498,6 +504,11 @@ export interface CustomerListBillableMetricsParams extends CursorPageParams { */ customer_id: string; + /** + * Query param: If true, the list of returned metrics will include archived metrics + */ + include_archived?: boolean; + /** * Query param: If true, the list of metrics will be filtered to just ones that are * on the customer's current plan diff --git a/tests/api-resources/billable-metrics.test.ts b/tests/api-resources/billable-metrics.test.ts index 5247d5a..2ea4f50 100644 --- a/tests/api-resources/billable-metrics.test.ts +++ b/tests/api-resources/billable-metrics.test.ts @@ -92,7 +92,10 @@ describe('resource billableMetrics', () => { 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( - client.billableMetrics.list({ limit: 1, next_page: 'next_page' }, { path: '/_stainless_unknown_path' }), + client.billableMetrics.list( + { include_archived: true, limit: 1, next_page: 'next_page' }, + { path: '/_stainless_unknown_path' }, + ), ).rejects.toThrow(Metronome.NotFoundError); }); diff --git a/tests/api-resources/customers/customers.test.ts b/tests/api-resources/customers/customers.test.ts index 6db8043..a4dc080 100644 --- a/tests/api-resources/customers/customers.test.ts +++ b/tests/api-resources/customers/customers.test.ts @@ -119,6 +119,7 @@ describe('resource customers', () => { test('listBillableMetrics: required and optional params', async () => { const response = await client.customers.listBillableMetrics({ customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc', + include_archived: true, limit: 1, next_page: 'next_page', on_current_plan: true,