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,528 @@
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.ConfigurationPage = exports.ConfigurationInstance = exports.ConfigurationContextImpl = exports.UpdateConfigurationRequest = exports.TriggerParameters = exports.Trigger = exports.RuleUpdateRequestPayload = exports.RuleCreationRequestPayload = exports.Rule = exports.Operator = exports.CreateConfigurationRequest = exports.ContextMemory = exports.ContextKnowledge = exports.Context = exports.Action = 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
+ class Action {
27
+ constructor(payload) {
28
+ this.type = payload["type"];
29
+ this.method = payload["method"];
30
+ this.url = payload["url"];
31
+ }
32
+ }
33
+ exports.Action = Action;
34
+ /**
35
+ * Controls what additional customer and enterprise context is made available to Language Operators when this Rule executes.
36
+ */
37
+ class Context {
38
+ constructor(payload) {
39
+ this.memory = payload["memory"];
40
+ this.knowledge = payload["knowledge"];
41
+ }
42
+ }
43
+ exports.Context = Context;
44
+ /**
45
+ * Configuration for passing Enterprise Knowledge as context to Operators in this Rule (available only for Enterprise Knowledge–enabled accounts).
46
+ */
47
+ class ContextKnowledge {
48
+ constructor(payload) {
49
+ this.bases = payload["bases"];
50
+ }
51
+ }
52
+ exports.ContextKnowledge = ContextKnowledge;
53
+ /**
54
+ * Configuration for passing Memory as context to Operators in this Rule (available only for Memory–enabled accounts).
55
+ */
56
+ class ContextMemory {
57
+ constructor(payload) {
58
+ this.enabled = payload["enabled"];
59
+ }
60
+ }
61
+ exports.ContextMemory = ContextMemory;
62
+ /**
63
+ * Request body for creating a new Intelligence Configuration.
64
+ */
65
+ class CreateConfigurationRequest {
66
+ constructor(payload) {
67
+ this.displayName = payload["displayName"];
68
+ this.description = payload["description"];
69
+ this.rules = payload["rules"];
70
+ }
71
+ }
72
+ exports.CreateConfigurationRequest = CreateConfigurationRequest;
73
+ class Operator {
74
+ constructor(payload) {
75
+ this.id = payload["id"];
76
+ this.version = payload["version"];
77
+ this.parameters = payload["parameters"];
78
+ }
79
+ }
80
+ exports.Operator = Operator;
81
+ class Rule {
82
+ constructor(payload) {
83
+ this.id = payload["id"];
84
+ this.operators = payload["operators"];
85
+ this.triggers = payload["triggers"];
86
+ this.actions = payload["actions"];
87
+ this.context = payload["context"];
88
+ }
89
+ }
90
+ exports.Rule = Rule;
91
+ class RuleCreationRequestPayload {
92
+ constructor(payload) {
93
+ this.operators = payload["operators"];
94
+ this.triggers = payload["triggers"];
95
+ this.actions = payload["actions"];
96
+ this.context = payload["context"];
97
+ }
98
+ }
99
+ exports.RuleCreationRequestPayload = RuleCreationRequestPayload;
100
+ class RuleUpdateRequestPayload {
101
+ constructor(payload) {
102
+ this.id = payload["id"];
103
+ this.operators = payload["operators"];
104
+ this.triggers = payload["triggers"];
105
+ this.actions = payload["actions"];
106
+ this.context = payload["context"];
107
+ }
108
+ }
109
+ exports.RuleUpdateRequestPayload = RuleUpdateRequestPayload;
110
+ class Trigger {
111
+ constructor(payload) {
112
+ this.on = payload["on"];
113
+ this.parameters = payload["parameters"];
114
+ }
115
+ }
116
+ exports.Trigger = Trigger;
117
+ /**
118
+ * Additional configuration to modify Trigger behavior. Only applies to certain Trigger types.
119
+ */
120
+ class TriggerParameters {
121
+ constructor(payload) {
122
+ this.count = payload["count"];
123
+ }
124
+ }
125
+ exports.TriggerParameters = TriggerParameters;
126
+ class UpdateConfigurationRequest {
127
+ constructor(payload) {
128
+ this.displayName = payload["displayName"];
129
+ this.description = payload["description"];
130
+ this.rules = payload["rules"];
131
+ }
132
+ }
133
+ exports.UpdateConfigurationRequest = UpdateConfigurationRequest;
134
+ class ConfigurationContextImpl {
135
+ constructor(_version, id) {
136
+ this._version = _version;
137
+ if (!(0, utility_1.isValidPathParam)(id)) {
138
+ throw new Error("Parameter 'id' is not valid.");
139
+ }
140
+ this._solution = { id };
141
+ this._uri = `/ControlPlane/Configurations/${id}`;
142
+ }
143
+ remove(callback) {
144
+ const headers = {};
145
+ const instance = this;
146
+ let operationVersion = instance._version, operationPromise = operationVersion.remove({
147
+ uri: instance._uri,
148
+ method: "delete",
149
+ headers,
150
+ });
151
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
152
+ return operationPromise;
153
+ }
154
+ removeWithHttpInfo(callback) {
155
+ const headers = {};
156
+ const instance = this;
157
+ let operationVersion = instance._version;
158
+ // DELETE operation - returns boolean based on status code
159
+ let operationPromise = operationVersion
160
+ .removeWithResponseInfo({ uri: instance._uri, method: "delete", headers })
161
+ .then((response) => ({
162
+ ...response,
163
+ body: response.statusCode === 204,
164
+ }));
165
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
166
+ return operationPromise;
167
+ }
168
+ fetch(callback) {
169
+ const headers = {};
170
+ headers["Accept"] = "application/json";
171
+ const instance = this;
172
+ let operationVersion = instance._version, operationPromise = operationVersion.fetch({
173
+ uri: instance._uri,
174
+ method: "get",
175
+ headers,
176
+ });
177
+ operationPromise = operationPromise.then((payload) => new ConfigurationInstance(operationVersion, payload, instance._solution.id));
178
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
179
+ return operationPromise;
180
+ }
181
+ fetchWithHttpInfo(callback) {
182
+ const headers = {};
183
+ headers["Accept"] = "application/json";
184
+ const instance = this;
185
+ let operationVersion = instance._version;
186
+ // CREATE, FETCH, UPDATE operations
187
+ let operationPromise = operationVersion
188
+ .fetchWithResponseInfo({
189
+ uri: instance._uri,
190
+ method: "get",
191
+ headers,
192
+ })
193
+ .then((response) => ({
194
+ ...response,
195
+ body: new ConfigurationInstance(operationVersion, response.body, instance._solution.id),
196
+ }));
197
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
198
+ return operationPromise;
199
+ }
200
+ update(params, headers, callback) {
201
+ if (params === null || params === undefined) {
202
+ throw new Error('Required parameter "params" missing.');
203
+ }
204
+ let data = {};
205
+ data = params;
206
+ if (headers === null || headers === undefined) {
207
+ headers = {};
208
+ }
209
+ headers["Content-Type"] = "application/json";
210
+ headers["Accept"] = "application/json";
211
+ const instance = this;
212
+ let operationVersion = instance._version, operationPromise = operationVersion.update({
213
+ uri: instance._uri,
214
+ method: "put",
215
+ data,
216
+ headers,
217
+ });
218
+ operationPromise = operationPromise.then((payload) => new ConfigurationInstance(operationVersion, payload, instance._solution.id));
219
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
220
+ return operationPromise;
221
+ }
222
+ updateWithHttpInfo(params, headers, callback) {
223
+ if (params === null || params === undefined) {
224
+ throw new Error('Required parameter "params" missing.');
225
+ }
226
+ let data = {};
227
+ data = params;
228
+ if (headers === null || headers === undefined) {
229
+ headers = {};
230
+ }
231
+ headers["Content-Type"] = "application/json";
232
+ headers["Accept"] = "application/json";
233
+ const instance = this;
234
+ let operationVersion = instance._version;
235
+ // CREATE, FETCH, UPDATE operations
236
+ let operationPromise = operationVersion
237
+ .updateWithResponseInfo({
238
+ uri: instance._uri,
239
+ method: "put",
240
+ data,
241
+ headers,
242
+ })
243
+ .then((response) => ({
244
+ ...response,
245
+ body: new ConfigurationInstance(operationVersion, response.body, instance._solution.id),
246
+ }));
247
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
248
+ return operationPromise;
249
+ }
250
+ /**
251
+ * Provide a user-friendly representation
252
+ *
253
+ * @returns Object
254
+ */
255
+ toJSON() {
256
+ return this._solution;
257
+ }
258
+ [util_1.inspect.custom](_depth, options) {
259
+ return (0, util_1.inspect)(this.toJSON(), options);
260
+ }
261
+ }
262
+ exports.ConfigurationContextImpl = ConfigurationContextImpl;
263
+ /**
264
+ * An Intelligence Configuration defines how and when Language Operators execute for a given conversation. To activate an Intelligence Configuration and trigger Operator execution, two conditions must be met: 1. The Intelligence Configuration must include at least one Rule. 2. The Intelligence Configuration must be attached to a Conversations Configuration via the Conversations API. Conversation traffic received by that Conversations Configuration determines when Rules are evaluated and executed. An Intelligence Configuration that has no Rules or is not attached to a Conversations Configuration will not execute.
265
+ */
266
+ class ConfigurationInstance {
267
+ constructor(_version, _payload, id) {
268
+ this._version = _version;
269
+ const payload = _payload;
270
+ this.accountId = payload.accountId;
271
+ this.id = payload.id;
272
+ this.displayName = payload.displayName;
273
+ this.description = payload.description;
274
+ this.version = deserialize.integer(payload.version);
275
+ this.rules =
276
+ payload.rules !== null && payload.rules !== undefined
277
+ ? payload.rules.map((payload) => new Rule(payload))
278
+ : null;
279
+ this.dateCreated = deserialize.iso8601DateTime(payload.dateCreated);
280
+ this.dateUpdated = deserialize.iso8601DateTime(payload.dateUpdated);
281
+ this._solution = { id: id };
282
+ }
283
+ get _proxy() {
284
+ this._context =
285
+ this._context ||
286
+ new ConfigurationContextImpl(this._version, this._solution.id);
287
+ return this._context;
288
+ }
289
+ /**
290
+ * Remove a ConfigurationInstance
291
+ *
292
+ * @param callback - Callback to handle processed record
293
+ *
294
+ * @returns Resolves to processed boolean
295
+ */
296
+ remove(callback) {
297
+ return this._proxy.remove(callback);
298
+ }
299
+ /**
300
+ * Remove a ConfigurationInstance and return HTTP info
301
+ *
302
+ * @param callback - Callback to handle processed record
303
+ *
304
+ * @returns Resolves to processed boolean with HTTP metadata
305
+ */
306
+ removeWithHttpInfo(callback) {
307
+ return this._proxy.removeWithHttpInfo(callback);
308
+ }
309
+ /**
310
+ * Fetch a ConfigurationInstance
311
+ *
312
+ * @param callback - Callback to handle processed record
313
+ *
314
+ * @returns Resolves to processed ConfigurationInstance
315
+ */
316
+ fetch(callback) {
317
+ return this._proxy.fetch(callback);
318
+ }
319
+ /**
320
+ * Fetch a ConfigurationInstance and return HTTP info
321
+ *
322
+ * @param callback - Callback to handle processed record
323
+ *
324
+ * @returns Resolves to processed ConfigurationInstance with HTTP metadata
325
+ */
326
+ fetchWithHttpInfo(callback) {
327
+ return this._proxy.fetchWithHttpInfo(callback);
328
+ }
329
+ update(params, callback) {
330
+ return this._proxy.update(params, callback);
331
+ }
332
+ updateWithHttpInfo(params, callback) {
333
+ return this._proxy.updateWithHttpInfo(params, callback);
334
+ }
335
+ /**
336
+ * Provide a user-friendly representation
337
+ *
338
+ * @returns Object
339
+ */
340
+ toJSON() {
341
+ return {
342
+ accountId: this.accountId,
343
+ id: this.id,
344
+ displayName: this.displayName,
345
+ description: this.description,
346
+ version: this.version,
347
+ rules: this.rules,
348
+ dateCreated: this.dateCreated,
349
+ dateUpdated: this.dateUpdated,
350
+ };
351
+ }
352
+ [util_1.inspect.custom](_depth, options) {
353
+ return (0, util_1.inspect)(this.toJSON(), options);
354
+ }
355
+ }
356
+ exports.ConfigurationInstance = ConfigurationInstance;
357
+ function ConfigurationListInstance(version) {
358
+ const instance = ((id) => instance.get(id));
359
+ instance.get = function get(id) {
360
+ return new ConfigurationContextImpl(version, id);
361
+ };
362
+ instance._version = version;
363
+ instance._solution = {};
364
+ instance._uri = `/ControlPlane/Configurations`;
365
+ instance.create = function create(params, headers, callback) {
366
+ if (params === null || params === undefined) {
367
+ throw new Error('Required parameter "params" missing.');
368
+ }
369
+ let data = {};
370
+ data = params;
371
+ if (headers === null || headers === undefined) {
372
+ headers = {};
373
+ }
374
+ headers["Content-Type"] = "application/json";
375
+ headers["Accept"] = "application/json";
376
+ let operationVersion = version, operationPromise = operationVersion.create({
377
+ uri: instance._uri,
378
+ method: "post",
379
+ data,
380
+ headers,
381
+ });
382
+ operationPromise = operationPromise.then((payload) => new ConfigurationInstance(operationVersion, payload));
383
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
384
+ return operationPromise;
385
+ };
386
+ instance.createWithHttpInfo = function createWithHttpInfo(params, headers, callback) {
387
+ if (params === null || params === undefined) {
388
+ throw new Error('Required parameter "params" missing.');
389
+ }
390
+ let data = {};
391
+ data = params;
392
+ if (headers === null || headers === undefined) {
393
+ headers = {};
394
+ }
395
+ headers["Content-Type"] = "application/json";
396
+ headers["Accept"] = "application/json";
397
+ let operationVersion = version;
398
+ // CREATE, FETCH, UPDATE operations
399
+ let operationPromise = operationVersion
400
+ .createWithResponseInfo({
401
+ uri: instance._uri,
402
+ method: "post",
403
+ data,
404
+ headers,
405
+ })
406
+ .then((response) => ({
407
+ ...response,
408
+ body: new ConfigurationInstance(operationVersion, response.body),
409
+ }));
410
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
411
+ return operationPromise;
412
+ };
413
+ instance.page = function page(params, callback) {
414
+ if (params instanceof Function) {
415
+ callback = params;
416
+ params = {};
417
+ }
418
+ else {
419
+ params = params || {};
420
+ }
421
+ let data = {};
422
+ if (params["pageSize"] !== undefined)
423
+ data["pageSize"] = params["pageSize"];
424
+ if (params["pageToken"] !== undefined)
425
+ data["pageToken"] = params["pageToken"];
426
+ const headers = {};
427
+ headers["Accept"] = "application/json";
428
+ let operationVersion = version, operationPromise = operationVersion.page({
429
+ uri: instance._uri,
430
+ method: "get",
431
+ params: data,
432
+ headers,
433
+ });
434
+ operationPromise = operationPromise.then((payload) => new ConfigurationPage(operationVersion, payload, instance._uri, data, instance._solution));
435
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
436
+ return operationPromise;
437
+ };
438
+ instance.each = instance._version.each;
439
+ instance.list = instance._version.list;
440
+ instance.getPage = function getPage(targetUrl, callback) {
441
+ const operationPromise = instance._version._domain.twilio.request({
442
+ method: "get",
443
+ uri: targetUrl,
444
+ });
445
+ let pagePromise = operationPromise.then((payload) => new ConfigurationPage(instance._version, payload, instance._uri, {}, instance._solution));
446
+ pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
447
+ return pagePromise;
448
+ };
449
+ instance.pageWithHttpInfo = function pageWithHttpInfo(params, callback) {
450
+ if (params instanceof Function) {
451
+ callback = params;
452
+ params = {};
453
+ }
454
+ else {
455
+ params = params || {};
456
+ }
457
+ let data = {};
458
+ if (params["pageSize"] !== undefined)
459
+ data["pageSize"] = params["pageSize"];
460
+ if (params["pageToken"] !== undefined)
461
+ data["pageToken"] = params["pageToken"];
462
+ const headers = {};
463
+ headers["Accept"] = "application/json";
464
+ let operationVersion = version;
465
+ // For page operations, use page() directly as it already returns { statusCode, body, headers }
466
+ // IMPORTANT: Pass full response to Page constructor, not response.body
467
+ let operationPromise = operationVersion
468
+ .page({ uri: instance._uri, method: "get", params: data, headers })
469
+ .then((response) => ({
470
+ statusCode: response.statusCode,
471
+ headers: response.headers,
472
+ body: new ConfigurationPage(operationVersion, response, instance._uri, data, instance._solution),
473
+ }));
474
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
475
+ return operationPromise;
476
+ };
477
+ instance.each = instance._version.each;
478
+ instance.eachWithHttpInfo = instance._version.eachWithHttpInfo;
479
+ instance.list = instance._version.list;
480
+ instance.listWithHttpInfo = instance._version.listWithHttpInfo;
481
+ instance.getPageWithHttpInfo = function getPageWithHttpInfo(targetUrl, callback) {
482
+ // Use request() directly as it already returns { statusCode, body, headers }
483
+ const operationPromise = instance._version._domain.twilio.request({
484
+ method: "get",
485
+ uri: targetUrl,
486
+ });
487
+ let pagePromise = operationPromise.then((response) => ({
488
+ statusCode: response.statusCode,
489
+ headers: response.headers,
490
+ body: new ConfigurationPage(instance._version, response, instance._uri, {}, instance._solution),
491
+ }));
492
+ pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
493
+ return pagePromise;
494
+ };
495
+ instance.toJSON = function toJSON() {
496
+ return instance._solution;
497
+ };
498
+ instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
499
+ return (0, util_1.inspect)(instance.toJSON(), options);
500
+ };
501
+ return instance;
502
+ }
503
+ class ConfigurationPage extends TokenPage_1.default {
504
+ /**
505
+ * Initialize the ConfigurationPage
506
+ *
507
+ * @param version - Version of the resource
508
+ * @param response - Response from the API
509
+ * @param uri - URI of the resource
510
+ * @param params - Query parameters
511
+ * @param solution - Path solution
512
+ */
513
+ constructor(version, response, uri, params, solution) {
514
+ super(version, response, uri, params, solution);
515
+ }
516
+ /**
517
+ * Build an instance of ConfigurationInstance
518
+ *
519
+ * @param payload - Payload response from the API
520
+ */
521
+ getInstance(payload) {
522
+ return new ConfigurationInstance(this._version, payload);
523
+ }
524
+ [util_1.inspect.custom](depth, options) {
525
+ return (0, util_1.inspect)(this.toJSON(), options);
526
+ }
527
+ }
528
+ exports.ConfigurationPage = ConfigurationPage;