open-project-flutter-api/doc/ProjectsApi.md
2023-11-05 19:54:17 +01:00

629 lines
22 KiB
Markdown

# openapi.api.ProjectsApi
## Load the API package
```dart
import 'package:openapi/api.dart';
```
All URIs are relative to *https://community.openproject.org*
Method | HTTP request | Description
------------- | ------------- | -------------
[**createProject**](ProjectsApi.md#createproject) | **POST** /api/v3/projects | Create project
[**createProjectCopy**](ProjectsApi.md#createprojectcopy) | **POST** /api/v3/projects/{id}/copy | Create project copy
[**deleteProject**](ProjectsApi.md#deleteproject) | **DELETE** /api/v3/projects/{id} | Delete Project
[**listAvailableParentProjectCandidates**](ProjectsApi.md#listavailableparentprojectcandidates) | **GET** /api/v3/projects/available_parent_projects | List available parent project candidates
[**listProjects**](ProjectsApi.md#listprojects) | **GET** /api/v3/projects | List projects
[**listProjectsWithVersion**](ProjectsApi.md#listprojectswithversion) | **GET** /api/v3/versions/{id}/projects | List projects having version
[**projectCopyForm**](ProjectsApi.md#projectcopyform) | **POST** /api/v3/projects/{id}/copy/form | Project copy form
[**projectCreateForm**](ProjectsApi.md#projectcreateform) | **POST** /api/v3/projects/form | Project create form
[**projectUpdateForm**](ProjectsApi.md#projectupdateform) | **POST** /api/v3/projects/{id}/form | Project update form
[**updateProject**](ProjectsApi.md#updateproject) | **PATCH** /api/v3/projects/{id} | Update Project
[**viewProject**](ProjectsApi.md#viewproject) | **GET** /api/v3/projects/{id} | View project
[**viewProjectSchema**](ProjectsApi.md#viewprojectschema) | **GET** /api/v3/projects/schema | View project schema
[**viewProjectStatus**](ProjectsApi.md#viewprojectstatus) | **GET** /api/v3/project_statuses/{id} | View project status
# **createProject**
> ProjectModel createProject(body)
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.
### Example
```dart
import 'package:openapi/api.dart';
// TODO Configure HTTP basic authorization: BasicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').password = 'YOUR_PASSWORD';
final api_instance = ProjectsApi();
final body = Object(); // Object |
try {
final result = api_instance.createProject(body);
print(result);
} catch (e) {
print('Exception when calling ProjectsApi->createProject: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | **Object**| | [optional]
### Return type
[**ProjectModel**](ProjectModel.md)
### Authorization
[BasicAuth](../README.md#BasicAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/hal+json, text/plain
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **createProjectCopy**
> createProjectCopy(id)
Create project copy
### Example
```dart
import 'package:openapi/api.dart';
// TODO Configure HTTP basic authorization: BasicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').password = 'YOUR_PASSWORD';
final api_instance = ProjectsApi();
final id = 1; // int | Project id
try {
api_instance.createProjectCopy(id);
} catch (e) {
print('Exception when calling ProjectsApi->createProjectCopy: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **int**| Project id |
### Return type
void (empty response body)
### Authorization
[BasicAuth](../README.md#BasicAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/hal+json, text/plain
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **deleteProject**
> deleteProject(id)
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.
### Example
```dart
import 'package:openapi/api.dart';
// TODO Configure HTTP basic authorization: BasicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').password = 'YOUR_PASSWORD';
final api_instance = ProjectsApi();
final id = 1; // int | Project id
try {
api_instance.deleteProject(id);
} catch (e) {
print('Exception when calling ProjectsApi->deleteProject: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **int**| Project id |
### Return type
void (empty response body)
### Authorization
[BasicAuth](../README.md#BasicAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/hal+json, text/plain
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **listAvailableParentProjectCandidates**
> Object listAvailableParentProjectCandidates(filters, of_, sortBy)
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\"]}}] ```
### Example
```dart
import 'package:openapi/api.dart';
// TODO Configure HTTP basic authorization: BasicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').password = 'YOUR_PASSWORD';
final api_instance = ProjectsApi();
final filters = [{ "ancestor": { "operator": "=", "values": ['1'] }" }]; // String | JSON specifying filter conditions.
final of_ = 123; // String | The id or identifier of the project the parent candidate is determined for
final sortBy = [["id", "asc"]]; // String | 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.
try {
final result = api_instance.listAvailableParentProjectCandidates(filters, of_, sortBy);
print(result);
} catch (e) {
print('Exception when calling ProjectsApi->listAvailableParentProjectCandidates: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**filters** | **String**| JSON specifying filter conditions. | [optional]
**of_** | **String**| The id or identifier of the project the parent candidate is determined for | [optional]
**sortBy** | **String**| 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. | [optional]
### Return type
[**Object**](Object.md)
### Authorization
[BasicAuth](../README.md#BasicAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/hal+json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **listProjects**
> Object listProjects(filters, sortBy, select)
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.
### Example
```dart
import 'package:openapi/api.dart';
// TODO Configure HTTP basic authorization: BasicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').password = 'YOUR_PASSWORD';
final api_instance = ProjectsApi();
final filters = [{ "ancestor": { "operator": "=", "values": ['1'] }" }]; // String | 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.
final sortBy = [["id", "asc"]]; // String | 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.
final select = total,elements/identifier,elements/name; // String | Comma separated list of properties to include.
try {
final result = api_instance.listProjects(filters, sortBy, select);
print(result);
} catch (e) {
print('Exception when calling ProjectsApi->listProjects: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**filters** | **String**| 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. | [optional]
**sortBy** | **String**| 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. | [optional]
**select** | **String**| Comma separated list of properties to include. | [optional]
### Return type
[**Object**](Object.md)
### Authorization
[BasicAuth](../README.md#BasicAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/hal+json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **listProjectsWithVersion**
> Object listProjectsWithVersion(id)
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.
### Example
```dart
import 'package:openapi/api.dart';
// TODO Configure HTTP basic authorization: BasicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').password = 'YOUR_PASSWORD';
final api_instance = ProjectsApi();
final id = 1; // int | Version id
try {
final result = api_instance.listProjectsWithVersion(id);
print(result);
} catch (e) {
print('Exception when calling ProjectsApi->listProjectsWithVersion: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **int**| Version id |
### Return type
[**Object**](Object.md)
### Authorization
[BasicAuth](../README.md#BasicAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/hal+json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **projectCopyForm**
> projectCopyForm(id)
Project copy form
### Example
```dart
import 'package:openapi/api.dart';
// TODO Configure HTTP basic authorization: BasicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').password = 'YOUR_PASSWORD';
final api_instance = ProjectsApi();
final id = 1; // int | Project id
try {
api_instance.projectCopyForm(id);
} catch (e) {
print('Exception when calling ProjectsApi->projectCopyForm: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **int**| Project id |
### Return type
void (empty response body)
### Authorization
[BasicAuth](../README.md#BasicAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/hal+json, text/plain
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **projectCreateForm**
> Object projectCreateForm(body)
Project create form
### Example
```dart
import 'package:openapi/api.dart';
// TODO Configure HTTP basic authorization: BasicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').password = 'YOUR_PASSWORD';
final api_instance = ProjectsApi();
final body = Object(); // Object |
try {
final result = api_instance.projectCreateForm(body);
print(result);
} catch (e) {
print('Exception when calling ProjectsApi->projectCreateForm: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | **Object**| | [optional]
### Return type
[**Object**](Object.md)
### Authorization
[BasicAuth](../README.md#BasicAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/hal+json, text/plain
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **projectUpdateForm**
> projectUpdateForm(id, body)
Project update form
### Example
```dart
import 'package:openapi/api.dart';
// TODO Configure HTTP basic authorization: BasicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').password = 'YOUR_PASSWORD';
final api_instance = ProjectsApi();
final id = 1; // int | Project id
final body = Object(); // Object |
try {
api_instance.projectUpdateForm(id, body);
} catch (e) {
print('Exception when calling ProjectsApi->projectUpdateForm: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **int**| Project id |
**body** | **Object**| | [optional]
### Return type
void (empty response body)
### Authorization
[BasicAuth](../README.md#BasicAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/hal+json, text/plain
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **updateProject**
> ProjectModel updateProject(id, body)
Update Project
Updates the given project by applying the attributes provided in the body.
### Example
```dart
import 'package:openapi/api.dart';
// TODO Configure HTTP basic authorization: BasicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').password = 'YOUR_PASSWORD';
final api_instance = ProjectsApi();
final id = 1; // int | Project id
final body = Object(); // Object |
try {
final result = api_instance.updateProject(id, body);
print(result);
} catch (e) {
print('Exception when calling ProjectsApi->updateProject: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **int**| Project id |
**body** | **Object**| | [optional]
### Return type
[**ProjectModel**](ProjectModel.md)
### Authorization
[BasicAuth](../README.md#BasicAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/hal+json, text/plain
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **viewProject**
> ProjectModel viewProject(id)
View project
### Example
```dart
import 'package:openapi/api.dart';
// TODO Configure HTTP basic authorization: BasicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').password = 'YOUR_PASSWORD';
final api_instance = ProjectsApi();
final id = 1; // int | Project id
try {
final result = api_instance.viewProject(id);
print(result);
} catch (e) {
print('Exception when calling ProjectsApi->viewProject: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **int**| Project id |
### Return type
[**ProjectModel**](ProjectModel.md)
### Authorization
[BasicAuth](../README.md#BasicAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/hal+json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **viewProjectSchema**
> Object viewProjectSchema()
View project schema
### Example
```dart
import 'package:openapi/api.dart';
// TODO Configure HTTP basic authorization: BasicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').password = 'YOUR_PASSWORD';
final api_instance = ProjectsApi();
try {
final result = api_instance.viewProjectSchema();
print(result);
} catch (e) {
print('Exception when calling ProjectsApi->viewProjectSchema: $e\n');
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**Object**](Object.md)
### Authorization
[BasicAuth](../README.md#BasicAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/hal+json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **viewProjectStatus**
> Object viewProjectStatus(id)
View project status
### Example
```dart
import 'package:openapi/api.dart';
// TODO Configure HTTP basic authorization: BasicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('BasicAuth').password = 'YOUR_PASSWORD';
final api_instance = ProjectsApi();
final id = on_track; // String | Project status id
try {
final result = api_instance.viewProjectStatus(id);
print(result);
} catch (e) {
print('Exception when calling ProjectsApi->viewProjectStatus: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **String**| Project status id |
### Return type
[**Object**](Object.md)
### Authorization
[BasicAuth](../README.md#BasicAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/hal+json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)