getEffectivePermissionsForPath method

Future<GetEffectivePermissionsForPathResponse> getEffectivePermissionsForPath({
  1. required String resourceArn,
  2. String? catalogId,
  3. int? maxResults,
  4. String? nextToken,
})

Returns the Lake Formation permissions for a specified table or database resource located at a path in Amazon S3. GetEffectivePermissionsForPath will not return databases and tables if the catalog is encrypted.

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

Parameter resourceArn : The Amazon Resource Name (ARN) of the resource for which you want to get permissions.

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.

Parameter maxResults : The maximum number of results to return.

Parameter nextToken : A continuation token, if this is not the first call to retrieve this list.

Implementation

Future<GetEffectivePermissionsForPathResponse>
    getEffectivePermissionsForPath({
  required String resourceArn,
  String? catalogId,
  int? maxResults,
  String? nextToken,
}) async {
  ArgumentError.checkNotNull(resourceArn, 'resourceArn');
  _s.validateStringLength(
    'catalogId',
    catalogId,
    1,
    255,
  );
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    1000,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSLakeFormation.GetEffectivePermissionsForPath'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ResourceArn': resourceArn,
      if (catalogId != null) 'CatalogId': catalogId,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return GetEffectivePermissionsForPathResponse.fromJson(jsonResponse.body);
}