deleteTapeArchive method

Future<DeleteTapeArchiveOutput> deleteTapeArchive({
  1. required String tapeARN,
  2. bool? bypassGovernanceRetention,
})

Deletes the specified virtual tape from the virtual tape shelf (VTS). This operation is only supported in the tape gateway type.

May throw InvalidGatewayRequestException. May throw InternalServerError.

Parameter tapeARN : The Amazon Resource Name (ARN) of the virtual tape to delete from the virtual tape shelf (VTS).

Parameter bypassGovernanceRetention : Set to TRUE to delete an archived tape that belongs to a custom pool with tape retention lock. Only archived tapes with tape retention lock set to governance can be deleted. Archived tapes with tape retention lock set to compliance can't be deleted.

Implementation

Future<DeleteTapeArchiveOutput> deleteTapeArchive({
  required String tapeARN,
  bool? bypassGovernanceRetention,
}) async {
  ArgumentError.checkNotNull(tapeARN, 'tapeARN');
  _s.validateStringLength(
    'tapeARN',
    tapeARN,
    50,
    500,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'StorageGateway_20130630.DeleteTapeArchive'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'TapeARN': tapeARN,
      if (bypassGovernanceRetention != null)
        'BypassGovernanceRetention': bypassGovernanceRetention,
    },
  );

  return DeleteTapeArchiveOutput.fromJson(jsonResponse.body);
}