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,473 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* This code was generated by
|
|
4
|
+
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
|
5
|
+
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
|
6
|
+
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
|
7
|
+
*
|
|
8
|
+
* Twilio Memory API
|
|
9
|
+
* APIs for managing memory stores, profiles, events, and conversational intelligence capabilities.
|
|
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.ConversationSummaryPage = exports.ConversationSummaryInstance = exports.ConversationSummaryContextImpl = exports.SummaryCorePatch = exports.SummaryCore = exports.CreateSummariesRequest = void 0;
|
|
20
|
+
exports.ConversationSummaryListInstance = ConversationSummaryListInstance;
|
|
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
|
+
/**
|
|
27
|
+
* Request payload for creating one or more conversation summaries. Supports creation of up to 10 summaries.
|
|
28
|
+
*/
|
|
29
|
+
class CreateSummariesRequest {
|
|
30
|
+
constructor(payload) {
|
|
31
|
+
this.summaries = payload["summaries"];
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.CreateSummariesRequest = CreateSummariesRequest;
|
|
35
|
+
/**
|
|
36
|
+
* Core mutable properties for creating summary objects.
|
|
37
|
+
*/
|
|
38
|
+
class SummaryCore {
|
|
39
|
+
constructor(payload) {
|
|
40
|
+
this.source = payload["source"];
|
|
41
|
+
this.content = payload["content"];
|
|
42
|
+
this.occurredAt = payload["occurredAt"];
|
|
43
|
+
this.conversationId = payload["conversationId"];
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
exports.SummaryCore = SummaryCore;
|
|
47
|
+
/**
|
|
48
|
+
* Core mutable properties for updating summary objects. All fields are optional for PATCH operations.
|
|
49
|
+
*/
|
|
50
|
+
class SummaryCorePatch {
|
|
51
|
+
constructor(payload) {
|
|
52
|
+
this.source = payload["source"];
|
|
53
|
+
this.content = payload["content"];
|
|
54
|
+
this.occurredAt = payload["occurredAt"];
|
|
55
|
+
this.conversationId = payload["conversationId"];
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.SummaryCorePatch = SummaryCorePatch;
|
|
59
|
+
class ConversationSummaryContextImpl {
|
|
60
|
+
constructor(_version, storeId, profileId, summaryId) {
|
|
61
|
+
this._version = _version;
|
|
62
|
+
if (!(0, utility_1.isValidPathParam)(storeId)) {
|
|
63
|
+
throw new Error("Parameter 'storeId' is not valid.");
|
|
64
|
+
}
|
|
65
|
+
if (!(0, utility_1.isValidPathParam)(profileId)) {
|
|
66
|
+
throw new Error("Parameter 'profileId' is not valid.");
|
|
67
|
+
}
|
|
68
|
+
if (!(0, utility_1.isValidPathParam)(summaryId)) {
|
|
69
|
+
throw new Error("Parameter 'summaryId' is not valid.");
|
|
70
|
+
}
|
|
71
|
+
this._solution = { storeId, profileId, summaryId };
|
|
72
|
+
this._uri = `/Stores/${storeId}/Profiles/${profileId}/ConversationSummaries/${summaryId}`;
|
|
73
|
+
}
|
|
74
|
+
remove(callback) {
|
|
75
|
+
const headers = {};
|
|
76
|
+
headers["Accept"] = "application/json";
|
|
77
|
+
const instance = this;
|
|
78
|
+
let operationVersion = instance._version, operationPromise = operationVersion.fetch({
|
|
79
|
+
uri: instance._uri,
|
|
80
|
+
method: "delete",
|
|
81
|
+
headers,
|
|
82
|
+
});
|
|
83
|
+
operationPromise = operationPromise.then((payload) => new ConversationSummaryInstance(operationVersion, payload, instance._solution.storeId, instance._solution.profileId, instance._solution.summaryId));
|
|
84
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
85
|
+
return operationPromise;
|
|
86
|
+
}
|
|
87
|
+
removeWithHttpInfo(callback) {
|
|
88
|
+
const headers = {};
|
|
89
|
+
headers["Accept"] = "application/json";
|
|
90
|
+
const instance = this;
|
|
91
|
+
let operationVersion = instance._version;
|
|
92
|
+
// DELETE operation that returns a response model
|
|
93
|
+
let operationPromise = operationVersion
|
|
94
|
+
.fetchWithResponseInfo({
|
|
95
|
+
uri: instance._uri,
|
|
96
|
+
method: "delete",
|
|
97
|
+
headers,
|
|
98
|
+
})
|
|
99
|
+
.then((response) => ({
|
|
100
|
+
...response,
|
|
101
|
+
body: new ConversationSummaryInstance(operationVersion, response.body, instance._solution.storeId, instance._solution.profileId, instance._solution.summaryId),
|
|
102
|
+
}));
|
|
103
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
104
|
+
return operationPromise;
|
|
105
|
+
}
|
|
106
|
+
fetch(callback) {
|
|
107
|
+
const headers = {};
|
|
108
|
+
headers["Accept"] = "application/json";
|
|
109
|
+
const instance = this;
|
|
110
|
+
let operationVersion = instance._version, operationPromise = operationVersion.fetch({
|
|
111
|
+
uri: instance._uri,
|
|
112
|
+
method: "get",
|
|
113
|
+
headers,
|
|
114
|
+
});
|
|
115
|
+
operationPromise = operationPromise.then((payload) => new ConversationSummaryInstance(operationVersion, payload, instance._solution.storeId, instance._solution.profileId, instance._solution.summaryId));
|
|
116
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
117
|
+
return operationPromise;
|
|
118
|
+
}
|
|
119
|
+
fetchWithHttpInfo(callback) {
|
|
120
|
+
const headers = {};
|
|
121
|
+
headers["Accept"] = "application/json";
|
|
122
|
+
const instance = this;
|
|
123
|
+
let operationVersion = instance._version;
|
|
124
|
+
// CREATE, FETCH, UPDATE operations
|
|
125
|
+
let operationPromise = operationVersion
|
|
126
|
+
.fetchWithResponseInfo({
|
|
127
|
+
uri: instance._uri,
|
|
128
|
+
method: "get",
|
|
129
|
+
headers,
|
|
130
|
+
})
|
|
131
|
+
.then((response) => ({
|
|
132
|
+
...response,
|
|
133
|
+
body: new ConversationSummaryInstance(operationVersion, response.body, instance._solution.storeId, instance._solution.profileId, instance._solution.summaryId),
|
|
134
|
+
}));
|
|
135
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
136
|
+
return operationPromise;
|
|
137
|
+
}
|
|
138
|
+
patch(params, headers, callback) {
|
|
139
|
+
if (params === null || params === undefined) {
|
|
140
|
+
throw new Error('Required parameter "params" missing.');
|
|
141
|
+
}
|
|
142
|
+
let data = {};
|
|
143
|
+
data = params;
|
|
144
|
+
if (headers === null || headers === undefined) {
|
|
145
|
+
headers = {};
|
|
146
|
+
}
|
|
147
|
+
headers["Content-Type"] = "application/json";
|
|
148
|
+
headers["Accept"] = "application/json";
|
|
149
|
+
const instance = this;
|
|
150
|
+
let operationVersion = instance._version, operationPromise = operationVersion.patch({
|
|
151
|
+
uri: instance._uri,
|
|
152
|
+
method: "patch",
|
|
153
|
+
data,
|
|
154
|
+
headers,
|
|
155
|
+
});
|
|
156
|
+
operationPromise = operationPromise.then((payload) => new ConversationSummaryInstance(operationVersion, payload, instance._solution.storeId, instance._solution.profileId, instance._solution.summaryId));
|
|
157
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
158
|
+
return operationPromise;
|
|
159
|
+
}
|
|
160
|
+
patchWithHttpInfo(params, headers, callback) {
|
|
161
|
+
if (params === null || params === undefined) {
|
|
162
|
+
throw new Error('Required parameter "params" missing.');
|
|
163
|
+
}
|
|
164
|
+
let data = {};
|
|
165
|
+
data = params;
|
|
166
|
+
if (headers === null || headers === undefined) {
|
|
167
|
+
headers = {};
|
|
168
|
+
}
|
|
169
|
+
headers["Content-Type"] = "application/json";
|
|
170
|
+
headers["Accept"] = "application/json";
|
|
171
|
+
const instance = this;
|
|
172
|
+
let operationVersion = instance._version;
|
|
173
|
+
// CREATE, FETCH, UPDATE operations
|
|
174
|
+
let operationPromise = operationVersion
|
|
175
|
+
.patchWithResponseInfo({
|
|
176
|
+
uri: instance._uri,
|
|
177
|
+
method: "patch",
|
|
178
|
+
data,
|
|
179
|
+
headers,
|
|
180
|
+
})
|
|
181
|
+
.then((response) => ({
|
|
182
|
+
...response,
|
|
183
|
+
body: new ConversationSummaryInstance(operationVersion, response.body, instance._solution.storeId, instance._solution.profileId, instance._solution.summaryId),
|
|
184
|
+
}));
|
|
185
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
186
|
+
return operationPromise;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Provide a user-friendly representation
|
|
190
|
+
*
|
|
191
|
+
* @returns Object
|
|
192
|
+
*/
|
|
193
|
+
toJSON() {
|
|
194
|
+
return this._solution;
|
|
195
|
+
}
|
|
196
|
+
[util_1.inspect.custom](_depth, options) {
|
|
197
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
exports.ConversationSummaryContextImpl = ConversationSummaryContextImpl;
|
|
201
|
+
/**
|
|
202
|
+
* Response for batch summary creation.
|
|
203
|
+
*/
|
|
204
|
+
class ConversationSummaryInstance {
|
|
205
|
+
constructor(_version, _payload, storeId, profileId, summaryId) {
|
|
206
|
+
this._version = _version;
|
|
207
|
+
const payload = _payload;
|
|
208
|
+
this.message = payload.message;
|
|
209
|
+
this.source = payload.source;
|
|
210
|
+
this.content = payload.content;
|
|
211
|
+
this.occurredAt = deserialize.iso8601DateTime(payload.occurredAt);
|
|
212
|
+
this.conversationId = payload.conversationId;
|
|
213
|
+
this.id = payload.id;
|
|
214
|
+
this.createdAt = deserialize.iso8601DateTime(payload.createdAt);
|
|
215
|
+
this.updatedAt = deserialize.iso8601DateTime(payload.updatedAt);
|
|
216
|
+
this._solution = { storeId, profileId, summaryId: summaryId };
|
|
217
|
+
}
|
|
218
|
+
get _proxy() {
|
|
219
|
+
this._context =
|
|
220
|
+
this._context ||
|
|
221
|
+
new ConversationSummaryContextImpl(this._version, this._solution.storeId, this._solution.profileId, this._solution.summaryId);
|
|
222
|
+
return this._context;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Remove a ConversationSummaryInstance
|
|
226
|
+
*
|
|
227
|
+
* @param callback - Callback to handle processed record
|
|
228
|
+
*
|
|
229
|
+
* @returns Resolves to processed ConversationSummaryInstance
|
|
230
|
+
*/
|
|
231
|
+
remove(callback) {
|
|
232
|
+
return this._proxy.remove(callback);
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Remove a ConversationSummaryInstance and return HTTP info
|
|
236
|
+
*
|
|
237
|
+
* @param callback - Callback to handle processed record
|
|
238
|
+
*
|
|
239
|
+
* @returns Resolves to processed ConversationSummaryInstance with HTTP metadata
|
|
240
|
+
*/
|
|
241
|
+
removeWithHttpInfo(callback) {
|
|
242
|
+
return this._proxy.removeWithHttpInfo(callback);
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Fetch a ConversationSummaryInstance
|
|
246
|
+
*
|
|
247
|
+
* @param callback - Callback to handle processed record
|
|
248
|
+
*
|
|
249
|
+
* @returns Resolves to processed ConversationSummaryInstance
|
|
250
|
+
*/
|
|
251
|
+
fetch(callback) {
|
|
252
|
+
return this._proxy.fetch(callback);
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Fetch a ConversationSummaryInstance and return HTTP info
|
|
256
|
+
*
|
|
257
|
+
* @param callback - Callback to handle processed record
|
|
258
|
+
*
|
|
259
|
+
* @returns Resolves to processed ConversationSummaryInstance with HTTP metadata
|
|
260
|
+
*/
|
|
261
|
+
fetchWithHttpInfo(callback) {
|
|
262
|
+
return this._proxy.fetchWithHttpInfo(callback);
|
|
263
|
+
}
|
|
264
|
+
patch(params, callback) {
|
|
265
|
+
return this._proxy.patch(params, callback);
|
|
266
|
+
}
|
|
267
|
+
patchWithHttpInfo(params, callback) {
|
|
268
|
+
return this._proxy.patchWithHttpInfo(params, callback);
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Provide a user-friendly representation
|
|
272
|
+
*
|
|
273
|
+
* @returns Object
|
|
274
|
+
*/
|
|
275
|
+
toJSON() {
|
|
276
|
+
return {
|
|
277
|
+
message: this.message,
|
|
278
|
+
source: this.source,
|
|
279
|
+
content: this.content,
|
|
280
|
+
occurredAt: this.occurredAt,
|
|
281
|
+
conversationId: this.conversationId,
|
|
282
|
+
id: this.id,
|
|
283
|
+
createdAt: this.createdAt,
|
|
284
|
+
updatedAt: this.updatedAt,
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
[util_1.inspect.custom](_depth, options) {
|
|
288
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
exports.ConversationSummaryInstance = ConversationSummaryInstance;
|
|
292
|
+
function ConversationSummaryListInstance(version, storeId, profileId) {
|
|
293
|
+
if (!(0, utility_1.isValidPathParam)(storeId)) {
|
|
294
|
+
throw new Error("Parameter 'storeId' is not valid.");
|
|
295
|
+
}
|
|
296
|
+
if (!(0, utility_1.isValidPathParam)(profileId)) {
|
|
297
|
+
throw new Error("Parameter 'profileId' is not valid.");
|
|
298
|
+
}
|
|
299
|
+
const instance = ((summaryId) => instance.get(summaryId));
|
|
300
|
+
instance.get = function get(summaryId) {
|
|
301
|
+
return new ConversationSummaryContextImpl(version, storeId, profileId, summaryId);
|
|
302
|
+
};
|
|
303
|
+
instance._version = version;
|
|
304
|
+
instance._solution = { storeId, profileId };
|
|
305
|
+
instance._uri = `/Stores/${storeId}/Profiles/${profileId}/ConversationSummaries`;
|
|
306
|
+
instance.create = function create(params, headers, callback) {
|
|
307
|
+
if (params === null || params === undefined) {
|
|
308
|
+
throw new Error('Required parameter "params" missing.');
|
|
309
|
+
}
|
|
310
|
+
let data = {};
|
|
311
|
+
data = params;
|
|
312
|
+
if (headers === null || headers === undefined) {
|
|
313
|
+
headers = {};
|
|
314
|
+
}
|
|
315
|
+
headers["Content-Type"] = "application/json";
|
|
316
|
+
headers["Accept"] = "application/json";
|
|
317
|
+
let operationVersion = version, operationPromise = operationVersion.create({
|
|
318
|
+
uri: instance._uri,
|
|
319
|
+
method: "post",
|
|
320
|
+
data,
|
|
321
|
+
headers,
|
|
322
|
+
});
|
|
323
|
+
operationPromise = operationPromise.then((payload) => new ConversationSummaryInstance(operationVersion, payload, instance._solution.storeId, instance._solution.profileId));
|
|
324
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
325
|
+
return operationPromise;
|
|
326
|
+
};
|
|
327
|
+
instance.createWithHttpInfo = function createWithHttpInfo(params, headers, callback) {
|
|
328
|
+
if (params === null || params === undefined) {
|
|
329
|
+
throw new Error('Required parameter "params" missing.');
|
|
330
|
+
}
|
|
331
|
+
let data = {};
|
|
332
|
+
data = params;
|
|
333
|
+
if (headers === null || headers === undefined) {
|
|
334
|
+
headers = {};
|
|
335
|
+
}
|
|
336
|
+
headers["Content-Type"] = "application/json";
|
|
337
|
+
headers["Accept"] = "application/json";
|
|
338
|
+
let operationVersion = version;
|
|
339
|
+
// CREATE, FETCH, UPDATE operations
|
|
340
|
+
let operationPromise = operationVersion
|
|
341
|
+
.createWithResponseInfo({
|
|
342
|
+
uri: instance._uri,
|
|
343
|
+
method: "post",
|
|
344
|
+
data,
|
|
345
|
+
headers,
|
|
346
|
+
})
|
|
347
|
+
.then((response) => ({
|
|
348
|
+
...response,
|
|
349
|
+
body: new ConversationSummaryInstance(operationVersion, response.body, instance._solution.storeId, instance._solution.profileId),
|
|
350
|
+
}));
|
|
351
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
352
|
+
return operationPromise;
|
|
353
|
+
};
|
|
354
|
+
instance.page = function page(params, callback) {
|
|
355
|
+
if (params instanceof Function) {
|
|
356
|
+
callback = params;
|
|
357
|
+
params = {};
|
|
358
|
+
}
|
|
359
|
+
else {
|
|
360
|
+
params = params || {};
|
|
361
|
+
}
|
|
362
|
+
let data = {};
|
|
363
|
+
if (params["pageSize"] !== undefined)
|
|
364
|
+
data["pageSize"] = params["pageSize"];
|
|
365
|
+
if (params["pageToken"] !== undefined)
|
|
366
|
+
data["pageToken"] = params["pageToken"];
|
|
367
|
+
const headers = {};
|
|
368
|
+
headers["Accept"] = "application/json";
|
|
369
|
+
if (params["acceptEncoding"] !== undefined)
|
|
370
|
+
headers["Accept-Encoding"] = params["acceptEncoding"];
|
|
371
|
+
let operationVersion = version, operationPromise = operationVersion.page({
|
|
372
|
+
uri: instance._uri,
|
|
373
|
+
method: "get",
|
|
374
|
+
params: data,
|
|
375
|
+
headers,
|
|
376
|
+
});
|
|
377
|
+
operationPromise = operationPromise.then((payload) => new ConversationSummaryPage(operationVersion, payload, instance._uri, data, instance._solution));
|
|
378
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
379
|
+
return operationPromise;
|
|
380
|
+
};
|
|
381
|
+
instance.each = instance._version.each;
|
|
382
|
+
instance.list = instance._version.list;
|
|
383
|
+
instance.getPage = function getPage(targetUrl, callback) {
|
|
384
|
+
const operationPromise = instance._version._domain.twilio.request({
|
|
385
|
+
method: "get",
|
|
386
|
+
uri: targetUrl,
|
|
387
|
+
});
|
|
388
|
+
let pagePromise = operationPromise.then((payload) => new ConversationSummaryPage(instance._version, payload, instance._uri, {}, instance._solution));
|
|
389
|
+
pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
|
|
390
|
+
return pagePromise;
|
|
391
|
+
};
|
|
392
|
+
instance.pageWithHttpInfo = function pageWithHttpInfo(params, callback) {
|
|
393
|
+
if (params instanceof Function) {
|
|
394
|
+
callback = params;
|
|
395
|
+
params = {};
|
|
396
|
+
}
|
|
397
|
+
else {
|
|
398
|
+
params = params || {};
|
|
399
|
+
}
|
|
400
|
+
let data = {};
|
|
401
|
+
if (params["pageSize"] !== undefined)
|
|
402
|
+
data["pageSize"] = params["pageSize"];
|
|
403
|
+
if (params["pageToken"] !== undefined)
|
|
404
|
+
data["pageToken"] = params["pageToken"];
|
|
405
|
+
const headers = {};
|
|
406
|
+
headers["Accept"] = "application/json";
|
|
407
|
+
if (params["acceptEncoding"] !== undefined)
|
|
408
|
+
headers["Accept-Encoding"] = params["acceptEncoding"];
|
|
409
|
+
let operationVersion = version;
|
|
410
|
+
// For page operations, use page() directly as it already returns { statusCode, body, headers }
|
|
411
|
+
// IMPORTANT: Pass full response to Page constructor, not response.body
|
|
412
|
+
let operationPromise = operationVersion
|
|
413
|
+
.page({ uri: instance._uri, method: "get", params: data, headers })
|
|
414
|
+
.then((response) => ({
|
|
415
|
+
statusCode: response.statusCode,
|
|
416
|
+
headers: response.headers,
|
|
417
|
+
body: new ConversationSummaryPage(operationVersion, response, instance._uri, data, instance._solution),
|
|
418
|
+
}));
|
|
419
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
420
|
+
return operationPromise;
|
|
421
|
+
};
|
|
422
|
+
instance.each = instance._version.each;
|
|
423
|
+
instance.eachWithHttpInfo = instance._version.eachWithHttpInfo;
|
|
424
|
+
instance.list = instance._version.list;
|
|
425
|
+
instance.listWithHttpInfo = instance._version.listWithHttpInfo;
|
|
426
|
+
instance.getPageWithHttpInfo = function getPageWithHttpInfo(targetUrl, callback) {
|
|
427
|
+
// Use request() directly as it already returns { statusCode, body, headers }
|
|
428
|
+
const operationPromise = instance._version._domain.twilio.request({
|
|
429
|
+
method: "get",
|
|
430
|
+
uri: targetUrl,
|
|
431
|
+
});
|
|
432
|
+
let pagePromise = operationPromise.then((response) => ({
|
|
433
|
+
statusCode: response.statusCode,
|
|
434
|
+
headers: response.headers,
|
|
435
|
+
body: new ConversationSummaryPage(instance._version, response, instance._uri, {}, instance._solution),
|
|
436
|
+
}));
|
|
437
|
+
pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
|
|
438
|
+
return pagePromise;
|
|
439
|
+
};
|
|
440
|
+
instance.toJSON = function toJSON() {
|
|
441
|
+
return instance._solution;
|
|
442
|
+
};
|
|
443
|
+
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
|
444
|
+
return (0, util_1.inspect)(instance.toJSON(), options);
|
|
445
|
+
};
|
|
446
|
+
return instance;
|
|
447
|
+
}
|
|
448
|
+
class ConversationSummaryPage extends TokenPage_1.default {
|
|
449
|
+
/**
|
|
450
|
+
* Initialize the ConversationSummaryPage
|
|
451
|
+
*
|
|
452
|
+
* @param version - Version of the resource
|
|
453
|
+
* @param response - Response from the API
|
|
454
|
+
* @param uri - URI of the resource
|
|
455
|
+
* @param params - Query parameters
|
|
456
|
+
* @param solution - Path solution
|
|
457
|
+
*/
|
|
458
|
+
constructor(version, response, uri, params, solution) {
|
|
459
|
+
super(version, response, uri, params, solution);
|
|
460
|
+
}
|
|
461
|
+
/**
|
|
462
|
+
* Build an instance of ConversationSummaryInstance
|
|
463
|
+
*
|
|
464
|
+
* @param payload - Payload response from the API
|
|
465
|
+
*/
|
|
466
|
+
getInstance(payload) {
|
|
467
|
+
return new ConversationSummaryInstance(this._version, payload, this._solution.storeId, this._solution.profileId);
|
|
468
|
+
}
|
|
469
|
+
[util_1.inspect.custom](depth, options) {
|
|
470
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
exports.ConversationSummaryPage = ConversationSummaryPage;
|