twilio 5.3.1 → 5.3.2

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.
Files changed (29) hide show
  1. package/lib/rest/Preview.d.ts +0 -5
  2. package/lib/rest/Preview.js +0 -7
  3. package/lib/rest/accounts/V1.d.ts +10 -0
  4. package/lib/rest/accounts/V1.js +12 -0
  5. package/lib/rest/accounts/v1/bulkConsents.d.ts +53 -0
  6. package/lib/rest/accounts/v1/bulkConsents.js +74 -0
  7. package/lib/rest/accounts/v1/bulkContacts.d.ts +53 -0
  8. package/lib/rest/accounts/v1/bulkContacts.js +74 -0
  9. package/lib/rest/assistants/v1/assistant/assistantsKnowledge.d.ts +260 -0
  10. package/lib/rest/assistants/v1/assistant/assistantsKnowledge.js +214 -0
  11. package/lib/rest/assistants/v1/assistant/assistantsTool.d.ts +266 -0
  12. package/lib/rest/assistants/v1/assistant/assistantsTool.js +216 -0
  13. package/lib/rest/assistants/v1/assistant/message.d.ts +112 -0
  14. package/lib/rest/assistants/v1/assistant/message.js +90 -0
  15. package/lib/rest/assistants/v1/assistant.d.ts +38 -0
  16. package/lib/rest/assistants/v1/assistant.js +40 -0
  17. package/lib/rest/assistants/v1/knowledge/knowledgeStatus.d.ts +101 -0
  18. package/lib/rest/assistants/v1/knowledge/knowledgeStatus.js +115 -0
  19. package/lib/rest/assistants/v1/knowledge.d.ts +14 -0
  20. package/lib/rest/assistants/v1/knowledge.js +15 -0
  21. package/lib/rest/assistants/v1/tool.d.ts +67 -0
  22. package/lib/rest/assistants/v1/tool.js +28 -1
  23. package/lib/rest/numbers/V1.d.ts +5 -5
  24. package/lib/rest/numbers/V1.js +6 -8
  25. package/lib/rest/numbers/v1/{portingWebhookConfigurationFetch.d.ts → webhook.d.ts} +10 -10
  26. package/lib/rest/numbers/v1/{portingWebhookConfigurationFetch.js → webhook.js} +6 -6
  27. package/lib/rest/serverless/v1/service/environment/deployment.d.ts +2 -0
  28. package/lib/rest/serverless/v1/service/environment/deployment.js +2 -0
  29. package/package.json +1 -1
@@ -0,0 +1,112 @@
1
+ /// <reference types="node" />
2
+ import { inspect, InspectOptions } from "util";
3
+ import V1 from "../../V1";
4
+ export declare class AssistantsV1ServiceAssistantSendMessageRequest {
5
+ /**
6
+ * The unique identity of user for the session.
7
+ */
8
+ "identity": string;
9
+ /**
10
+ * The unique name for the session.
11
+ */
12
+ "sessionId"?: string;
13
+ /**
14
+ * The query to ask the assistant.
15
+ */
16
+ "body": string;
17
+ /**
18
+ * The webhook url to call after the assistant has generated a response or report an error.
19
+ */
20
+ "webhook"?: string;
21
+ /**
22
+ * one of the modes \'chat\', \'email\' or \'voice\'
23
+ */
24
+ "mode"?: string;
25
+ }
26
+ /**
27
+ * Options to pass to create a MessageInstance
28
+ */
29
+ export interface MessageListInstanceCreateOptions {
30
+ /** */
31
+ assistantsV1ServiceAssistantSendMessageRequest: AssistantsV1ServiceAssistantSendMessageRequest;
32
+ }
33
+ export interface MessageSolution {
34
+ id: string;
35
+ }
36
+ export interface MessageListInstance {
37
+ _version: V1;
38
+ _solution: MessageSolution;
39
+ _uri: string;
40
+ /**
41
+ * Create a MessageInstance
42
+ *
43
+ * @param params - Body for request
44
+ * @param callback - Callback to handle processed record
45
+ *
46
+ * @returns Resolves to processed MessageInstance
47
+ */
48
+ create(params: AssistantsV1ServiceAssistantSendMessageRequest, callback?: (error: Error | null, item?: MessageInstance) => any): Promise<MessageInstance>;
49
+ /**
50
+ * Provide a user-friendly representation
51
+ */
52
+ toJSON(): any;
53
+ [inspect.custom](_depth: any, options: InspectOptions): any;
54
+ }
55
+ export declare function MessageListInstance(version: V1, id: string): MessageListInstance;
56
+ interface MessageResource {
57
+ status: string;
58
+ flagged: boolean;
59
+ aborted: boolean;
60
+ session_id: string;
61
+ account_sid: string;
62
+ body: string;
63
+ error: string;
64
+ }
65
+ export declare class MessageInstance {
66
+ protected _version: V1;
67
+ constructor(_version: V1, payload: MessageResource, id: string);
68
+ /**
69
+ * success or failure based on whether the request successfully generated a response.
70
+ */
71
+ status: string;
72
+ /**
73
+ * If successful, this property will denote whether the response was flagged or not.
74
+ */
75
+ flagged: boolean;
76
+ /**
77
+ * This property will denote whether the request was aborted or not.
78
+ */
79
+ aborted: boolean;
80
+ /**
81
+ * The unique name for the session.
82
+ */
83
+ sessionId: string;
84
+ /**
85
+ * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that sent the Message.
86
+ */
87
+ accountSid: string;
88
+ /**
89
+ * If successful, the body of the generated response
90
+ */
91
+ body: string;
92
+ /**
93
+ * The error message if generation was not successful
94
+ */
95
+ error: string;
96
+ /**
97
+ * Provide a user-friendly representation
98
+ *
99
+ * @returns Object
100
+ */
101
+ toJSON(): {
102
+ status: string;
103
+ flagged: boolean;
104
+ aborted: boolean;
105
+ sessionId: string;
106
+ accountSid: string;
107
+ body: string;
108
+ error: string;
109
+ };
110
+ [inspect.custom](_depth: any, options: InspectOptions): string;
111
+ }
112
+ export {};
@@ -0,0 +1,90 @@
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.MessageInstance = exports.MessageListInstance = exports.AssistantsV1ServiceAssistantSendMessageRequest = 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 AssistantsV1ServiceAssistantSendMessageRequest {
22
+ }
23
+ exports.AssistantsV1ServiceAssistantSendMessageRequest = AssistantsV1ServiceAssistantSendMessageRequest;
24
+ function MessageListInstance(version, id) {
25
+ if (!(0, utility_1.isValidPathParam)(id)) {
26
+ throw new Error("Parameter 'id' is not valid.");
27
+ }
28
+ const instance = {};
29
+ instance._version = version;
30
+ instance._solution = { id };
31
+ instance._uri = `/Assistants/${id}/Messages`;
32
+ instance.create = function create(params, callback) {
33
+ if (params === null || params === undefined) {
34
+ throw new Error('Required parameter "params" missing.');
35
+ }
36
+ let data = {};
37
+ data = params;
38
+ const headers = {};
39
+ headers["Content-Type"] = "application/json";
40
+ let operationVersion = version, operationPromise = operationVersion.create({
41
+ uri: instance._uri,
42
+ method: "post",
43
+ data,
44
+ headers,
45
+ });
46
+ operationPromise = operationPromise.then((payload) => new MessageInstance(operationVersion, payload, instance._solution.id));
47
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
48
+ return operationPromise;
49
+ };
50
+ instance.toJSON = function toJSON() {
51
+ return instance._solution;
52
+ };
53
+ instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
54
+ return (0, util_1.inspect)(instance.toJSON(), options);
55
+ };
56
+ return instance;
57
+ }
58
+ exports.MessageListInstance = MessageListInstance;
59
+ class MessageInstance {
60
+ constructor(_version, payload, id) {
61
+ this._version = _version;
62
+ this.status = payload.status;
63
+ this.flagged = payload.flagged;
64
+ this.aborted = payload.aborted;
65
+ this.sessionId = payload.session_id;
66
+ this.accountSid = payload.account_sid;
67
+ this.body = payload.body;
68
+ this.error = payload.error;
69
+ }
70
+ /**
71
+ * Provide a user-friendly representation
72
+ *
73
+ * @returns Object
74
+ */
75
+ toJSON() {
76
+ return {
77
+ status: this.status,
78
+ flagged: this.flagged,
79
+ aborted: this.aborted,
80
+ sessionId: this.sessionId,
81
+ accountSid: this.accountSid,
82
+ body: this.body,
83
+ error: this.error,
84
+ };
85
+ }
86
+ [util_1.inspect.custom](_depth, options) {
87
+ return (0, util_1.inspect)(this.toJSON(), options);
88
+ }
89
+ }
90
+ exports.MessageInstance = MessageInstance;
@@ -3,7 +3,10 @@ import { inspect, InspectOptions } from "util";
3
3
  import Page, { TwilioResponsePayload } from "../../../base/Page";
4
4
  import Response from "../../../http/response";
5
5
  import V1 from "../V1";
6
+ import { AssistantsKnowledgeListInstance } from "./assistant/assistantsKnowledge";
7
+ import { AssistantsToolListInstance } from "./assistant/assistantsTool";
6
8
  import { FeedbackListInstance } from "./assistant/feedback";
9
+ import { MessageListInstance } from "./assistant/message";
7
10
  export declare class AssistantsV1ServiceCreateAssistantRequest {
8
11
  "customerAi"?: AssistantsV1ServiceCustomerAi;
9
12
  /**
@@ -59,6 +62,10 @@ export declare class AssistantsV1ServiceKnowledge {
59
62
  * The type of knowledge source (\'Web\', \'Database\', \'Text\', \'File\')
60
63
  */
61
64
  "type"?: string;
65
+ /**
66
+ * The url of the knowledge resource.
67
+ */
68
+ "url"?: string;
62
69
  /**
63
70
  * The date and time in GMT when the Knowledge was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
64
71
  */
@@ -115,6 +122,10 @@ export declare class AssistantsV1ServiceTool {
115
122
  * The type of the tool. (\'WEBHOOK\')
116
123
  */
117
124
  "type": string;
125
+ /**
126
+ * The url of the tool resource.
127
+ */
128
+ "url"?: string;
118
129
  /**
119
130
  * The date and time in GMT when the Tool was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
120
131
  */
@@ -188,7 +199,10 @@ export interface AssistantListInstancePageOptions {
188
199
  pageToken?: string;
189
200
  }
190
201
  export interface AssistantContext {
202
+ assistantsKnowledge: AssistantsKnowledgeListInstance;
203
+ assistantsTools: AssistantsToolListInstance;
191
204
  feedbacks: FeedbackListInstance;
205
+ messages: MessageListInstance;
192
206
  /**
193
207
  * Remove a AssistantInstance
194
208
  *
@@ -235,9 +249,15 @@ export declare class AssistantContextImpl implements AssistantContext {
235
249
  protected _version: V1;
236
250
  protected _solution: AssistantContextSolution;
237
251
  protected _uri: string;
252
+ protected _assistantsKnowledge?: AssistantsKnowledgeListInstance;
253
+ protected _assistantsTools?: AssistantsToolListInstance;
238
254
  protected _feedbacks?: FeedbackListInstance;
255
+ protected _messages?: MessageListInstance;
239
256
  constructor(_version: V1, id: string);
257
+ get assistantsKnowledge(): AssistantsKnowledgeListInstance;
258
+ get assistantsTools(): AssistantsToolListInstance;
240
259
  get feedbacks(): FeedbackListInstance;
260
+ get messages(): MessageListInstance;
241
261
  remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
242
262
  fetch(callback?: (error: Error | null, item?: AssistantInstance) => any): Promise<AssistantInstance>;
243
263
  update(params?: AssistantsV1ServiceUpdateAssistantRequest | ((error: Error | null, item?: AssistantInstance) => any), callback?: (error: Error | null, item?: AssistantInstance) => any): Promise<AssistantInstance>;
@@ -259,6 +279,7 @@ interface AssistantResource {
259
279
  model: string;
260
280
  name: string;
261
281
  owner: string;
282
+ url: string;
262
283
  personality_prompt: string;
263
284
  date_created: Date;
264
285
  date_updated: Date;
@@ -294,6 +315,10 @@ export declare class AssistantInstance {
294
315
  * The owner/company of the assistant.
295
316
  */
296
317
  owner: string;
318
+ /**
319
+ * The url of the assistant resource.
320
+ */
321
+ url: string;
297
322
  /**
298
323
  * The personality prompt to be used for assistant.
299
324
  */
@@ -348,10 +373,22 @@ export declare class AssistantInstance {
348
373
  * @returns Resolves to processed AssistantInstance
349
374
  */
350
375
  update(params: AssistantsV1ServiceUpdateAssistantRequest, callback?: (error: Error | null, item?: AssistantInstance) => any): Promise<AssistantInstance>;
376
+ /**
377
+ * Access the assistantsKnowledge.
378
+ */
379
+ assistantsKnowledge(): AssistantsKnowledgeListInstance;
380
+ /**
381
+ * Access the assistantsTools.
382
+ */
383
+ assistantsTools(): AssistantsToolListInstance;
351
384
  /**
352
385
  * Access the feedbacks.
353
386
  */
354
387
  feedbacks(): FeedbackListInstance;
388
+ /**
389
+ * Access the messages.
390
+ */
391
+ messages(): MessageListInstance;
355
392
  /**
356
393
  * Provide a user-friendly representation
357
394
  *
@@ -364,6 +401,7 @@ export declare class AssistantInstance {
364
401
  model: string;
365
402
  name: string;
366
403
  owner: string;
404
+ url: string;
367
405
  personalityPrompt: string;
368
406
  dateCreated: Date;
369
407
  dateUpdated: Date;
@@ -22,7 +22,10 @@ const Page_1 = __importDefault(require("../../../base/Page"));
22
22
  const deserialize = require("../../../base/deserialize");
23
23
  const serialize = require("../../../base/serialize");
24
24
  const utility_1 = require("../../../base/utility");
25
+ const assistantsKnowledge_1 = require("./assistant/assistantsKnowledge");
26
+ const assistantsTool_1 = require("./assistant/assistantsTool");
25
27
  const feedback_1 = require("./assistant/feedback");
28
+ const message_1 = require("./assistant/message");
26
29
  class AssistantsV1ServiceCreateAssistantRequest {
27
30
  }
28
31
  exports.AssistantsV1ServiceCreateAssistantRequest = AssistantsV1ServiceCreateAssistantRequest;
@@ -50,11 +53,28 @@ class AssistantContextImpl {
50
53
  this._solution = { id };
51
54
  this._uri = `/Assistants/${id}`;
52
55
  }
56
+ get assistantsKnowledge() {
57
+ this._assistantsKnowledge =
58
+ this._assistantsKnowledge ||
59
+ (0, assistantsKnowledge_1.AssistantsKnowledgeListInstance)(this._version, this._solution.id);
60
+ return this._assistantsKnowledge;
61
+ }
62
+ get assistantsTools() {
63
+ this._assistantsTools =
64
+ this._assistantsTools ||
65
+ (0, assistantsTool_1.AssistantsToolListInstance)(this._version, this._solution.id);
66
+ return this._assistantsTools;
67
+ }
53
68
  get feedbacks() {
54
69
  this._feedbacks =
55
70
  this._feedbacks || (0, feedback_1.FeedbackListInstance)(this._version, this._solution.id);
56
71
  return this._feedbacks;
57
72
  }
73
+ get messages() {
74
+ this._messages =
75
+ this._messages || (0, message_1.MessageListInstance)(this._version, this._solution.id);
76
+ return this._messages;
77
+ }
58
78
  remove(callback) {
59
79
  const instance = this;
60
80
  let operationVersion = instance._version, operationPromise = operationVersion.remove({
@@ -119,6 +139,7 @@ class AssistantInstance {
119
139
  this.model = payload.model;
120
140
  this.name = payload.name;
121
141
  this.owner = payload.owner;
142
+ this.url = payload.url;
122
143
  this.personalityPrompt = payload.personality_prompt;
123
144
  this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
124
145
  this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated);
@@ -155,12 +176,30 @@ class AssistantInstance {
155
176
  update(params, callback) {
156
177
  return this._proxy.update(params, callback);
157
178
  }
179
+ /**
180
+ * Access the assistantsKnowledge.
181
+ */
182
+ assistantsKnowledge() {
183
+ return this._proxy.assistantsKnowledge;
184
+ }
185
+ /**
186
+ * Access the assistantsTools.
187
+ */
188
+ assistantsTools() {
189
+ return this._proxy.assistantsTools;
190
+ }
158
191
  /**
159
192
  * Access the feedbacks.
160
193
  */
161
194
  feedbacks() {
162
195
  return this._proxy.feedbacks;
163
196
  }
197
+ /**
198
+ * Access the messages.
199
+ */
200
+ messages() {
201
+ return this._proxy.messages;
202
+ }
164
203
  /**
165
204
  * Provide a user-friendly representation
166
205
  *
@@ -174,6 +213,7 @@ class AssistantInstance {
174
213
  model: this.model,
175
214
  name: this.name,
176
215
  owner: this.owner,
216
+ url: this.url,
177
217
  personalityPrompt: this.personalityPrompt,
178
218
  dateCreated: this.dateCreated,
179
219
  dateUpdated: this.dateUpdated,
@@ -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
  };