/* tslint:disable */ /* eslint-disable */ /** * Bandwidth * Bandwidth\'s Communication APIs * * The version of the OpenAPI document: 1.0.0 * Contact: letstalk@bandwidth.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import type { Configuration } from '../configuration'; import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import type { TfvError } from '../models'; // @ts-ignore import type { TfvStatus } from '../models'; // @ts-ignore import type { TfvSubmissionWrapper } from '../models'; // @ts-ignore import type { VerificationRequest } from '../models'; // @ts-ignore import type { WebhookSubscription } from '../models'; // @ts-ignore import type { WebhookSubscriptionRequestSchema } from '../models'; // @ts-ignore import type { WebhookSubscriptionsListBody } from '../models'; /** * TollFreeVerificationApi - axios parameter creator */ export const TollFreeVerificationApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * 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. * @summary Create Webhook Subscription * @param {string} accountId Your Bandwidth Account ID. * @param {WebhookSubscriptionRequestSchema} webhookSubscriptionRequestSchema Information about a webhook that Bandwidth should send upon the completion of event customer is trying to subscribe to. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createWebhookSubscription: async (accountId: string, webhookSubscriptionRequestSchema: WebhookSubscriptionRequestSchema, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'accountId' is not null or undefined assertParamExists('createWebhookSubscription', 'accountId', accountId) // verify required parameter 'webhookSubscriptionRequestSchema' is not null or undefined assertParamExists('createWebhookSubscription', 'webhookSubscriptionRequestSchema', webhookSubscriptionRequestSchema) const localVarPath = `/accounts/{accountId}/tollFreeVerification/webhooks/subscriptions` .replace(`{${"accountId"}}`, encodeURIComponent(String(accountId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication Basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration) // authentication OAuth2 required // oauth required await setOAuthToObject(localVarHeaderParameter, "OAuth2", [], configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(webhookSubscriptionRequestSchema, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Delete a toll-free verification submission for a toll-free number. * @summary Delete a Toll-Free Verification Submission * @param {string} accountId Your Bandwidth Account ID. * @param {string} phoneNumber Valid Toll-Free telephone number in E.164 format. * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteVerificationRequest: async (accountId: string, phoneNumber: string, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'accountId' is not null or undefined assertParamExists('deleteVerificationRequest', 'accountId', accountId) // verify required parameter 'phoneNumber' is not null or undefined assertParamExists('deleteVerificationRequest', 'phoneNumber', phoneNumber) const localVarPath = `/accounts/{accountId}/phoneNumbers/{phoneNumber}/tollFreeVerification` .replace(`{${"accountId"}}`, encodeURIComponent(String(accountId))) .replace(`{${"phoneNumber"}}`, encodeURIComponent(String(phoneNumber))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication Basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration) // authentication OAuth2 required // oauth required await setOAuthToObject(localVarHeaderParameter, "OAuth2", [], configuration) setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Delete a webhook subscription by ID. * @summary Delete Webhook Subscription * @param {string} accountId Your Bandwidth Account ID. * @param {string} id Webhook subscription ID * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteWebhookSubscription: async (accountId: string, id: string, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'accountId' is not null or undefined assertParamExists('deleteWebhookSubscription', 'accountId', accountId) // verify required parameter 'id' is not null or undefined assertParamExists('deleteWebhookSubscription', 'id', id) const localVarPath = `/accounts/{accountId}/tollFreeVerification/webhooks/subscriptions/{id}` .replace(`{${"accountId"}}`, encodeURIComponent(String(accountId))) .replace(`{${"id"}}`, encodeURIComponent(String(id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication Basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration) // authentication OAuth2 required // oauth required await setOAuthToObject(localVarHeaderParameter, "OAuth2", [], configuration) setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * 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. * @summary Get Toll-Free Verification Status * @param {string} accountId Your Bandwidth Account ID. * @param {string} phoneNumber Valid Toll-Free telephone number in E.164 format. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getTollFreeVerificationStatus: async (accountId: string, phoneNumber: string, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'accountId' is not null or undefined assertParamExists('getTollFreeVerificationStatus', 'accountId', accountId) // verify required parameter 'phoneNumber' is not null or undefined assertParamExists('getTollFreeVerificationStatus', 'phoneNumber', phoneNumber) const localVarPath = `/accounts/{accountId}/phoneNumbers/{phoneNumber}/tollFreeVerification` .replace(`{${"accountId"}}`, encodeURIComponent(String(accountId))) .replace(`{${"phoneNumber"}}`, encodeURIComponent(String(phoneNumber))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication Basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration) // authentication OAuth2 required // oauth required await setOAuthToObject(localVarHeaderParameter, "OAuth2", [], configuration) setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Lists valid toll-free use cases. * @summary List Toll-Free Use Cases * @param {*} [options] Override http request option. * @throws {RequiredError} */ listTollFreeUseCases: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/tollFreeVerification/useCases`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication Basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration) // authentication OAuth2 required // oauth required await setOAuthToObject(localVarHeaderParameter, "OAuth2", [], configuration) setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * 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). * @summary List Webhook Subscriptions * @param {string} accountId Your Bandwidth Account ID. * @param {*} [options] Override http request option. * @throws {RequiredError} */ listWebhookSubscriptions: async (accountId: string, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'accountId' is not null or undefined assertParamExists('listWebhookSubscriptions', 'accountId', accountId) const localVarPath = `/accounts/{accountId}/tollFreeVerification/webhooks/subscriptions` .replace(`{${"accountId"}}`, encodeURIComponent(String(accountId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication Basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration) // authentication OAuth2 required // oauth required await setOAuthToObject(localVarHeaderParameter, "OAuth2", [], configuration) setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Submit a request for verification of a toll-free phone number. * @summary Request Toll-Free Verification * @param {string} accountId Your Bandwidth Account ID. * @param {VerificationRequest} verificationRequest Request for verification of a toll-free phone number. * @param {*} [options] Override http request option. * @throws {RequiredError} */ requestTollFreeVerification: async (accountId: string, verificationRequest: VerificationRequest, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'accountId' is not null or undefined assertParamExists('requestTollFreeVerification', 'accountId', accountId) // verify required parameter 'verificationRequest' is not null or undefined assertParamExists('requestTollFreeVerification', 'verificationRequest', verificationRequest) const localVarPath = `/accounts/{accountId}/tollFreeVerification` .replace(`{${"accountId"}}`, encodeURIComponent(String(accountId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication Basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration) // authentication OAuth2 required // oauth required await setOAuthToObject(localVarHeaderParameter, "OAuth2", [], configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(verificationRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * 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). * @summary Update Toll-Free Verification Request * @param {string} accountId Your Bandwidth Account ID. * @param {string} phoneNumber Valid Toll-Free telephone number in E.164 format. * @param {TfvSubmissionWrapper} tfvSubmissionWrapper Update a request for verification of a toll-free phone number. * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateTollFreeVerificationRequest: async (accountId: string, phoneNumber: string, tfvSubmissionWrapper: TfvSubmissionWrapper, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'accountId' is not null or undefined assertParamExists('updateTollFreeVerificationRequest', 'accountId', accountId) // verify required parameter 'phoneNumber' is not null or undefined assertParamExists('updateTollFreeVerificationRequest', 'phoneNumber', phoneNumber) // verify required parameter 'tfvSubmissionWrapper' is not null or undefined assertParamExists('updateTollFreeVerificationRequest', 'tfvSubmissionWrapper', tfvSubmissionWrapper) const localVarPath = `/accounts/{accountId}/phoneNumbers/{phoneNumber}/tollFreeVerification` .replace(`{${"accountId"}}`, encodeURIComponent(String(accountId))) .replace(`{${"phoneNumber"}}`, encodeURIComponent(String(phoneNumber))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication Basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration) // authentication OAuth2 required // oauth required await setOAuthToObject(localVarHeaderParameter, "OAuth2", [], configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(tfvSubmissionWrapper, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Update an existing webhook subscription (`callbackUrl` and `basicAuthentication` can be updated). * @summary Update Webhook Subscription * @param {string} accountId Your Bandwidth Account ID. * @param {string} id Webhook subscription ID * @param {WebhookSubscriptionRequestSchema} webhookSubscriptionRequestSchema Information about a webhook that Bandwidth should send upon the completion of event customer is trying to subscribe to. * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateWebhookSubscription: async (accountId: string, id: string, webhookSubscriptionRequestSchema: WebhookSubscriptionRequestSchema, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'accountId' is not null or undefined assertParamExists('updateWebhookSubscription', 'accountId', accountId) // verify required parameter 'id' is not null or undefined assertParamExists('updateWebhookSubscription', 'id', id) // verify required parameter 'webhookSubscriptionRequestSchema' is not null or undefined assertParamExists('updateWebhookSubscription', 'webhookSubscriptionRequestSchema', webhookSubscriptionRequestSchema) const localVarPath = `/accounts/{accountId}/tollFreeVerification/webhooks/subscriptions/{id}` .replace(`{${"accountId"}}`, encodeURIComponent(String(accountId))) .replace(`{${"id"}}`, encodeURIComponent(String(id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication Basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration) // authentication OAuth2 required // oauth required await setOAuthToObject(localVarHeaderParameter, "OAuth2", [], configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(webhookSubscriptionRequestSchema, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * TollFreeVerificationApi - functional programming interface */ export const TollFreeVerificationApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = TollFreeVerificationApiAxiosParamCreator(configuration) return { /** * 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. * @summary Create Webhook Subscription * @param {string} accountId Your Bandwidth Account ID. * @param {WebhookSubscriptionRequestSchema} webhookSubscriptionRequestSchema Information about a webhook that Bandwidth should send upon the completion of event customer is trying to subscribe to. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createWebhookSubscription(accountId: string, webhookSubscriptionRequestSchema: WebhookSubscriptionRequestSchema, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.createWebhookSubscription(accountId, webhookSubscriptionRequestSchema, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['TollFreeVerificationApi.createWebhookSubscription']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Delete a toll-free verification submission for a toll-free number. * @summary Delete a Toll-Free Verification Submission * @param {string} accountId Your Bandwidth Account ID. * @param {string} phoneNumber Valid Toll-Free telephone number in E.164 format. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async deleteVerificationRequest(accountId: string, phoneNumber: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteVerificationRequest(accountId, phoneNumber, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['TollFreeVerificationApi.deleteVerificationRequest']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Delete a webhook subscription by ID. * @summary Delete Webhook Subscription * @param {string} accountId Your Bandwidth Account ID. * @param {string} id Webhook subscription ID * @param {*} [options] Override http request option. * @throws {RequiredError} */ async deleteWebhookSubscription(accountId: string, id: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteWebhookSubscription(accountId, id, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['TollFreeVerificationApi.deleteWebhookSubscription']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * 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. * @summary Get Toll-Free Verification Status * @param {string} accountId Your Bandwidth Account ID. * @param {string} phoneNumber Valid Toll-Free telephone number in E.164 format. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getTollFreeVerificationStatus(accountId: string, phoneNumber: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getTollFreeVerificationStatus(accountId, phoneNumber, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['TollFreeVerificationApi.getTollFreeVerificationStatus']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Lists valid toll-free use cases. * @summary List Toll-Free Use Cases * @param {*} [options] Override http request option. * @throws {RequiredError} */ async listTollFreeUseCases(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.listTollFreeUseCases(options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['TollFreeVerificationApi.listTollFreeUseCases']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * 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). * @summary List Webhook Subscriptions * @param {string} accountId Your Bandwidth Account ID. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async listWebhookSubscriptions(accountId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.listWebhookSubscriptions(accountId, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['TollFreeVerificationApi.listWebhookSubscriptions']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Submit a request for verification of a toll-free phone number. * @summary Request Toll-Free Verification * @param {string} accountId Your Bandwidth Account ID. * @param {VerificationRequest} verificationRequest Request for verification of a toll-free phone number. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async requestTollFreeVerification(accountId: string, verificationRequest: VerificationRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.requestTollFreeVerification(accountId, verificationRequest, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['TollFreeVerificationApi.requestTollFreeVerification']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * 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). * @summary Update Toll-Free Verification Request * @param {string} accountId Your Bandwidth Account ID. * @param {string} phoneNumber Valid Toll-Free telephone number in E.164 format. * @param {TfvSubmissionWrapper} tfvSubmissionWrapper Update a request for verification of a toll-free phone number. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async updateTollFreeVerificationRequest(accountId: string, phoneNumber: string, tfvSubmissionWrapper: TfvSubmissionWrapper, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.updateTollFreeVerificationRequest(accountId, phoneNumber, tfvSubmissionWrapper, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['TollFreeVerificationApi.updateTollFreeVerificationRequest']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Update an existing webhook subscription (`callbackUrl` and `basicAuthentication` can be updated). * @summary Update Webhook Subscription * @param {string} accountId Your Bandwidth Account ID. * @param {string} id Webhook subscription ID * @param {WebhookSubscriptionRequestSchema} webhookSubscriptionRequestSchema Information about a webhook that Bandwidth should send upon the completion of event customer is trying to subscribe to. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async updateWebhookSubscription(accountId: string, id: string, webhookSubscriptionRequestSchema: WebhookSubscriptionRequestSchema, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.updateWebhookSubscription(accountId, id, webhookSubscriptionRequestSchema, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['TollFreeVerificationApi.updateWebhookSubscription']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; /** * TollFreeVerificationApi - factory interface */ export const TollFreeVerificationApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = TollFreeVerificationApiFp(configuration) return { /** * 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. * @summary Create Webhook Subscription * @param {string} accountId Your Bandwidth Account ID. * @param {WebhookSubscriptionRequestSchema} webhookSubscriptionRequestSchema Information about a webhook that Bandwidth should send upon the completion of event customer is trying to subscribe to. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createWebhookSubscription(accountId: string, webhookSubscriptionRequestSchema: WebhookSubscriptionRequestSchema, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.createWebhookSubscription(accountId, webhookSubscriptionRequestSchema, options).then((request) => request(axios, basePath)); }, /** * Delete a toll-free verification submission for a toll-free number. * @summary Delete a Toll-Free Verification Submission * @param {string} accountId Your Bandwidth Account ID. * @param {string} phoneNumber Valid Toll-Free telephone number in E.164 format. * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteVerificationRequest(accountId: string, phoneNumber: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.deleteVerificationRequest(accountId, phoneNumber, options).then((request) => request(axios, basePath)); }, /** * Delete a webhook subscription by ID. * @summary Delete Webhook Subscription * @param {string} accountId Your Bandwidth Account ID. * @param {string} id Webhook subscription ID * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteWebhookSubscription(accountId: string, id: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.deleteWebhookSubscription(accountId, id, options).then((request) => request(axios, basePath)); }, /** * 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. * @summary Get Toll-Free Verification Status * @param {string} accountId Your Bandwidth Account ID. * @param {string} phoneNumber Valid Toll-Free telephone number in E.164 format. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getTollFreeVerificationStatus(accountId: string, phoneNumber: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getTollFreeVerificationStatus(accountId, phoneNumber, options).then((request) => request(axios, basePath)); }, /** * Lists valid toll-free use cases. * @summary List Toll-Free Use Cases * @param {*} [options] Override http request option. * @throws {RequiredError} */ listTollFreeUseCases(options?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.listTollFreeUseCases(options).then((request) => request(axios, basePath)); }, /** * 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). * @summary List Webhook Subscriptions * @param {string} accountId Your Bandwidth Account ID. * @param {*} [options] Override http request option. * @throws {RequiredError} */ listWebhookSubscriptions(accountId: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.listWebhookSubscriptions(accountId, options).then((request) => request(axios, basePath)); }, /** * Submit a request for verification of a toll-free phone number. * @summary Request Toll-Free Verification * @param {string} accountId Your Bandwidth Account ID. * @param {VerificationRequest} verificationRequest Request for verification of a toll-free phone number. * @param {*} [options] Override http request option. * @throws {RequiredError} */ requestTollFreeVerification(accountId: string, verificationRequest: VerificationRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.requestTollFreeVerification(accountId, verificationRequest, options).then((request) => request(axios, basePath)); }, /** * 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). * @summary Update Toll-Free Verification Request * @param {string} accountId Your Bandwidth Account ID. * @param {string} phoneNumber Valid Toll-Free telephone number in E.164 format. * @param {TfvSubmissionWrapper} tfvSubmissionWrapper Update a request for verification of a toll-free phone number. * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateTollFreeVerificationRequest(accountId: string, phoneNumber: string, tfvSubmissionWrapper: TfvSubmissionWrapper, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.updateTollFreeVerificationRequest(accountId, phoneNumber, tfvSubmissionWrapper, options).then((request) => request(axios, basePath)); }, /** * Update an existing webhook subscription (`callbackUrl` and `basicAuthentication` can be updated). * @summary Update Webhook Subscription * @param {string} accountId Your Bandwidth Account ID. * @param {string} id Webhook subscription ID * @param {WebhookSubscriptionRequestSchema} webhookSubscriptionRequestSchema Information about a webhook that Bandwidth should send upon the completion of event customer is trying to subscribe to. * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateWebhookSubscription(accountId: string, id: string, webhookSubscriptionRequestSchema: WebhookSubscriptionRequestSchema, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.updateWebhookSubscription(accountId, id, webhookSubscriptionRequestSchema, options).then((request) => request(axios, basePath)); }, }; }; /** * TollFreeVerificationApi - object-oriented interface */ export class TollFreeVerificationApi extends BaseAPI { /** * 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. * @summary Create Webhook Subscription * @param {string} accountId Your Bandwidth Account ID. * @param {WebhookSubscriptionRequestSchema} webhookSubscriptionRequestSchema Information about a webhook that Bandwidth should send upon the completion of event customer is trying to subscribe to. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public createWebhookSubscription(accountId: string, webhookSubscriptionRequestSchema: WebhookSubscriptionRequestSchema, options?: RawAxiosRequestConfig) { return TollFreeVerificationApiFp(this.configuration).createWebhookSubscription(accountId, webhookSubscriptionRequestSchema, options).then((request) => request(this.axios, this.basePath)); } /** * Delete a toll-free verification submission for a toll-free number. * @summary Delete a Toll-Free Verification Submission * @param {string} accountId Your Bandwidth Account ID. * @param {string} phoneNumber Valid Toll-Free telephone number in E.164 format. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public deleteVerificationRequest(accountId: string, phoneNumber: string, options?: RawAxiosRequestConfig) { return TollFreeVerificationApiFp(this.configuration).deleteVerificationRequest(accountId, phoneNumber, options).then((request) => request(this.axios, this.basePath)); } /** * Delete a webhook subscription by ID. * @summary Delete Webhook Subscription * @param {string} accountId Your Bandwidth Account ID. * @param {string} id Webhook subscription ID * @param {*} [options] Override http request option. * @throws {RequiredError} */ public deleteWebhookSubscription(accountId: string, id: string, options?: RawAxiosRequestConfig) { return TollFreeVerificationApiFp(this.configuration).deleteWebhookSubscription(accountId, id, options).then((request) => request(this.axios, this.basePath)); } /** * 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. * @summary Get Toll-Free Verification Status * @param {string} accountId Your Bandwidth Account ID. * @param {string} phoneNumber Valid Toll-Free telephone number in E.164 format. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public getTollFreeVerificationStatus(accountId: string, phoneNumber: string, options?: RawAxiosRequestConfig) { return TollFreeVerificationApiFp(this.configuration).getTollFreeVerificationStatus(accountId, phoneNumber, options).then((request) => request(this.axios, this.basePath)); } /** * Lists valid toll-free use cases. * @summary List Toll-Free Use Cases * @param {*} [options] Override http request option. * @throws {RequiredError} */ public listTollFreeUseCases(options?: RawAxiosRequestConfig) { return TollFreeVerificationApiFp(this.configuration).listTollFreeUseCases(options).then((request) => request(this.axios, this.basePath)); } /** * 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). * @summary List Webhook Subscriptions * @param {string} accountId Your Bandwidth Account ID. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public listWebhookSubscriptions(accountId: string, options?: RawAxiosRequestConfig) { return TollFreeVerificationApiFp(this.configuration).listWebhookSubscriptions(accountId, options).then((request) => request(this.axios, this.basePath)); } /** * Submit a request for verification of a toll-free phone number. * @summary Request Toll-Free Verification * @param {string} accountId Your Bandwidth Account ID. * @param {VerificationRequest} verificationRequest Request for verification of a toll-free phone number. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public requestTollFreeVerification(accountId: string, verificationRequest: VerificationRequest, options?: RawAxiosRequestConfig) { return TollFreeVerificationApiFp(this.configuration).requestTollFreeVerification(accountId, verificationRequest, options).then((request) => request(this.axios, this.basePath)); } /** * 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). * @summary Update Toll-Free Verification Request * @param {string} accountId Your Bandwidth Account ID. * @param {string} phoneNumber Valid Toll-Free telephone number in E.164 format. * @param {TfvSubmissionWrapper} tfvSubmissionWrapper Update a request for verification of a toll-free phone number. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public updateTollFreeVerificationRequest(accountId: string, phoneNumber: string, tfvSubmissionWrapper: TfvSubmissionWrapper, options?: RawAxiosRequestConfig) { return TollFreeVerificationApiFp(this.configuration).updateTollFreeVerificationRequest(accountId, phoneNumber, tfvSubmissionWrapper, options).then((request) => request(this.axios, this.basePath)); } /** * Update an existing webhook subscription (`callbackUrl` and `basicAuthentication` can be updated). * @summary Update Webhook Subscription * @param {string} accountId Your Bandwidth Account ID. * @param {string} id Webhook subscription ID * @param {WebhookSubscriptionRequestSchema} webhookSubscriptionRequestSchema Information about a webhook that Bandwidth should send upon the completion of event customer is trying to subscribe to. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public updateWebhookSubscription(accountId: string, id: string, webhookSubscriptionRequestSchema: WebhookSubscriptionRequestSchema, options?: RawAxiosRequestConfig) { return TollFreeVerificationApiFp(this.configuration).updateWebhookSubscription(accountId, id, webhookSubscriptionRequestSchema, options).then((request) => request(this.axios, this.basePath)); } }