9.1 KiB
openapi.api.GridsApi
Load the API package
import 'package:openapi/api.dart';
All URIs are relative to https://community.openproject.org
| Method | HTTP request | Description |
|---|---|---|
| createGrid | POST /api/v3/grids | Create a grid |
| getGrid | GET /api/v3/grids/{id} | Get a grid |
| gridCreateForm | POST /api/v3/grids/form | Grid Create Form |
| gridUpdateForm | POST /api/v3/grids/{id}/form | Grid Update Form |
| listGrids | GET /api/v3/grids | List grids |
| updateGrid | PATCH /api/v3/grids/{id} | Update a grid |
createGrid
GridReadModel createGrid(gridWriteModel)
Create a grid
Creates a new grid applying the attributes provided in the body. The constraints applied to the grid depend on the page the grid is placed in which is why the create form end point should be used to be guided when wanting to create a grid.
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 = GridsApi();
final gridWriteModel = GridWriteModel(); // GridWriteModel |
try {
final result = api_instance.createGrid(gridWriteModel);
print(result);
} catch (e) {
print('Exception when calling GridsApi->createGrid: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| gridWriteModel | GridWriteModel | [optional] |
Return type
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]
getGrid
GridReadModel getGrid(id)
Get a grid
Fetches a single grid identified by its 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 = GridsApi();
final id = 42; // int | Grid id
try {
final result = api_instance.getGrid(id);
print(result);
} catch (e) {
print('Exception when calling GridsApi->getGrid: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | Grid 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]
gridCreateForm
gridCreateForm()
Grid 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 = GridsApi();
try {
api_instance.gridCreateForm();
} catch (e) {
print('Exception when calling GridsApi->gridCreateForm: $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: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
gridUpdateForm
Object gridUpdateForm(id)
Grid 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 = GridsApi();
final id = 1; // int | ID of the grid being modified
try {
final result = api_instance.gridUpdateForm(id);
print(result);
} catch (e) {
print('Exception when calling GridsApi->gridUpdateForm: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | ID of the grid being modified |
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]
listGrids
GridCollectionModel listGrids(offset, pageSize, filters)
List grids
Lists all grids matching the provided filters and being part of the selected query page. The grids returned will also depend on the permissions of the requesting user.
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 = GridsApi();
final offset = 25; // int | Page number inside the requested collection.
final pageSize = 25; // int | Number of elements to display per page.
final filters = [{ "page": { "operator": "=", "values": ["/my/page"] } }]; // 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: - page: Filter grid by work package
try {
final result = api_instance.listGrids(offset, pageSize, filters);
print(result);
} catch (e) {
print('Exception when calling GridsApi->listGrids: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| offset | int | Page number inside the requested collection. | [optional] [default to 1] |
| pageSize | int | Number of elements to display per page. | [optional] [default to 30] |
| filters | String | JSON specifying filter conditions. Accepts the same format as returned by the queries endpoint. Currently supported filters are: - page: Filter grid by work package | [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]
updateGrid
GridReadModel updateGrid(id, gridWriteModel)
Update a grid
Updates the given grid by applying the attributes provided in the body. The constraints applied to the grid depend on the page the grid is placed in which is why the create form end point should be used to be guided when wanting to update a grid.
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 = GridsApi();
final id = 1; // int | ID of the grid being modified
final gridWriteModel = GridWriteModel(); // GridWriteModel |
try {
final result = api_instance.updateGrid(id, gridWriteModel);
print(result);
} catch (e) {
print('Exception when calling GridsApi->updateGrid: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | ID of the grid being modified | |
| gridWriteModel | GridWriteModel | [optional] |
Return type
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]