@Override public String getName() { if (org != null) return org.getLogin(); else return null; }
@Override String getApiRoute() { return String.format("/orgs/%s/hooks/%d", organization.getLogin(), id); } }
@Override String collection() { return String.format("/orgs/%s/hooks", organization.getLogin()); }
@Override String collection() { return String.format("/orgs/%s/hooks", organization.getLogin()); }
@Override String getApiRoute() { return String.format("/orgs/%s/hooks/%d", organization.getLogin(), id); } }
public int getPublicRepoCount() { try { return organization.getPublicRepoCount(); } catch (IOException e) { logger.warn("No public repositories count found for organization '{}'.", organization.getLogin()); return 0; } }
public List<GHTeam> listTeams() { if (this.teams == null) { try { this.teams = organization.listTeams().asList(); } catch (Throwable t) { logger.warn("No teams found for organization '{}'.", organization.getLogin()); this.teams = Collections.<GHTeam>emptyList(); } } return this.teams; }
public List<GHUser> listMembers() { if (this.members == null) { try { this.members = organization.listMembers().asList(); } catch (Throwable t) { logger.warn("No public members found for organization '{}'.", organization.getLogin()); this.members = Collections.<GHUser>emptyList(); } } return this.members; }
public Map<String, Long> listLanguages() { try { return repository.listLanguages(); } catch (IOException e) { logger.warn("No languages found for project '{}' of organization '{}'.", repository.getName(), organization.getLogin()); return Collections.<String, Long>emptyMap(); } }
/** * Gets the organization that this user belongs to. */ public GHPersonSet<GHOrganization> getAllOrganizations() throws IOException { GHPersonSet<GHOrganization> orgs = new GHPersonSet<GHOrganization>(); Set<String> names = new HashSet<String>(); for (GHOrganization o : root.retrieve().to("/user/orgs", GHOrganization[].class)) { if (names.add(o.getLogin())) // in case of rumoured duplicates in the data orgs.add(root.getOrganization(o.getLogin())); } return orgs; }
public List<GHTag> listTags() { if (this.tags == null) { try { this.tags = repository.listTags().asList(); } catch (Throwable t) { logger.warn("No tags found for project '{}' of organization '{}'.", repository.getName(), organization.getLogin()); this.tags = Collections.<GHTag>emptyList(); } } return this.tags; }
public List<GHRepository.Contributor> listContributors() { if (this.contributors == null) { try { this.contributors = repository.listContributors().asList(); } catch (Throwable t) { logger.warn("No contributors found for project '{}' of organization '{}'.", repository.getName(), organization.getLogin()); this.contributors = Collections.<GHRepository.Contributor>emptyList(); } } return this.contributors; }
/** * Gets the organization that this user belongs to. */ public GHPersonSet<GHOrganization> getAllOrganizations() throws IOException { GHPersonSet<GHOrganization> orgs = new GHPersonSet<GHOrganization>(); Set<String> names = new HashSet<String>(); for (GHOrganization o : root.retrieve().to("/user/orgs", GHOrganization[].class)) { if (names.add(o.getLogin())) // in case of rumoured duplicates in the data orgs.add(root.getOrganization(o.getLogin())); } return orgs; }
public List<GHCommit> listCommits() { if (this.commits == null) { try { this.commits = repository.listCommits().asList(); } catch (Error e) { logger.warn("No commits found for project '{}' of organization '{}'.", repository.getName(), organization.getLogin()); this.commits = Collections.<GHCommit>emptyList(); } } return this.commits; }
/** * Gets the organization that this user belongs to. */ public GHPersonSet<GHOrganization> getAllOrganizations() throws IOException { GHPersonSet<GHOrganization> orgs = new GHPersonSet<GHOrganization>(); Set<String> names = new HashSet<String>(); for (GHOrganization o : root.retrieve().to("/user/orgs", GHOrganization[].class)) { if (names.add(o.getLogin())) // in case of rumoured duplicates in the data orgs.add(root.getOrganization(o.getLogin())); } return orgs; }
/** * Gets the organization that this user belongs to publicly. */ @WithBridgeMethods(Set.class) public GHPersonSet<GHOrganization> getOrganizations() throws IOException { GHPersonSet<GHOrganization> orgs = new GHPersonSet<GHOrganization>(); Set<String> names = new HashSet<String>(); for (GHOrganization o : root.retrieve().to("/users/" + login + "/orgs", GHOrganization[].class)) { if (names.add(o.getLogin())) // I've seen some duplicates in the data orgs.add(root.getOrganization(o.getLogin())); } return orgs; }
/** * Gets your membership in a specific organization. */ public GHMembership getMembership(GHOrganization o) throws IOException { return root.retrieve().to("/user/memberships/orgs/"+o.getLogin(),GHMembership.class).wrap(root); }
/** * Gets your membership in a specific organization. */ public GHMembership getMembership(GHOrganization o) throws IOException { return root.retrieve().to("/user/memberships/orgs/"+o.getLogin(),GHMembership.class).wrap(root); }