Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored Aug 22, 2024
1 parent a9083b4 commit 8ae58d5
Show file tree
Hide file tree
Showing 11 changed files with 406 additions and 1,824 deletions.
12 changes: 11 additions & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,22 @@

Types:

- <code><a href="./src/resources/shared.ts">BaseUsageFilter</a></code>
- <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">Discount</a></code>
- <code><a href="./src/resources/shared.ts">EventTypeFilter</a></code>
- <code><a href="./src/resources/shared.ts">ID</a></code>
- <code><a href="./src/resources/shared.ts">Override</a></code>
- <code><a href="./src/resources/shared.ts">PropertyFilter</a></code>
- <code><a href="./src/resources/shared.ts">ProService</a></code>
- <code><a href="./src/resources/shared.ts">Rate</a></code>
- <code><a href="./src/resources/shared.ts">SchedulePointInTime</a></code>
- <code><a href="./src/resources/shared.ts">ScheduledCharge</a></code>
- <code><a href="./src/resources/shared.ts">ScheduleDuration</a></code>
- <code><a href="./src/resources/shared.ts">SchedulePointInTime</a></code>
- <code><a href="./src/resources/shared.ts">Tier</a></code>

# Alerts

Expand Down Expand Up @@ -299,6 +306,9 @@ Methods:

Types:

- <code><a href="./src/resources/contracts/products.ts">ProductListItemState</a></code>
- <code><a href="./src/resources/contracts/products.ts">QuantityConversion</a></code>
- <code><a href="./src/resources/contracts/products.ts">QuantityRounding</a></code>
- <code><a href="./src/resources/contracts/products.ts">ProductCreateResponse</a></code>
- <code><a href="./src/resources/contracts/products.ts">ProductRetrieveResponse</a></code>
- <code><a href="./src/resources/contracts/products.ts">ProductUpdateResponse</a></code>
Expand Down
9 changes: 8 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,15 +333,22 @@ export namespace Metronome {
export import ContractSetUsageFilterParams = API.ContractSetUsageFilterParams;
export import ContractUpdateEndDateParams = API.ContractUpdateEndDateParams;

export import BaseUsageFilter = API.BaseUsageFilter;
export import Commit = API.Commit;
export import ContractWithoutAmendments = API.ContractWithoutAmendments;
export import Credit = API.Credit;
export import CreditType = API.CreditType;
export import Discount = API.Discount;
export import EventTypeFilter = API.EventTypeFilter;
export import ID = API.ID;
export import Override = API.Override;
export import PropertyFilter = API.PropertyFilter;
export import ProService = API.ProService;
export import Rate = API.Rate;
export import SchedulePointInTime = API.SchedulePointInTime;
export import ScheduledCharge = API.ScheduledCharge;
export import ScheduleDuration = API.ScheduleDuration;
export import SchedulePointInTime = API.SchedulePointInTime;
export import Tier = API.Tier;
}

export default Metronome;
168 changes: 6 additions & 162 deletions src/resources/billable-metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export namespace BillableMetricRetrieveResponse {
/**
* An optional filtering rule to match the 'event_type' property of an event.
*/
event_type_filter?: Data.EventTypeFilter;
event_type_filter?: Shared.EventTypeFilter;

/**
* Property names that are used to group usage costs on an invoice. Each entry
Expand All @@ -118,65 +118,13 @@ export namespace BillableMetricRetrieveResponse {
* rule on an event property. All rules must pass for the event to match the
* billable metric.
*/
property_filters?: Array<Data.PropertyFilter>;
property_filters?: Array<Shared.PropertyFilter>;

/**
* The SQL query associated with the billable metric
*/
sql?: string;
}

export namespace Data {
/**
* An optional filtering rule to match the 'event_type' property of an event.
*/
export interface EventTypeFilter {
/**
* A list of event types that are explicitly included in the billable metric. If
* specified, only events of these types will match the billable metric. Must be
* non-empty if present.
*/
in_values?: Array<string>;

/**
* A list of event types that are explicitly excluded from the billable metric. If
* specified, events of these types will not match the billable metric. Must be
* non-empty if present.
*/
not_in_values?: Array<string>;
}

export interface PropertyFilter {
/**
* The name of the event property.
*/
name: string;

/**
* Determines whether the property must exist in the event. If true, only events
* with this property will pass the filter. If false, only events without this
* property will pass the filter. If null or omitted, the existence of the property
* is optional.
*/
exists?: boolean;

/**
* Specifies the allowed values for the property to match an event. An event will
* pass the filter only if its property value is included in this list. If
* undefined, all property values will pass the filter. Must be non-empty if
* present.
*/
in_values?: Array<string>;

/**
* Specifies the values that prevent an event from matching the filter. An event
* will not pass the filter if its property value is included in this list. If null
* or empty, all property values will pass the filter. Must be non-empty if
* present.
*/
not_in_values?: Array<string>;
}
}
}

export interface BillableMetricListResponse {
Expand Down Expand Up @@ -211,7 +159,7 @@ export interface BillableMetricListResponse {
/**
* An optional filtering rule to match the 'event_type' property of an event.
*/
event_type_filter?: BillableMetricListResponse.EventTypeFilter;
event_type_filter?: Shared.EventTypeFilter;

/**
* (DEPRECATED) use property_filters & event_type_filter instead
Expand All @@ -234,66 +182,14 @@ export interface BillableMetricListResponse {
* rule on an event property. All rules must pass for the event to match the
* billable metric.
*/
property_filters?: Array<BillableMetricListResponse.PropertyFilter>;
property_filters?: Array<Shared.PropertyFilter>;

/**
* The SQL query associated with the billable metric
*/
sql?: string;
}

export namespace BillableMetricListResponse {
/**
* An optional filtering rule to match the 'event_type' property of an event.
*/
export interface EventTypeFilter {
/**
* A list of event types that are explicitly included in the billable metric. If
* specified, only events of these types will match the billable metric. Must be
* non-empty if present.
*/
in_values?: Array<string>;

/**
* A list of event types that are explicitly excluded from the billable metric. If
* specified, events of these types will not match the billable metric. Must be
* non-empty if present.
*/
not_in_values?: Array<string>;
}

export interface PropertyFilter {
/**
* The name of the event property.
*/
name: string;

/**
* Determines whether the property must exist in the event. If true, only events
* with this property will pass the filter. If false, only events without this
* property will pass the filter. If null or omitted, the existence of the property
* is optional.
*/
exists?: boolean;

/**
* Specifies the allowed values for the property to match an event. An event will
* pass the filter only if its property value is included in this list. If
* undefined, all property values will pass the filter. Must be non-empty if
* present.
*/
in_values?: Array<string>;

/**
* Specifies the values that prevent an event from matching the filter. An event
* will not pass the filter if its property value is included in this list. If null
* or empty, all property values will pass the filter. Must be non-empty if
* present.
*/
not_in_values?: Array<string>;
}
}

export interface BillableMetricArchiveResponse {
data: Shared.ID;
}
Expand Down Expand Up @@ -324,7 +220,7 @@ export interface BillableMetricCreateParams {
/**
* An optional filtering rule to match the 'event_type' property of an event.
*/
event_type_filter?: BillableMetricCreateParams.EventTypeFilter;
event_type_filter?: Shared.EventTypeFilter;

/**
* Property names that are used to group usage costs on an invoice. Each entry
Expand All @@ -337,59 +233,7 @@ export interface BillableMetricCreateParams {
* rule on an event property. All rules must pass for the event to match the
* billable metric.
*/
property_filters?: Array<BillableMetricCreateParams.PropertyFilter>;
}

export namespace BillableMetricCreateParams {
/**
* An optional filtering rule to match the 'event_type' property of an event.
*/
export interface EventTypeFilter {
/**
* A list of event types that are explicitly included in the billable metric. If
* specified, only events of these types will match the billable metric. Must be
* non-empty if present.
*/
in_values?: Array<string>;

/**
* A list of event types that are explicitly excluded from the billable metric. If
* specified, events of these types will not match the billable metric. Must be
* non-empty if present.
*/
not_in_values?: Array<string>;
}

export interface PropertyFilter {
/**
* The name of the event property.
*/
name: string;

/**
* Determines whether the property must exist in the event. If true, only events
* with this property will pass the filter. If false, only events without this
* property will pass the filter. If null or omitted, the existence of the property
* is optional.
*/
exists?: boolean;

/**
* Specifies the allowed values for the property to match an event. An event will
* pass the filter only if its property value is included in this list. If
* undefined, all property values will pass the filter. Must be non-empty if
* present.
*/
in_values?: Array<string>;

/**
* Specifies the values that prevent an event from matching the filter. An event
* will not pass the filter if its property value is included in this list. If null
* or empty, all property values will pass the filter. Must be non-empty if
* present.
*/
not_in_values?: Array<string>;
}
property_filters?: Array<Shared.PropertyFilter>;
}

export interface BillableMetricListParams extends CursorPageParams {
Expand Down
Loading

0 comments on commit 8ae58d5

Please sign in to comment.