AmplifyGen3 / Client / get_folder

get_folder

AmplifyGen3.Client.get_folder(**kwargs)

Lists the files and subfolders directly inside a folder of a repository branch. The AWS Management Console uses this operation when you create an app from a repository. To browse a repository in detail, use your Git provider.

See also: AWS API Documentation

Request Syntax

response = client.get_folder(
    Provider='GITHUB'|'GITLAB',
    Owner='string',
    RepositoryName='string',
    RepositoryPath='string',
    FolderPath='string',
    Branch='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.

  • FolderPath (string) –

    [REQUIRED]

    The path of the folder, relative to the root of the repository, for example src/app. To list the root of the repository, use /.

  • Branch (string) –

    [REQUIRED]

    The name of the branch to read from.

Return type:

dict

Returns:

Response Syntax

{
    'FolderPath': 'string',
    'SubFolders': [
        {
            'AbsolutePath': 'string',
            'RelativePath': 'string'
        },
    ],
    'Files': [
        {
            'AbsolutePath': 'string',
            'RelativePath': 'string'
        },
    ]
}

Response Structure

  • (dict) –

    • FolderPath (string) –

      The path of the folder that was listed.

    • SubFolders (list) –

      The folders directly inside the folder.

      • (dict) –

        A folder in a repository.

        • AbsolutePath (string) –

          The path from the root of the repository, for example src/app.

        • RelativePath (string) –

          The name relative to the folder that was listed, for example app.

    • Files (list) –

      The files directly inside the folder.

      • (dict) –

        A file in a repository.

        • AbsolutePath (string) –

          The path from the root of the repository, for example src/app/index.ts.

        • RelativePath (string) –

          The name relative to the folder that was listed, for example index.ts.

Exceptions