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,324 +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
|
-
/**
|
|
7
|
-
* Options to pass to update a CertificateInstance
|
|
8
|
-
*/
|
|
9
|
-
export interface CertificateContextUpdateOptions {
|
|
10
|
-
/** Provides a human readable descriptive text for this Certificate credential, up to 256 characters long. */
|
|
11
|
-
friendlyName?: string;
|
|
12
|
-
/** Provides the unique string identifier of an existing Device to become authenticated with this Certificate credential. */
|
|
13
|
-
deviceSid?: string;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Options to pass to create a CertificateInstance
|
|
17
|
-
*/
|
|
18
|
-
export interface CertificateListInstanceCreateOptions {
|
|
19
|
-
/** Provides a URL encoded representation of the public certificate in PEM format. */
|
|
20
|
-
certificateData: string;
|
|
21
|
-
/** Provides a human readable descriptive text for this Certificate credential, up to 256 characters long. */
|
|
22
|
-
friendlyName?: string;
|
|
23
|
-
/** Provides the unique string identifier of an existing Device to become authenticated with this Certificate credential. */
|
|
24
|
-
deviceSid?: string;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Options to pass to each
|
|
28
|
-
*/
|
|
29
|
-
export interface CertificateListInstanceEachOptions {
|
|
30
|
-
/** Filters the resulting list of Certificates by a unique string identifier of an authenticated Device. */
|
|
31
|
-
deviceSid?: string;
|
|
32
|
-
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
|
33
|
-
pageSize?: number;
|
|
34
|
-
/** Function to process each record. If this and a positional callback are passed, this one will be used */
|
|
35
|
-
callback?: (item: CertificateInstance, done: (err?: Error) => void) => void;
|
|
36
|
-
/** Function to be called upon completion of streaming */
|
|
37
|
-
done?: Function;
|
|
38
|
-
/** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */
|
|
39
|
-
limit?: number;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Options to pass to list
|
|
43
|
-
*/
|
|
44
|
-
export interface CertificateListInstanceOptions {
|
|
45
|
-
/** Filters the resulting list of Certificates by a unique string identifier of an authenticated Device. */
|
|
46
|
-
deviceSid?: string;
|
|
47
|
-
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
|
48
|
-
pageSize?: number;
|
|
49
|
-
/** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */
|
|
50
|
-
limit?: number;
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Options to pass to page
|
|
54
|
-
*/
|
|
55
|
-
export interface CertificateListInstancePageOptions {
|
|
56
|
-
/** Filters the resulting list of Certificates by a unique string identifier of an authenticated Device. */
|
|
57
|
-
deviceSid?: string;
|
|
58
|
-
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
|
59
|
-
pageSize?: number;
|
|
60
|
-
/** Page Number, this value is simply for client state */
|
|
61
|
-
pageNumber?: number;
|
|
62
|
-
/** PageToken provided by the API */
|
|
63
|
-
pageToken?: string;
|
|
64
|
-
}
|
|
65
|
-
export interface CertificateContext {
|
|
66
|
-
/**
|
|
67
|
-
* Remove a CertificateInstance
|
|
68
|
-
*
|
|
69
|
-
* @param callback - Callback to handle processed record
|
|
70
|
-
*
|
|
71
|
-
* @returns Resolves to processed boolean
|
|
72
|
-
*/
|
|
73
|
-
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
|
74
|
-
/**
|
|
75
|
-
* Fetch a CertificateInstance
|
|
76
|
-
*
|
|
77
|
-
* @param callback - Callback to handle processed record
|
|
78
|
-
*
|
|
79
|
-
* @returns Resolves to processed CertificateInstance
|
|
80
|
-
*/
|
|
81
|
-
fetch(callback?: (error: Error | null, item?: CertificateInstance) => any): Promise<CertificateInstance>;
|
|
82
|
-
/**
|
|
83
|
-
* Update a CertificateInstance
|
|
84
|
-
*
|
|
85
|
-
* @param callback - Callback to handle processed record
|
|
86
|
-
*
|
|
87
|
-
* @returns Resolves to processed CertificateInstance
|
|
88
|
-
*/
|
|
89
|
-
update(callback?: (error: Error | null, item?: CertificateInstance) => any): Promise<CertificateInstance>;
|
|
90
|
-
/**
|
|
91
|
-
* Update a CertificateInstance
|
|
92
|
-
*
|
|
93
|
-
* @param params - Parameter for request
|
|
94
|
-
* @param callback - Callback to handle processed record
|
|
95
|
-
*
|
|
96
|
-
* @returns Resolves to processed CertificateInstance
|
|
97
|
-
*/
|
|
98
|
-
update(params: CertificateContextUpdateOptions, callback?: (error: Error | null, item?: CertificateInstance) => any): Promise<CertificateInstance>;
|
|
99
|
-
/**
|
|
100
|
-
* Provide a user-friendly representation
|
|
101
|
-
*/
|
|
102
|
-
toJSON(): any;
|
|
103
|
-
[inspect.custom](_depth: any, options: InspectOptions): any;
|
|
104
|
-
}
|
|
105
|
-
export interface CertificateContextSolution {
|
|
106
|
-
fleetSid: string;
|
|
107
|
-
sid: string;
|
|
108
|
-
}
|
|
109
|
-
export declare class CertificateContextImpl implements CertificateContext {
|
|
110
|
-
protected _version: DeployedDevices;
|
|
111
|
-
protected _solution: CertificateContextSolution;
|
|
112
|
-
protected _uri: string;
|
|
113
|
-
constructor(_version: DeployedDevices, fleetSid: string, sid: string);
|
|
114
|
-
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
|
115
|
-
fetch(callback?: (error: Error | null, item?: CertificateInstance) => any): Promise<CertificateInstance>;
|
|
116
|
-
update(params?: CertificateContextUpdateOptions | ((error: Error | null, item?: CertificateInstance) => any), callback?: (error: Error | null, item?: CertificateInstance) => any): Promise<CertificateInstance>;
|
|
117
|
-
/**
|
|
118
|
-
* Provide a user-friendly representation
|
|
119
|
-
*
|
|
120
|
-
* @returns Object
|
|
121
|
-
*/
|
|
122
|
-
toJSON(): CertificateContextSolution;
|
|
123
|
-
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
124
|
-
}
|
|
125
|
-
interface CertificatePayload extends TwilioResponsePayload {
|
|
126
|
-
certificates: CertificateResource[];
|
|
127
|
-
}
|
|
128
|
-
interface CertificateResource {
|
|
129
|
-
sid: string;
|
|
130
|
-
url: string;
|
|
131
|
-
friendly_name: string;
|
|
132
|
-
fleet_sid: string;
|
|
133
|
-
account_sid: string;
|
|
134
|
-
device_sid: string;
|
|
135
|
-
thumbprint: string;
|
|
136
|
-
date_created: Date;
|
|
137
|
-
date_updated: Date;
|
|
138
|
-
}
|
|
139
|
-
export declare class CertificateInstance {
|
|
140
|
-
protected _version: DeployedDevices;
|
|
141
|
-
protected _solution: CertificateContextSolution;
|
|
142
|
-
protected _context?: CertificateContext;
|
|
143
|
-
constructor(_version: DeployedDevices, payload: CertificateResource, fleetSid: string, sid?: string);
|
|
144
|
-
/**
|
|
145
|
-
* Contains a 34 character string that uniquely identifies this Certificate credential resource.
|
|
146
|
-
*/
|
|
147
|
-
sid: string;
|
|
148
|
-
/**
|
|
149
|
-
* Contains an absolute URL for this Certificate credential resource.
|
|
150
|
-
*/
|
|
151
|
-
url: string;
|
|
152
|
-
/**
|
|
153
|
-
* Contains a human readable descriptive text for this Certificate credential, up to 256 characters long.
|
|
154
|
-
*/
|
|
155
|
-
friendlyName: string;
|
|
156
|
-
/**
|
|
157
|
-
* Specifies the unique string identifier of the Fleet that the given Certificate credential belongs to.
|
|
158
|
-
*/
|
|
159
|
-
fleetSid: string;
|
|
160
|
-
/**
|
|
161
|
-
* Specifies the unique string identifier of the Account responsible for this Certificate credential.
|
|
162
|
-
*/
|
|
163
|
-
accountSid: string;
|
|
164
|
-
/**
|
|
165
|
-
* Specifies the unique string identifier of a Device authenticated with this Certificate credential.
|
|
166
|
-
*/
|
|
167
|
-
deviceSid: string;
|
|
168
|
-
/**
|
|
169
|
-
* Contains a unique hash of the payload of this Certificate credential, used to authenticate the Device.
|
|
170
|
-
*/
|
|
171
|
-
thumbprint: string;
|
|
172
|
-
/**
|
|
173
|
-
* Specifies the date this Certificate credential was created, given in UTC ISO 8601 format.
|
|
174
|
-
*/
|
|
175
|
-
dateCreated: Date;
|
|
176
|
-
/**
|
|
177
|
-
* Specifies the date this Certificate credential was last updated, given in UTC ISO 8601 format.
|
|
178
|
-
*/
|
|
179
|
-
dateUpdated: Date;
|
|
180
|
-
private get _proxy();
|
|
181
|
-
/**
|
|
182
|
-
* Remove a CertificateInstance
|
|
183
|
-
*
|
|
184
|
-
* @param callback - Callback to handle processed record
|
|
185
|
-
*
|
|
186
|
-
* @returns Resolves to processed boolean
|
|
187
|
-
*/
|
|
188
|
-
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
|
189
|
-
/**
|
|
190
|
-
* Fetch a CertificateInstance
|
|
191
|
-
*
|
|
192
|
-
* @param callback - Callback to handle processed record
|
|
193
|
-
*
|
|
194
|
-
* @returns Resolves to processed CertificateInstance
|
|
195
|
-
*/
|
|
196
|
-
fetch(callback?: (error: Error | null, item?: CertificateInstance) => any): Promise<CertificateInstance>;
|
|
197
|
-
/**
|
|
198
|
-
* Update a CertificateInstance
|
|
199
|
-
*
|
|
200
|
-
* @param callback - Callback to handle processed record
|
|
201
|
-
*
|
|
202
|
-
* @returns Resolves to processed CertificateInstance
|
|
203
|
-
*/
|
|
204
|
-
update(callback?: (error: Error | null, item?: CertificateInstance) => any): Promise<CertificateInstance>;
|
|
205
|
-
/**
|
|
206
|
-
* Update a CertificateInstance
|
|
207
|
-
*
|
|
208
|
-
* @param params - Parameter for request
|
|
209
|
-
* @param callback - Callback to handle processed record
|
|
210
|
-
*
|
|
211
|
-
* @returns Resolves to processed CertificateInstance
|
|
212
|
-
*/
|
|
213
|
-
update(params: CertificateContextUpdateOptions, callback?: (error: Error | null, item?: CertificateInstance) => any): Promise<CertificateInstance>;
|
|
214
|
-
/**
|
|
215
|
-
* Provide a user-friendly representation
|
|
216
|
-
*
|
|
217
|
-
* @returns Object
|
|
218
|
-
*/
|
|
219
|
-
toJSON(): {
|
|
220
|
-
sid: string;
|
|
221
|
-
url: string;
|
|
222
|
-
friendlyName: string;
|
|
223
|
-
fleetSid: string;
|
|
224
|
-
accountSid: string;
|
|
225
|
-
deviceSid: string;
|
|
226
|
-
thumbprint: string;
|
|
227
|
-
dateCreated: Date;
|
|
228
|
-
dateUpdated: Date;
|
|
229
|
-
};
|
|
230
|
-
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
231
|
-
}
|
|
232
|
-
export interface CertificateSolution {
|
|
233
|
-
fleetSid: string;
|
|
234
|
-
}
|
|
235
|
-
export interface CertificateListInstance {
|
|
236
|
-
_version: DeployedDevices;
|
|
237
|
-
_solution: CertificateSolution;
|
|
238
|
-
_uri: string;
|
|
239
|
-
(sid: string): CertificateContext;
|
|
240
|
-
get(sid: string): CertificateContext;
|
|
241
|
-
/**
|
|
242
|
-
* Create a CertificateInstance
|
|
243
|
-
*
|
|
244
|
-
* @param params - Parameter for request
|
|
245
|
-
* @param callback - Callback to handle processed record
|
|
246
|
-
*
|
|
247
|
-
* @returns Resolves to processed CertificateInstance
|
|
248
|
-
*/
|
|
249
|
-
create(params: CertificateListInstanceCreateOptions, callback?: (error: Error | null, item?: CertificateInstance) => any): Promise<CertificateInstance>;
|
|
250
|
-
/**
|
|
251
|
-
* Streams CertificateInstance records from the API.
|
|
252
|
-
*
|
|
253
|
-
* This operation lazily loads records as efficiently as possible until the limit
|
|
254
|
-
* is reached.
|
|
255
|
-
*
|
|
256
|
-
* The results are passed into the callback function, so this operation is memory
|
|
257
|
-
* efficient.
|
|
258
|
-
*
|
|
259
|
-
* If a function is passed as the first argument, it will be used as the callback
|
|
260
|
-
* function.
|
|
261
|
-
*
|
|
262
|
-
* @param { CertificateListInstanceEachOptions } [params] - Options for request
|
|
263
|
-
* @param { function } [callback] - Function to process each record
|
|
264
|
-
*/
|
|
265
|
-
each(callback?: (item: CertificateInstance, done: (err?: Error) => void) => void): void;
|
|
266
|
-
each(params: CertificateListInstanceEachOptions, callback?: (item: CertificateInstance, done: (err?: Error) => void) => void): void;
|
|
267
|
-
/**
|
|
268
|
-
* Retrieve a single target page of CertificateInstance records from the API.
|
|
269
|
-
*
|
|
270
|
-
* The request is executed immediately.
|
|
271
|
-
*
|
|
272
|
-
* @param { string } [targetUrl] - API-generated URL for the requested results page
|
|
273
|
-
* @param { function } [callback] - Callback to handle list of records
|
|
274
|
-
*/
|
|
275
|
-
getPage(targetUrl: string, callback?: (error: Error | null, items: CertificatePage) => any): Promise<CertificatePage>;
|
|
276
|
-
/**
|
|
277
|
-
* Lists CertificateInstance records from the API as a list.
|
|
278
|
-
*
|
|
279
|
-
* If a function is passed as the first argument, it will be used as the callback
|
|
280
|
-
* function.
|
|
281
|
-
*
|
|
282
|
-
* @param { CertificateListInstanceOptions } [params] - Options for request
|
|
283
|
-
* @param { function } [callback] - Callback to handle list of records
|
|
284
|
-
*/
|
|
285
|
-
list(callback?: (error: Error | null, items: CertificateInstance[]) => any): Promise<CertificateInstance[]>;
|
|
286
|
-
list(params: CertificateListInstanceOptions, callback?: (error: Error | null, items: CertificateInstance[]) => any): Promise<CertificateInstance[]>;
|
|
287
|
-
/**
|
|
288
|
-
* Retrieve a single page of CertificateInstance records from the API.
|
|
289
|
-
*
|
|
290
|
-
* The request is executed immediately.
|
|
291
|
-
*
|
|
292
|
-
* If a function is passed as the first argument, it will be used as the callback
|
|
293
|
-
* function.
|
|
294
|
-
*
|
|
295
|
-
* @param { CertificateListInstancePageOptions } [params] - Options for request
|
|
296
|
-
* @param { function } [callback] - Callback to handle list of records
|
|
297
|
-
*/
|
|
298
|
-
page(callback?: (error: Error | null, items: CertificatePage) => any): Promise<CertificatePage>;
|
|
299
|
-
page(params: CertificateListInstancePageOptions, callback?: (error: Error | null, items: CertificatePage) => any): Promise<CertificatePage>;
|
|
300
|
-
/**
|
|
301
|
-
* Provide a user-friendly representation
|
|
302
|
-
*/
|
|
303
|
-
toJSON(): any;
|
|
304
|
-
[inspect.custom](_depth: any, options: InspectOptions): any;
|
|
305
|
-
}
|
|
306
|
-
export declare function CertificateListInstance(version: DeployedDevices, fleetSid: string): CertificateListInstance;
|
|
307
|
-
export declare class CertificatePage extends Page<DeployedDevices, CertificatePayload, CertificateResource, CertificateInstance> {
|
|
308
|
-
/**
|
|
309
|
-
* Initialize the CertificatePage
|
|
310
|
-
*
|
|
311
|
-
* @param version - Version of the resource
|
|
312
|
-
* @param response - Response from the API
|
|
313
|
-
* @param solution - Path solution
|
|
314
|
-
*/
|
|
315
|
-
constructor(version: DeployedDevices, response: Response<string>, solution: CertificateSolution);
|
|
316
|
-
/**
|
|
317
|
-
* Build an instance of CertificateInstance
|
|
318
|
-
*
|
|
319
|
-
* @param payload - Payload response from the API
|
|
320
|
-
*/
|
|
321
|
-
getInstance(payload: CertificateResource): CertificateInstance;
|
|
322
|
-
[inspect.custom](depth: any, options: InspectOptions): string;
|
|
323
|
-
}
|
|
324
|
-
export {};
|
|
@@ -1,269 +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.CertificatePage = exports.CertificateListInstance = exports.CertificateInstance = exports.CertificateContextImpl = 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
|
-
class CertificateContextImpl {
|
|
26
|
-
constructor(_version, fleetSid, sid) {
|
|
27
|
-
this._version = _version;
|
|
28
|
-
if (!(0, utility_1.isValidPathParam)(fleetSid)) {
|
|
29
|
-
throw new Error("Parameter 'fleetSid' is not valid.");
|
|
30
|
-
}
|
|
31
|
-
if (!(0, utility_1.isValidPathParam)(sid)) {
|
|
32
|
-
throw new Error("Parameter 'sid' is not valid.");
|
|
33
|
-
}
|
|
34
|
-
this._solution = { fleetSid, sid };
|
|
35
|
-
this._uri = `/Fleets/${fleetSid}/Certificates/${sid}`;
|
|
36
|
-
}
|
|
37
|
-
remove(callback) {
|
|
38
|
-
const instance = this;
|
|
39
|
-
let operationVersion = instance._version, operationPromise = operationVersion.remove({
|
|
40
|
-
uri: instance._uri,
|
|
41
|
-
method: "delete",
|
|
42
|
-
});
|
|
43
|
-
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
44
|
-
return operationPromise;
|
|
45
|
-
}
|
|
46
|
-
fetch(callback) {
|
|
47
|
-
const instance = this;
|
|
48
|
-
let operationVersion = instance._version, operationPromise = operationVersion.fetch({
|
|
49
|
-
uri: instance._uri,
|
|
50
|
-
method: "get",
|
|
51
|
-
});
|
|
52
|
-
operationPromise = operationPromise.then((payload) => new CertificateInstance(operationVersion, payload, instance._solution.fleetSid, instance._solution.sid));
|
|
53
|
-
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
54
|
-
return operationPromise;
|
|
55
|
-
}
|
|
56
|
-
update(params, callback) {
|
|
57
|
-
if (params instanceof Function) {
|
|
58
|
-
callback = params;
|
|
59
|
-
params = {};
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
params = params || {};
|
|
63
|
-
}
|
|
64
|
-
let data = {};
|
|
65
|
-
if (params["friendlyName"] !== undefined)
|
|
66
|
-
data["FriendlyName"] = params["friendlyName"];
|
|
67
|
-
if (params["deviceSid"] !== undefined)
|
|
68
|
-
data["DeviceSid"] = params["deviceSid"];
|
|
69
|
-
const headers = {};
|
|
70
|
-
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
|
71
|
-
const instance = this;
|
|
72
|
-
let operationVersion = instance._version, operationPromise = operationVersion.update({
|
|
73
|
-
uri: instance._uri,
|
|
74
|
-
method: "post",
|
|
75
|
-
data,
|
|
76
|
-
headers,
|
|
77
|
-
});
|
|
78
|
-
operationPromise = operationPromise.then((payload) => new CertificateInstance(operationVersion, payload, instance._solution.fleetSid, instance._solution.sid));
|
|
79
|
-
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
80
|
-
return operationPromise;
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Provide a user-friendly representation
|
|
84
|
-
*
|
|
85
|
-
* @returns Object
|
|
86
|
-
*/
|
|
87
|
-
toJSON() {
|
|
88
|
-
return this._solution;
|
|
89
|
-
}
|
|
90
|
-
[util_1.inspect.custom](_depth, options) {
|
|
91
|
-
return (0, util_1.inspect)(this.toJSON(), options);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
exports.CertificateContextImpl = CertificateContextImpl;
|
|
95
|
-
class CertificateInstance {
|
|
96
|
-
constructor(_version, payload, fleetSid, sid) {
|
|
97
|
-
this._version = _version;
|
|
98
|
-
this.sid = payload.sid;
|
|
99
|
-
this.url = payload.url;
|
|
100
|
-
this.friendlyName = payload.friendly_name;
|
|
101
|
-
this.fleetSid = payload.fleet_sid;
|
|
102
|
-
this.accountSid = payload.account_sid;
|
|
103
|
-
this.deviceSid = payload.device_sid;
|
|
104
|
-
this.thumbprint = payload.thumbprint;
|
|
105
|
-
this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
|
|
106
|
-
this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated);
|
|
107
|
-
this._solution = { fleetSid, sid: sid || this.sid };
|
|
108
|
-
}
|
|
109
|
-
get _proxy() {
|
|
110
|
-
this._context =
|
|
111
|
-
this._context ||
|
|
112
|
-
new CertificateContextImpl(this._version, this._solution.fleetSid, this._solution.sid);
|
|
113
|
-
return this._context;
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* Remove a CertificateInstance
|
|
117
|
-
*
|
|
118
|
-
* @param callback - Callback to handle processed record
|
|
119
|
-
*
|
|
120
|
-
* @returns Resolves to processed boolean
|
|
121
|
-
*/
|
|
122
|
-
remove(callback) {
|
|
123
|
-
return this._proxy.remove(callback);
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* Fetch a CertificateInstance
|
|
127
|
-
*
|
|
128
|
-
* @param callback - Callback to handle processed record
|
|
129
|
-
*
|
|
130
|
-
* @returns Resolves to processed CertificateInstance
|
|
131
|
-
*/
|
|
132
|
-
fetch(callback) {
|
|
133
|
-
return this._proxy.fetch(callback);
|
|
134
|
-
}
|
|
135
|
-
update(params, callback) {
|
|
136
|
-
return this._proxy.update(params, callback);
|
|
137
|
-
}
|
|
138
|
-
/**
|
|
139
|
-
* Provide a user-friendly representation
|
|
140
|
-
*
|
|
141
|
-
* @returns Object
|
|
142
|
-
*/
|
|
143
|
-
toJSON() {
|
|
144
|
-
return {
|
|
145
|
-
sid: this.sid,
|
|
146
|
-
url: this.url,
|
|
147
|
-
friendlyName: this.friendlyName,
|
|
148
|
-
fleetSid: this.fleetSid,
|
|
149
|
-
accountSid: this.accountSid,
|
|
150
|
-
deviceSid: this.deviceSid,
|
|
151
|
-
thumbprint: this.thumbprint,
|
|
152
|
-
dateCreated: this.dateCreated,
|
|
153
|
-
dateUpdated: this.dateUpdated,
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
[util_1.inspect.custom](_depth, options) {
|
|
157
|
-
return (0, util_1.inspect)(this.toJSON(), options);
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
exports.CertificateInstance = CertificateInstance;
|
|
161
|
-
function CertificateListInstance(version, fleetSid) {
|
|
162
|
-
if (!(0, utility_1.isValidPathParam)(fleetSid)) {
|
|
163
|
-
throw new Error("Parameter 'fleetSid' is not valid.");
|
|
164
|
-
}
|
|
165
|
-
const instance = ((sid) => instance.get(sid));
|
|
166
|
-
instance.get = function get(sid) {
|
|
167
|
-
return new CertificateContextImpl(version, fleetSid, sid);
|
|
168
|
-
};
|
|
169
|
-
instance._version = version;
|
|
170
|
-
instance._solution = { fleetSid };
|
|
171
|
-
instance._uri = `/Fleets/${fleetSid}/Certificates`;
|
|
172
|
-
instance.create = function create(params, callback) {
|
|
173
|
-
if (params === null || params === undefined) {
|
|
174
|
-
throw new Error('Required parameter "params" missing.');
|
|
175
|
-
}
|
|
176
|
-
if (params["certificateData"] === null ||
|
|
177
|
-
params["certificateData"] === undefined) {
|
|
178
|
-
throw new Error("Required parameter \"params['certificateData']\" missing.");
|
|
179
|
-
}
|
|
180
|
-
let data = {};
|
|
181
|
-
data["CertificateData"] = params["certificateData"];
|
|
182
|
-
if (params["friendlyName"] !== undefined)
|
|
183
|
-
data["FriendlyName"] = params["friendlyName"];
|
|
184
|
-
if (params["deviceSid"] !== undefined)
|
|
185
|
-
data["DeviceSid"] = params["deviceSid"];
|
|
186
|
-
const headers = {};
|
|
187
|
-
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
|
188
|
-
let operationVersion = version, operationPromise = operationVersion.create({
|
|
189
|
-
uri: instance._uri,
|
|
190
|
-
method: "post",
|
|
191
|
-
data,
|
|
192
|
-
headers,
|
|
193
|
-
});
|
|
194
|
-
operationPromise = operationPromise.then((payload) => new CertificateInstance(operationVersion, payload, instance._solution.fleetSid));
|
|
195
|
-
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
196
|
-
return operationPromise;
|
|
197
|
-
};
|
|
198
|
-
instance.page = function page(params, callback) {
|
|
199
|
-
if (params instanceof Function) {
|
|
200
|
-
callback = params;
|
|
201
|
-
params = {};
|
|
202
|
-
}
|
|
203
|
-
else {
|
|
204
|
-
params = params || {};
|
|
205
|
-
}
|
|
206
|
-
let data = {};
|
|
207
|
-
if (params["deviceSid"] !== undefined)
|
|
208
|
-
data["DeviceSid"] = params["deviceSid"];
|
|
209
|
-
if (params["pageSize"] !== undefined)
|
|
210
|
-
data["PageSize"] = params["pageSize"];
|
|
211
|
-
if (params.pageNumber !== undefined)
|
|
212
|
-
data["Page"] = params.pageNumber;
|
|
213
|
-
if (params.pageToken !== undefined)
|
|
214
|
-
data["PageToken"] = params.pageToken;
|
|
215
|
-
const headers = {};
|
|
216
|
-
let operationVersion = version, operationPromise = operationVersion.page({
|
|
217
|
-
uri: instance._uri,
|
|
218
|
-
method: "get",
|
|
219
|
-
params: data,
|
|
220
|
-
headers,
|
|
221
|
-
});
|
|
222
|
-
operationPromise = operationPromise.then((payload) => new CertificatePage(operationVersion, payload, instance._solution));
|
|
223
|
-
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
224
|
-
return operationPromise;
|
|
225
|
-
};
|
|
226
|
-
instance.each = instance._version.each;
|
|
227
|
-
instance.list = instance._version.list;
|
|
228
|
-
instance.getPage = function getPage(targetUrl, callback) {
|
|
229
|
-
const operationPromise = instance._version._domain.twilio.request({
|
|
230
|
-
method: "get",
|
|
231
|
-
uri: targetUrl,
|
|
232
|
-
});
|
|
233
|
-
let pagePromise = operationPromise.then((payload) => new CertificatePage(instance._version, payload, instance._solution));
|
|
234
|
-
pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
|
|
235
|
-
return pagePromise;
|
|
236
|
-
};
|
|
237
|
-
instance.toJSON = function toJSON() {
|
|
238
|
-
return instance._solution;
|
|
239
|
-
};
|
|
240
|
-
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
|
241
|
-
return (0, util_1.inspect)(instance.toJSON(), options);
|
|
242
|
-
};
|
|
243
|
-
return instance;
|
|
244
|
-
}
|
|
245
|
-
exports.CertificateListInstance = CertificateListInstance;
|
|
246
|
-
class CertificatePage extends Page_1.default {
|
|
247
|
-
/**
|
|
248
|
-
* Initialize the CertificatePage
|
|
249
|
-
*
|
|
250
|
-
* @param version - Version of the resource
|
|
251
|
-
* @param response - Response from the API
|
|
252
|
-
* @param solution - Path solution
|
|
253
|
-
*/
|
|
254
|
-
constructor(version, response, solution) {
|
|
255
|
-
super(version, response, solution);
|
|
256
|
-
}
|
|
257
|
-
/**
|
|
258
|
-
* Build an instance of CertificateInstance
|
|
259
|
-
*
|
|
260
|
-
* @param payload - Payload response from the API
|
|
261
|
-
*/
|
|
262
|
-
getInstance(payload) {
|
|
263
|
-
return new CertificateInstance(this._version, payload, this._solution.fleetSid);
|
|
264
|
-
}
|
|
265
|
-
[util_1.inspect.custom](depth, options) {
|
|
266
|
-
return (0, util_1.inspect)(this.toJSON(), options);
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
exports.CertificatePage = CertificatePage;
|