use of org.stepik.api.objects.users.Users in project intellij-plugins by StepicOrg.
the class CourseNode method getAuthors.
@SuppressWarnings("unused")
@NotNull
public List<User> getAuthors(@NotNull StepikApiClient stepikApiClient) {
if (authors == null) {
List<Long> authorsIds;
Course data = getData();
authorsIds = data != null ? data.getAuthors() : Collections.emptyList();
if (!authorsIds.isEmpty()) {
try {
if (!isAuthenticated()) {
return Collections.emptyList();
}
Users users = stepikApiClient.users().get().id(authorsIds).execute();
authors = users.getUsers();
} catch (StepikClientException e) {
return Collections.emptyList();
}
}
}
return authors != null ? authors : Collections.emptyList();
}
Aggregations