getCommandExecution method

Future<GetCommandExecutionResponse> getCommandExecution({
  1. required String executionId,
  2. required String targetArn,
  3. bool? includeResult,
})

Gets information about the specific command execution on a single device.

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

Parameter executionId : The unique identifier for the command execution. This information is returned as a response of the StartCommandExecution API request.

Parameter targetArn : The Amazon Resource Number (ARN) of the device on which the command execution is being performed.

Parameter includeResult : Can be used to specify whether to include the result of the command execution in the GetCommandExecution API response. Your device can use this field to provide additional information about the command execution. You only need to specify this field when using the AWS-IoT namespace.

Implementation

Future<GetCommandExecutionResponse> getCommandExecution({
  required String executionId,
  required String targetArn,
  bool? includeResult,
}) async {
  final $query = <String, List<String>>{
    'targetArn': [targetArn],
    if (includeResult != null) 'includeResult': [includeResult.toString()],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/command-executions/${Uri.encodeComponent(executionId)}',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return GetCommandExecutionResponse.fromJson(response);
}