cancelArchival method

Future<CancelArchivalOutput> cancelArchival({
  1. required String gatewayARN,
  2. required String tapeARN,
})

Cancels archiving of a virtual tape to the virtual tape shelf (VTS) after the archiving process is initiated. 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 archiving for.

Implementation

Future<CancelArchivalOutput> cancelArchival({
  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.CancelArchival'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'GatewayARN': gatewayARN,
      'TapeARN': tapeARN,
    },
  );

  return CancelArchivalOutput.fromJson(jsonResponse.body);
}