resumeSession method

Future<ResumeSessionResponse> resumeSession({
  1. required String sessionId,
})

Reconnects a session to a managed node after it has been disconnected. Connections can be resumed for disconnected sessions, but not terminated sessions.

May throw DoesNotExistException. May throw InternalServerError.

Parameter sessionId : The ID of the disconnected session to resume.

Implementation

Future<ResumeSessionResponse> resumeSession({
  required String sessionId,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonSSM.ResumeSession'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'SessionId': sessionId,
    },
  );

  return ResumeSessionResponse.fromJson(jsonResponse.body);
}