batchDeleteTableVersion method

Future<BatchDeleteTableVersionResponse> batchDeleteTableVersion({
  1. required String databaseName,
  2. required String tableName,
  3. required List<String> versionIds,
  4. String? catalogId,
})

Deletes a specified batch of versions of a table.

May throw EntityNotFoundException. May throw InvalidInputException. May throw InternalServiceException. May throw OperationTimeoutException.

Parameter databaseName : The database in the catalog in which the table resides. For Hive compatibility, this name is entirely lowercase.

Parameter tableName : The name of the table. For Hive compatibility, this name is entirely lowercase.

Parameter versionIds : A list of the IDs of versions to be deleted. A VersionId is a string representation of an integer. Each version is incremented by 1.

Parameter catalogId : The ID of the Data Catalog where the tables reside. If none is provided, the AWS account ID is used by default.

Implementation

Future<BatchDeleteTableVersionResponse> batchDeleteTableVersion({
  required String databaseName,
  required String tableName,
  required List<String> versionIds,
  String? catalogId,
}) async {
  ArgumentError.checkNotNull(databaseName, 'databaseName');
  _s.validateStringLength(
    'databaseName',
    databaseName,
    1,
    255,
    isRequired: true,
  );
  ArgumentError.checkNotNull(tableName, 'tableName');
  _s.validateStringLength(
    'tableName',
    tableName,
    1,
    255,
    isRequired: true,
  );
  ArgumentError.checkNotNull(versionIds, 'versionIds');
  _s.validateStringLength(
    'catalogId',
    catalogId,
    1,
    255,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSGlue.BatchDeleteTableVersion'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'DatabaseName': databaseName,
      'TableName': tableName,
      'VersionIds': versionIds,
      if (catalogId != null) 'CatalogId': catalogId,
    },
  );

  return BatchDeleteTableVersionResponse.fromJson(jsonResponse.body);
}