-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathevents.ts
More file actions
161 lines (123 loc) · 3.36 KB
/
Copy pathevents.ts
File metadata and controls
161 lines (123 loc) · 3.36 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../../core/resource';
import * as EventsAPI from './events';
import { APIPromise } from '../../core/api-promise';
import { RequestOptions } from '../../internal/request-options';
import { path } from '../../internal/utils/path';
/**
* Manage users, user attributes, events, and diagnostics for an application.
*/
export class Events extends APIResource {
/**
* Retrieves a single event by ID. The `application_id` query parameter is required
* for authorization. Requires users:read scope.
*/
retrieve(
eventID: string,
query: EventRetrieveParams,
options?: RequestOptions,
): APIPromise<EventRetrieveResponse> {
return this._client.get(path`/v2/users/events/${eventID}`, { query, ...options });
}
/**
* List User Events
*/
list(appUserID: string, query: EventListParams, options?: RequestOptions): APIPromise<EventListResponse> {
return this._client.get(path`/v2/users/${appUserID}/events`, { query, ...options });
}
}
export type JsonValue = string | number | boolean | null | Array<JsonValue> | unknown;
export interface EventRetrieveResponse {
/**
* Unique event identifier
*/
id: string;
/**
* Categorized event origin: 'subscription' for payment/billing events, 'sdk' for
* client SDK events
*/
event_source: 'subscription' | 'sdk';
/**
* Event name
*/
name: string;
properties: { [key: string]: JsonValue };
/**
* Human-readable source label for the event (e.g. integration name, SDK version)
*/
source: string;
/**
* ISO 8601 timestamp of when the event occurred
*/
timestamp: string;
app_version?: string | null;
debug?: JsonValue | null;
device_locale?: string | null;
headers?: string | null;
inserted_at?: string;
platform?: string | null;
}
export interface EventListResponse {
data: Array<EventListResponse.Data>;
has_more: boolean;
object: 'list';
total_count: number;
url: '/v2/users/events';
}
export namespace EventListResponse {
export interface Data {
/**
* Unique event identifier
*/
id: string;
/**
* Event name
*/
name: string;
properties: { [key: string]: EventsAPI.JsonValue };
/**
* Human-readable source label for the event (e.g. integration name, SDK version)
*/
source: string;
/**
* ISO 8601 timestamp of when the event occurred
*/
timestamp: string;
app_version?: string | null;
device_locale?: string | null;
headers?: string | null;
inserted_at?: string;
platform?: string | null;
}
}
export interface EventRetrieveParams {
/**
* Application ID
*/
application_id: string;
}
export interface EventListParams {
/**
* Application ID
*/
application_id: string;
event_group?: 'app' | 'sdk' | 'integration' | 'subscription' | 'overview' | 'all';
/**
* a string to be decoded into a number
*/
limit?: string;
/**
* a string to be decoded into a number
*/
offset?: string;
search_term?: string;
}
export declare namespace Events {
export {
type JsonValue as JsonValue,
type EventRetrieveResponse as EventRetrieveResponse,
type EventListResponse as EventListResponse,
type EventRetrieveParams as EventRetrieveParams,
type EventListParams as EventListParams,
};
}