listProjects method
- String? nextToken,
- ProjectSortByType? sortBy,
- SortOrderType? sortOrder,
Gets a list of build project names, with each build project name representing a single build project.
May throw InvalidInputException.
Parameter nextToken
:
During a previous call, if there are more than 100 items in the list, only
the first 100 items are returned, along with a unique string called a
nextToken. To get the next batch of items in the list, call this
operation again, adding the next token to the call. To get all of the
items in the list, keep calling this operation with each subsequent next
token that is returned, until no more next tokens are returned.
Parameter sortBy
:
The criterion to be used to list build project names. Valid values
include:
-
CREATED_TIME
: List based on when each build project was created. -
LAST_MODIFIED_TIME
: List based on when information about each build project was last changed. -
NAME
: List based on each build project's name.
sortOrder
to specify in what order to list the build
project names based on the preceding criteria.
Parameter sortOrder
:
The order in which to list build projects. Valid values include:
-
ASCENDING
: List in ascending order. -
DESCENDING
: List in descending order.
sortBy
to specify the criterion to be used to list build
project names.
Implementation
Future<ListProjectsOutput> listProjects({
String? nextToken,
ProjectSortByType? sortBy,
SortOrderType? sortOrder,
}) async {
_s.validateStringLength(
'nextToken',
nextToken,
1,
1152921504606846976,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'CodeBuild_20161006.ListProjects'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
if (nextToken != null) 'nextToken': nextToken,
if (sortBy != null) 'sortBy': sortBy.toValue(),
if (sortOrder != null) 'sortOrder': sortOrder.toValue(),
},
);
return ListProjectsOutput.fromJson(jsonResponse.body);
}