listPermissions method

Future<ListPermissionsResponse> listPermissions({
  1. String? catalogId,
  2. int? maxResults,
  3. String? nextToken,
  4. DataLakePrincipal? principal,
  5. Resource? resource,
  6. DataLakeResourceType? resourceType,
})

Returns a list of the principal permissions on the resource, filtered by the permissions of the caller. For example, if you are granted an ALTER permission, you are able to see only the principal permissions for ALTER.

This operation returns only those permissions that have been explicitly granted.

For information about permissions, see Security and Access Control to Metadata and Data.

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

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.

Parameter principal : Specifies a principal to filter the permissions returned.

Parameter resource : A resource where you will get a list of the principal permissions.

This operation does not support getting privileges on a table with columns. Instead, call this operation on the table, and the operation returns the table and the table w columns.

Parameter resourceType : Specifies a resource type to filter the permissions returned.

Implementation

Future<ListPermissionsResponse> listPermissions({
  String? catalogId,
  int? maxResults,
  String? nextToken,
  DataLakePrincipal? principal,
  Resource? resource,
  DataLakeResourceType? resourceType,
}) async {
  _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.ListPermissions'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (catalogId != null) 'CatalogId': catalogId,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
      if (principal != null) 'Principal': principal,
      if (resource != null) 'Resource': resource,
      if (resourceType != null) 'ResourceType': resourceType.toValue(),
    },
  );

  return ListPermissionsResponse.fromJson(jsonResponse.body);
}