batchUpdatePartition method

Future<BatchUpdatePartitionResponse> batchUpdatePartition({
  1. required String databaseName,
  2. required List<BatchUpdatePartitionRequestEntry> entries,
  3. required String tableName,
  4. String? catalogId,
})

Updates one or more partitions in a batch operation.

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

Parameter databaseName : The name of the metadata database in which the partition is to be updated.

Parameter entries : A list of up to 100 BatchUpdatePartitionRequestEntry objects to update.

Parameter tableName : The name of the metadata table in which the partition is to be updated.

Parameter catalogId : The ID of the catalog in which the partition is to be updated. Currently, this should be the AWS account ID.

Implementation

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

  return BatchUpdatePartitionResponse.fromJson(jsonResponse.body);
}