runStatement method

Future<RunStatementResponse> runStatement({
  1. required String code,
  2. required String sessionId,
  3. String? requestOrigin,
})

Executes the statement.

May throw AccessDeniedException. May throw EntityNotFoundException. May throw IllegalSessionStateException. May throw InternalServiceException. May throw InvalidInputException. May throw OperationNotSupportedException. May throw OperationTimeoutException. May throw ResourceNumberLimitExceededException. May throw SessionBusyException. May throw ValidationException.

Parameter code : The statement code to be run.

Parameter sessionId : The Session Id of the statement to be run.

Parameter requestOrigin : The origin of the request.

Implementation

Future<RunStatementResponse> runStatement({
  required String code,
  required String sessionId,
  String? requestOrigin,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSGlue.RunStatement'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Code': code,
      'SessionId': sessionId,
      if (requestOrigin != null) 'RequestOrigin': requestOrigin,
    },
  );

  return RunStatementResponse.fromJson(jsonResponse.body);
}