resumeSession method

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

Reconnects a session to an instance 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 {
  ArgumentError.checkNotNull(sessionId, 'sessionId');
  _s.validateStringLength(
    'sessionId',
    sessionId,
    1,
    96,
    isRequired: true,
  );
  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);
}