deleteSession method

Future<DeleteSessionResponse> deleteSession({
  1. required String id,
  2. String? requestOrigin,
})

Deletes the session.

May throw AccessDeniedException. May throw ConcurrentModificationException. May throw IllegalSessionStateException. May throw InternalServiceException. May throw InvalidInputException. May throw OperationTimeoutException.

Parameter id : The ID of the session to be deleted.

Parameter requestOrigin : The name of the origin of the delete session request.

Implementation

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

  return DeleteSessionResponse.fromJson(jsonResponse.body);
}