AmplifyGen3 / Client / list_git_branches

list_git_branches

AmplifyGen3.Client.list_git_branches(**kwargs)

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.

See also: AWS API Documentation

Request Syntax

response = client.list_git_branches(
    Provider='GITHUB'|'GITLAB',
    Owner='string',
    RepositoryName='string',
    RepositoryPath='string',
    MaxResults=123,
    NextToken='string'
)
Parameters:
  • Provider (string) –

    [REQUIRED]

    The Git provider.

  • Owner (string) –

    [REQUIRED]

    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.

  • RepositoryName (string) – The name of the repository, which is the last segment of RepositoryPath.

  • RepositoryPath (string) –

    [REQUIRED]

    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.

  • MaxResults (integer) – The maximum number of results to return in a single response.

  • NextToken (string) – The pagination token returned in a previous response, used to retrieve the next page of results.

Return type:

dict

Returns:

Response Syntax

{
    'Branches': [
        {
            'Name': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) –

    • Branches (list) –

      The branches of the repository.

      • (dict) –

        A branch of a repository.

        • Name (string) –

          The name of the branch.

    • NextToken (string) –

      The token to use in the next request to get the next page of results. This value is absent when there are no more results.

Exceptions