Skip to content

list_git_branches async

list_git_branches(
    provider: GitProvider,
    owner: GitOwnerName,
    repository_path: GitRepositoryPath,
    *,
    config_overrides: Optional[AsyncAmplifyGen3ClientConfig] = None,
    repository_name: Optional[GitRepositoryName] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> ListGitBranchesResponse

Lists the branches of a repository. The AWS Management Console uses this operation to show the branches that you can choose from when you create an app.

Parameters:

  • provider (GitProvider) –

    The Git provider.

  • owner (GitOwnerName) –

    The account that the Git connection is for. The value depends on the provider:

    • For GitHub, specify the user or organization name.

    • For GitLab, specify the user name.

    To get this value, call ListGitConnections.

  • repository_name (Optional[GitRepositoryName], default: None ) –

    The name of the repository, which is the last segment of RepositoryPath.

  • repository_path (GitRepositoryPath) –

    The full path of the repository in the Git provider, for example my-org/my-app. GitLab paths can include subgroups, for example my-group/subgroup/my-app. To get this value, call ListRepositories.

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

    The maximum number of results to return in a single response.

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

    The pagination token returned in a previous response, used to retrieve the next page of results.

Raises:

  • AccessDeniedException –

    You do not have sufficient permissions to perform this action.

  • GitConnectionDisconnectedException –

    The Git connection doesn't exist, or the Git provider no longer accepts its access. For example, the app was uninstalled or access was revoked. Reconnect the Git provider account, and then try again.

  • InternalServerException –

    An internal error occurred. Retry the request.

  • ThrottlingException –

    The request was denied because the request rate exceeds the allowed limit.

  • ValidationException –

    The request contains invalid parameters or is otherwise malformed.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_amplifygen3/_services/async_amplify_gen3.py
async def list_git_branches(
    self,
    provider: "capo_amplifygen3.types.git_provider.GitProvider",
    owner: "capo_amplifygen3.types.git_owner_name.GitOwnerName",
    repository_path: "capo_amplifygen3.types.git_repository_path.GitRepositoryPath",
    *,
    config_overrides: Optional[AsyncAmplifyGen3ClientConfig] = None,
    repository_name: Optional[
        "capo_amplifygen3.types.git_repository_name.GitRepositoryName"
    ] = None,
    max_results: Optional["capo_amplifygen3.types.max_results.MaxResults"] = None,
    next_token: Optional["capo_amplifygen3.types.next_token.NextToken"] = None,
) -> "capo_amplifygen3.types.list_git_branches_response.ListGitBranchesResponse":
    """<p>Lists the branches of a repository. The AWS Management Console uses this operation to show the branches that you can choose from when you create an app.</p>

    Args:
        provider: <p>The Git provider.</p>
        owner: <p>The account that the Git connection is for. The value depends on the provider:</p> <ul> <li> <p>For GitHub, specify the user or organization name.</p> </li> <li> <p>For GitLab, specify the user name.</p> </li> </ul> <p>To get this value, call ListGitConnections.</p>
        repository_name: <p>The name of the repository, which is the last segment of RepositoryPath.</p>
        repository_path: <p>The full path of the repository in the Git provider, for example my-org/my-app. GitLab paths can include subgroups, for example my-group/subgroup/my-app. To get this value, call ListRepositories.</p>
        max_results: <p>The maximum number of results to return in a single response.</p>
        next_token: <p>The pagination token returned in a previous response, used to retrieve the next page of results.</p>

    Raises:
        capo_amplifygen3.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient permissions to perform this action.</p>
        capo_amplifygen3.errors.git_connection_disconnected_exception.GitConnectionDisconnectedException: <p>The Git connection doesn't exist, or the Git provider no longer accepts its access. For example, the app was uninstalled or access was revoked. Reconnect the Git provider account, and then try again.</p>
        capo_amplifygen3.errors.internal_server_exception.InternalServerException: <p>An internal error occurred. Retry the request.</p>
        capo_amplifygen3.errors.throttling_exception.ThrottlingException: <p>The request was denied because the request rate exceeds the allowed limit.</p>
        capo_amplifygen3.errors.validation_exception.ValidationException: <p>The request contains invalid parameters or is otherwise malformed.</p>
        capo_amplifygen3.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_amplifygen3.types.list_git_branches_request.ListGitBranchesRequest]",
    ) -> AsyncOperationResponse[
        "capo_amplifygen3.types.list_git_branches_response.ListGitBranchesResponse"
    ]:
        import capo_amplifygen3._operations.omega.list_git_branches

        (
            output,
            http_response,
        ) = await capo_amplifygen3._operations.omega.list_git_branches.async_list_git_branches(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListGitBranches")
    )
    input_: capo_amplifygen3.types.list_git_branches_request.ListGitBranchesRequest = {
        "provider": provider,
        "owner": owner,
        "repository_path": repository_path,
    }
    if repository_name is not None:
        input_["repository_name"] = repository_name
    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