restoreWorkspace method

Future<void> restoreWorkspace({
  1. required String workspaceId,
})

Restores the specified WorkSpace to its last known healthy state.

You cannot restore a WorkSpace unless its state is AVAILABLE, ERROR, UNHEALTHY, or STOPPED.

Restoring a WorkSpace is a potentially destructive action that can result in the loss of data. For more information, see Restore a WorkSpace.

This operation is asynchronous and returns before the WorkSpace is completely restored.

May throw InvalidParameterValuesException. May throw ResourceNotFoundException. May throw AccessDeniedException.

Parameter workspaceId : The identifier of the WorkSpace.

Implementation

Future<void> restoreWorkspace({
  required String workspaceId,
}) async {
  ArgumentError.checkNotNull(workspaceId, 'workspaceId');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'WorkspacesService.RestoreWorkspace'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'WorkspaceId': workspaceId,
    },
  );
}