/** * Returns the set of projects that contain this object, and which the requesting user has * permissions to access. * * @return Mapping from project ID to the user's access level in that project. */ public Map<DXContainer, AccessLevel> listProjects() { Map<String, AccessLevel> rawMap = deserializeListProjectsMap(apiCallOnObject("listProjects", RetryStrategy.SAFE_TO_RETRY)); ImmutableMap.Builder<DXContainer, AccessLevel> resultBuilder = ImmutableMap.builder(); for (Map.Entry<String, AccessLevel> entry : rawMap.entrySet()) { resultBuilder.put(DXContainer.getInstance(entry.getKey()), entry.getValue()); } return resultBuilder.build(); }
/** * Returns the project or container from which user-provided metadata was retrieved. * * @return {@code DXProject} or {@code DXContainer} */ public DXContainer getProject() { Preconditions.checkState( this.project != null, "project is not accessible because it was not retrieved with the describe call"); return DXContainer.getInstance(this.project); }