From 30043e4a53bf3c52debeb21c8d05218ed55a11e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hanna=20F=C3=BChr?= <fuehr@itc.rwth-aachen.de> Date: Tue, 21 Feb 2023 15:44:42 +0100 Subject: [PATCH] Update: Resources API --- src/Coscine.Api.Resources/api.ts | 96 +++++++++++++++++++--- src/Coscine.Api.Resources/base.ts | 4 +- src/Coscine.Api.Resources/common.ts | 2 +- src/Coscine.Api.Resources/configuration.ts | 2 +- src/Coscine.Api.Resources/index.ts | 2 +- 5 files changed, 88 insertions(+), 18 deletions(-) diff --git a/src/Coscine.Api.Resources/api.ts b/src/Coscine.Api.Resources/api.ts index 09f7319..991a581 100644 --- a/src/Coscine.Api.Resources/api.ts +++ b/src/Coscine.Api.Resources/api.ts @@ -4,7 +4,7 @@ * Coscine.Api.Resources * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 3.1.1 + * The version of the OpenAPI document: 3.4.4 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -1935,7 +1935,7 @@ export const ResourceQuotaApiAxiosParamCreator = function (configuration?: Confi return { /** * - * @summary Retrieves the resource quota for an individual resource. + * @summary Retrieves the resource used and reserved quota for an individual resource. * @param {string} id Id of the resource. * @param {*} [options] Override http request option. * @throws {RequiredError} @@ -2025,7 +2025,7 @@ export const ResourceQuotaApiFp = function(configuration?: Configuration) { return { /** * - * @summary Retrieves the resource quota for an individual resource. + * @summary Retrieves the resource used and reserved quota for an individual resource. * @param {string} id Id of the resource. * @param {*} [options] Override http request option. * @throws {RequiredError} @@ -2058,7 +2058,7 @@ export const ResourceQuotaApiFactory = function (configuration?: Configuration, return { /** * - * @summary Retrieves the resource quota for an individual resource. + * @summary Retrieves the resource used and reserved quota for an individual resource. * @param {string} id Id of the resource. * @param {*} [options] Override http request option. * @throws {RequiredError} @@ -2089,7 +2089,7 @@ export const ResourceQuotaApiFactory = function (configuration?: Configuration, export class ResourceQuotaApi extends BaseAPI { /** * - * @summary Retrieves the resource quota for an individual resource. + * @summary Retrieves the resource used and reserved quota for an individual resource. * @param {string} id Id of the resource. * @param {*} [options] Override http request option. * @throws {RequiredError} @@ -2144,6 +2144,43 @@ export const ResourceTypeApiAxiosParamCreator = function (configuration?: Config + 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 Returns all enabled resource types according to user\'s affiliation and allocated quota in the project. + * @param {string} id Id of the project + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + resourceTypeGetEnabledResourceTypesAll: async (id: string, options: any = {}): Promise<RequestArgs> => { + // verify required parameter 'id' is not null or undefined + assertParamExists('resourceTypeGetEnabledResourceTypesAll', 'id', id) + const localVarPath = `/ResourceType/types/{id}/-/enabled` + .replace(`{${"id"}}`, encodeURIComponent(String(id))); + // 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}; @@ -2156,7 +2193,7 @@ export const ResourceTypeApiAxiosParamCreator = function (configuration?: Config /** * * @summary Returns all fields of the specified resource type. - * @param {string} id A guid as a string that identifies the resource. + * @param {string} id A GUID as a string that identifies the resource. * @param {*} [options] Override http request option. * @throws {RequiredError} */ @@ -2192,7 +2229,7 @@ export const ResourceTypeApiAxiosParamCreator = function (configuration?: Config }, /** * - * @summary Returns all resource types. + * @summary Returns all resource types. Both hidden and active, regardless of user affiliation or quota. * @param {*} [options] Override http request option. * @throws {RequiredError} */ @@ -2243,10 +2280,21 @@ export const ResourceTypeApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.resourceTypeGetEnabledResourceTypes(options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * + * @summary Returns all enabled resource types according to user\'s affiliation and allocated quota in the project. + * @param {string} id Id of the project + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async resourceTypeGetEnabledResourceTypesAll(id: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<ResourceTypeInformation>>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.resourceTypeGetEnabledResourceTypesAll(id, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, /** * * @summary Returns all fields of the specified resource type. - * @param {string} id A guid as a string that identifies the resource. + * @param {string} id A GUID as a string that identifies the resource. * @param {*} [options] Override http request option. * @throws {RequiredError} */ @@ -2256,7 +2304,7 @@ export const ResourceTypeApiFp = function(configuration?: Configuration) { }, /** * - * @summary Returns all resource types. + * @summary Returns all resource types. Both hidden and active, regardless of user affiliation or quota. * @param {*} [options] Override http request option. * @throws {RequiredError} */ @@ -2283,10 +2331,20 @@ export const ResourceTypeApiFactory = function (configuration?: Configuration, b resourceTypeGetEnabledResourceTypes(options?: any): AxiosPromise<Array<ResourceTypeInformation>> { return localVarFp.resourceTypeGetEnabledResourceTypes(options).then((request) => request(axios, basePath)); }, + /** + * + * @summary Returns all enabled resource types according to user\'s affiliation and allocated quota in the project. + * @param {string} id Id of the project + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + resourceTypeGetEnabledResourceTypesAll(id: string, options?: any): AxiosPromise<Array<ResourceTypeInformation>> { + return localVarFp.resourceTypeGetEnabledResourceTypesAll(id, options).then((request) => request(axios, basePath)); + }, /** * * @summary Returns all fields of the specified resource type. - * @param {string} id A guid as a string that identifies the resource. + * @param {string} id A GUID as a string that identifies the resource. * @param {*} [options] Override http request option. * @throws {RequiredError} */ @@ -2295,7 +2353,7 @@ export const ResourceTypeApiFactory = function (configuration?: Configuration, b }, /** * - * @summary Returns all resource types. + * @summary Returns all resource types. Both hidden and active, regardless of user affiliation or quota. * @param {*} [options] Override http request option. * @throws {RequiredError} */ @@ -2323,10 +2381,22 @@ export class ResourceTypeApi extends BaseAPI { return ResourceTypeApiFp(this.configuration).resourceTypeGetEnabledResourceTypes(options).then((request) => request(this.axios, this.basePath)); } + /** + * + * @summary Returns all enabled resource types according to user\'s affiliation and allocated quota in the project. + * @param {string} id Id of the project + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ResourceTypeApi + */ + public resourceTypeGetEnabledResourceTypesAll(id: string, options?: any) { + return ResourceTypeApiFp(this.configuration).resourceTypeGetEnabledResourceTypesAll(id, options).then((request) => request(this.axios, this.basePath)); + } + /** * * @summary Returns all fields of the specified resource type. - * @param {string} id A guid as a string that identifies the resource. + * @param {string} id A GUID as a string that identifies the resource. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ResourceTypeApi @@ -2337,7 +2407,7 @@ export class ResourceTypeApi extends BaseAPI { /** * - * @summary Returns all resource types. + * @summary Returns all resource types. Both hidden and active, regardless of user affiliation or quota. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ResourceTypeApi diff --git a/src/Coscine.Api.Resources/base.ts b/src/Coscine.Api.Resources/base.ts index 0c0baa5..3347a04 100644 --- a/src/Coscine.Api.Resources/base.ts +++ b/src/Coscine.Api.Resources/base.ts @@ -4,7 +4,7 @@ * Coscine.Api.Resources * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 3.1.1 + * The version of the OpenAPI document: 3.4.4 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,7 +18,7 @@ import { Configuration } from "./configuration"; // @ts-ignore import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; -export const BASE_PATH = "https://d-sp16.devlef.campus.rwth-aachen.de/coscine/api/Coscine.Api.Resources".replace(/\/+$/, ""); +export const BASE_PATH = "https://d-sp25.devlef.campus.rwth-aachen.de/coscine/api/Coscine.Api.Resources".replace(/\/+$/, ""); /** * diff --git a/src/Coscine.Api.Resources/common.ts b/src/Coscine.Api.Resources/common.ts index 16d97da..52ec8e9 100644 --- a/src/Coscine.Api.Resources/common.ts +++ b/src/Coscine.Api.Resources/common.ts @@ -4,7 +4,7 @@ * Coscine.Api.Resources * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 3.1.1 + * The version of the OpenAPI document: 3.4.4 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/Coscine.Api.Resources/configuration.ts b/src/Coscine.Api.Resources/configuration.ts index ed03006..e4b67aa 100644 --- a/src/Coscine.Api.Resources/configuration.ts +++ b/src/Coscine.Api.Resources/configuration.ts @@ -4,7 +4,7 @@ * Coscine.Api.Resources * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 3.1.1 + * The version of the OpenAPI document: 3.4.4 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/Coscine.Api.Resources/index.ts b/src/Coscine.Api.Resources/index.ts index 0334aa9..d717756 100644 --- a/src/Coscine.Api.Resources/index.ts +++ b/src/Coscine.Api.Resources/index.ts @@ -4,7 +4,7 @@ * Coscine.Api.Resources * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 3.1.1 + * The version of the OpenAPI document: 3.4.4 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -- GitLab