-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathend-users.ts
More file actions
216 lines (183 loc) · 5.5 KB
/
end-users.ts
File metadata and controls
216 lines (183 loc) · 5.5 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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../resource';
import * as Core from '../core';
export class EndUsers extends APIResource {
/**
* Creates an EndUser.
*/
create(body: EndUserCreateParams, options?: Core.RequestOptions): Core.APIPromise<EndUser> {
return this._client.post('/end-users', { body, ...options });
}
/**
* Retrieves an EndUser object.
*/
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<EndUser> {
return this._client.get(`/end-users/${id}`, options);
}
/**
* Returns a list of your EndUsers.
*/
list(options?: Core.RequestOptions): Core.APIPromise<EndUserListResponse> {
return this._client.get('/end-users', options);
}
/**
* Permanently deletes an EndUser object and all of its connections.
*/
delete(id: string, options?: Core.RequestOptions): Core.APIPromise<EndUserDeleteResponse> {
return this._client.delete(`/end-users/${id}`, options);
}
/**
* Sends a request directly to the specified integration connection (e.g.,
* QuickBooks Desktop) on behalf of the end-user.
*/
passthrough(
id: string,
integrationSlug: 'quickbooks_desktop',
body: EndUserPassthroughParams,
options?: Core.RequestOptions,
): Core.APIPromise<EndUserPassthroughResponse> {
return this._client.post(`/end-users/${id}/passthrough/${integrationSlug}`, { body, ...options });
}
/**
* Checks whether the specified IntegrationConnection can connect and process
* requests end-to-end. This is useful for showing a "connection status" indicator
* in your app.
*/
ping(
id: string,
integrationSlug: 'quickbooks_desktop',
options?: Core.RequestOptions,
): Core.APIPromise<EndUserPingResponse> {
return this._client.get(`/end-users/${id}/ping/${integrationSlug}`, options);
}
}
export interface EndUser {
/**
* The unique identifier for this EndUser. You must save this value to your
* database because it is how you identify which of your users to receive your API
* requests.
*/
id: string;
/**
* The EndUser's company name that will be shown elsewhere in Conductor.
*/
companyName: string;
/**
* The date and time when this EndUser record was created.
*/
createdAt: string;
/**
* The EndUser's email address for identification purposes.
*/
email: string;
/**
* The EndUser's IntegrationConnections.
*/
integrationConnections: Array<EndUser.IntegrationConnection>;
/**
* The type of object. This value is always `"end_user"`.
*/
objectType: 'end_user';
/**
* The EndUser's unique identifier from your system. Maps users between your
* database and Conductor.
*/
sourceId: string;
}
export namespace EndUser {
export interface IntegrationConnection {
/**
* The unique identifier for this IntegrationConnection.
*/
id: string;
/**
* The date and time when this IntegrationConnection record was created.
*/
createdAt: string;
/**
* The identifier of the third-party platform to integrate.
*/
integrationSlug: 'quickbooks_desktop';
/**
* The date and time of your last API request to this IntegrationConnection.
*/
lastRequestAt: string | null;
/**
* The date and time of your last _successful_ API request to this
* IntegrationConnection. A successful request means the integration fully
* processed and returned a response without any errors end-to-end.
*/
lastSuccessfulRequestAt: string | null;
/**
* The type of object. This value is always `"integration_connection"`.
*/
objectType: 'integration_connection';
}
}
export interface EndUserListResponse {
/**
* The array of EndUsers.
*/
data: Array<EndUser>;
/**
* The type of object. This value is always `"list"`.
*/
objectType: 'list';
/**
* The endpoint URL where this list can be accessed.
*/
url: string;
}
export interface EndUserDeleteResponse {
/**
* The ID of the deleted EndUser.
*/
id: string;
/**
* Indicates whether the EndUser was deleted.
*/
deleted: boolean;
/**
* The type of object. This value is always `"end_user"`.
*/
objectType: 'end_user';
}
/**
* The response from the integration connection.
*/
export type EndUserPassthroughResponse = Record<string, unknown>;
export interface EndUserPingResponse {
/**
* The time, in milliseconds, that it took to ping the connection.
*/
duration: number;
}
export interface EndUserCreateParams {
/**
* The end-user's company name that will be shown elsewhere in Conductor.
*/
companyName: string;
/**
* The end-user's email address for identification purposes. Setting this field
* will not cause any emails to be sent.
*/
email: string;
/**
* The end-user's unique identifier from your system. Maps users between your
* database and Conductor. Must be unique for each user. If you have only one user,
* you may use any string value.
*/
sourceId: string;
}
export type EndUserPassthroughParams = Record<string, unknown>;
export declare namespace EndUsers {
export {
type EndUser as EndUser,
type EndUserListResponse as EndUserListResponse,
type EndUserDeleteResponse as EndUserDeleteResponse,
type EndUserPassthroughResponse as EndUserPassthroughResponse,
type EndUserPingResponse as EndUserPingResponse,
type EndUserCreateParams as EndUserCreateParams,
type EndUserPassthroughParams as EndUserPassthroughParams,
};
}