Select Git revision
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
api.ts 13.45 KiB
/* tslint:disable */
/* eslint-disable */
/**
* Coscine.Api.Admin
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 3.0.2
*
*
* 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';
/**
* Retuned when searching for a project. Contains basic informations and quotas.
* @export
* @interface AdminProjectObject
*/
export interface AdminProjectObject {
/**
* Project Id
* @type {string}
* @memberof AdminProjectObject
*/
id?: string;
/**
* Project Name (full project name)
* @type {string}
* @memberof AdminProjectObject
*/
projectName?: string | null;
/**
* Project Display Name
* @type {string}
* @memberof AdminProjectObject
*/
displayName?: string | null;
/**
* List of the admin quotas (AdminQuotaReturnObject)
* @type {Array<AdminQuotaReturnObject>}
* @memberof AdminProjectObject
*/
quotas?: Array<AdminQuotaReturnObject> | null;
}
/**
* Returned when searching for a project, as part of the AdminProjectObject. Contains quota informations.
* @export
* @interface AdminQuotaReturnObject
*/
export interface AdminQuotaReturnObject {
/**
* Quota relation id (See Database, Table \'ProjectQuotas\', Column \'RelationId\').
* @type {string}
* @memberof AdminQuotaReturnObject
*/
relationId?: string;
/**
* Which resource type the quota is referring to.
* @type {string}
* @memberof AdminQuotaReturnObject
*/
resourceType?: string | null;
/**
* How much space is used by all files in all resources in total [Bytes].
* @type {QuotaDimObject}
* @memberof AdminQuotaReturnObject
*/
totalUsed?: QuotaDimObject | null;
/**
* How much space is reserved by resources in total [GiB]. Is equal to the sum of all resource quota reserved values.
* @type {QuotaDimObject}
* @memberof AdminQuotaReturnObject
*/
totalReserved?: QuotaDimObject | null;
/**
* How much space is currently allocated and is available to be taken by resources [GiB] (See Database, Table \'ProjectQuotas\', Column \'Quota\').
* @type {QuotaDimObject}
* @memberof AdminQuotaReturnObject
*/
allocated?: QuotaDimObject | null;
/**
* How much maximum space is possible to be taken by resources [GiB] (See Database, Table \'ProjectQuotas\', Column \'MaxQuota\').
* @type {QuotaDimObject}
* @memberof AdminQuotaReturnObject
*/
maximum?: QuotaDimObject | null;
}
/**
*
* @export
* @interface QuotaDimObject
*/
export interface QuotaDimObject {
/**
*
* @type {number}
* @memberof QuotaDimObject
*/
value?: number;
/**
*
* @type {QuotaUnit}
* @memberof QuotaDimObject
*/
unit?: QuotaUnit;
}
/**
*
* @export
* @enum {string}
*/
export enum QuotaUnit {
Byte = 'https://qudt.org/vocab/unit/BYTE',
KibiByte = 'https://qudt.org/vocab/unit/KibiBYTE',
MebiByte = 'https://qudt.org/vocab/unit/MebiBYTE',
GibiByte = 'https://qudt.org/vocab/unit/GibiBYTE',
TebiByte = 'https://qudt.org/vocab/unit/TebiBYTE',
PebiByte = 'https://qudt.org/vocab/unit/PebiBYTE'
}
/**
* Data send to update the project quota.
* @export
* @interface UpdateQuotaParameterObject
*/
export interface UpdateQuotaParameterObject {
/**
* The new maximum project quota value.
* @type {number}
* @memberof UpdateQuotaParameterObject
*/
maximumGiB?: number;
}
/**
* AdminApi - axios parameter creator
* @export
*/
export const AdminApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
*
* @summary Find the project related to the projectString(GUID or slug)
* @param {string} projectString The project id (GUID) or slug (from URL).
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
adminGetProject: async (projectString: string, options: any = {}): Promise<RequestArgs> => {
// verify required parameter 'projectString' is not null or undefined
assertParamExists('adminGetProject', 'projectString', projectString)
const localVarPath = `/Admin/{projectString}`
.replace(`{${"projectString"}}`, encodeURIComponent(String(projectString)));
// 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)
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 Update a project maximum and allocated quota
* @param {string} projectId Id of the project
* @param {string} resourceTypeId Id of the resource type
* @param {UpdateQuotaParameterObject} updateQuotaParameterObject JSON object for updating the project maximum and allocated quota.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
adminUpdateQuota: async (projectId: string, resourceTypeId: string, updateQuotaParameterObject: UpdateQuotaParameterObject, options: any = {}): Promise<RequestArgs> => {
// verify required parameter 'projectId' is not null or undefined
assertParamExists('adminUpdateQuota', 'projectId', projectId)
// verify required parameter 'resourceTypeId' is not null or undefined
assertParamExists('adminUpdateQuota', 'resourceTypeId', resourceTypeId)
// verify required parameter 'updateQuotaParameterObject' is not null or undefined
assertParamExists('adminUpdateQuota', 'updateQuotaParameterObject', updateQuotaParameterObject)
const localVarPath = `/Admin/{projectId}/{resourceTypeId}`
.replace(`{${"projectId"}}`, encodeURIComponent(String(projectId)))
.replace(`{${"resourceTypeId"}}`, encodeURIComponent(String(resourceTypeId)));
// 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;
// authentication JWT token required
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
localVarHeaderParameter['Content-Type'] = 'application/json';
setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(updateQuotaParameterObject, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
}
};
/**
* AdminApi - functional programming interface
* @export
*/
export const AdminApiFp = function(configuration?: Configuration) {
const localVarAxiosParamCreator = AdminApiAxiosParamCreator(configuration)
return {
/**
*
* @summary Find the project related to the projectString(GUID or slug)
* @param {string} projectString The project id (GUID) or slug (from URL).
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async adminGetProject(projectString: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AdminProjectObject>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.adminGetProject(projectString, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
*
* @summary Update a project maximum and allocated quota
* @param {string} projectId Id of the project
* @param {string} resourceTypeId Id of the resource type
* @param {UpdateQuotaParameterObject} updateQuotaParameterObject JSON object for updating the project maximum and allocated quota.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async adminUpdateQuota(projectId: string, resourceTypeId: string, updateQuotaParameterObject: UpdateQuotaParameterObject, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<any>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.adminUpdateQuota(projectId, resourceTypeId, updateQuotaParameterObject, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
}
};
/**
* AdminApi - factory interface
* @export
*/
export const AdminApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
const localVarFp = AdminApiFp(configuration)
return {
/**
*
* @summary Find the project related to the projectString(GUID or slug)
* @param {string} projectString The project id (GUID) or slug (from URL).
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
adminGetProject(projectString: string, options?: any): AxiosPromise<AdminProjectObject> {
return localVarFp.adminGetProject(projectString, options).then((request) => request(axios, basePath));
},
/**
*
* @summary Update a project maximum and allocated quota
* @param {string} projectId Id of the project
* @param {string} resourceTypeId Id of the resource type
* @param {UpdateQuotaParameterObject} updateQuotaParameterObject JSON object for updating the project maximum and allocated quota.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
adminUpdateQuota(projectId: string, resourceTypeId: string, updateQuotaParameterObject: UpdateQuotaParameterObject, options?: any): AxiosPromise<any> {
return localVarFp.adminUpdateQuota(projectId, resourceTypeId, updateQuotaParameterObject, options).then((request) => request(axios, basePath));
},
};
};
/**
* AdminApi - object-oriented interface
* @export
* @class AdminApi
* @extends {BaseAPI}
*/
export class AdminApi extends BaseAPI {
/**
*
* @summary Find the project related to the projectString(GUID or slug)
* @param {string} projectString The project id (GUID) or slug (from URL).
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AdminApi
*/
public adminGetProject(projectString: string, options?: any) {
return AdminApiFp(this.configuration).adminGetProject(projectString, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary Update a project maximum and allocated quota
* @param {string} projectId Id of the project
* @param {string} resourceTypeId Id of the resource type
* @param {UpdateQuotaParameterObject} updateQuotaParameterObject JSON object for updating the project maximum and allocated quota.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AdminApi
*/
public adminUpdateQuota(projectId: string, resourceTypeId: string, updateQuotaParameterObject: UpdateQuotaParameterObject, options?: any) {
return AdminApiFp(this.configuration).adminUpdateQuota(projectId, resourceTypeId, updateQuotaParameterObject, options).then((request) => request(this.axios, this.basePath));
}
}