twilio 5.12.2 → 5.13.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.
Files changed (108) hide show
  1. package/README.md +1 -0
  2. package/lib/rest/InsightsBase.d.ts +3 -0
  3. package/lib/rest/InsightsBase.js +5 -0
  4. package/lib/rest/api/v2010/account/call/payment.d.ts +6 -2
  5. package/lib/rest/api/v2010/account/call/payment.js +8 -0
  6. package/lib/rest/api/v2010/account/call/transcription.d.ts +4 -0
  7. package/lib/rest/api/v2010/account/call/transcription.js +8 -0
  8. package/lib/rest/api/v2010/account/token.d.ts +1 -0
  9. package/lib/rest/api/v2010/account/token.js +10 -1
  10. package/lib/rest/assistants/v1/assistant/feedback.d.ts +1 -0
  11. package/lib/rest/assistants/v1/assistant/feedback.js +6 -0
  12. package/lib/rest/assistants/v1/assistant/message.d.ts +1 -0
  13. package/lib/rest/assistants/v1/assistant/message.js +7 -0
  14. package/lib/rest/assistants/v1/assistant.d.ts +6 -0
  15. package/lib/rest/assistants/v1/assistant.js +58 -2
  16. package/lib/rest/assistants/v1/knowledge.d.ts +3 -0
  17. package/lib/rest/assistants/v1/knowledge.js +24 -0
  18. package/lib/rest/assistants/v1/tool.d.ts +4 -0
  19. package/lib/rest/assistants/v1/tool.js +40 -1
  20. package/lib/rest/content/v1/content/approvalCreate.d.ts +1 -0
  21. package/lib/rest/content/v1/content/approvalCreate.js +4 -0
  22. package/lib/rest/content/v1/content.d.ts +27 -0
  23. package/lib/rest/content/v1/content.js +171 -0
  24. package/lib/rest/flexApi/v1/createFlexInstance.d.ts +2 -0
  25. package/lib/rest/flexApi/v1/createFlexInstance.js +6 -0
  26. package/lib/rest/iam/v1/oAuthApp.d.ts +4 -0
  27. package/lib/rest/iam/v1/oAuthApp.js +28 -1
  28. package/lib/rest/insights/V2.d.ts +21 -0
  29. package/lib/rest/insights/V2.js +46 -0
  30. package/lib/rest/insights/v2/inbound.d.ts +436 -0
  31. package/lib/rest/insights/v2/inbound.js +342 -0
  32. package/lib/rest/insights/v2/outbound.d.ts +529 -0
  33. package/lib/rest/insights/v2/outbound.js +392 -0
  34. package/lib/rest/insights/v2/report.d.ts +783 -0
  35. package/lib/rest/insights/v2/report.js +550 -0
  36. package/lib/rest/intelligence/v2/operatorType.d.ts +6 -0
  37. package/lib/rest/intelligence/v2/operatorType.js +4 -0
  38. package/lib/rest/knowledge/v1/knowledge.d.ts +3 -0
  39. package/lib/rest/knowledge/v1/knowledge.js +23 -0
  40. package/lib/rest/lookups/v2/bucket.d.ts +1 -0
  41. package/lib/rest/lookups/v2/bucket.js +4 -0
  42. package/lib/rest/lookups/v2/lookupOverride.d.ts +1 -0
  43. package/lib/rest/lookups/v2/lookupOverride.js +4 -0
  44. package/lib/rest/lookups/v2/phoneNumber.d.ts +9 -0
  45. package/lib/rest/lookups/v2/phoneNumber.js +94 -8
  46. package/lib/rest/lookups/v2/query.d.ts +15 -0
  47. package/lib/rest/lookups/v2/query.js +113 -1
  48. package/lib/rest/lookups/v2/rateLimit.d.ts +1 -0
  49. package/lib/rest/lookups/v2/rateLimit.js +11 -1
  50. package/lib/rest/marketplace/v1/installedAddOn/installedAddOnUsage.d.ts +2 -0
  51. package/lib/rest/marketplace/v1/installedAddOn/installedAddOnUsage.js +13 -1
  52. package/lib/rest/marketplace/v1/referralConversion.d.ts +1 -0
  53. package/lib/rest/marketplace/v1/referralConversion.js +3 -0
  54. package/lib/rest/messaging/v1/service/usAppToPerson.d.ts +78 -5
  55. package/lib/rest/messaging/v1/service/usAppToPerson.js +60 -20
  56. package/lib/rest/messaging/v1/tollfreeVerification.d.ts +26 -24
  57. package/lib/rest/messaging/v2/channelsSender.d.ts +18 -0
  58. package/lib/rest/messaging/v2/channelsSender.js +115 -6
  59. package/lib/rest/numbers/V1.d.ts +8 -0
  60. package/lib/rest/numbers/V1.js +12 -0
  61. package/lib/rest/numbers/v1/embeddedSession.d.ts +84 -0
  62. package/lib/rest/numbers/v1/embeddedSession.js +115 -0
  63. package/lib/rest/numbers/v1/portingPortIn.d.ts +5 -0
  64. package/lib/rest/numbers/v1/portingPortIn.js +67 -2
  65. package/lib/rest/numbers/v1/senderIdRegistration.d.ts +181 -0
  66. package/lib/rest/numbers/v1/senderIdRegistration.js +146 -0
  67. package/lib/rest/numbers/v2/application.d.ts +194 -4
  68. package/lib/rest/numbers/v2/application.js +188 -3
  69. package/lib/rest/previewIam/versionless/organization/roleAssignment.d.ts +1 -0
  70. package/lib/rest/previewIam/versionless/organization/roleAssignment.js +5 -0
  71. package/lib/rest/previewIam/versionless/organization/user.d.ts +69 -0
  72. package/lib/rest/previewIam/versionless/organization/user.js +117 -4
  73. package/lib/rest/pricing/v1/messaging/country.d.ts +3 -0
  74. package/lib/rest/pricing/v1/messaging/country.js +26 -2
  75. package/lib/rest/pricing/v1/phoneNumber/country.d.ts +1 -0
  76. package/lib/rest/pricing/v1/phoneNumber/country.js +10 -1
  77. package/lib/rest/pricing/v1/voice/country.d.ts +2 -0
  78. package/lib/rest/pricing/v1/voice/country.js +21 -2
  79. package/lib/rest/pricing/v1/voice/number.d.ts +2 -0
  80. package/lib/rest/pricing/v1/voice/number.js +19 -2
  81. package/lib/rest/pricing/v2/country.d.ts +2 -0
  82. package/lib/rest/pricing/v2/country.js +22 -2
  83. package/lib/rest/pricing/v2/number.d.ts +2 -0
  84. package/lib/rest/pricing/v2/number.js +22 -2
  85. package/lib/rest/pricing/v2/voice/country.d.ts +2 -0
  86. package/lib/rest/pricing/v2/voice/country.js +22 -2
  87. package/lib/rest/pricing/v2/voice/number.d.ts +2 -0
  88. package/lib/rest/pricing/v2/voice/number.js +20 -2
  89. package/lib/rest/studio/v2/flow/execution.d.ts +12 -0
  90. package/lib/rest/studio/v2/flow/execution.js +4 -0
  91. package/lib/rest/studio/v2/flow/flowRevision.d.ts +6 -0
  92. package/lib/rest/studio/v2/flow/flowRevision.js +2 -0
  93. package/lib/rest/studio/v2/flow.d.ts +6 -0
  94. package/lib/rest/studio/v2/flow.js +2 -0
  95. package/lib/rest/verify/v2/service/approveChallenge.d.ts +2 -0
  96. package/lib/rest/verify/v2/service/approveChallenge.js +13 -0
  97. package/lib/rest/verify/v2/service/newChallenge.d.ts +1 -0
  98. package/lib/rest/verify/v2/service/newChallenge.js +4 -0
  99. package/lib/rest/verify/v2/service/newFactor.d.ts +3 -0
  100. package/lib/rest/verify/v2/service/newFactor.js +16 -0
  101. package/lib/rest/verify/v2/service/newVerifyFactor.d.ts +2 -0
  102. package/lib/rest/verify/v2/service/newVerifyFactor.js +12 -0
  103. package/lib/rest/verify/v2/service/verification.d.ts +1 -1
  104. package/lib/rest/video/v1/room/participant/subscribeRules.d.ts +1 -0
  105. package/lib/rest/video/v1/room/participant/subscribeRules.js +12 -1
  106. package/lib/rest/video/v1/room/recordingRules.d.ts +1 -0
  107. package/lib/rest/video/v1/room/recordingRules.js +11 -1
  108. package/package.json +4 -4
@@ -0,0 +1,550 @@
1
+ "use strict";
2
+ /*
3
+ * This code was generated by
4
+ * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
5
+ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
6
+ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
7
+ *
8
+ * Sample/reference Twilio API.
9
+ * This is the reference API for the rest-proxy server.
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
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.ReportInstance = exports.ReportContextImpl = exports.VoiceIntegrityCallsPerBundle = exports.VoiceIntegrity = exports.StirShakenPercentage = exports.StirShakenCallCount = exports.StirShakenAnswerRate = exports.StirShaken = exports.ReportMetadata = exports.ReportFilter = exports.InsightsV2OutboundPhoneNumberReportAnsweringMachineDetection = exports.InsightsV2InboundPhoneNumberReportCallStatePercentage = exports.InsightsV2CreateAccountReportRequestTimeRange = exports.InsightsV2CreateAccountReportRequest = exports.CountyCarrierValueCarriers = exports.CountyCarrierValue = exports.BrandedUseCaseDetail = exports.BrandedCalling = exports.AccountReportNetworkIssuesTwilioGateway = exports.AccountReportNetworkIssuesSdk = exports.AccountReportNetworkIssues = exports.AccountReportKYTOutboundCarrierCalling = exports.AccountReportKYT = exports.AccountReportCallType = exports.AccountReportCallState = exports.AccountReportCallDirection = exports.AccountReportAnsweringMachineDetection = exports.AccountReport = void 0;
17
+ exports.ReportListInstance = ReportListInstance;
18
+ const util_1 = require("util");
19
+ const deserialize = require("../../../base/deserialize");
20
+ const serialize = require("../../../base/serialize");
21
+ const utility_1 = require("../../../base/utility");
22
+ class AccountReport {
23
+ constructor(payload) {
24
+ this.callDeliverabilityScore = payload["call_deliverability_score"];
25
+ this.callAnswerScore = payload["call_answer_score"];
26
+ this.totalCalls = payload["total_calls"];
27
+ this.callDirection = payload["call_direction"];
28
+ this.callState = payload["call_state"];
29
+ this.callType = payload["call_type"];
30
+ this.aloc = payload["aloc"];
31
+ this.twilioEdgeLocation = payload["twilio_edge_location"];
32
+ this.callerCountryCode = payload["caller_country_code"];
33
+ this.calleeCountryCode = payload["callee_country_code"];
34
+ this.averageQueueTimeMs = payload["average_queue_time_ms"];
35
+ this.silentCallsPercentage = payload["silent_calls_percentage"];
36
+ this.networkIssues = payload["network_issues"];
37
+ this.kYT = payload["KYT"];
38
+ this.answeringMachineDetection = payload["answering_machine_detection"];
39
+ }
40
+ }
41
+ exports.AccountReport = AccountReport;
42
+ /**
43
+ * Number of calls made in each answering machine detection.
44
+ */
45
+ class AccountReportAnsweringMachineDetection {
46
+ constructor(payload) {
47
+ this.totalCalls = payload["total_calls"];
48
+ this.answeredByHumanPercentage = payload["answered_by_human_percentage"];
49
+ this.answeredByMachinePercentage =
50
+ payload["answered_by_machine_percentage"];
51
+ }
52
+ }
53
+ exports.AccountReportAnsweringMachineDetection = AccountReportAnsweringMachineDetection;
54
+ /**
55
+ * Number of calls made in each direction.
56
+ */
57
+ class AccountReportCallDirection {
58
+ constructor(payload) {
59
+ this.outbound = payload["outbound"];
60
+ this.inbound = payload["inbound"];
61
+ }
62
+ }
63
+ exports.AccountReportCallDirection = AccountReportCallDirection;
64
+ /**
65
+ * Number of calls made in each state.
66
+ */
67
+ class AccountReportCallState {
68
+ constructor(payload) {
69
+ this.completed = payload["completed"];
70
+ this.fail = payload["fail"];
71
+ this.busy = payload["busy"];
72
+ this.noanswer = payload["noanswer"];
73
+ this.canceled = payload["canceled"];
74
+ }
75
+ }
76
+ exports.AccountReportCallState = AccountReportCallState;
77
+ /**
78
+ * Number of calls made in each type. `carrier`, `sip`, `trunking`, `client`, `whatsapp`
79
+ */
80
+ class AccountReportCallType {
81
+ constructor(payload) {
82
+ this.carrier = payload["carrier"];
83
+ this.sip = payload["sip"];
84
+ this.trunking = payload["trunking"];
85
+ this.client = payload["client"];
86
+ this.whatsapp = payload["whatsapp"];
87
+ }
88
+ }
89
+ exports.AccountReportCallType = AccountReportCallType;
90
+ /**
91
+ * Know Your Traffic (KYT) metrics focused on outbound carrier performance and trust signals for the report period.
92
+ */
93
+ class AccountReportKYT {
94
+ constructor(payload) {
95
+ this.outboundCarrierCalling = payload["outbound_carrier_calling"];
96
+ }
97
+ }
98
+ exports.AccountReportKYT = AccountReportKYT;
99
+ /**
100
+ * KYT metrics for outbound carrier calling.
101
+ */
102
+ class AccountReportKYTOutboundCarrierCalling {
103
+ constructor(payload) {
104
+ this.uniqueCallingNumbers = payload["unique_calling_numbers"];
105
+ this.uniqueCalledNumbers = payload["unique_called_numbers"];
106
+ this.blockedCallsByCarrier = payload["blocked_calls_by_carrier"];
107
+ this.shortDurationCallsPercentage =
108
+ payload["short_duration_calls_percentage"];
109
+ this.longDurationCallsPercentage =
110
+ payload["long_duration_calls_percentage"];
111
+ this.potentialRobocallsPercentage =
112
+ payload["potential_robocalls_percentage"];
113
+ this.brandedCalling = payload["branded_calling"];
114
+ this.voiceIntegrity = payload["voice_integrity"];
115
+ this.stirShaken = payload["stir_shaken"];
116
+ }
117
+ }
118
+ exports.AccountReportKYTOutboundCarrierCalling = AccountReportKYTOutboundCarrierCalling;
119
+ /**
120
+ * Network-quality indicators for SDK and Twilio Gateway traffic during the report period.
121
+ */
122
+ class AccountReportNetworkIssues {
123
+ constructor(payload) {
124
+ this.sdk = payload["sdk"];
125
+ this.twilioGateway = payload["twilio_gateway"];
126
+ }
127
+ }
128
+ exports.AccountReportNetworkIssues = AccountReportNetworkIssues;
129
+ /**
130
+ * Network issues of calls for client type. This is indicative of local network issues.
131
+ */
132
+ class AccountReportNetworkIssuesSdk {
133
+ constructor(payload) {
134
+ this.iceFailuresPercentage = payload["ice_failures_percentage"];
135
+ this.highLatencyPercentage = payload["high_latency_percentage"];
136
+ this.highPacketLossPercentage = payload["high_packet_loss_percentage"];
137
+ this.highJitterPercentage = payload["high_jitter_percentage"];
138
+ }
139
+ }
140
+ exports.AccountReportNetworkIssuesSdk = AccountReportNetworkIssuesSdk;
141
+ /**
142
+ * Network related metrics for Twilio Gateway calls only.
143
+ */
144
+ class AccountReportNetworkIssuesTwilioGateway {
145
+ constructor(payload) {
146
+ this.highLatencyPercentage = payload["high_latency_percentage"];
147
+ this.highPacketLossPercentage = payload["high_packet_loss_percentage"];
148
+ this.highJitterPercentage = payload["high_jitter_percentage"];
149
+ }
150
+ }
151
+ exports.AccountReportNetworkIssuesTwilioGateway = AccountReportNetworkIssuesTwilioGateway;
152
+ /**
153
+ * Metrics related to Branded Calling bundled calls including CTIA for the report period.
154
+ */
155
+ class BrandedCalling {
156
+ constructor(payload) {
157
+ this.totalBrandedCalls = payload["total_branded_calls"];
158
+ this.percentBrandedCalls = payload["percent_branded_calls"];
159
+ this.answerRate = payload["answer_rate"];
160
+ this.humanAnswerRate = payload["human_answer_rate"];
161
+ this.engagementRate = payload["engagement_rate"];
162
+ this.byUseCase = payload["by_use_case"];
163
+ }
164
+ }
165
+ exports.BrandedCalling = BrandedCalling;
166
+ /**
167
+ * Associated metrics for Branded calls grouped by each use case.
168
+ */
169
+ class BrandedUseCaseDetail {
170
+ constructor(payload) {
171
+ this.useCase = payload["use_case"];
172
+ this.enabledPhonenumbers = payload["enabled_phonenumbers"];
173
+ this.totalCalls = payload["total_calls"];
174
+ this.answerRate = payload["answer_rate"];
175
+ this.humanAnswerRate = payload["human_answer_rate"];
176
+ this.engagementRate = payload["engagement_rate"];
177
+ }
178
+ }
179
+ exports.BrandedUseCaseDetail = BrandedUseCaseDetail;
180
+ class CountyCarrierValue {
181
+ constructor(payload) {
182
+ this.country = payload["country"];
183
+ this.carriers = payload["carriers"];
184
+ }
185
+ }
186
+ exports.CountyCarrierValue = CountyCarrierValue;
187
+ class CountyCarrierValueCarriers {
188
+ constructor(payload) {
189
+ this.carrier = payload["carrier"];
190
+ this.totalCalls = payload["total_calls"];
191
+ this.blockedCalls = payload["blocked_calls"];
192
+ this.blockedCallsPercentage = payload["blocked_calls_percentage"];
193
+ }
194
+ }
195
+ exports.CountyCarrierValueCarriers = CountyCarrierValueCarriers;
196
+ class InsightsV2CreateAccountReportRequest {
197
+ constructor(payload) {
198
+ this.timeRange = payload["time_range"];
199
+ this.filters = payload["filters"];
200
+ }
201
+ }
202
+ exports.InsightsV2CreateAccountReportRequest = InsightsV2CreateAccountReportRequest;
203
+ /**
204
+ * Optional start and end date time for the report window. Defaults to the most recent 7 days when omitted.
205
+ */
206
+ class InsightsV2CreateAccountReportRequestTimeRange {
207
+ constructor(payload) {
208
+ this.startTime = payload["start_time"];
209
+ this.endTime = payload["end_time"];
210
+ }
211
+ }
212
+ exports.InsightsV2CreateAccountReportRequestTimeRange = InsightsV2CreateAccountReportRequestTimeRange;
213
+ /**
214
+ * Percentage of calls made in each state.
215
+ */
216
+ class InsightsV2InboundPhoneNumberReportCallStatePercentage {
217
+ constructor(payload) {
218
+ this.completed = payload["completed"];
219
+ this.fail = payload["fail"];
220
+ this.busy = payload["busy"];
221
+ this.noanswer = payload["noanswer"];
222
+ this.canceled = payload["canceled"];
223
+ }
224
+ }
225
+ exports.InsightsV2InboundPhoneNumberReportCallStatePercentage = InsightsV2InboundPhoneNumberReportCallStatePercentage;
226
+ /**
227
+ * Number of calls made in answering machine detection (AMD) enabled.
228
+ */
229
+ class InsightsV2OutboundPhoneNumberReportAnsweringMachineDetection {
230
+ constructor(payload) {
231
+ this.totalCalls = payload["total_calls"];
232
+ this.answeredByHumanPercentage = payload["answered_by_human_percentage"];
233
+ this.answeredByMachinePercentage =
234
+ payload["answered_by_machine_percentage"];
235
+ }
236
+ }
237
+ exports.InsightsV2OutboundPhoneNumberReportAnsweringMachineDetection = InsightsV2OutboundPhoneNumberReportAnsweringMachineDetection;
238
+ class ReportFilter {
239
+ constructor(payload) {
240
+ this.key = payload["key"];
241
+ this.values = payload["values"];
242
+ }
243
+ }
244
+ exports.ReportFilter = ReportFilter;
245
+ class ReportMetadata {
246
+ constructor(payload) {
247
+ this.startTime = payload["start_time"];
248
+ this.endTime = payload["end_time"];
249
+ this.filters = payload["filters"];
250
+ }
251
+ }
252
+ exports.ReportMetadata = ReportMetadata;
253
+ /**
254
+ * Metrics related to STIR/SHAKEN attestation A, B, and C for the report period.
255
+ */
256
+ class StirShaken {
257
+ constructor(payload) {
258
+ this.callCount = payload["call_count"];
259
+ this.percentage = payload["percentage"];
260
+ this.answerRate = payload["answer_rate"];
261
+ }
262
+ }
263
+ exports.StirShaken = StirShaken;
264
+ /**
265
+ * Answer rate for each STIR/SHAKEN attestation category.
266
+ */
267
+ class StirShakenAnswerRate {
268
+ constructor(payload) {
269
+ this.stshA = payload["stsh_a"];
270
+ this.stshB = payload["stsh_b"];
271
+ this.stshC = payload["stsh_c"];
272
+ }
273
+ }
274
+ exports.StirShakenAnswerRate = StirShakenAnswerRate;
275
+ /**
276
+ * Total number of calls for each STIR/SHAKEN attestation category.
277
+ */
278
+ class StirShakenCallCount {
279
+ constructor(payload) {
280
+ this.stshA = payload["stsh_a"];
281
+ this.stshB = payload["stsh_b"];
282
+ this.stshC = payload["stsh_c"];
283
+ }
284
+ }
285
+ exports.StirShakenCallCount = StirShakenCallCount;
286
+ /**
287
+ * Percentage of calls for each STIR/SHAKEN attestation category.
288
+ */
289
+ class StirShakenPercentage {
290
+ constructor(payload) {
291
+ this.stshA = payload["stsh_a"];
292
+ this.stshB = payload["stsh_b"];
293
+ this.stshC = payload["stsh_c"];
294
+ }
295
+ }
296
+ exports.StirShakenPercentage = StirShakenPercentage;
297
+ /**
298
+ * Metrics related to Voice Integrity enabled calls for the report period.
299
+ */
300
+ class VoiceIntegrity {
301
+ constructor(payload) {
302
+ this.enabledCalls = payload["enabled_calls"];
303
+ this.enabledPercentage = payload["enabled_percentage"];
304
+ this.callsPerBundle = payload["calls_per_bundle"];
305
+ }
306
+ }
307
+ exports.VoiceIntegrity = VoiceIntegrity;
308
+ class VoiceIntegrityCallsPerBundle {
309
+ constructor(payload) {
310
+ this.bundleSid = payload["bundle_sid"];
311
+ this.enabledPhonenumbers = payload["enabled_phonenumbers"];
312
+ this.totalCalls = payload["total_calls"];
313
+ this.answerRate = payload["answer_rate"];
314
+ this.humanAnswerRate = payload["human_answer_rate"];
315
+ }
316
+ }
317
+ exports.VoiceIntegrityCallsPerBundle = VoiceIntegrityCallsPerBundle;
318
+ class ReportContextImpl {
319
+ constructor(_version, reportId) {
320
+ this._version = _version;
321
+ if (!(0, utility_1.isValidPathParam)(reportId)) {
322
+ throw new Error("Parameter 'reportId' is not valid.");
323
+ }
324
+ this._solution = { reportId };
325
+ this._uri = `/Voice/Reports/${reportId}`;
326
+ }
327
+ create(params, headers, callback) {
328
+ if (params instanceof Function) {
329
+ callback = params;
330
+ params = {};
331
+ }
332
+ else {
333
+ params = params || {};
334
+ }
335
+ let data = {};
336
+ data = params;
337
+ if (headers === null || headers === undefined) {
338
+ headers = {};
339
+ }
340
+ headers["Content-Type"] = "application/json";
341
+ headers["Accept"] = "application/json";
342
+ const instance = this;
343
+ let operationVersion = instance._version, operationPromise = operationVersion.create({
344
+ uri: instance._uri,
345
+ method: "post",
346
+ data,
347
+ headers,
348
+ });
349
+ operationPromise = operationPromise.then((payload) => new ReportInstance(operationVersion, payload, instance._solution.reportId));
350
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
351
+ return operationPromise;
352
+ }
353
+ createWithHttpInfo(params, headers, callback) {
354
+ if (params instanceof Function) {
355
+ callback = params;
356
+ params = {};
357
+ }
358
+ else {
359
+ params = params || {};
360
+ }
361
+ let data = {};
362
+ data = params;
363
+ if (headers === null || headers === undefined) {
364
+ headers = {};
365
+ }
366
+ headers["Content-Type"] = "application/json";
367
+ headers["Accept"] = "application/json";
368
+ const instance = this;
369
+ let operationVersion = instance._version;
370
+ // CREATE, FETCH, UPDATE operations
371
+ let operationPromise = operationVersion
372
+ .createWithResponseInfo({
373
+ uri: instance._uri,
374
+ method: "post",
375
+ data,
376
+ headers,
377
+ })
378
+ .then((response) => ({
379
+ ...response,
380
+ body: new ReportInstance(operationVersion, response.body, instance._solution.reportId),
381
+ }));
382
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
383
+ return operationPromise;
384
+ }
385
+ fetch(callback) {
386
+ const headers = {};
387
+ headers["Accept"] = "application/json";
388
+ const instance = this;
389
+ let operationVersion = instance._version, operationPromise = operationVersion.fetch({
390
+ uri: instance._uri,
391
+ method: "get",
392
+ headers,
393
+ });
394
+ operationPromise = operationPromise.then((payload) => new ReportInstance(operationVersion, payload, instance._solution.reportId));
395
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
396
+ return operationPromise;
397
+ }
398
+ fetchWithHttpInfo(callback) {
399
+ const headers = {};
400
+ headers["Accept"] = "application/json";
401
+ const instance = this;
402
+ let operationVersion = instance._version;
403
+ // CREATE, FETCH, UPDATE operations
404
+ let operationPromise = operationVersion
405
+ .fetchWithResponseInfo({
406
+ uri: instance._uri,
407
+ method: "get",
408
+ headers,
409
+ })
410
+ .then((response) => ({
411
+ ...response,
412
+ body: new ReportInstance(operationVersion, response.body, instance._solution.reportId),
413
+ }));
414
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
415
+ return operationPromise;
416
+ }
417
+ /**
418
+ * Provide a user-friendly representation
419
+ *
420
+ * @returns Object
421
+ */
422
+ toJSON() {
423
+ return this._solution;
424
+ }
425
+ [util_1.inspect.custom](_depth, options) {
426
+ return (0, util_1.inspect)(this.toJSON(), options);
427
+ }
428
+ }
429
+ exports.ReportContextImpl = ReportContextImpl;
430
+ class ReportInstance {
431
+ constructor(_version, payload, reportId) {
432
+ this._version = _version;
433
+ this.accountSid = payload.account_sid;
434
+ this.reportId = payload.report_id;
435
+ this.status = payload.status;
436
+ this.requestMeta =
437
+ payload.request_meta !== null && payload.request_meta !== undefined
438
+ ? new ReportMetadata(payload.request_meta)
439
+ : null;
440
+ this.url = payload.url;
441
+ this.handle = payload.handle;
442
+ this.totalCalls = deserialize.integer(payload.total_calls);
443
+ this.callAnswerScore = payload.call_answer_score;
444
+ this.callStatePercentage =
445
+ payload.call_state_percentage !== null &&
446
+ payload.call_state_percentage !== undefined
447
+ ? new InsightsV2InboundPhoneNumberReportCallStatePercentage(payload.call_state_percentage)
448
+ : null;
449
+ this.silentCallsPercentage = payload.silent_calls_percentage;
450
+ this.callsByDeviceType = payload.calls_by_device_type;
451
+ this.answerRateDeviceType = payload.answer_rate_device_type;
452
+ this.blockedCallsByCarrier =
453
+ payload.blocked_calls_by_carrier !== null &&
454
+ payload.blocked_calls_by_carrier !== undefined
455
+ ? payload.blocked_calls_by_carrier.map((payload) => new CountyCarrierValue(payload))
456
+ : null;
457
+ this.shortDurationCallsPercentage = payload.short_duration_calls_percentage;
458
+ this.longDurationCallsPercentage = payload.long_duration_calls_percentage;
459
+ this.potentialRobocallsPercentage = payload.potential_robocalls_percentage;
460
+ this.answeringMachineDetection =
461
+ payload.answering_machine_detection !== null &&
462
+ payload.answering_machine_detection !== undefined
463
+ ? new InsightsV2OutboundPhoneNumberReportAnsweringMachineDetection(payload.answering_machine_detection)
464
+ : null;
465
+ this.report =
466
+ payload.report !== null && payload.report !== undefined
467
+ ? new AccountReport(payload.report)
468
+ : null;
469
+ this._solution = { reportId: reportId || this.reportId };
470
+ }
471
+ get _proxy() {
472
+ this._context =
473
+ this._context ||
474
+ new ReportContextImpl(this._version, this._solution.reportId);
475
+ return this._context;
476
+ }
477
+ create(params, callback) {
478
+ return this._proxy.create(params, callback);
479
+ }
480
+ createWithHttpInfo(params, callback) {
481
+ return this._proxy.createWithHttpInfo(params, callback);
482
+ }
483
+ /**
484
+ * Fetch a ReportInstance
485
+ *
486
+ * @param callback - Callback to handle processed record
487
+ *
488
+ * @returns Resolves to processed ReportInstance
489
+ */
490
+ fetch(callback) {
491
+ return this._proxy.fetch(callback);
492
+ }
493
+ /**
494
+ * Fetch a ReportInstance and return HTTP info
495
+ *
496
+ * @param callback - Callback to handle processed record
497
+ *
498
+ * @returns Resolves to processed ReportInstance with HTTP metadata
499
+ */
500
+ fetchWithHttpInfo(callback) {
501
+ return this._proxy.fetchWithHttpInfo(callback);
502
+ }
503
+ /**
504
+ * Provide a user-friendly representation
505
+ *
506
+ * @returns Object
507
+ */
508
+ toJSON() {
509
+ return {
510
+ accountSid: this.accountSid,
511
+ reportId: this.reportId,
512
+ status: this.status,
513
+ requestMeta: this.requestMeta,
514
+ url: this.url,
515
+ handle: this.handle,
516
+ totalCalls: this.totalCalls,
517
+ callAnswerScore: this.callAnswerScore,
518
+ callStatePercentage: this.callStatePercentage,
519
+ silentCallsPercentage: this.silentCallsPercentage,
520
+ callsByDeviceType: this.callsByDeviceType,
521
+ answerRateDeviceType: this.answerRateDeviceType,
522
+ blockedCallsByCarrier: this.blockedCallsByCarrier,
523
+ shortDurationCallsPercentage: this.shortDurationCallsPercentage,
524
+ longDurationCallsPercentage: this.longDurationCallsPercentage,
525
+ potentialRobocallsPercentage: this.potentialRobocallsPercentage,
526
+ answeringMachineDetection: this.answeringMachineDetection,
527
+ report: this.report,
528
+ };
529
+ }
530
+ [util_1.inspect.custom](_depth, options) {
531
+ return (0, util_1.inspect)(this.toJSON(), options);
532
+ }
533
+ }
534
+ exports.ReportInstance = ReportInstance;
535
+ function ReportListInstance(version) {
536
+ const instance = ((reportId) => instance.get(reportId));
537
+ instance.get = function get(reportId) {
538
+ return new ReportContextImpl(version, reportId);
539
+ };
540
+ instance._version = version;
541
+ instance._solution = {};
542
+ instance._uri = ``;
543
+ instance.toJSON = function toJSON() {
544
+ return instance._solution;
545
+ };
546
+ instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
547
+ return (0, util_1.inspect)(instance.toJSON(), options);
548
+ };
549
+ return instance;
550
+ }
@@ -21,6 +21,8 @@ export type OperatorTypeProvider = "twilio" | "amazon" | "openai";
21
21
  export interface OperatorTypeListInstanceEachOptions {
22
22
  /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
23
23
  pageSize?: number;
24
+ /** Returns Operator Types that support the provided language code. */
25
+ languageCode?: string;
24
26
  /** Function to process each record. If this and a positional callback are passed, this one will be used */
25
27
  callback?: (item: OperatorTypeInstance, done: (err?: Error) => void) => void;
26
28
  /** Function to be called upon completion of streaming */
@@ -34,6 +36,8 @@ export interface OperatorTypeListInstanceEachOptions {
34
36
  export interface OperatorTypeListInstanceOptions {
35
37
  /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
36
38
  pageSize?: number;
39
+ /** Returns Operator Types that support the provided language code. */
40
+ languageCode?: string;
37
41
  /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */
38
42
  limit?: number;
39
43
  }
@@ -43,6 +47,8 @@ export interface OperatorTypeListInstanceOptions {
43
47
  export interface OperatorTypeListInstancePageOptions {
44
48
  /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
45
49
  pageSize?: number;
50
+ /** Returns Operator Types that support the provided language code. */
51
+ languageCode?: string;
46
52
  /** Page Number, this value is simply for client state */
47
53
  pageNumber?: number;
48
54
  /** PageToken provided by the API */
@@ -169,6 +169,8 @@ function OperatorTypeListInstance(version) {
169
169
  let data = {};
170
170
  if (params["pageSize"] !== undefined)
171
171
  data["PageSize"] = params["pageSize"];
172
+ if (params["languageCode"] !== undefined)
173
+ data["LanguageCode"] = params["languageCode"];
172
174
  if (params.pageNumber !== undefined)
173
175
  data["Page"] = params.pageNumber;
174
176
  if (params.pageToken !== undefined)
@@ -207,6 +209,8 @@ function OperatorTypeListInstance(version) {
207
209
  let data = {};
208
210
  if (params["pageSize"] !== undefined)
209
211
  data["PageSize"] = params["pageSize"];
212
+ if (params["languageCode"] !== undefined)
213
+ data["LanguageCode"] = params["languageCode"];
210
214
  if (params.pageNumber !== undefined)
211
215
  data["Page"] = params.pageNumber;
212
216
  if (params.pageToken !== undefined)
@@ -27,6 +27,7 @@ export declare class KnowledgeV1ServiceCreateKnowledgeRequest {
27
27
  * The embedding model to be used for the knowledge source. It\'s required for \'Database\' type but disallowed for other types.
28
28
  */
29
29
  "embeddingModel"?: string;
30
+ constructor(payload: any);
30
31
  }
31
32
  export declare class KnowledgeV1ServiceCreatePolicyRequest {
32
33
  /**
@@ -46,6 +47,7 @@ export declare class KnowledgeV1ServiceCreatePolicyRequest {
46
47
  * The description of the policy.
47
48
  */
48
49
  "type"?: string;
50
+ constructor(payload: any);
49
51
  }
50
52
  export declare class KnowledgeV1ServiceUpdateKnowledgeRequest {
51
53
  /**
@@ -69,6 +71,7 @@ export declare class KnowledgeV1ServiceUpdateKnowledgeRequest {
69
71
  * The embedding model to be used for the knowledge source. It\'s only applicable to \'Database\' type.
70
72
  */
71
73
  "embeddingModel"?: string;
74
+ constructor(payload: any);
72
75
  }
73
76
  /**
74
77
  * Options to pass to update a KnowledgeInstance
@@ -26,12 +26,35 @@ const utility_1 = require("../../../base/utility");
26
26
  const chunk_1 = require("./knowledge/chunk");
27
27
  const knowledgeStatus_1 = require("./knowledge/knowledgeStatus");
28
28
  class KnowledgeV1ServiceCreateKnowledgeRequest {
29
+ constructor(payload) {
30
+ this.description = payload["description"];
31
+ this.knowledgeSourceDetails = payload["knowledge_source_details"];
32
+ this.name = payload["name"];
33
+ this.policy = payload["policy"];
34
+ this.type = payload["type"];
35
+ this.embeddingModel = payload["embedding_model"];
36
+ }
29
37
  }
30
38
  exports.KnowledgeV1ServiceCreateKnowledgeRequest = KnowledgeV1ServiceCreateKnowledgeRequest;
31
39
  class KnowledgeV1ServiceCreatePolicyRequest {
40
+ constructor(payload) {
41
+ this.description = payload["description"];
42
+ this.id = payload["id"];
43
+ this.name = payload["name"];
44
+ this.policyDetails = payload["policy_details"];
45
+ this.type = payload["type"];
46
+ }
32
47
  }
33
48
  exports.KnowledgeV1ServiceCreatePolicyRequest = KnowledgeV1ServiceCreatePolicyRequest;
34
49
  class KnowledgeV1ServiceUpdateKnowledgeRequest {
50
+ constructor(payload) {
51
+ this.description = payload["description"];
52
+ this.knowledgeSourceDetails = payload["knowledge_source_details"];
53
+ this.name = payload["name"];
54
+ this.policy = payload["policy"];
55
+ this.type = payload["type"];
56
+ this.embeddingModel = payload["embedding_model"];
57
+ }
35
58
  }
36
59
  exports.KnowledgeV1ServiceUpdateKnowledgeRequest = KnowledgeV1ServiceUpdateKnowledgeRequest;
37
60
  class KnowledgeContextImpl {
@@ -13,6 +13,7 @@ export declare class RateLimitRequest {
13
13
  * Time to live of the rule
14
14
  */
15
15
  "ttl"?: number;
16
+ constructor(payload: any);
16
17
  }
17
18
  /**
18
19
  * Options to pass to update a BucketInstance
@@ -23,6 +23,10 @@ const utility_1 = require("../../../base/utility");
23
23
  * Rate limit request schema
24
24
  */
25
25
  class RateLimitRequest {
26
+ constructor(payload) {
27
+ this.limit = payload["limit"];
28
+ this.ttl = payload["ttl"];
29
+ }
26
30
  }
27
31
  exports.RateLimitRequest = RateLimitRequest;
28
32
  class BucketContextImpl {
@@ -10,6 +10,7 @@ export declare class OverridesRequest {
10
10
  * The reason for the override
11
11
  */
12
12
  "reason"?: string;
13
+ constructor(payload: any);
13
14
  }
14
15
  /**
15
16
  * Options to pass to create a LookupOverrideInstance