Skip to content
Snippets Groups Projects

New: Endpoint for subprojects

Files

/* tslint:disable */
/* eslint-disable */
/**
* Coscine Web API
* Coscine (short for <b>CO</b>llaborative <b>SC</b>ientific <b>IN</b>tegration <b>E</b>nvironment) is the research data management platform for your research project.
*
* The version of the OpenAPI document: 2.0
* Contact: servicedesk@rwth-aachen.de
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import type { Configuration } from '../../configuration';
import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
import globalAxios 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, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../../base';
// @ts-ignore
import type { ProjectDtoPagedResponse } from '../../@coscine/model';
/**
* ProjectSubProjectsApi - axios parameter creator
* @export
*/
export const ProjectSubProjectsApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
*
* @summary Responds with the HTTP methods allowed for the endpoint.
* @param {string} projectId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiV2ProjectsProjectIdSubprojectsOptions: async (projectId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'projectId' is not null or undefined
assertParamExists('apiV2ProjectsProjectIdSubprojectsOptions', 'projectId', projectId)
const localVarPath = `/api/v2/projects/{projectId}/subprojects`
.replace(`{${"projectId"}}`, encodeURIComponent(String(projectId)));
// 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: 'OPTIONS', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication Bearer required
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @summary Retrieves all subprojects for a specified project.
* @param {string} projectId The Id or slug of the project.
* @param {boolean} [includeOrganizations] Gets or sets a value indicating whether to retrieve the organizations.
* @param {number} [pageNumber] The desired page number. Should be greater than or equal to 1. Default is 1.
* @param {number} [pageSize] The desired page size. Should be between 1 and the maximum allowed page size (50). Default is 10.
* @param {string} [orderBy] Gets or sets the field name used for ordering the results. The order is constructed by an order string. Use the property followed by \&quot;asc\&quot; or \&quot;desc\&quot; and separate properties by commas. Default is asc.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getSubProjectsForProject: async (projectId: string, includeOrganizations?: boolean, pageNumber?: number, pageSize?: number, orderBy?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'projectId' is not null or undefined
assertParamExists('getSubProjectsForProject', 'projectId', projectId)
const localVarPath = `/api/v2/projects/{projectId}/subprojects`
.replace(`{${"projectId"}}`, encodeURIComponent(String(projectId)));
// 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 Bearer required
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
if (includeOrganizations !== undefined) {
localVarQueryParameter['IncludeOrganizations'] = includeOrganizations;
}
if (pageNumber !== undefined) {
localVarQueryParameter['PageNumber'] = pageNumber;
}
if (pageSize !== undefined) {
localVarQueryParameter['PageSize'] = pageSize;
}
if (orderBy !== undefined) {
localVarQueryParameter['OrderBy'] = orderBy;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
}
};
/**
* ProjectSubProjectsApi - functional programming interface
* @export
*/
export const ProjectSubProjectsApiFp = function(configuration?: Configuration) {
const localVarAxiosParamCreator = ProjectSubProjectsApiAxiosParamCreator(configuration)
return {
/**
*
* @summary Responds with the HTTP methods allowed for the endpoint.
* @param {string} projectId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiV2ProjectsProjectIdSubprojectsOptions(projectId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.apiV2ProjectsProjectIdSubprojectsOptions(projectId, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['ProjectSubProjectsApi.apiV2ProjectsProjectIdSubprojectsOptions']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
*
* @summary Retrieves all subprojects for a specified project.
* @param {string} projectId The Id or slug of the project.
* @param {boolean} [includeOrganizations] Gets or sets a value indicating whether to retrieve the organizations.
* @param {number} [pageNumber] The desired page number. Should be greater than or equal to 1. Default is 1.
* @param {number} [pageSize] The desired page size. Should be between 1 and the maximum allowed page size (50). Default is 10.
* @param {string} [orderBy] Gets or sets the field name used for ordering the results. The order is constructed by an order string. Use the property followed by \&quot;asc\&quot; or \&quot;desc\&quot; and separate properties by commas. Default is asc.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getSubProjectsForProject(projectId: string, includeOrganizations?: boolean, pageNumber?: number, pageSize?: number, orderBy?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ProjectDtoPagedResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getSubProjectsForProject(projectId, includeOrganizations, pageNumber, pageSize, orderBy, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['ProjectSubProjectsApi.getSubProjectsForProject']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
}
};
/**
* ProjectSubProjectsApi - factory interface
* @export
*/
export const ProjectSubProjectsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
const localVarFp = ProjectSubProjectsApiFp(configuration)
return {
/**
*
* @summary Responds with the HTTP methods allowed for the endpoint.
* @param {ProjectSubProjectsApiApiV2ProjectsProjectIdSubprojectsOptionsRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiV2ProjectsProjectIdSubprojectsOptions(requestParameters: ProjectSubProjectsApiApiV2ProjectsProjectIdSubprojectsOptionsRequest, options?: RawAxiosRequestConfig): AxiosPromise<void> {
return localVarFp.apiV2ProjectsProjectIdSubprojectsOptions(requestParameters.projectId, options).then((request) => request(axios, basePath));
},
/**
*
* @summary Retrieves all subprojects for a specified project.
* @param {ProjectSubProjectsApiGetSubProjectsForProjectRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getSubProjectsForProject(requestParameters: ProjectSubProjectsApiGetSubProjectsForProjectRequest, options?: RawAxiosRequestConfig): AxiosPromise<ProjectDtoPagedResponse> {
return localVarFp.getSubProjectsForProject(requestParameters.projectId, requestParameters.includeOrganizations, requestParameters.pageNumber, requestParameters.pageSize, requestParameters.orderBy, options).then((request) => request(axios, basePath));
},
};
};
/**
* Request parameters for apiV2ProjectsProjectIdSubprojectsOptions operation in ProjectSubProjectsApi.
* @export
* @interface ProjectSubProjectsApiApiV2ProjectsProjectIdSubprojectsOptionsRequest
*/
export interface ProjectSubProjectsApiApiV2ProjectsProjectIdSubprojectsOptionsRequest {
/**
*
* @type {string}
* @memberof ProjectSubProjectsApiApiV2ProjectsProjectIdSubprojectsOptions
*/
readonly projectId: string
}
/**
* Request parameters for getSubProjectsForProject operation in ProjectSubProjectsApi.
* @export
* @interface ProjectSubProjectsApiGetSubProjectsForProjectRequest
*/
export interface ProjectSubProjectsApiGetSubProjectsForProjectRequest {
/**
* The Id or slug of the project.
* @type {string}
* @memberof ProjectSubProjectsApiGetSubProjectsForProject
*/
readonly projectId: string
/**
* Gets or sets a value indicating whether to retrieve the organizations.
* @type {boolean}
* @memberof ProjectSubProjectsApiGetSubProjectsForProject
*/
readonly includeOrganizations?: boolean
/**
* The desired page number. Should be greater than or equal to 1. Default is 1.
* @type {number}
* @memberof ProjectSubProjectsApiGetSubProjectsForProject
*/
readonly pageNumber?: number
/**
* The desired page size. Should be between 1 and the maximum allowed page size (50). Default is 10.
* @type {number}
* @memberof ProjectSubProjectsApiGetSubProjectsForProject
*/
readonly pageSize?: number
/**
* Gets or sets the field name used for ordering the results. The order is constructed by an order string. Use the property followed by \&quot;asc\&quot; or \&quot;desc\&quot; and separate properties by commas. Default is asc.
* @type {string}
* @memberof ProjectSubProjectsApiGetSubProjectsForProject
*/
readonly orderBy?: string
}
/**
* ProjectSubProjectsApi - object-oriented interface
* @export
* @class ProjectSubProjectsApi
* @extends {BaseAPI}
*/
export class ProjectSubProjectsApi extends BaseAPI {
/**
*
* @summary Responds with the HTTP methods allowed for the endpoint.
* @param {ProjectSubProjectsApiApiV2ProjectsProjectIdSubprojectsOptionsRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ProjectSubProjectsApi
*/
public apiV2ProjectsProjectIdSubprojectsOptions(requestParameters: ProjectSubProjectsApiApiV2ProjectsProjectIdSubprojectsOptionsRequest, options?: RawAxiosRequestConfig) {
return ProjectSubProjectsApiFp(this.configuration).apiV2ProjectsProjectIdSubprojectsOptions(requestParameters.projectId, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary Retrieves all subprojects for a specified project.
* @param {ProjectSubProjectsApiGetSubProjectsForProjectRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ProjectSubProjectsApi
*/
public getSubProjectsForProject(requestParameters: ProjectSubProjectsApiGetSubProjectsForProjectRequest, options?: RawAxiosRequestConfig) {
return ProjectSubProjectsApiFp(this.configuration).getSubProjectsForProject(requestParameters.projectId, requestParameters.includeOrganizations, requestParameters.pageNumber, requestParameters.pageSize, requestParameters.orderBy, options).then((request) => request(this.axios, this.basePath));
}
}
Loading