Select Git revision

Petar Hristov authored and
Sirieam Marie Hunke
committed
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
api.ts 13.38 KiB
/* tslint:disable */
/* eslint-disable */
/**
* Coscine.Api.Blob
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 3.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { Configuration } from './configuration';
import globalAxios, { AxiosPromise, AxiosInstance } from 'axios';
// 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';
/**
* BlobApi - axios parameter creator
* @export
*/
export const BlobApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
*
* @summary This method deletes a given file
* @param {string} resourceId Id of the resource
* @param {string} [path] Path to the file
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
blobDeleteFileWithParameter: async (resourceId: string, path?: string, options: any = {}): Promise<RequestArgs> => {
// verify required parameter 'resourceId' is not null or undefined
assertParamExists('blobDeleteFileWithParameter', 'resourceId', resourceId)
const localVarPath = `/Blob/{resourceId}`
.replace(`{${"resourceId"}}`, encodeURIComponent(String(resourceId)));
// 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: 'DELETE', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication JWT token required
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
if (path !== undefined) {
localVarQueryParameter['path'] = path;
}
setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @summary This method checks if the given file exists and returns it
* @param {string} resourceId Id of the resource
* @param {string} [path] Path to the file
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
blobGetFileWithParameter: async (resourceId: string, path?: string, options: any = {}): Promise<RequestArgs> => {
// verify required parameter 'resourceId' is not null or undefined
assertParamExists('blobGetFileWithParameter', 'resourceId', resourceId)
const localVarPath = `/Blob/{resourceId}`
.replace(`{${"resourceId"}}`, encodeURIComponent(String(resourceId)));
// 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 JWT token required
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
if (path !== undefined) {
localVarQueryParameter['path'] = path;
}
setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @summary This method uploads a given File
* @param {string} resourceId Id of the resource
* @param {string} [path] Path to the file
* @param {Array<any>} [files]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
blobUploadFileWithParameter: async (resourceId: string, path?: string, files?: Array<any>, options: any = {}): Promise<RequestArgs> => {
// verify required parameter 'resourceId' is not null or undefined
assertParamExists('blobUploadFileWithParameter', 'resourceId', resourceId)
const localVarPath = `/Blob/{resourceId}`
.replace(`{${"resourceId"}}`, encodeURIComponent(String(resourceId)));
// 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: 'PUT', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)();
// authentication JWT token required
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
if (path !== undefined) {
localVarQueryParameter['path'] = path;
}
if (files) {
files.forEach((element) => {
localVarFormParams.append('files', element as any);
})
}
localVarHeaderParameter['Content-Type'] = 'multipart/form-data';
setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = localVarFormParams;
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
}
};
/**
* BlobApi - functional programming interface
* @export
*/
export const BlobApiFp = function(configuration?: Configuration) {
const localVarAxiosParamCreator = BlobApiAxiosParamCreator(configuration)
return {
/**
*
* @summary This method deletes a given file
* @param {string} resourceId Id of the resource
* @param {string} [path] Path to the file
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async blobDeleteFileWithParameter(resourceId: string, path?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<any>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.blobDeleteFileWithParameter(resourceId, path, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
*
* @summary This method checks if the given file exists and returns it
* @param {string} resourceId Id of the resource
* @param {string} [path] Path to the file
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async blobGetFileWithParameter(resourceId: string, path?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<any>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.blobGetFileWithParameter(resourceId, path, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
*
* @summary This method uploads a given File
* @param {string} resourceId Id of the resource
* @param {string} [path] Path to the file
* @param {Array<any>} [files]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async blobUploadFileWithParameter(resourceId: string, path?: string, files?: Array<any>, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<any>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.blobUploadFileWithParameter(resourceId, path, files, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
}
};
/**
* BlobApi - factory interface
* @export
*/
export const BlobApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
const localVarFp = BlobApiFp(configuration)
return {
/**
*
* @summary This method deletes a given file
* @param {string} resourceId Id of the resource
* @param {string} [path] Path to the file
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
blobDeleteFileWithParameter(resourceId: string, path?: string, options?: any): AxiosPromise<any> {
return localVarFp.blobDeleteFileWithParameter(resourceId, path, options).then((request) => request(axios, basePath));
},
/**
*
* @summary This method checks if the given file exists and returns it
* @param {string} resourceId Id of the resource
* @param {string} [path] Path to the file
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
blobGetFileWithParameter(resourceId: string, path?: string, options?: any): AxiosPromise<any> {
return localVarFp.blobGetFileWithParameter(resourceId, path, options).then((request) => request(axios, basePath));
},
/**
*
* @summary This method uploads a given File
* @param {string} resourceId Id of the resource
* @param {string} [path] Path to the file
* @param {Array<any>} [files]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
blobUploadFileWithParameter(resourceId: string, path?: string, files?: Array<any>, options?: any): AxiosPromise<any> {
return localVarFp.blobUploadFileWithParameter(resourceId, path, files, options).then((request) => request(axios, basePath));
},
};
};
/**
* BlobApi - object-oriented interface
* @export
* @class BlobApi
* @extends {BaseAPI}
*/
export class BlobApi extends BaseAPI {
/**
*
* @summary This method deletes a given file
* @param {string} resourceId Id of the resource
* @param {string} [path] Path to the file
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof BlobApi
*/
public blobDeleteFileWithParameter(resourceId: string, path?: string, options?: any) {
return BlobApiFp(this.configuration).blobDeleteFileWithParameter(resourceId, path, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary This method checks if the given file exists and returns it
* @param {string} resourceId Id of the resource
* @param {string} [path] Path to the file
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof BlobApi
*/
public blobGetFileWithParameter(resourceId: string, path?: string, options?: any) {
return BlobApiFp(this.configuration).blobGetFileWithParameter(resourceId, path, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary This method uploads a given File
* @param {string} resourceId Id of the resource
* @param {string} [path] Path to the file
* @param {Array<any>} [files]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof BlobApi
*/
public blobUploadFileWithParameter(resourceId: string, path?: string, files?: Array<any>, options?: any) {
return BlobApiFp(this.configuration).blobUploadFileWithParameter(resourceId, path, files, options).then((request) => request(this.axios, this.basePath));
}
}