deleteObjectsOnCancel method

Future<void> deleteObjectsOnCancel({
  1. required String databaseName,
  2. required List<VirtualObject> objects,
  3. required String tableName,
  4. required String transactionId,
  5. String? catalogId,
})

For a specific governed table, provides a list of Amazon S3 objects that will be written during the current transaction and that can be automatically deleted if the transaction is canceled. Without this call, no Amazon S3 objects are automatically deleted when a transaction cancels.

The Glue ETL library function write_dynamic_frame.from_catalog() includes an option to automatically call DeleteObjectsOnCancel before writes. For more information, see Rolling Back Amazon S3 Writes.

May throw ConcurrentModificationException. May throw EntityNotFoundException. May throw InternalServiceException. May throw InvalidInputException. May throw OperationTimeoutException. May throw ResourceNotReadyException. May throw TransactionCanceledException. May throw TransactionCommittedException.

Parameter databaseName : The database that contains the governed table.

Parameter objects : A list of VirtualObject structures, which indicates the Amazon S3 objects to be deleted if the transaction cancels.

Parameter tableName : The name of the governed table.

Parameter transactionId : ID of the transaction that the writes occur in.

Parameter catalogId : The Glue data catalog that contains the governed table. Defaults to the current account ID.

Implementation

Future<void> deleteObjectsOnCancel({
  required String databaseName,
  required List<VirtualObject> objects,
  required String tableName,
  required String transactionId,
  String? catalogId,
}) async {
  final $payload = <String, dynamic>{
    'DatabaseName': databaseName,
    'Objects': objects,
    'TableName': tableName,
    'TransactionId': transactionId,
    if (catalogId != null) 'CatalogId': catalogId,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/DeleteObjectsOnCancel',
    exceptionFnMap: _exceptionFns,
  );
}