use of software.amazon.awssdk.services.codecommit.model.DeleteBranchRequest in project aws-doc-sdk-examples by awsdocs.
the class DeleteBranch method deleteSpecificBranch.
// snippet-start:[codecommit.java2.del_branch.main]
public static void deleteSpecificBranch(CodeCommitClient codeCommitClient, String repoName, String branchName) {
try {
DeleteBranchRequest branchRequest = DeleteBranchRequest.builder().branchName(branchName).repositoryName(repoName).build();
codeCommitClient.deleteBranch(branchRequest);
System.out.println("The " + branchName + " branch was deleted!");
} catch (CodeCommitException e) {
System.err.println(e.getMessage());
System.exit(1);
}
}
Aggregations