twilio 6.0.0 → 6.0.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.
- package/lib/rest/ConversationsBase.d.ts +3 -0
- package/lib/rest/ConversationsBase.js +5 -0
- package/lib/rest/InsightsBase.d.ts +3 -0
- package/lib/rest/InsightsBase.js +5 -0
- package/lib/rest/IntelligenceBase.d.ts +3 -0
- package/lib/rest/IntelligenceBase.js +5 -0
- package/lib/rest/KnowledgeBase.d.ts +3 -0
- package/lib/rest/KnowledgeBase.js +5 -0
- package/lib/rest/Memory.d.ts +4 -0
- package/lib/rest/Memory.js +8 -0
- package/lib/rest/MemoryBase.d.ts +13 -0
- package/lib/rest/MemoryBase.js +31 -0
- package/lib/rest/Twilio.d.ts +5 -0
- package/lib/rest/Twilio.js +5 -0
- package/lib/rest/VoiceBase.d.ts +3 -0
- package/lib/rest/VoiceBase.js +5 -0
- package/lib/rest/api/v2010/account/call/recording.d.ts +2 -0
- package/lib/rest/api/v2010/account/call/recording.js +4 -0
- package/lib/rest/api/v2010/account/call/transcription.d.ts +1 -1
- package/lib/rest/api/v2010/account/call/transcription.js +6 -4
- package/lib/rest/api/v2010/account/call.d.ts +2 -0
- package/lib/rest/api/v2010/account/call.js +4 -0
- package/lib/rest/api/v2010/account/conference/participant.d.ts +2 -0
- package/lib/rest/api/v2010/account/conference/participant.js +4 -0
- package/lib/rest/conversations/V2.d.ts +38 -0
- package/lib/rest/conversations/V2.js +72 -0
- package/lib/rest/conversations/v2/action.d.ts +241 -0
- package/lib/rest/conversations/v2/action.js +246 -0
- package/lib/rest/conversations/v2/communication.d.ts +479 -0
- package/lib/rest/conversations/v2/communication.js +436 -0
- package/lib/rest/conversations/v2/configuration.d.ts +906 -0
- package/lib/rest/conversations/v2/configuration.js +619 -0
- package/lib/rest/conversations/v2/conversation.d.ts +936 -0
- package/lib/rest/conversations/v2/conversation.js +664 -0
- package/lib/rest/conversations/v2/operation.d.ts +167 -0
- package/lib/rest/conversations/v2/operation.js +170 -0
- package/lib/rest/conversations/v2/participant.d.ts +469 -0
- package/lib/rest/conversations/v2/participant.js +442 -0
- package/lib/rest/flexApi/v1/plugin/pluginVersions.d.ts +1 -1
- package/lib/rest/flexApi/v1/plugin/pluginVersions.js +8 -6
- package/lib/rest/insights/V3.d.ts +20 -0
- package/lib/rest/insights/V3.js +42 -0
- package/lib/rest/insights/v1/call/callSummary.d.ts +10 -10
- package/lib/rest/insights/v1/call/event.d.ts +4 -4
- package/lib/rest/insights/v1/callSummaries.d.ts +12 -9
- package/lib/rest/insights/v3/metadata.d.ts +115 -0
- package/lib/rest/insights/v3/metadata.js +118 -0
- package/lib/rest/insights/v3/query.d.ts +180 -0
- package/lib/rest/insights/v3/query.js +214 -0
- package/lib/rest/intelligence/V3.d.ts +35 -0
- package/lib/rest/intelligence/V3.js +65 -0
- package/lib/rest/intelligence/v3/configuration.d.ts +693 -0
- package/lib/rest/intelligence/v3/configuration.js +528 -0
- package/lib/rest/intelligence/v3/conversation.d.ts +478 -0
- package/lib/rest/intelligence/v3/conversation.js +342 -0
- package/lib/rest/intelligence/v3/operator.d.ts +619 -0
- package/lib/rest/intelligence/v3/operator.js +493 -0
- package/lib/rest/intelligence/v3/operatorResult.d.ts +543 -0
- package/lib/rest/intelligence/v3/operatorResult.js +478 -0
- package/lib/rest/intelligence/v3/version.d.ts +469 -0
- package/lib/rest/intelligence/v3/version.js +341 -0
- package/lib/rest/knowledge/V2.d.ts +31 -0
- package/lib/rest/knowledge/V2.js +62 -0
- package/lib/rest/knowledge/v2/chunk.d.ts +209 -0
- package/lib/rest/knowledge/v2/chunk.js +178 -0
- package/lib/rest/knowledge/v2/knowledge.d.ts +507 -0
- package/lib/rest/knowledge/v2/knowledge.js +466 -0
- package/lib/rest/knowledge/v2/knowledgeBasis.d.ts +484 -0
- package/lib/rest/knowledge/v2/knowledgeBasis.js +441 -0
- package/lib/rest/knowledge/v2/operation.d.ts +162 -0
- package/lib/rest/knowledge/v2/operation.js +175 -0
- package/lib/rest/knowledge/v2/search.d.ts +180 -0
- package/lib/rest/knowledge/v2/search.js +174 -0
- package/lib/rest/memory/V1.d.ts +76 -0
- package/lib/rest/memory/V1.js +140 -0
- package/lib/rest/memory/v1/bulk.d.ts +129 -0
- package/lib/rest/memory/v1/bulk.js +158 -0
- package/lib/rest/memory/v1/conversationSummary.d.ts +531 -0
- package/lib/rest/memory/v1/conversationSummary.js +473 -0
- package/lib/rest/memory/v1/dataMapping.d.ts +630 -0
- package/lib/rest/memory/v1/dataMapping.js +512 -0
- package/lib/rest/memory/v1/event.d.ts +153 -0
- package/lib/rest/memory/v1/event.js +159 -0
- package/lib/rest/memory/v1/identifier.d.ts +362 -0
- package/lib/rest/memory/v1/identifier.js +369 -0
- package/lib/rest/memory/v1/identityResolutionSetting.d.ts +247 -0
- package/lib/rest/memory/v1/identityResolutionSetting.js +229 -0
- package/lib/rest/memory/v1/import.d.ts +292 -0
- package/lib/rest/memory/v1/import.js +280 -0
- package/lib/rest/memory/v1/lookup.d.ts +82 -0
- package/lib/rest/memory/v1/lookup.js +118 -0
- package/lib/rest/memory/v1/observation.d.ts +521 -0
- package/lib/rest/memory/v1/observation.js +477 -0
- package/lib/rest/memory/v1/operation.d.ts +162 -0
- package/lib/rest/memory/v1/operation.js +175 -0
- package/lib/rest/memory/v1/profile.d.ts +548 -0
- package/lib/rest/memory/v1/profile.js +531 -0
- package/lib/rest/memory/v1/recall.d.ts +306 -0
- package/lib/rest/memory/v1/recall.js +234 -0
- package/lib/rest/memory/v1/revision.d.ts +246 -0
- package/lib/rest/memory/v1/revision.js +195 -0
- package/lib/rest/memory/v1/store.d.ts +544 -0
- package/lib/rest/memory/v1/store.js +534 -0
- package/lib/rest/memory/v1/trait.d.ts +233 -0
- package/lib/rest/memory/v1/trait.js +190 -0
- package/lib/rest/memory/v1/traitGroup.d.ts +758 -0
- package/lib/rest/memory/v1/traitGroup.js +555 -0
- package/lib/rest/messaging/v2/channelsSender.d.ts +8 -0
- package/lib/rest/messaging/v2/channelsSender.js +2 -0
- package/lib/rest/previewIam/versionless/organization/roleAssignment.d.ts +32 -0
- package/lib/rest/previewIam/versionless/organization/roleAssignment.js +14 -0
- package/lib/rest/studio/v2/flow.d.ts +4 -0
- package/lib/rest/studio/v2/flow.js +8 -0
- package/lib/rest/verify/v2/service/webhook.d.ts +2 -2
- package/lib/rest/verify/v2/service/webhook.js +8 -8
- package/lib/rest/voice/V3.d.ts +15 -0
- package/lib/rest/voice/V3.js +37 -0
- package/lib/rest/voice/v3/transcription.d.ts +378 -0
- package/lib/rest/voice/v3/transcription.js +264 -0
- package/lib/twiml/VoiceResponse.d.ts +8 -0
- package/package.json +1 -1
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* This code was generated by
|
|
4
|
+
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
|
5
|
+
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
|
6
|
+
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
|
7
|
+
*
|
|
8
|
+
* Twilio Conversational Intelligence API
|
|
9
|
+
* The Conversational Intelligence API includes resources to create and manage intelligence configurations, define and run language operators, and retrieve processed conversations and operator results. * Use the Configurations resource to create and manage intelligence configurations and define rules that control how and when language operators analyze and transform conversations. * Use the Operators resource to create custom language operators or retrieve Twilio-author and custom operators. * Use the Conversations resource to retrieve conversations processed with an intelligence configuration, and the OperatorResults resource to retrieve language operator results for those conversations.
|
|
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.ConversationPage = exports.ConversationInstance = exports.ConversationContextImpl = exports.Participant = exports.Content = exports.Communication = void 0;
|
|
20
|
+
exports.ConversationListInstance = ConversationListInstance;
|
|
21
|
+
const util_1 = require("util");
|
|
22
|
+
const TokenPage_1 = __importDefault(require("../../../base/TokenPage"));
|
|
23
|
+
const deserialize = require("../../../base/deserialize");
|
|
24
|
+
const serialize = require("../../../base/serialize");
|
|
25
|
+
const utility_1 = require("../../../base/utility");
|
|
26
|
+
class Communication {
|
|
27
|
+
constructor(payload) {
|
|
28
|
+
this.id = payload["id"];
|
|
29
|
+
this.participantId = payload["participantId"];
|
|
30
|
+
this.content = payload["content"];
|
|
31
|
+
this.createdAt = payload["createdAt"];
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.Communication = Communication;
|
|
35
|
+
/**
|
|
36
|
+
* The content of the communication.
|
|
37
|
+
*/
|
|
38
|
+
class Content {
|
|
39
|
+
constructor(payload) {
|
|
40
|
+
this.text = payload["text"];
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.Content = Content;
|
|
44
|
+
class Participant {
|
|
45
|
+
constructor(payload) {
|
|
46
|
+
this.id = payload["id"];
|
|
47
|
+
this.name = payload["name"];
|
|
48
|
+
this.type = payload["type"];
|
|
49
|
+
this.addressValues = payload["addressValues"];
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.Participant = Participant;
|
|
53
|
+
class ConversationContextImpl {
|
|
54
|
+
constructor(_version, id) {
|
|
55
|
+
this._version = _version;
|
|
56
|
+
if (!(0, utility_1.isValidPathParam)(id)) {
|
|
57
|
+
throw new Error("Parameter 'id' is not valid.");
|
|
58
|
+
}
|
|
59
|
+
this._solution = { id };
|
|
60
|
+
this._uri = `/Conversations/${id}`;
|
|
61
|
+
}
|
|
62
|
+
fetch(callback) {
|
|
63
|
+
const headers = {};
|
|
64
|
+
headers["Accept"] = "application/json";
|
|
65
|
+
const instance = this;
|
|
66
|
+
let operationVersion = instance._version, operationPromise = operationVersion.fetch({
|
|
67
|
+
uri: instance._uri,
|
|
68
|
+
method: "get",
|
|
69
|
+
headers,
|
|
70
|
+
});
|
|
71
|
+
operationPromise = operationPromise.then((payload) => new ConversationInstance(operationVersion, payload, instance._solution.id));
|
|
72
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
73
|
+
return operationPromise;
|
|
74
|
+
}
|
|
75
|
+
fetchWithHttpInfo(callback) {
|
|
76
|
+
const headers = {};
|
|
77
|
+
headers["Accept"] = "application/json";
|
|
78
|
+
const instance = this;
|
|
79
|
+
let operationVersion = instance._version;
|
|
80
|
+
// CREATE, FETCH, UPDATE operations
|
|
81
|
+
let operationPromise = operationVersion
|
|
82
|
+
.fetchWithResponseInfo({
|
|
83
|
+
uri: instance._uri,
|
|
84
|
+
method: "get",
|
|
85
|
+
headers,
|
|
86
|
+
})
|
|
87
|
+
.then((response) => ({
|
|
88
|
+
...response,
|
|
89
|
+
body: new ConversationInstance(operationVersion, response.body, instance._solution.id),
|
|
90
|
+
}));
|
|
91
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
92
|
+
return operationPromise;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Provide a user-friendly representation
|
|
96
|
+
*
|
|
97
|
+
* @returns Object
|
|
98
|
+
*/
|
|
99
|
+
toJSON() {
|
|
100
|
+
return this._solution;
|
|
101
|
+
}
|
|
102
|
+
[util_1.inspect.custom](_depth, options) {
|
|
103
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
exports.ConversationContextImpl = ConversationContextImpl;
|
|
107
|
+
class ConversationInstance {
|
|
108
|
+
constructor(_version, _payload, id) {
|
|
109
|
+
this._version = _version;
|
|
110
|
+
const payload = _payload;
|
|
111
|
+
this.id = payload.id;
|
|
112
|
+
this.accountId = payload.accountId;
|
|
113
|
+
this.name = payload.name;
|
|
114
|
+
this.status = payload.status;
|
|
115
|
+
this.createdAt = deserialize.iso8601DateTime(payload.createdAt);
|
|
116
|
+
this.updatedAt = deserialize.iso8601DateTime(payload.updatedAt);
|
|
117
|
+
this.intelligenceConfigurationIds = payload.intelligenceConfigurationIds;
|
|
118
|
+
this.conversationConfigurationId = payload.conversationConfigurationId;
|
|
119
|
+
this.channels = payload.channels;
|
|
120
|
+
this.channelIds = payload.channelIds;
|
|
121
|
+
this.participants =
|
|
122
|
+
payload.participants !== null && payload.participants !== undefined
|
|
123
|
+
? payload.participants.map((payload) => new Participant(payload))
|
|
124
|
+
: null;
|
|
125
|
+
this.communications =
|
|
126
|
+
payload.communications !== null && payload.communications !== undefined
|
|
127
|
+
? payload.communications.map((payload) => new Communication(payload))
|
|
128
|
+
: null;
|
|
129
|
+
this.operatorResultIds = payload.operatorResultIds;
|
|
130
|
+
this._solution = { id: id };
|
|
131
|
+
}
|
|
132
|
+
get _proxy() {
|
|
133
|
+
this._context =
|
|
134
|
+
this._context ||
|
|
135
|
+
new ConversationContextImpl(this._version, this._solution.id);
|
|
136
|
+
return this._context;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Fetch a ConversationInstance
|
|
140
|
+
*
|
|
141
|
+
* @param callback - Callback to handle processed record
|
|
142
|
+
*
|
|
143
|
+
* @returns Resolves to processed ConversationInstance
|
|
144
|
+
*/
|
|
145
|
+
fetch(callback) {
|
|
146
|
+
return this._proxy.fetch(callback);
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Fetch a ConversationInstance and return HTTP info
|
|
150
|
+
*
|
|
151
|
+
* @param callback - Callback to handle processed record
|
|
152
|
+
*
|
|
153
|
+
* @returns Resolves to processed ConversationInstance with HTTP metadata
|
|
154
|
+
*/
|
|
155
|
+
fetchWithHttpInfo(callback) {
|
|
156
|
+
return this._proxy.fetchWithHttpInfo(callback);
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Provide a user-friendly representation
|
|
160
|
+
*
|
|
161
|
+
* @returns Object
|
|
162
|
+
*/
|
|
163
|
+
toJSON() {
|
|
164
|
+
return {
|
|
165
|
+
id: this.id,
|
|
166
|
+
accountId: this.accountId,
|
|
167
|
+
name: this.name,
|
|
168
|
+
status: this.status,
|
|
169
|
+
createdAt: this.createdAt,
|
|
170
|
+
updatedAt: this.updatedAt,
|
|
171
|
+
intelligenceConfigurationIds: this.intelligenceConfigurationIds,
|
|
172
|
+
conversationConfigurationId: this.conversationConfigurationId,
|
|
173
|
+
channels: this.channels,
|
|
174
|
+
channelIds: this.channelIds,
|
|
175
|
+
participants: this.participants,
|
|
176
|
+
communications: this.communications,
|
|
177
|
+
operatorResultIds: this.operatorResultIds,
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
[util_1.inspect.custom](_depth, options) {
|
|
181
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
exports.ConversationInstance = ConversationInstance;
|
|
185
|
+
function ConversationListInstance(version) {
|
|
186
|
+
const instance = ((id) => instance.get(id));
|
|
187
|
+
instance.get = function get(id) {
|
|
188
|
+
return new ConversationContextImpl(version, id);
|
|
189
|
+
};
|
|
190
|
+
instance._version = version;
|
|
191
|
+
instance._solution = {};
|
|
192
|
+
instance._uri = `/Conversations`;
|
|
193
|
+
instance.page = function page(params, callback) {
|
|
194
|
+
if (params instanceof Function) {
|
|
195
|
+
callback = params;
|
|
196
|
+
params = {};
|
|
197
|
+
}
|
|
198
|
+
else {
|
|
199
|
+
params = params || {};
|
|
200
|
+
}
|
|
201
|
+
let data = {};
|
|
202
|
+
if (params["pageSize"] !== undefined)
|
|
203
|
+
data["pageSize"] = params["pageSize"];
|
|
204
|
+
if (params["pageToken"] !== undefined)
|
|
205
|
+
data["pageToken"] = params["pageToken"];
|
|
206
|
+
if (params["createdAtBefore"] !== undefined)
|
|
207
|
+
data["createdAtBefore"] = serialize.iso8601DateTime(params["createdAtBefore"]);
|
|
208
|
+
if (params["createdAtAfter"] !== undefined)
|
|
209
|
+
data["createdAtAfter"] = serialize.iso8601DateTime(params["createdAtAfter"]);
|
|
210
|
+
if (params["status"] !== undefined)
|
|
211
|
+
data["status"] = params["status"];
|
|
212
|
+
if (params["channelId"] !== undefined)
|
|
213
|
+
data["channelId"] = params["channelId"];
|
|
214
|
+
if (params["channels"] !== undefined)
|
|
215
|
+
data["channels"] = serialize.map(params["channels"], (e) => e);
|
|
216
|
+
if (params["conversationConfigurationId"] !== undefined)
|
|
217
|
+
data["conversationConfigurationId"] =
|
|
218
|
+
params["conversationConfigurationId"];
|
|
219
|
+
if (params["intelligenceConfigurationIds"] !== undefined)
|
|
220
|
+
data["intelligenceConfigurationIds"] = serialize.map(params["intelligenceConfigurationIds"], (e) => e);
|
|
221
|
+
if (params["operatorIds"] !== undefined)
|
|
222
|
+
data["operatorIds"] = serialize.map(params["operatorIds"], (e) => e);
|
|
223
|
+
const headers = {};
|
|
224
|
+
headers["Accept"] = "application/json";
|
|
225
|
+
let operationVersion = version, operationPromise = operationVersion.page({
|
|
226
|
+
uri: instance._uri,
|
|
227
|
+
method: "get",
|
|
228
|
+
params: data,
|
|
229
|
+
headers,
|
|
230
|
+
});
|
|
231
|
+
operationPromise = operationPromise.then((payload) => new ConversationPage(operationVersion, payload, instance._uri, data, instance._solution));
|
|
232
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
233
|
+
return operationPromise;
|
|
234
|
+
};
|
|
235
|
+
instance.each = instance._version.each;
|
|
236
|
+
instance.list = instance._version.list;
|
|
237
|
+
instance.getPage = function getPage(targetUrl, callback) {
|
|
238
|
+
const operationPromise = instance._version._domain.twilio.request({
|
|
239
|
+
method: "get",
|
|
240
|
+
uri: targetUrl,
|
|
241
|
+
});
|
|
242
|
+
let pagePromise = operationPromise.then((payload) => new ConversationPage(instance._version, payload, instance._uri, {}, instance._solution));
|
|
243
|
+
pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
|
|
244
|
+
return pagePromise;
|
|
245
|
+
};
|
|
246
|
+
instance.pageWithHttpInfo = function pageWithHttpInfo(params, callback) {
|
|
247
|
+
if (params instanceof Function) {
|
|
248
|
+
callback = params;
|
|
249
|
+
params = {};
|
|
250
|
+
}
|
|
251
|
+
else {
|
|
252
|
+
params = params || {};
|
|
253
|
+
}
|
|
254
|
+
let data = {};
|
|
255
|
+
if (params["pageSize"] !== undefined)
|
|
256
|
+
data["pageSize"] = params["pageSize"];
|
|
257
|
+
if (params["pageToken"] !== undefined)
|
|
258
|
+
data["pageToken"] = params["pageToken"];
|
|
259
|
+
if (params["createdAtBefore"] !== undefined)
|
|
260
|
+
data["createdAtBefore"] = serialize.iso8601DateTime(params["createdAtBefore"]);
|
|
261
|
+
if (params["createdAtAfter"] !== undefined)
|
|
262
|
+
data["createdAtAfter"] = serialize.iso8601DateTime(params["createdAtAfter"]);
|
|
263
|
+
if (params["status"] !== undefined)
|
|
264
|
+
data["status"] = params["status"];
|
|
265
|
+
if (params["channelId"] !== undefined)
|
|
266
|
+
data["channelId"] = params["channelId"];
|
|
267
|
+
if (params["channels"] !== undefined)
|
|
268
|
+
data["channels"] = serialize.map(params["channels"], (e) => e);
|
|
269
|
+
if (params["conversationConfigurationId"] !== undefined)
|
|
270
|
+
data["conversationConfigurationId"] =
|
|
271
|
+
params["conversationConfigurationId"];
|
|
272
|
+
if (params["intelligenceConfigurationIds"] !== undefined)
|
|
273
|
+
data["intelligenceConfigurationIds"] = serialize.map(params["intelligenceConfigurationIds"], (e) => e);
|
|
274
|
+
if (params["operatorIds"] !== undefined)
|
|
275
|
+
data["operatorIds"] = serialize.map(params["operatorIds"], (e) => e);
|
|
276
|
+
const headers = {};
|
|
277
|
+
headers["Accept"] = "application/json";
|
|
278
|
+
let operationVersion = version;
|
|
279
|
+
// For page operations, use page() directly as it already returns { statusCode, body, headers }
|
|
280
|
+
// IMPORTANT: Pass full response to Page constructor, not response.body
|
|
281
|
+
let operationPromise = operationVersion
|
|
282
|
+
.page({ uri: instance._uri, method: "get", params: data, headers })
|
|
283
|
+
.then((response) => ({
|
|
284
|
+
statusCode: response.statusCode,
|
|
285
|
+
headers: response.headers,
|
|
286
|
+
body: new ConversationPage(operationVersion, response, instance._uri, data, instance._solution),
|
|
287
|
+
}));
|
|
288
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
289
|
+
return operationPromise;
|
|
290
|
+
};
|
|
291
|
+
instance.each = instance._version.each;
|
|
292
|
+
instance.eachWithHttpInfo = instance._version.eachWithHttpInfo;
|
|
293
|
+
instance.list = instance._version.list;
|
|
294
|
+
instance.listWithHttpInfo = instance._version.listWithHttpInfo;
|
|
295
|
+
instance.getPageWithHttpInfo = function getPageWithHttpInfo(targetUrl, callback) {
|
|
296
|
+
// Use request() directly as it already returns { statusCode, body, headers }
|
|
297
|
+
const operationPromise = instance._version._domain.twilio.request({
|
|
298
|
+
method: "get",
|
|
299
|
+
uri: targetUrl,
|
|
300
|
+
});
|
|
301
|
+
let pagePromise = operationPromise.then((response) => ({
|
|
302
|
+
statusCode: response.statusCode,
|
|
303
|
+
headers: response.headers,
|
|
304
|
+
body: new ConversationPage(instance._version, response, instance._uri, {}, instance._solution),
|
|
305
|
+
}));
|
|
306
|
+
pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
|
|
307
|
+
return pagePromise;
|
|
308
|
+
};
|
|
309
|
+
instance.toJSON = function toJSON() {
|
|
310
|
+
return instance._solution;
|
|
311
|
+
};
|
|
312
|
+
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
|
313
|
+
return (0, util_1.inspect)(instance.toJSON(), options);
|
|
314
|
+
};
|
|
315
|
+
return instance;
|
|
316
|
+
}
|
|
317
|
+
class ConversationPage extends TokenPage_1.default {
|
|
318
|
+
/**
|
|
319
|
+
* Initialize the ConversationPage
|
|
320
|
+
*
|
|
321
|
+
* @param version - Version of the resource
|
|
322
|
+
* @param response - Response from the API
|
|
323
|
+
* @param uri - URI of the resource
|
|
324
|
+
* @param params - Query parameters
|
|
325
|
+
* @param solution - Path solution
|
|
326
|
+
*/
|
|
327
|
+
constructor(version, response, uri, params, solution) {
|
|
328
|
+
super(version, response, uri, params, solution);
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Build an instance of ConversationInstance
|
|
332
|
+
*
|
|
333
|
+
* @param payload - Payload response from the API
|
|
334
|
+
*/
|
|
335
|
+
getInstance(payload) {
|
|
336
|
+
return new ConversationInstance(this._version, payload);
|
|
337
|
+
}
|
|
338
|
+
[util_1.inspect.custom](depth, options) {
|
|
339
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
exports.ConversationPage = ConversationPage;
|