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,619 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* This code was generated by
|
|
4
|
+
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
|
5
|
+
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
|
6
|
+
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
|
7
|
+
*
|
|
8
|
+
* Conversation Orchestrator
|
|
9
|
+
* Manage configurations, conversations, participants, and communications. Create configurations to define capture rules and channel settings, then use conversations to group related communications.
|
|
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.ConfigurationPage = exports.ConfigurationInstance = exports.ConfigurationContextImpl = exports.UpdateConfigurationRequestStatusCallbacks = exports.UpdateConfigurationRequestChannelSettingsValueStatusTimeouts = exports.UpdateConfigurationRequestChannelSettingsValueCaptureRules = exports.UpdateConfigurationRequestChannelSettingsValue = exports.UpdateConfigurationRequest = exports.CreateConfigurationRequestStatusCallbacks = exports.CreateConfigurationRequestChannelSettingsValueStatusTimeouts = exports.CreateConfigurationRequestChannelSettingsValueCaptureRules = exports.CreateConfigurationRequestChannelSettingsValue = exports.CreateConfigurationRequest = exports.ConversationsV2StatusTimeouts = exports.ConversationsV2StatusCallbackConfig = exports.ConversationsV2ConversationsV1Bridge = exports.ConversationsV2ChannelSetting = exports.ConversationsV2CaptureRule = void 0;
|
|
20
|
+
exports.ConfigurationListInstance = ConfigurationListInstance;
|
|
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
|
+
* Defines a capture rule with from and to addresses. Supports wildcard `*` for omnidirectional matching.
|
|
28
|
+
*/
|
|
29
|
+
class ConversationsV2CaptureRule {
|
|
30
|
+
constructor(payload) {
|
|
31
|
+
this.from = payload["from"];
|
|
32
|
+
this.to = payload["to"];
|
|
33
|
+
this.metadata = payload["metadata"];
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.ConversationsV2CaptureRule = ConversationsV2CaptureRule;
|
|
37
|
+
/**
|
|
38
|
+
* Configuration settings for a specific channel type.
|
|
39
|
+
*/
|
|
40
|
+
class ConversationsV2ChannelSetting {
|
|
41
|
+
constructor(payload) {
|
|
42
|
+
this.statusTimeouts = payload["statusTimeouts"];
|
|
43
|
+
this.captureRules = payload["captureRules"];
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
exports.ConversationsV2ChannelSetting = ConversationsV2ChannelSetting;
|
|
47
|
+
/**
|
|
48
|
+
* Configuration for Conversations V1 bridge. When set, messaging channels route through Conversations V1. Use this to integrate with existing Conversations V1 applications.
|
|
49
|
+
*/
|
|
50
|
+
class ConversationsV2ConversationsV1Bridge {
|
|
51
|
+
constructor(payload) {
|
|
52
|
+
this.serviceId = payload["serviceId"];
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.ConversationsV2ConversationsV1Bridge = ConversationsV2ConversationsV1Bridge;
|
|
56
|
+
/**
|
|
57
|
+
* Default webhook configuration for Conversation-level events under this Configuration.
|
|
58
|
+
*/
|
|
59
|
+
class ConversationsV2StatusCallbackConfig {
|
|
60
|
+
constructor(payload) {
|
|
61
|
+
this.url = payload["url"];
|
|
62
|
+
this.method = payload["method"];
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
exports.ConversationsV2StatusCallbackConfig = ConversationsV2StatusCallbackConfig;
|
|
66
|
+
/**
|
|
67
|
+
* Timeout settings for channel status transitions.
|
|
68
|
+
*/
|
|
69
|
+
class ConversationsV2StatusTimeouts {
|
|
70
|
+
constructor(payload) {
|
|
71
|
+
this.inactive = payload["inactive"];
|
|
72
|
+
this.closed = payload["closed"];
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
exports.ConversationsV2StatusTimeouts = ConversationsV2StatusTimeouts;
|
|
76
|
+
class CreateConfigurationRequest {
|
|
77
|
+
constructor(payload) {
|
|
78
|
+
this.displayName = payload["displayName"];
|
|
79
|
+
this.description = payload["description"];
|
|
80
|
+
this.conversationGroupingType = payload["conversationGroupingType"];
|
|
81
|
+
this.memoryStoreId = payload["memoryStoreId"];
|
|
82
|
+
this.channelSettings = payload["channelSettings"];
|
|
83
|
+
this.statusCallbacks = payload["statusCallbacks"];
|
|
84
|
+
this.intelligenceConfigurationIds = payload["intelligenceConfigurationIds"];
|
|
85
|
+
this.memoryExtractionEnabled = payload["memoryExtractionEnabled"];
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
exports.CreateConfigurationRequest = CreateConfigurationRequest;
|
|
89
|
+
class CreateConfigurationRequestChannelSettingsValue {
|
|
90
|
+
constructor(payload) {
|
|
91
|
+
this.statusTimeouts = payload["statusTimeouts"];
|
|
92
|
+
this.captureRules = payload["captureRules"];
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
exports.CreateConfigurationRequestChannelSettingsValue = CreateConfigurationRequestChannelSettingsValue;
|
|
96
|
+
class CreateConfigurationRequestChannelSettingsValueCaptureRules {
|
|
97
|
+
constructor(payload) {
|
|
98
|
+
this.from = payload["from"];
|
|
99
|
+
this.to = payload["to"];
|
|
100
|
+
this.metadata = payload["metadata"];
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
exports.CreateConfigurationRequestChannelSettingsValueCaptureRules = CreateConfigurationRequestChannelSettingsValueCaptureRules;
|
|
104
|
+
class CreateConfigurationRequestChannelSettingsValueStatusTimeouts {
|
|
105
|
+
constructor(payload) {
|
|
106
|
+
this.inactive = payload["inactive"];
|
|
107
|
+
this.closed = payload["closed"];
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
exports.CreateConfigurationRequestChannelSettingsValueStatusTimeouts = CreateConfigurationRequestChannelSettingsValueStatusTimeouts;
|
|
111
|
+
class CreateConfigurationRequestStatusCallbacks {
|
|
112
|
+
constructor(payload) {
|
|
113
|
+
this.url = payload["url"];
|
|
114
|
+
this.method = payload["method"];
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
exports.CreateConfigurationRequestStatusCallbacks = CreateConfigurationRequestStatusCallbacks;
|
|
118
|
+
class UpdateConfigurationRequest {
|
|
119
|
+
constructor(payload) {
|
|
120
|
+
this.displayName = payload["displayName"];
|
|
121
|
+
this.description = payload["description"];
|
|
122
|
+
this.conversationGroupingType = payload["conversationGroupingType"];
|
|
123
|
+
this.memoryStoreId = payload["memoryStoreId"];
|
|
124
|
+
this.channelSettings = payload["channelSettings"];
|
|
125
|
+
this.statusCallbacks = payload["statusCallbacks"];
|
|
126
|
+
this.intelligenceConfigurationIds = payload["intelligenceConfigurationIds"];
|
|
127
|
+
this.memoryExtractionEnabled = payload["memoryExtractionEnabled"];
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
exports.UpdateConfigurationRequest = UpdateConfigurationRequest;
|
|
131
|
+
class UpdateConfigurationRequestChannelSettingsValue {
|
|
132
|
+
constructor(payload) {
|
|
133
|
+
this.statusTimeouts = payload["statusTimeouts"];
|
|
134
|
+
this.captureRules = payload["captureRules"];
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
exports.UpdateConfigurationRequestChannelSettingsValue = UpdateConfigurationRequestChannelSettingsValue;
|
|
138
|
+
class UpdateConfigurationRequestChannelSettingsValueCaptureRules {
|
|
139
|
+
constructor(payload) {
|
|
140
|
+
this.from = payload["from"];
|
|
141
|
+
this.to = payload["to"];
|
|
142
|
+
this.metadata = payload["metadata"];
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
exports.UpdateConfigurationRequestChannelSettingsValueCaptureRules = UpdateConfigurationRequestChannelSettingsValueCaptureRules;
|
|
146
|
+
class UpdateConfigurationRequestChannelSettingsValueStatusTimeouts {
|
|
147
|
+
constructor(payload) {
|
|
148
|
+
this.inactive = payload["inactive"];
|
|
149
|
+
this.closed = payload["closed"];
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
exports.UpdateConfigurationRequestChannelSettingsValueStatusTimeouts = UpdateConfigurationRequestChannelSettingsValueStatusTimeouts;
|
|
153
|
+
class UpdateConfigurationRequestStatusCallbacks {
|
|
154
|
+
constructor(payload) {
|
|
155
|
+
this.url = payload["url"];
|
|
156
|
+
this.method = payload["method"];
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
exports.UpdateConfigurationRequestStatusCallbacks = UpdateConfigurationRequestStatusCallbacks;
|
|
160
|
+
class ConfigurationContextImpl {
|
|
161
|
+
constructor(_version, sid) {
|
|
162
|
+
this._version = _version;
|
|
163
|
+
if (!(0, utility_1.isValidPathParam)(sid)) {
|
|
164
|
+
throw new Error("Parameter 'sid' is not valid.");
|
|
165
|
+
}
|
|
166
|
+
this._solution = { sid };
|
|
167
|
+
this._uri = `/ControlPlane/Configurations/${sid}`;
|
|
168
|
+
}
|
|
169
|
+
remove(params, callback) {
|
|
170
|
+
if (params instanceof Function) {
|
|
171
|
+
callback = params;
|
|
172
|
+
params = {};
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
params = params || {};
|
|
176
|
+
}
|
|
177
|
+
let data = {};
|
|
178
|
+
const headers = {};
|
|
179
|
+
headers["Accept"] = "application/json";
|
|
180
|
+
if (params["idempotencyKey"] !== undefined)
|
|
181
|
+
headers["Idempotency-Key"] = params["idempotencyKey"];
|
|
182
|
+
const instance = this;
|
|
183
|
+
let operationVersion = instance._version, operationPromise = operationVersion.fetch({
|
|
184
|
+
uri: instance._uri,
|
|
185
|
+
method: "delete",
|
|
186
|
+
params: data,
|
|
187
|
+
headers,
|
|
188
|
+
});
|
|
189
|
+
operationPromise = operationPromise.then((payload) => new ConfigurationInstance(operationVersion, payload, instance._solution.sid));
|
|
190
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
191
|
+
return operationPromise;
|
|
192
|
+
}
|
|
193
|
+
removeWithHttpInfo(params, callback) {
|
|
194
|
+
if (params instanceof Function) {
|
|
195
|
+
callback = params;
|
|
196
|
+
params = {};
|
|
197
|
+
}
|
|
198
|
+
else {
|
|
199
|
+
params = params || {};
|
|
200
|
+
}
|
|
201
|
+
let data = {};
|
|
202
|
+
const headers = {};
|
|
203
|
+
headers["Accept"] = "application/json";
|
|
204
|
+
if (params["idempotencyKey"] !== undefined)
|
|
205
|
+
headers["Idempotency-Key"] = params["idempotencyKey"];
|
|
206
|
+
const instance = this;
|
|
207
|
+
let operationVersion = instance._version;
|
|
208
|
+
// DELETE operation that returns a response model
|
|
209
|
+
let operationPromise = operationVersion
|
|
210
|
+
.fetchWithResponseInfo({
|
|
211
|
+
uri: instance._uri,
|
|
212
|
+
method: "delete",
|
|
213
|
+
params: data,
|
|
214
|
+
headers,
|
|
215
|
+
})
|
|
216
|
+
.then((response) => ({
|
|
217
|
+
...response,
|
|
218
|
+
body: new ConfigurationInstance(operationVersion, response.body, instance._solution.sid),
|
|
219
|
+
}));
|
|
220
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
221
|
+
return operationPromise;
|
|
222
|
+
}
|
|
223
|
+
fetch(callback) {
|
|
224
|
+
const headers = {};
|
|
225
|
+
headers["Accept"] = "application/json";
|
|
226
|
+
const instance = this;
|
|
227
|
+
let operationVersion = instance._version, operationPromise = operationVersion.fetch({
|
|
228
|
+
uri: instance._uri,
|
|
229
|
+
method: "get",
|
|
230
|
+
headers,
|
|
231
|
+
});
|
|
232
|
+
operationPromise = operationPromise.then((payload) => new ConfigurationInstance(operationVersion, payload, instance._solution.sid));
|
|
233
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
234
|
+
return operationPromise;
|
|
235
|
+
}
|
|
236
|
+
fetchWithHttpInfo(callback) {
|
|
237
|
+
const headers = {};
|
|
238
|
+
headers["Accept"] = "application/json";
|
|
239
|
+
const instance = this;
|
|
240
|
+
let operationVersion = instance._version;
|
|
241
|
+
// CREATE, FETCH, UPDATE operations
|
|
242
|
+
let operationPromise = operationVersion
|
|
243
|
+
.fetchWithResponseInfo({
|
|
244
|
+
uri: instance._uri,
|
|
245
|
+
method: "get",
|
|
246
|
+
headers,
|
|
247
|
+
})
|
|
248
|
+
.then((response) => ({
|
|
249
|
+
...response,
|
|
250
|
+
body: new ConfigurationInstance(operationVersion, response.body, instance._solution.sid),
|
|
251
|
+
}));
|
|
252
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
253
|
+
return operationPromise;
|
|
254
|
+
}
|
|
255
|
+
update(params, headers, callback) {
|
|
256
|
+
if (params instanceof Function) {
|
|
257
|
+
callback = params;
|
|
258
|
+
params =
|
|
259
|
+
{};
|
|
260
|
+
}
|
|
261
|
+
else {
|
|
262
|
+
params =
|
|
263
|
+
params ||
|
|
264
|
+
{};
|
|
265
|
+
}
|
|
266
|
+
let data = {};
|
|
267
|
+
data = params;
|
|
268
|
+
if (headers === null || headers === undefined) {
|
|
269
|
+
headers = {};
|
|
270
|
+
}
|
|
271
|
+
headers["Content-Type"] = "application/json";
|
|
272
|
+
headers["Accept"] = "application/json";
|
|
273
|
+
const instance = this;
|
|
274
|
+
let operationVersion = instance._version, operationPromise = operationVersion.update({
|
|
275
|
+
uri: instance._uri,
|
|
276
|
+
method: "put",
|
|
277
|
+
data,
|
|
278
|
+
headers,
|
|
279
|
+
});
|
|
280
|
+
operationPromise = operationPromise.then((payload) => new ConfigurationInstance(operationVersion, payload, instance._solution.sid));
|
|
281
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
282
|
+
return operationPromise;
|
|
283
|
+
}
|
|
284
|
+
updateWithHttpInfo(params, headers, callback) {
|
|
285
|
+
if (params instanceof Function) {
|
|
286
|
+
callback = params;
|
|
287
|
+
params =
|
|
288
|
+
{};
|
|
289
|
+
}
|
|
290
|
+
else {
|
|
291
|
+
params =
|
|
292
|
+
params ||
|
|
293
|
+
{};
|
|
294
|
+
}
|
|
295
|
+
let data = {};
|
|
296
|
+
data = params;
|
|
297
|
+
if (headers === null || headers === undefined) {
|
|
298
|
+
headers = {};
|
|
299
|
+
}
|
|
300
|
+
headers["Content-Type"] = "application/json";
|
|
301
|
+
headers["Accept"] = "application/json";
|
|
302
|
+
const instance = this;
|
|
303
|
+
let operationVersion = instance._version;
|
|
304
|
+
// CREATE, FETCH, UPDATE operations
|
|
305
|
+
let operationPromise = operationVersion
|
|
306
|
+
.updateWithResponseInfo({
|
|
307
|
+
uri: instance._uri,
|
|
308
|
+
method: "put",
|
|
309
|
+
data,
|
|
310
|
+
headers,
|
|
311
|
+
})
|
|
312
|
+
.then((response) => ({
|
|
313
|
+
...response,
|
|
314
|
+
body: new ConfigurationInstance(operationVersion, response.body, instance._solution.sid),
|
|
315
|
+
}));
|
|
316
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
317
|
+
return operationPromise;
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* Provide a user-friendly representation
|
|
321
|
+
*
|
|
322
|
+
* @returns Object
|
|
323
|
+
*/
|
|
324
|
+
toJSON() {
|
|
325
|
+
return this._solution;
|
|
326
|
+
}
|
|
327
|
+
[util_1.inspect.custom](_depth, options) {
|
|
328
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
exports.ConfigurationContextImpl = ConfigurationContextImpl;
|
|
332
|
+
/**
|
|
333
|
+
* Slim response for an accepted long-running operation.
|
|
334
|
+
*/
|
|
335
|
+
class ConfigurationInstance {
|
|
336
|
+
constructor(_version, _payload, sid) {
|
|
337
|
+
this._version = _version;
|
|
338
|
+
const payload = _payload;
|
|
339
|
+
this.statusUrl = payload.statusUrl;
|
|
340
|
+
this.related = payload.related;
|
|
341
|
+
this.id = payload.id;
|
|
342
|
+
this.displayName = payload.displayName;
|
|
343
|
+
this.description = payload.description;
|
|
344
|
+
this.conversationGroupingType = payload.conversationGroupingType;
|
|
345
|
+
this.memoryStoreId = payload.memoryStoreId;
|
|
346
|
+
this.channelSettings = payload.channelSettings;
|
|
347
|
+
this.statusCallbacks =
|
|
348
|
+
payload.statusCallbacks !== null && payload.statusCallbacks !== undefined
|
|
349
|
+
? payload.statusCallbacks.map((payload) => new ConversationsV2StatusCallbackConfig(payload))
|
|
350
|
+
: null;
|
|
351
|
+
this.intelligenceConfigurationIds = payload.intelligenceConfigurationIds;
|
|
352
|
+
this.memoryExtractionEnabled = payload.memoryExtractionEnabled;
|
|
353
|
+
this.conversationsV1Bridge =
|
|
354
|
+
payload.conversationsV1Bridge !== null &&
|
|
355
|
+
payload.conversationsV1Bridge !== undefined
|
|
356
|
+
? new ConversationsV2ConversationsV1Bridge(payload.conversationsV1Bridge)
|
|
357
|
+
: null;
|
|
358
|
+
this.createdAt = deserialize.iso8601DateTime(payload.createdAt);
|
|
359
|
+
this.updatedAt = deserialize.iso8601DateTime(payload.updatedAt);
|
|
360
|
+
this.version = payload.version;
|
|
361
|
+
this._solution = { sid: sid };
|
|
362
|
+
}
|
|
363
|
+
get _proxy() {
|
|
364
|
+
this._context =
|
|
365
|
+
this._context ||
|
|
366
|
+
new ConfigurationContextImpl(this._version, this._solution.sid);
|
|
367
|
+
return this._context;
|
|
368
|
+
}
|
|
369
|
+
remove(params, callback) {
|
|
370
|
+
return this._proxy.remove(params, callback);
|
|
371
|
+
}
|
|
372
|
+
removeWithHttpInfo(params, callback) {
|
|
373
|
+
return this._proxy.removeWithHttpInfo(params, callback);
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* Fetch a ConfigurationInstance
|
|
377
|
+
*
|
|
378
|
+
* @param callback - Callback to handle processed record
|
|
379
|
+
*
|
|
380
|
+
* @returns Resolves to processed ConfigurationInstance
|
|
381
|
+
*/
|
|
382
|
+
fetch(callback) {
|
|
383
|
+
return this._proxy.fetch(callback);
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* Fetch a ConfigurationInstance and return HTTP info
|
|
387
|
+
*
|
|
388
|
+
* @param callback - Callback to handle processed record
|
|
389
|
+
*
|
|
390
|
+
* @returns Resolves to processed ConfigurationInstance with HTTP metadata
|
|
391
|
+
*/
|
|
392
|
+
fetchWithHttpInfo(callback) {
|
|
393
|
+
return this._proxy.fetchWithHttpInfo(callback);
|
|
394
|
+
}
|
|
395
|
+
update(params, callback) {
|
|
396
|
+
return this._proxy.update(params, callback);
|
|
397
|
+
}
|
|
398
|
+
updateWithHttpInfo(params, callback) {
|
|
399
|
+
return this._proxy.updateWithHttpInfo(params, callback);
|
|
400
|
+
}
|
|
401
|
+
/**
|
|
402
|
+
* Provide a user-friendly representation
|
|
403
|
+
*
|
|
404
|
+
* @returns Object
|
|
405
|
+
*/
|
|
406
|
+
toJSON() {
|
|
407
|
+
return {
|
|
408
|
+
statusUrl: this.statusUrl,
|
|
409
|
+
related: this.related,
|
|
410
|
+
id: this.id,
|
|
411
|
+
displayName: this.displayName,
|
|
412
|
+
description: this.description,
|
|
413
|
+
conversationGroupingType: this.conversationGroupingType,
|
|
414
|
+
memoryStoreId: this.memoryStoreId,
|
|
415
|
+
channelSettings: this.channelSettings,
|
|
416
|
+
statusCallbacks: this.statusCallbacks,
|
|
417
|
+
intelligenceConfigurationIds: this.intelligenceConfigurationIds,
|
|
418
|
+
memoryExtractionEnabled: this.memoryExtractionEnabled,
|
|
419
|
+
conversationsV1Bridge: this.conversationsV1Bridge,
|
|
420
|
+
createdAt: this.createdAt,
|
|
421
|
+
updatedAt: this.updatedAt,
|
|
422
|
+
version: this.version,
|
|
423
|
+
};
|
|
424
|
+
}
|
|
425
|
+
[util_1.inspect.custom](_depth, options) {
|
|
426
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
exports.ConfigurationInstance = ConfigurationInstance;
|
|
430
|
+
function ConfigurationListInstance(version) {
|
|
431
|
+
const instance = ((sid) => instance.get(sid));
|
|
432
|
+
instance.get = function get(sid) {
|
|
433
|
+
return new ConfigurationContextImpl(version, sid);
|
|
434
|
+
};
|
|
435
|
+
instance._version = version;
|
|
436
|
+
instance._solution = {};
|
|
437
|
+
instance._uri = `/ControlPlane/Configurations`;
|
|
438
|
+
instance.create = function create(params, headers, callback) {
|
|
439
|
+
if (params instanceof Function) {
|
|
440
|
+
callback = params;
|
|
441
|
+
params =
|
|
442
|
+
{};
|
|
443
|
+
}
|
|
444
|
+
else {
|
|
445
|
+
params =
|
|
446
|
+
params ||
|
|
447
|
+
{};
|
|
448
|
+
}
|
|
449
|
+
let data = {};
|
|
450
|
+
data = params;
|
|
451
|
+
if (headers === null || headers === undefined) {
|
|
452
|
+
headers = {};
|
|
453
|
+
}
|
|
454
|
+
headers["Content-Type"] = "application/json";
|
|
455
|
+
headers["Accept"] = "application/json";
|
|
456
|
+
let operationVersion = version, operationPromise = operationVersion.create({
|
|
457
|
+
uri: instance._uri,
|
|
458
|
+
method: "post",
|
|
459
|
+
data,
|
|
460
|
+
headers,
|
|
461
|
+
});
|
|
462
|
+
operationPromise = operationPromise.then((payload) => new ConfigurationInstance(operationVersion, payload));
|
|
463
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
464
|
+
return operationPromise;
|
|
465
|
+
};
|
|
466
|
+
instance.createWithHttpInfo = function createWithHttpInfo(params, headers, callback) {
|
|
467
|
+
if (params instanceof Function) {
|
|
468
|
+
callback = params;
|
|
469
|
+
params =
|
|
470
|
+
{};
|
|
471
|
+
}
|
|
472
|
+
else {
|
|
473
|
+
params =
|
|
474
|
+
params ||
|
|
475
|
+
{};
|
|
476
|
+
}
|
|
477
|
+
let data = {};
|
|
478
|
+
data = params;
|
|
479
|
+
if (headers === null || headers === undefined) {
|
|
480
|
+
headers = {};
|
|
481
|
+
}
|
|
482
|
+
headers["Content-Type"] = "application/json";
|
|
483
|
+
headers["Accept"] = "application/json";
|
|
484
|
+
let operationVersion = version;
|
|
485
|
+
// CREATE, FETCH, UPDATE operations
|
|
486
|
+
let operationPromise = operationVersion
|
|
487
|
+
.createWithResponseInfo({
|
|
488
|
+
uri: instance._uri,
|
|
489
|
+
method: "post",
|
|
490
|
+
data,
|
|
491
|
+
headers,
|
|
492
|
+
})
|
|
493
|
+
.then((response) => ({
|
|
494
|
+
...response,
|
|
495
|
+
body: new ConfigurationInstance(operationVersion, response.body),
|
|
496
|
+
}));
|
|
497
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
498
|
+
return operationPromise;
|
|
499
|
+
};
|
|
500
|
+
instance.page = function page(params, callback) {
|
|
501
|
+
if (params instanceof Function) {
|
|
502
|
+
callback = params;
|
|
503
|
+
params = {};
|
|
504
|
+
}
|
|
505
|
+
else {
|
|
506
|
+
params = params || {};
|
|
507
|
+
}
|
|
508
|
+
let data = {};
|
|
509
|
+
if (params["pageSize"] !== undefined)
|
|
510
|
+
data["pageSize"] = params["pageSize"];
|
|
511
|
+
if (params["pageToken"] !== undefined)
|
|
512
|
+
data["pageToken"] = params["pageToken"];
|
|
513
|
+
if (params["memoryStoreId"] !== undefined)
|
|
514
|
+
data["memoryStoreId"] = params["memoryStoreId"];
|
|
515
|
+
const headers = {};
|
|
516
|
+
headers["Accept"] = "application/json";
|
|
517
|
+
let operationVersion = version, operationPromise = operationVersion.page({
|
|
518
|
+
uri: instance._uri,
|
|
519
|
+
method: "get",
|
|
520
|
+
params: data,
|
|
521
|
+
headers,
|
|
522
|
+
});
|
|
523
|
+
operationPromise = operationPromise.then((payload) => new ConfigurationPage(operationVersion, payload, instance._uri, data, instance._solution));
|
|
524
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
525
|
+
return operationPromise;
|
|
526
|
+
};
|
|
527
|
+
instance.each = instance._version.each;
|
|
528
|
+
instance.list = instance._version.list;
|
|
529
|
+
instance.getPage = function getPage(targetUrl, callback) {
|
|
530
|
+
const operationPromise = instance._version._domain.twilio.request({
|
|
531
|
+
method: "get",
|
|
532
|
+
uri: targetUrl,
|
|
533
|
+
});
|
|
534
|
+
let pagePromise = operationPromise.then((payload) => new ConfigurationPage(instance._version, payload, instance._uri, {}, instance._solution));
|
|
535
|
+
pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
|
|
536
|
+
return pagePromise;
|
|
537
|
+
};
|
|
538
|
+
instance.pageWithHttpInfo = function pageWithHttpInfo(params, callback) {
|
|
539
|
+
if (params instanceof Function) {
|
|
540
|
+
callback = params;
|
|
541
|
+
params = {};
|
|
542
|
+
}
|
|
543
|
+
else {
|
|
544
|
+
params = params || {};
|
|
545
|
+
}
|
|
546
|
+
let data = {};
|
|
547
|
+
if (params["pageSize"] !== undefined)
|
|
548
|
+
data["pageSize"] = params["pageSize"];
|
|
549
|
+
if (params["pageToken"] !== undefined)
|
|
550
|
+
data["pageToken"] = params["pageToken"];
|
|
551
|
+
if (params["memoryStoreId"] !== undefined)
|
|
552
|
+
data["memoryStoreId"] = params["memoryStoreId"];
|
|
553
|
+
const headers = {};
|
|
554
|
+
headers["Accept"] = "application/json";
|
|
555
|
+
let operationVersion = version;
|
|
556
|
+
// For page operations, use page() directly as it already returns { statusCode, body, headers }
|
|
557
|
+
// IMPORTANT: Pass full response to Page constructor, not response.body
|
|
558
|
+
let operationPromise = operationVersion
|
|
559
|
+
.page({ uri: instance._uri, method: "get", params: data, headers })
|
|
560
|
+
.then((response) => ({
|
|
561
|
+
statusCode: response.statusCode,
|
|
562
|
+
headers: response.headers,
|
|
563
|
+
body: new ConfigurationPage(operationVersion, response, instance._uri, data, instance._solution),
|
|
564
|
+
}));
|
|
565
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
566
|
+
return operationPromise;
|
|
567
|
+
};
|
|
568
|
+
instance.each = instance._version.each;
|
|
569
|
+
instance.eachWithHttpInfo = instance._version.eachWithHttpInfo;
|
|
570
|
+
instance.list = instance._version.list;
|
|
571
|
+
instance.listWithHttpInfo = instance._version.listWithHttpInfo;
|
|
572
|
+
instance.getPageWithHttpInfo = function getPageWithHttpInfo(targetUrl, callback) {
|
|
573
|
+
// Use request() directly as it already returns { statusCode, body, headers }
|
|
574
|
+
const operationPromise = instance._version._domain.twilio.request({
|
|
575
|
+
method: "get",
|
|
576
|
+
uri: targetUrl,
|
|
577
|
+
});
|
|
578
|
+
let pagePromise = operationPromise.then((response) => ({
|
|
579
|
+
statusCode: response.statusCode,
|
|
580
|
+
headers: response.headers,
|
|
581
|
+
body: new ConfigurationPage(instance._version, response, instance._uri, {}, instance._solution),
|
|
582
|
+
}));
|
|
583
|
+
pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
|
|
584
|
+
return pagePromise;
|
|
585
|
+
};
|
|
586
|
+
instance.toJSON = function toJSON() {
|
|
587
|
+
return instance._solution;
|
|
588
|
+
};
|
|
589
|
+
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
|
590
|
+
return (0, util_1.inspect)(instance.toJSON(), options);
|
|
591
|
+
};
|
|
592
|
+
return instance;
|
|
593
|
+
}
|
|
594
|
+
class ConfigurationPage extends TokenPage_1.default {
|
|
595
|
+
/**
|
|
596
|
+
* Initialize the ConfigurationPage
|
|
597
|
+
*
|
|
598
|
+
* @param version - Version of the resource
|
|
599
|
+
* @param response - Response from the API
|
|
600
|
+
* @param uri - URI of the resource
|
|
601
|
+
* @param params - Query parameters
|
|
602
|
+
* @param solution - Path solution
|
|
603
|
+
*/
|
|
604
|
+
constructor(version, response, uri, params, solution) {
|
|
605
|
+
super(version, response, uri, params, solution);
|
|
606
|
+
}
|
|
607
|
+
/**
|
|
608
|
+
* Build an instance of ConfigurationInstance
|
|
609
|
+
*
|
|
610
|
+
* @param payload - Payload response from the API
|
|
611
|
+
*/
|
|
612
|
+
getInstance(payload) {
|
|
613
|
+
return new ConfigurationInstance(this._version, payload);
|
|
614
|
+
}
|
|
615
|
+
[util_1.inspect.custom](depth, options) {
|
|
616
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
exports.ConfigurationPage = ConfigurationPage;
|