/* tslint:disable */ /* eslint-disable */ /** * 统一管理平台API文档 * 包含模块:会员、账号、商品、支付、咨询、营销 * * OpenAPI spec version: 2.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, { AxiosPromise, AxiosInstance } 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 { ResponseResult } from '../models'; /** * QiNiuOosControllerApi - axios parameter creator * @export */ export const QiNiuOosControllerApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * * @param {string} fileKey * @param {*} [options] Override http request option. * @throws {RequiredError} */ generateUploadToken: async (fileKey: string, options: any = {}): Promise => { // verify required parameter 'fileKey' is not null or undefined if (fileKey === null || fileKey === undefined) { throw new RequiredError('fileKey','Required parameter fileKey was null or undefined when calling generateUploadToken.'); } const localVarPath = `/qiniu/oos/uploadToken/{fileKey}` .replace(`{${"fileKey"}}`, encodeURIComponent(String(fileKey))); // 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 = { method: 'POST', ...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.query) { query.set(key, options.query[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, }; }, } }; /** * QiNiuOosControllerApi - functional programming interface * @export */ export const QiNiuOosControllerApiFp = function(configuration?: Configuration) { return { /** * * @param {string} fileKey * @param {*} [options] Override http request option. * @throws {RequiredError} */ async generateUploadToken(fileKey: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await QiNiuOosControllerApiAxiosParamCreator(configuration).generateUploadToken(fileKey, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, } }; /** * QiNiuOosControllerApi - factory interface * @export */ export const QiNiuOosControllerApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { return { /** * * @param {string} fileKey * @param {*} [options] Override http request option. * @throws {RequiredError} */ generateUploadToken(fileKey: string, options?: any): AxiosPromise { return QiNiuOosControllerApiFp(configuration).generateUploadToken(fileKey, options).then((request) => request(axios, basePath)); }, }; }; /** * QiNiuOosControllerApi - object-oriented interface * @export * @class QiNiuOosControllerApi * @extends {BaseAPI} */ export class QiNiuOosControllerApi extends BaseAPI { /** * * @param {string} fileKey * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof QiNiuOosControllerApi */ public generateUploadToken(fileKey: string, options?: any) { return QiNiuOosControllerApiFp(this.configuration).generateUploadToken(fileKey, options).then((request) => request(this.axios, this.basePath)); } }