/* tslint:disable */ /* eslint-disable */ /** * Fasterbase * Fasterbase API description * * OpenAPI spec version: 1.0 * * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ import globalAxios, { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios'; import { Configuration } from '../configuration'; // Some imports not used depending on template conditions // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; import { CustomerModel } from '../models'; import { GetAllCustomersByOrgId } from '../models'; /** * DefaultApi - axios parameter creator * @export */ export const DefaultApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * * @param {string} orgId * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAllCustomersByOrgId: async (orgId: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'orgId' is not null or undefined if (orgId === null || orgId === undefined) { throw new RequiredError('orgId','Required parameter orgId was null or undefined when calling getAllCustomersByOrgId.'); } const localVarPath = `/link/customers/{orgId}` .replace(`{${"orgId"}}`, encodeURIComponent(String(orgId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.params) { query.set(key, options.params[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * * @param {string} orgId * @param {string} userId * @param {*} [options] Override http request option. * @throws {RequiredError} */ getCustomersById: async (orgId: string, userId: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'orgId' is not null or undefined if (orgId === null || orgId === undefined) { throw new RequiredError('orgId','Required parameter orgId was null or undefined when calling getCustomersById.'); } // verify required parameter 'userId' is not null or undefined if (userId === null || userId === undefined) { throw new RequiredError('userId','Required parameter userId was null or undefined when calling getCustomersById.'); } const localVarPath = `/link/customers/{orgId}/{userId}` .replace(`{${"orgId"}}`, encodeURIComponent(String(orgId))) .replace(`{${"userId"}}`, encodeURIComponent(String(userId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.params) { query.set(key, options.params[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ getHealth: async (options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/health`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication bearer required const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.params) { query.set(key, options.params[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ getVersion: async (options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication bearer required const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.params) { query.set(key, options.params[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, } }; /** * DefaultApi - functional programming interface * @export */ export const DefaultApiFp = function(configuration?: Configuration) { return { /** * * @param {string} orgId * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getAllCustomersByOrgId(orgId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await DefaultApiAxiosParamCreator(configuration).getAllCustomersByOrgId(orgId, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * * @param {string} orgId * @param {string} userId * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getCustomersById(orgId: string, userId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await DefaultApiAxiosParamCreator(configuration).getCustomersById(orgId, userId, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getHealth(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await DefaultApiAxiosParamCreator(configuration).getHealth(options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getVersion(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await DefaultApiAxiosParamCreator(configuration).getVersion(options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, } }; /** * DefaultApi - factory interface * @export */ export const DefaultApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { return { /** * * @param {string} orgId * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getAllCustomersByOrgId(orgId: string, options?: AxiosRequestConfig): Promise> { return DefaultApiFp(configuration).getAllCustomersByOrgId(orgId, options).then((request) => request(axios, basePath)); }, /** * * @param {string} orgId * @param {string} userId * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getCustomersById(orgId: string, userId: string, options?: AxiosRequestConfig): Promise> { return DefaultApiFp(configuration).getCustomersById(orgId, userId, options).then((request) => request(axios, basePath)); }, /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getHealth(options?: AxiosRequestConfig): Promise> { return DefaultApiFp(configuration).getHealth(options).then((request) => request(axios, basePath)); }, /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getVersion(options?: AxiosRequestConfig): Promise> { return DefaultApiFp(configuration).getVersion(options).then((request) => request(axios, basePath)); }, }; }; /** * DefaultApi - object-oriented interface * @export * @class DefaultApi * @extends {BaseAPI} */ export class DefaultApi extends BaseAPI { /** * * @param {string} orgId * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof DefaultApi */ public async getAllCustomersByOrgId(orgId: string, options?: AxiosRequestConfig) : Promise> { return DefaultApiFp(this.configuration).getAllCustomersByOrgId(orgId, options).then((request) => request(this.axios, this.basePath)); } /** * * @param {string} orgId * @param {string} userId * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof DefaultApi */ public async getCustomersById(orgId: string, userId: string, options?: AxiosRequestConfig) : Promise> { return DefaultApiFp(this.configuration).getCustomersById(orgId, userId, options).then((request) => request(this.axios, this.basePath)); } /** * * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof DefaultApi */ public async getHealth(options?: AxiosRequestConfig) : Promise> { return DefaultApiFp(this.configuration).getHealth(options).then((request) => request(this.axios, this.basePath)); } /** * * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof DefaultApi */ public async getVersion(options?: AxiosRequestConfig) : Promise> { return DefaultApiFp(this.configuration).getVersion(options).then((request) => request(this.axios, this.basePath)); } }