File size: 1,342 Bytes
1477a90
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Code generated by @openmeter/typespec-typescript. DO NOT EDIT.

import { z } from 'zod'
import * as schemas from '../schemas.js'
import type { AcceptDateStrings } from '../../lib/wire.js'
import type {
  CursorPaginationQueryPage,
  EventInput,
  IngestedEventPaginatedResponse,
  ListEventsParamsFilter,
  SortQueryInput,
} from '../types.js'

export interface ListMeteringEventsQuery {
  page?: CursorPaginationQueryPage
  /**
   * Filter events returned in the response.
   *
   * To filter events by subject add the following query param:
   * filter[subject][eq]=customer-1
   */
  filter?: ListEventsParamsFilter
  /**
   * Sort events returned in the response. Supported sort attributes are:
   *
   * - `time` (default)
   * - `ingested_at`
   * - `stored_at`
   *
   * When omitted, events are sorted by `time desc` (most recent first). When a sort
   * field is provided without a suffix, it sorts descending. Append the `asc` suffix
   * to sort ascending, or the `desc` suffix to sort descending.
   */
  sort?: SortQueryInput
}

export type ListMeteringEventsRequest =
  AcceptDateStrings<ListMeteringEventsQuery>
export type ListMeteringEventsResponse = IngestedEventPaginatedResponse

export type IngestMeteringEventsRequest = AcceptDateStrings<
  EventInput | EventInput[]
>
export type IngestMeteringEventsResponse = void