getSession method

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

Retrieves the session.

May throw AccessDeniedException. May throw EntityNotFoundException. May throw InternalServiceException. May throw InvalidInputException. May throw OperationTimeoutException.

Parameter id : The ID of the session.

Parameter requestOrigin : The origin of the request.

Implementation

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

  return GetSessionResponse.fromJson(jsonResponse.body);
}