Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored Oct 7, 2024
1 parent e9c7182 commit 401dbbb
Show file tree
Hide file tree
Showing 14 changed files with 52 additions and 41 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: 91
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome%2Fmetronome-a89210f56e000a978cd97348ab656503553f7a93d055561792d012c4a70cd5da.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome%2Fmetronome-4de9563f4ab2e7aa37e854d325c2166633d1e484d3bbaffeee3a98774f3b52ba.yml
2 changes: 1 addition & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Types:
- <code><a href="./src/resources/shared.ts">Commit</a></code>
- <code><a href="./src/resources/shared.ts">ContractWithoutAmendments</a></code>
- <code><a href="./src/resources/shared.ts">Credit</a></code>
- <code><a href="./src/resources/shared.ts">CreditType</a></code>
- <code><a href="./src/resources/shared.ts">CreditTypeData</a></code>
- <code><a href="./src/resources/shared.ts">Discount</a></code>
- <code><a href="./src/resources/shared.ts">EventTypeFilter</a></code>
- <code><a href="./src/resources/shared.ts">ID</a></code>
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ export namespace Metronome {
export import Commit = API.Commit;
export import ContractWithoutAmendments = API.ContractWithoutAmendments;
export import Credit = API.Credit;
export import CreditType = API.CreditType;
export import CreditTypeData = API.CreditTypeData;
export import Discount = API.Discount;
export import EventTypeFilter = API.EventTypeFilter;
export import ID = API.ID;
Expand Down
8 changes: 8 additions & 0 deletions src/resources/alerts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,15 @@ export namespace AlertCreateParams {
}

export interface AlertArchiveParams {
/**
* The Metronome ID of the alert
*/
id: string;

/**
* If true, resets the uniqueness key on this alert so it can be re-used
*/
release_uniqueness_key?: boolean;
}

export namespace Alerts {
Expand Down
2 changes: 1 addition & 1 deletion src/resources/contracts/contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ export namespace ContractRetrieveRateScheduleResponse {
| 'CUSTOM'
| 'custom';

credit_type?: Shared.CreditType;
credit_type?: Shared.CreditTypeData;

/**
* Commit rate proration configuration. Only valid for SUBSCRIPTION rate_type.
Expand Down
22 changes: 11 additions & 11 deletions src/resources/contracts/rate-cards/rate-cards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export namespace RateCardRetrieveResponse {

description?: string;

fiat_credit_type?: Shared.CreditType;
fiat_credit_type?: Shared.CreditTypeData;
}

export namespace Data {
Expand All @@ -121,7 +121,7 @@ export namespace RateCardRetrieveResponse {

created_by?: string;

credit_type?: Shared.CreditType;
credit_type?: Shared.CreditTypeData;

custom_rate?: Record<string, unknown>;

Expand Down Expand Up @@ -162,7 +162,7 @@ export namespace RateCardRetrieveResponse {
*/
commit_rate?: Update.CommitRate;

credit_type?: Shared.CreditType;
credit_type?: Shared.CreditTypeData;

custom_rate?: Record<string, unknown>;

Expand Down Expand Up @@ -196,7 +196,7 @@ export namespace RateCardRetrieveResponse {
| 'CUSTOM'
| 'custom';

credit_type?: Shared.CreditType;
credit_type?: Shared.CreditTypeData;

/**
* Commit rate proration configuration. Only valid for SUBSCRIPTION rate_type.
Expand Down Expand Up @@ -239,7 +239,7 @@ export namespace RateCardRetrieveResponse {
}

export interface CreditTypeConversion {
custom_credit_type: Shared.CreditType;
custom_credit_type: Shared.CreditTypeData;

fiat_per_custom_credit: string;
}
Expand Down Expand Up @@ -269,7 +269,7 @@ export interface RateCardListResponse {

description?: string;

fiat_credit_type?: Shared.CreditType;
fiat_credit_type?: Shared.CreditTypeData;
}

export namespace RateCardListResponse {
Expand All @@ -287,7 +287,7 @@ export namespace RateCardListResponse {

created_by?: string;

credit_type?: Shared.CreditType;
credit_type?: Shared.CreditTypeData;

custom_rate?: Record<string, unknown>;

Expand Down Expand Up @@ -328,7 +328,7 @@ export namespace RateCardListResponse {
*/
commit_rate?: Update.CommitRate;

credit_type?: Shared.CreditType;
credit_type?: Shared.CreditTypeData;

custom_rate?: Record<string, unknown>;

Expand Down Expand Up @@ -362,7 +362,7 @@ export namespace RateCardListResponse {
| 'CUSTOM'
| 'custom';

credit_type?: Shared.CreditType;
credit_type?: Shared.CreditTypeData;

/**
* Commit rate proration configuration. Only valid for SUBSCRIPTION rate_type.
Expand Down Expand Up @@ -405,7 +405,7 @@ export namespace RateCardListResponse {
}

export interface CreditTypeConversion {
custom_credit_type: Shared.CreditType;
custom_credit_type: Shared.CreditTypeData;

fiat_per_custom_credit: string;
}
Expand Down Expand Up @@ -462,7 +462,7 @@ export namespace RateCardRetrieveRateScheduleResponse {
| 'CUSTOM'
| 'custom';

credit_type?: Shared.CreditType;
credit_type?: Shared.CreditTypeData;

/**
* Commit rate proration configuration. Only valid for SUBSCRIPTION rate_type.
Expand Down
10 changes: 5 additions & 5 deletions src/resources/contracts/rate-cards/rates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export namespace RateListResponse {
| 'CUSTOM'
| 'custom';

credit_type?: Shared.CreditType;
credit_type?: Shared.CreditTypeData;

/**
* Commit rate proration configuration. Only valid for SUBSCRIPTION rate_type.
Expand Down Expand Up @@ -151,7 +151,7 @@ export namespace RateAddResponse {
*/
commit_rate?: Data.CommitRate;

credit_type?: Shared.CreditType;
credit_type?: Shared.CreditTypeData;

/**
* Only set for CUSTOM rate_type. This field is interpreted by custom rate
Expand Down Expand Up @@ -213,7 +213,7 @@ export namespace RateAddResponse {
| 'CUSTOM'
| 'custom';

credit_type?: Shared.CreditType;
credit_type?: Shared.CreditTypeData;

/**
* Commit rate proration configuration. Only valid for SUBSCRIPTION rate_type.
Expand Down Expand Up @@ -400,7 +400,7 @@ export namespace RateAddParams {
| 'CUSTOM'
| 'custom';

credit_type?: Shared.CreditType;
credit_type?: Shared.CreditTypeData;

/**
* Commit rate proration configuration. Only valid for SUBSCRIPTION rate_type.
Expand Down Expand Up @@ -535,7 +535,7 @@ export namespace RateAddManyParams {
| 'CUSTOM'
| 'custom';

credit_type?: Shared.CreditType;
credit_type?: Shared.CreditTypeData;

/**
* Commit rate proration configuration. Only valid for SUBSCRIPTION rate_type.
Expand Down
6 changes: 3 additions & 3 deletions src/resources/credit-grants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ export namespace CreditGrantListResponse {
/**
* the credit type for the amount granted
*/
credit_type: Shared.CreditType;
credit_type: Shared.CreditTypeData;
}

/**
Expand All @@ -279,7 +279,7 @@ export namespace CreditGrantListResponse {
/**
* the credit type for the amount paid
*/
credit_type: Shared.CreditType;
credit_type: Shared.CreditTypeData;
}

export interface Product {
Expand Down Expand Up @@ -316,7 +316,7 @@ export namespace CreditGrantListEntriesResponse {

export namespace Data {
export interface Ledger {
credit_type: Shared.CreditType;
credit_type: Shared.CreditTypeData;

/**
* the effective balances at the end of the specified time window
Expand Down
2 changes: 1 addition & 1 deletion src/resources/customers/alerts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export namespace CustomerAlert {
*/
credit_grant_type_filters?: Array<string>;

credit_type?: Shared.CreditType | null;
credit_type?: Shared.CreditTypeData | null;

/**
* A list of custom field filters for alert types that support advanced filtering
Expand Down
6 changes: 3 additions & 3 deletions src/resources/customers/invoices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class InvoiceListBreakdownsResponsesCursorPage extends CursorPage<Invoice
export interface Invoice {
id: string;

credit_type: Shared.CreditType;
credit_type: Shared.CreditTypeData;

customer_id: string;

Expand Down Expand Up @@ -150,7 +150,7 @@ export interface Invoice {

export namespace Invoice {
export interface LineItem {
credit_type: Shared.CreditType;
credit_type: Shared.CreditTypeData;

name: string;

Expand Down Expand Up @@ -421,7 +421,7 @@ export namespace Invoice {
}

export interface InvoiceAdjustment {
credit_type: Shared.CreditType;
credit_type: Shared.CreditTypeData;

name: string;

Expand Down
2 changes: 1 addition & 1 deletion src/resources/customers/plans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export namespace PlanListResponse {

amount_remaining: number;

credit_type: Shared.CreditType;
credit_type: Shared.CreditTypeData;
}
}
}
Expand Down
12 changes: 6 additions & 6 deletions src/resources/plans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,11 @@ export namespace PlanDetail {
export interface CreditGrant {
amount_granted: number;

amount_granted_credit_type: Shared.CreditType;
amount_granted_credit_type: Shared.CreditTypeData;

amount_paid: number;

amount_paid_credit_type: Shared.CreditType;
amount_paid_credit_type: Shared.CreditTypeData;

effective_duration: number;

Expand All @@ -117,7 +117,7 @@ export namespace PlanDetail {
}

export interface Minimum {
credit_type: Shared.CreditType;
credit_type: Shared.CreditTypeData;

name: string;

Expand All @@ -131,9 +131,9 @@ export namespace PlanDetail {
}

export interface OverageRate {
credit_type: Shared.CreditType;
credit_type: Shared.CreditTypeData;

fiat_credit_type: Shared.CreditType;
fiat_credit_type: Shared.CreditTypeData;

/**
* Used in price ramps. Indicates how many billing periods pass before the charge
Expand Down Expand Up @@ -164,7 +164,7 @@ export interface PlanListChargesResponse {

charge_type: 'usage' | 'fixed' | 'composite' | 'minimum' | 'seat';

credit_type: Shared.CreditType;
credit_type: Shared.CreditTypeData;

custom_fields: Record<string, string>;

Expand Down
12 changes: 6 additions & 6 deletions src/resources/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ export namespace Credit {
}
}

export interface CreditType {
export interface CreditTypeData {
id: string;

name: string;
Expand Down Expand Up @@ -574,7 +574,7 @@ export interface Override {

applicable_product_tags?: Array<string>;

credit_type?: CreditType;
credit_type?: CreditTypeData;

ending_before?: string;

Expand Down Expand Up @@ -644,7 +644,7 @@ export namespace Override {
export interface OverwriteRate {
rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'CUSTOM';

credit_type?: Shared.CreditType;
credit_type?: Shared.CreditTypeData;

/**
* Only set for CUSTOM rate_type. This field is interpreted by custom rate
Expand Down Expand Up @@ -747,7 +747,7 @@ export interface ProService {
export interface Rate {
rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'CUSTOM' | 'TIERED';

credit_type?: CreditType;
credit_type?: CreditTypeData;

/**
* Only set for CUSTOM rate_type. This field is interpreted by custom rate
Expand Down Expand Up @@ -821,7 +821,7 @@ export namespace ScheduledCharge {
export interface ScheduleDuration {
schedule_items: Array<ScheduleDuration.ScheduleItem>;

credit_type?: CreditType;
credit_type?: CreditTypeData;
}

export namespace ScheduleDuration {
Expand All @@ -837,7 +837,7 @@ export namespace ScheduleDuration {
}

export interface SchedulePointInTime {
credit_type?: CreditType;
credit_type?: CreditTypeData;

schedule_items?: Array<SchedulePointInTime.ScheduleItem>;
}
Expand Down
5 changes: 4 additions & 1 deletion tests/api-resources/alerts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ describe('resource alerts', () => {
});

test('archive: required and optional params', async () => {
const response = await client.alerts.archive({ id: '8deed800-1b7a-495d-a207-6c52bac54dc9' });
const response = await client.alerts.archive({
id: '8deed800-1b7a-495d-a207-6c52bac54dc9',
release_uniqueness_key: true,
});
});
});

0 comments on commit 401dbbb

Please sign in to comment.