cancelRetrieval method

Future<CancelRetrievalOutput> cancelRetrieval({
  1. required String gatewayARN,
  2. required String tapeARN,
})

Cancels retrieval of a virtual tape from the virtual tape shelf (VTS) to a gateway after the retrieval process is initiated. The virtual tape is returned to the 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 you want to cancel retrieval for.

Implementation

Future<CancelRetrievalOutput> cancelRetrieval({
  required String gatewayARN,
  required String tapeARN,
}) async {
  ArgumentError.checkNotNull(gatewayARN, 'gatewayARN');
  _s.validateStringLength(
    'gatewayARN',
    gatewayARN,
    50,
    500,
    isRequired: true,
  );
  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.CancelRetrieval'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'GatewayARN': gatewayARN,
      'TapeARN': tapeARN,
    },
  );

  return CancelRetrievalOutput.fromJson(jsonResponse.body);
}