twilio 6.0.0 → 6.0.1
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 +35 -0
- package/lib/rest/conversations/V2.js +67 -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 +441 -0
- package/lib/rest/memory/v1/profile.js +467 -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 +503 -0
- package/lib/rest/memory/v1/store.js +482 -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,512 @@
|
|
|
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.DataMappingPage = exports.DataMappingInstance = exports.DataMappingContextImpl = exports.MappingTraitItem = exports.DataMappingToTraits = exports.DataMappingFromDataSet = exports.DataMappingCore = exports.CreateDataMappingInput = void 0;
|
|
20
|
+
exports.DataMappingListInstance = DataMappingListInstance;
|
|
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
|
+
* A data mapping connects external data sources to a Memory Store, enabling automatic ingestion and mapping of data to profile traits.
|
|
28
|
+
*/
|
|
29
|
+
class CreateDataMappingInput {
|
|
30
|
+
constructor(payload) {
|
|
31
|
+
this.displayName = payload["displayName"];
|
|
32
|
+
this.description = payload["description"];
|
|
33
|
+
this.isEnabled = payload["isEnabled"];
|
|
34
|
+
this.mappingTo = payload["mappingTo"];
|
|
35
|
+
this.mappingFrom = payload["mappingFrom"];
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.CreateDataMappingInput = CreateDataMappingInput;
|
|
39
|
+
/**
|
|
40
|
+
* Writable fields of a data mapping. Used directly as the PATCH request body (all fields optional). Composed into CreateDataMappingInput via allOf.
|
|
41
|
+
*/
|
|
42
|
+
class DataMappingCore {
|
|
43
|
+
constructor(payload) {
|
|
44
|
+
this.displayName = payload["displayName"];
|
|
45
|
+
this.description = payload["description"];
|
|
46
|
+
this.isEnabled = payload["isEnabled"];
|
|
47
|
+
this.mappingTo = payload["mappingTo"];
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.DataMappingCore = DataMappingCore;
|
|
51
|
+
/**
|
|
52
|
+
* Configuration for mapping from a TDI dataset.
|
|
53
|
+
*/
|
|
54
|
+
class DataMappingFromDataSet {
|
|
55
|
+
constructor(payload) {
|
|
56
|
+
this.type = payload["type"];
|
|
57
|
+
this.datasetId = payload["datasetId"];
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
exports.DataMappingFromDataSet = DataMappingFromDataSet;
|
|
61
|
+
/**
|
|
62
|
+
* Configuration for mapping data to traits in a Memory Store.
|
|
63
|
+
*/
|
|
64
|
+
class DataMappingToTraits {
|
|
65
|
+
constructor(payload) {
|
|
66
|
+
this.type = payload["type"];
|
|
67
|
+
this.mappings = payload["mappings"];
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
exports.DataMappingToTraits = DataMappingToTraits;
|
|
71
|
+
/**
|
|
72
|
+
* Maps a field from a source to a Trait in the Memory Store.
|
|
73
|
+
*/
|
|
74
|
+
class MappingTraitItem {
|
|
75
|
+
constructor(payload) {
|
|
76
|
+
this.fieldName = payload["fieldName"];
|
|
77
|
+
this.expression = payload["expression"];
|
|
78
|
+
this.traitGroup = payload["traitGroup"];
|
|
79
|
+
this.traitName = payload["traitName"];
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
exports.MappingTraitItem = MappingTraitItem;
|
|
83
|
+
class DataMappingContextImpl {
|
|
84
|
+
constructor(_version, storeId, dataMappingId) {
|
|
85
|
+
this._version = _version;
|
|
86
|
+
if (!(0, utility_1.isValidPathParam)(storeId)) {
|
|
87
|
+
throw new Error("Parameter 'storeId' is not valid.");
|
|
88
|
+
}
|
|
89
|
+
if (!(0, utility_1.isValidPathParam)(dataMappingId)) {
|
|
90
|
+
throw new Error("Parameter 'dataMappingId' is not valid.");
|
|
91
|
+
}
|
|
92
|
+
this._solution = { storeId, dataMappingId };
|
|
93
|
+
this._uri = `/ControlPlane/Stores/${storeId}/DataMappings/${dataMappingId}`;
|
|
94
|
+
}
|
|
95
|
+
remove(callback) {
|
|
96
|
+
const headers = {};
|
|
97
|
+
headers["Accept"] = "application/json";
|
|
98
|
+
const instance = this;
|
|
99
|
+
let operationVersion = instance._version, operationPromise = operationVersion.fetch({
|
|
100
|
+
uri: instance._uri,
|
|
101
|
+
method: "delete",
|
|
102
|
+
headers,
|
|
103
|
+
});
|
|
104
|
+
operationPromise = operationPromise.then((payload) => new DataMappingInstance(operationVersion, payload, instance._solution.storeId, instance._solution.dataMappingId));
|
|
105
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
106
|
+
return operationPromise;
|
|
107
|
+
}
|
|
108
|
+
removeWithHttpInfo(callback) {
|
|
109
|
+
const headers = {};
|
|
110
|
+
headers["Accept"] = "application/json";
|
|
111
|
+
const instance = this;
|
|
112
|
+
let operationVersion = instance._version;
|
|
113
|
+
// DELETE operation that returns a response model
|
|
114
|
+
let operationPromise = operationVersion
|
|
115
|
+
.fetchWithResponseInfo({
|
|
116
|
+
uri: instance._uri,
|
|
117
|
+
method: "delete",
|
|
118
|
+
headers,
|
|
119
|
+
})
|
|
120
|
+
.then((response) => ({
|
|
121
|
+
...response,
|
|
122
|
+
body: new DataMappingInstance(operationVersion, response.body, instance._solution.storeId, instance._solution.dataMappingId),
|
|
123
|
+
}));
|
|
124
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
125
|
+
return operationPromise;
|
|
126
|
+
}
|
|
127
|
+
fetch(callback) {
|
|
128
|
+
const headers = {};
|
|
129
|
+
headers["Accept"] = "application/json";
|
|
130
|
+
const instance = this;
|
|
131
|
+
let operationVersion = instance._version, operationPromise = operationVersion.fetch({
|
|
132
|
+
uri: instance._uri,
|
|
133
|
+
method: "get",
|
|
134
|
+
headers,
|
|
135
|
+
});
|
|
136
|
+
operationPromise = operationPromise.then((payload) => new DataMappingInstance(operationVersion, payload, instance._solution.storeId, instance._solution.dataMappingId));
|
|
137
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
138
|
+
return operationPromise;
|
|
139
|
+
}
|
|
140
|
+
fetchWithHttpInfo(callback) {
|
|
141
|
+
const headers = {};
|
|
142
|
+
headers["Accept"] = "application/json";
|
|
143
|
+
const instance = this;
|
|
144
|
+
let operationVersion = instance._version;
|
|
145
|
+
// CREATE, FETCH, UPDATE operations
|
|
146
|
+
let operationPromise = operationVersion
|
|
147
|
+
.fetchWithResponseInfo({
|
|
148
|
+
uri: instance._uri,
|
|
149
|
+
method: "get",
|
|
150
|
+
headers,
|
|
151
|
+
})
|
|
152
|
+
.then((response) => ({
|
|
153
|
+
...response,
|
|
154
|
+
body: new DataMappingInstance(operationVersion, response.body, instance._solution.storeId, instance._solution.dataMappingId),
|
|
155
|
+
}));
|
|
156
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
157
|
+
return operationPromise;
|
|
158
|
+
}
|
|
159
|
+
patch(params, headers, callback) {
|
|
160
|
+
if (params instanceof Function) {
|
|
161
|
+
callback = params;
|
|
162
|
+
params = {};
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
params = params || {};
|
|
166
|
+
}
|
|
167
|
+
let data = {};
|
|
168
|
+
data = params;
|
|
169
|
+
if (headers === null || headers === undefined) {
|
|
170
|
+
headers = {};
|
|
171
|
+
}
|
|
172
|
+
headers["Content-Type"] = "application/json";
|
|
173
|
+
headers["Accept"] = "application/json";
|
|
174
|
+
const instance = this;
|
|
175
|
+
let operationVersion = instance._version, operationPromise = operationVersion.patch({
|
|
176
|
+
uri: instance._uri,
|
|
177
|
+
method: "patch",
|
|
178
|
+
data,
|
|
179
|
+
headers,
|
|
180
|
+
});
|
|
181
|
+
operationPromise = operationPromise.then((payload) => new DataMappingInstance(operationVersion, payload, instance._solution.storeId, instance._solution.dataMappingId));
|
|
182
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
183
|
+
return operationPromise;
|
|
184
|
+
}
|
|
185
|
+
patchWithHttpInfo(params, headers, callback) {
|
|
186
|
+
if (params instanceof Function) {
|
|
187
|
+
callback = params;
|
|
188
|
+
params = {};
|
|
189
|
+
}
|
|
190
|
+
else {
|
|
191
|
+
params = params || {};
|
|
192
|
+
}
|
|
193
|
+
let data = {};
|
|
194
|
+
data = params;
|
|
195
|
+
if (headers === null || headers === undefined) {
|
|
196
|
+
headers = {};
|
|
197
|
+
}
|
|
198
|
+
headers["Content-Type"] = "application/json";
|
|
199
|
+
headers["Accept"] = "application/json";
|
|
200
|
+
const instance = this;
|
|
201
|
+
let operationVersion = instance._version;
|
|
202
|
+
// CREATE, FETCH, UPDATE operations
|
|
203
|
+
let operationPromise = operationVersion
|
|
204
|
+
.patchWithResponseInfo({
|
|
205
|
+
uri: instance._uri,
|
|
206
|
+
method: "patch",
|
|
207
|
+
data,
|
|
208
|
+
headers,
|
|
209
|
+
})
|
|
210
|
+
.then((response) => ({
|
|
211
|
+
...response,
|
|
212
|
+
body: new DataMappingInstance(operationVersion, response.body, instance._solution.storeId, instance._solution.dataMappingId),
|
|
213
|
+
}));
|
|
214
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
215
|
+
return operationPromise;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Provide a user-friendly representation
|
|
219
|
+
*
|
|
220
|
+
* @returns Object
|
|
221
|
+
*/
|
|
222
|
+
toJSON() {
|
|
223
|
+
return this._solution;
|
|
224
|
+
}
|
|
225
|
+
[util_1.inspect.custom](_depth, options) {
|
|
226
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
exports.DataMappingContextImpl = DataMappingContextImpl;
|
|
230
|
+
class DataMappingInstance {
|
|
231
|
+
constructor(_version, _payload, storeId, dataMappingId) {
|
|
232
|
+
this._version = _version;
|
|
233
|
+
const payload = _payload;
|
|
234
|
+
this.message = payload.message;
|
|
235
|
+
this.statusUrl = payload.statusUrl;
|
|
236
|
+
this.displayName = payload.displayName;
|
|
237
|
+
this.description = payload.description;
|
|
238
|
+
this.isEnabled = payload.isEnabled;
|
|
239
|
+
this.mappingTo =
|
|
240
|
+
payload.mappingTo !== null && payload.mappingTo !== undefined
|
|
241
|
+
? new DataMappingToTraits(payload.mappingTo)
|
|
242
|
+
: null;
|
|
243
|
+
this.mappingFrom =
|
|
244
|
+
payload.mappingFrom !== null && payload.mappingFrom !== undefined
|
|
245
|
+
? new DataMappingFromDataSet(payload.mappingFrom)
|
|
246
|
+
: null;
|
|
247
|
+
this.id = payload.id;
|
|
248
|
+
this.createdAt = deserialize.iso8601DateTime(payload.createdAt);
|
|
249
|
+
this.updatedAt = deserialize.iso8601DateTime(payload.updatedAt);
|
|
250
|
+
this.version = deserialize.integer(payload.version);
|
|
251
|
+
this._solution = { storeId, dataMappingId: dataMappingId };
|
|
252
|
+
}
|
|
253
|
+
get _proxy() {
|
|
254
|
+
this._context =
|
|
255
|
+
this._context ||
|
|
256
|
+
new DataMappingContextImpl(this._version, this._solution.storeId, this._solution.dataMappingId);
|
|
257
|
+
return this._context;
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Remove a DataMappingInstance
|
|
261
|
+
*
|
|
262
|
+
* @param callback - Callback to handle processed record
|
|
263
|
+
*
|
|
264
|
+
* @returns Resolves to processed DataMappingInstance
|
|
265
|
+
*/
|
|
266
|
+
remove(callback) {
|
|
267
|
+
return this._proxy.remove(callback);
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Remove a DataMappingInstance and return HTTP info
|
|
271
|
+
*
|
|
272
|
+
* @param callback - Callback to handle processed record
|
|
273
|
+
*
|
|
274
|
+
* @returns Resolves to processed DataMappingInstance with HTTP metadata
|
|
275
|
+
*/
|
|
276
|
+
removeWithHttpInfo(callback) {
|
|
277
|
+
return this._proxy.removeWithHttpInfo(callback);
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* Fetch a DataMappingInstance
|
|
281
|
+
*
|
|
282
|
+
* @param callback - Callback to handle processed record
|
|
283
|
+
*
|
|
284
|
+
* @returns Resolves to processed DataMappingInstance
|
|
285
|
+
*/
|
|
286
|
+
fetch(callback) {
|
|
287
|
+
return this._proxy.fetch(callback);
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Fetch a DataMappingInstance and return HTTP info
|
|
291
|
+
*
|
|
292
|
+
* @param callback - Callback to handle processed record
|
|
293
|
+
*
|
|
294
|
+
* @returns Resolves to processed DataMappingInstance with HTTP metadata
|
|
295
|
+
*/
|
|
296
|
+
fetchWithHttpInfo(callback) {
|
|
297
|
+
return this._proxy.fetchWithHttpInfo(callback);
|
|
298
|
+
}
|
|
299
|
+
patch(params, callback) {
|
|
300
|
+
return this._proxy.patch(params, callback);
|
|
301
|
+
}
|
|
302
|
+
patchWithHttpInfo(params, callback) {
|
|
303
|
+
return this._proxy.patchWithHttpInfo(params, callback);
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Provide a user-friendly representation
|
|
307
|
+
*
|
|
308
|
+
* @returns Object
|
|
309
|
+
*/
|
|
310
|
+
toJSON() {
|
|
311
|
+
return {
|
|
312
|
+
message: this.message,
|
|
313
|
+
statusUrl: this.statusUrl,
|
|
314
|
+
displayName: this.displayName,
|
|
315
|
+
description: this.description,
|
|
316
|
+
isEnabled: this.isEnabled,
|
|
317
|
+
mappingTo: this.mappingTo,
|
|
318
|
+
mappingFrom: this.mappingFrom,
|
|
319
|
+
id: this.id,
|
|
320
|
+
createdAt: this.createdAt,
|
|
321
|
+
updatedAt: this.updatedAt,
|
|
322
|
+
version: this.version,
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
[util_1.inspect.custom](_depth, options) {
|
|
326
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
exports.DataMappingInstance = DataMappingInstance;
|
|
330
|
+
function DataMappingListInstance(version, storeId) {
|
|
331
|
+
if (!(0, utility_1.isValidPathParam)(storeId)) {
|
|
332
|
+
throw new Error("Parameter 'storeId' is not valid.");
|
|
333
|
+
}
|
|
334
|
+
const instance = ((dataMappingId) => instance.get(dataMappingId));
|
|
335
|
+
instance.get = function get(dataMappingId) {
|
|
336
|
+
return new DataMappingContextImpl(version, storeId, dataMappingId);
|
|
337
|
+
};
|
|
338
|
+
instance._version = version;
|
|
339
|
+
instance._solution = { storeId };
|
|
340
|
+
instance._uri = `/ControlPlane/Stores/${storeId}/DataMappings`;
|
|
341
|
+
instance.create = function create(params, headers, callback) {
|
|
342
|
+
if (params === null || params === undefined) {
|
|
343
|
+
throw new Error('Required parameter "params" missing.');
|
|
344
|
+
}
|
|
345
|
+
let data = {};
|
|
346
|
+
data = params;
|
|
347
|
+
if (headers === null || headers === undefined) {
|
|
348
|
+
headers = {};
|
|
349
|
+
}
|
|
350
|
+
headers["Content-Type"] = "application/json";
|
|
351
|
+
headers["Accept"] = "application/json";
|
|
352
|
+
let operationVersion = version, operationPromise = operationVersion.create({
|
|
353
|
+
uri: instance._uri,
|
|
354
|
+
method: "post",
|
|
355
|
+
data,
|
|
356
|
+
headers,
|
|
357
|
+
});
|
|
358
|
+
operationPromise = operationPromise.then((payload) => new DataMappingInstance(operationVersion, payload, instance._solution.storeId));
|
|
359
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
360
|
+
return operationPromise;
|
|
361
|
+
};
|
|
362
|
+
instance.createWithHttpInfo = function createWithHttpInfo(params, headers, callback) {
|
|
363
|
+
if (params === null || params === undefined) {
|
|
364
|
+
throw new Error('Required parameter "params" missing.');
|
|
365
|
+
}
|
|
366
|
+
let data = {};
|
|
367
|
+
data = params;
|
|
368
|
+
if (headers === null || headers === undefined) {
|
|
369
|
+
headers = {};
|
|
370
|
+
}
|
|
371
|
+
headers["Content-Type"] = "application/json";
|
|
372
|
+
headers["Accept"] = "application/json";
|
|
373
|
+
let operationVersion = version;
|
|
374
|
+
// CREATE, FETCH, UPDATE operations
|
|
375
|
+
let operationPromise = operationVersion
|
|
376
|
+
.createWithResponseInfo({
|
|
377
|
+
uri: instance._uri,
|
|
378
|
+
method: "post",
|
|
379
|
+
data,
|
|
380
|
+
headers,
|
|
381
|
+
})
|
|
382
|
+
.then((response) => ({
|
|
383
|
+
...response,
|
|
384
|
+
body: new DataMappingInstance(operationVersion, response.body, instance._solution.storeId),
|
|
385
|
+
}));
|
|
386
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
387
|
+
return operationPromise;
|
|
388
|
+
};
|
|
389
|
+
instance.page = function page(params, callback) {
|
|
390
|
+
if (params instanceof Function) {
|
|
391
|
+
callback = params;
|
|
392
|
+
params = {};
|
|
393
|
+
}
|
|
394
|
+
else {
|
|
395
|
+
params = params || {};
|
|
396
|
+
}
|
|
397
|
+
let data = {};
|
|
398
|
+
if (params["pageSize"] !== undefined)
|
|
399
|
+
data["pageSize"] = params["pageSize"];
|
|
400
|
+
if (params["pageToken"] !== undefined)
|
|
401
|
+
data["pageToken"] = params["pageToken"];
|
|
402
|
+
if (params["orderBy"] !== undefined)
|
|
403
|
+
data["orderBy"] = params["orderBy"];
|
|
404
|
+
if (params["type"] !== undefined)
|
|
405
|
+
data["type"] = params["type"];
|
|
406
|
+
const headers = {};
|
|
407
|
+
headers["Accept"] = "application/json";
|
|
408
|
+
let operationVersion = version, operationPromise = operationVersion.page({
|
|
409
|
+
uri: instance._uri,
|
|
410
|
+
method: "get",
|
|
411
|
+
params: data,
|
|
412
|
+
headers,
|
|
413
|
+
});
|
|
414
|
+
operationPromise = operationPromise.then((payload) => new DataMappingPage(operationVersion, payload, instance._uri, data, instance._solution));
|
|
415
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
416
|
+
return operationPromise;
|
|
417
|
+
};
|
|
418
|
+
instance.each = instance._version.each;
|
|
419
|
+
instance.list = instance._version.list;
|
|
420
|
+
instance.getPage = function getPage(targetUrl, callback) {
|
|
421
|
+
const operationPromise = instance._version._domain.twilio.request({
|
|
422
|
+
method: "get",
|
|
423
|
+
uri: targetUrl,
|
|
424
|
+
});
|
|
425
|
+
let pagePromise = operationPromise.then((payload) => new DataMappingPage(instance._version, payload, instance._uri, {}, instance._solution));
|
|
426
|
+
pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
|
|
427
|
+
return pagePromise;
|
|
428
|
+
};
|
|
429
|
+
instance.pageWithHttpInfo = function pageWithHttpInfo(params, callback) {
|
|
430
|
+
if (params instanceof Function) {
|
|
431
|
+
callback = params;
|
|
432
|
+
params = {};
|
|
433
|
+
}
|
|
434
|
+
else {
|
|
435
|
+
params = params || {};
|
|
436
|
+
}
|
|
437
|
+
let data = {};
|
|
438
|
+
if (params["pageSize"] !== undefined)
|
|
439
|
+
data["pageSize"] = params["pageSize"];
|
|
440
|
+
if (params["pageToken"] !== undefined)
|
|
441
|
+
data["pageToken"] = params["pageToken"];
|
|
442
|
+
if (params["orderBy"] !== undefined)
|
|
443
|
+
data["orderBy"] = params["orderBy"];
|
|
444
|
+
if (params["type"] !== undefined)
|
|
445
|
+
data["type"] = params["type"];
|
|
446
|
+
const headers = {};
|
|
447
|
+
headers["Accept"] = "application/json";
|
|
448
|
+
let operationVersion = version;
|
|
449
|
+
// For page operations, use page() directly as it already returns { statusCode, body, headers }
|
|
450
|
+
// IMPORTANT: Pass full response to Page constructor, not response.body
|
|
451
|
+
let operationPromise = operationVersion
|
|
452
|
+
.page({ uri: instance._uri, method: "get", params: data, headers })
|
|
453
|
+
.then((response) => ({
|
|
454
|
+
statusCode: response.statusCode,
|
|
455
|
+
headers: response.headers,
|
|
456
|
+
body: new DataMappingPage(operationVersion, response, instance._uri, data, instance._solution),
|
|
457
|
+
}));
|
|
458
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
459
|
+
return operationPromise;
|
|
460
|
+
};
|
|
461
|
+
instance.each = instance._version.each;
|
|
462
|
+
instance.eachWithHttpInfo = instance._version.eachWithHttpInfo;
|
|
463
|
+
instance.list = instance._version.list;
|
|
464
|
+
instance.listWithHttpInfo = instance._version.listWithHttpInfo;
|
|
465
|
+
instance.getPageWithHttpInfo = function getPageWithHttpInfo(targetUrl, callback) {
|
|
466
|
+
// Use request() directly as it already returns { statusCode, body, headers }
|
|
467
|
+
const operationPromise = instance._version._domain.twilio.request({
|
|
468
|
+
method: "get",
|
|
469
|
+
uri: targetUrl,
|
|
470
|
+
});
|
|
471
|
+
let pagePromise = operationPromise.then((response) => ({
|
|
472
|
+
statusCode: response.statusCode,
|
|
473
|
+
headers: response.headers,
|
|
474
|
+
body: new DataMappingPage(instance._version, response, instance._uri, {}, instance._solution),
|
|
475
|
+
}));
|
|
476
|
+
pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
|
|
477
|
+
return pagePromise;
|
|
478
|
+
};
|
|
479
|
+
instance.toJSON = function toJSON() {
|
|
480
|
+
return instance._solution;
|
|
481
|
+
};
|
|
482
|
+
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
|
483
|
+
return (0, util_1.inspect)(instance.toJSON(), options);
|
|
484
|
+
};
|
|
485
|
+
return instance;
|
|
486
|
+
}
|
|
487
|
+
class DataMappingPage extends TokenPage_1.default {
|
|
488
|
+
/**
|
|
489
|
+
* Initialize the DataMappingPage
|
|
490
|
+
*
|
|
491
|
+
* @param version - Version of the resource
|
|
492
|
+
* @param response - Response from the API
|
|
493
|
+
* @param uri - URI of the resource
|
|
494
|
+
* @param params - Query parameters
|
|
495
|
+
* @param solution - Path solution
|
|
496
|
+
*/
|
|
497
|
+
constructor(version, response, uri, params, solution) {
|
|
498
|
+
super(version, response, uri, params, solution);
|
|
499
|
+
}
|
|
500
|
+
/**
|
|
501
|
+
* Build an instance of DataMappingInstance
|
|
502
|
+
*
|
|
503
|
+
* @param payload - Payload response from the API
|
|
504
|
+
*/
|
|
505
|
+
getInstance(payload) {
|
|
506
|
+
return new DataMappingInstance(this._version, payload, this._solution.storeId);
|
|
507
|
+
}
|
|
508
|
+
[util_1.inspect.custom](depth, options) {
|
|
509
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
exports.DataMappingPage = DataMappingPage;
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { inspect, InspectOptions } from "util";
|
|
2
|
+
import V1 from "../V1";
|
|
3
|
+
import { ApiResponse } from "../../../base/ApiResponse";
|
|
4
|
+
export declare class CommunicationLifecycleEventRecipient {
|
|
5
|
+
/**
|
|
6
|
+
* The recipient\'s address. Must be a valid address matching the channel type such as E.164 format for phone numbers.
|
|
7
|
+
*/
|
|
8
|
+
"address": string;
|
|
9
|
+
/**
|
|
10
|
+
* The unique identifier for the recipient participant.
|
|
11
|
+
*/
|
|
12
|
+
"participantId": string;
|
|
13
|
+
constructor(payload: any);
|
|
14
|
+
}
|
|
15
|
+
export declare class CommunicationLifecycleEventSender {
|
|
16
|
+
/**
|
|
17
|
+
* The sender\'s address. Must be a valid address matching the channel type such as E.164 format for phone numbers.
|
|
18
|
+
*/
|
|
19
|
+
"address": string;
|
|
20
|
+
/**
|
|
21
|
+
* The unique identifier for the sender participant.
|
|
22
|
+
*/
|
|
23
|
+
"participantId": string;
|
|
24
|
+
constructor(payload: any);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Request body for adding events to a specific profile. This request can contain multiple events.
|
|
28
|
+
*/
|
|
29
|
+
export declare class ProfileEventRequest {
|
|
30
|
+
/**
|
|
31
|
+
* The type of event being sent.
|
|
32
|
+
*/
|
|
33
|
+
"type": string;
|
|
34
|
+
"events": Array<ProfileEventRequestEvents>;
|
|
35
|
+
constructor(payload: any);
|
|
36
|
+
}
|
|
37
|
+
export declare class ProfileEventRequestEvents {
|
|
38
|
+
/**
|
|
39
|
+
* The time the event occurred in ISO8601 format with millisecond resolution. Defaults to received time if not provided.
|
|
40
|
+
*/
|
|
41
|
+
"timestamp": Date;
|
|
42
|
+
/**
|
|
43
|
+
* The lifecycle event type of the communication.
|
|
44
|
+
*/
|
|
45
|
+
"lifecycle": string;
|
|
46
|
+
/**
|
|
47
|
+
* The unique identifier for the conversation.
|
|
48
|
+
*/
|
|
49
|
+
"conversationId": string;
|
|
50
|
+
/**
|
|
51
|
+
* The unique identifier for the communication.
|
|
52
|
+
*/
|
|
53
|
+
"communicationId"?: string;
|
|
54
|
+
/**
|
|
55
|
+
* The communication channel type.
|
|
56
|
+
*/
|
|
57
|
+
"communicationType": string;
|
|
58
|
+
/**
|
|
59
|
+
* The lifecycle status of the communication.
|
|
60
|
+
*/
|
|
61
|
+
"communicationStatus"?: string;
|
|
62
|
+
/**
|
|
63
|
+
* The direction of the communication.
|
|
64
|
+
*/
|
|
65
|
+
"direction"?: string;
|
|
66
|
+
"sender"?: CommunicationLifecycleEventSender;
|
|
67
|
+
"recipient"?: CommunicationLifecycleEventRecipient;
|
|
68
|
+
/**
|
|
69
|
+
* Error code for FAILED communication status.
|
|
70
|
+
*/
|
|
71
|
+
"errorCode"?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Error message for FAILED communication status.
|
|
74
|
+
*/
|
|
75
|
+
"errorMessage"?: string;
|
|
76
|
+
constructor(payload: any);
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Options to pass to create a EventInstance
|
|
80
|
+
*/
|
|
81
|
+
export interface EventListInstanceCreateOptions {
|
|
82
|
+
/** */
|
|
83
|
+
profileEventRequest?: ProfileEventRequest;
|
|
84
|
+
}
|
|
85
|
+
export interface EventSolution {
|
|
86
|
+
storeId: string;
|
|
87
|
+
profileId: string;
|
|
88
|
+
}
|
|
89
|
+
export interface EventListInstance {
|
|
90
|
+
_version: V1;
|
|
91
|
+
_solution: EventSolution;
|
|
92
|
+
_uri: string;
|
|
93
|
+
/**
|
|
94
|
+
* Create a EventInstance
|
|
95
|
+
*
|
|
96
|
+
* @param callback - Callback to handle processed record
|
|
97
|
+
*
|
|
98
|
+
* @returns Resolves to processed EventInstance
|
|
99
|
+
*/
|
|
100
|
+
create(callback?: (error: Error | null, item?: EventInstance) => any): Promise<EventInstance>;
|
|
101
|
+
/**
|
|
102
|
+
* Create a EventInstance
|
|
103
|
+
*
|
|
104
|
+
* @param params - Body for request
|
|
105
|
+
* @param headers - header params for request
|
|
106
|
+
* @param callback - Callback to handle processed record
|
|
107
|
+
*
|
|
108
|
+
* @returns Resolves to processed EventInstance
|
|
109
|
+
*/
|
|
110
|
+
create(params: ProfileEventRequest, headers?: any, callback?: (error: Error | null, item?: EventInstance) => any): Promise<EventInstance>;
|
|
111
|
+
/**
|
|
112
|
+
* Create a EventInstance and return HTTP info
|
|
113
|
+
*
|
|
114
|
+
* @param callback - Callback to handle processed record
|
|
115
|
+
*
|
|
116
|
+
* @returns Resolves to processed EventInstance with HTTP metadata
|
|
117
|
+
*/
|
|
118
|
+
createWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<EventInstance>) => any): Promise<ApiResponse<EventInstance>>;
|
|
119
|
+
/**
|
|
120
|
+
* Create a EventInstance and return HTTP info
|
|
121
|
+
*
|
|
122
|
+
* @param params - Body for request
|
|
123
|
+
* @param headers - header params for request
|
|
124
|
+
* @param callback - Callback to handle processed record
|
|
125
|
+
*
|
|
126
|
+
* @returns Resolves to processed EventInstance with HTTP metadata
|
|
127
|
+
*/
|
|
128
|
+
createWithHttpInfo(params: ProfileEventRequest, headers?: any, callback?: (error: Error | null, item?: ApiResponse<EventInstance>) => any): Promise<ApiResponse<EventInstance>>;
|
|
129
|
+
/**
|
|
130
|
+
* Provide a user-friendly representation
|
|
131
|
+
*/
|
|
132
|
+
toJSON(): any;
|
|
133
|
+
[inspect.custom](_depth: any, options: InspectOptions): any;
|
|
134
|
+
}
|
|
135
|
+
export declare function EventListInstance(version: V1, storeId: string, profileId: string): EventListInstance;
|
|
136
|
+
interface EventResource {
|
|
137
|
+
message: string;
|
|
138
|
+
}
|
|
139
|
+
export declare class EventInstance {
|
|
140
|
+
protected _version: V1;
|
|
141
|
+
constructor(_version: V1, _payload: EventResource, storeId: string, profileId: string);
|
|
142
|
+
message: string;
|
|
143
|
+
/**
|
|
144
|
+
* Provide a user-friendly representation
|
|
145
|
+
*
|
|
146
|
+
* @returns Object
|
|
147
|
+
*/
|
|
148
|
+
toJSON(): {
|
|
149
|
+
message: string;
|
|
150
|
+
};
|
|
151
|
+
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
152
|
+
}
|
|
153
|
+
export {};
|