startCommandExecution method

Future<StartCommandExecutionOutput> startCommandExecution({
  1. required String command,
  2. required String sandboxId,
  3. CommandType? type,
})

Starts a command execution.

May throw InvalidInputException. May throw ResourceNotFoundException.

Parameter command : The command that needs to be executed.

Parameter sandboxId : A sandboxId or sandboxArn.

Parameter type : The command type.

Implementation

Future<StartCommandExecutionOutput> startCommandExecution({
  required String command,
  required String sandboxId,
  CommandType? type,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'CodeBuild_20161006.StartCommandExecution'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'command': command,
      'sandboxId': sandboxId,
      if (type != null) 'type': type.value,
    },
  );

  return StartCommandExecutionOutput.fromJson(jsonResponse.body);
}