listCodeReviews method
Lists all the code reviews that the customer has created in the past 90 days.
May throw AccessDeniedException.
May throw InternalServerException.
May throw ThrottlingException.
May throw ValidationException.
Parameter type :
The type of code reviews to list in the response.
Parameter maxResults :
The maximum number of results that are returned per call. The default is
100.
Parameter nextToken :
If nextToken is returned, there are more results available.
The value of nextToken is a unique pagination token for each
page. Make the call again using the returned token to retrieve the next
page. Keep all other arguments unchanged.
Parameter providerTypes :
List of provider types for filtering that needs to be applied before
displaying the result. For example, providerTypes=[GitHub]
lists code reviews from GitHub.
Parameter repositoryNames :
List of repository names for filtering that needs to be applied before
displaying the result.
Parameter states :
List of states for filtering that needs to be applied before displaying
the result. For example, states=[Pending] lists code
reviews in the Pending state.
The valid code review states are:
-
Completed: The code review is complete. -
Pending: The code review started and has not completed or failed. -
Failed: The code review failed. -
Deleting: The code review is being deleted.
Implementation
Future<ListCodeReviewsResponse> listCodeReviews({
required Type type,
int? maxResults,
String? nextToken,
List<ProviderType>? providerTypes,
List<String>? repositoryNames,
List<JobState>? states,
}) async {
_s.validateNumRange(
'maxResults',
maxResults,
1,
100,
);
final $query = <String, List<String>>{
'Type': [type.value],
if (maxResults != null) 'MaxResults': [maxResults.toString()],
if (nextToken != null) 'NextToken': [nextToken],
if (providerTypes != null)
'ProviderTypes': providerTypes.map((e) => e.value).toList(),
if (repositoryNames != null) 'RepositoryNames': repositoryNames,
if (states != null) 'States': states.map((e) => e.value).toList(),
};
final response = await _protocol.send(
payload: null,
method: 'GET',
requestUri: '/codereviews',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return ListCodeReviewsResponse.fromJson(response);
}