mirror of
https://github.com/gosticks/open-project-flutter-api.git
synced 2026-01-30 13:27:31 +00:00
327 lines
12 KiB
Dart
327 lines
12 KiB
Dart
//
|
|
// 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 ActionsCapabilitiesApi {
|
|
ActionsCapabilitiesApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
|
|
|
|
final ApiClient apiClient;
|
|
|
|
/// List actions
|
|
///
|
|
/// Returns a collection of actions. The client can choose to filter the actions similar to how work packages are filtered. In addition to the provided filters, the server will reduce the result set to only contain actions, for which the requesting client has sufficient permissions.
|
|
///
|
|
/// 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: + id: Returns only the action having the id or all actions except those having the id(s).
|
|
///
|
|
/// * [String] sortBy:
|
|
/// JSON specifying sort criteria. Accepts the same format as returned by the [queries](https://www.openproject.org/docs/api/endpoints/queries/) endpoint. Currently supported sorts are: + *No sort supported yet*
|
|
Future<Response> listActionsWithHttpInfo({ String? filters, String? sortBy, }) async {
|
|
// ignore: prefer_const_declarations
|
|
final path = r'/api/v3/actions';
|
|
|
|
// ignore: prefer_final_locals
|
|
Object? postBody;
|
|
|
|
final queryParams = <QueryParam>[];
|
|
final headerParams = <String, String>{};
|
|
final formParams = <String, String>{};
|
|
|
|
if (filters != null) {
|
|
queryParams.addAll(_queryParams('', 'filters', filters));
|
|
}
|
|
if (sortBy != null) {
|
|
queryParams.addAll(_queryParams('', 'sortBy', sortBy));
|
|
}
|
|
|
|
const contentTypes = <String>[];
|
|
|
|
|
|
return apiClient.invokeAPI(
|
|
path,
|
|
'GET',
|
|
queryParams,
|
|
postBody,
|
|
headerParams,
|
|
formParams,
|
|
contentTypes.isEmpty ? null : contentTypes.first,
|
|
);
|
|
}
|
|
|
|
/// List actions
|
|
///
|
|
/// Returns a collection of actions. The client can choose to filter the actions similar to how work packages are filtered. In addition to the provided filters, the server will reduce the result set to only contain actions, for which the requesting client has sufficient permissions.
|
|
///
|
|
/// 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: + id: Returns only the action having the id or all actions except those having the id(s).
|
|
///
|
|
/// * [String] sortBy:
|
|
/// JSON specifying sort criteria. Accepts the same format as returned by the [queries](https://www.openproject.org/docs/api/endpoints/queries/) endpoint. Currently supported sorts are: + *No sort supported yet*
|
|
Future<Object?> listActions({ String? filters, String? sortBy, }) async {
|
|
final response = await listActionsWithHttpInfo( filters: filters, 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 capabilities
|
|
///
|
|
/// Returns a collection of actions assigned to a principal in a context. The client can choose to filter the actions similar to how work packages are filtered. In addition to the provided filters, the server will reduce the result set to only contain actions, for which the requesting client has sufficient permissions
|
|
///
|
|
/// 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. + action: Get all capabilities of a certain action + principal: Get all capabilities of a principal + context: Get all capabilities within a context. Note that for a project context the client needs to provide `p{id}`, e.g. `p5` and for the global context a `g`
|
|
///
|
|
/// * [String] sortBy:
|
|
/// JSON specifying sort criteria. Accepts the same format as returned by the [queries](https://www.openproject.org/docs/api/endpoints/queries/) endpoint. Currently supported sorts are: + id: Sort by the capabilities id
|
|
Future<Response> listCapabilitiesWithHttpInfo({ String? filters, String? sortBy, }) async {
|
|
// ignore: prefer_const_declarations
|
|
final path = r'/api/v3/capabilities';
|
|
|
|
// ignore: prefer_final_locals
|
|
Object? postBody;
|
|
|
|
final queryParams = <QueryParam>[];
|
|
final headerParams = <String, String>{};
|
|
final formParams = <String, String>{};
|
|
|
|
if (filters != null) {
|
|
queryParams.addAll(_queryParams('', 'filters', filters));
|
|
}
|
|
if (sortBy != null) {
|
|
queryParams.addAll(_queryParams('', 'sortBy', sortBy));
|
|
}
|
|
|
|
const contentTypes = <String>[];
|
|
|
|
|
|
return apiClient.invokeAPI(
|
|
path,
|
|
'GET',
|
|
queryParams,
|
|
postBody,
|
|
headerParams,
|
|
formParams,
|
|
contentTypes.isEmpty ? null : contentTypes.first,
|
|
);
|
|
}
|
|
|
|
/// List capabilities
|
|
///
|
|
/// Returns a collection of actions assigned to a principal in a context. The client can choose to filter the actions similar to how work packages are filtered. In addition to the provided filters, the server will reduce the result set to only contain actions, for which the requesting client has sufficient permissions
|
|
///
|
|
/// 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. + action: Get all capabilities of a certain action + principal: Get all capabilities of a principal + context: Get all capabilities within a context. Note that for a project context the client needs to provide `p{id}`, e.g. `p5` and for the global context a `g`
|
|
///
|
|
/// * [String] sortBy:
|
|
/// JSON specifying sort criteria. Accepts the same format as returned by the [queries](https://www.openproject.org/docs/api/endpoints/queries/) endpoint. Currently supported sorts are: + id: Sort by the capabilities id
|
|
Future<Object?> listCapabilities({ String? filters, String? sortBy, }) async {
|
|
final response = await listCapabilitiesWithHttpInfo( filters: filters, 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;
|
|
}
|
|
|
|
/// View action
|
|
///
|
|
/// Returns an individual action.
|
|
///
|
|
/// Note: This method returns the HTTP [Response].
|
|
///
|
|
/// Parameters:
|
|
///
|
|
/// * [String] id (required):
|
|
/// action id which is the name of the action
|
|
Future<Response> viewActionWithHttpInfo(String id,) async {
|
|
// ignore: prefer_const_declarations
|
|
final path = r'/api/v3/actions/{id}'
|
|
.replaceAll('{id}', id);
|
|
|
|
// ignore: prefer_final_locals
|
|
Object? postBody;
|
|
|
|
final queryParams = <QueryParam>[];
|
|
final headerParams = <String, String>{};
|
|
final formParams = <String, String>{};
|
|
|
|
const contentTypes = <String>[];
|
|
|
|
|
|
return apiClient.invokeAPI(
|
|
path,
|
|
'GET',
|
|
queryParams,
|
|
postBody,
|
|
headerParams,
|
|
formParams,
|
|
contentTypes.isEmpty ? null : contentTypes.first,
|
|
);
|
|
}
|
|
|
|
/// View action
|
|
///
|
|
/// Returns an individual action.
|
|
///
|
|
/// Parameters:
|
|
///
|
|
/// * [String] id (required):
|
|
/// action id which is the name of the action
|
|
Future<Object?> viewAction(String id,) async {
|
|
final response = await viewActionWithHttpInfo(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;
|
|
}
|
|
|
|
/// View capabilities
|
|
///
|
|
///
|
|
///
|
|
/// Note: This method returns the HTTP [Response].
|
|
///
|
|
/// Parameters:
|
|
///
|
|
/// * [String] id (required):
|
|
/// capability id
|
|
Future<Response> viewCapabilitiesWithHttpInfo(String id,) async {
|
|
// ignore: prefer_const_declarations
|
|
final path = r'/api/v3/capabilities/{id}'
|
|
.replaceAll('{id}', id);
|
|
|
|
// ignore: prefer_final_locals
|
|
Object? postBody;
|
|
|
|
final queryParams = <QueryParam>[];
|
|
final headerParams = <String, String>{};
|
|
final formParams = <String, String>{};
|
|
|
|
const contentTypes = <String>[];
|
|
|
|
|
|
return apiClient.invokeAPI(
|
|
path,
|
|
'GET',
|
|
queryParams,
|
|
postBody,
|
|
headerParams,
|
|
formParams,
|
|
contentTypes.isEmpty ? null : contentTypes.first,
|
|
);
|
|
}
|
|
|
|
/// View capabilities
|
|
///
|
|
///
|
|
///
|
|
/// Parameters:
|
|
///
|
|
/// * [String] id (required):
|
|
/// capability id
|
|
Future<Object?> viewCapabilities(String id,) async {
|
|
final response = await viewCapabilitiesWithHttpInfo(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;
|
|
}
|
|
|
|
/// View global context
|
|
///
|
|
/// Returns the global capability context. This context is necessary to consistently link to a context even if the context is not a project.
|
|
///
|
|
/// Note: This method returns the HTTP [Response].
|
|
Future<Response> viewGlobalContextWithHttpInfo() async {
|
|
// ignore: prefer_const_declarations
|
|
final path = r'/api/v3/capabilities/context/global';
|
|
|
|
// ignore: prefer_final_locals
|
|
Object? postBody;
|
|
|
|
final queryParams = <QueryParam>[];
|
|
final headerParams = <String, String>{};
|
|
final formParams = <String, String>{};
|
|
|
|
const contentTypes = <String>[];
|
|
|
|
|
|
return apiClient.invokeAPI(
|
|
path,
|
|
'GET',
|
|
queryParams,
|
|
postBody,
|
|
headerParams,
|
|
formParams,
|
|
contentTypes.isEmpty ? null : contentTypes.first,
|
|
);
|
|
}
|
|
|
|
/// View global context
|
|
///
|
|
/// Returns the global capability context. This context is necessary to consistently link to a context even if the context is not a project.
|
|
Future<Object?> viewGlobalContext() async {
|
|
final response = await viewGlobalContextWithHttpInfo();
|
|
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;
|
|
}
|
|
}
|