// // AUTO-GENERATED FILE, DO NOT MODIFY! // // @dart=2.12 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first // ignore_for_file: constant_identifier_names // ignore_for_file: lines_longer_than_80_chars part of openapi.api; class ProjectsApi { ProjectsApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; final ApiClient apiClient; /// Create project /// /// Creates a new project, applying the attributes provided in the body. You can use the form and schema to be retrieve the valid attribute values and by that be guided towards successful creation. /// /// Note: This method returns the HTTP [Response]. /// /// Parameters: /// /// * [Object] body: Future createProjectWithHttpInfo({ Object? body, }) async { // ignore: prefer_const_declarations final path = r'/api/v3/projects'; // ignore: prefer_final_locals Object? postBody = body; final queryParams = []; final headerParams = {}; final formParams = {}; const contentTypes = ['application/json']; return apiClient.invokeAPI( path, 'POST', queryParams, postBody, headerParams, formParams, contentTypes.isEmpty ? null : contentTypes.first, ); } /// Create project /// /// Creates a new project, applying the attributes provided in the body. You can use the form and schema to be retrieve the valid attribute values and by that be guided towards successful creation. /// /// Parameters: /// /// * [Object] body: Future createProject({ Object? body, }) async { final response = await createProjectWithHttpInfo( body: body, ); if (response.statusCode >= HttpStatus.badRequest) { throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ProjectModel',) as ProjectModel; } return null; } /// Create project copy /// /// /// /// Note: This method returns the HTTP [Response]. /// /// Parameters: /// /// * [int] id (required): /// Project id Future createProjectCopyWithHttpInfo(int id,) async { // ignore: prefer_const_declarations final path = r'/api/v3/projects/{id}/copy' .replaceAll('{id}', id.toString()); // ignore: prefer_final_locals Object? postBody; final queryParams = []; final headerParams = {}; final formParams = {}; const contentTypes = []; return apiClient.invokeAPI( path, 'POST', queryParams, postBody, headerParams, formParams, contentTypes.isEmpty ? null : contentTypes.first, ); } /// Create project copy /// /// /// /// Parameters: /// /// * [int] id (required): /// Project id Future createProjectCopy(int id,) async { final response = await createProjectCopyWithHttpInfo(id,); if (response.statusCode >= HttpStatus.badRequest) { throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } } /// Delete Project /// /// Deletes the project permanently. As this is a lengthy process, the actual deletion is carried out asynchronously. So the project might exist well after the request has returned successfully. To prevent unwanted changes to the project scheduled for deletion, it is archived at once. /// /// Note: This method returns the HTTP [Response]. /// /// Parameters: /// /// * [int] id (required): /// Project id Future deleteProjectWithHttpInfo(int id,) async { // ignore: prefer_const_declarations final path = r'/api/v3/projects/{id}' .replaceAll('{id}', id.toString()); // ignore: prefer_final_locals Object? postBody; final queryParams = []; final headerParams = {}; final formParams = {}; const contentTypes = []; return apiClient.invokeAPI( path, 'DELETE', queryParams, postBody, headerParams, formParams, contentTypes.isEmpty ? null : contentTypes.first, ); } /// Delete Project /// /// Deletes the project permanently. As this is a lengthy process, the actual deletion is carried out asynchronously. So the project might exist well after the request has returned successfully. To prevent unwanted changes to the project scheduled for deletion, it is archived at once. /// /// Parameters: /// /// * [int] id (required): /// Project id Future deleteProject(int id,) async { final response = await deleteProjectWithHttpInfo(id,); if (response.statusCode >= HttpStatus.badRequest) { throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } } /// List available parent project candidates /// /// Lists projects which can become parent to another project. Only sound candidates are returned. For instance a project cannot become parent of itself or it's children. To specify the project for which a parent is queried for, the `of` parameter can be provided. If no `of` parameter is provided, a new project is assumed. Then, the check for the hierarchy is omitted as a new project cannot be part of a hierarchy yet. Candidates can be filtered. Most commonly one will want to filter by name or identifier. You can do this through the `filters` parameter which works just like the work package index. For instance to find all parent candidates with \"rollout\" in their name: ``` ?filters=[{\"name_and_identifier\":{\"operator\":\"~\",\"values\":[\"rollout\"]}}] ``` /// /// Note: This method returns the HTTP [Response]. /// /// Parameters: /// /// * [String] filters: /// JSON specifying filter conditions. /// /// * [String] of_: /// The id or identifier of the project the parent candidate is determined for /// /// * [String] sortBy: /// JSON specifying sort criteria. Accepts the same format as returned by the [queries](https://www.openproject.org/docs/api/endpoints/queries/) endpoint and allows all the filters and sortBy supported by the project list end point. Future listAvailableParentProjectCandidatesWithHttpInfo({ String? filters, String? of_, String? sortBy, }) async { // ignore: prefer_const_declarations final path = r'/api/v3/projects/available_parent_projects'; // ignore: prefer_final_locals Object? postBody; final queryParams = []; final headerParams = {}; final formParams = {}; if (filters != null) { queryParams.addAll(_queryParams('', 'filters', filters)); } if (of_ != null) { queryParams.addAll(_queryParams('', 'of', of_)); } if (sortBy != null) { queryParams.addAll(_queryParams('', 'sortBy', sortBy)); } const contentTypes = []; return apiClient.invokeAPI( path, 'GET', queryParams, postBody, headerParams, formParams, contentTypes.isEmpty ? null : contentTypes.first, ); } /// List available parent project candidates /// /// Lists projects which can become parent to another project. Only sound candidates are returned. For instance a project cannot become parent of itself or it's children. To specify the project for which a parent is queried for, the `of` parameter can be provided. If no `of` parameter is provided, a new project is assumed. Then, the check for the hierarchy is omitted as a new project cannot be part of a hierarchy yet. Candidates can be filtered. Most commonly one will want to filter by name or identifier. You can do this through the `filters` parameter which works just like the work package index. For instance to find all parent candidates with \"rollout\" in their name: ``` ?filters=[{\"name_and_identifier\":{\"operator\":\"~\",\"values\":[\"rollout\"]}}] ``` /// /// Parameters: /// /// * [String] filters: /// JSON specifying filter conditions. /// /// * [String] of_: /// The id or identifier of the project the parent candidate is determined for /// /// * [String] sortBy: /// JSON specifying sort criteria. Accepts the same format as returned by the [queries](https://www.openproject.org/docs/api/endpoints/queries/) endpoint and allows all the filters and sortBy supported by the project list end point. Future listAvailableParentProjectCandidates({ String? filters, String? of_, String? sortBy, }) async { final response = await listAvailableParentProjectCandidatesWithHttpInfo( filters: filters, of_: of_, sortBy: sortBy, ); if (response.statusCode >= HttpStatus.badRequest) { throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Object',) as Object; } return null; } /// List projects /// /// Returns a collection of projects. The collection can be filtered via query parameters similar to how work packages are filtered. In addition to the provided filter, the result set is always limited to only contain projects the client is allowed to see. /// /// Note: This method returns the HTTP [Response]. /// /// Parameters: /// /// * [String] filters: /// JSON specifying filter conditions. Accepts the same format as returned by the [queries](https://www.openproject.org/docs/api/endpoints/queries/) endpoint. Currently supported filters are: + active: based on the active property of the project + ancestor: filters projects by their ancestor. A project is not considered to be it's own ancestor. + created_at: based on the time the project was created + latest_activity_at: based on the time the last activity was registered on a project. + name_and_identifier: based on both the name and the identifier. + parent_id: filters projects by their parent. + principal: based on members of the project. + type_id: based on the types active in a project. + user_action: based on the actions the current user has in the project. + id: based on projects' id. + visible: based on the visibility for the user (id) provided as the filter value. This filter is useful for admins to identify the projects visible to a user. There might also be additional filters based on the custom fields that have been configured. /// /// * [String] sortBy: /// JSON specifying sort criteria. Currently supported orders are: + id + name + typeahead (sorting by hierarchy and name) + created_at + public + latest_activity_at + required_disk_space There might also be additional orders based on the custom fields that have been configured. /// /// * [String] select: /// Comma separated list of properties to include. Future listProjectsWithHttpInfo({ String? filters, String? sortBy, String? select, }) async { // ignore: prefer_const_declarations final path = r'/api/v3/projects'; // ignore: prefer_final_locals Object? postBody; final queryParams = []; final headerParams = {}; final formParams = {}; if (filters != null) { queryParams.addAll(_queryParams('', 'filters', filters)); } if (sortBy != null) { queryParams.addAll(_queryParams('', 'sortBy', sortBy)); } if (select != null) { queryParams.addAll(_queryParams('', 'select', select)); } const contentTypes = []; return apiClient.invokeAPI( path, 'GET', queryParams, postBody, headerParams, formParams, contentTypes.isEmpty ? null : contentTypes.first, ); } /// List projects /// /// Returns a collection of projects. The collection can be filtered via query parameters similar to how work packages are filtered. In addition to the provided filter, the result set is always limited to only contain projects the client is allowed to see. /// /// Parameters: /// /// * [String] filters: /// JSON specifying filter conditions. Accepts the same format as returned by the [queries](https://www.openproject.org/docs/api/endpoints/queries/) endpoint. Currently supported filters are: + active: based on the active property of the project + ancestor: filters projects by their ancestor. A project is not considered to be it's own ancestor. + created_at: based on the time the project was created + latest_activity_at: based on the time the last activity was registered on a project. + name_and_identifier: based on both the name and the identifier. + parent_id: filters projects by their parent. + principal: based on members of the project. + type_id: based on the types active in a project. + user_action: based on the actions the current user has in the project. + id: based on projects' id. + visible: based on the visibility for the user (id) provided as the filter value. This filter is useful for admins to identify the projects visible to a user. There might also be additional filters based on the custom fields that have been configured. /// /// * [String] sortBy: /// JSON specifying sort criteria. Currently supported orders are: + id + name + typeahead (sorting by hierarchy and name) + created_at + public + latest_activity_at + required_disk_space There might also be additional orders based on the custom fields that have been configured. /// /// * [String] select: /// Comma separated list of properties to include. Future listProjects({ String? filters, String? sortBy, String? select, }) async { final response = await listProjectsWithHttpInfo( filters: filters, sortBy: sortBy, select: select, ); if (response.statusCode >= HttpStatus.badRequest) { throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Object',) as Object; } return null; } /// List projects having version /// /// This endpoint lists the projects where the given version is available. The projects returned depend on the sharing settings of the given version, but are also limited to the projects that the current user is allowed to see. /// /// Note: This method returns the HTTP [Response]. /// /// Parameters: /// /// * [int] id (required): /// Version id Future listProjectsWithVersionWithHttpInfo(int id,) async { // ignore: prefer_const_declarations final path = r'/api/v3/versions/{id}/projects' .replaceAll('{id}', id.toString()); // ignore: prefer_final_locals Object? postBody; final queryParams = []; final headerParams = {}; final formParams = {}; const contentTypes = []; return apiClient.invokeAPI( path, 'GET', queryParams, postBody, headerParams, formParams, contentTypes.isEmpty ? null : contentTypes.first, ); } /// List projects having version /// /// This endpoint lists the projects where the given version is available. The projects returned depend on the sharing settings of the given version, but are also limited to the projects that the current user is allowed to see. /// /// Parameters: /// /// * [int] id (required): /// Version id Future listProjectsWithVersion(int id,) async { final response = await listProjectsWithVersionWithHttpInfo(id,); if (response.statusCode >= HttpStatus.badRequest) { throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Object',) as Object; } return null; } /// Project copy form /// /// /// /// Note: This method returns the HTTP [Response]. /// /// Parameters: /// /// * [int] id (required): /// Project id Future projectCopyFormWithHttpInfo(int id,) async { // ignore: prefer_const_declarations final path = r'/api/v3/projects/{id}/copy/form' .replaceAll('{id}', id.toString()); // ignore: prefer_final_locals Object? postBody; final queryParams = []; final headerParams = {}; final formParams = {}; const contentTypes = []; return apiClient.invokeAPI( path, 'POST', queryParams, postBody, headerParams, formParams, contentTypes.isEmpty ? null : contentTypes.first, ); } /// Project copy form /// /// /// /// Parameters: /// /// * [int] id (required): /// Project id Future projectCopyForm(int id,) async { final response = await projectCopyFormWithHttpInfo(id,); if (response.statusCode >= HttpStatus.badRequest) { throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } } /// Project create form /// /// /// /// Note: This method returns the HTTP [Response]. /// /// Parameters: /// /// * [Object] body: Future projectCreateFormWithHttpInfo({ Object? body, }) async { // ignore: prefer_const_declarations final path = r'/api/v3/projects/form'; // ignore: prefer_final_locals Object? postBody = body; final queryParams = []; final headerParams = {}; final formParams = {}; const contentTypes = ['application/json']; return apiClient.invokeAPI( path, 'POST', queryParams, postBody, headerParams, formParams, contentTypes.isEmpty ? null : contentTypes.first, ); } /// Project create form /// /// /// /// Parameters: /// /// * [Object] body: Future projectCreateForm({ Object? body, }) async { final response = await projectCreateFormWithHttpInfo( body: body, ); if (response.statusCode >= HttpStatus.badRequest) { throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Object',) as Object; } return null; } /// Project update form /// /// /// /// Note: This method returns the HTTP [Response]. /// /// Parameters: /// /// * [int] id (required): /// Project id /// /// * [Object] body: Future projectUpdateFormWithHttpInfo(int id, { Object? body, }) async { // ignore: prefer_const_declarations final path = r'/api/v3/projects/{id}/form' .replaceAll('{id}', id.toString()); // ignore: prefer_final_locals Object? postBody = body; final queryParams = []; final headerParams = {}; final formParams = {}; const contentTypes = ['application/json']; return apiClient.invokeAPI( path, 'POST', queryParams, postBody, headerParams, formParams, contentTypes.isEmpty ? null : contentTypes.first, ); } /// Project update form /// /// /// /// Parameters: /// /// * [int] id (required): /// Project id /// /// * [Object] body: Future projectUpdateForm(int id, { Object? body, }) async { final response = await projectUpdateFormWithHttpInfo(id, body: body, ); if (response.statusCode >= HttpStatus.badRequest) { throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } } /// Update Project /// /// Updates the given project by applying the attributes provided in the body. /// /// Note: This method returns the HTTP [Response]. /// /// Parameters: /// /// * [int] id (required): /// Project id /// /// * [Object] body: Future updateProjectWithHttpInfo(int id, { Object? body, }) async { // ignore: prefer_const_declarations final path = r'/api/v3/projects/{id}' .replaceAll('{id}', id.toString()); // ignore: prefer_final_locals Object? postBody = body; final queryParams = []; final headerParams = {}; final formParams = {}; const contentTypes = ['application/json']; return apiClient.invokeAPI( path, 'PATCH', queryParams, postBody, headerParams, formParams, contentTypes.isEmpty ? null : contentTypes.first, ); } /// Update Project /// /// Updates the given project by applying the attributes provided in the body. /// /// Parameters: /// /// * [int] id (required): /// Project id /// /// * [Object] body: Future updateProject(int id, { Object? body, }) async { final response = await updateProjectWithHttpInfo(id, body: body, ); if (response.statusCode >= HttpStatus.badRequest) { throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ProjectModel',) as ProjectModel; } return null; } /// View project /// /// /// /// Note: This method returns the HTTP [Response]. /// /// Parameters: /// /// * [int] id (required): /// Project id Future viewProjectWithHttpInfo(int id,) async { // ignore: prefer_const_declarations final path = r'/api/v3/projects/{id}' .replaceAll('{id}', id.toString()); // ignore: prefer_final_locals Object? postBody; final queryParams = []; final headerParams = {}; final formParams = {}; const contentTypes = []; return apiClient.invokeAPI( path, 'GET', queryParams, postBody, headerParams, formParams, contentTypes.isEmpty ? null : contentTypes.first, ); } /// View project /// /// /// /// Parameters: /// /// * [int] id (required): /// Project id Future viewProject(int id,) async { final response = await viewProjectWithHttpInfo(id,); if (response.statusCode >= HttpStatus.badRequest) { throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ProjectModel',) as ProjectModel; } return null; } /// View project schema /// /// /// /// Note: This method returns the HTTP [Response]. Future viewProjectSchemaWithHttpInfo() async { // ignore: prefer_const_declarations final path = r'/api/v3/projects/schema'; // ignore: prefer_final_locals Object? postBody; final queryParams = []; final headerParams = {}; final formParams = {}; const contentTypes = []; return apiClient.invokeAPI( path, 'GET', queryParams, postBody, headerParams, formParams, contentTypes.isEmpty ? null : contentTypes.first, ); } /// View project schema /// /// Future viewProjectSchema() async { final response = await viewProjectSchemaWithHttpInfo(); if (response.statusCode >= HttpStatus.badRequest) { throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Object',) as Object; } return null; } /// View project status /// /// /// /// Note: This method returns the HTTP [Response]. /// /// Parameters: /// /// * [String] id (required): /// Project status id Future viewProjectStatusWithHttpInfo(String id,) async { // ignore: prefer_const_declarations final path = r'/api/v3/project_statuses/{id}' .replaceAll('{id}', id); // ignore: prefer_final_locals Object? postBody; final queryParams = []; final headerParams = {}; final formParams = {}; const contentTypes = []; return apiClient.invokeAPI( path, 'GET', queryParams, postBody, headerParams, formParams, contentTypes.isEmpty ? null : contentTypes.first, ); } /// View project status /// /// /// /// Parameters: /// /// * [String] id (required): /// Project status id Future viewProjectStatus(String id,) async { final response = await viewProjectStatusWithHttpInfo(id,); if (response.statusCode >= HttpStatus.badRequest) { throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Object',) as Object; } return null; } }