getCanaryRuns method

Future<GetCanaryRunsResponse> getCanaryRuns({
  1. required String name,
  2. String? dryRunId,
  3. int? maxResults,
  4. String? nextToken,
  5. RunType? runType,
})

Retrieves a list of runs for a specified canary.

May throw InternalServerException. May throw ResourceNotFoundException. May throw ValidationException.

Parameter name : The name of the canary that you want to see runs for.

Parameter dryRunId : The DryRunId associated with an existing canary’s dry run. You can use this DryRunId to retrieve information about the dry run.

Parameter maxResults : Specify this parameter to limit how many runs are returned each time you use the GetCanaryRuns operation. If you omit this parameter, the default of 100 is used.

Parameter nextToken : A token that indicates that there is more data available. You can use this token in a subsequent GetCanaryRuns operation to retrieve the next set of results.

Parameter runType :

  • When you provide RunType=CANARY_RUN and dryRunId, you will get an exception
  • When a value is not provided for RunType, the default value is CANARY_RUN
  • When CANARY_RUN is provided, all canary runs excluding dry runs are returned
  • When DRY_RUN is provided, all dry runs excluding canary runs are returned

Implementation

Future<GetCanaryRunsResponse> getCanaryRuns({
  required String name,
  String? dryRunId,
  int? maxResults,
  String? nextToken,
  RunType? runType,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final $payload = <String, dynamic>{
    if (dryRunId != null) 'DryRunId': dryRunId,
    if (maxResults != null) 'MaxResults': maxResults,
    if (nextToken != null) 'NextToken': nextToken,
    if (runType != null) 'RunType': runType.value,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/canary/${Uri.encodeComponent(name)}/runs',
    exceptionFnMap: _exceptionFns,
  );
  return GetCanaryRunsResponse.fromJson(response);
}