public BranchCreateRequestImpl(org.eclipse.che.api.git.shared.BranchCreateRequest origin) { this.startPoint = origin.getStartPoint(); this.name = origin.getName(); }
@Override public Promise<Branch> branchCreate(Path project, String name, String startPoint) { BranchCreateRequest branchCreateRequest = dtoFactory.createDto(BranchCreateRequest.class).withName(name).withStartPoint(startPoint); String url = getWsAgentBaseUrl() + BRANCH + "?projectPath=" + encodePath(project); return asyncRequestFactory .createPostRequest(url, branchCreateRequest) .loader(loader) .header(ACCEPT, APPLICATION_JSON) .send(dtoUnmarshallerFactory.newUnmarshaller(Branch.class)); }
@POST @Path("branch") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public Branch branchCreate(BranchCreateRequest request) throws ApiException { try (GitConnection gitConnection = getGitConnection()) { return gitConnection.branchCreate(request.getName(), request.getStartPoint()); } }