restoreBackup method

Future<RestoreBackupResponse> restoreBackup({
  1. required String backupId,
})

Restores a specified AWS CloudHSM backup that is in the PENDING_DELETION state. For mor information on deleting a backup, see DeleteBackup.

May throw CloudHsmAccessDeniedException. May throw CloudHsmInternalFailureException. May throw CloudHsmInvalidRequestException. May throw CloudHsmResourceNotFoundException. May throw CloudHsmServiceException.

Parameter backupId : The ID of the backup to be restored. To find the ID of a backup, use the DescribeBackups operation.

Implementation

Future<RestoreBackupResponse> restoreBackup({
  required String backupId,
}) async {
  ArgumentError.checkNotNull(backupId, 'backupId');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'BaldrApiService.RestoreBackup'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'BackupId': backupId,
    },
  );

  return RestoreBackupResponse.fromJson(jsonResponse.body);
}