diff --git a/.stats.yml b/.stats.yml index d7fe1f6..2983fba 100755 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 88 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome%2Fmetronome-2213de19fd79bd2188fb178888a30c39dbcacebd7b0693b47e293d118fba5228.yml +configured_endpoints: 90 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome%2Fmetronome-689348d45e1dedd9c2658451fce83ea94d995005f95e67b73f3b9ec8e30b0a93.yml diff --git a/api.md b/api.md index 9125d3b..1dc0dfb 100755 --- a/api.md +++ b/api.md @@ -258,7 +258,7 @@ Methods: - client.billableMetrics.create({ ...params }) -> BillableMetricCreateResponse - client.billableMetrics.retrieve(billableMetricId) -> BillableMetricRetrieveResponse -- client.billableMetrics.list(customerId, { ...params }) -> BillableMetricListResponsesCursorPage +- client.billableMetrics.list({ ...params }) -> BillableMetricListResponsesCursorPage - client.billableMetrics.archive({ ...params }) -> BillableMetricArchiveResponse # Services @@ -292,6 +292,7 @@ Types: - ContractListResponse - ContractAmendResponse - ContractArchiveResponse +- ContractCreateHistoricalInvoicesResponse - ContractListBalancesResponse - ContractRetrieveRateScheduleResponse - ContractScheduleProServicesInvoiceResponse @@ -305,6 +306,7 @@ Methods: - client.contracts.addManualBalanceEntry({ ...params }) -> void - client.contracts.amend({ ...params }) -> ContractAmendResponse - client.contracts.archive({ ...params }) -> ContractArchiveResponse +- client.contracts.createHistoricalInvoices({ ...params }) -> ContractCreateHistoricalInvoicesResponse - client.contracts.listBalances({ ...params }) -> ContractListBalancesResponse - client.contracts.retrieveRateSchedule({ ...params }) -> ContractRetrieveRateScheduleResponse - client.contracts.scheduleProServicesInvoice({ ...params }) -> ContractScheduleProServicesInvoiceResponse diff --git a/src/index.ts b/src/index.ts index 68ac4ae..f56e78a 100755 --- a/src/index.ts +++ b/src/index.ts @@ -322,6 +322,7 @@ export namespace Metronome { export import ContractListResponse = API.ContractListResponse; export import ContractAmendResponse = API.ContractAmendResponse; export import ContractArchiveResponse = API.ContractArchiveResponse; + export import ContractCreateHistoricalInvoicesResponse = API.ContractCreateHistoricalInvoicesResponse; export import ContractListBalancesResponse = API.ContractListBalancesResponse; export import ContractRetrieveRateScheduleResponse = API.ContractRetrieveRateScheduleResponse; export import ContractScheduleProServicesInvoiceResponse = API.ContractScheduleProServicesInvoiceResponse; @@ -332,6 +333,7 @@ export namespace Metronome { export import ContractAddManualBalanceEntryParams = API.ContractAddManualBalanceEntryParams; export import ContractAmendParams = API.ContractAmendParams; export import ContractArchiveParams = API.ContractArchiveParams; + export import ContractCreateHistoricalInvoicesParams = API.ContractCreateHistoricalInvoicesParams; export import ContractListBalancesParams = API.ContractListBalancesParams; export import ContractRetrieveRateScheduleParams = API.ContractRetrieveRateScheduleParams; export import ContractScheduleProServicesInvoiceParams = API.ContractScheduleProServicesInvoiceParams; diff --git a/src/resources/billable-metrics.ts b/src/resources/billable-metrics.ts index 1dc72c5..d488208 100755 --- a/src/resources/billable-metrics.ts +++ b/src/resources/billable-metrics.ts @@ -29,30 +29,26 @@ export class BillableMetrics extends APIResource { } /** - * Get all billable metrics for a given customer. + * List all billable metrics. */ list( - customerId: string, query?: BillableMetricListParams, options?: Core.RequestOptions, ): Core.PagePromise; list( - customerId: string, options?: Core.RequestOptions, ): Core.PagePromise; list( - customerId: string, query: BillableMetricListParams | Core.RequestOptions = {}, options?: Core.RequestOptions, ): Core.PagePromise { if (isRequestOptions(query)) { - return this.list(customerId, {}, query); + return this.list({}, query); } - return this._client.getAPIList( - `/customers/${customerId}/billable-metrics`, - BillableMetricListResponsesCursorPage, - { query, ...options }, - ); + return this._client.getAPIList('/billable-metrics', BillableMetricListResponsesCursorPage, { + query, + ...options, + }); } /** @@ -128,19 +124,15 @@ export namespace BillableMetricRetrieveResponse { } export interface BillableMetricListResponse { - id: string; - - name: string; - /** - * (DEPRECATED) use aggregation_type instead + * ID of the billable metric */ - aggregate?: string; + id: string; /** - * (DEPRECATED) use aggregation_key instead + * The display name of the billable metric. */ - aggregate_keys?: Array; + name: string; /** * A key that specifies which property of the event is used to aggregate data. This @@ -161,16 +153,6 @@ export interface BillableMetricListResponse { */ event_type_filter?: Shared.EventTypeFilter; - /** - * (DEPRECATED) use property_filters & event_type_filter instead - */ - filter?: Record; - - /** - * (DEPRECATED) use group_keys instead - */ - group_by?: Array; - /** * Property names that are used to group usage costs on an invoice. Each entry * represents a set of properties used to slice events into distinct buckets. @@ -236,13 +218,7 @@ export interface BillableMetricCreateParams { property_filters?: Array; } -export interface BillableMetricListParams extends CursorPageParams { - /** - * If true, the list of metrics will be filtered to just ones that are on the - * customer's current plan - */ - on_current_plan?: boolean; -} +export interface BillableMetricListParams extends CursorPageParams {} export interface BillableMetricArchiveParams { id: string; diff --git a/src/resources/contracts/contracts.ts b/src/resources/contracts/contracts.ts index 8887e7d..6955b51 100755 --- a/src/resources/contracts/contracts.ts +++ b/src/resources/contracts/contracts.ts @@ -69,6 +69,16 @@ export class Contracts extends APIResource { return this._client.post('/contracts/archive', { body, ...options }); } + /** + * Creates historical usage invoices for a contract + */ + createHistoricalInvoices( + body: ContractCreateHistoricalInvoicesParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return this._client.post('/contracts/createHistoricalInvoices', { body, ...options }); + } + /** * List balances (commits and credits). */ @@ -379,6 +389,10 @@ export interface ContractArchiveResponse { data: Shared.ID; } +export interface ContractCreateHistoricalInvoicesResponse { + data: Array; +} + export interface ContractListBalancesResponse { data: Array; @@ -2120,6 +2134,67 @@ export interface ContractArchiveParams { void_invoices: boolean; } +export interface ContractCreateHistoricalInvoicesParams { + invoices: Array; + + preview: boolean; +} + +export namespace ContractCreateHistoricalInvoicesParams { + export interface Invoice { + contract_id: string; + + credit_type_id: string; + + customer_id: string; + + exclusive_end_date: string; + + inclusive_start_date: string; + + issue_date: string; + + usage_line_items: Array; + + /** + * This field's availability is dependent on your client's configuration. + */ + billable_status?: 'billable' | 'unbillable'; + + breakdown_granularity?: 'hour' | 'day' | 'HOUR' | 'DAY' | 'Hour' | 'Day'; + + custom_fields?: Record; + } + + export namespace Invoice { + export interface UsageLineItem { + exclusive_end_date: string; + + inclusive_start_date: string; + + product_id: string; + + presentation_group_values?: Record; + + pricing_group_values?: Record; + + quantity?: number; + + subtotals_with_quantity?: Array; + } + + export namespace UsageLineItem { + export interface SubtotalsWithQuantity { + exclusive_end_date: string; + + inclusive_start_date: string; + + quantity: number; + } + } + } +} + export interface ContractListBalancesParams { customer_id: string; @@ -2332,6 +2407,7 @@ export namespace Contracts { export import ContractListResponse = ContractsAPI.ContractListResponse; export import ContractAmendResponse = ContractsAPI.ContractAmendResponse; export import ContractArchiveResponse = ContractsAPI.ContractArchiveResponse; + export import ContractCreateHistoricalInvoicesResponse = ContractsAPI.ContractCreateHistoricalInvoicesResponse; export import ContractListBalancesResponse = ContractsAPI.ContractListBalancesResponse; export import ContractRetrieveRateScheduleResponse = ContractsAPI.ContractRetrieveRateScheduleResponse; export import ContractScheduleProServicesInvoiceResponse = ContractsAPI.ContractScheduleProServicesInvoiceResponse; @@ -2342,6 +2418,7 @@ export namespace Contracts { export import ContractAddManualBalanceEntryParams = ContractsAPI.ContractAddManualBalanceEntryParams; export import ContractAmendParams = ContractsAPI.ContractAmendParams; export import ContractArchiveParams = ContractsAPI.ContractArchiveParams; + export import ContractCreateHistoricalInvoicesParams = ContractsAPI.ContractCreateHistoricalInvoicesParams; export import ContractListBalancesParams = ContractsAPI.ContractListBalancesParams; export import ContractRetrieveRateScheduleParams = ContractsAPI.ContractRetrieveRateScheduleParams; export import ContractScheduleProServicesInvoiceParams = ContractsAPI.ContractScheduleProServicesInvoiceParams; diff --git a/src/resources/contracts/index.ts b/src/resources/contracts/index.ts index 210eb28..79ed1e8 100755 --- a/src/resources/contracts/index.ts +++ b/src/resources/contracts/index.ts @@ -6,6 +6,7 @@ export { ContractListResponse, ContractAmendResponse, ContractArchiveResponse, + ContractCreateHistoricalInvoicesResponse, ContractListBalancesResponse, ContractRetrieveRateScheduleResponse, ContractScheduleProServicesInvoiceResponse, @@ -16,6 +17,7 @@ export { ContractAddManualBalanceEntryParams, ContractAmendParams, ContractArchiveParams, + ContractCreateHistoricalInvoicesParams, ContractListBalancesParams, ContractRetrieveRateScheduleParams, ContractScheduleProServicesInvoiceParams, diff --git a/src/resources/customers/invoices.ts b/src/resources/customers/invoices.ts index 503c1e8..7c65c85 100755 --- a/src/resources/customers/invoices.ts +++ b/src/resources/customers/invoices.ts @@ -208,6 +208,13 @@ export namespace Invoice { */ is_prorated?: boolean; + /** + * only present for contract invoices and when the include_list_prices query + * parameter is set to true. This will include the list rate for the charge if + * applicable. Only present for usage and subscription line items. + */ + list_price?: Shared.Rate; + metadata?: string; /** diff --git a/src/resources/dashboards.ts b/src/resources/dashboards.ts index 5754fd2..7687cf8 100755 --- a/src/resources/dashboards.ts +++ b/src/resources/dashboards.ts @@ -36,6 +36,10 @@ export interface DashboardGetEmbeddableURLParams { */ dashboard: 'invoices' | 'usage' | 'credits'; + bm_group_key_display_name_overrides?: DashboardGetEmbeddableURLParams.BmGroupKeyDisplayNameOverrides; + + bm_group_key_values_display_name_overrides?: DashboardGetEmbeddableURLParams.BmGroupKeyValuesDisplayNameOverrides; + /** * Optional list of colors to override */ @@ -48,6 +52,50 @@ export interface DashboardGetEmbeddableURLParams { } export namespace DashboardGetEmbeddableURLParams { + export interface BmGroupKeyDisplayNameOverrides { + /** + * The new display name for the group key. e.g. "Tenant ID" + */ + display_name?: string; + + /** + * The current name of the group key. e.g. "tenant_id" + */ + group_key_name?: string; + } + + export interface BmGroupKeyValuesDisplayNameOverrides { + /** + * The actual value of the group key. e.g. "123-xyz-abc". If group key is not used, + * it is the BM's name. + */ + group_key_name?: string; + + /** + * An object containing the group key value and the new display name for the group + * key value. + */ + value_display_name?: BmGroupKeyValuesDisplayNameOverrides.ValueDisplayName; + } + + export namespace BmGroupKeyValuesDisplayNameOverrides { + /** + * An object containing the group key value and the new display name for the group + * key value. + */ + export interface ValueDisplayName { + /** + * The new display name for the group key value. e.g. "EU-Cluster-A" + */ + display_name?: string; + + /** + * The actual value of the group key. e.g. "123-xyz-abc" + */ + group_key_value?: string; + } + } + export interface ColorOverride { /** * The color to override diff --git a/src/resources/index.ts b/src/resources/index.ts index 75311d4..151b6b3 100755 --- a/src/resources/index.ts +++ b/src/resources/index.ts @@ -31,6 +31,7 @@ export { ContractListResponse, ContractAmendResponse, ContractArchiveResponse, + ContractCreateHistoricalInvoicesResponse, ContractListBalancesResponse, ContractRetrieveRateScheduleResponse, ContractScheduleProServicesInvoiceResponse, @@ -41,6 +42,7 @@ export { ContractAddManualBalanceEntryParams, ContractAmendParams, ContractArchiveParams, + ContractCreateHistoricalInvoicesParams, ContractListBalancesParams, ContractRetrieveRateScheduleParams, ContractScheduleProServicesInvoiceParams, diff --git a/tests/api-resources/billable-metrics.test.ts b/tests/api-resources/billable-metrics.test.ts index 18acdd0..1b9c47c 100755 --- a/tests/api-resources/billable-metrics.test.ts +++ b/tests/api-resources/billable-metrics.test.ts @@ -72,7 +72,7 @@ describe('resource billableMetrics', () => { }); test('list', async () => { - const responsePromise = client.billableMetrics.list('d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc'); + const responsePromise = client.billableMetrics.list(); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -84,21 +84,15 @@ describe('resource billableMetrics', () => { test('list: request options instead of 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('d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc', { - path: '/_stainless_unknown_path', - }), - ).rejects.toThrow(Metronome.NotFoundError); + await expect(client.billableMetrics.list({ path: '/_stainless_unknown_path' })).rejects.toThrow( + Metronome.NotFoundError, + ); }); 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( - 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc', - { limit: 1, next_page: 'next_page', on_current_plan: true }, - { path: '/_stainless_unknown_path' }, - ), + client.billableMetrics.list({ limit: 1, next_page: 'next_page' }, { path: '/_stainless_unknown_path' }), ).rejects.toThrow(Metronome.NotFoundError); }); diff --git a/tests/api-resources/contracts/contracts.test.ts b/tests/api-resources/contracts/contracts.test.ts index 31ee37c..3ed3dd2 100755 --- a/tests/api-resources/contracts/contracts.test.ts +++ b/tests/api-resources/contracts/contracts.test.ts @@ -1465,6 +1465,368 @@ describe('resource contracts', () => { }); }); + test('createHistoricalInvoices: only required params', async () => { + const responsePromise = client.contracts.createHistoricalInvoices({ + invoices: [ + { + contract_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + credit_type_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + customer_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + exclusive_end_date: '2019-12-27T18:11:19.117Z', + inclusive_start_date: '2019-12-27T18:11:19.117Z', + issue_date: '2019-12-27T18:11:19.117Z', + usage_line_items: [ + { + exclusive_end_date: '2019-12-27T18:11:19.117Z', + inclusive_start_date: '2019-12-27T18:11:19.117Z', + product_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + }, + { + exclusive_end_date: '2019-12-27T18:11:19.117Z', + inclusive_start_date: '2019-12-27T18:11:19.117Z', + product_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + }, + { + exclusive_end_date: '2019-12-27T18:11:19.117Z', + inclusive_start_date: '2019-12-27T18:11:19.117Z', + product_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + }, + ], + }, + { + contract_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + credit_type_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + customer_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + exclusive_end_date: '2019-12-27T18:11:19.117Z', + inclusive_start_date: '2019-12-27T18:11:19.117Z', + issue_date: '2019-12-27T18:11:19.117Z', + usage_line_items: [ + { + exclusive_end_date: '2019-12-27T18:11:19.117Z', + inclusive_start_date: '2019-12-27T18:11:19.117Z', + product_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + }, + { + exclusive_end_date: '2019-12-27T18:11:19.117Z', + inclusive_start_date: '2019-12-27T18:11:19.117Z', + product_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + }, + { + exclusive_end_date: '2019-12-27T18:11:19.117Z', + inclusive_start_date: '2019-12-27T18:11:19.117Z', + product_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + }, + ], + }, + { + contract_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + credit_type_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + customer_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + exclusive_end_date: '2019-12-27T18:11:19.117Z', + inclusive_start_date: '2019-12-27T18:11:19.117Z', + issue_date: '2019-12-27T18:11:19.117Z', + usage_line_items: [ + { + exclusive_end_date: '2019-12-27T18:11:19.117Z', + inclusive_start_date: '2019-12-27T18:11:19.117Z', + product_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + }, + { + exclusive_end_date: '2019-12-27T18:11:19.117Z', + inclusive_start_date: '2019-12-27T18:11:19.117Z', + product_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + }, + { + exclusive_end_date: '2019-12-27T18:11:19.117Z', + inclusive_start_date: '2019-12-27T18:11:19.117Z', + product_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + }, + ], + }, + ], + preview: true, + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('createHistoricalInvoices: required and optional params', async () => { + const response = await client.contracts.createHistoricalInvoices({ + invoices: [ + { + contract_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + credit_type_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + customer_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + exclusive_end_date: '2019-12-27T18:11:19.117Z', + inclusive_start_date: '2019-12-27T18:11:19.117Z', + issue_date: '2019-12-27T18:11:19.117Z', + usage_line_items: [ + { + exclusive_end_date: '2019-12-27T18:11:19.117Z', + inclusive_start_date: '2019-12-27T18:11:19.117Z', + product_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + presentation_group_values: { foo: 'string' }, + pricing_group_values: { foo: 'string' }, + quantity: 0, + subtotals_with_quantity: [ + { + exclusive_end_date: '2019-12-27T18:11:19.117Z', + inclusive_start_date: '2019-12-27T18:11:19.117Z', + quantity: 0, + }, + { + exclusive_end_date: '2019-12-27T18:11:19.117Z', + inclusive_start_date: '2019-12-27T18:11:19.117Z', + quantity: 0, + }, + { + exclusive_end_date: '2019-12-27T18:11:19.117Z', + inclusive_start_date: '2019-12-27T18:11:19.117Z', + quantity: 0, + }, + ], + }, + { + exclusive_end_date: '2019-12-27T18:11:19.117Z', + inclusive_start_date: '2019-12-27T18:11:19.117Z', + product_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + presentation_group_values: { foo: 'string' }, + pricing_group_values: { foo: 'string' }, + quantity: 0, + subtotals_with_quantity: [ + { + exclusive_end_date: '2019-12-27T18:11:19.117Z', + inclusive_start_date: '2019-12-27T18:11:19.117Z', + quantity: 0, + }, + { + exclusive_end_date: '2019-12-27T18:11:19.117Z', + inclusive_start_date: '2019-12-27T18:11:19.117Z', + quantity: 0, + }, + { + exclusive_end_date: '2019-12-27T18:11:19.117Z', + inclusive_start_date: '2019-12-27T18:11:19.117Z', + quantity: 0, + }, + ], + }, + { + exclusive_end_date: '2019-12-27T18:11:19.117Z', + inclusive_start_date: '2019-12-27T18:11:19.117Z', + product_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + presentation_group_values: { foo: 'string' }, + pricing_group_values: { foo: 'string' }, + quantity: 0, + subtotals_with_quantity: [ + { + exclusive_end_date: '2019-12-27T18:11:19.117Z', + inclusive_start_date: '2019-12-27T18:11:19.117Z', + quantity: 0, + }, + { + exclusive_end_date: '2019-12-27T18:11:19.117Z', + inclusive_start_date: '2019-12-27T18:11:19.117Z', + quantity: 0, + }, + { + exclusive_end_date: '2019-12-27T18:11:19.117Z', + inclusive_start_date: '2019-12-27T18:11:19.117Z', + quantity: 0, + }, + ], + }, + ], + billable_status: 'billable', + breakdown_granularity: 'hour', + custom_fields: { foo: 'string' }, + }, + { + contract_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + credit_type_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + customer_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + exclusive_end_date: '2019-12-27T18:11:19.117Z', + inclusive_start_date: '2019-12-27T18:11:19.117Z', + issue_date: '2019-12-27T18:11:19.117Z', + usage_line_items: [ + { + exclusive_end_date: '2019-12-27T18:11:19.117Z', + inclusive_start_date: '2019-12-27T18:11:19.117Z', + product_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + presentation_group_values: { foo: 'string' }, + pricing_group_values: { foo: 'string' }, + quantity: 0, + subtotals_with_quantity: [ + { + exclusive_end_date: '2019-12-27T18:11:19.117Z', + inclusive_start_date: '2019-12-27T18:11:19.117Z', + quantity: 0, + }, + { + exclusive_end_date: '2019-12-27T18:11:19.117Z', + inclusive_start_date: '2019-12-27T18:11:19.117Z', + quantity: 0, + }, + { + exclusive_end_date: '2019-12-27T18:11:19.117Z', + inclusive_start_date: '2019-12-27T18:11:19.117Z', + quantity: 0, + }, + ], + }, + { + exclusive_end_date: '2019-12-27T18:11:19.117Z', + inclusive_start_date: '2019-12-27T18:11:19.117Z', + product_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + presentation_group_values: { foo: 'string' }, + pricing_group_values: { foo: 'string' }, + quantity: 0, + subtotals_with_quantity: [ + { + exclusive_end_date: '2019-12-27T18:11:19.117Z', + inclusive_start_date: '2019-12-27T18:11:19.117Z', + quantity: 0, + }, + { + exclusive_end_date: '2019-12-27T18:11:19.117Z', + inclusive_start_date: '2019-12-27T18:11:19.117Z', + quantity: 0, + }, + { + exclusive_end_date: '2019-12-27T18:11:19.117Z', + inclusive_start_date: '2019-12-27T18:11:19.117Z', + quantity: 0, + }, + ], + }, + { + exclusive_end_date: '2019-12-27T18:11:19.117Z', + inclusive_start_date: '2019-12-27T18:11:19.117Z', + product_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + presentation_group_values: { foo: 'string' }, + pricing_group_values: { foo: 'string' }, + quantity: 0, + subtotals_with_quantity: [ + { + exclusive_end_date: '2019-12-27T18:11:19.117Z', + inclusive_start_date: '2019-12-27T18:11:19.117Z', + quantity: 0, + }, + { + exclusive_end_date: '2019-12-27T18:11:19.117Z', + inclusive_start_date: '2019-12-27T18:11:19.117Z', + quantity: 0, + }, + { + exclusive_end_date: '2019-12-27T18:11:19.117Z', + inclusive_start_date: '2019-12-27T18:11:19.117Z', + quantity: 0, + }, + ], + }, + ], + billable_status: 'billable', + breakdown_granularity: 'hour', + custom_fields: { foo: 'string' }, + }, + { + contract_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + credit_type_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + customer_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + exclusive_end_date: '2019-12-27T18:11:19.117Z', + inclusive_start_date: '2019-12-27T18:11:19.117Z', + issue_date: '2019-12-27T18:11:19.117Z', + usage_line_items: [ + { + exclusive_end_date: '2019-12-27T18:11:19.117Z', + inclusive_start_date: '2019-12-27T18:11:19.117Z', + product_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + presentation_group_values: { foo: 'string' }, + pricing_group_values: { foo: 'string' }, + quantity: 0, + subtotals_with_quantity: [ + { + exclusive_end_date: '2019-12-27T18:11:19.117Z', + inclusive_start_date: '2019-12-27T18:11:19.117Z', + quantity: 0, + }, + { + exclusive_end_date: '2019-12-27T18:11:19.117Z', + inclusive_start_date: '2019-12-27T18:11:19.117Z', + quantity: 0, + }, + { + exclusive_end_date: '2019-12-27T18:11:19.117Z', + inclusive_start_date: '2019-12-27T18:11:19.117Z', + quantity: 0, + }, + ], + }, + { + exclusive_end_date: '2019-12-27T18:11:19.117Z', + inclusive_start_date: '2019-12-27T18:11:19.117Z', + product_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + presentation_group_values: { foo: 'string' }, + pricing_group_values: { foo: 'string' }, + quantity: 0, + subtotals_with_quantity: [ + { + exclusive_end_date: '2019-12-27T18:11:19.117Z', + inclusive_start_date: '2019-12-27T18:11:19.117Z', + quantity: 0, + }, + { + exclusive_end_date: '2019-12-27T18:11:19.117Z', + inclusive_start_date: '2019-12-27T18:11:19.117Z', + quantity: 0, + }, + { + exclusive_end_date: '2019-12-27T18:11:19.117Z', + inclusive_start_date: '2019-12-27T18:11:19.117Z', + quantity: 0, + }, + ], + }, + { + exclusive_end_date: '2019-12-27T18:11:19.117Z', + inclusive_start_date: '2019-12-27T18:11:19.117Z', + product_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + presentation_group_values: { foo: 'string' }, + pricing_group_values: { foo: 'string' }, + quantity: 0, + subtotals_with_quantity: [ + { + exclusive_end_date: '2019-12-27T18:11:19.117Z', + inclusive_start_date: '2019-12-27T18:11:19.117Z', + quantity: 0, + }, + { + exclusive_end_date: '2019-12-27T18:11:19.117Z', + inclusive_start_date: '2019-12-27T18:11:19.117Z', + quantity: 0, + }, + { + exclusive_end_date: '2019-12-27T18:11:19.117Z', + inclusive_start_date: '2019-12-27T18:11:19.117Z', + quantity: 0, + }, + ], + }, + ], + billable_status: 'billable', + breakdown_granularity: 'hour', + custom_fields: { foo: 'string' }, + }, + ], + preview: true, + }); + }); + test('listBalances: only required params', async () => { const responsePromise = client.contracts.listBalances({ customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d', diff --git a/tests/api-resources/dashboards.test.ts b/tests/api-resources/dashboards.test.ts index 72af3df..22037eb 100755 --- a/tests/api-resources/dashboards.test.ts +++ b/tests/api-resources/dashboards.test.ts @@ -27,6 +27,11 @@ describe('resource dashboards', () => { const response = await client.dashboards.getEmbeddableURL({ customer_id: '4db51251-61de-4bfe-b9ce-495e244f3491', dashboard: 'invoices', + bm_group_key_display_name_overrides: { display_name: 'display_name', group_key_name: 'group_key_name' }, + bm_group_key_values_display_name_overrides: { + group_key_name: 'group_key_name', + value_display_name: { display_name: 'display_name', group_key_value: 'group_key_value' }, + }, color_overrides: [{ name: 'Gray_dark', value: '#ff0000' }], dashboard_options: [ { key: 'key', value: 'value' },