/* 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 { CreateMultiChannelMessageResponse } from '../models'; // @ts-ignore import type { MultiChannelError } from '../models'; // @ts-ignore import type { MultiChannelMessageRequest } from '../models'; /** * MultiChannelApi - axios parameter creator */ export const MultiChannelApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * Endpoint for sending Multi-Channel messages. * @summary Create Multi-Channel Message * @param {string} accountId Your Bandwidth Account ID. * @param {MultiChannelMessageRequest} multiChannelMessageRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ createMultiChannelMessage: async (accountId: string, multiChannelMessageRequest: MultiChannelMessageRequest, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'accountId' is not null or undefined assertParamExists('createMultiChannelMessage', 'accountId', accountId) // verify required parameter 'multiChannelMessageRequest' is not null or undefined assertParamExists('createMultiChannelMessage', 'multiChannelMessageRequest', multiChannelMessageRequest) const localVarPath = `/users/{accountId}/messages/multiChannel` .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(multiChannelMessageRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * MultiChannelApi - functional programming interface */ export const MultiChannelApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = MultiChannelApiAxiosParamCreator(configuration) return { /** * Endpoint for sending Multi-Channel messages. * @summary Create Multi-Channel Message * @param {string} accountId Your Bandwidth Account ID. * @param {MultiChannelMessageRequest} multiChannelMessageRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createMultiChannelMessage(accountId: string, multiChannelMessageRequest: MultiChannelMessageRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.createMultiChannelMessage(accountId, multiChannelMessageRequest, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['MultiChannelApi.createMultiChannelMessage']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; /** * MultiChannelApi - factory interface */ export const MultiChannelApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = MultiChannelApiFp(configuration) return { /** * Endpoint for sending Multi-Channel messages. * @summary Create Multi-Channel Message * @param {string} accountId Your Bandwidth Account ID. * @param {MultiChannelMessageRequest} multiChannelMessageRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ createMultiChannelMessage(accountId: string, multiChannelMessageRequest: MultiChannelMessageRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.createMultiChannelMessage(accountId, multiChannelMessageRequest, options).then((request) => request(axios, basePath)); }, }; }; /** * MultiChannelApi - object-oriented interface */ export class MultiChannelApi extends BaseAPI { /** * Endpoint for sending Multi-Channel messages. * @summary Create Multi-Channel Message * @param {string} accountId Your Bandwidth Account ID. * @param {MultiChannelMessageRequest} multiChannelMessageRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ public createMultiChannelMessage(accountId: string, multiChannelMessageRequest: MultiChannelMessageRequest, options?: RawAxiosRequestConfig) { return MultiChannelApiFp(this.configuration).createMultiChannelMessage(accountId, multiChannelMessageRequest, options).then((request) => request(this.axios, this.basePath)); } }