bandwidth-sdk 4.0.0 → 4.1.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 (189) hide show
  1. package/.github/CODEOWNERS +1 -1
  2. package/.github/workflows/deploy.yml +8 -2
  3. package/.github/workflows/test-pr.yml +2 -2
  4. package/.github/workflows/test-smoke.yml +39 -10
  5. package/.openapi-generator/FILES +25 -0
  6. package/README.md +3 -4
  7. package/api/toll-free-verification-api.ts +715 -0
  8. package/api.ts +1 -0
  9. package/bandwidth.yml +1113 -0
  10. package/base.ts +48 -0
  11. package/configuration.ts +1 -1
  12. package/coverage/clover.xml +674 -438
  13. package/coverage/coverage-final.json +70 -66
  14. package/coverage/lcov-report/index.html +26 -26
  15. package/coverage/lcov-report/node-sdk/api/calls-api.ts.html +14 -14
  16. package/coverage/lcov-report/node-sdk/api/conferences-api.ts.html +18 -18
  17. package/coverage/lcov-report/node-sdk/api/index.html +24 -9
  18. package/coverage/lcov-report/node-sdk/api/media-api.ts.html +13 -13
  19. package/coverage/lcov-report/node-sdk/api/messages-api.ts.html +11 -11
  20. package/coverage/lcov-report/node-sdk/api/mfaapi.ts.html +12 -12
  21. package/coverage/lcov-report/node-sdk/api/phone-number-lookup-api.ts.html +11 -11
  22. package/coverage/lcov-report/node-sdk/api/recordings-api.ts.html +19 -19
  23. package/coverage/lcov-report/node-sdk/api/statistics-api.ts.html +10 -10
  24. package/coverage/lcov-report/node-sdk/api/toll-free-verification-api.ts.html +2230 -0
  25. package/coverage/lcov-report/node-sdk/api/transcriptions-api.ts.html +12 -12
  26. package/coverage/lcov-report/node-sdk/api.ts.html +16 -13
  27. package/coverage/lcov-report/node-sdk/base.ts.html +158 -14
  28. package/coverage/lcov-report/node-sdk/common.ts.html +32 -32
  29. package/coverage/lcov-report/node-sdk/configuration.ts.html +16 -16
  30. package/coverage/lcov-report/node-sdk/index.html +7 -7
  31. package/coverage/lcov-report/node-sdk/models/bxml/Bxml.ts.html +4 -4
  32. package/coverage/lcov-report/node-sdk/models/bxml/NestableVerb.ts.html +6 -6
  33. package/coverage/lcov-report/node-sdk/models/bxml/Response.ts.html +4 -4
  34. package/coverage/lcov-report/node-sdk/models/bxml/Root.ts.html +8 -8
  35. package/coverage/lcov-report/node-sdk/models/bxml/Verb.ts.html +6 -6
  36. package/coverage/lcov-report/node-sdk/models/bxml/index.html +1 -1
  37. package/coverage/lcov-report/node-sdk/models/bxml/index.ts.html +3 -3
  38. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Bridge.ts.html +4 -4
  39. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Conference.ts.html +4 -4
  40. package/coverage/lcov-report/node-sdk/models/bxml/verbs/CustomParam.ts.html +4 -4
  41. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Forward.ts.html +4 -4
  42. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Gather.ts.html +7 -7
  43. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Hangup.ts.html +4 -4
  44. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Pause.ts.html +4 -4
  45. package/coverage/lcov-report/node-sdk/models/bxml/verbs/PauseRecording.ts.html +4 -4
  46. package/coverage/lcov-report/node-sdk/models/bxml/verbs/PhoneNumber.ts.html +4 -4
  47. package/coverage/lcov-report/node-sdk/models/bxml/verbs/PlayAudio.ts.html +4 -4
  48. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Record.ts.html +4 -4
  49. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Redirect.ts.html +4 -4
  50. package/coverage/lcov-report/node-sdk/models/bxml/verbs/ResumeRecording.ts.html +4 -4
  51. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Ring.ts.html +4 -4
  52. package/coverage/lcov-report/node-sdk/models/bxml/verbs/SendDtmf.ts.html +4 -4
  53. package/coverage/lcov-report/node-sdk/models/bxml/verbs/SipUri.ts.html +4 -4
  54. package/coverage/lcov-report/node-sdk/models/bxml/verbs/SpeakSentence.ts.html +6 -6
  55. package/coverage/lcov-report/node-sdk/models/bxml/verbs/StartGather.ts.html +4 -4
  56. package/coverage/lcov-report/node-sdk/models/bxml/verbs/StartRecording.ts.html +4 -4
  57. package/coverage/lcov-report/node-sdk/models/bxml/verbs/StartStream.ts.html +5 -5
  58. package/coverage/lcov-report/node-sdk/models/bxml/verbs/StartTranscription.ts.html +5 -5
  59. package/coverage/lcov-report/node-sdk/models/bxml/verbs/StopGather.ts.html +4 -4
  60. package/coverage/lcov-report/node-sdk/models/bxml/verbs/StopRecording.ts.html +4 -4
  61. package/coverage/lcov-report/node-sdk/models/bxml/verbs/StopStream.ts.html +4 -4
  62. package/coverage/lcov-report/node-sdk/models/bxml/verbs/StopTranscription.ts.html +4 -4
  63. package/coverage/lcov-report/node-sdk/models/bxml/verbs/StreamParam.ts.html +4 -4
  64. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Tag.ts.html +4 -4
  65. package/coverage/lcov-report/node-sdk/models/bxml/verbs/Transfer.ts.html +5 -5
  66. package/coverage/lcov-report/node-sdk/models/bxml/verbs/index.html +1 -1
  67. package/coverage/lcov-report/node-sdk/models/bxml/verbs/index.ts.html +31 -31
  68. package/coverage/lcov-report/node-sdk/models/call-direction-enum.ts.html +2 -2
  69. package/coverage/lcov-report/node-sdk/models/call-state-enum.ts.html +2 -2
  70. package/coverage/lcov-report/node-sdk/models/call-transcription-detected-language-enum.ts.html +2 -2
  71. package/coverage/lcov-report/node-sdk/models/call-transcription-track-enum.ts.html +2 -2
  72. package/coverage/lcov-report/node-sdk/models/callback-method-enum.ts.html +2 -2
  73. package/coverage/lcov-report/node-sdk/models/callback-type-enum.ts.html +2 -2
  74. package/coverage/lcov-report/node-sdk/models/conference-state-enum.ts.html +2 -2
  75. package/coverage/lcov-report/node-sdk/models/file-format-enum.ts.html +2 -2
  76. package/coverage/lcov-report/node-sdk/models/index.html +50 -5
  77. package/coverage/lcov-report/node-sdk/models/index.ts.html +164 -92
  78. package/coverage/lcov-report/node-sdk/models/list-message-direction-enum.ts.html +2 -2
  79. package/coverage/lcov-report/node-sdk/models/lookup-status-enum.ts.html +2 -2
  80. package/coverage/lcov-report/node-sdk/models/machine-detection-mode-enum.ts.html +2 -2
  81. package/coverage/lcov-report/node-sdk/models/message-direction-enum.ts.html +2 -2
  82. package/coverage/lcov-report/node-sdk/models/message-status-enum.ts.html +2 -2
  83. package/coverage/lcov-report/node-sdk/models/message-type-enum.ts.html +2 -2
  84. package/coverage/lcov-report/node-sdk/models/priority-enum.ts.html +2 -2
  85. package/coverage/lcov-report/node-sdk/models/recording-state-enum.ts.html +2 -2
  86. package/coverage/lcov-report/node-sdk/models/redirect-method-enum.ts.html +2 -2
  87. package/coverage/lcov-report/node-sdk/models/tfv-callback-status-enum.ts.html +178 -0
  88. package/coverage/lcov-report/node-sdk/models/tfv-status-enum.ts.html +187 -0
  89. package/coverage/lcov-report/node-sdk/models/webhook-subscription-type-enum.ts.html +178 -0
  90. package/coverage/lcov.info +1106 -526
  91. package/custom_templates/README.mustache +3 -4
  92. package/dist/api/toll-free-verification-api.d.ts +338 -0
  93. package/dist/api/toll-free-verification-api.js +870 -0
  94. package/dist/api.d.ts +1 -0
  95. package/dist/api.js +1 -0
  96. package/dist/base.js +48 -0
  97. package/dist/common.d.ts +1 -1
  98. package/dist/configuration.js +1 -1
  99. package/dist/models/additional-denial-reason.d.ts +36 -0
  100. package/dist/models/additional-denial-reason.js +15 -0
  101. package/dist/models/address.d.ts +60 -0
  102. package/dist/models/address.js +15 -0
  103. package/dist/models/contact.d.ts +42 -0
  104. package/dist/models/contact.js +15 -0
  105. package/dist/models/failure-webhook.d.ts +54 -0
  106. package/dist/models/failure-webhook.js +15 -0
  107. package/dist/models/index.d.ts +24 -0
  108. package/dist/models/index.js +24 -0
  109. package/dist/models/initiate-callback.d.ts +6 -0
  110. package/dist/models/links-object.d.ts +42 -0
  111. package/dist/models/links-object.js +15 -0
  112. package/dist/models/model-error.d.ts +37 -0
  113. package/dist/models/model-error.js +15 -0
  114. package/dist/models/opt-in-workflow.d.ts +30 -0
  115. package/dist/models/opt-in-workflow.js +15 -0
  116. package/dist/models/telephone-number.d.ts +24 -0
  117. package/dist/models/telephone-number.js +15 -0
  118. package/dist/models/tfv-basic-authentication.d.ts +30 -0
  119. package/dist/models/tfv-basic-authentication.js +15 -0
  120. package/dist/models/tfv-callback-status-enum.d.ts +21 -0
  121. package/dist/models/tfv-callback-status-enum.js +25 -0
  122. package/dist/models/tfv-error.d.ts +36 -0
  123. package/dist/models/tfv-error.js +15 -0
  124. package/dist/models/tfv-status-enum.d.ts +24 -0
  125. package/dist/models/tfv-status-enum.js +28 -0
  126. package/dist/models/tfv-status.d.ts +68 -0
  127. package/dist/models/tfv-status.js +15 -0
  128. package/dist/models/tfv-submission-info.d.ts +75 -0
  129. package/dist/models/tfv-submission-info.js +15 -0
  130. package/dist/models/tfv-submission-wrapper.d.ts +25 -0
  131. package/dist/models/tfv-submission-wrapper.js +15 -0
  132. package/dist/models/verification-denial-webhook.d.ts +67 -0
  133. package/dist/models/verification-denial-webhook.js +15 -0
  134. package/dist/models/verification-request.d.ts +81 -0
  135. package/dist/models/verification-request.js +15 -0
  136. package/dist/models/verification-update-request.d.ts +75 -0
  137. package/dist/models/verification-update-request.js +15 -0
  138. package/dist/models/verification-webhook.d.ts +43 -0
  139. package/dist/models/verification-webhook.js +15 -0
  140. package/dist/models/webhook-subscription-basic-authentication.d.ts +30 -0
  141. package/dist/models/webhook-subscription-basic-authentication.js +15 -0
  142. package/dist/models/webhook-subscription-request-schema.d.ts +37 -0
  143. package/dist/models/webhook-subscription-request-schema.js +15 -0
  144. package/dist/models/webhook-subscription-type-enum.d.ts +21 -0
  145. package/dist/models/webhook-subscription-type-enum.js +25 -0
  146. package/dist/models/webhook-subscription.d.ts +62 -0
  147. package/dist/models/webhook-subscription.js +15 -0
  148. package/dist/models/webhook-subscriptions-list-body.d.ts +39 -0
  149. package/dist/models/webhook-subscriptions-list-body.js +15 -0
  150. package/models/additional-denial-reason.ts +42 -0
  151. package/models/address.ts +66 -0
  152. package/models/contact.ts +48 -0
  153. package/models/failure-webhook.ts +60 -0
  154. package/models/index.ts +24 -0
  155. package/models/initiate-callback.ts +6 -0
  156. package/models/links-object.ts +48 -0
  157. package/models/model-error.ts +45 -0
  158. package/models/opt-in-workflow.ts +36 -0
  159. package/models/telephone-number.ts +30 -0
  160. package/models/tfv-basic-authentication.ts +36 -0
  161. package/models/tfv-callback-status-enum.ts +31 -0
  162. package/models/tfv-error.ts +42 -0
  163. package/models/tfv-status-enum.ts +34 -0
  164. package/models/tfv-status.ts +80 -0
  165. package/models/tfv-submission-info.ts +87 -0
  166. package/models/tfv-submission-wrapper.ts +33 -0
  167. package/models/verification-denial-webhook.ts +75 -0
  168. package/models/verification-request.ts +93 -0
  169. package/models/verification-update-request.ts +87 -0
  170. package/models/verification-webhook.ts +53 -0
  171. package/models/webhook-subscription-basic-authentication.ts +36 -0
  172. package/models/webhook-subscription-request-schema.ts +45 -0
  173. package/models/webhook-subscription-type-enum.ts +31 -0
  174. package/models/webhook-subscription.ts +74 -0
  175. package/models/webhook-subscriptions-list-body.ts +51 -0
  176. package/openapi-config.yml +0 -1
  177. package/package.json +1 -1
  178. package/tests/callUtils.ts +0 -8
  179. package/tests/smoke/phone-number-lookup-api.test.ts +2 -12
  180. package/tests/smoke/toll-free-verification-api.test.ts +18 -0
  181. package/tests/unit/api/calls-api.test.ts +5 -5
  182. package/tests/unit/api/conferences-api.test.ts +4 -4
  183. package/tests/unit/api/messages-api.test.ts +5 -14
  184. package/tests/unit/api/phone-number-lookup-api.test.ts +2 -12
  185. package/tests/unit/api/recordings-api.test.ts +6 -6
  186. package/tests/unit/api/toll-free-verification-api.test.ts +159 -0
  187. package/tests/unit/models/tfv-callback-status-enum.test.ts +8 -0
  188. package/tests/unit/models/tfv-status-enum.test.ts +11 -0
  189. package/tests/unit/models/webhook-subscription-type-enum.test.ts +8 -0
@@ -0,0 +1,870 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Bandwidth
6
+ * Bandwidth\'s Communication APIs
7
+ *
8
+ * The version of the OpenAPI document: 1.0.0
9
+ * Contact: letstalk@bandwidth.com
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ var __extends = (this && this.__extends) || (function () {
16
+ var extendStatics = function (d, b) {
17
+ extendStatics = Object.setPrototypeOf ||
18
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
19
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
20
+ return extendStatics(d, b);
21
+ };
22
+ return function (d, b) {
23
+ if (typeof b !== "function" && b !== null)
24
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
25
+ extendStatics(d, b);
26
+ function __() { this.constructor = d; }
27
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
28
+ };
29
+ })();
30
+ var __assign = (this && this.__assign) || function () {
31
+ __assign = Object.assign || function(t) {
32
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
33
+ s = arguments[i];
34
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
35
+ t[p] = s[p];
36
+ }
37
+ return t;
38
+ };
39
+ return __assign.apply(this, arguments);
40
+ };
41
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
42
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
43
+ return new (P || (P = Promise))(function (resolve, reject) {
44
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
45
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
46
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
47
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
48
+ });
49
+ };
50
+ var __generator = (this && this.__generator) || function (thisArg, body) {
51
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
52
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
53
+ function verb(n) { return function (v) { return step([n, v]); }; }
54
+ function step(op) {
55
+ if (f) throw new TypeError("Generator is already executing.");
56
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
57
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
58
+ if (y = 0, t) op = [op[0] & 2, t.value];
59
+ switch (op[0]) {
60
+ case 0: case 1: t = op; break;
61
+ case 4: _.label++; return { value: op[1], done: false };
62
+ case 5: _.label++; y = op[1]; op = [0]; continue;
63
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
64
+ default:
65
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
66
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
67
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
68
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
69
+ if (t[2]) _.ops.pop();
70
+ _.trys.pop(); continue;
71
+ }
72
+ op = body.call(thisArg, _);
73
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
74
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
75
+ }
76
+ };
77
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
78
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
79
+ if (ar || !(i in from)) {
80
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
81
+ ar[i] = from[i];
82
+ }
83
+ }
84
+ return to.concat(ar || Array.prototype.slice.call(from));
85
+ };
86
+ Object.defineProperty(exports, "__esModule", { value: true });
87
+ exports.TollFreeVerificationApi = exports.TollFreeVerificationApiFactory = exports.TollFreeVerificationApiFp = exports.TollFreeVerificationApiAxiosParamCreator = void 0;
88
+ var axios_1 = require("axios");
89
+ // Some imports not used depending on template conditions
90
+ // @ts-ignore
91
+ var common_1 = require("../common");
92
+ // @ts-ignore
93
+ var base_1 = require("../base");
94
+ /**
95
+ * TollFreeVerificationApi - axios parameter creator
96
+ * @export
97
+ */
98
+ var TollFreeVerificationApiAxiosParamCreator = function (configuration) {
99
+ var _this = this;
100
+ return {
101
+ /**
102
+ * Create a new webhook subscription (this webhook will be called for every update on every submission). In addition to a `callbackUrl`, this subscription can provide optional HTTP basic authentication credentials (a username and a password). The returned subscription object will contain an ID that can be used to modify or delete the subscription at a later time.
103
+ * @summary Create Webhook Subscription
104
+ * @param {string} accountId Your Bandwidth Account ID.
105
+ * @param {WebhookSubscriptionRequestSchema} webhookSubscriptionRequestSchema Information about a webhook that Bandwidth should send upon the completion of event customer is trying to subscribe to.
106
+ * @param {*} [options] Override http request option.
107
+ * @throws {RequiredError}
108
+ */
109
+ createWebhookSubscription: function (accountId_1, webhookSubscriptionRequestSchema_1) {
110
+ var args_1 = [];
111
+ for (var _i = 2; _i < arguments.length; _i++) {
112
+ args_1[_i - 2] = arguments[_i];
113
+ }
114
+ return __awaiter(_this, __spreadArray([accountId_1, webhookSubscriptionRequestSchema_1], args_1, true), void 0, function (accountId, webhookSubscriptionRequestSchema, options) {
115
+ var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
116
+ if (options === void 0) { options = {}; }
117
+ return __generator(this, function (_a) {
118
+ // verify required parameter 'accountId' is not null or undefined
119
+ (0, common_1.assertParamExists)('createWebhookSubscription', 'accountId', accountId);
120
+ // verify required parameter 'webhookSubscriptionRequestSchema' is not null or undefined
121
+ (0, common_1.assertParamExists)('createWebhookSubscription', 'webhookSubscriptionRequestSchema', webhookSubscriptionRequestSchema);
122
+ localVarPath = "/accounts/{accountId}/tollFreeVerification/webhooks/subscriptions"
123
+ .replace("{".concat("accountId", "}"), encodeURIComponent(String(accountId)));
124
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
125
+ if (configuration) {
126
+ baseOptions = configuration.baseOptions;
127
+ }
128
+ localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
129
+ localVarHeaderParameter = {};
130
+ localVarQueryParameter = {};
131
+ // authentication Basic required
132
+ // http basic authentication required
133
+ (0, common_1.setBasicAuthToObject)(localVarRequestOptions, configuration);
134
+ localVarHeaderParameter['Content-Type'] = 'application/json';
135
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
136
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
137
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
138
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(webhookSubscriptionRequestSchema, localVarRequestOptions, configuration);
139
+ return [2 /*return*/, {
140
+ url: (0, common_1.toPathString)(localVarUrlObj),
141
+ options: localVarRequestOptions,
142
+ }];
143
+ });
144
+ });
145
+ },
146
+ /**
147
+ * Delete a webhook subscription by ID.
148
+ * @summary Delete Webhook Subscription
149
+ * @param {string} accountId Your Bandwidth Account ID.
150
+ * @param {string} id Webhook subscription ID
151
+ * @param {*} [options] Override http request option.
152
+ * @throws {RequiredError}
153
+ */
154
+ deleteWebhookSubscription: function (accountId_1, id_1) {
155
+ var args_1 = [];
156
+ for (var _i = 2; _i < arguments.length; _i++) {
157
+ args_1[_i - 2] = arguments[_i];
158
+ }
159
+ return __awaiter(_this, __spreadArray([accountId_1, id_1], args_1, true), void 0, function (accountId, id, options) {
160
+ var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
161
+ if (options === void 0) { options = {}; }
162
+ return __generator(this, function (_a) {
163
+ // verify required parameter 'accountId' is not null or undefined
164
+ (0, common_1.assertParamExists)('deleteWebhookSubscription', 'accountId', accountId);
165
+ // verify required parameter 'id' is not null or undefined
166
+ (0, common_1.assertParamExists)('deleteWebhookSubscription', 'id', id);
167
+ localVarPath = "/accounts/{accountId}/tollFreeVerification/webhooks/subscriptions/{id}"
168
+ .replace("{".concat("accountId", "}"), encodeURIComponent(String(accountId)))
169
+ .replace("{".concat("id", "}"), encodeURIComponent(String(id)));
170
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
171
+ if (configuration) {
172
+ baseOptions = configuration.baseOptions;
173
+ }
174
+ localVarRequestOptions = __assign(__assign({ method: 'DELETE' }, baseOptions), options);
175
+ localVarHeaderParameter = {};
176
+ localVarQueryParameter = {};
177
+ // authentication Basic required
178
+ // http basic authentication required
179
+ (0, common_1.setBasicAuthToObject)(localVarRequestOptions, configuration);
180
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
181
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
182
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
183
+ return [2 /*return*/, {
184
+ url: (0, common_1.toPathString)(localVarUrlObj),
185
+ options: localVarRequestOptions,
186
+ }];
187
+ });
188
+ });
189
+ },
190
+ /**
191
+ * Gets the verification status for a phone number that is provisioned to your account. Submission information will be appended to the response if it is available.
192
+ * @summary Get Toll-Free Verification Status
193
+ * @param {string} accountId Your Bandwidth Account ID.
194
+ * @param {string} phoneNumber Valid Toll-Free telephone number in E.164 format.
195
+ * @param {*} [options] Override http request option.
196
+ * @throws {RequiredError}
197
+ */
198
+ getTollFreeVerificationStatus: function (accountId_1, phoneNumber_1) {
199
+ var args_1 = [];
200
+ for (var _i = 2; _i < arguments.length; _i++) {
201
+ args_1[_i - 2] = arguments[_i];
202
+ }
203
+ return __awaiter(_this, __spreadArray([accountId_1, phoneNumber_1], args_1, true), void 0, function (accountId, phoneNumber, options) {
204
+ var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
205
+ if (options === void 0) { options = {}; }
206
+ return __generator(this, function (_a) {
207
+ // verify required parameter 'accountId' is not null or undefined
208
+ (0, common_1.assertParamExists)('getTollFreeVerificationStatus', 'accountId', accountId);
209
+ // verify required parameter 'phoneNumber' is not null or undefined
210
+ (0, common_1.assertParamExists)('getTollFreeVerificationStatus', 'phoneNumber', phoneNumber);
211
+ localVarPath = "/accounts/{accountId}/phoneNumbers/{phoneNumber}/tollFreeVerification"
212
+ .replace("{".concat("accountId", "}"), encodeURIComponent(String(accountId)))
213
+ .replace("{".concat("phoneNumber", "}"), encodeURIComponent(String(phoneNumber)));
214
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
215
+ if (configuration) {
216
+ baseOptions = configuration.baseOptions;
217
+ }
218
+ localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
219
+ localVarHeaderParameter = {};
220
+ localVarQueryParameter = {};
221
+ // authentication Basic required
222
+ // http basic authentication required
223
+ (0, common_1.setBasicAuthToObject)(localVarRequestOptions, configuration);
224
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
225
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
226
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
227
+ return [2 /*return*/, {
228
+ url: (0, common_1.toPathString)(localVarUrlObj),
229
+ options: localVarRequestOptions,
230
+ }];
231
+ });
232
+ });
233
+ },
234
+ /**
235
+ * Lists valid toll-free use cases.
236
+ * @summary List Toll-Free Use Cases
237
+ * @param {*} [options] Override http request option.
238
+ * @throws {RequiredError}
239
+ */
240
+ listTollFreeUseCases: function () {
241
+ var args_1 = [];
242
+ for (var _i = 0; _i < arguments.length; _i++) {
243
+ args_1[_i] = arguments[_i];
244
+ }
245
+ return __awaiter(_this, __spreadArray([], args_1, true), void 0, function (options) {
246
+ var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
247
+ if (options === void 0) { options = {}; }
248
+ return __generator(this, function (_a) {
249
+ localVarPath = "/tollFreeVerification/useCases";
250
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
251
+ if (configuration) {
252
+ baseOptions = configuration.baseOptions;
253
+ }
254
+ localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
255
+ localVarHeaderParameter = {};
256
+ localVarQueryParameter = {};
257
+ // authentication Basic required
258
+ // http basic authentication required
259
+ (0, common_1.setBasicAuthToObject)(localVarRequestOptions, configuration);
260
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
261
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
262
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
263
+ return [2 /*return*/, {
264
+ url: (0, common_1.toPathString)(localVarUrlObj),
265
+ options: localVarRequestOptions,
266
+ }];
267
+ });
268
+ });
269
+ },
270
+ /**
271
+ * Lists all webhook subscriptions that are registered to receive status updates for the toll-free verification requests submitted under this account (password will not be returned through this API If `basicAuthentication` is defined, the `password` property of that object will be null).
272
+ * @summary List Webhook Subscriptions
273
+ * @param {string} accountId Your Bandwidth Account ID.
274
+ * @param {*} [options] Override http request option.
275
+ * @throws {RequiredError}
276
+ */
277
+ listWebhookSubscriptions: function (accountId_1) {
278
+ var args_1 = [];
279
+ for (var _i = 1; _i < arguments.length; _i++) {
280
+ args_1[_i - 1] = arguments[_i];
281
+ }
282
+ return __awaiter(_this, __spreadArray([accountId_1], args_1, true), void 0, function (accountId, options) {
283
+ var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
284
+ if (options === void 0) { options = {}; }
285
+ return __generator(this, function (_a) {
286
+ // verify required parameter 'accountId' is not null or undefined
287
+ (0, common_1.assertParamExists)('listWebhookSubscriptions', 'accountId', accountId);
288
+ localVarPath = "/accounts/{accountId}/tollFreeVerification/webhooks/subscriptions"
289
+ .replace("{".concat("accountId", "}"), encodeURIComponent(String(accountId)));
290
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
291
+ if (configuration) {
292
+ baseOptions = configuration.baseOptions;
293
+ }
294
+ localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
295
+ localVarHeaderParameter = {};
296
+ localVarQueryParameter = {};
297
+ // authentication Basic required
298
+ // http basic authentication required
299
+ (0, common_1.setBasicAuthToObject)(localVarRequestOptions, configuration);
300
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
301
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
302
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
303
+ return [2 /*return*/, {
304
+ url: (0, common_1.toPathString)(localVarUrlObj),
305
+ options: localVarRequestOptions,
306
+ }];
307
+ });
308
+ });
309
+ },
310
+ /**
311
+ * Submit a request for verification of a toll-free phone number.
312
+ * @summary Request Toll-Free Verification
313
+ * @param {string} accountId Your Bandwidth Account ID.
314
+ * @param {VerificationRequest} verificationRequest Request for verification of a toll-free phone number.
315
+ * @param {*} [options] Override http request option.
316
+ * @throws {RequiredError}
317
+ */
318
+ requestTollFreeVerification: function (accountId_1, verificationRequest_1) {
319
+ var args_1 = [];
320
+ for (var _i = 2; _i < arguments.length; _i++) {
321
+ args_1[_i - 2] = arguments[_i];
322
+ }
323
+ return __awaiter(_this, __spreadArray([accountId_1, verificationRequest_1], args_1, true), void 0, function (accountId, verificationRequest, options) {
324
+ var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
325
+ if (options === void 0) { options = {}; }
326
+ return __generator(this, function (_a) {
327
+ // verify required parameter 'accountId' is not null or undefined
328
+ (0, common_1.assertParamExists)('requestTollFreeVerification', 'accountId', accountId);
329
+ // verify required parameter 'verificationRequest' is not null or undefined
330
+ (0, common_1.assertParamExists)('requestTollFreeVerification', 'verificationRequest', verificationRequest);
331
+ localVarPath = "/accounts/{accountId}/tollFreeVerification"
332
+ .replace("{".concat("accountId", "}"), encodeURIComponent(String(accountId)));
333
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
334
+ if (configuration) {
335
+ baseOptions = configuration.baseOptions;
336
+ }
337
+ localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
338
+ localVarHeaderParameter = {};
339
+ localVarQueryParameter = {};
340
+ // authentication Basic required
341
+ // http basic authentication required
342
+ (0, common_1.setBasicAuthToObject)(localVarRequestOptions, configuration);
343
+ localVarHeaderParameter['Content-Type'] = 'application/json';
344
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
345
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
346
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
347
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(verificationRequest, localVarRequestOptions, configuration);
348
+ return [2 /*return*/, {
349
+ url: (0, common_1.toPathString)(localVarUrlObj),
350
+ options: localVarRequestOptions,
351
+ }];
352
+ });
353
+ });
354
+ },
355
+ /**
356
+ * Updates a toll-free verification request. Submissions are only eligible for resubmission for 7 days within being processed and if resubmission is allowed (resubmitAllowed field is true).
357
+ * @summary Update Toll-Free Verification Request
358
+ * @param {string} accountId Your Bandwidth Account ID.
359
+ * @param {string} phoneNumber Valid Toll-Free telephone number in E.164 format.
360
+ * @param {TfvSubmissionWrapper} tfvSubmissionWrapper Update a request for verification of a toll-free phone number.
361
+ * @param {*} [options] Override http request option.
362
+ * @throws {RequiredError}
363
+ */
364
+ updateTollFreeVerificationRequest: function (accountId_1, phoneNumber_1, tfvSubmissionWrapper_1) {
365
+ var args_1 = [];
366
+ for (var _i = 3; _i < arguments.length; _i++) {
367
+ args_1[_i - 3] = arguments[_i];
368
+ }
369
+ return __awaiter(_this, __spreadArray([accountId_1, phoneNumber_1, tfvSubmissionWrapper_1], args_1, true), void 0, function (accountId, phoneNumber, tfvSubmissionWrapper, options) {
370
+ var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
371
+ if (options === void 0) { options = {}; }
372
+ return __generator(this, function (_a) {
373
+ // verify required parameter 'accountId' is not null or undefined
374
+ (0, common_1.assertParamExists)('updateTollFreeVerificationRequest', 'accountId', accountId);
375
+ // verify required parameter 'phoneNumber' is not null or undefined
376
+ (0, common_1.assertParamExists)('updateTollFreeVerificationRequest', 'phoneNumber', phoneNumber);
377
+ // verify required parameter 'tfvSubmissionWrapper' is not null or undefined
378
+ (0, common_1.assertParamExists)('updateTollFreeVerificationRequest', 'tfvSubmissionWrapper', tfvSubmissionWrapper);
379
+ localVarPath = "/accounts/{accountId}/phoneNumbers/{phoneNumber}/tollFreeVerification"
380
+ .replace("{".concat("accountId", "}"), encodeURIComponent(String(accountId)))
381
+ .replace("{".concat("phoneNumber", "}"), encodeURIComponent(String(phoneNumber)));
382
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
383
+ if (configuration) {
384
+ baseOptions = configuration.baseOptions;
385
+ }
386
+ localVarRequestOptions = __assign(__assign({ method: 'PUT' }, baseOptions), options);
387
+ localVarHeaderParameter = {};
388
+ localVarQueryParameter = {};
389
+ // authentication Basic required
390
+ // http basic authentication required
391
+ (0, common_1.setBasicAuthToObject)(localVarRequestOptions, configuration);
392
+ localVarHeaderParameter['Content-Type'] = 'application/json';
393
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
394
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
395
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
396
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(tfvSubmissionWrapper, localVarRequestOptions, configuration);
397
+ return [2 /*return*/, {
398
+ url: (0, common_1.toPathString)(localVarUrlObj),
399
+ options: localVarRequestOptions,
400
+ }];
401
+ });
402
+ });
403
+ },
404
+ /**
405
+ * Update an existing webhook subscription (`callbackUrl` and `basicAuthentication` can be updated).
406
+ * @summary Update Webhook Subscription
407
+ * @param {string} accountId Your Bandwidth Account ID.
408
+ * @param {string} id Webhook subscription ID
409
+ * @param {WebhookSubscriptionRequestSchema} webhookSubscriptionRequestSchema Information about a webhook that Bandwidth should send upon the completion of event customer is trying to subscribe to.
410
+ * @param {*} [options] Override http request option.
411
+ * @throws {RequiredError}
412
+ */
413
+ updateWebhookSubscription: function (accountId_1, id_1, webhookSubscriptionRequestSchema_1) {
414
+ var args_1 = [];
415
+ for (var _i = 3; _i < arguments.length; _i++) {
416
+ args_1[_i - 3] = arguments[_i];
417
+ }
418
+ return __awaiter(_this, __spreadArray([accountId_1, id_1, webhookSubscriptionRequestSchema_1], args_1, true), void 0, function (accountId, id, webhookSubscriptionRequestSchema, options) {
419
+ var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
420
+ if (options === void 0) { options = {}; }
421
+ return __generator(this, function (_a) {
422
+ // verify required parameter 'accountId' is not null or undefined
423
+ (0, common_1.assertParamExists)('updateWebhookSubscription', 'accountId', accountId);
424
+ // verify required parameter 'id' is not null or undefined
425
+ (0, common_1.assertParamExists)('updateWebhookSubscription', 'id', id);
426
+ // verify required parameter 'webhookSubscriptionRequestSchema' is not null or undefined
427
+ (0, common_1.assertParamExists)('updateWebhookSubscription', 'webhookSubscriptionRequestSchema', webhookSubscriptionRequestSchema);
428
+ localVarPath = "/accounts/{accountId}/tollFreeVerification/webhooks/subscriptions/{id}"
429
+ .replace("{".concat("accountId", "}"), encodeURIComponent(String(accountId)))
430
+ .replace("{".concat("id", "}"), encodeURIComponent(String(id)));
431
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
432
+ if (configuration) {
433
+ baseOptions = configuration.baseOptions;
434
+ }
435
+ localVarRequestOptions = __assign(__assign({ method: 'PUT' }, baseOptions), options);
436
+ localVarHeaderParameter = {};
437
+ localVarQueryParameter = {};
438
+ // authentication Basic required
439
+ // http basic authentication required
440
+ (0, common_1.setBasicAuthToObject)(localVarRequestOptions, configuration);
441
+ localVarHeaderParameter['Content-Type'] = 'application/json';
442
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
443
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
444
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
445
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(webhookSubscriptionRequestSchema, localVarRequestOptions, configuration);
446
+ return [2 /*return*/, {
447
+ url: (0, common_1.toPathString)(localVarUrlObj),
448
+ options: localVarRequestOptions,
449
+ }];
450
+ });
451
+ });
452
+ },
453
+ };
454
+ };
455
+ exports.TollFreeVerificationApiAxiosParamCreator = TollFreeVerificationApiAxiosParamCreator;
456
+ /**
457
+ * TollFreeVerificationApi - functional programming interface
458
+ * @export
459
+ */
460
+ var TollFreeVerificationApiFp = function (configuration) {
461
+ var localVarAxiosParamCreator = (0, exports.TollFreeVerificationApiAxiosParamCreator)(configuration);
462
+ return {
463
+ /**
464
+ * Create a new webhook subscription (this webhook will be called for every update on every submission). In addition to a `callbackUrl`, this subscription can provide optional HTTP basic authentication credentials (a username and a password). The returned subscription object will contain an ID that can be used to modify or delete the subscription at a later time.
465
+ * @summary Create Webhook Subscription
466
+ * @param {string} accountId Your Bandwidth Account ID.
467
+ * @param {WebhookSubscriptionRequestSchema} webhookSubscriptionRequestSchema Information about a webhook that Bandwidth should send upon the completion of event customer is trying to subscribe to.
468
+ * @param {*} [options] Override http request option.
469
+ * @throws {RequiredError}
470
+ */
471
+ createWebhookSubscription: function (accountId, webhookSubscriptionRequestSchema, options) {
472
+ return __awaiter(this, void 0, void 0, function () {
473
+ var localVarAxiosArgs, localVarOperationServerIndex, localVarOperationServerBasePath;
474
+ var _a, _b, _c;
475
+ return __generator(this, function (_d) {
476
+ switch (_d.label) {
477
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.createWebhookSubscription(accountId, webhookSubscriptionRequestSchema, options)];
478
+ case 1:
479
+ localVarAxiosArgs = _d.sent();
480
+ localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
481
+ localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['TollFreeVerificationApi.createWebhookSubscription']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
482
+ return [2 /*return*/, function (axios, basePath) { return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }];
483
+ }
484
+ });
485
+ });
486
+ },
487
+ /**
488
+ * Delete a webhook subscription by ID.
489
+ * @summary Delete Webhook Subscription
490
+ * @param {string} accountId Your Bandwidth Account ID.
491
+ * @param {string} id Webhook subscription ID
492
+ * @param {*} [options] Override http request option.
493
+ * @throws {RequiredError}
494
+ */
495
+ deleteWebhookSubscription: function (accountId, id, options) {
496
+ return __awaiter(this, void 0, void 0, function () {
497
+ var localVarAxiosArgs, localVarOperationServerIndex, localVarOperationServerBasePath;
498
+ var _a, _b, _c;
499
+ return __generator(this, function (_d) {
500
+ switch (_d.label) {
501
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.deleteWebhookSubscription(accountId, id, options)];
502
+ case 1:
503
+ localVarAxiosArgs = _d.sent();
504
+ localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
505
+ localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['TollFreeVerificationApi.deleteWebhookSubscription']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
506
+ return [2 /*return*/, function (axios, basePath) { return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }];
507
+ }
508
+ });
509
+ });
510
+ },
511
+ /**
512
+ * Gets the verification status for a phone number that is provisioned to your account. Submission information will be appended to the response if it is available.
513
+ * @summary Get Toll-Free Verification Status
514
+ * @param {string} accountId Your Bandwidth Account ID.
515
+ * @param {string} phoneNumber Valid Toll-Free telephone number in E.164 format.
516
+ * @param {*} [options] Override http request option.
517
+ * @throws {RequiredError}
518
+ */
519
+ getTollFreeVerificationStatus: function (accountId, phoneNumber, options) {
520
+ return __awaiter(this, void 0, void 0, function () {
521
+ var localVarAxiosArgs, localVarOperationServerIndex, localVarOperationServerBasePath;
522
+ var _a, _b, _c;
523
+ return __generator(this, function (_d) {
524
+ switch (_d.label) {
525
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.getTollFreeVerificationStatus(accountId, phoneNumber, options)];
526
+ case 1:
527
+ localVarAxiosArgs = _d.sent();
528
+ localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
529
+ localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['TollFreeVerificationApi.getTollFreeVerificationStatus']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
530
+ return [2 /*return*/, function (axios, basePath) { return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }];
531
+ }
532
+ });
533
+ });
534
+ },
535
+ /**
536
+ * Lists valid toll-free use cases.
537
+ * @summary List Toll-Free Use Cases
538
+ * @param {*} [options] Override http request option.
539
+ * @throws {RequiredError}
540
+ */
541
+ listTollFreeUseCases: function (options) {
542
+ return __awaiter(this, void 0, void 0, function () {
543
+ var localVarAxiosArgs, localVarOperationServerIndex, localVarOperationServerBasePath;
544
+ var _a, _b, _c;
545
+ return __generator(this, function (_d) {
546
+ switch (_d.label) {
547
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.listTollFreeUseCases(options)];
548
+ case 1:
549
+ localVarAxiosArgs = _d.sent();
550
+ localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
551
+ localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['TollFreeVerificationApi.listTollFreeUseCases']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
552
+ return [2 /*return*/, function (axios, basePath) { return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }];
553
+ }
554
+ });
555
+ });
556
+ },
557
+ /**
558
+ * Lists all webhook subscriptions that are registered to receive status updates for the toll-free verification requests submitted under this account (password will not be returned through this API If `basicAuthentication` is defined, the `password` property of that object will be null).
559
+ * @summary List Webhook Subscriptions
560
+ * @param {string} accountId Your Bandwidth Account ID.
561
+ * @param {*} [options] Override http request option.
562
+ * @throws {RequiredError}
563
+ */
564
+ listWebhookSubscriptions: function (accountId, options) {
565
+ return __awaiter(this, void 0, void 0, function () {
566
+ var localVarAxiosArgs, localVarOperationServerIndex, localVarOperationServerBasePath;
567
+ var _a, _b, _c;
568
+ return __generator(this, function (_d) {
569
+ switch (_d.label) {
570
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.listWebhookSubscriptions(accountId, options)];
571
+ case 1:
572
+ localVarAxiosArgs = _d.sent();
573
+ localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
574
+ localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['TollFreeVerificationApi.listWebhookSubscriptions']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
575
+ return [2 /*return*/, function (axios, basePath) { return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }];
576
+ }
577
+ });
578
+ });
579
+ },
580
+ /**
581
+ * Submit a request for verification of a toll-free phone number.
582
+ * @summary Request Toll-Free Verification
583
+ * @param {string} accountId Your Bandwidth Account ID.
584
+ * @param {VerificationRequest} verificationRequest Request for verification of a toll-free phone number.
585
+ * @param {*} [options] Override http request option.
586
+ * @throws {RequiredError}
587
+ */
588
+ requestTollFreeVerification: function (accountId, verificationRequest, options) {
589
+ return __awaiter(this, void 0, void 0, function () {
590
+ var localVarAxiosArgs, localVarOperationServerIndex, localVarOperationServerBasePath;
591
+ var _a, _b, _c;
592
+ return __generator(this, function (_d) {
593
+ switch (_d.label) {
594
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.requestTollFreeVerification(accountId, verificationRequest, options)];
595
+ case 1:
596
+ localVarAxiosArgs = _d.sent();
597
+ localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
598
+ localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['TollFreeVerificationApi.requestTollFreeVerification']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
599
+ return [2 /*return*/, function (axios, basePath) { return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }];
600
+ }
601
+ });
602
+ });
603
+ },
604
+ /**
605
+ * Updates a toll-free verification request. Submissions are only eligible for resubmission for 7 days within being processed and if resubmission is allowed (resubmitAllowed field is true).
606
+ * @summary Update Toll-Free Verification Request
607
+ * @param {string} accountId Your Bandwidth Account ID.
608
+ * @param {string} phoneNumber Valid Toll-Free telephone number in E.164 format.
609
+ * @param {TfvSubmissionWrapper} tfvSubmissionWrapper Update a request for verification of a toll-free phone number.
610
+ * @param {*} [options] Override http request option.
611
+ * @throws {RequiredError}
612
+ */
613
+ updateTollFreeVerificationRequest: function (accountId, phoneNumber, tfvSubmissionWrapper, options) {
614
+ return __awaiter(this, void 0, void 0, function () {
615
+ var localVarAxiosArgs, localVarOperationServerIndex, localVarOperationServerBasePath;
616
+ var _a, _b, _c;
617
+ return __generator(this, function (_d) {
618
+ switch (_d.label) {
619
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.updateTollFreeVerificationRequest(accountId, phoneNumber, tfvSubmissionWrapper, options)];
620
+ case 1:
621
+ localVarAxiosArgs = _d.sent();
622
+ localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
623
+ localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['TollFreeVerificationApi.updateTollFreeVerificationRequest']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
624
+ return [2 /*return*/, function (axios, basePath) { return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }];
625
+ }
626
+ });
627
+ });
628
+ },
629
+ /**
630
+ * Update an existing webhook subscription (`callbackUrl` and `basicAuthentication` can be updated).
631
+ * @summary Update Webhook Subscription
632
+ * @param {string} accountId Your Bandwidth Account ID.
633
+ * @param {string} id Webhook subscription ID
634
+ * @param {WebhookSubscriptionRequestSchema} webhookSubscriptionRequestSchema Information about a webhook that Bandwidth should send upon the completion of event customer is trying to subscribe to.
635
+ * @param {*} [options] Override http request option.
636
+ * @throws {RequiredError}
637
+ */
638
+ updateWebhookSubscription: function (accountId, id, webhookSubscriptionRequestSchema, options) {
639
+ return __awaiter(this, void 0, void 0, function () {
640
+ var localVarAxiosArgs, localVarOperationServerIndex, localVarOperationServerBasePath;
641
+ var _a, _b, _c;
642
+ return __generator(this, function (_d) {
643
+ switch (_d.label) {
644
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.updateWebhookSubscription(accountId, id, webhookSubscriptionRequestSchema, options)];
645
+ case 1:
646
+ localVarAxiosArgs = _d.sent();
647
+ localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
648
+ localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['TollFreeVerificationApi.updateWebhookSubscription']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
649
+ return [2 /*return*/, function (axios, basePath) { return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }];
650
+ }
651
+ });
652
+ });
653
+ },
654
+ };
655
+ };
656
+ exports.TollFreeVerificationApiFp = TollFreeVerificationApiFp;
657
+ /**
658
+ * TollFreeVerificationApi - factory interface
659
+ * @export
660
+ */
661
+ var TollFreeVerificationApiFactory = function (configuration, basePath, axios) {
662
+ var localVarFp = (0, exports.TollFreeVerificationApiFp)(configuration);
663
+ return {
664
+ /**
665
+ * Create a new webhook subscription (this webhook will be called for every update on every submission). In addition to a `callbackUrl`, this subscription can provide optional HTTP basic authentication credentials (a username and a password). The returned subscription object will contain an ID that can be used to modify or delete the subscription at a later time.
666
+ * @summary Create Webhook Subscription
667
+ * @param {string} accountId Your Bandwidth Account ID.
668
+ * @param {WebhookSubscriptionRequestSchema} webhookSubscriptionRequestSchema Information about a webhook that Bandwidth should send upon the completion of event customer is trying to subscribe to.
669
+ * @param {*} [options] Override http request option.
670
+ * @throws {RequiredError}
671
+ */
672
+ createWebhookSubscription: function (accountId, webhookSubscriptionRequestSchema, options) {
673
+ return localVarFp.createWebhookSubscription(accountId, webhookSubscriptionRequestSchema, options).then(function (request) { return request(axios, basePath); });
674
+ },
675
+ /**
676
+ * Delete a webhook subscription by ID.
677
+ * @summary Delete Webhook Subscription
678
+ * @param {string} accountId Your Bandwidth Account ID.
679
+ * @param {string} id Webhook subscription ID
680
+ * @param {*} [options] Override http request option.
681
+ * @throws {RequiredError}
682
+ */
683
+ deleteWebhookSubscription: function (accountId, id, options) {
684
+ return localVarFp.deleteWebhookSubscription(accountId, id, options).then(function (request) { return request(axios, basePath); });
685
+ },
686
+ /**
687
+ * Gets the verification status for a phone number that is provisioned to your account. Submission information will be appended to the response if it is available.
688
+ * @summary Get Toll-Free Verification Status
689
+ * @param {string} accountId Your Bandwidth Account ID.
690
+ * @param {string} phoneNumber Valid Toll-Free telephone number in E.164 format.
691
+ * @param {*} [options] Override http request option.
692
+ * @throws {RequiredError}
693
+ */
694
+ getTollFreeVerificationStatus: function (accountId, phoneNumber, options) {
695
+ return localVarFp.getTollFreeVerificationStatus(accountId, phoneNumber, options).then(function (request) { return request(axios, basePath); });
696
+ },
697
+ /**
698
+ * Lists valid toll-free use cases.
699
+ * @summary List Toll-Free Use Cases
700
+ * @param {*} [options] Override http request option.
701
+ * @throws {RequiredError}
702
+ */
703
+ listTollFreeUseCases: function (options) {
704
+ return localVarFp.listTollFreeUseCases(options).then(function (request) { return request(axios, basePath); });
705
+ },
706
+ /**
707
+ * Lists all webhook subscriptions that are registered to receive status updates for the toll-free verification requests submitted under this account (password will not be returned through this API If `basicAuthentication` is defined, the `password` property of that object will be null).
708
+ * @summary List Webhook Subscriptions
709
+ * @param {string} accountId Your Bandwidth Account ID.
710
+ * @param {*} [options] Override http request option.
711
+ * @throws {RequiredError}
712
+ */
713
+ listWebhookSubscriptions: function (accountId, options) {
714
+ return localVarFp.listWebhookSubscriptions(accountId, options).then(function (request) { return request(axios, basePath); });
715
+ },
716
+ /**
717
+ * Submit a request for verification of a toll-free phone number.
718
+ * @summary Request Toll-Free Verification
719
+ * @param {string} accountId Your Bandwidth Account ID.
720
+ * @param {VerificationRequest} verificationRequest Request for verification of a toll-free phone number.
721
+ * @param {*} [options] Override http request option.
722
+ * @throws {RequiredError}
723
+ */
724
+ requestTollFreeVerification: function (accountId, verificationRequest, options) {
725
+ return localVarFp.requestTollFreeVerification(accountId, verificationRequest, options).then(function (request) { return request(axios, basePath); });
726
+ },
727
+ /**
728
+ * Updates a toll-free verification request. Submissions are only eligible for resubmission for 7 days within being processed and if resubmission is allowed (resubmitAllowed field is true).
729
+ * @summary Update Toll-Free Verification Request
730
+ * @param {string} accountId Your Bandwidth Account ID.
731
+ * @param {string} phoneNumber Valid Toll-Free telephone number in E.164 format.
732
+ * @param {TfvSubmissionWrapper} tfvSubmissionWrapper Update a request for verification of a toll-free phone number.
733
+ * @param {*} [options] Override http request option.
734
+ * @throws {RequiredError}
735
+ */
736
+ updateTollFreeVerificationRequest: function (accountId, phoneNumber, tfvSubmissionWrapper, options) {
737
+ return localVarFp.updateTollFreeVerificationRequest(accountId, phoneNumber, tfvSubmissionWrapper, options).then(function (request) { return request(axios, basePath); });
738
+ },
739
+ /**
740
+ * Update an existing webhook subscription (`callbackUrl` and `basicAuthentication` can be updated).
741
+ * @summary Update Webhook Subscription
742
+ * @param {string} accountId Your Bandwidth Account ID.
743
+ * @param {string} id Webhook subscription ID
744
+ * @param {WebhookSubscriptionRequestSchema} webhookSubscriptionRequestSchema Information about a webhook that Bandwidth should send upon the completion of event customer is trying to subscribe to.
745
+ * @param {*} [options] Override http request option.
746
+ * @throws {RequiredError}
747
+ */
748
+ updateWebhookSubscription: function (accountId, id, webhookSubscriptionRequestSchema, options) {
749
+ return localVarFp.updateWebhookSubscription(accountId, id, webhookSubscriptionRequestSchema, options).then(function (request) { return request(axios, basePath); });
750
+ },
751
+ };
752
+ };
753
+ exports.TollFreeVerificationApiFactory = TollFreeVerificationApiFactory;
754
+ /**
755
+ * TollFreeVerificationApi - object-oriented interface
756
+ * @export
757
+ * @class TollFreeVerificationApi
758
+ * @extends {BaseAPI}
759
+ */
760
+ var TollFreeVerificationApi = /** @class */ (function (_super) {
761
+ __extends(TollFreeVerificationApi, _super);
762
+ function TollFreeVerificationApi() {
763
+ return _super !== null && _super.apply(this, arguments) || this;
764
+ }
765
+ /**
766
+ * Create a new webhook subscription (this webhook will be called for every update on every submission). In addition to a `callbackUrl`, this subscription can provide optional HTTP basic authentication credentials (a username and a password). The returned subscription object will contain an ID that can be used to modify or delete the subscription at a later time.
767
+ * @summary Create Webhook Subscription
768
+ * @param {string} accountId Your Bandwidth Account ID.
769
+ * @param {WebhookSubscriptionRequestSchema} webhookSubscriptionRequestSchema Information about a webhook that Bandwidth should send upon the completion of event customer is trying to subscribe to.
770
+ * @param {*} [options] Override http request option.
771
+ * @throws {RequiredError}
772
+ * @memberof TollFreeVerificationApi
773
+ */
774
+ TollFreeVerificationApi.prototype.createWebhookSubscription = function (accountId, webhookSubscriptionRequestSchema, options) {
775
+ var _this = this;
776
+ return (0, exports.TollFreeVerificationApiFp)(this.configuration).createWebhookSubscription(accountId, webhookSubscriptionRequestSchema, options).then(function (request) { return request(_this.axios, _this.basePath); });
777
+ };
778
+ /**
779
+ * Delete a webhook subscription by ID.
780
+ * @summary Delete Webhook Subscription
781
+ * @param {string} accountId Your Bandwidth Account ID.
782
+ * @param {string} id Webhook subscription ID
783
+ * @param {*} [options] Override http request option.
784
+ * @throws {RequiredError}
785
+ * @memberof TollFreeVerificationApi
786
+ */
787
+ TollFreeVerificationApi.prototype.deleteWebhookSubscription = function (accountId, id, options) {
788
+ var _this = this;
789
+ return (0, exports.TollFreeVerificationApiFp)(this.configuration).deleteWebhookSubscription(accountId, id, options).then(function (request) { return request(_this.axios, _this.basePath); });
790
+ };
791
+ /**
792
+ * Gets the verification status for a phone number that is provisioned to your account. Submission information will be appended to the response if it is available.
793
+ * @summary Get Toll-Free Verification Status
794
+ * @param {string} accountId Your Bandwidth Account ID.
795
+ * @param {string} phoneNumber Valid Toll-Free telephone number in E.164 format.
796
+ * @param {*} [options] Override http request option.
797
+ * @throws {RequiredError}
798
+ * @memberof TollFreeVerificationApi
799
+ */
800
+ TollFreeVerificationApi.prototype.getTollFreeVerificationStatus = function (accountId, phoneNumber, options) {
801
+ var _this = this;
802
+ return (0, exports.TollFreeVerificationApiFp)(this.configuration).getTollFreeVerificationStatus(accountId, phoneNumber, options).then(function (request) { return request(_this.axios, _this.basePath); });
803
+ };
804
+ /**
805
+ * Lists valid toll-free use cases.
806
+ * @summary List Toll-Free Use Cases
807
+ * @param {*} [options] Override http request option.
808
+ * @throws {RequiredError}
809
+ * @memberof TollFreeVerificationApi
810
+ */
811
+ TollFreeVerificationApi.prototype.listTollFreeUseCases = function (options) {
812
+ var _this = this;
813
+ return (0, exports.TollFreeVerificationApiFp)(this.configuration).listTollFreeUseCases(options).then(function (request) { return request(_this.axios, _this.basePath); });
814
+ };
815
+ /**
816
+ * Lists all webhook subscriptions that are registered to receive status updates for the toll-free verification requests submitted under this account (password will not be returned through this API If `basicAuthentication` is defined, the `password` property of that object will be null).
817
+ * @summary List Webhook Subscriptions
818
+ * @param {string} accountId Your Bandwidth Account ID.
819
+ * @param {*} [options] Override http request option.
820
+ * @throws {RequiredError}
821
+ * @memberof TollFreeVerificationApi
822
+ */
823
+ TollFreeVerificationApi.prototype.listWebhookSubscriptions = function (accountId, options) {
824
+ var _this = this;
825
+ return (0, exports.TollFreeVerificationApiFp)(this.configuration).listWebhookSubscriptions(accountId, options).then(function (request) { return request(_this.axios, _this.basePath); });
826
+ };
827
+ /**
828
+ * Submit a request for verification of a toll-free phone number.
829
+ * @summary Request Toll-Free Verification
830
+ * @param {string} accountId Your Bandwidth Account ID.
831
+ * @param {VerificationRequest} verificationRequest Request for verification of a toll-free phone number.
832
+ * @param {*} [options] Override http request option.
833
+ * @throws {RequiredError}
834
+ * @memberof TollFreeVerificationApi
835
+ */
836
+ TollFreeVerificationApi.prototype.requestTollFreeVerification = function (accountId, verificationRequest, options) {
837
+ var _this = this;
838
+ return (0, exports.TollFreeVerificationApiFp)(this.configuration).requestTollFreeVerification(accountId, verificationRequest, options).then(function (request) { return request(_this.axios, _this.basePath); });
839
+ };
840
+ /**
841
+ * Updates a toll-free verification request. Submissions are only eligible for resubmission for 7 days within being processed and if resubmission is allowed (resubmitAllowed field is true).
842
+ * @summary Update Toll-Free Verification Request
843
+ * @param {string} accountId Your Bandwidth Account ID.
844
+ * @param {string} phoneNumber Valid Toll-Free telephone number in E.164 format.
845
+ * @param {TfvSubmissionWrapper} tfvSubmissionWrapper Update a request for verification of a toll-free phone number.
846
+ * @param {*} [options] Override http request option.
847
+ * @throws {RequiredError}
848
+ * @memberof TollFreeVerificationApi
849
+ */
850
+ TollFreeVerificationApi.prototype.updateTollFreeVerificationRequest = function (accountId, phoneNumber, tfvSubmissionWrapper, options) {
851
+ var _this = this;
852
+ return (0, exports.TollFreeVerificationApiFp)(this.configuration).updateTollFreeVerificationRequest(accountId, phoneNumber, tfvSubmissionWrapper, options).then(function (request) { return request(_this.axios, _this.basePath); });
853
+ };
854
+ /**
855
+ * Update an existing webhook subscription (`callbackUrl` and `basicAuthentication` can be updated).
856
+ * @summary Update Webhook Subscription
857
+ * @param {string} accountId Your Bandwidth Account ID.
858
+ * @param {string} id Webhook subscription ID
859
+ * @param {WebhookSubscriptionRequestSchema} webhookSubscriptionRequestSchema Information about a webhook that Bandwidth should send upon the completion of event customer is trying to subscribe to.
860
+ * @param {*} [options] Override http request option.
861
+ * @throws {RequiredError}
862
+ * @memberof TollFreeVerificationApi
863
+ */
864
+ TollFreeVerificationApi.prototype.updateWebhookSubscription = function (accountId, id, webhookSubscriptionRequestSchema, options) {
865
+ var _this = this;
866
+ return (0, exports.TollFreeVerificationApiFp)(this.configuration).updateWebhookSubscription(accountId, id, webhookSubscriptionRequestSchema, options).then(function (request) { return request(_this.axios, _this.basePath); });
867
+ };
868
+ return TollFreeVerificationApi;
869
+ }(base_1.BaseAPI));
870
+ exports.TollFreeVerificationApi = TollFreeVerificationApi;