describeDeployments method

Future<DescribeDeploymentsResult> describeDeployments({
  1. String? appId,
  2. List<String>? deploymentIds,
  3. String? stackId,
})

Requests a description of a specified set of deployments. Required Permissions: To use this action, an IAM user must have a Show, Deploy, or Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information about user permissions, see Managing User Permissions.

May throw ValidationException. May throw ResourceNotFoundException.

Parameter appId : The app ID. If you include this parameter, the command returns a description of the commands associated with the specified app.

Parameter deploymentIds : An array of deployment IDs to be described. If you include this parameter, the command returns a description of the specified deployments. Otherwise, it returns a description of every deployment.

Parameter stackId : The stack ID. If you include this parameter, the command returns a description of the commands associated with the specified stack.

Implementation

Future<DescribeDeploymentsResult> describeDeployments({
  String? appId,
  List<String>? deploymentIds,
  String? stackId,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'OpsWorks_20130218.DescribeDeployments'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (appId != null) 'AppId': appId,
      if (deploymentIds != null) 'DeploymentIds': deploymentIds,
      if (stackId != null) 'StackId': stackId,
    },
  );

  return DescribeDeploymentsResult.fromJson(jsonResponse.body);
}