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.
This is an asynchronous operation using the standard naming convention for .NET 4.5 or higher. For .NET 3.5 the operation is implemented as a pair of methods using the standard naming convention of BeginDeleteFile and EndDeleteFile.
Namespace: Amazon.CodeCommit
Assembly: AWSSDK.CodeCommit.dll
Version: 3.x.y.z
public virtual Task<DeleteFileResponse> DeleteFileAsync( DeleteFileRequest request, CancellationToken cancellationToken )
Container for the necessary parameters to execute the DeleteFile service method.
A cancellation token that can be used by other objects or threads to receive notice of cancellation.
Exception | Condition |
---|---|
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. |
.NET Core App:
Supported in: 3.1
.NET Standard:
Supported in: 2.0
.NET Framework:
Supported in: 4.5