/** * Get commit comment with given id * * @param repository * @param commentId * @return commit comment * @throws IOException */ public CommitComment getComment(IRepositoryIdProvider repository, long commentId) throws IOException { String repoId = getId(repository); StringBuilder uri = new StringBuilder(SEGMENT_REPOS); uri.append('/').append(repoId); uri.append(SEGMENT_PULLS); uri.append(SEGMENT_COMMENTS); uri.append('/').append(commentId); GitHubRequest request = createRequest(); request.setUri(uri); request.setType(CommitComment.class); return (CommitComment) client.get(request).getBody(); }
/** * Create request for single pull request * * @param repository * @param id * @return request * @throws IOException */ public PullRequest getPullRequest(IRepositoryIdProvider repository, int id) throws IOException { final String repoId = getId(repository); StringBuilder uri = new StringBuilder(SEGMENT_REPOS); uri.append('/').append(repoId); uri.append(SEGMENT_PULLS); uri.append('/').append(id); GitHubRequest request = createRequest(); request.setUri(uri); request.setType(PullRequest.class); return (PullRequest) client.get(request).getBody(); }