twilio 5.3.1 → 5.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/base/RequestClient.d.ts +1 -0
- package/lib/rest/Preview.d.ts +0 -5
- package/lib/rest/Preview.js +0 -7
- package/lib/rest/PreviewBase.d.ts +0 -3
- package/lib/rest/PreviewBase.js +0 -6
- package/lib/rest/accounts/V1.d.ts +10 -0
- package/lib/rest/accounts/V1.js +12 -0
- package/lib/rest/accounts/v1/bulkConsents.d.ts +53 -0
- package/lib/rest/accounts/v1/bulkConsents.js +74 -0
- package/lib/rest/accounts/v1/bulkContacts.d.ts +53 -0
- package/lib/rest/accounts/v1/bulkContacts.js +74 -0
- package/lib/rest/assistants/v1/assistant/assistantsKnowledge.d.ts +260 -0
- package/lib/rest/{preview/deployed_devices/fleet/key.js → assistants/v1/assistant/assistantsKnowledge.js} +62 -116
- package/lib/rest/assistants/v1/assistant/assistantsTool.d.ts +266 -0
- package/lib/rest/{preview/deployed_devices/fleet/deployment.js → assistants/v1/assistant/assistantsTool.js} +64 -112
- package/lib/rest/assistants/v1/assistant/message.d.ts +112 -0
- package/lib/rest/assistants/v1/assistant/message.js +90 -0
- package/lib/rest/assistants/v1/assistant.d.ts +38 -0
- package/lib/rest/assistants/v1/assistant.js +40 -0
- package/lib/rest/assistants/v1/knowledge/knowledgeStatus.d.ts +101 -0
- package/lib/rest/assistants/v1/knowledge/knowledgeStatus.js +115 -0
- package/lib/rest/assistants/v1/knowledge.d.ts +14 -0
- package/lib/rest/assistants/v1/knowledge.js +15 -0
- package/lib/rest/assistants/v1/tool.d.ts +67 -0
- package/lib/rest/assistants/v1/tool.js +28 -1
- package/lib/rest/iam/V1.d.ts +5 -5
- package/lib/rest/iam/V1.js +5 -5
- package/lib/rest/iam/v1/{newApiKey.d.ts → key.d.ts} +14 -14
- package/lib/rest/iam/v1/{newApiKey.js → key.js} +6 -6
- package/lib/rest/numbers/V1.d.ts +5 -5
- package/lib/rest/numbers/V1.js +6 -8
- package/lib/rest/numbers/v1/portingPortability.d.ts +2 -0
- package/lib/rest/numbers/v1/portingPortability.js +2 -0
- package/lib/rest/numbers/v1/{portingWebhookConfigurationFetch.d.ts → webhook.d.ts} +10 -10
- package/lib/rest/numbers/v1/{portingWebhookConfigurationFetch.js → webhook.js} +6 -6
- package/lib/rest/serverless/v1/service/environment/deployment.d.ts +2 -0
- package/lib/rest/serverless/v1/service/environment/deployment.js +2 -0
- package/lib/rest/taskrouter/v1/workspace/task.d.ts +2 -2
- package/lib/rest/verify/v2/service/verification.d.ts +2 -0
- package/lib/rest/verify/v2/service/verification.js +2 -0
- package/lib/rest/verify/v2/service/verificationCheck.d.ts +2 -0
- package/lib/rest/verify/v2/service/verificationCheck.js +2 -0
- package/lib/webhooks/webhooks.d.ts +1 -0
- package/package.json +1 -1
- package/lib/rest/preview/DeployedDevices.d.ts +0 -15
- package/lib/rest/preview/DeployedDevices.js +0 -36
- package/lib/rest/preview/deployed_devices/fleet/certificate.d.ts +0 -324
- package/lib/rest/preview/deployed_devices/fleet/certificate.js +0 -269
- package/lib/rest/preview/deployed_devices/fleet/deployment.d.ts +0 -318
- package/lib/rest/preview/deployed_devices/fleet/device.d.ts +0 -358
- package/lib/rest/preview/deployed_devices/fleet/device.js +0 -284
- package/lib/rest/preview/deployed_devices/fleet/key.d.ts +0 -330
- package/lib/rest/preview/deployed_devices/fleet.d.ts +0 -352
- package/lib/rest/preview/deployed_devices/fleet.js +0 -307
|
@@ -1,352 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { inspect, InspectOptions } from "util";
|
|
3
|
-
import Page, { TwilioResponsePayload } from "../../../base/Page";
|
|
4
|
-
import Response from "../../../http/response";
|
|
5
|
-
import DeployedDevices from "../DeployedDevices";
|
|
6
|
-
import { CertificateListInstance } from "./fleet/certificate";
|
|
7
|
-
import { DeploymentListInstance } from "./fleet/deployment";
|
|
8
|
-
import { DeviceListInstance } from "./fleet/device";
|
|
9
|
-
import { KeyListInstance } from "./fleet/key";
|
|
10
|
-
/**
|
|
11
|
-
* Options to pass to update a FleetInstance
|
|
12
|
-
*/
|
|
13
|
-
export interface FleetContextUpdateOptions {
|
|
14
|
-
/** Provides a human readable descriptive text for this Fleet, up to 256 characters long. */
|
|
15
|
-
friendlyName?: string;
|
|
16
|
-
/** Provides a string identifier of a Deployment that is going to be used as a default one for this Fleet. */
|
|
17
|
-
defaultDeploymentSid?: string;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Options to pass to create a FleetInstance
|
|
21
|
-
*/
|
|
22
|
-
export interface FleetListInstanceCreateOptions {
|
|
23
|
-
/** Provides a human readable descriptive text for this Fleet, up to 256 characters long. */
|
|
24
|
-
friendlyName?: string;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Options to pass to each
|
|
28
|
-
*/
|
|
29
|
-
export interface FleetListInstanceEachOptions {
|
|
30
|
-
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
|
31
|
-
pageSize?: number;
|
|
32
|
-
/** Function to process each record. If this and a positional callback are passed, this one will be used */
|
|
33
|
-
callback?: (item: FleetInstance, done: (err?: Error) => void) => void;
|
|
34
|
-
/** Function to be called upon completion of streaming */
|
|
35
|
-
done?: Function;
|
|
36
|
-
/** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */
|
|
37
|
-
limit?: number;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Options to pass to list
|
|
41
|
-
*/
|
|
42
|
-
export interface FleetListInstanceOptions {
|
|
43
|
-
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
|
44
|
-
pageSize?: number;
|
|
45
|
-
/** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */
|
|
46
|
-
limit?: number;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Options to pass to page
|
|
50
|
-
*/
|
|
51
|
-
export interface FleetListInstancePageOptions {
|
|
52
|
-
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
|
53
|
-
pageSize?: number;
|
|
54
|
-
/** Page Number, this value is simply for client state */
|
|
55
|
-
pageNumber?: number;
|
|
56
|
-
/** PageToken provided by the API */
|
|
57
|
-
pageToken?: string;
|
|
58
|
-
}
|
|
59
|
-
export interface FleetContext {
|
|
60
|
-
certificates: CertificateListInstance;
|
|
61
|
-
deployments: DeploymentListInstance;
|
|
62
|
-
devices: DeviceListInstance;
|
|
63
|
-
keys: KeyListInstance;
|
|
64
|
-
/**
|
|
65
|
-
* Remove a FleetInstance
|
|
66
|
-
*
|
|
67
|
-
* @param callback - Callback to handle processed record
|
|
68
|
-
*
|
|
69
|
-
* @returns Resolves to processed boolean
|
|
70
|
-
*/
|
|
71
|
-
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
|
72
|
-
/**
|
|
73
|
-
* Fetch a FleetInstance
|
|
74
|
-
*
|
|
75
|
-
* @param callback - Callback to handle processed record
|
|
76
|
-
*
|
|
77
|
-
* @returns Resolves to processed FleetInstance
|
|
78
|
-
*/
|
|
79
|
-
fetch(callback?: (error: Error | null, item?: FleetInstance) => any): Promise<FleetInstance>;
|
|
80
|
-
/**
|
|
81
|
-
* Update a FleetInstance
|
|
82
|
-
*
|
|
83
|
-
* @param callback - Callback to handle processed record
|
|
84
|
-
*
|
|
85
|
-
* @returns Resolves to processed FleetInstance
|
|
86
|
-
*/
|
|
87
|
-
update(callback?: (error: Error | null, item?: FleetInstance) => any): Promise<FleetInstance>;
|
|
88
|
-
/**
|
|
89
|
-
* Update a FleetInstance
|
|
90
|
-
*
|
|
91
|
-
* @param params - Parameter for request
|
|
92
|
-
* @param callback - Callback to handle processed record
|
|
93
|
-
*
|
|
94
|
-
* @returns Resolves to processed FleetInstance
|
|
95
|
-
*/
|
|
96
|
-
update(params: FleetContextUpdateOptions, callback?: (error: Error | null, item?: FleetInstance) => any): Promise<FleetInstance>;
|
|
97
|
-
/**
|
|
98
|
-
* Provide a user-friendly representation
|
|
99
|
-
*/
|
|
100
|
-
toJSON(): any;
|
|
101
|
-
[inspect.custom](_depth: any, options: InspectOptions): any;
|
|
102
|
-
}
|
|
103
|
-
export interface FleetContextSolution {
|
|
104
|
-
sid: string;
|
|
105
|
-
}
|
|
106
|
-
export declare class FleetContextImpl implements FleetContext {
|
|
107
|
-
protected _version: DeployedDevices;
|
|
108
|
-
protected _solution: FleetContextSolution;
|
|
109
|
-
protected _uri: string;
|
|
110
|
-
protected _certificates?: CertificateListInstance;
|
|
111
|
-
protected _deployments?: DeploymentListInstance;
|
|
112
|
-
protected _devices?: DeviceListInstance;
|
|
113
|
-
protected _keys?: KeyListInstance;
|
|
114
|
-
constructor(_version: DeployedDevices, sid: string);
|
|
115
|
-
get certificates(): CertificateListInstance;
|
|
116
|
-
get deployments(): DeploymentListInstance;
|
|
117
|
-
get devices(): DeviceListInstance;
|
|
118
|
-
get keys(): KeyListInstance;
|
|
119
|
-
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
|
120
|
-
fetch(callback?: (error: Error | null, item?: FleetInstance) => any): Promise<FleetInstance>;
|
|
121
|
-
update(params?: FleetContextUpdateOptions | ((error: Error | null, item?: FleetInstance) => any), callback?: (error: Error | null, item?: FleetInstance) => any): Promise<FleetInstance>;
|
|
122
|
-
/**
|
|
123
|
-
* Provide a user-friendly representation
|
|
124
|
-
*
|
|
125
|
-
* @returns Object
|
|
126
|
-
*/
|
|
127
|
-
toJSON(): FleetContextSolution;
|
|
128
|
-
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
129
|
-
}
|
|
130
|
-
interface FleetPayload extends TwilioResponsePayload {
|
|
131
|
-
fleets: FleetResource[];
|
|
132
|
-
}
|
|
133
|
-
interface FleetResource {
|
|
134
|
-
sid: string;
|
|
135
|
-
url: string;
|
|
136
|
-
unique_name: string;
|
|
137
|
-
friendly_name: string;
|
|
138
|
-
account_sid: string;
|
|
139
|
-
default_deployment_sid: string;
|
|
140
|
-
date_created: Date;
|
|
141
|
-
date_updated: Date;
|
|
142
|
-
links: Record<string, string>;
|
|
143
|
-
}
|
|
144
|
-
export declare class FleetInstance {
|
|
145
|
-
protected _version: DeployedDevices;
|
|
146
|
-
protected _solution: FleetContextSolution;
|
|
147
|
-
protected _context?: FleetContext;
|
|
148
|
-
constructor(_version: DeployedDevices, payload: FleetResource, sid?: string);
|
|
149
|
-
/**
|
|
150
|
-
* Contains a 34 character string that uniquely identifies this Fleet resource.
|
|
151
|
-
*/
|
|
152
|
-
sid: string;
|
|
153
|
-
/**
|
|
154
|
-
* Contains an absolute URL for this Fleet resource.
|
|
155
|
-
*/
|
|
156
|
-
url: string;
|
|
157
|
-
/**
|
|
158
|
-
* Contains a unique and addressable name of this Fleet, e.g. \'default\', up to 128 characters long.
|
|
159
|
-
*/
|
|
160
|
-
uniqueName: string;
|
|
161
|
-
/**
|
|
162
|
-
* Contains a human readable descriptive text for this Fleet, up to 256 characters long.
|
|
163
|
-
*/
|
|
164
|
-
friendlyName: string;
|
|
165
|
-
/**
|
|
166
|
-
* Speicifies the unique string identifier of the Account responsible for this Fleet.
|
|
167
|
-
*/
|
|
168
|
-
accountSid: string;
|
|
169
|
-
/**
|
|
170
|
-
* Contains the string identifier of the automatically provisioned default Deployment of this Fleet.
|
|
171
|
-
*/
|
|
172
|
-
defaultDeploymentSid: string;
|
|
173
|
-
/**
|
|
174
|
-
* Specifies the date this Fleet was created, given in UTC ISO 8601 format.
|
|
175
|
-
*/
|
|
176
|
-
dateCreated: Date;
|
|
177
|
-
/**
|
|
178
|
-
* Specifies the date this Fleet was last updated, given in UTC ISO 8601 format.
|
|
179
|
-
*/
|
|
180
|
-
dateUpdated: Date;
|
|
181
|
-
/**
|
|
182
|
-
* Contains a dictionary of URL links to nested resources of this Fleet.
|
|
183
|
-
*/
|
|
184
|
-
links: Record<string, string>;
|
|
185
|
-
private get _proxy();
|
|
186
|
-
/**
|
|
187
|
-
* Remove a FleetInstance
|
|
188
|
-
*
|
|
189
|
-
* @param callback - Callback to handle processed record
|
|
190
|
-
*
|
|
191
|
-
* @returns Resolves to processed boolean
|
|
192
|
-
*/
|
|
193
|
-
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
|
194
|
-
/**
|
|
195
|
-
* Fetch a FleetInstance
|
|
196
|
-
*
|
|
197
|
-
* @param callback - Callback to handle processed record
|
|
198
|
-
*
|
|
199
|
-
* @returns Resolves to processed FleetInstance
|
|
200
|
-
*/
|
|
201
|
-
fetch(callback?: (error: Error | null, item?: FleetInstance) => any): Promise<FleetInstance>;
|
|
202
|
-
/**
|
|
203
|
-
* Update a FleetInstance
|
|
204
|
-
*
|
|
205
|
-
* @param callback - Callback to handle processed record
|
|
206
|
-
*
|
|
207
|
-
* @returns Resolves to processed FleetInstance
|
|
208
|
-
*/
|
|
209
|
-
update(callback?: (error: Error | null, item?: FleetInstance) => any): Promise<FleetInstance>;
|
|
210
|
-
/**
|
|
211
|
-
* Update a FleetInstance
|
|
212
|
-
*
|
|
213
|
-
* @param params - Parameter for request
|
|
214
|
-
* @param callback - Callback to handle processed record
|
|
215
|
-
*
|
|
216
|
-
* @returns Resolves to processed FleetInstance
|
|
217
|
-
*/
|
|
218
|
-
update(params: FleetContextUpdateOptions, callback?: (error: Error | null, item?: FleetInstance) => any): Promise<FleetInstance>;
|
|
219
|
-
/**
|
|
220
|
-
* Access the certificates.
|
|
221
|
-
*/
|
|
222
|
-
certificates(): CertificateListInstance;
|
|
223
|
-
/**
|
|
224
|
-
* Access the deployments.
|
|
225
|
-
*/
|
|
226
|
-
deployments(): DeploymentListInstance;
|
|
227
|
-
/**
|
|
228
|
-
* Access the devices.
|
|
229
|
-
*/
|
|
230
|
-
devices(): DeviceListInstance;
|
|
231
|
-
/**
|
|
232
|
-
* Access the keys.
|
|
233
|
-
*/
|
|
234
|
-
keys(): KeyListInstance;
|
|
235
|
-
/**
|
|
236
|
-
* Provide a user-friendly representation
|
|
237
|
-
*
|
|
238
|
-
* @returns Object
|
|
239
|
-
*/
|
|
240
|
-
toJSON(): {
|
|
241
|
-
sid: string;
|
|
242
|
-
url: string;
|
|
243
|
-
uniqueName: string;
|
|
244
|
-
friendlyName: string;
|
|
245
|
-
accountSid: string;
|
|
246
|
-
defaultDeploymentSid: string;
|
|
247
|
-
dateCreated: Date;
|
|
248
|
-
dateUpdated: Date;
|
|
249
|
-
links: Record<string, string>;
|
|
250
|
-
};
|
|
251
|
-
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
252
|
-
}
|
|
253
|
-
export interface FleetSolution {
|
|
254
|
-
}
|
|
255
|
-
export interface FleetListInstance {
|
|
256
|
-
_version: DeployedDevices;
|
|
257
|
-
_solution: FleetSolution;
|
|
258
|
-
_uri: string;
|
|
259
|
-
(sid: string): FleetContext;
|
|
260
|
-
get(sid: string): FleetContext;
|
|
261
|
-
/**
|
|
262
|
-
* Create a FleetInstance
|
|
263
|
-
*
|
|
264
|
-
* @param callback - Callback to handle processed record
|
|
265
|
-
*
|
|
266
|
-
* @returns Resolves to processed FleetInstance
|
|
267
|
-
*/
|
|
268
|
-
create(callback?: (error: Error | null, item?: FleetInstance) => any): Promise<FleetInstance>;
|
|
269
|
-
/**
|
|
270
|
-
* Create a FleetInstance
|
|
271
|
-
*
|
|
272
|
-
* @param params - Parameter for request
|
|
273
|
-
* @param callback - Callback to handle processed record
|
|
274
|
-
*
|
|
275
|
-
* @returns Resolves to processed FleetInstance
|
|
276
|
-
*/
|
|
277
|
-
create(params: FleetListInstanceCreateOptions, callback?: (error: Error | null, item?: FleetInstance) => any): Promise<FleetInstance>;
|
|
278
|
-
/**
|
|
279
|
-
* Streams FleetInstance records from the API.
|
|
280
|
-
*
|
|
281
|
-
* This operation lazily loads records as efficiently as possible until the limit
|
|
282
|
-
* is reached.
|
|
283
|
-
*
|
|
284
|
-
* The results are passed into the callback function, so this operation is memory
|
|
285
|
-
* efficient.
|
|
286
|
-
*
|
|
287
|
-
* If a function is passed as the first argument, it will be used as the callback
|
|
288
|
-
* function.
|
|
289
|
-
*
|
|
290
|
-
* @param { FleetListInstanceEachOptions } [params] - Options for request
|
|
291
|
-
* @param { function } [callback] - Function to process each record
|
|
292
|
-
*/
|
|
293
|
-
each(callback?: (item: FleetInstance, done: (err?: Error) => void) => void): void;
|
|
294
|
-
each(params: FleetListInstanceEachOptions, callback?: (item: FleetInstance, done: (err?: Error) => void) => void): void;
|
|
295
|
-
/**
|
|
296
|
-
* Retrieve a single target page of FleetInstance records from the API.
|
|
297
|
-
*
|
|
298
|
-
* The request is executed immediately.
|
|
299
|
-
*
|
|
300
|
-
* @param { string } [targetUrl] - API-generated URL for the requested results page
|
|
301
|
-
* @param { function } [callback] - Callback to handle list of records
|
|
302
|
-
*/
|
|
303
|
-
getPage(targetUrl: string, callback?: (error: Error | null, items: FleetPage) => any): Promise<FleetPage>;
|
|
304
|
-
/**
|
|
305
|
-
* Lists FleetInstance records from the API as a list.
|
|
306
|
-
*
|
|
307
|
-
* If a function is passed as the first argument, it will be used as the callback
|
|
308
|
-
* function.
|
|
309
|
-
*
|
|
310
|
-
* @param { FleetListInstanceOptions } [params] - Options for request
|
|
311
|
-
* @param { function } [callback] - Callback to handle list of records
|
|
312
|
-
*/
|
|
313
|
-
list(callback?: (error: Error | null, items: FleetInstance[]) => any): Promise<FleetInstance[]>;
|
|
314
|
-
list(params: FleetListInstanceOptions, callback?: (error: Error | null, items: FleetInstance[]) => any): Promise<FleetInstance[]>;
|
|
315
|
-
/**
|
|
316
|
-
* Retrieve a single page of FleetInstance records from the API.
|
|
317
|
-
*
|
|
318
|
-
* The request is executed immediately.
|
|
319
|
-
*
|
|
320
|
-
* If a function is passed as the first argument, it will be used as the callback
|
|
321
|
-
* function.
|
|
322
|
-
*
|
|
323
|
-
* @param { FleetListInstancePageOptions } [params] - Options for request
|
|
324
|
-
* @param { function } [callback] - Callback to handle list of records
|
|
325
|
-
*/
|
|
326
|
-
page(callback?: (error: Error | null, items: FleetPage) => any): Promise<FleetPage>;
|
|
327
|
-
page(params: FleetListInstancePageOptions, callback?: (error: Error | null, items: FleetPage) => any): Promise<FleetPage>;
|
|
328
|
-
/**
|
|
329
|
-
* Provide a user-friendly representation
|
|
330
|
-
*/
|
|
331
|
-
toJSON(): any;
|
|
332
|
-
[inspect.custom](_depth: any, options: InspectOptions): any;
|
|
333
|
-
}
|
|
334
|
-
export declare function FleetListInstance(version: DeployedDevices): FleetListInstance;
|
|
335
|
-
export declare class FleetPage extends Page<DeployedDevices, FleetPayload, FleetResource, FleetInstance> {
|
|
336
|
-
/**
|
|
337
|
-
* Initialize the FleetPage
|
|
338
|
-
*
|
|
339
|
-
* @param version - Version of the resource
|
|
340
|
-
* @param response - Response from the API
|
|
341
|
-
* @param solution - Path solution
|
|
342
|
-
*/
|
|
343
|
-
constructor(version: DeployedDevices, response: Response<string>, solution: FleetSolution);
|
|
344
|
-
/**
|
|
345
|
-
* Build an instance of FleetInstance
|
|
346
|
-
*
|
|
347
|
-
* @param payload - Payload response from the API
|
|
348
|
-
*/
|
|
349
|
-
getInstance(payload: FleetResource): FleetInstance;
|
|
350
|
-
[inspect.custom](depth: any, options: InspectOptions): string;
|
|
351
|
-
}
|
|
352
|
-
export {};
|
|
@@ -1,307 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* This code was generated by
|
|
4
|
-
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
|
5
|
-
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
|
6
|
-
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
|
7
|
-
*
|
|
8
|
-
* Twilio - Preview
|
|
9
|
-
* This is the public Twilio REST API.
|
|
10
|
-
*
|
|
11
|
-
* NOTE: This class is auto generated by OpenAPI Generator.
|
|
12
|
-
* https://openapi-generator.tech
|
|
13
|
-
* Do not edit the class manually.
|
|
14
|
-
*/
|
|
15
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
16
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17
|
-
};
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.FleetPage = exports.FleetListInstance = exports.FleetInstance = exports.FleetContextImpl = void 0;
|
|
20
|
-
const util_1 = require("util");
|
|
21
|
-
const Page_1 = __importDefault(require("../../../base/Page"));
|
|
22
|
-
const deserialize = require("../../../base/deserialize");
|
|
23
|
-
const serialize = require("../../../base/serialize");
|
|
24
|
-
const utility_1 = require("../../../base/utility");
|
|
25
|
-
const certificate_1 = require("./fleet/certificate");
|
|
26
|
-
const deployment_1 = require("./fleet/deployment");
|
|
27
|
-
const device_1 = require("./fleet/device");
|
|
28
|
-
const key_1 = require("./fleet/key");
|
|
29
|
-
class FleetContextImpl {
|
|
30
|
-
constructor(_version, sid) {
|
|
31
|
-
this._version = _version;
|
|
32
|
-
if (!(0, utility_1.isValidPathParam)(sid)) {
|
|
33
|
-
throw new Error("Parameter 'sid' is not valid.");
|
|
34
|
-
}
|
|
35
|
-
this._solution = { sid };
|
|
36
|
-
this._uri = `/Fleets/${sid}`;
|
|
37
|
-
}
|
|
38
|
-
get certificates() {
|
|
39
|
-
this._certificates =
|
|
40
|
-
this._certificates ||
|
|
41
|
-
(0, certificate_1.CertificateListInstance)(this._version, this._solution.sid);
|
|
42
|
-
return this._certificates;
|
|
43
|
-
}
|
|
44
|
-
get deployments() {
|
|
45
|
-
this._deployments =
|
|
46
|
-
this._deployments ||
|
|
47
|
-
(0, deployment_1.DeploymentListInstance)(this._version, this._solution.sid);
|
|
48
|
-
return this._deployments;
|
|
49
|
-
}
|
|
50
|
-
get devices() {
|
|
51
|
-
this._devices =
|
|
52
|
-
this._devices || (0, device_1.DeviceListInstance)(this._version, this._solution.sid);
|
|
53
|
-
return this._devices;
|
|
54
|
-
}
|
|
55
|
-
get keys() {
|
|
56
|
-
this._keys =
|
|
57
|
-
this._keys || (0, key_1.KeyListInstance)(this._version, this._solution.sid);
|
|
58
|
-
return this._keys;
|
|
59
|
-
}
|
|
60
|
-
remove(callback) {
|
|
61
|
-
const instance = this;
|
|
62
|
-
let operationVersion = instance._version, operationPromise = operationVersion.remove({
|
|
63
|
-
uri: instance._uri,
|
|
64
|
-
method: "delete",
|
|
65
|
-
});
|
|
66
|
-
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
67
|
-
return operationPromise;
|
|
68
|
-
}
|
|
69
|
-
fetch(callback) {
|
|
70
|
-
const instance = this;
|
|
71
|
-
let operationVersion = instance._version, operationPromise = operationVersion.fetch({
|
|
72
|
-
uri: instance._uri,
|
|
73
|
-
method: "get",
|
|
74
|
-
});
|
|
75
|
-
operationPromise = operationPromise.then((payload) => new FleetInstance(operationVersion, payload, instance._solution.sid));
|
|
76
|
-
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
77
|
-
return operationPromise;
|
|
78
|
-
}
|
|
79
|
-
update(params, callback) {
|
|
80
|
-
if (params instanceof Function) {
|
|
81
|
-
callback = params;
|
|
82
|
-
params = {};
|
|
83
|
-
}
|
|
84
|
-
else {
|
|
85
|
-
params = params || {};
|
|
86
|
-
}
|
|
87
|
-
let data = {};
|
|
88
|
-
if (params["friendlyName"] !== undefined)
|
|
89
|
-
data["FriendlyName"] = params["friendlyName"];
|
|
90
|
-
if (params["defaultDeploymentSid"] !== undefined)
|
|
91
|
-
data["DefaultDeploymentSid"] = params["defaultDeploymentSid"];
|
|
92
|
-
const headers = {};
|
|
93
|
-
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
|
94
|
-
const instance = this;
|
|
95
|
-
let operationVersion = instance._version, operationPromise = operationVersion.update({
|
|
96
|
-
uri: instance._uri,
|
|
97
|
-
method: "post",
|
|
98
|
-
data,
|
|
99
|
-
headers,
|
|
100
|
-
});
|
|
101
|
-
operationPromise = operationPromise.then((payload) => new FleetInstance(operationVersion, payload, instance._solution.sid));
|
|
102
|
-
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
103
|
-
return operationPromise;
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* Provide a user-friendly representation
|
|
107
|
-
*
|
|
108
|
-
* @returns Object
|
|
109
|
-
*/
|
|
110
|
-
toJSON() {
|
|
111
|
-
return this._solution;
|
|
112
|
-
}
|
|
113
|
-
[util_1.inspect.custom](_depth, options) {
|
|
114
|
-
return (0, util_1.inspect)(this.toJSON(), options);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
exports.FleetContextImpl = FleetContextImpl;
|
|
118
|
-
class FleetInstance {
|
|
119
|
-
constructor(_version, payload, sid) {
|
|
120
|
-
this._version = _version;
|
|
121
|
-
this.sid = payload.sid;
|
|
122
|
-
this.url = payload.url;
|
|
123
|
-
this.uniqueName = payload.unique_name;
|
|
124
|
-
this.friendlyName = payload.friendly_name;
|
|
125
|
-
this.accountSid = payload.account_sid;
|
|
126
|
-
this.defaultDeploymentSid = payload.default_deployment_sid;
|
|
127
|
-
this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
|
|
128
|
-
this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated);
|
|
129
|
-
this.links = payload.links;
|
|
130
|
-
this._solution = { sid: sid || this.sid };
|
|
131
|
-
}
|
|
132
|
-
get _proxy() {
|
|
133
|
-
this._context =
|
|
134
|
-
this._context || new FleetContextImpl(this._version, this._solution.sid);
|
|
135
|
-
return this._context;
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* Remove a FleetInstance
|
|
139
|
-
*
|
|
140
|
-
* @param callback - Callback to handle processed record
|
|
141
|
-
*
|
|
142
|
-
* @returns Resolves to processed boolean
|
|
143
|
-
*/
|
|
144
|
-
remove(callback) {
|
|
145
|
-
return this._proxy.remove(callback);
|
|
146
|
-
}
|
|
147
|
-
/**
|
|
148
|
-
* Fetch a FleetInstance
|
|
149
|
-
*
|
|
150
|
-
* @param callback - Callback to handle processed record
|
|
151
|
-
*
|
|
152
|
-
* @returns Resolves to processed FleetInstance
|
|
153
|
-
*/
|
|
154
|
-
fetch(callback) {
|
|
155
|
-
return this._proxy.fetch(callback);
|
|
156
|
-
}
|
|
157
|
-
update(params, callback) {
|
|
158
|
-
return this._proxy.update(params, callback);
|
|
159
|
-
}
|
|
160
|
-
/**
|
|
161
|
-
* Access the certificates.
|
|
162
|
-
*/
|
|
163
|
-
certificates() {
|
|
164
|
-
return this._proxy.certificates;
|
|
165
|
-
}
|
|
166
|
-
/**
|
|
167
|
-
* Access the deployments.
|
|
168
|
-
*/
|
|
169
|
-
deployments() {
|
|
170
|
-
return this._proxy.deployments;
|
|
171
|
-
}
|
|
172
|
-
/**
|
|
173
|
-
* Access the devices.
|
|
174
|
-
*/
|
|
175
|
-
devices() {
|
|
176
|
-
return this._proxy.devices;
|
|
177
|
-
}
|
|
178
|
-
/**
|
|
179
|
-
* Access the keys.
|
|
180
|
-
*/
|
|
181
|
-
keys() {
|
|
182
|
-
return this._proxy.keys;
|
|
183
|
-
}
|
|
184
|
-
/**
|
|
185
|
-
* Provide a user-friendly representation
|
|
186
|
-
*
|
|
187
|
-
* @returns Object
|
|
188
|
-
*/
|
|
189
|
-
toJSON() {
|
|
190
|
-
return {
|
|
191
|
-
sid: this.sid,
|
|
192
|
-
url: this.url,
|
|
193
|
-
uniqueName: this.uniqueName,
|
|
194
|
-
friendlyName: this.friendlyName,
|
|
195
|
-
accountSid: this.accountSid,
|
|
196
|
-
defaultDeploymentSid: this.defaultDeploymentSid,
|
|
197
|
-
dateCreated: this.dateCreated,
|
|
198
|
-
dateUpdated: this.dateUpdated,
|
|
199
|
-
links: this.links,
|
|
200
|
-
};
|
|
201
|
-
}
|
|
202
|
-
[util_1.inspect.custom](_depth, options) {
|
|
203
|
-
return (0, util_1.inspect)(this.toJSON(), options);
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
exports.FleetInstance = FleetInstance;
|
|
207
|
-
function FleetListInstance(version) {
|
|
208
|
-
const instance = ((sid) => instance.get(sid));
|
|
209
|
-
instance.get = function get(sid) {
|
|
210
|
-
return new FleetContextImpl(version, sid);
|
|
211
|
-
};
|
|
212
|
-
instance._version = version;
|
|
213
|
-
instance._solution = {};
|
|
214
|
-
instance._uri = `/Fleets`;
|
|
215
|
-
instance.create = function create(params, callback) {
|
|
216
|
-
if (params instanceof Function) {
|
|
217
|
-
callback = params;
|
|
218
|
-
params = {};
|
|
219
|
-
}
|
|
220
|
-
else {
|
|
221
|
-
params = params || {};
|
|
222
|
-
}
|
|
223
|
-
let data = {};
|
|
224
|
-
if (params["friendlyName"] !== undefined)
|
|
225
|
-
data["FriendlyName"] = params["friendlyName"];
|
|
226
|
-
const headers = {};
|
|
227
|
-
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
|
228
|
-
let operationVersion = version, operationPromise = operationVersion.create({
|
|
229
|
-
uri: instance._uri,
|
|
230
|
-
method: "post",
|
|
231
|
-
data,
|
|
232
|
-
headers,
|
|
233
|
-
});
|
|
234
|
-
operationPromise = operationPromise.then((payload) => new FleetInstance(operationVersion, payload));
|
|
235
|
-
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
236
|
-
return operationPromise;
|
|
237
|
-
};
|
|
238
|
-
instance.page = function page(params, callback) {
|
|
239
|
-
if (params instanceof Function) {
|
|
240
|
-
callback = params;
|
|
241
|
-
params = {};
|
|
242
|
-
}
|
|
243
|
-
else {
|
|
244
|
-
params = params || {};
|
|
245
|
-
}
|
|
246
|
-
let data = {};
|
|
247
|
-
if (params["pageSize"] !== undefined)
|
|
248
|
-
data["PageSize"] = params["pageSize"];
|
|
249
|
-
if (params.pageNumber !== undefined)
|
|
250
|
-
data["Page"] = params.pageNumber;
|
|
251
|
-
if (params.pageToken !== undefined)
|
|
252
|
-
data["PageToken"] = params.pageToken;
|
|
253
|
-
const headers = {};
|
|
254
|
-
let operationVersion = version, operationPromise = operationVersion.page({
|
|
255
|
-
uri: instance._uri,
|
|
256
|
-
method: "get",
|
|
257
|
-
params: data,
|
|
258
|
-
headers,
|
|
259
|
-
});
|
|
260
|
-
operationPromise = operationPromise.then((payload) => new FleetPage(operationVersion, payload, instance._solution));
|
|
261
|
-
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
262
|
-
return operationPromise;
|
|
263
|
-
};
|
|
264
|
-
instance.each = instance._version.each;
|
|
265
|
-
instance.list = instance._version.list;
|
|
266
|
-
instance.getPage = function getPage(targetUrl, callback) {
|
|
267
|
-
const operationPromise = instance._version._domain.twilio.request({
|
|
268
|
-
method: "get",
|
|
269
|
-
uri: targetUrl,
|
|
270
|
-
});
|
|
271
|
-
let pagePromise = operationPromise.then((payload) => new FleetPage(instance._version, payload, instance._solution));
|
|
272
|
-
pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
|
|
273
|
-
return pagePromise;
|
|
274
|
-
};
|
|
275
|
-
instance.toJSON = function toJSON() {
|
|
276
|
-
return instance._solution;
|
|
277
|
-
};
|
|
278
|
-
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
|
279
|
-
return (0, util_1.inspect)(instance.toJSON(), options);
|
|
280
|
-
};
|
|
281
|
-
return instance;
|
|
282
|
-
}
|
|
283
|
-
exports.FleetListInstance = FleetListInstance;
|
|
284
|
-
class FleetPage extends Page_1.default {
|
|
285
|
-
/**
|
|
286
|
-
* Initialize the FleetPage
|
|
287
|
-
*
|
|
288
|
-
* @param version - Version of the resource
|
|
289
|
-
* @param response - Response from the API
|
|
290
|
-
* @param solution - Path solution
|
|
291
|
-
*/
|
|
292
|
-
constructor(version, response, solution) {
|
|
293
|
-
super(version, response, solution);
|
|
294
|
-
}
|
|
295
|
-
/**
|
|
296
|
-
* Build an instance of FleetInstance
|
|
297
|
-
*
|
|
298
|
-
* @param payload - Payload response from the API
|
|
299
|
-
*/
|
|
300
|
-
getInstance(payload) {
|
|
301
|
-
return new FleetInstance(this._version, payload);
|
|
302
|
-
}
|
|
303
|
-
[util_1.inspect.custom](depth, options) {
|
|
304
|
-
return (0, util_1.inspect)(this.toJSON(), options);
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
exports.FleetPage = FleetPage;
|