14 KiB
openapi.api.VersionsApi
Load the API package
import 'package:openapi/api.dart';
All URIs are relative to https://community.openproject.org
| Method | HTTP request | Description |
|---|---|---|
| availableProjectsForVersions | GET /api/v3/versions/available_projects | Available projects for versions |
| createVersion | POST /api/v3/versions | Create version |
| deleteVersion | DELETE /api/v3/versions/{id} | Delete version |
| listVersions | GET /api/v3/versions | List versions |
| listVersionsAvailableInAProject | GET /api/v3/projects/{id}/versions | List versions available in a project |
| updateVersion | PATCH /api/v3/versions/{id} | Update Version |
| versionCreateForm | POST /api/v3/versions/form | Version create form |
| versionUpdateForm | POST /api/v3/versions/{id}/form | Version update form |
| viewVersion | GET /api/v3/versions/{id} | View version |
| viewVersionSchema | GET /api/v3/versions/schema | View version schema |
availableProjectsForVersions
Object availableProjectsForVersions()
Available projects for versions
Gets a list of projects in which a version can be created in. The list contains all projects in which the user issuing the request has the manage versions permissions.
Example
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 = VersionsApi();
try {
final result = api_instance.availableProjectsForVersions();
print(result);
} catch (e) {
print('Exception when calling VersionsApi->availableProjectsForVersions: $e\n');
}
Parameters
This endpoint does not need any parameter.
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/hal+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
createVersion
VersionModel createVersion()
Create version
Creates a new version applying the attributes provided in the body. Please note that while there is a fixed set of attributes, custom fields can extend a version's attributes and are accepted by the endpoint. You can use the form and schema to be retrieve the valid attribute values and by that be guided towards successful creation.
Example
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 = VersionsApi();
try {
final result = api_instance.createVersion();
print(result);
} catch (e) {
print('Exception when calling VersionsApi->createVersion: $e\n');
}
Parameters
This endpoint does not need any parameter.
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/hal+json, text/plain
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deleteVersion
deleteVersion(id)
Delete version
Deletes the version. Work packages associated to the version will no longer be assigned to it.
Example
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 = VersionsApi();
final id = 1; // int | Version id
try {
api_instance.deleteVersion(id);
} catch (e) {
print('Exception when calling VersionsApi->deleteVersion: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | Version id |
Return type
void (empty response body)
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/hal+json, text/plain
[Back to top] [Back to API list] [Back to Model list] [Back to README]
listVersions
Object listVersions(filters)
List versions
Returns a collection of versions. The client can choose to filter the versions similar to how work packages are filtered. In addition to the provided filters, the server will reduce the result set to only contain versions, for which the requesting client has sufficient permissions (view_work_packages).
Example
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 = VersionsApi();
final filters = [{ "sharing": { "operator": "*", "values": ["system"] }" }]; // 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: + sharing: filters versions by how they are shared within the server (*none*, *descendants*, *hierarchy*, *tree*, *system*).
try {
final result = api_instance.listVersions(filters);
print(result);
} catch (e) {
print('Exception when calling VersionsApi->listVersions: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| filters | String | JSON specifying filter conditions. Accepts the same format as returned by the queries endpoint. Currently supported filters are: + sharing: filters versions by how they are shared within the server (none, descendants, hierarchy, tree, system). | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/hal+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
listVersionsAvailableInAProject
Object listVersionsAvailableInAProject(id)
List versions available in a project
This endpoint lists the versions that are available in a given project. Note that due to sharing this might be more than the versions defined by that project.
Example
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 = VersionsApi();
final id = 1; // int | ID of the project whose versions will be listed
try {
final result = api_instance.listVersionsAvailableInAProject(id);
print(result);
} catch (e) {
print('Exception when calling VersionsApi->listVersionsAvailableInAProject: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | ID of the project whose versions will be listed |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/hal+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
updateVersion
VersionModel updateVersion(id)
Update Version
Updates the given version by applying the attributes provided in the body. Please note that while there is a fixed set of attributes, custom fields can extend a version's attributes and are accepted by the endpoint.
Example
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 = VersionsApi();
final id = 1; // int | Version id
try {
final result = api_instance.updateVersion(id);
print(result);
} catch (e) {
print('Exception when calling VersionsApi->updateVersion: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | Version id |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/hal+json, text/plain
[Back to top] [Back to API list] [Back to Model list] [Back to README]
versionCreateForm
versionCreateForm()
Version create form
Example
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 = VersionsApi();
try {
api_instance.versionCreateForm();
} catch (e) {
print('Exception when calling VersionsApi->versionCreateForm: $e\n');
}
Parameters
This endpoint does not need any parameter.
Return type
void (empty response body)
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/hal+json, text/plain
[Back to top] [Back to API list] [Back to Model list] [Back to README]
versionUpdateForm
versionUpdateForm(id)
Version update form
Example
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 = VersionsApi();
final id = 1; // int | Project id
try {
api_instance.versionUpdateForm(id);
} catch (e) {
print('Exception when calling VersionsApi->versionUpdateForm: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | Project id |
Return type
void (empty response body)
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/hal+json, text/plain
[Back to top] [Back to API list] [Back to Model list] [Back to README]
viewVersion
VersionModel viewVersion(id)
View version
Example
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 = VersionsApi();
final id = 1; // int | Version id
try {
final result = api_instance.viewVersion(id);
print(result);
} catch (e) {
print('Exception when calling VersionsApi->viewVersion: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | Version id |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/hal+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
viewVersionSchema
Object viewVersionSchema()
View version schema
Example
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 = VersionsApi();
try {
final result = api_instance.viewVersionSchema();
print(result);
} catch (e) {
print('Exception when calling VersionsApi->viewVersionSchema: $e\n');
}
Parameters
This endpoint does not need any parameter.
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/hal+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]