batchGrantPermissions method

Future<BatchGrantPermissionsResponse> batchGrantPermissions({
  1. required List<BatchPermissionsRequestEntry> entries,
  2. String? catalogId,
})

Batch operation to grant permissions to the principal.

May throw InvalidInputException. May throw OperationTimeoutException.

Parameter entries : A list of up to 20 entries for resource permissions to be granted by batch operation to the principal.

Parameter catalogId : The identifier for the Data Catalog. By default, the account ID. The Data Catalog is the persistent metadata store. It contains database definitions, table definitions, and other control information to manage your AWS Lake Formation environment.

Implementation

Future<BatchGrantPermissionsResponse> batchGrantPermissions({
  required List<BatchPermissionsRequestEntry> entries,
  String? catalogId,
}) async {
  ArgumentError.checkNotNull(entries, 'entries');
  _s.validateStringLength(
    'catalogId',
    catalogId,
    1,
    255,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSLakeFormation.BatchGrantPermissions'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Entries': entries,
      if (catalogId != null) 'CatalogId': catalogId,
    },
  );

  return BatchGrantPermissionsResponse.fromJson(jsonResponse.body);
}