listProjectPolicies method

Future<ListProjectPoliciesResponse> listProjectPolicies({
  1. required String projectArn,
  2. int? maxResults,
  3. String? nextToken,
})
Gets a list of the project policies attached to a project.

To attach a project policy to a project, call PutProjectPolicy. To remove a project policy from a project, call DeleteProjectPolicy.

This operation requires permissions to perform the rekognition:ListProjectPolicies action.

May throw AccessDeniedException. May throw InternalServerError. May throw InvalidPaginationTokenException. May throw InvalidParameterException. May throw ProvisionedThroughputExceededException. May throw ResourceNotFoundException. May throw ThrottlingException.

Parameter projectArn : The ARN of the project for which you want to list the project policies.

Parameter maxResults : The maximum number of results to return per paginated call. The largest value you can specify is 5. If you specify a value greater than 5, a ValidationException error occurs. The default value is 5.

Parameter nextToken : If the previous response was incomplete (because there is more results to retrieve), Amazon Rekognition Custom Labels returns a pagination token in the response. You can use this pagination token to retrieve the next set of results.

Implementation

Future<ListProjectPoliciesResponse> listProjectPolicies({
  required String projectArn,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    5,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'RekognitionService.ListProjectPolicies'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ProjectArn': projectArn,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return ListProjectPoliciesResponse.fromJson(jsonResponse.body);
}