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.
Files changed (121) hide show
  1. package/lib/rest/ConversationsBase.d.ts +3 -0
  2. package/lib/rest/ConversationsBase.js +5 -0
  3. package/lib/rest/InsightsBase.d.ts +3 -0
  4. package/lib/rest/InsightsBase.js +5 -0
  5. package/lib/rest/IntelligenceBase.d.ts +3 -0
  6. package/lib/rest/IntelligenceBase.js +5 -0
  7. package/lib/rest/KnowledgeBase.d.ts +3 -0
  8. package/lib/rest/KnowledgeBase.js +5 -0
  9. package/lib/rest/Memory.d.ts +4 -0
  10. package/lib/rest/Memory.js +8 -0
  11. package/lib/rest/MemoryBase.d.ts +13 -0
  12. package/lib/rest/MemoryBase.js +31 -0
  13. package/lib/rest/Twilio.d.ts +5 -0
  14. package/lib/rest/Twilio.js +5 -0
  15. package/lib/rest/VoiceBase.d.ts +3 -0
  16. package/lib/rest/VoiceBase.js +5 -0
  17. package/lib/rest/api/v2010/account/call/recording.d.ts +2 -0
  18. package/lib/rest/api/v2010/account/call/recording.js +4 -0
  19. package/lib/rest/api/v2010/account/call/transcription.d.ts +1 -1
  20. package/lib/rest/api/v2010/account/call/transcription.js +6 -4
  21. package/lib/rest/api/v2010/account/call.d.ts +2 -0
  22. package/lib/rest/api/v2010/account/call.js +4 -0
  23. package/lib/rest/api/v2010/account/conference/participant.d.ts +2 -0
  24. package/lib/rest/api/v2010/account/conference/participant.js +4 -0
  25. package/lib/rest/conversations/V2.d.ts +38 -0
  26. package/lib/rest/conversations/V2.js +72 -0
  27. package/lib/rest/conversations/v2/action.d.ts +241 -0
  28. package/lib/rest/conversations/v2/action.js +246 -0
  29. package/lib/rest/conversations/v2/communication.d.ts +479 -0
  30. package/lib/rest/conversations/v2/communication.js +436 -0
  31. package/lib/rest/conversations/v2/configuration.d.ts +906 -0
  32. package/lib/rest/conversations/v2/configuration.js +619 -0
  33. package/lib/rest/conversations/v2/conversation.d.ts +936 -0
  34. package/lib/rest/conversations/v2/conversation.js +664 -0
  35. package/lib/rest/conversations/v2/operation.d.ts +167 -0
  36. package/lib/rest/conversations/v2/operation.js +170 -0
  37. package/lib/rest/conversations/v2/participant.d.ts +469 -0
  38. package/lib/rest/conversations/v2/participant.js +442 -0
  39. package/lib/rest/flexApi/v1/plugin/pluginVersions.d.ts +1 -1
  40. package/lib/rest/flexApi/v1/plugin/pluginVersions.js +8 -6
  41. package/lib/rest/insights/V3.d.ts +20 -0
  42. package/lib/rest/insights/V3.js +42 -0
  43. package/lib/rest/insights/v1/call/callSummary.d.ts +10 -10
  44. package/lib/rest/insights/v1/call/event.d.ts +4 -4
  45. package/lib/rest/insights/v1/callSummaries.d.ts +12 -9
  46. package/lib/rest/insights/v3/metadata.d.ts +115 -0
  47. package/lib/rest/insights/v3/metadata.js +118 -0
  48. package/lib/rest/insights/v3/query.d.ts +180 -0
  49. package/lib/rest/insights/v3/query.js +214 -0
  50. package/lib/rest/intelligence/V3.d.ts +35 -0
  51. package/lib/rest/intelligence/V3.js +65 -0
  52. package/lib/rest/intelligence/v3/configuration.d.ts +693 -0
  53. package/lib/rest/intelligence/v3/configuration.js +528 -0
  54. package/lib/rest/intelligence/v3/conversation.d.ts +478 -0
  55. package/lib/rest/intelligence/v3/conversation.js +342 -0
  56. package/lib/rest/intelligence/v3/operator.d.ts +619 -0
  57. package/lib/rest/intelligence/v3/operator.js +493 -0
  58. package/lib/rest/intelligence/v3/operatorResult.d.ts +543 -0
  59. package/lib/rest/intelligence/v3/operatorResult.js +478 -0
  60. package/lib/rest/intelligence/v3/version.d.ts +469 -0
  61. package/lib/rest/intelligence/v3/version.js +341 -0
  62. package/lib/rest/knowledge/V2.d.ts +31 -0
  63. package/lib/rest/knowledge/V2.js +62 -0
  64. package/lib/rest/knowledge/v2/chunk.d.ts +209 -0
  65. package/lib/rest/knowledge/v2/chunk.js +178 -0
  66. package/lib/rest/knowledge/v2/knowledge.d.ts +507 -0
  67. package/lib/rest/knowledge/v2/knowledge.js +466 -0
  68. package/lib/rest/knowledge/v2/knowledgeBasis.d.ts +484 -0
  69. package/lib/rest/knowledge/v2/knowledgeBasis.js +441 -0
  70. package/lib/rest/knowledge/v2/operation.d.ts +162 -0
  71. package/lib/rest/knowledge/v2/operation.js +175 -0
  72. package/lib/rest/knowledge/v2/search.d.ts +180 -0
  73. package/lib/rest/knowledge/v2/search.js +174 -0
  74. package/lib/rest/memory/V1.d.ts +76 -0
  75. package/lib/rest/memory/V1.js +140 -0
  76. package/lib/rest/memory/v1/bulk.d.ts +129 -0
  77. package/lib/rest/memory/v1/bulk.js +158 -0
  78. package/lib/rest/memory/v1/conversationSummary.d.ts +531 -0
  79. package/lib/rest/memory/v1/conversationSummary.js +473 -0
  80. package/lib/rest/memory/v1/dataMapping.d.ts +630 -0
  81. package/lib/rest/memory/v1/dataMapping.js +512 -0
  82. package/lib/rest/memory/v1/event.d.ts +153 -0
  83. package/lib/rest/memory/v1/event.js +159 -0
  84. package/lib/rest/memory/v1/identifier.d.ts +362 -0
  85. package/lib/rest/memory/v1/identifier.js +369 -0
  86. package/lib/rest/memory/v1/identityResolutionSetting.d.ts +247 -0
  87. package/lib/rest/memory/v1/identityResolutionSetting.js +229 -0
  88. package/lib/rest/memory/v1/import.d.ts +292 -0
  89. package/lib/rest/memory/v1/import.js +280 -0
  90. package/lib/rest/memory/v1/lookup.d.ts +82 -0
  91. package/lib/rest/memory/v1/lookup.js +118 -0
  92. package/lib/rest/memory/v1/observation.d.ts +521 -0
  93. package/lib/rest/memory/v1/observation.js +477 -0
  94. package/lib/rest/memory/v1/operation.d.ts +162 -0
  95. package/lib/rest/memory/v1/operation.js +175 -0
  96. package/lib/rest/memory/v1/profile.d.ts +548 -0
  97. package/lib/rest/memory/v1/profile.js +531 -0
  98. package/lib/rest/memory/v1/recall.d.ts +306 -0
  99. package/lib/rest/memory/v1/recall.js +234 -0
  100. package/lib/rest/memory/v1/revision.d.ts +246 -0
  101. package/lib/rest/memory/v1/revision.js +195 -0
  102. package/lib/rest/memory/v1/store.d.ts +544 -0
  103. package/lib/rest/memory/v1/store.js +534 -0
  104. package/lib/rest/memory/v1/trait.d.ts +233 -0
  105. package/lib/rest/memory/v1/trait.js +190 -0
  106. package/lib/rest/memory/v1/traitGroup.d.ts +758 -0
  107. package/lib/rest/memory/v1/traitGroup.js +555 -0
  108. package/lib/rest/messaging/v2/channelsSender.d.ts +8 -0
  109. package/lib/rest/messaging/v2/channelsSender.js +2 -0
  110. package/lib/rest/previewIam/versionless/organization/roleAssignment.d.ts +32 -0
  111. package/lib/rest/previewIam/versionless/organization/roleAssignment.js +14 -0
  112. package/lib/rest/studio/v2/flow.d.ts +4 -0
  113. package/lib/rest/studio/v2/flow.js +8 -0
  114. package/lib/rest/verify/v2/service/webhook.d.ts +2 -2
  115. package/lib/rest/verify/v2/service/webhook.js +8 -8
  116. package/lib/rest/voice/V3.d.ts +15 -0
  117. package/lib/rest/voice/V3.js +37 -0
  118. package/lib/rest/voice/v3/transcription.d.ts +378 -0
  119. package/lib/rest/voice/v3/transcription.js +264 -0
  120. package/lib/twiml/VoiceResponse.d.ts +8 -0
  121. package/package.json +1 -1
@@ -0,0 +1,478 @@
1
+ "use strict";
2
+ /*
3
+ * This code was generated by
4
+ * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
5
+ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
6
+ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
7
+ *
8
+ * Twilio Conversational Intelligence API
9
+ * The Conversational Intelligence API includes resources to create and manage intelligence configurations, define and run language operators, and retrieve processed conversations and operator results. * Use the Configurations resource to create and manage intelligence configurations and define rules that control how and when language operators analyze and transform conversations. * Use the Operators resource to create custom language operators or retrieve Twilio-author and custom operators. * Use the Conversations resource to retrieve conversations processed with an intelligence configuration, and the OperatorResults resource to retrieve language operator results for those conversations.
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator.
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ var __importDefault = (this && this.__importDefault) || function (mod) {
16
+ return (mod && mod.__esModule) ? mod : { "default": mod };
17
+ };
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.OperatorResultPage = exports.OperatorResultInstance = exports.OperatorResultContextImpl = exports.SystemMetaData = exports.ResolvedContextMemory = exports.ResolvedContextKnowledgeSources = exports.ResolvedContextKnowledge = exports.ResolvedContext = exports.OperatorResultsResponseBaseMetadata = exports.OperatorReference = exports.IntelligenceConfigurationReference = exports.ExtractionResultResultEntities = exports.ExtractionResultResult = exports.ExecutionDetailsTrigger = exports.ExecutionDetailsParticipants = exports.ExecutionDetailsCommunications = exports.ExecutionDetails = void 0;
20
+ exports.OperatorResultListInstance = OperatorResultListInstance;
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
+ * Details about the conditions under which the Operator executed.
28
+ */
29
+ class ExecutionDetails {
30
+ constructor(payload) {
31
+ this.trigger = payload["trigger"];
32
+ this.communications = payload["communications"];
33
+ this.channels = payload["channels"];
34
+ this.participants = payload["participants"];
35
+ this.resolvedContext = payload["resolvedContext"];
36
+ }
37
+ }
38
+ exports.ExecutionDetails = ExecutionDetails;
39
+ /**
40
+ * Range of first and last communications in the Conversation that were processed during this Operator execution.
41
+ */
42
+ class ExecutionDetailsCommunications {
43
+ constructor(payload) {
44
+ this.first = payload["first"];
45
+ this.last = payload["last"];
46
+ }
47
+ }
48
+ exports.ExecutionDetailsCommunications = ExecutionDetailsCommunications;
49
+ class ExecutionDetailsParticipants {
50
+ constructor(payload) {
51
+ this.id = payload["id"];
52
+ this.profileId = payload["profileId"];
53
+ this.type = payload["type"];
54
+ }
55
+ }
56
+ exports.ExecutionDetailsParticipants = ExecutionDetailsParticipants;
57
+ /**
58
+ * Metadata for the trigger that generated this Operator Result.
59
+ */
60
+ class ExecutionDetailsTrigger {
61
+ constructor(payload) {
62
+ this.on = payload["on"];
63
+ this.timestamp = payload["timestamp"];
64
+ }
65
+ }
66
+ exports.ExecutionDetailsTrigger = ExecutionDetailsTrigger;
67
+ /**
68
+ * The actual result from executing the Language Operator with `EXTRACTION` output format.
69
+ */
70
+ class ExtractionResultResult {
71
+ constructor(payload) {
72
+ this.entities = payload["entities"];
73
+ }
74
+ }
75
+ exports.ExtractionResultResult = ExtractionResultResult;
76
+ class ExtractionResultResultEntities {
77
+ constructor(payload) {
78
+ this.text = payload["text"];
79
+ this.label = payload["label"];
80
+ }
81
+ }
82
+ exports.ExtractionResultResultEntities = ExtractionResultResultEntities;
83
+ /**
84
+ * Reference to the Intelligence Configuration that generated the Operator Result.
85
+ */
86
+ class IntelligenceConfigurationReference {
87
+ constructor(payload) {
88
+ this.id = payload["id"];
89
+ this.ruleId = payload["ruleId"];
90
+ this.version = payload["version"];
91
+ }
92
+ }
93
+ exports.IntelligenceConfigurationReference = IntelligenceConfigurationReference;
94
+ /**
95
+ * Reference to the Language Operator that generated the Operator Result.
96
+ */
97
+ class OperatorReference {
98
+ constructor(payload) {
99
+ this.id = payload["id"];
100
+ this.version = payload["version"];
101
+ this.parameters = payload["parameters"];
102
+ }
103
+ }
104
+ exports.OperatorReference = OperatorReference;
105
+ class OperatorResultsResponseBaseMetadata {
106
+ constructor(payload) {
107
+ this.system = payload["system"];
108
+ }
109
+ }
110
+ exports.OperatorResultsResponseBaseMetadata = OperatorResultsResponseBaseMetadata;
111
+ /**
112
+ * The context that was actually used by the operator during execution
113
+ */
114
+ class ResolvedContext {
115
+ constructor(payload) {
116
+ this.memory = payload["memory"];
117
+ this.knowledge = payload["knowledge"];
118
+ }
119
+ }
120
+ exports.ResolvedContext = ResolvedContext;
121
+ /**
122
+ * Knowledge source IDs with their respective knowledge base ID that was accessed and used by the LLM to generate the result. null if no knowledge was accessed.
123
+ */
124
+ class ResolvedContextKnowledge {
125
+ constructor(payload) {
126
+ this.sources = payload["sources"];
127
+ }
128
+ }
129
+ exports.ResolvedContextKnowledge = ResolvedContextKnowledge;
130
+ class ResolvedContextKnowledgeSources {
131
+ constructor(payload) {
132
+ this.baseId = payload["baseId"];
133
+ this.sourceId = payload["sourceId"];
134
+ }
135
+ }
136
+ exports.ResolvedContextKnowledgeSources = ResolvedContextKnowledgeSources;
137
+ /**
138
+ * The customer profile that was accessed. null if no memory was accessed. Either observations and/or traits from the profile were used by the LLM to generate the result.
139
+ */
140
+ class ResolvedContextMemory {
141
+ constructor(payload) {
142
+ this.profileId = payload["profileId"];
143
+ this.memoryStoreId = payload["memoryStoreId"];
144
+ }
145
+ }
146
+ exports.ResolvedContextMemory = ResolvedContextMemory;
147
+ class SystemMetaData {
148
+ constructor(payload) {
149
+ this.resolvedModel = payload["resolvedModel"];
150
+ this.latencyMs = payload["latencyMs"];
151
+ this.inputCharacters = payload["inputCharacters"];
152
+ this.outputCharacters = payload["outputCharacters"];
153
+ this.inputTruncated = payload["inputTruncated"];
154
+ }
155
+ }
156
+ exports.SystemMetaData = SystemMetaData;
157
+ class OperatorResultContextImpl {
158
+ constructor(_version, operatorResultId) {
159
+ this._version = _version;
160
+ if (!(0, utility_1.isValidPathParam)(operatorResultId)) {
161
+ throw new Error("Parameter 'operatorResultId' is not valid.");
162
+ }
163
+ this._solution = { operatorResultId };
164
+ this._uri = `/OperatorResults/${operatorResultId}`;
165
+ }
166
+ remove(callback) {
167
+ const headers = {};
168
+ const instance = this;
169
+ let operationVersion = instance._version, operationPromise = operationVersion.remove({
170
+ uri: instance._uri,
171
+ method: "delete",
172
+ headers,
173
+ });
174
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
175
+ return operationPromise;
176
+ }
177
+ removeWithHttpInfo(callback) {
178
+ const headers = {};
179
+ const instance = this;
180
+ let operationVersion = instance._version;
181
+ // DELETE operation - returns boolean based on status code
182
+ let operationPromise = operationVersion
183
+ .removeWithResponseInfo({ uri: instance._uri, method: "delete", headers })
184
+ .then((response) => ({
185
+ ...response,
186
+ body: response.statusCode === 204,
187
+ }));
188
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
189
+ return operationPromise;
190
+ }
191
+ fetch(callback) {
192
+ const headers = {};
193
+ headers["Accept"] = "application/json";
194
+ const instance = this;
195
+ let operationVersion = instance._version, operationPromise = operationVersion.fetch({
196
+ uri: instance._uri,
197
+ method: "get",
198
+ headers,
199
+ });
200
+ operationPromise = operationPromise.then((payload) => new OperatorResultInstance(operationVersion, payload, instance._solution.operatorResultId));
201
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
202
+ return operationPromise;
203
+ }
204
+ fetchWithHttpInfo(callback) {
205
+ const headers = {};
206
+ headers["Accept"] = "application/json";
207
+ const instance = this;
208
+ let operationVersion = instance._version;
209
+ // CREATE, FETCH, UPDATE operations
210
+ let operationPromise = operationVersion
211
+ .fetchWithResponseInfo({
212
+ uri: instance._uri,
213
+ method: "get",
214
+ headers,
215
+ })
216
+ .then((response) => ({
217
+ ...response,
218
+ body: new OperatorResultInstance(operationVersion, response.body, instance._solution.operatorResultId),
219
+ }));
220
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
221
+ return operationPromise;
222
+ }
223
+ /**
224
+ * Provide a user-friendly representation
225
+ *
226
+ * @returns Object
227
+ */
228
+ toJSON() {
229
+ return this._solution;
230
+ }
231
+ [util_1.inspect.custom](_depth, options) {
232
+ return (0, util_1.inspect)(this.toJSON(), options);
233
+ }
234
+ }
235
+ exports.OperatorResultContextImpl = OperatorResultContextImpl;
236
+ class OperatorResultInstance {
237
+ constructor(_version, _payload, operatorResultId) {
238
+ this._version = _version;
239
+ const payload = _payload;
240
+ this.outputFormat = payload.outputFormat;
241
+ this.id = payload.id;
242
+ this.accountId = payload.accountId;
243
+ this.intelligenceConfiguration =
244
+ payload.intelligenceConfiguration !== null &&
245
+ payload.intelligenceConfiguration !== undefined
246
+ ? new IntelligenceConfigurationReference(payload.intelligenceConfiguration)
247
+ : null;
248
+ this.conversationId = payload.conversationId;
249
+ this.operator =
250
+ payload.operator !== null && payload.operator !== undefined
251
+ ? new OperatorReference(payload.operator)
252
+ : null;
253
+ this.dateCreated = deserialize.iso8601DateTime(payload.dateCreated);
254
+ this.referenceIds = payload.referenceIds;
255
+ this.executionDetails =
256
+ payload.executionDetails !== null &&
257
+ payload.executionDetails !== undefined
258
+ ? new ExecutionDetails(payload.executionDetails)
259
+ : null;
260
+ this.metadata =
261
+ payload.metadata !== null && payload.metadata !== undefined
262
+ ? new OperatorResultsResponseBaseMetadata(payload.metadata)
263
+ : null;
264
+ this.result =
265
+ payload.result !== null && payload.result !== undefined
266
+ ? new ExtractionResultResult(payload.result)
267
+ : null;
268
+ this._solution = { operatorResultId: operatorResultId };
269
+ }
270
+ get _proxy() {
271
+ this._context =
272
+ this._context ||
273
+ new OperatorResultContextImpl(this._version, this._solution.operatorResultId);
274
+ return this._context;
275
+ }
276
+ /**
277
+ * Remove a OperatorResultInstance
278
+ *
279
+ * @param callback - Callback to handle processed record
280
+ *
281
+ * @returns Resolves to processed boolean
282
+ */
283
+ remove(callback) {
284
+ return this._proxy.remove(callback);
285
+ }
286
+ /**
287
+ * Remove a OperatorResultInstance and return HTTP info
288
+ *
289
+ * @param callback - Callback to handle processed record
290
+ *
291
+ * @returns Resolves to processed boolean with HTTP metadata
292
+ */
293
+ removeWithHttpInfo(callback) {
294
+ return this._proxy.removeWithHttpInfo(callback);
295
+ }
296
+ /**
297
+ * Fetch a OperatorResultInstance
298
+ *
299
+ * @param callback - Callback to handle processed record
300
+ *
301
+ * @returns Resolves to processed OperatorResultInstance
302
+ */
303
+ fetch(callback) {
304
+ return this._proxy.fetch(callback);
305
+ }
306
+ /**
307
+ * Fetch a OperatorResultInstance and return HTTP info
308
+ *
309
+ * @param callback - Callback to handle processed record
310
+ *
311
+ * @returns Resolves to processed OperatorResultInstance with HTTP metadata
312
+ */
313
+ fetchWithHttpInfo(callback) {
314
+ return this._proxy.fetchWithHttpInfo(callback);
315
+ }
316
+ /**
317
+ * Provide a user-friendly representation
318
+ *
319
+ * @returns Object
320
+ */
321
+ toJSON() {
322
+ return {
323
+ outputFormat: this.outputFormat,
324
+ id: this.id,
325
+ accountId: this.accountId,
326
+ intelligenceConfiguration: this.intelligenceConfiguration,
327
+ conversationId: this.conversationId,
328
+ operator: this.operator,
329
+ dateCreated: this.dateCreated,
330
+ referenceIds: this.referenceIds,
331
+ executionDetails: this.executionDetails,
332
+ metadata: this.metadata,
333
+ result: this.result,
334
+ };
335
+ }
336
+ [util_1.inspect.custom](_depth, options) {
337
+ return (0, util_1.inspect)(this.toJSON(), options);
338
+ }
339
+ }
340
+ exports.OperatorResultInstance = OperatorResultInstance;
341
+ function OperatorResultListInstance(version) {
342
+ const instance = ((operatorResultId) => instance.get(operatorResultId));
343
+ instance.get = function get(operatorResultId) {
344
+ return new OperatorResultContextImpl(version, operatorResultId);
345
+ };
346
+ instance._version = version;
347
+ instance._solution = {};
348
+ instance._uri = `/OperatorResults`;
349
+ instance.page = function page(params, callback) {
350
+ if (params instanceof Function) {
351
+ callback = params;
352
+ params = {};
353
+ }
354
+ else {
355
+ params = params || {};
356
+ }
357
+ let data = {};
358
+ if (params["conversationId"] !== undefined)
359
+ data["conversationId"] = params["conversationId"];
360
+ if (params["intelligenceConfigurationId"] !== undefined)
361
+ data["intelligenceConfigurationId"] =
362
+ params["intelligenceConfigurationId"];
363
+ if (params["operatorId"] !== undefined)
364
+ data["operatorId"] = params["operatorId"];
365
+ if (params["pageSize"] !== undefined)
366
+ data["pageSize"] = params["pageSize"];
367
+ if (params["pageToken"] !== undefined)
368
+ data["pageToken"] = params["pageToken"];
369
+ const headers = {};
370
+ headers["Accept"] = "application/json";
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 OperatorResultPage(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 OperatorResultPage(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["conversationId"] !== undefined)
402
+ data["conversationId"] = params["conversationId"];
403
+ if (params["intelligenceConfigurationId"] !== undefined)
404
+ data["intelligenceConfigurationId"] =
405
+ params["intelligenceConfigurationId"];
406
+ if (params["operatorId"] !== undefined)
407
+ data["operatorId"] = params["operatorId"];
408
+ if (params["pageSize"] !== undefined)
409
+ data["pageSize"] = params["pageSize"];
410
+ if (params["pageToken"] !== undefined)
411
+ data["pageToken"] = params["pageToken"];
412
+ const headers = {};
413
+ headers["Accept"] = "application/json";
414
+ let operationVersion = version;
415
+ // For page operations, use page() directly as it already returns { statusCode, body, headers }
416
+ // IMPORTANT: Pass full response to Page constructor, not response.body
417
+ let operationPromise = operationVersion
418
+ .page({ uri: instance._uri, method: "get", params: data, headers })
419
+ .then((response) => ({
420
+ statusCode: response.statusCode,
421
+ headers: response.headers,
422
+ body: new OperatorResultPage(operationVersion, response, instance._uri, data, instance._solution),
423
+ }));
424
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
425
+ return operationPromise;
426
+ };
427
+ instance.each = instance._version.each;
428
+ instance.eachWithHttpInfo = instance._version.eachWithHttpInfo;
429
+ instance.list = instance._version.list;
430
+ instance.listWithHttpInfo = instance._version.listWithHttpInfo;
431
+ instance.getPageWithHttpInfo = function getPageWithHttpInfo(targetUrl, callback) {
432
+ // Use request() directly as it already returns { statusCode, body, headers }
433
+ const operationPromise = instance._version._domain.twilio.request({
434
+ method: "get",
435
+ uri: targetUrl,
436
+ });
437
+ let pagePromise = operationPromise.then((response) => ({
438
+ statusCode: response.statusCode,
439
+ headers: response.headers,
440
+ body: new OperatorResultPage(instance._version, response, instance._uri, {}, instance._solution),
441
+ }));
442
+ pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
443
+ return pagePromise;
444
+ };
445
+ instance.toJSON = function toJSON() {
446
+ return instance._solution;
447
+ };
448
+ instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
449
+ return (0, util_1.inspect)(instance.toJSON(), options);
450
+ };
451
+ return instance;
452
+ }
453
+ class OperatorResultPage extends TokenPage_1.default {
454
+ /**
455
+ * Initialize the OperatorResultPage
456
+ *
457
+ * @param version - Version of the resource
458
+ * @param response - Response from the API
459
+ * @param uri - URI of the resource
460
+ * @param params - Query parameters
461
+ * @param solution - Path solution
462
+ */
463
+ constructor(version, response, uri, params, solution) {
464
+ super(version, response, uri, params, solution);
465
+ }
466
+ /**
467
+ * Build an instance of OperatorResultInstance
468
+ *
469
+ * @param payload - Payload response from the API
470
+ */
471
+ getInstance(payload) {
472
+ return new OperatorResultInstance(this._version, payload);
473
+ }
474
+ [util_1.inspect.custom](depth, options) {
475
+ return (0, util_1.inspect)(this.toJSON(), options);
476
+ }
477
+ }
478
+ exports.OperatorResultPage = OperatorResultPage;