listDeploymentTargets method

Future<ListDeploymentTargetsOutput> listDeploymentTargets({
  1. String? deploymentId,
  2. String? nextToken,
  3. Map<TargetFilterName, List<String>>? targetFilters,
})

Returns an array of target IDs that are associated a deployment.

May throw DeploymentIdRequiredException. May throw DeploymentDoesNotExistException. May throw DeploymentNotStartedException. May throw InvalidNextTokenException. May throw InvalidDeploymentIdException. May throw InvalidInstanceStatusException. May throw InvalidInstanceTypeException. May throw InvalidDeploymentInstanceTypeException.

Parameter deploymentId : The unique ID of a deployment.

Parameter nextToken : A token identifier returned from the previous ListDeploymentTargets call. It can be used to return the next set of deployment targets in the list.

Parameter targetFilters : A key used to filter the returned targets. The two valid values are:

  • TargetStatus - A TargetStatus filter string can be Failed, InProgress, Pending, Ready, Skipped, Succeeded, or Unknown.
  • ServerInstanceLabel - A ServerInstanceLabel filter string can be Blue or Green.

Implementation

Future<ListDeploymentTargetsOutput> listDeploymentTargets({
  String? deploymentId,
  String? nextToken,
  Map<TargetFilterName, List<String>>? targetFilters,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'CodeDeploy_20141006.ListDeploymentTargets'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (deploymentId != null) 'deploymentId': deploymentId,
      if (nextToken != null) 'nextToken': nextToken,
      if (targetFilters != null)
        'targetFilters':
            targetFilters.map((k, e) => MapEntry(k.toValue(), e)),
    },
  );

  return ListDeploymentTargetsOutput.fromJson(jsonResponse.body);
}