|
| 1 | +/* tslint:disable */ |
| 2 | +/* eslint-disable */ |
| 3 | +/** |
| 4 | + * Bandwidth |
| 5 | + * Bandwidth\'s Communication APIs |
| 6 | + * |
| 7 | + * The version of the OpenAPI document: 1.0.0 |
| 8 | + |
| 9 | + * |
| 10 | + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). |
| 11 | + * https://openapi-generator.tech |
| 12 | + * Do not edit the class manually. |
| 13 | + */ |
| 14 | + |
| 15 | + |
| 16 | +import type { Configuration } from '../configuration'; |
| 17 | +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; |
| 18 | +import globalAxios from 'axios'; |
| 19 | +// Some imports not used depending on template conditions |
| 20 | +// @ts-ignore |
| 21 | +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; |
| 22 | +// @ts-ignore |
| 23 | +import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; |
| 24 | +// @ts-ignore |
| 25 | +import type { CreateMessageRequestError } from '../models'; |
| 26 | +// @ts-ignore |
| 27 | +import type { CreateMultiChannelMessageResponse } from '../models'; |
| 28 | +// @ts-ignore |
| 29 | +import type { MessagingRequestError } from '../models'; |
| 30 | +// @ts-ignore |
| 31 | +import type { MultiChannelMessageRequest } from '../models'; |
| 32 | +/** |
| 33 | + * MultiChannelApi - axios parameter creator |
| 34 | + * @export |
| 35 | + */ |
| 36 | +export const MultiChannelApiAxiosParamCreator = function (configuration?: Configuration) { |
| 37 | + return { |
| 38 | + /** |
| 39 | + * Endpoint for sending Multi-Channel messages. |
| 40 | + * @summary Create Multi-Channel Message |
| 41 | + * @param {string} accountId Your Bandwidth Account ID. |
| 42 | + * @param {MultiChannelMessageRequest} multiChannelMessageRequest |
| 43 | + * @param {*} [options] Override http request option. |
| 44 | + * @throws {RequiredError} |
| 45 | + */ |
| 46 | + createMultiChannelMessage: async (accountId: string, multiChannelMessageRequest: MultiChannelMessageRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => { |
| 47 | + // verify required parameter 'accountId' is not null or undefined |
| 48 | + assertParamExists('createMultiChannelMessage', 'accountId', accountId) |
| 49 | + // verify required parameter 'multiChannelMessageRequest' is not null or undefined |
| 50 | + assertParamExists('createMultiChannelMessage', 'multiChannelMessageRequest', multiChannelMessageRequest) |
| 51 | + const localVarPath = `/users/{accountId}/messages/multiChannel` |
| 52 | + .replace(`{${"accountId"}}`, encodeURIComponent(String(accountId))); |
| 53 | + // use dummy base URL string because the URL constructor only accepts absolute URLs. |
| 54 | + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); |
| 55 | + let baseOptions; |
| 56 | + if (configuration) { |
| 57 | + baseOptions = configuration.baseOptions; |
| 58 | + } |
| 59 | + |
| 60 | + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; |
| 61 | + const localVarHeaderParameter = {} as any; |
| 62 | + const localVarQueryParameter = {} as any; |
| 63 | + |
| 64 | + // authentication Basic required |
| 65 | + // http basic authentication required |
| 66 | + setBasicAuthToObject(localVarRequestOptions, configuration) |
| 67 | + |
| 68 | + |
| 69 | + |
| 70 | + localVarHeaderParameter['Content-Type'] = 'application/json'; |
| 71 | + |
| 72 | + setSearchParams(localVarUrlObj, localVarQueryParameter); |
| 73 | + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; |
| 74 | + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; |
| 75 | + localVarRequestOptions.data = serializeDataIfNeeded(multiChannelMessageRequest, localVarRequestOptions, configuration) |
| 76 | + |
| 77 | + return { |
| 78 | + url: toPathString(localVarUrlObj), |
| 79 | + options: localVarRequestOptions, |
| 80 | + }; |
| 81 | + }, |
| 82 | + } |
| 83 | +}; |
| 84 | + |
| 85 | +/** |
| 86 | + * MultiChannelApi - functional programming interface |
| 87 | + * @export |
| 88 | + */ |
| 89 | +export const MultiChannelApiFp = function(configuration?: Configuration) { |
| 90 | + const localVarAxiosParamCreator = MultiChannelApiAxiosParamCreator(configuration) |
| 91 | + return { |
| 92 | + /** |
| 93 | + * Endpoint for sending Multi-Channel messages. |
| 94 | + * @summary Create Multi-Channel Message |
| 95 | + * @param {string} accountId Your Bandwidth Account ID. |
| 96 | + * @param {MultiChannelMessageRequest} multiChannelMessageRequest |
| 97 | + * @param {*} [options] Override http request option. |
| 98 | + * @throws {RequiredError} |
| 99 | + */ |
| 100 | + async createMultiChannelMessage(accountId: string, multiChannelMessageRequest: MultiChannelMessageRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateMultiChannelMessageResponse>> { |
| 101 | + const localVarAxiosArgs = await localVarAxiosParamCreator.createMultiChannelMessage(accountId, multiChannelMessageRequest, options); |
| 102 | + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; |
| 103 | + const localVarOperationServerBasePath = operationServerMap['MultiChannelApi.createMultiChannelMessage']?.[localVarOperationServerIndex]?.url; |
| 104 | + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); |
| 105 | + }, |
| 106 | + } |
| 107 | +}; |
| 108 | + |
| 109 | +/** |
| 110 | + * MultiChannelApi - factory interface |
| 111 | + * @export |
| 112 | + */ |
| 113 | +export const MultiChannelApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { |
| 114 | + const localVarFp = MultiChannelApiFp(configuration) |
| 115 | + return { |
| 116 | + /** |
| 117 | + * Endpoint for sending Multi-Channel messages. |
| 118 | + * @summary Create Multi-Channel Message |
| 119 | + * @param {string} accountId Your Bandwidth Account ID. |
| 120 | + * @param {MultiChannelMessageRequest} multiChannelMessageRequest |
| 121 | + * @param {*} [options] Override http request option. |
| 122 | + * @throws {RequiredError} |
| 123 | + */ |
| 124 | + createMultiChannelMessage(accountId: string, multiChannelMessageRequest: MultiChannelMessageRequest, options?: RawAxiosRequestConfig): AxiosPromise<CreateMultiChannelMessageResponse> { |
| 125 | + return localVarFp.createMultiChannelMessage(accountId, multiChannelMessageRequest, options).then((request) => request(axios, basePath)); |
| 126 | + }, |
| 127 | + }; |
| 128 | +}; |
| 129 | + |
| 130 | +/** |
| 131 | + * MultiChannelApi - object-oriented interface |
| 132 | + * @export |
| 133 | + * @class MultiChannelApi |
| 134 | + * @extends {BaseAPI} |
| 135 | + */ |
| 136 | +export class MultiChannelApi extends BaseAPI { |
| 137 | + /** |
| 138 | + * Endpoint for sending Multi-Channel messages. |
| 139 | + * @summary Create Multi-Channel Message |
| 140 | + * @param {string} accountId Your Bandwidth Account ID. |
| 141 | + * @param {MultiChannelMessageRequest} multiChannelMessageRequest |
| 142 | + * @param {*} [options] Override http request option. |
| 143 | + * @throws {RequiredError} |
| 144 | + * @memberof MultiChannelApi |
| 145 | + */ |
| 146 | + public createMultiChannelMessage(accountId: string, multiChannelMessageRequest: MultiChannelMessageRequest, options?: RawAxiosRequestConfig) { |
| 147 | + return MultiChannelApiFp(this.configuration).createMultiChannelMessage(accountId, multiChannelMessageRequest, options).then((request) => request(this.axios, this.basePath)); |
| 148 | + } |
| 149 | +} |
| 150 | + |
0 commit comments