/* tslint:disable */ /* eslint-disable */ /** * Emil PublicAPI * The Emil Public API description * * The version of the OpenAPI document: 1.0 * Contact: kontakt@emil.de * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; import { Configuration } from '../configuration'; // 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, RequestArgs, BaseAPI, RequiredError } from '../base'; // @ts-ignore import { GetBookingFunnelResponseClass } from '../models'; // URLSearchParams not necessarily used // @ts-ignore import { URL, URLSearchParams } from 'url'; const FormData = require('form-data'); /** * BookingFunnelsApi - axios parameter creator * @export */ export const BookingFunnelsApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * Retrieves the details of the booking funnel that was previously created. Supply the unique booking funnel code that was returned when you created it and Emil Api will return the corresponding booking funnel information. * @summary Retrieve the booking funnel * @param {string} code Unique identifier for the object. * @param {string} [authorization] Bearer Token * @param {*} [options] Override http request option. * @throws {RequiredError} */ getBookingFunnel: async (code: string, authorization?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'code' is not null or undefined assertParamExists('getBookingFunnel', 'code', code) const localVarPath = `/publicapi/v1/booking-funnels/{code}` .replace(`{${"code"}}`, encodeURIComponent(String(code))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; let baseAccessToken; if (configuration) { baseOptions = configuration.baseOptions; baseAccessToken = configuration.accessToken; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication bearer required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) { localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken); } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * BookingFunnelsApi - functional programming interface * @export */ export const BookingFunnelsApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = BookingFunnelsApiAxiosParamCreator(configuration) return { /** * Retrieves the details of the booking funnel that was previously created. Supply the unique booking funnel code that was returned when you created it and Emil Api will return the corresponding booking funnel information. * @summary Retrieve the booking funnel * @param {string} code Unique identifier for the object. * @param {string} [authorization] Bearer Token * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getBookingFunnel(code: string, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getBookingFunnel(code, authorization, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } }; /** * BookingFunnelsApi - factory interface * @export */ export const BookingFunnelsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = BookingFunnelsApiFp(configuration) return { /** * Retrieves the details of the booking funnel that was previously created. Supply the unique booking funnel code that was returned when you created it and Emil Api will return the corresponding booking funnel information. * @summary Retrieve the booking funnel * @param {string} code Unique identifier for the object. * @param {string} [authorization] Bearer Token * @param {*} [options] Override http request option. * @throws {RequiredError} */ getBookingFunnel(code: string, authorization?: string, options?: any): AxiosPromise { return localVarFp.getBookingFunnel(code, authorization, options).then((request) => request(axios, basePath)); }, }; }; /** * Request parameters for getBookingFunnel operation in BookingFunnelsApi. * @export * @interface BookingFunnelsApiGetBookingFunnelRequest */ export interface BookingFunnelsApiGetBookingFunnelRequest { /** * Unique identifier for the object. * @type {string} * @memberof BookingFunnelsApiGetBookingFunnel */ readonly code: string /** * Bearer Token * @type {string} * @memberof BookingFunnelsApiGetBookingFunnel */ readonly authorization?: string } /** * BookingFunnelsApi - object-oriented interface * @export * @class BookingFunnelsApi * @extends {BaseAPI} */ export class BookingFunnelsApi extends BaseAPI { /** * Retrieves the details of the booking funnel that was previously created. Supply the unique booking funnel code that was returned when you created it and Emil Api will return the corresponding booking funnel information. * @summary Retrieve the booking funnel * @param {BookingFunnelsApiGetBookingFunnelRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof BookingFunnelsApi */ public getBookingFunnel(requestParameters: BookingFunnelsApiGetBookingFunnelRequest, options?: AxiosRequestConfig) { return BookingFunnelsApiFp(this.configuration).getBookingFunnel(requestParameters.code, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath)); } }