Skip to content

list_code_reviews async

list_code_reviews(
    type: Type,
    *,
    config_overrides: Optional[AsyncCodeGuruReviewerClientConfig] = None,
    provider_types: Optional[ProviderTypes] = None,
    states: Optional[JobStates] = None,
    repository_names: Optional[RepositoryNames] = None,
    max_results: Optional[ListCodeReviewsMaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> ListCodeReviewsResponse

Lists all the code reviews that the customer has created in the past 90 days.

Parameters:

  • provider_types (Optional[ProviderTypes], default: None ) –

    List of provider types for filtering that needs to be applied before displaying the result. For example, providerTypes=[GitHub] lists code reviews from GitHub.

  • states (Optional[JobStates], default: None ) –

    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.

  • repository_names (Optional[RepositoryNames], default: None ) –

    List of repository names for filtering that needs to be applied before displaying the result.

  • type (Type) –

    The type of code reviews to list in the response.

  • max_results (Optional[ListCodeReviewsMaxResults], default: None ) –

    The maximum number of results that are returned per call. The default is 100.

  • next_token (Optional[NextToken], default: None ) –

    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.

Raises:

Source code in docs_src/capo_codeguru_reviewer/_services/async_code_guru_reviewer.py
async def list_code_reviews(
    self,
    type: "capo_codeguru_reviewer.types.type.Type",
    *,
    config_overrides: Optional[AsyncCodeGuruReviewerClientConfig] = None,
    provider_types: Optional[
        "capo_codeguru_reviewer.types.provider_types.ProviderTypes"
    ] = None,
    states: Optional["capo_codeguru_reviewer.types.job_states.JobStates"] = None,
    repository_names: Optional[
        "capo_codeguru_reviewer.types.repository_names.RepositoryNames"
    ] = None,
    max_results: Optional[
        "capo_codeguru_reviewer.types.list_code_reviews_max_results.ListCodeReviewsMaxResults"
    ] = None,
    next_token: Optional[
        "capo_codeguru_reviewer.types.next_token.NextToken"
    ] = None,
) -> "capo_codeguru_reviewer.types.list_code_reviews_response.ListCodeReviewsResponse":
    """<p>Lists all the code reviews that the customer has created in the past 90 days.</p>

    Args:
        provider_types: <p>List of provider types for filtering that needs to be applied before displaying the result. For example, <code>providerTypes=[GitHub]</code> lists code reviews from GitHub.</p>
        states: <p>List of states for filtering that needs to be applied before displaying the result. For example, <code>states=[Pending]</code> lists code reviews in the Pending state.</p> <p>The valid code review states are:</p> <ul> <li> <p> <code>Completed</code>: The code review is complete.</p> </li> <li> <p> <code>Pending</code>: The code review started and has not completed or failed.</p> </li> <li> <p> <code>Failed</code>: The code review failed.</p> </li> <li> <p> <code>Deleting</code>: The code review is being deleted.</p> </li> </ul>
        repository_names: <p>List of repository names for filtering that needs to be applied before displaying the result.</p>
        type: <p>The type of code reviews to list in the response.</p>
        max_results: <p>The maximum number of results that are returned per call. The default is 100.</p>
        next_token: <p>If <code>nextToken</code> is returned, there are more results available. The value of <code>nextToken</code> 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.</p>

    Raises:
        capo_codeguru_reviewer.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_codeguru_reviewer.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
        capo_codeguru_reviewer.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_codeguru_reviewer.errors.validation_exception.ValidationException: <p>The input fails to satisfy the specified constraints.</p>
        capo_codeguru_reviewer.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_codeguru_reviewer.types.list_code_reviews_request.ListCodeReviewsRequest]",
    ) -> AsyncOperationResponse[
        "capo_codeguru_reviewer.types.list_code_reviews_response.ListCodeReviewsResponse"
    ]:
        import capo_codeguru_reviewer._operations.aws_guru_frontend_service.list_code_reviews

        (
            output,
            http_response,
        ) = await capo_codeguru_reviewer._operations.aws_guru_frontend_service.list_code_reviews.async_list_code_reviews(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListCodeReviews")
    )
    input_: capo_codeguru_reviewer.types.list_code_reviews_request.ListCodeReviewsRequest = {
        "type": type
    }
    if provider_types is not None:
        input_["provider_types"] = provider_types
    if states is not None:
        input_["states"] = states
    if repository_names is not None:
        input_["repository_names"] = repository_names
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output