UNPKG

@circle-fin/circle-sdk

Version:
171 lines (162 loc) 4.65 kB
/* tslint:disable */ /* eslint-disable */ /** * 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, setBearerAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from "../common"; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from "../base"; // @ts-ignore import { ListChannelsResponse } from "../models"; // @ts-ignore import { NotAuthorized } from "../models"; /** * ChannelsApi - axios parameter creator * @export */ export const ChannelsApiAxiosParamCreator = function ( configuration?: Configuration ) { return { /** * Retrieve a list of channels with details (e.g. `cardDescriptor`, `achDescriptor`, etc.). * @summary List all channels * @param {*} [options] Override http request option. * @throws {RequiredError} */ listChannels: async ( options: AxiosRequestConfig = {} ): Promise<RequestArgs> => { const localVarPath = `/v1/channels`; // 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); setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions }; } }; }; /** * ChannelsApi - functional programming interface * @export */ export const ChannelsApiFp = function (configuration?: Configuration) { const localVarAxiosParamCreator = ChannelsApiAxiosParamCreator(configuration); return { /** * Retrieve a list of channels with details (e.g. `cardDescriptor`, `achDescriptor`, etc.). * @summary List all channels * @param {*} [options] Override http request option. * @throws {RequiredError} */ async listChannels( options?: AxiosRequestConfig ): Promise< ( axios?: AxiosInstance, basePath?: string ) => AxiosPromise<ListChannelsResponse> > { const localVarAxiosArgs = await localVarAxiosParamCreator.listChannels( options ); return createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration ); } }; }; /** * ChannelsApi - factory interface * @export */ export const ChannelsApiFactory = function ( configuration?: Configuration, basePath?: string, axios?: AxiosInstance ) { const localVarFp = ChannelsApiFp(configuration); return { /** * Retrieve a list of channels with details (e.g. `cardDescriptor`, `achDescriptor`, etc.). * @summary List all channels * @param {*} [options] Override http request option. * @throws {RequiredError} */ listChannels(options?: any): AxiosPromise<ListChannelsResponse> { return localVarFp .listChannels(options) .then((request) => request(axios, basePath)); } }; }; /** * ChannelsApi - object-oriented interface * @export * @class ChannelsApi * @extends {BaseAPI} */ export class ChannelsApi extends BaseAPI { /** * Retrieve a list of channels with details (e.g. `cardDescriptor`, `achDescriptor`, etc.). * @summary List all channels * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ChannelsApi */ public listChannels(options?: AxiosRequestConfig) { return ChannelsApiFp(this.configuration) .listChannels(options) .then((request) => request(this.axios, this.basePath)); } }