mirror of
https://github.com/gosticks/open-project-flutter-api.git
synced 2025-10-16 11:55:34 +00:00
3.5 KiB
3.5 KiB
openapi.api.CustomActionsApi
Load the API package
import 'package:openapi/api.dart';
All URIs are relative to https://community.openproject.org
| Method | HTTP request | Description |
|---|---|---|
| executeCustomAction | POST /api/v3/custom_actions/{id}/execute | Execute custom action |
| getCustomAction | GET /api/v3/custom_actions/{id} | Get a custom action |
executeCustomAction
executeCustomAction(id, executeCustomActionRequest)
Execute custom action
A POST to this end point executes the custom action on the work package provided in the payload. The altered work package will be returned. In order to avoid executing the custom action unbeknown to a change that has already taken place, the client has to provide the work package's current lockVersion.
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 = CustomActionsApi();
final id = 1; // int | The id of the custom action to execute
final executeCustomActionRequest = ExecuteCustomActionRequest(); // ExecuteCustomActionRequest |
try {
api_instance.executeCustomAction(id, executeCustomActionRequest);
} catch (e) {
print('Exception when calling CustomActionsApi->executeCustomAction: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | The id of the custom action to execute | |
| executeCustomActionRequest | ExecuteCustomActionRequest | [optional] |
Return type
void (empty response body)
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/hal+json, text/plain
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getCustomAction
CustomActionModel getCustomAction(id)
Get a custom action
Retrieves a custom action by id.
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 = CustomActionsApi();
final id = 42; // int | The id of the custom action to fetch
try {
final result = api_instance.getCustomAction(id);
print(result);
} catch (e) {
print('Exception when calling CustomActionsApi->getCustomAction: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | The id of the custom action to fetch |
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]