Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Jul 1, 2024
1 parent ca6a6b2 commit a028087
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 4 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: 48
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome%2Fmetronome-1ba87fe3b31769922c40c192fab50b9bdda6518303b16c4c1821ea8ecefb5def.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome%2Fmetronome-4065131979feacf59598b6266ddaca7f6a2177203dd04a98be28ed2310cd359d.yml
7 changes: 7 additions & 0 deletions src/resources/alerts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ export interface AlertCreateParams {
*/
billable_metric_id?: string;

/**
* An array of strings, representing a way to filter the credit grant this alert
* applies to, by looking at the credit_grant_type field on the credit grant. This
* field is only defined for CreditPercentage and CreditBalance alerts
*/
credit_grant_type_filters?: Array<string>;

credit_type_id?: string;

/**
Expand Down
7 changes: 7 additions & 0 deletions src/resources/customers/alerts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@ export namespace CustomerAlert {
*/
updated_at: string;

/**
* An array of strings, representing a way to filter the credit grant this alert
* applies to, by looking at the credit_grant_type field on the credit grant. This
* field is only defined for CreditPercentage and CreditBalance alerts
*/
credit_grant_type_filters?: Array<string>;

credit_type?: Shared.CreditType | null;

/**
Expand Down
10 changes: 10 additions & 0 deletions src/resources/customers/invoices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,12 +298,22 @@ export namespace Invoice {

credit_grant_id?: string;

/**
* The end date for the charge (for seats charges only).
*/
end_date?: string;

/**
* the unit price for this charge, present only if the charge is not tiered and the
* quantity is nonzero
*/
price?: number;

/**
* The start date for the charge (for seats charges only).
*/
start_date?: string;

tiers?: Array<SubLineItem.Tier>;
}

Expand Down
1 change: 1 addition & 0 deletions tests/api-resources/alerts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ describe('resource alerts', () => {
name: '$100 spend threshold reached',
threshold: 10000,
billable_metric_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
credit_grant_type_filters: ['enterprise'],
credit_type_id: '2714e483-4ff1-48e4-9e25-ac732e8f24f2',
custom_field_filters: [
{ entity: 'Contract', key: 'string', value: 'string' },
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3033,9 +3033,9 @@ pure-rand@^6.0.0:
integrity sha512-LA0Y9kxMYv47GIPJy6MI84fqTd2HmYZI83W/kM/SkKfDlajnZYfmXFTxkbY+xSBPkLJxltMa9hIkmdc29eguMA==

qs@^6.10.3:
version "6.12.1"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.12.1.tgz#39422111ca7cbdb70425541cba20c7d7b216599a"
integrity sha512-zWmv4RSuB9r2mYQw3zxQuHWeU+42aKi1wWig/j4ele4ygELZ7PEO6MM7rim9oAQH2A5MWfsAVf/jPvTPgCbvUQ==
version "6.12.2"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.12.2.tgz#5443b587f3bf73ac68968de491e5b25bafe04478"
integrity sha512-x+NLUpx9SYrcwXtX7ob1gnkSems4i/mGZX5SlYxwIau6RrUSODO89TR/XDGGpn5RPWSYIB+aSfuSlV5+CmbTBg==
dependencies:
side-channel "^1.0.6"

Expand Down

0 comments on commit a028087

Please sign in to comment.