deleteBackup method

Future<DeleteBackupResponse> deleteBackup({
  1. required String backupId,
})

Deletes a specified AWS CloudHSM backup. A backup can be restored up to 7 days after the DeleteBackup request is made. For more information on restoring a backup, see RestoreBackup.

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

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

Implementation

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

  return DeleteBackupResponse.fromJson(jsonResponse.body);
}