diff --git a/src/Coscine.Api.Project/api.ts b/src/Coscine.Api.Project/api.ts index b639c6ef159cade465f1763b32e384538d2f397b..67090821a45f82663bdec6940c7eb467916c6e50 100644 --- a/src/Coscine.Api.Project/api.ts +++ b/src/Coscine.Api.Project/api.ts @@ -2298,6 +2298,43 @@ export const ProjectApiAxiosParamCreator = function (configuration?: Configurati + 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 returns the project if the user has access to it + * @param {string} slug Slug of the project + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + projectGetBySlug: async (slug: string, options: any = {}): Promise<RequestArgs> => { + // verify required parameter 'slug' is not null or undefined + assertParamExists('projectGetBySlug', 'slug', slug) + const localVarPath = `/Project/slug/{slug}` + .replace(`{${"slug"}}`, encodeURIComponent(String(slug))); + // 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}; @@ -2310,18 +2347,18 @@ export const ProjectApiAxiosParamCreator = function (configuration?: Configurati /** * * @summary Get the max quota for a resource type. - * @param {string} projectId Id of the project. + * @param {string} id Id of the project. * @param {string} resourceTypeId Id of the resource * @param {*} [options] Override http request option. * @throws {RequiredError} */ - projectGetQuotaMax: async (projectId: string, resourceTypeId: string, options: any = {}): Promise<RequestArgs> => { - // verify required parameter 'projectId' is not null or undefined - assertParamExists('projectGetQuotaMax', 'projectId', projectId) + projectGetQuotaMax: async (id: string, resourceTypeId: string, options: any = {}): Promise<RequestArgs> => { + // verify required parameter 'id' is not null or undefined + assertParamExists('projectGetQuotaMax', 'id', id) // verify required parameter 'resourceTypeId' is not null or undefined assertParamExists('projectGetQuotaMax', 'resourceTypeId', resourceTypeId) - const localVarPath = `/Project/{projectId}/quota/{resourceTypeId}/max` - .replace(`{${"projectId"}}`, encodeURIComponent(String(projectId))) + const localVarPath = `/Project/{id}/quota/{resourceTypeId}/max` + .replace(`{${"id"}}`, encodeURIComponent(String(id))) .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); @@ -2351,7 +2388,7 @@ export const ProjectApiAxiosParamCreator = function (configuration?: Configurati /** * * @summary Gets the resources - * @param {string} id Id of the resource + * @param {string} id Id of the project * @param {*} [options] Override http request option. * @throws {RequiredError} */ @@ -2454,7 +2491,7 @@ export const ProjectApiAxiosParamCreator = function (configuration?: Configurati /** * * @summary List all invitations of a project. - * @param {string} projectId Project id of the project + * @param {string} projectId Id of the project * @param {*} [options] Override http request option. * @throws {RequiredError} */ @@ -2491,18 +2528,18 @@ export const ProjectApiAxiosParamCreator = function (configuration?: Configurati /** * * @summary Retrieves the quota for the selected project and resource Type. - * @param {string} projectId Id of the project + * @param {string} id Id of the project * @param {string} resourceTypeId Id of the resource type * @param {*} [options] Override http request option. * @throws {RequiredError} */ - projectQuota: async (projectId: string, resourceTypeId: string, options: any = {}): Promise<RequestArgs> => { - // verify required parameter 'projectId' is not null or undefined - assertParamExists('projectQuota', 'projectId', projectId) + projectQuota: async (id: string, resourceTypeId: string, options: any = {}): Promise<RequestArgs> => { + // verify required parameter 'id' is not null or undefined + assertParamExists('projectQuota', 'id', id) // verify required parameter 'resourceTypeId' is not null or undefined assertParamExists('projectQuota', 'resourceTypeId', resourceTypeId) - const localVarPath = `/Project/{projectId}/quota/{resourceTypeId}` - .replace(`{${"projectId"}}`, encodeURIComponent(String(projectId))) + const localVarPath = `/Project/{id}/quota/{resourceTypeId}` + .replace(`{${"id"}}`, encodeURIComponent(String(id))) .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); @@ -2532,15 +2569,15 @@ export const ProjectApiAxiosParamCreator = function (configuration?: Configurati /** * * @summary Retrieves the quota for the selected project. - * @param {string} projectId Id of the project. + * @param {string} id Id of the project * @param {*} [options] Override http request option. * @throws {RequiredError} */ - projectQuotas: async (projectId: string, options: any = {}): Promise<RequestArgs> => { - // verify required parameter 'projectId' is not null or undefined - assertParamExists('projectQuotas', 'projectId', projectId) - const localVarPath = `/Project/{projectId}/quota/-/all` - .replace(`{${"projectId"}}`, encodeURIComponent(String(projectId))); + projectQuotas: async (id: string, options: any = {}): Promise<RequestArgs> => { + // verify required parameter 'id' is not null or undefined + assertParamExists('projectQuotas', 'id', id) + const localVarPath = `/Project/{id}/quota/-/all` + .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; @@ -2715,21 +2752,21 @@ export const ProjectApiAxiosParamCreator = function (configuration?: Configurati /** * * @summary Update the project quota. - * @param {string} projectId Id of the project. + * @param {string} id Id of the project. * @param {string} resourceTypeId Id of the resource. * @param {UpdateProjectQuotaObject} updateProjectQuotaObject Object containing the update values. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - projectUpdateQuota: async (projectId: string, resourceTypeId: string, updateProjectQuotaObject: UpdateProjectQuotaObject, options: any = {}): Promise<RequestArgs> => { - // verify required parameter 'projectId' is not null or undefined - assertParamExists('projectUpdateQuota', 'projectId', projectId) + projectUpdateQuota: async (id: string, resourceTypeId: string, updateProjectQuotaObject: UpdateProjectQuotaObject, options: any = {}): Promise<RequestArgs> => { + // verify required parameter 'id' is not null or undefined + assertParamExists('projectUpdateQuota', 'id', id) // verify required parameter 'resourceTypeId' is not null or undefined assertParamExists('projectUpdateQuota', 'resourceTypeId', resourceTypeId) // verify required parameter 'updateProjectQuotaObject' is not null or undefined assertParamExists('projectUpdateQuota', 'updateProjectQuotaObject', updateProjectQuotaObject) - const localVarPath = `/Project/{projectId}/quota/{resourceTypeId}` - .replace(`{${"projectId"}}`, encodeURIComponent(String(projectId))) + const localVarPath = `/Project/{id}/quota/{resourceTypeId}` + .replace(`{${"id"}}`, encodeURIComponent(String(id))) .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); @@ -2802,22 +2839,33 @@ export const ProjectApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.projectGet(id, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * + * @summary This returns the project if the user has access to it + * @param {string} slug Slug of the project + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async projectGetBySlug(slug: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ProjectObject>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.projectGetBySlug(slug, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, /** * * @summary Get the max quota for a resource type. - * @param {string} projectId Id of the project. + * @param {string} id Id of the project. * @param {string} resourceTypeId Id of the resource * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async projectGetQuotaMax(projectId: string, resourceTypeId: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<MaxProjectQuota>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.projectGetQuotaMax(projectId, resourceTypeId, options); + async projectGetQuotaMax(id: string, resourceTypeId: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<MaxProjectQuota>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.projectGetQuotaMax(id, resourceTypeId, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * * @summary Gets the resources - * @param {string} id Id of the resource + * @param {string} id Id of the project * @param {*} [options] Override http request option. * @throws {RequiredError} */ @@ -2848,7 +2896,7 @@ export const ProjectApiFp = function(configuration?: Configuration) { /** * * @summary List all invitations of a project. - * @param {string} projectId Project id of the project + * @param {string} projectId Id of the project * @param {*} [options] Override http request option. * @throws {RequiredError} */ @@ -2859,24 +2907,24 @@ export const ProjectApiFp = function(configuration?: Configuration) { /** * * @summary Retrieves the quota for the selected project and resource Type. - * @param {string} projectId Id of the project + * @param {string} id Id of the project * @param {string} resourceTypeId Id of the resource type * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async projectQuota(projectId: string, resourceTypeId: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ProjectQuotaReturnObject>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.projectQuota(projectId, resourceTypeId, options); + async projectQuota(id: string, resourceTypeId: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ProjectQuotaReturnObject>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.projectQuota(id, resourceTypeId, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * * @summary Retrieves the quota for the selected project. - * @param {string} projectId Id of the project. + * @param {string} id Id of the project * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async projectQuotas(projectId: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<ProjectQuota>>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.projectQuotas(projectId, options); + async projectQuotas(id: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<ProjectQuota>>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.projectQuotas(id, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -2925,14 +2973,14 @@ export const ProjectApiFp = function(configuration?: Configuration) { /** * * @summary Update the project quota. - * @param {string} projectId Id of the project. + * @param {string} id Id of the project. * @param {string} resourceTypeId Id of the resource. * @param {UpdateProjectQuotaObject} updateProjectQuotaObject Object containing the update values. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async projectUpdateQuota(projectId: string, resourceTypeId: string, updateProjectQuotaObject: UpdateProjectQuotaObject, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<any>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.projectUpdateQuota(projectId, resourceTypeId, updateProjectQuotaObject, options); + async projectUpdateQuota(id: string, resourceTypeId: string, updateProjectQuotaObject: UpdateProjectQuotaObject, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<any>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.projectUpdateQuota(id, resourceTypeId, updateProjectQuotaObject, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } @@ -2975,21 +3023,31 @@ export const ProjectApiFactory = function (configuration?: Configuration, basePa projectGet(id: string, options?: any): AxiosPromise<ProjectObject> { return localVarFp.projectGet(id, options).then((request) => request(axios, basePath)); }, + /** + * + * @summary This returns the project if the user has access to it + * @param {string} slug Slug of the project + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + projectGetBySlug(slug: string, options?: any): AxiosPromise<ProjectObject> { + return localVarFp.projectGetBySlug(slug, options).then((request) => request(axios, basePath)); + }, /** * * @summary Get the max quota for a resource type. - * @param {string} projectId Id of the project. + * @param {string} id Id of the project. * @param {string} resourceTypeId Id of the resource * @param {*} [options] Override http request option. * @throws {RequiredError} */ - projectGetQuotaMax(projectId: string, resourceTypeId: string, options?: any): AxiosPromise<MaxProjectQuota> { - return localVarFp.projectGetQuotaMax(projectId, resourceTypeId, options).then((request) => request(axios, basePath)); + projectGetQuotaMax(id: string, resourceTypeId: string, options?: any): AxiosPromise<MaxProjectQuota> { + return localVarFp.projectGetQuotaMax(id, resourceTypeId, options).then((request) => request(axios, basePath)); }, /** * * @summary Gets the resources - * @param {string} id Id of the resource + * @param {string} id Id of the project * @param {*} [options] Override http request option. * @throws {RequiredError} */ @@ -3017,7 +3075,7 @@ export const ProjectApiFactory = function (configuration?: Configuration, basePa /** * * @summary List all invitations of a project. - * @param {string} projectId Project id of the project + * @param {string} projectId Id of the project * @param {*} [options] Override http request option. * @throws {RequiredError} */ @@ -3027,23 +3085,23 @@ export const ProjectApiFactory = function (configuration?: Configuration, basePa /** * * @summary Retrieves the quota for the selected project and resource Type. - * @param {string} projectId Id of the project + * @param {string} id Id of the project * @param {string} resourceTypeId Id of the resource type * @param {*} [options] Override http request option. * @throws {RequiredError} */ - projectQuota(projectId: string, resourceTypeId: string, options?: any): AxiosPromise<ProjectQuotaReturnObject> { - return localVarFp.projectQuota(projectId, resourceTypeId, options).then((request) => request(axios, basePath)); + projectQuota(id: string, resourceTypeId: string, options?: any): AxiosPromise<ProjectQuotaReturnObject> { + return localVarFp.projectQuota(id, resourceTypeId, options).then((request) => request(axios, basePath)); }, /** * * @summary Retrieves the quota for the selected project. - * @param {string} projectId Id of the project. + * @param {string} id Id of the project * @param {*} [options] Override http request option. * @throws {RequiredError} */ - projectQuotas(projectId: string, options?: any): AxiosPromise<Array<ProjectQuota>> { - return localVarFp.projectQuotas(projectId, options).then((request) => request(axios, basePath)); + projectQuotas(id: string, options?: any): AxiosPromise<Array<ProjectQuota>> { + return localVarFp.projectQuotas(id, options).then((request) => request(axios, basePath)); }, /** * @@ -3087,14 +3145,14 @@ export const ProjectApiFactory = function (configuration?: Configuration, basePa /** * * @summary Update the project quota. - * @param {string} projectId Id of the project. + * @param {string} id Id of the project. * @param {string} resourceTypeId Id of the resource. * @param {UpdateProjectQuotaObject} updateProjectQuotaObject Object containing the update values. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - projectUpdateQuota(projectId: string, resourceTypeId: string, updateProjectQuotaObject: UpdateProjectQuotaObject, options?: any): AxiosPromise<any> { - return localVarFp.projectUpdateQuota(projectId, resourceTypeId, updateProjectQuotaObject, options).then((request) => request(axios, basePath)); + projectUpdateQuota(id: string, resourceTypeId: string, updateProjectQuotaObject: UpdateProjectQuotaObject, options?: any): AxiosPromise<any> { + return localVarFp.projectUpdateQuota(id, resourceTypeId, updateProjectQuotaObject, options).then((request) => request(axios, basePath)); }, }; }; @@ -3142,23 +3200,35 @@ export class ProjectApi extends BaseAPI { return ProjectApiFp(this.configuration).projectGet(id, options).then((request) => request(this.axios, this.basePath)); } + /** + * + * @summary This returns the project if the user has access to it + * @param {string} slug Slug of the project + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ProjectApi + */ + public projectGetBySlug(slug: string, options?: any) { + return ProjectApiFp(this.configuration).projectGetBySlug(slug, options).then((request) => request(this.axios, this.basePath)); + } + /** * * @summary Get the max quota for a resource type. - * @param {string} projectId Id of the project. + * @param {string} id Id of the project. * @param {string} resourceTypeId Id of the resource * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ProjectApi */ - public projectGetQuotaMax(projectId: string, resourceTypeId: string, options?: any) { - return ProjectApiFp(this.configuration).projectGetQuotaMax(projectId, resourceTypeId, options).then((request) => request(this.axios, this.basePath)); + public projectGetQuotaMax(id: string, resourceTypeId: string, options?: any) { + return ProjectApiFp(this.configuration).projectGetQuotaMax(id, resourceTypeId, options).then((request) => request(this.axios, this.basePath)); } /** * * @summary Gets the resources - * @param {string} id Id of the resource + * @param {string} id Id of the project * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ProjectApi @@ -3192,7 +3262,7 @@ export class ProjectApi extends BaseAPI { /** * * @summary List all invitations of a project. - * @param {string} projectId Project id of the project + * @param {string} projectId Id of the project * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ProjectApi @@ -3204,26 +3274,26 @@ export class ProjectApi extends BaseAPI { /** * * @summary Retrieves the quota for the selected project and resource Type. - * @param {string} projectId Id of the project + * @param {string} id Id of the project * @param {string} resourceTypeId Id of the resource type * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ProjectApi */ - public projectQuota(projectId: string, resourceTypeId: string, options?: any) { - return ProjectApiFp(this.configuration).projectQuota(projectId, resourceTypeId, options).then((request) => request(this.axios, this.basePath)); + public projectQuota(id: string, resourceTypeId: string, options?: any) { + return ProjectApiFp(this.configuration).projectQuota(id, resourceTypeId, options).then((request) => request(this.axios, this.basePath)); } /** * * @summary Retrieves the quota for the selected project. - * @param {string} projectId Id of the project. + * @param {string} id Id of the project * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ProjectApi */ - public projectQuotas(projectId: string, options?: any) { - return ProjectApiFp(this.configuration).projectQuotas(projectId, options).then((request) => request(this.axios, this.basePath)); + public projectQuotas(id: string, options?: any) { + return ProjectApiFp(this.configuration).projectQuotas(id, options).then((request) => request(this.axios, this.basePath)); } /** @@ -3276,15 +3346,15 @@ export class ProjectApi extends BaseAPI { /** * * @summary Update the project quota. - * @param {string} projectId Id of the project. + * @param {string} id Id of the project. * @param {string} resourceTypeId Id of the resource. * @param {UpdateProjectQuotaObject} updateProjectQuotaObject Object containing the update values. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ProjectApi */ - public projectUpdateQuota(projectId: string, resourceTypeId: string, updateProjectQuotaObject: UpdateProjectQuotaObject, options?: any) { - return ProjectApiFp(this.configuration).projectUpdateQuota(projectId, resourceTypeId, updateProjectQuotaObject, options).then((request) => request(this.axios, this.basePath)); + public projectUpdateQuota(id: string, resourceTypeId: string, updateProjectQuotaObject: UpdateProjectQuotaObject, options?: any) { + return ProjectApiFp(this.configuration).projectUpdateQuota(id, resourceTypeId, updateProjectQuotaObject, options).then((request) => request(this.axios, this.basePath)); } }