listDeployments method

Future<ListDeploymentsOutput> listDeployments({
  1. String? applicationName,
  2. TimeRange? createTimeRange,
  3. String? deploymentGroupName,
  4. String? externalId,
  5. List<DeploymentStatus>? includeOnlyStatuses,
  6. String? nextToken,
})

Lists the deployments in a deployment group for an application registered with the user or Amazon Web Services account.

May throw ApplicationDoesNotExistException. May throw ApplicationNameRequiredException. May throw DeploymentGroupDoesNotExistException. May throw DeploymentGroupNameRequiredException. May throw InvalidApplicationNameException. May throw InvalidDeploymentGroupNameException. May throw InvalidDeploymentStatusException. May throw InvalidExternalIdException. May throw InvalidInputException. May throw InvalidNextTokenException. May throw InvalidTimeRangeException.

Parameter applicationName : The name of an CodeDeploy application associated with the user or Amazon Web Services account.

Parameter createTimeRange : A time range (start and end) for returning a subset of the list of deployments.

Parameter deploymentGroupName : The name of a deployment group for the specified application.

Parameter externalId : The unique ID of an external resource for returning deployments linked to the external resource.

Parameter includeOnlyStatuses : A subset of deployments to list by status:

  • Created: Include created deployments in the resulting list.
  • Queued: Include queued deployments in the resulting list.
  • In Progress: Include in-progress deployments in the resulting list.
  • Succeeded: Include successful deployments in the resulting list.
  • Failed: Include failed deployments in the resulting list.
  • Stopped: Include stopped deployments in the resulting list.

Parameter nextToken : An identifier returned from the previous list deployments call. It can be used to return the next set of deployments in the list.

Implementation

Future<ListDeploymentsOutput> listDeployments({
  String? applicationName,
  TimeRange? createTimeRange,
  String? deploymentGroupName,
  String? externalId,
  List<DeploymentStatus>? includeOnlyStatuses,
  String? nextToken,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'CodeDeploy_20141006.ListDeployments'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (applicationName != null) 'applicationName': applicationName,
      if (createTimeRange != null) 'createTimeRange': createTimeRange,
      if (deploymentGroupName != null)
        'deploymentGroupName': deploymentGroupName,
      if (externalId != null) 'externalId': externalId,
      if (includeOnlyStatuses != null)
        'includeOnlyStatuses':
            includeOnlyStatuses.map((e) => e.value).toList(),
      if (nextToken != null) 'nextToken': nextToken,
    },
  );

  return ListDeploymentsOutput.fromJson(jsonResponse.body);
}