AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Deletes a specified file from a specified branch. A commit is created on the branch that contains the revision. The file still exists in the commits earlier to the commit that contains the deletion.

Note:

For .NET Core this operation is only available in asynchronous form. Please refer to DeleteFileAsync.

Namespace: Amazon.CodeCommit
Assembly: AWSSDK.CodeCommit.dll
Version: 3.x.y.z

Syntax

C#
public virtual DeleteFileResponse DeleteFile(
         DeleteFileRequest request
)

Parameters

request
Type: Amazon.CodeCommit.Model.DeleteFileRequest

Container for the necessary parameters to execute the DeleteFile service method.

Return Value


The response from the DeleteFile service method, as returned by CodeCommit.

Exceptions

ExceptionCondition
BranchDoesNotExistException The specified branch does not exist.
BranchNameIsTagNameException The specified branch name is not valid because it is a tag name. Enter the name of a branch in the repository. For a list of valid branch names, use ListBranches.
BranchNameRequiredException A branch name is required, but was not specified.
CommitMessageLengthExceededException The commit message is too long. Provide a shorter string.
EncryptionIntegrityChecksFailedException An encryption integrity check failed.
EncryptionKeyAccessDeniedException An encryption key could not be accessed.
EncryptionKeyDisabledException The encryption key is disabled.
EncryptionKeyNotFoundException No encryption key was found.
EncryptionKeyUnavailableException The encryption key is not available.
FileDoesNotExistException The specified file does not exist. Verify that you have used the correct file name, full path, and extension.
InvalidBranchNameException The specified reference name is not valid.
InvalidEmailException The specified email address either contains one or more characters that are not allowed, or it exceeds the maximum number of characters allowed for an email address.
InvalidParentCommitIdException The parent commit ID is not valid. The commit ID cannot be empty, and must match the head commit ID for the branch of the repository where you want to add or update a file.
InvalidPathException The specified path is not valid.
InvalidRepositoryNameException A specified repository name is not valid. 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.
NameLengthExceededException The user name is not valid because it has exceeded the character limit for author names.
ParentCommitDoesNotExistException The parent commit ID is not valid because it does not exist. The specified parent commit ID does not exist in the specified branch of the repository.
ParentCommitIdOutdatedException The file could not be added because the provided parent commit ID is not the current tip of the specified branch. To view the full commit ID of the current head of the branch, use GetBranch.
ParentCommitIdRequiredException A parent commit ID is required. To view the full commit ID of a branch in a repository, use GetBranch or a Git command (for example, git pull or git log).
PathRequiredException The folderPath for a location cannot be null.
RepositoryDoesNotExistException The specified repository does not exist.
RepositoryNameRequiredException A repository name is required, but was not specified.

Version Information

.NET Framework:
Supported in: 4.5, 4.0, 3.5

See Also