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
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { inspect, InspectOptions } from "util";
|
|
3
|
+
import V1 from "../../V1";
|
|
4
|
+
export interface KnowledgeStatusContext {
|
|
5
|
+
/**
|
|
6
|
+
* Fetch a KnowledgeStatusInstance
|
|
7
|
+
*
|
|
8
|
+
* @param callback - Callback to handle processed record
|
|
9
|
+
*
|
|
10
|
+
* @returns Resolves to processed KnowledgeStatusInstance
|
|
11
|
+
*/
|
|
12
|
+
fetch(callback?: (error: Error | null, item?: KnowledgeStatusInstance) => any): Promise<KnowledgeStatusInstance>;
|
|
13
|
+
/**
|
|
14
|
+
* Provide a user-friendly representation
|
|
15
|
+
*/
|
|
16
|
+
toJSON(): any;
|
|
17
|
+
[inspect.custom](_depth: any, options: InspectOptions): any;
|
|
18
|
+
}
|
|
19
|
+
export interface KnowledgeStatusContextSolution {
|
|
20
|
+
id: string;
|
|
21
|
+
}
|
|
22
|
+
export declare class KnowledgeStatusContextImpl implements KnowledgeStatusContext {
|
|
23
|
+
protected _version: V1;
|
|
24
|
+
protected _solution: KnowledgeStatusContextSolution;
|
|
25
|
+
protected _uri: string;
|
|
26
|
+
constructor(_version: V1, id: string);
|
|
27
|
+
fetch(callback?: (error: Error | null, item?: KnowledgeStatusInstance) => any): Promise<KnowledgeStatusInstance>;
|
|
28
|
+
/**
|
|
29
|
+
* Provide a user-friendly representation
|
|
30
|
+
*
|
|
31
|
+
* @returns Object
|
|
32
|
+
*/
|
|
33
|
+
toJSON(): KnowledgeStatusContextSolution;
|
|
34
|
+
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
35
|
+
}
|
|
36
|
+
interface KnowledgeStatusResource {
|
|
37
|
+
account_sid: string;
|
|
38
|
+
status: string;
|
|
39
|
+
last_status: string;
|
|
40
|
+
date_updated: Date;
|
|
41
|
+
}
|
|
42
|
+
export declare class KnowledgeStatusInstance {
|
|
43
|
+
protected _version: V1;
|
|
44
|
+
protected _solution: KnowledgeStatusContextSolution;
|
|
45
|
+
protected _context?: KnowledgeStatusContext;
|
|
46
|
+
constructor(_version: V1, payload: KnowledgeStatusResource, id: string);
|
|
47
|
+
/**
|
|
48
|
+
* The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Knowledge resource.
|
|
49
|
+
*/
|
|
50
|
+
accountSid: string;
|
|
51
|
+
/**
|
|
52
|
+
* The status of processing the knowledge source (\'QUEUED\', \'PROCESSING\', \'COMPLETED\', \'FAILED\')
|
|
53
|
+
*/
|
|
54
|
+
status: string;
|
|
55
|
+
/**
|
|
56
|
+
* The last status of processing the knowledge source (\'QUEUED\', \'PROCESSING\', \'COMPLETED\', \'FAILED\')
|
|
57
|
+
*/
|
|
58
|
+
lastStatus: string;
|
|
59
|
+
/**
|
|
60
|
+
* The date and time in GMT when the Knowledge was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
|
61
|
+
*/
|
|
62
|
+
dateUpdated: Date;
|
|
63
|
+
private get _proxy();
|
|
64
|
+
/**
|
|
65
|
+
* Fetch a KnowledgeStatusInstance
|
|
66
|
+
*
|
|
67
|
+
* @param callback - Callback to handle processed record
|
|
68
|
+
*
|
|
69
|
+
* @returns Resolves to processed KnowledgeStatusInstance
|
|
70
|
+
*/
|
|
71
|
+
fetch(callback?: (error: Error | null, item?: KnowledgeStatusInstance) => any): Promise<KnowledgeStatusInstance>;
|
|
72
|
+
/**
|
|
73
|
+
* Provide a user-friendly representation
|
|
74
|
+
*
|
|
75
|
+
* @returns Object
|
|
76
|
+
*/
|
|
77
|
+
toJSON(): {
|
|
78
|
+
accountSid: string;
|
|
79
|
+
status: string;
|
|
80
|
+
lastStatus: string;
|
|
81
|
+
dateUpdated: Date;
|
|
82
|
+
};
|
|
83
|
+
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
84
|
+
}
|
|
85
|
+
export interface KnowledgeStatusSolution {
|
|
86
|
+
id: string;
|
|
87
|
+
}
|
|
88
|
+
export interface KnowledgeStatusListInstance {
|
|
89
|
+
_version: V1;
|
|
90
|
+
_solution: KnowledgeStatusSolution;
|
|
91
|
+
_uri: string;
|
|
92
|
+
(): KnowledgeStatusContext;
|
|
93
|
+
get(): KnowledgeStatusContext;
|
|
94
|
+
/**
|
|
95
|
+
* Provide a user-friendly representation
|
|
96
|
+
*/
|
|
97
|
+
toJSON(): any;
|
|
98
|
+
[inspect.custom](_depth: any, options: InspectOptions): any;
|
|
99
|
+
}
|
|
100
|
+
export declare function KnowledgeStatusListInstance(version: V1, id: string): KnowledgeStatusListInstance;
|
|
101
|
+
export {};
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* This code was generated by
|
|
4
|
+
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
|
5
|
+
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
|
6
|
+
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
|
7
|
+
*
|
|
8
|
+
* Twilio - Assistants
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.KnowledgeStatusListInstance = exports.KnowledgeStatusInstance = exports.KnowledgeStatusContextImpl = void 0;
|
|
17
|
+
const util_1 = require("util");
|
|
18
|
+
const deserialize = require("../../../../base/deserialize");
|
|
19
|
+
const serialize = require("../../../../base/serialize");
|
|
20
|
+
const utility_1 = require("../../../../base/utility");
|
|
21
|
+
class KnowledgeStatusContextImpl {
|
|
22
|
+
constructor(_version, id) {
|
|
23
|
+
this._version = _version;
|
|
24
|
+
if (!(0, utility_1.isValidPathParam)(id)) {
|
|
25
|
+
throw new Error("Parameter 'id' is not valid.");
|
|
26
|
+
}
|
|
27
|
+
this._solution = { id };
|
|
28
|
+
this._uri = `/Knowledge/${id}/Status`;
|
|
29
|
+
}
|
|
30
|
+
fetch(callback) {
|
|
31
|
+
const instance = this;
|
|
32
|
+
let operationVersion = instance._version, operationPromise = operationVersion.fetch({
|
|
33
|
+
uri: instance._uri,
|
|
34
|
+
method: "get",
|
|
35
|
+
});
|
|
36
|
+
operationPromise = operationPromise.then((payload) => new KnowledgeStatusInstance(operationVersion, payload, instance._solution.id));
|
|
37
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
38
|
+
return operationPromise;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Provide a user-friendly representation
|
|
42
|
+
*
|
|
43
|
+
* @returns Object
|
|
44
|
+
*/
|
|
45
|
+
toJSON() {
|
|
46
|
+
return this._solution;
|
|
47
|
+
}
|
|
48
|
+
[util_1.inspect.custom](_depth, options) {
|
|
49
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.KnowledgeStatusContextImpl = KnowledgeStatusContextImpl;
|
|
53
|
+
class KnowledgeStatusInstance {
|
|
54
|
+
constructor(_version, payload, id) {
|
|
55
|
+
this._version = _version;
|
|
56
|
+
this.accountSid = payload.account_sid;
|
|
57
|
+
this.status = payload.status;
|
|
58
|
+
this.lastStatus = payload.last_status;
|
|
59
|
+
this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated);
|
|
60
|
+
this._solution = { id };
|
|
61
|
+
}
|
|
62
|
+
get _proxy() {
|
|
63
|
+
this._context =
|
|
64
|
+
this._context ||
|
|
65
|
+
new KnowledgeStatusContextImpl(this._version, this._solution.id);
|
|
66
|
+
return this._context;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Fetch a KnowledgeStatusInstance
|
|
70
|
+
*
|
|
71
|
+
* @param callback - Callback to handle processed record
|
|
72
|
+
*
|
|
73
|
+
* @returns Resolves to processed KnowledgeStatusInstance
|
|
74
|
+
*/
|
|
75
|
+
fetch(callback) {
|
|
76
|
+
return this._proxy.fetch(callback);
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Provide a user-friendly representation
|
|
80
|
+
*
|
|
81
|
+
* @returns Object
|
|
82
|
+
*/
|
|
83
|
+
toJSON() {
|
|
84
|
+
return {
|
|
85
|
+
accountSid: this.accountSid,
|
|
86
|
+
status: this.status,
|
|
87
|
+
lastStatus: this.lastStatus,
|
|
88
|
+
dateUpdated: this.dateUpdated,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
[util_1.inspect.custom](_depth, options) {
|
|
92
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
exports.KnowledgeStatusInstance = KnowledgeStatusInstance;
|
|
96
|
+
function KnowledgeStatusListInstance(version, id) {
|
|
97
|
+
if (!(0, utility_1.isValidPathParam)(id)) {
|
|
98
|
+
throw new Error("Parameter 'id' is not valid.");
|
|
99
|
+
}
|
|
100
|
+
const instance = (() => instance.get());
|
|
101
|
+
instance.get = function get() {
|
|
102
|
+
return new KnowledgeStatusContextImpl(version, id);
|
|
103
|
+
};
|
|
104
|
+
instance._version = version;
|
|
105
|
+
instance._solution = { id };
|
|
106
|
+
instance._uri = ``;
|
|
107
|
+
instance.toJSON = function toJSON() {
|
|
108
|
+
return instance._solution;
|
|
109
|
+
};
|
|
110
|
+
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
|
111
|
+
return (0, util_1.inspect)(instance.toJSON(), options);
|
|
112
|
+
};
|
|
113
|
+
return instance;
|
|
114
|
+
}
|
|
115
|
+
exports.KnowledgeStatusListInstance = KnowledgeStatusListInstance;
|
|
@@ -4,6 +4,7 @@ import Page, { TwilioResponsePayload } from "../../../base/Page";
|
|
|
4
4
|
import Response from "../../../http/response";
|
|
5
5
|
import V1 from "../V1";
|
|
6
6
|
import { ChunkListInstance } from "./knowledge/chunk";
|
|
7
|
+
import { KnowledgeStatusListInstance } from "./knowledge/knowledgeStatus";
|
|
7
8
|
export declare class AssistantsV1ServiceCreateKnowledgeRequest {
|
|
8
9
|
/**
|
|
9
10
|
* The Assistant ID.
|
|
@@ -120,6 +121,7 @@ export interface KnowledgeListInstancePageOptions {
|
|
|
120
121
|
}
|
|
121
122
|
export interface KnowledgeContext {
|
|
122
123
|
chunks: ChunkListInstance;
|
|
124
|
+
knowledgeStatus: KnowledgeStatusListInstance;
|
|
123
125
|
/**
|
|
124
126
|
* Remove a KnowledgeInstance
|
|
125
127
|
*
|
|
@@ -167,8 +169,10 @@ export declare class KnowledgeContextImpl implements KnowledgeContext {
|
|
|
167
169
|
protected _solution: KnowledgeContextSolution;
|
|
168
170
|
protected _uri: string;
|
|
169
171
|
protected _chunks?: ChunkListInstance;
|
|
172
|
+
protected _knowledgeStatus?: KnowledgeStatusListInstance;
|
|
170
173
|
constructor(_version: V1, id: string);
|
|
171
174
|
get chunks(): ChunkListInstance;
|
|
175
|
+
get knowledgeStatus(): KnowledgeStatusListInstance;
|
|
172
176
|
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
|
173
177
|
fetch(callback?: (error: Error | null, item?: KnowledgeInstance) => any): Promise<KnowledgeInstance>;
|
|
174
178
|
update(params?: AssistantsV1ServiceUpdateKnowledgeRequest | ((error: Error | null, item?: KnowledgeInstance) => any), callback?: (error: Error | null, item?: KnowledgeInstance) => any): Promise<KnowledgeInstance>;
|
|
@@ -191,6 +195,7 @@ interface KnowledgeResource {
|
|
|
191
195
|
name: string;
|
|
192
196
|
status: string;
|
|
193
197
|
type: string;
|
|
198
|
+
url: string;
|
|
194
199
|
date_created: Date;
|
|
195
200
|
date_updated: Date;
|
|
196
201
|
}
|
|
@@ -227,6 +232,10 @@ export declare class KnowledgeInstance {
|
|
|
227
232
|
* The type of knowledge source (\'Web\', \'Database\', \'Text\', \'File\')
|
|
228
233
|
*/
|
|
229
234
|
type: string;
|
|
235
|
+
/**
|
|
236
|
+
* The url of the knowledge resource.
|
|
237
|
+
*/
|
|
238
|
+
url: string;
|
|
230
239
|
/**
|
|
231
240
|
* The date and time in GMT when the Knowledge was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
|
232
241
|
*/
|
|
@@ -273,6 +282,10 @@ export declare class KnowledgeInstance {
|
|
|
273
282
|
* Access the chunks.
|
|
274
283
|
*/
|
|
275
284
|
chunks(): ChunkListInstance;
|
|
285
|
+
/**
|
|
286
|
+
* Access the knowledgeStatus.
|
|
287
|
+
*/
|
|
288
|
+
knowledgeStatus(): KnowledgeStatusListInstance;
|
|
276
289
|
/**
|
|
277
290
|
* Provide a user-friendly representation
|
|
278
291
|
*
|
|
@@ -286,6 +299,7 @@ export declare class KnowledgeInstance {
|
|
|
286
299
|
name: string;
|
|
287
300
|
status: string;
|
|
288
301
|
type: string;
|
|
302
|
+
url: string;
|
|
289
303
|
dateCreated: Date;
|
|
290
304
|
dateUpdated: Date;
|
|
291
305
|
};
|
|
@@ -23,6 +23,7 @@ const deserialize = require("../../../base/deserialize");
|
|
|
23
23
|
const serialize = require("../../../base/serialize");
|
|
24
24
|
const utility_1 = require("../../../base/utility");
|
|
25
25
|
const chunk_1 = require("./knowledge/chunk");
|
|
26
|
+
const knowledgeStatus_1 = require("./knowledge/knowledgeStatus");
|
|
26
27
|
class AssistantsV1ServiceCreateKnowledgeRequest {
|
|
27
28
|
}
|
|
28
29
|
exports.AssistantsV1ServiceCreateKnowledgeRequest = AssistantsV1ServiceCreateKnowledgeRequest;
|
|
@@ -46,6 +47,12 @@ class KnowledgeContextImpl {
|
|
|
46
47
|
this._chunks || (0, chunk_1.ChunkListInstance)(this._version, this._solution.id);
|
|
47
48
|
return this._chunks;
|
|
48
49
|
}
|
|
50
|
+
get knowledgeStatus() {
|
|
51
|
+
this._knowledgeStatus =
|
|
52
|
+
this._knowledgeStatus ||
|
|
53
|
+
(0, knowledgeStatus_1.KnowledgeStatusListInstance)(this._version, this._solution.id);
|
|
54
|
+
return this._knowledgeStatus;
|
|
55
|
+
}
|
|
49
56
|
remove(callback) {
|
|
50
57
|
const instance = this;
|
|
51
58
|
let operationVersion = instance._version, operationPromise = operationVersion.remove({
|
|
@@ -111,6 +118,7 @@ class KnowledgeInstance {
|
|
|
111
118
|
this.name = payload.name;
|
|
112
119
|
this.status = payload.status;
|
|
113
120
|
this.type = payload.type;
|
|
121
|
+
this.url = payload.url;
|
|
114
122
|
this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
|
|
115
123
|
this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated);
|
|
116
124
|
this._solution = { id: id || this.id };
|
|
@@ -150,6 +158,12 @@ class KnowledgeInstance {
|
|
|
150
158
|
chunks() {
|
|
151
159
|
return this._proxy.chunks;
|
|
152
160
|
}
|
|
161
|
+
/**
|
|
162
|
+
* Access the knowledgeStatus.
|
|
163
|
+
*/
|
|
164
|
+
knowledgeStatus() {
|
|
165
|
+
return this._proxy.knowledgeStatus;
|
|
166
|
+
}
|
|
153
167
|
/**
|
|
154
168
|
* Provide a user-friendly representation
|
|
155
169
|
*
|
|
@@ -164,6 +178,7 @@ class KnowledgeInstance {
|
|
|
164
178
|
name: this.name,
|
|
165
179
|
status: this.status,
|
|
166
180
|
type: this.type,
|
|
181
|
+
url: this.url,
|
|
167
182
|
dateCreated: this.dateCreated,
|
|
168
183
|
dateUpdated: this.dateUpdated,
|
|
169
184
|
};
|
|
@@ -49,6 +49,44 @@ export declare class AssistantsV1ServiceCreateToolRequest {
|
|
|
49
49
|
*/
|
|
50
50
|
"type": string;
|
|
51
51
|
}
|
|
52
|
+
export declare class AssistantsV1ServicePolicy {
|
|
53
|
+
/**
|
|
54
|
+
* The Policy ID.
|
|
55
|
+
*/
|
|
56
|
+
"id"?: string;
|
|
57
|
+
/**
|
|
58
|
+
* The name of the policy.
|
|
59
|
+
*/
|
|
60
|
+
"name"?: string;
|
|
61
|
+
/**
|
|
62
|
+
* The description of the policy.
|
|
63
|
+
*/
|
|
64
|
+
"description"?: string;
|
|
65
|
+
/**
|
|
66
|
+
* The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Policy resource.
|
|
67
|
+
*/
|
|
68
|
+
"accountSid"?: string;
|
|
69
|
+
/**
|
|
70
|
+
* The SID of the User that created the Policy resource.
|
|
71
|
+
*/
|
|
72
|
+
"userSid"?: string;
|
|
73
|
+
/**
|
|
74
|
+
* The type of the policy.
|
|
75
|
+
*/
|
|
76
|
+
"type": string;
|
|
77
|
+
/**
|
|
78
|
+
* The details of the policy based on the type.
|
|
79
|
+
*/
|
|
80
|
+
"policyDetails": Record<string, object>;
|
|
81
|
+
/**
|
|
82
|
+
* The date and time in GMT when the Policy was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
|
83
|
+
*/
|
|
84
|
+
"dateCreated"?: Date;
|
|
85
|
+
/**
|
|
86
|
+
* The date and time in GMT when the Policy was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
|
87
|
+
*/
|
|
88
|
+
"dateUpdated"?: Date;
|
|
89
|
+
}
|
|
52
90
|
export declare class AssistantsV1ServiceUpdateToolRequest {
|
|
53
91
|
/**
|
|
54
92
|
* The Assistant ID.
|
|
@@ -138,6 +176,14 @@ export interface ToolContext {
|
|
|
138
176
|
* @returns Resolves to processed boolean
|
|
139
177
|
*/
|
|
140
178
|
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
|
179
|
+
/**
|
|
180
|
+
* Fetch a ToolInstance
|
|
181
|
+
*
|
|
182
|
+
* @param callback - Callback to handle processed record
|
|
183
|
+
*
|
|
184
|
+
* @returns Resolves to processed ToolInstance
|
|
185
|
+
*/
|
|
186
|
+
fetch(callback?: (error: Error | null, item?: ToolInstance) => any): Promise<ToolInstance>;
|
|
141
187
|
/**
|
|
142
188
|
* Update a ToolInstance
|
|
143
189
|
*
|
|
@@ -170,6 +216,7 @@ export declare class ToolContextImpl implements ToolContext {
|
|
|
170
216
|
protected _uri: string;
|
|
171
217
|
constructor(_version: V1, id: string);
|
|
172
218
|
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
|
219
|
+
fetch(callback?: (error: Error | null, item?: ToolInstance) => any): Promise<ToolInstance>;
|
|
173
220
|
update(params?: AssistantsV1ServiceUpdateToolRequest | ((error: Error | null, item?: ToolInstance) => any), callback?: (error: Error | null, item?: ToolInstance) => any): Promise<ToolInstance>;
|
|
174
221
|
/**
|
|
175
222
|
* Provide a user-friendly representation
|
|
@@ -191,8 +238,10 @@ interface ToolResource {
|
|
|
191
238
|
name: string;
|
|
192
239
|
requires_auth: boolean;
|
|
193
240
|
type: string;
|
|
241
|
+
url: string;
|
|
194
242
|
date_created: Date;
|
|
195
243
|
date_updated: Date;
|
|
244
|
+
policies: Array<AssistantsV1ServicePolicy>;
|
|
196
245
|
}
|
|
197
246
|
export declare class ToolInstance {
|
|
198
247
|
protected _version: V1;
|
|
@@ -231,6 +280,10 @@ export declare class ToolInstance {
|
|
|
231
280
|
* The type of the tool. (\'WEBHOOK\')
|
|
232
281
|
*/
|
|
233
282
|
type: string;
|
|
283
|
+
/**
|
|
284
|
+
* The url of the tool resource.
|
|
285
|
+
*/
|
|
286
|
+
url: string;
|
|
234
287
|
/**
|
|
235
288
|
* The date and time in GMT when the Tool was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
|
236
289
|
*/
|
|
@@ -239,6 +292,10 @@ export declare class ToolInstance {
|
|
|
239
292
|
* The date and time in GMT when the Tool was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
|
240
293
|
*/
|
|
241
294
|
dateUpdated: Date;
|
|
295
|
+
/**
|
|
296
|
+
* The Policies associated with the tool.
|
|
297
|
+
*/
|
|
298
|
+
policies: Array<AssistantsV1ServicePolicy>;
|
|
242
299
|
private get _proxy();
|
|
243
300
|
/**
|
|
244
301
|
* Remove a ToolInstance
|
|
@@ -248,6 +305,14 @@ export declare class ToolInstance {
|
|
|
248
305
|
* @returns Resolves to processed boolean
|
|
249
306
|
*/
|
|
250
307
|
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
|
308
|
+
/**
|
|
309
|
+
* Fetch a ToolInstance
|
|
310
|
+
*
|
|
311
|
+
* @param callback - Callback to handle processed record
|
|
312
|
+
*
|
|
313
|
+
* @returns Resolves to processed ToolInstance
|
|
314
|
+
*/
|
|
315
|
+
fetch(callback?: (error: Error | null, item?: ToolInstance) => any): Promise<ToolInstance>;
|
|
251
316
|
/**
|
|
252
317
|
* Update a ToolInstance
|
|
253
318
|
*
|
|
@@ -279,8 +344,10 @@ export declare class ToolInstance {
|
|
|
279
344
|
name: string;
|
|
280
345
|
requiresAuth: boolean;
|
|
281
346
|
type: string;
|
|
347
|
+
url: string;
|
|
282
348
|
dateCreated: Date;
|
|
283
349
|
dateUpdated: Date;
|
|
350
|
+
policies: AssistantsV1ServicePolicy[];
|
|
284
351
|
};
|
|
285
352
|
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
286
353
|
}
|
|
@@ -16,7 +16,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
16
16
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17
17
|
};
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.ToolPage = exports.ToolListInstance = exports.ToolInstance = exports.ToolContextImpl = exports.AssistantsV1ServiceUpdateToolRequest = exports.AssistantsV1ServiceCreateToolRequest = exports.AssistantsV1ServiceCreatePolicyRequest = void 0;
|
|
19
|
+
exports.ToolPage = exports.ToolListInstance = exports.ToolInstance = exports.ToolContextImpl = exports.AssistantsV1ServiceUpdateToolRequest = exports.AssistantsV1ServicePolicy = exports.AssistantsV1ServiceCreateToolRequest = exports.AssistantsV1ServiceCreatePolicyRequest = void 0;
|
|
20
20
|
const util_1 = require("util");
|
|
21
21
|
const Page_1 = __importDefault(require("../../../base/Page"));
|
|
22
22
|
const deserialize = require("../../../base/deserialize");
|
|
@@ -28,6 +28,9 @@ exports.AssistantsV1ServiceCreatePolicyRequest = AssistantsV1ServiceCreatePolicy
|
|
|
28
28
|
class AssistantsV1ServiceCreateToolRequest {
|
|
29
29
|
}
|
|
30
30
|
exports.AssistantsV1ServiceCreateToolRequest = AssistantsV1ServiceCreateToolRequest;
|
|
31
|
+
class AssistantsV1ServicePolicy {
|
|
32
|
+
}
|
|
33
|
+
exports.AssistantsV1ServicePolicy = AssistantsV1ServicePolicy;
|
|
31
34
|
class AssistantsV1ServiceUpdateToolRequest {
|
|
32
35
|
}
|
|
33
36
|
exports.AssistantsV1ServiceUpdateToolRequest = AssistantsV1ServiceUpdateToolRequest;
|
|
@@ -49,6 +52,16 @@ class ToolContextImpl {
|
|
|
49
52
|
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
50
53
|
return operationPromise;
|
|
51
54
|
}
|
|
55
|
+
fetch(callback) {
|
|
56
|
+
const instance = this;
|
|
57
|
+
let operationVersion = instance._version, operationPromise = operationVersion.fetch({
|
|
58
|
+
uri: instance._uri,
|
|
59
|
+
method: "get",
|
|
60
|
+
});
|
|
61
|
+
operationPromise = operationPromise.then((payload) => new ToolInstance(operationVersion, payload, instance._solution.id));
|
|
62
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
63
|
+
return operationPromise;
|
|
64
|
+
}
|
|
52
65
|
update(params, callback) {
|
|
53
66
|
if (params instanceof Function) {
|
|
54
67
|
callback = params;
|
|
@@ -96,8 +109,10 @@ class ToolInstance {
|
|
|
96
109
|
this.name = payload.name;
|
|
97
110
|
this.requiresAuth = payload.requires_auth;
|
|
98
111
|
this.type = payload.type;
|
|
112
|
+
this.url = payload.url;
|
|
99
113
|
this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
|
|
100
114
|
this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated);
|
|
115
|
+
this.policies = payload.policies;
|
|
101
116
|
this._solution = { id: id || this.id };
|
|
102
117
|
}
|
|
103
118
|
get _proxy() {
|
|
@@ -115,6 +130,16 @@ class ToolInstance {
|
|
|
115
130
|
remove(callback) {
|
|
116
131
|
return this._proxy.remove(callback);
|
|
117
132
|
}
|
|
133
|
+
/**
|
|
134
|
+
* Fetch a ToolInstance
|
|
135
|
+
*
|
|
136
|
+
* @param callback - Callback to handle processed record
|
|
137
|
+
*
|
|
138
|
+
* @returns Resolves to processed ToolInstance
|
|
139
|
+
*/
|
|
140
|
+
fetch(callback) {
|
|
141
|
+
return this._proxy.fetch(callback);
|
|
142
|
+
}
|
|
118
143
|
update(params, callback) {
|
|
119
144
|
return this._proxy.update(params, callback);
|
|
120
145
|
}
|
|
@@ -133,8 +158,10 @@ class ToolInstance {
|
|
|
133
158
|
name: this.name,
|
|
134
159
|
requiresAuth: this.requiresAuth,
|
|
135
160
|
type: this.type,
|
|
161
|
+
url: this.url,
|
|
136
162
|
dateCreated: this.dateCreated,
|
|
137
163
|
dateUpdated: this.dateUpdated,
|
|
164
|
+
policies: this.policies,
|
|
138
165
|
};
|
|
139
166
|
}
|
|
140
167
|
[util_1.inspect.custom](_depth, options) {
|
package/lib/rest/iam/V1.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import IamBase from "../IamBase";
|
|
|
2
2
|
import Version from "../../base/Version";
|
|
3
3
|
import { ApiKeyListInstance } from "./v1/apiKey";
|
|
4
4
|
import { GetApiKeysListInstance } from "./v1/getApiKeys";
|
|
5
|
-
import {
|
|
5
|
+
import { KeyListInstance } from "./v1/key";
|
|
6
6
|
export default class V1 extends Version {
|
|
7
7
|
/**
|
|
8
8
|
* Initialize the V1 version of Iam
|
|
@@ -14,12 +14,12 @@ export default class V1 extends Version {
|
|
|
14
14
|
protected _apiKey?: ApiKeyListInstance;
|
|
15
15
|
/** getApiKeys - { Twilio.Iam.V1.GetApiKeysListInstance } resource */
|
|
16
16
|
protected _getApiKeys?: GetApiKeysListInstance;
|
|
17
|
-
/**
|
|
18
|
-
protected
|
|
17
|
+
/** keys - { Twilio.Iam.V1.KeyListInstance } resource */
|
|
18
|
+
protected _keys?: KeyListInstance;
|
|
19
19
|
/** Getter for apiKey resource */
|
|
20
20
|
get apiKey(): ApiKeyListInstance;
|
|
21
21
|
/** Getter for getApiKeys resource */
|
|
22
22
|
get getApiKeys(): GetApiKeysListInstance;
|
|
23
|
-
/** Getter for
|
|
24
|
-
get
|
|
23
|
+
/** Getter for keys resource */
|
|
24
|
+
get keys(): KeyListInstance;
|
|
25
25
|
}
|
package/lib/rest/iam/V1.js
CHANGED
|
@@ -19,7 +19,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
19
19
|
const Version_1 = __importDefault(require("../../base/Version"));
|
|
20
20
|
const apiKey_1 = require("./v1/apiKey");
|
|
21
21
|
const getApiKeys_1 = require("./v1/getApiKeys");
|
|
22
|
-
const
|
|
22
|
+
const key_1 = require("./v1/key");
|
|
23
23
|
class V1 extends Version_1.default {
|
|
24
24
|
/**
|
|
25
25
|
* Initialize the V1 version of Iam
|
|
@@ -39,10 +39,10 @@ class V1 extends Version_1.default {
|
|
|
39
39
|
this._getApiKeys = this._getApiKeys || (0, getApiKeys_1.GetApiKeysListInstance)(this);
|
|
40
40
|
return this._getApiKeys;
|
|
41
41
|
}
|
|
42
|
-
/** Getter for
|
|
43
|
-
get
|
|
44
|
-
this.
|
|
45
|
-
return this.
|
|
42
|
+
/** Getter for keys resource */
|
|
43
|
+
get keys() {
|
|
44
|
+
this._keys = this._keys || (0, key_1.KeyListInstance)(this);
|
|
45
|
+
return this._keys;
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
exports.default = V1;
|
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { inspect, InspectOptions } from "util";
|
|
3
3
|
import V1 from "../V1";
|
|
4
|
-
export type
|
|
4
|
+
export type KeyKeytype = "restricted";
|
|
5
5
|
/**
|
|
6
|
-
* Options to pass to create a
|
|
6
|
+
* Options to pass to create a KeyInstance
|
|
7
7
|
*/
|
|
8
|
-
export interface
|
|
8
|
+
export interface KeyListInstanceCreateOptions {
|
|
9
9
|
/** The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Payments resource. */
|
|
10
10
|
accountSid: string;
|
|
11
11
|
/** A descriptive string that you create to describe the resource. It can be up to 64 characters long. */
|
|
12
12
|
friendlyName?: string;
|
|
13
13
|
/** */
|
|
14
|
-
keyType?:
|
|
14
|
+
keyType?: KeyKeytype;
|
|
15
15
|
/** The \\\\`Policy\\\\` object is a collection that specifies the allowed Twilio permissions for the restricted key. For more information on the permissions available with restricted API keys, refer to the [Twilio documentation](https://www.twilio.com/docs/iam/api-keys/restricted-api-keys#permissions-available-with-restricted-api-keys). */
|
|
16
16
|
policy?: any;
|
|
17
17
|
}
|
|
18
|
-
export interface
|
|
18
|
+
export interface KeySolution {
|
|
19
19
|
}
|
|
20
|
-
export interface
|
|
20
|
+
export interface KeyListInstance {
|
|
21
21
|
_version: V1;
|
|
22
|
-
_solution:
|
|
22
|
+
_solution: KeySolution;
|
|
23
23
|
_uri: string;
|
|
24
24
|
/**
|
|
25
|
-
* Create a
|
|
25
|
+
* Create a KeyInstance
|
|
26
26
|
*
|
|
27
27
|
* @param params - Parameter for request
|
|
28
28
|
* @param callback - Callback to handle processed record
|
|
29
29
|
*
|
|
30
|
-
* @returns Resolves to processed
|
|
30
|
+
* @returns Resolves to processed KeyInstance
|
|
31
31
|
*/
|
|
32
|
-
create(params:
|
|
32
|
+
create(params: KeyListInstanceCreateOptions, callback?: (error: Error | null, item?: KeyInstance) => any): Promise<KeyInstance>;
|
|
33
33
|
/**
|
|
34
34
|
* Provide a user-friendly representation
|
|
35
35
|
*/
|
|
36
36
|
toJSON(): any;
|
|
37
37
|
[inspect.custom](_depth: any, options: InspectOptions): any;
|
|
38
38
|
}
|
|
39
|
-
export declare function
|
|
40
|
-
interface
|
|
39
|
+
export declare function KeyListInstance(version: V1): KeyListInstance;
|
|
40
|
+
interface KeyResource {
|
|
41
41
|
sid: string;
|
|
42
42
|
friendly_name: string;
|
|
43
43
|
date_created: Date;
|
|
@@ -45,9 +45,9 @@ interface NewApiKeyResource {
|
|
|
45
45
|
secret: string;
|
|
46
46
|
policy: any;
|
|
47
47
|
}
|
|
48
|
-
export declare class
|
|
48
|
+
export declare class KeyInstance {
|
|
49
49
|
protected _version: V1;
|
|
50
|
-
constructor(_version: V1, payload:
|
|
50
|
+
constructor(_version: V1, payload: KeyResource);
|
|
51
51
|
/**
|
|
52
52
|
* The unique string that that we created to identify the NewKey resource. You will use this as the basic-auth `user` when authenticating to the API.
|
|
53
53
|
*/
|