Class Project
- java.lang.Object
-
- com.google.cloud.resourcemanager.ProjectInfo
-
- com.google.cloud.resourcemanager.Project
-
- All Implemented Interfaces:
Serializable
@Deprecated public class Project extends ProjectInfo
Deprecated.v3 GAPIC client of ResourceManager is now availableA Google Cloud Resource Manager project 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. This class' member variables are immutable. Methods that change or update the underlying Project information return a new Project instance.
Project
adds a layer of service-related functionality overProjectInfo
.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Project.Builder
Deprecated.Builder forProject
.-
Nested classes/interfaces inherited from class com.google.cloud.resourcemanager.ProjectInfo
ProjectInfo.ResourceId, ProjectInfo.State
-
-
Field Summary
-
Fields inherited from class com.google.cloud.resourcemanager.ProjectInfo
DATE_TIME_FORMATTER
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
delete()
Deprecated.Marks the project identified by the specified project ID for deletion.boolean
equals(Object obj)
Deprecated.com.google.cloud.Policy
getPolicy()
Deprecated.Returns the IAM access control policy for this project.ResourceManager
getResourceManager()
Deprecated.Returns theResourceManager
service object associated with this Project.int
hashCode()
Deprecated.Project
reload()
Deprecated.Fetches the project's latest information.Project
replace()
Deprecated.Replaces the attributes of the project with the attributes of this project.com.google.cloud.Policy
replacePolicy(com.google.cloud.Policy newPolicy)
Deprecated.Sets the IAM access control policy for this project.Project.Builder
toBuilder()
Deprecated.void
undelete()
Deprecated.Restores the project identified by the specified project ID.-
Methods inherited from class com.google.cloud.resourcemanager.ProjectInfo
getCreateTimeMillis, getLabels, getName, getProjectId, getProjectNumber, getState, newBuilder
-
-
-
-
Method Detail
-
getResourceManager
public ResourceManager getResourceManager()
Deprecated.Returns theResourceManager
service object associated with this Project.
-
reload
public Project reload()
Deprecated.Fetches the project's latest information. Returnsnull
if the project does not exist.- Returns:
- Project containing the project's updated metadata or
null
if not found - Throws:
ResourceManagerException
- upon failure
-
delete
public void delete()
Deprecated.Marks the project identified by the specified project ID for deletion.This method will only affect the project if the following criteria are met:
- The project does not have a billing account associated with it.
- The project has a lifecycle state of
ProjectInfo.State.ACTIVE
.
ProjectInfo.State.ACTIVE
toProjectInfo.State.DELETE_REQUESTED
. The deletion starts at an unspecified time, at which point the lifecycle state changes toProjectInfo.State.DELETE_IN_PROGRESS
. Until the deletion completes, you can check the lifecycle state checked by retrieving the project withResourceManager.get(java.lang.String, com.google.cloud.resourcemanager.ResourceManager.ProjectGetOption...)
, and the project remains visible toResourceManager.list(com.google.cloud.resourcemanager.ResourceManager.ProjectListOption...)
. However, you cannot update the project. After the deletion completes, the project is not retrievable by theResourceManager.get(java.lang.String, com.google.cloud.resourcemanager.ResourceManager.ProjectGetOption...)
andResourceManager.list(com.google.cloud.resourcemanager.ResourceManager.ProjectListOption...)
methods. The caller must have modify permissions for this project.- Throws:
ResourceManagerException
- upon failure- See Also:
- Cloud Resource Manager delete
-
undelete
public void undelete()
Deprecated.Restores the project identified by the specified project ID.You can only use this method for a project that has a lifecycle state of
ProjectInfo.State.DELETE_REQUESTED
. After deletion starts, as indicated by a lifecycle state ofProjectInfo.State.DELETE_IN_PROGRESS
, the project cannot be restored. The caller must have modify permissions for this project.- Throws:
ResourceManagerException
- upon failure (including when the project can't be restored)- See Also:
- Cloud Resource Manager undelete
-
replace
public Project replace()
Deprecated.Replaces the attributes of the project with the attributes of this project.The caller must have modify permissions for this project.
- Returns:
- the Project representing the new project metadata
- Throws:
ResourceManagerException
- upon failure- See Also:
- Cloud Resource Manager update
-
getPolicy
public com.google.cloud.Policy getPolicy()
Deprecated.Returns the IAM access control policy for this project. Returnsnull
if the resource does not exist or if you do not have adequate permission to view the project or get the policy.- Returns:
- the IAM policy for the project
- Throws:
ResourceManagerException
- upon failure- See Also:
- Resource Manager getIamPolicy
-
replacePolicy
public com.google.cloud.Policy replacePolicy(com.google.cloud.Policy newPolicy)
Deprecated.Sets the IAM access control policy for this project. Replaces any existing policy. It is recommended that you use the read-modify-write pattern. See code samples and important details of replacing policies in the documentation forResourceManager.replacePolicy(java.lang.String, com.google.cloud.Policy)
.- Returns:
- the newly set IAM policy for this project
- Throws:
ResourceManagerException
- upon failure- See Also:
- Resource Manager setIamPolicy
-
toBuilder
public Project.Builder toBuilder()
Deprecated.- Overrides:
toBuilder
in classProjectInfo
-
equals
public final boolean equals(Object obj)
Deprecated.- Overrides:
equals
in classProjectInfo
-
hashCode
public final int hashCode()
Deprecated.- Overrides:
hashCode
in classProjectInfo
-
-