|
| 1 | +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. |
| 2 | + |
| 3 | +import { APIResource } from '../../resource'; |
| 4 | +import { isRequestOptions } from '../../core'; |
| 5 | +import * as Core from '../../core'; |
| 6 | +import * as AxonsAPI from './axons'; |
| 7 | + |
| 8 | +export class Events extends APIResource { |
| 9 | + /** |
| 10 | + * [Beta] List events from an axon's event stream, ordered by sequence descending. |
| 11 | + */ |
| 12 | + list( |
| 13 | + id: string, |
| 14 | + query?: EventListParams, |
| 15 | + options?: Core.RequestOptions, |
| 16 | + ): Core.APIPromise<AxonEventListView>; |
| 17 | + list(id: string, options?: Core.RequestOptions): Core.APIPromise<AxonEventListView>; |
| 18 | + list( |
| 19 | + id: string, |
| 20 | + query: EventListParams | Core.RequestOptions = {}, |
| 21 | + options?: Core.RequestOptions, |
| 22 | + ): Core.APIPromise<AxonEventListView> { |
| 23 | + if (isRequestOptions(query)) { |
| 24 | + return this.list(id, {}, query); |
| 25 | + } |
| 26 | + return this._client.get(`/v1/axons/${id}/events`, { query, ...options }); |
| 27 | + } |
| 28 | +} |
| 29 | + |
| 30 | +export interface AxonEventListView { |
| 31 | + /** |
| 32 | + * List of axon events. |
| 33 | + */ |
| 34 | + events: Array<AxonsAPI.AxonEventView>; |
| 35 | + |
| 36 | + has_more: boolean; |
| 37 | + |
| 38 | + total_count?: number | null; |
| 39 | +} |
| 40 | + |
| 41 | +export interface EventListParams { |
| 42 | + /** |
| 43 | + * If true (default), includes total_count in the response. Set to false to skip |
| 44 | + * the count query for better performance on large datasets. |
| 45 | + */ |
| 46 | + include_total_count?: boolean; |
| 47 | + |
| 48 | + /** |
| 49 | + * The limit of items to return. Default is 20. Max is 5000. |
| 50 | + */ |
| 51 | + limit?: number; |
| 52 | + |
| 53 | + /** |
| 54 | + * Load the next page of data starting after the item with the given ID. |
| 55 | + */ |
| 56 | + starting_after?: string; |
| 57 | +} |
| 58 | + |
| 59 | +export declare namespace Events { |
| 60 | + export { type AxonEventListView as AxonEventListView, type EventListParams as EventListParams }; |
| 61 | +} |
0 commit comments