getTasksIDRuns method
List runs for a task
Parameters:
-
String taskID (required): The ID of the task to get runs for.
-
String zapTraceSpan: OpenTracing span context
-
String after: Returns runs after a specific ID.
-
int limit: The number of runs to return
-
DateTime afterTime: Filter runs to those scheduled after this time, RFC3339
-
DateTime beforeTime: Filter runs to those scheduled before this time, RFC3339
Implementation
Future<Runs> getTasksIDRuns(String taskID,
{String? zapTraceSpan,
String? after,
int? limit,
DateTime? afterTime,
DateTime? beforeTime}) async {
final response = await getTasksIDRunsWithHttpInfo(taskID,
zapTraceSpan: zapTraceSpan,
after: after,
limit: limit,
afterTime: afterTime,
beforeTime: beforeTime);
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),
'Runs',
) as Runs;
}
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}