/* tslint:disable */ /* eslint-disable */ /** * Credify API doc version 1 * API documentations version 1. * * The version of the OpenAPI document: 1.0.0-oas3 * Contact: dev@credify.one * * 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 { ServiceInstanceListResponse } from '../model'; /** * ServiceInstanceApi - axios parameter creator * @export */ export const ServiceInstanceApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * This returns service instance list based on market id and product type * @summary Fetch service instance list. * @param {string} marketId The market id * @param {Array} [productTypes] The list of product type. It can be `product_category` or `product_sub_category` * @param {*} [options] Override http request option. * @throws {RequiredError} */ getServiceInstanceList: async (marketId: string, productTypes?: Array, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'marketId' is not null or undefined assertParamExists('getServiceInstanceList', 'marketId', marketId) const localVarPath = `/v1/service-instances`; // 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 bearerAuth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) if (marketId !== undefined) { localVarQueryParameter['market_id'] = marketId; } if (productTypes) { localVarQueryParameter['product_types'] = productTypes; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * ServiceInstanceApi - functional programming interface * @export */ export const ServiceInstanceApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = ServiceInstanceApiAxiosParamCreator(configuration) return { /** * This returns service instance list based on market id and product type * @summary Fetch service instance list. * @param {string} marketId The market id * @param {Array} [productTypes] The list of product type. It can be `product_category` or `product_sub_category` * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getServiceInstanceList(marketId: string, productTypes?: Array, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getServiceInstanceList(marketId, productTypes, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } }; /** * ServiceInstanceApi - factory interface * @export */ export const ServiceInstanceApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = ServiceInstanceApiFp(configuration) return { /** * This returns service instance list based on market id and product type * @summary Fetch service instance list. * @param {string} marketId The market id * @param {Array} [productTypes] The list of product type. It can be `product_category` or `product_sub_category` * @param {*} [options] Override http request option. * @throws {RequiredError} */ getServiceInstanceList(marketId: string, productTypes?: Array, options?: any): AxiosPromise { return localVarFp.getServiceInstanceList(marketId, productTypes, options).then((request) => request(axios, basePath)); }, }; }; /** * ServiceInstanceApi - interface * @export * @interface ServiceInstanceApi */ export interface ServiceInstanceApiInterface { /** * This returns service instance list based on market id and product type * @summary Fetch service instance list. * @param {string} marketId The market id * @param {Array} [productTypes] The list of product type. It can be `product_category` or `product_sub_category` * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ServiceInstanceApiInterface */ getServiceInstanceList(marketId: string, productTypes?: Array, options?: AxiosRequestConfig): AxiosPromise; } /** * ServiceInstanceApi - object-oriented interface * @export * @class ServiceInstanceApi * @extends {BaseAPI} */ export class ServiceInstanceApi extends BaseAPI implements ServiceInstanceApiInterface { /** * This returns service instance list based on market id and product type * @summary Fetch service instance list. * @param {string} marketId The market id * @param {Array} [productTypes] The list of product type. It can be `product_category` or `product_sub_category` * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ServiceInstanceApi */ public getServiceInstanceList(marketId: string, productTypes?: Array, options?: AxiosRequestConfig) { return ServiceInstanceApiFp(this.configuration).getServiceInstanceList(marketId, productTypes, options).then((request) => request(this.axios, this.basePath)); } }