diff --git a/gcloud-java-resourcemanager/src/main/java/com/google/gcloud/resourcemanager/Option.java b/gcloud-java-resourcemanager/src/main/java/com/google/gcloud/resourcemanager/Option.java index 9900861b93cc..853b678a2ebe 100644 --- a/gcloud-java-resourcemanager/src/main/java/com/google/gcloud/resourcemanager/Option.java +++ b/gcloud-java-resourcemanager/src/main/java/com/google/gcloud/resourcemanager/Option.java @@ -27,7 +27,7 @@ /** * Base class for Resource Manager operation options */ -public class Option implements Serializable { +class Option implements Serializable { private static final long serialVersionUID = 2655177550880762967L; @@ -70,4 +70,3 @@ public String toString() { .toString(); } } - diff --git a/gcloud-java-resourcemanager/src/main/java/com/google/gcloud/resourcemanager/Project.java b/gcloud-java-resourcemanager/src/main/java/com/google/gcloud/resourcemanager/Project.java index b9abdabc9f87..a08d7e3714be 100644 --- a/gcloud-java-resourcemanager/src/main/java/com/google/gcloud/resourcemanager/Project.java +++ b/gcloud-java-resourcemanager/src/main/java/com/google/gcloud/resourcemanager/Project.java @@ -21,8 +21,10 @@ /** * A Google Cloud Resource Manager project object. * - * This class' member variables are immutable. Methods that change or update the underlying Project - * information return a new Project instance. + * A Project is a high-level Google Cloud Platform entity. It is a container for ACLs, APIs, + * AppEngine Apps, VMs, and other Google Cloud Platform resources. This class' member variables are + * immutable. Methods that change or update the underlying Project information return a new Project + * instance. */ public class Project { @@ -69,7 +71,7 @@ public ResourceManager resourceManager() { * @throws ResourceManagerException upon failure */ public Project reload() { - return new Project(resourceManager, resourceManager.get(info.id())); + return Project.load(resourceManager, info.projectId()); } /** @@ -89,13 +91,13 @@ public Project reload() { * completes, the project is not retrievable by the {@link ResourceManager#get} and * {@link ResourceManager#list} methods. The caller must have modify permissions for this project. * - * @see - * - * Cloud Resource Manager delete + * @see Cloud + * Resource Manager delete * @throws ResourceManagerException upon failure */ public void delete() { - resourceManager.delete(info.id()); + resourceManager.delete(info.projectId()); } /** @@ -106,13 +108,13 @@ public void delete() { * state of {@link ProjectInfo.State#DELETE_IN_PROGRESS}, the project cannot be restored. The * caller must have modify permissions for this project. * - * @see - * Cloud Resource Manager undelete + * @see Cloud + * Resource Manager undelete * @throws ResourceManagerException upon failure (including when the project can't be restored) */ public void undelete() { - resourceManager.undelete(info.id()); + resourceManager.undelete(info.projectId()); } /** @@ -120,9 +122,9 @@ public void undelete() { * * The caller must have modify permissions for this project. * - * @see - * - * Cloud Resource Manager update + * @see Cloud + * Resource Manager update * @return the ProjectInfo representing the new project metadata * @throws ResourceManagerException upon failure */ diff --git a/gcloud-java-resourcemanager/src/main/java/com/google/gcloud/resourcemanager/ProjectInfo.java b/gcloud-java-resourcemanager/src/main/java/com/google/gcloud/resourcemanager/ProjectInfo.java index 4e45e1274dbf..7b48e595ae0d 100644 --- a/gcloud-java-resourcemanager/src/main/java/com/google/gcloud/resourcemanager/ProjectInfo.java +++ b/gcloud-java-resourcemanager/src/main/java/com/google/gcloud/resourcemanager/ProjectInfo.java @@ -14,11 +14,14 @@ package com.google.gcloud.resourcemanager; +import static com.google.common.base.MoreObjects.firstNonNull; import static com.google.common.base.Preconditions.checkNotNull; +import com.google.api.client.util.Data; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Maps; +import org.joda.time.DateTime; import org.joda.time.format.ISODateTimeFormat; import java.io.Serializable; @@ -28,26 +31,23 @@ /** * A Google Cloud Resource Manager project metadata object. + * + * A Project is a high-level Google Cloud Platform entity. It is a container for ACLs, APIs, + * AppEngine Apps, VMs, and other Google Cloud Platform resources. */ public class ProjectInfo implements Serializable { private static final long serialVersionUID = 9148970963697734236L; private final String name; - private final String id; + private final String projectId; private final Map labels; - private final Long number; + private final Long projectNumber; private final State state; private final Long createTimeMillis; + private final ResourceId parent; /** - * The project lifecycle state. - * - *