Skip to content

list_repository_associations async

list_repository_associations(
    *,
    config_overrides: Optional[AsyncCodeGuruReviewerClientConfig] = None,
    provider_types: Optional[ProviderTypes] = None,
    states: Optional[RepositoryAssociationStates] = None,
    names: Optional[Names] = None,
    owners: Optional[Owners] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> ListRepositoryAssociationsResponse

Returns a list of RepositoryAssociationSummary objects that contain summary information about a repository association. You can filter the returned list by ProviderType, Name, State, and Owner.

Parameters:

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

    List of provider types to use as a filter.

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

    List of repository association states to use as a filter.

    The valid repository association states are:

    • Associated: The repository association is complete.

    • Associating: CodeGuru Reviewer is:

      • Setting up pull request notifications. This is required for pull requests to trigger a CodeGuru Reviewer review.

        If your repository ProviderType is GitHub, GitHub Enterprise Server, or Bitbucket, CodeGuru Reviewer creates webhooks in your repository to trigger CodeGuru Reviewer reviews. If you delete these webhooks, reviews of code in your repository cannot be triggered.

      • Setting up source code access. This is required for CodeGuru Reviewer to securely clone code in your repository.

    • Failed: The repository failed to associate or disassociate.

    • Disassociating: CodeGuru Reviewer is removing the repository's pull request notifications and source code access.

    • Disassociated: CodeGuru Reviewer successfully disassociated the repository. You can create a new association with this repository if you want to review source code in it later. You can control access to code reviews created in anassociated repository with tags after it has been disassociated. For more information, see Using tags to control access to associated repositories in the Amazon CodeGuru Reviewer User Guide.

  • names (Optional[Names], default: None ) –

    List of repository names to use as a filter.

  • owners (Optional[Owners], default: None ) –

    List of owners to use as a filter. For Amazon Web Services CodeCommit, it is the name of the CodeCommit account that was used to associate the repository. For other repository source providers, such as Bitbucket and GitHub Enterprise Server, this is name of the account that was used to associate the repository.

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

    The maximum number of repository association results returned by ListRepositoryAssociations in paginated output. When this parameter is used, ListRepositoryAssociations only returns maxResults results in a single page with a nextToken response element. The remaining results of the initial request can be seen by sending another ListRepositoryAssociations request with the returned nextToken value. This value can be between 1 and 100. If this parameter is not used, ListRepositoryAssociations returns up to 100 results and a nextToken value if applicable.

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

    The nextToken value returned from a previous paginated ListRepositoryAssociations request where maxResults was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the nextToken value.

    Treat this token as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.

Raises:

Source code in docs_src/capo_codeguru_reviewer/_services/async_code_guru_reviewer.py
async def list_repository_associations(
    self,
    *,
    config_overrides: Optional[AsyncCodeGuruReviewerClientConfig] = None,
    provider_types: Optional[
        "capo_codeguru_reviewer.types.provider_types.ProviderTypes"
    ] = None,
    states: Optional[
        "capo_codeguru_reviewer.types.repository_association_states.RepositoryAssociationStates"
    ] = None,
    names: Optional["capo_codeguru_reviewer.types.names.Names"] = None,
    owners: Optional["capo_codeguru_reviewer.types.owners.Owners"] = None,
    max_results: Optional[
        "capo_codeguru_reviewer.types.max_results.MaxResults"
    ] = None,
    next_token: Optional[
        "capo_codeguru_reviewer.types.next_token.NextToken"
    ] = None,
) -> "capo_codeguru_reviewer.types.list_repository_associations_response.ListRepositoryAssociationsResponse":
    """<p>Returns a list of <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociationSummary.html">RepositoryAssociationSummary</a> objects that contain summary information about a repository association. You can filter the returned list by <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociationSummary.html#reviewer-Type-RepositoryAssociationSummary-ProviderType">ProviderType</a>, <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociationSummary.html#reviewer-Type-RepositoryAssociationSummary-Name">Name</a>, <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociationSummary.html#reviewer-Type-RepositoryAssociationSummary-State">State</a>, and <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociationSummary.html#reviewer-Type-RepositoryAssociationSummary-Owner">Owner</a>.</p>

    Args:
        provider_types: <p>List of provider types to use as a filter.</p>
        states: <p>List of repository association states to use as a filter.</p> <p>The valid repository association states are:</p> <ul> <li> <p> <b>Associated</b>: The repository association is complete.</p> </li> <li> <p> <b>Associating</b>: CodeGuru Reviewer is:</p> <ul> <li> <p>Setting up pull request notifications. This is required for pull requests to trigger a CodeGuru Reviewer review.</p> <note> <p>If your repository <code>ProviderType</code> is <code>GitHub</code>, <code>GitHub Enterprise Server</code>, or <code>Bitbucket</code>, CodeGuru Reviewer creates webhooks in your repository to trigger CodeGuru Reviewer reviews. If you delete these webhooks, reviews of code in your repository cannot be triggered.</p> </note> </li> <li> <p>Setting up source code access. This is required for CodeGuru Reviewer to securely clone code in your repository.</p> </li> </ul> </li> <li> <p> <b>Failed</b>: The repository failed to associate or disassociate.</p> </li> <li> <p> <b>Disassociating</b>: CodeGuru Reviewer is removing the repository's pull request notifications and source code access.</p> </li> <li> <p> <b>Disassociated</b>: CodeGuru Reviewer successfully disassociated the repository. You can create a new association with this repository if you want to review source code in it later. You can control access to code reviews created in anassociated repository with tags after it has been disassociated. For more information, see <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-ug/auth-and-access-control-using-tags.html">Using tags to control access to associated repositories</a> in the <i>Amazon CodeGuru Reviewer User Guide</i>.</p> </li> </ul>
        names: <p>List of repository names to use as a filter.</p>
        owners: <p>List of owners to use as a filter. For Amazon Web Services CodeCommit, it is the name of the CodeCommit account that was used to associate the repository. For other repository source providers, such as Bitbucket and GitHub Enterprise Server, this is name of the account that was used to associate the repository. </p>
        max_results: <p>The maximum number of repository association results returned by <code>ListRepositoryAssociations</code> in paginated output. When this parameter is used, <code>ListRepositoryAssociations</code> only returns <code>maxResults</code> results in a single page with a <code>nextToken</code> response element. The remaining results of the initial request can be seen by sending another <code>ListRepositoryAssociations</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 100. If this parameter is not used, <code>ListRepositoryAssociations</code> returns up to 100 results and a <code>nextToken</code> value if applicable. </p>
        next_token: <p>The <code>nextToken</code> value returned from a previous paginated <code>ListRepositoryAssociations</code> request where <code>maxResults</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value. </p> <note> <p>Treat this token as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.</p> </note>

    Raises:
        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_repository_associations_request.ListRepositoryAssociationsRequest]",
    ) -> AsyncOperationResponse[
        "capo_codeguru_reviewer.types.list_repository_associations_response.ListRepositoryAssociationsResponse"
    ]:
        import capo_codeguru_reviewer._operations.aws_guru_frontend_service.list_repository_associations

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListRepositoryAssociations")
    )
    input_: capo_codeguru_reviewer.types.list_repository_associations_request.ListRepositoryAssociationsRequest = {}
    if provider_types is not None:
        input_["provider_types"] = provider_types
    if states is not None:
        input_["states"] = states
    if names is not None:
        input_["names"] = names
    if owners is not None:
        input_["owners"] = owners
    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