Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Sep 13, 2024
1 parent b305056 commit 96e2738
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 43 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: 90
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome%2Fmetronome-c23134402bb47d1637feabf3d4058720571d9d5d90253a11e2ea818b3add064a.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome%2Fmetronome-531ea40f0371507ecead2f5ed9911002dab5d2667ea32a43b66c7b70b30f8819.yml
49 changes: 12 additions & 37 deletions src/resources/dashboards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +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 billable metric group key overrides
*/
bm_group_key_overrides?: Array<DashboardGetEmbeddableURLParams.BmGroupKeyOverride>;

/**
* Optional list of colors to override
Expand All @@ -52,48 +53,22 @@ export interface DashboardGetEmbeddableURLParams {
}

export namespace DashboardGetEmbeddableURLParams {
export interface BmGroupKeyDisplayNameOverrides {
export interface BmGroupKeyOverride {
/**
* The new display name for the group key. e.g. "Tenant ID"
* The name of the billable metric group key.
*/
display_name?: string;
group_key_name: string;

/**
* The current name of the group key. e.g. "tenant_id"
* The display name for the billable metric group key
*/
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;
}
display_name?: string;

export namespace BmGroupKeyValuesDisplayNameOverrides {
/**
* An object containing the group key value and the new display name for the group
* key value.
* <key, value> pairs of the billable metric group key values and their display
* names. e.g. {"a": "Asia", "b": "Euro"}
*/
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;
}
value_display_names?: Record<string, unknown>;
}

export interface ColorOverride {
Expand Down
12 changes: 7 additions & 5 deletions tests/api-resources/dashboards.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ 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' },
},
bm_group_key_overrides: [
{
group_key_name: 'tenant_id',
display_name: 'Org ID',
value_display_names: { '48ecb18f358f': 'bar', e358f3ce242d: 'bar' },
},
],
color_overrides: [{ name: 'Gray_dark', value: '#ff0000' }],
dashboard_options: [
{ key: 'key', value: 'value' },
Expand Down

0 comments on commit 96e2738

Please sign in to comment.