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 IAM user or AWS account.

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

Parameter applicationName : The name of an AWS CodeDeploy application associated with the IAM user or AWS 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 {
  _s.validateStringLength(
    'applicationName',
    applicationName,
    1,
    100,
  );
  _s.validateStringLength(
    'deploymentGroupName',
    deploymentGroupName,
    1,
    100,
  );
  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.toValue()).toList(),
      if (nextToken != null) 'nextToken': nextToken,
    },
  );

  return ListDeploymentsOutput.fromJson(jsonResponse.body);
}