Skip to content

get_folder async

get_folder(
    repository_name: RepositoryName,
    folder_path: Path,
    *,
    config_overrides: Optional[AsyncCodeCommitClientConfig] = None,
    commit_specifier: Optional[CommitName] = None,
) -> GetFolderOutput

Returns the contents of a specified folder in a repository.

Parameters:

  • repository_name (RepositoryName) –

    The name of the repository.

  • commit_specifier (Optional[CommitName], default: None ) –

    A fully qualified reference used to identify a commit that contains the version of the folder's content to return. A fully qualified reference can be a commit ID, branch name, tag, or reference such as HEAD. If no specifier is provided, the folder content is returned as it exists in the HEAD commit.

  • folder_path (Path) –

    The fully qualified path to the folder whose contents are returned, including the folder name. For example, /examples is a fully-qualified path to a folder named examples that was created off of the root directory (/) of a repository.

Raises:

Source code in docs_src/capo_codecommit/_services/async_code_commit.py
async def get_folder(
    self,
    repository_name: "capo_codecommit.types.repository_name.RepositoryName",
    folder_path: "capo_codecommit.types.path.Path",
    *,
    config_overrides: Optional[AsyncCodeCommitClientConfig] = None,
    commit_specifier: Optional[
        "capo_codecommit.types.commit_name.CommitName"
    ] = None,
) -> "capo_codecommit.types.get_folder_output.GetFolderOutput":
    """<p>Returns the contents of a specified folder in a repository.</p>

    Args:
        repository_name: <p>The name of the repository.</p>
        commit_specifier: <p>A fully qualified reference used to identify a commit that contains the version of the folder's content to return. A fully qualified reference can be a commit ID, branch name, tag, or reference such as HEAD. If no specifier is provided, the folder content is returned as it exists in the HEAD commit.</p>
        folder_path: <p>The fully qualified path to the folder whose contents are returned, including the folder name. For example, /examples is a fully-qualified path to a folder named examples that was created off of the root directory (/) of a repository. </p>

    Raises:
        capo_codecommit.errors.commit_does_not_exist_exception.CommitDoesNotExistException: <p>The specified commit does not exist or no commit was specified, and the specified repository has no default branch.</p>
        capo_codecommit.errors.encryption_integrity_checks_failed_exception.EncryptionIntegrityChecksFailedException: <p>An encryption integrity check failed.</p>
        capo_codecommit.errors.encryption_key_access_denied_exception.EncryptionKeyAccessDeniedException: <p>An encryption key could not be accessed.</p>
        capo_codecommit.errors.encryption_key_disabled_exception.EncryptionKeyDisabledException: <p>The encryption key is disabled.</p>
        capo_codecommit.errors.encryption_key_not_found_exception.EncryptionKeyNotFoundException: <p>No encryption key was found.</p>
        capo_codecommit.errors.encryption_key_unavailable_exception.EncryptionKeyUnavailableException: <p>The encryption key is not available.</p>
        capo_codecommit.errors.folder_does_not_exist_exception.FolderDoesNotExistException: <p>The specified folder does not exist. Either the folder name is not correct, or you did not enter the full path to the folder.</p>
        capo_codecommit.errors.invalid_commit_exception.InvalidCommitException: <p>The specified commit is not valid.</p>
        capo_codecommit.errors.invalid_path_exception.InvalidPathException: <p>The specified path is not valid.</p>
        capo_codecommit.errors.invalid_repository_name_exception.InvalidRepositoryNameException: <p>A specified repository name is not valid.</p> <note> <p>This exception occurs only when a specified repository name is not valid. Other exceptions occur when a required repository parameter is missing, or when a specified repository does not exist.</p> </note>
        capo_codecommit.errors.path_required_exception.PathRequiredException: <p>The folderPath for a location cannot be null.</p>
        capo_codecommit.errors.repository_does_not_exist_exception.RepositoryDoesNotExistException: <p>The specified repository does not exist.</p>
        capo_codecommit.errors.repository_name_required_exception.RepositoryNameRequiredException: <p>A repository name is required, but was not specified.</p>
        capo_codecommit.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_codecommit.types.get_folder_input.GetFolderInput]",
    ) -> AsyncOperationResponse[
        "capo_codecommit.types.get_folder_output.GetFolderOutput"
    ]:
        import capo_codecommit._operations.code_commit_20150413.get_folder

        (
            output,
            http_response,
        ) = await capo_codecommit._operations.code_commit_20150413.get_folder.async_get_folder(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetFolder")
    )
    input_: capo_codecommit.types.get_folder_input.GetFolderInput = {
        "repository_name": repository_name,
        "folder_path": folder_path,
    }
    if commit_specifier is not None:
        input_["commit_specifier"] = commit_specifier

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