getTasks method

Future<Tasks> getTasks({
  1. String? zapTraceSpan,
  2. String? name,
  3. String? after,
  4. String? user,
  5. String? org,
  6. String? orgID,
  7. String? status,
  8. int? limit,
  9. String? type,
})

List all tasks

Parameters:

  • String zapTraceSpan: OpenTracing span context

  • String name: Returns task with a specific name.

  • String after: Return tasks after a specified ID.

  • String user: Filter tasks to a specific user ID.

  • String org: Filter tasks to a specific organization name.

  • String orgID: Filter tasks to a specific organization ID.

  • String status: Filter tasks by a status--"inactive" or "active".

  • int limit: The number of tasks to return

  • String type: Type of task, unset by default.

Implementation

Future<Tasks> getTasks(
    {String? zapTraceSpan,
    String? name,
    String? after,
    String? user,
    String? org,
    String? orgID,
    String? status,
    int? limit,
    String? type}) async {
  final response = await getTasksWithHttpInfo(
      zapTraceSpan: zapTraceSpan,
      name: name,
      after: after,
      user: user,
      org: org,
      orgID: orgID,
      status: status,
      limit: limit,
      type: type);
  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.statusCode != HttpStatus.noContent) {
    return await apiClient.deserializeAsync(
      await _decodeBodyBytes(response),
      'Tasks',
    ) as Tasks;
  }
  throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}