listProjects method

Future<ListProjectsOutput> listProjects({
  1. required String domainIdentifier,
  2. String? groupIdentifier,
  3. int? maxResults,
  4. String? name,
  5. String? nextToken,
  6. String? projectCategory,
  7. String? userIdentifier,
})

Lists Amazon DataZone projects.

May throw AccessDeniedException. May throw InternalServerException. May throw ThrottlingException. May throw ValidationException.

Parameter domainIdentifier : The identifier of the Amazon DataZone domain.

Parameter groupIdentifier : The identifier of a group.

Parameter maxResults : The maximum number of projects to return in a single call to ListProjects. When the number of projects to be listed is greater than the value of MaxResults, the response contains a NextToken value that you can use in a subsequent call to ListProjects to list the next set of projects.

Parameter name : The name of the project.

Parameter nextToken : When the number of projects is greater than the default value for the MaxResults parameter, or if you explicitly specify a value for MaxResults that is less than the number of projects, the response includes a pagination token named NextToken. You can specify this NextToken value in a subsequent call to ListProjects to list the next set of projects.

Parameter projectCategory : A parameter to filter projects by their category.

Parameter userIdentifier : The identifier of the Amazon DataZone user.

Implementation

Future<ListProjectsOutput> listProjects({
  required String domainIdentifier,
  String? groupIdentifier,
  int? maxResults,
  String? name,
  String? nextToken,
  String? projectCategory,
  String? userIdentifier,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    50,
  );
  final $query = <String, List<String>>{
    if (groupIdentifier != null) 'groupIdentifier': [groupIdentifier],
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (name != null) 'name': [name],
    if (nextToken != null) 'nextToken': [nextToken],
    if (projectCategory != null) 'projectCategory': [projectCategory],
    if (userIdentifier != null) 'userIdentifier': [userIdentifier],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri:
        '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/projects',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListProjectsOutput.fromJson(response);
}