use of com.intellij.tasks.impl.httpclient.TaskResponseUtil.GsonSingleObjectDeserializer in project intellij-community by JetBrains.
the class GitlabRepository method fetchIssue.
/**
* @param issueId global issue's ID (<tt>id</tt> field, not <tt>iid</tt>)
*/
@Nullable
public GitlabIssue fetchIssue(int projectId, int issueId) throws Exception {
ensureProjectsDiscovered();
final HttpGet request = new HttpGet(getRestApiUrl("projects", projectId, "issues", issueId));
final ResponseHandler<GitlabIssue> handler = new GsonSingleObjectDeserializer<>(GSON, GitlabIssue.class, true);
return getHttpClient().execute(request, handler);
}
use of com.intellij.tasks.impl.httpclient.TaskResponseUtil.GsonSingleObjectDeserializer in project intellij-community by JetBrains.
the class RedmineRepository method fetchProjects.
public List<RedmineProject> fetchProjects() throws Exception {
HttpClient client = getHttpClient();
// Download projects with pagination (IDEA-125056, IDEA-125157)
List<RedmineProject> allProjects = new ArrayList<>();
int offset = 0;
ProjectsWrapper wrapper;
do {
HttpGet method = new HttpGet(getProjectsUrl(offset, 50));
wrapper = client.execute(method, new GsonSingleObjectDeserializer<>(GSON, ProjectsWrapper.class));
offset += wrapper.getProjects().size();
allProjects.addAll(wrapper.getProjects());
} while (wrapper.getTotalCount() > allProjects.size() || wrapper.getProjects().isEmpty());
myProjects = allProjects;
return Collections.unmodifiableList(myProjects);
}
Aggregations