@@ -41,11 +41,24 @@ public class ProjectInfo implements Serializable {
4141 private final Long createTimeMillis ;
4242 private final ResourceId parent ;
4343
44+ /**
45+ * The project lifecycle state.
46+ *
47+ * <ul>
48+ * <li>LIFECYCLE_STATE_UNSPECIFIED: only used/useful for distinguishing unset values
49+ * <li>ACTIVE: the normal and active state
50+ * <li>DELETE_REQUESTED: the project has been marked for deletion by the user or by the system
51+ * (Google Cloud Platform). This can generally be reversed by calling
52+ * {@link ResourceManager#undelete}.
53+ * <li>DELETE_IN_PROGRESS: the process of deleting the project has begun. Reversing the deletion
54+ * is no longer possible.
55+ * <ul>
56+ */
4457 public enum State {
4558 LIFECYCLE_STATE_UNSPECIFIED ,
4659 ACTIVE ,
4760 DELETE_REQUESTED ,
48- DELETE_IN_PROGRESS ;
61+ DELETE_IN_PROGRESS
4962 }
5063
5164 public static class Builder {
@@ -58,34 +71,68 @@ public static class Builder {
5871 private ResourceId parent ;
5972
6073 Builder () {
61- labels = new HashMap <String , String >();
74+ labels = new HashMap <>();
6275 }
6376
77+ /**
78+ * Set the user-assigned name of the project.
79+ *
80+ * This field is optional and can remain unset. Allowed characters are: lowercase and uppercase
81+ * letters, numbers, hyphen, single-quote, double-quote, space, and exclamation point. This
82+ * field can be changed after project creation.
83+ */
6484 public Builder name (String name ) {
6585 this .name = name ;
6686 return this ;
6787 }
6888
89+ /**
90+ * Set the unique, user-assigned ID of the project.
91+ *
92+ * The ID must be 6 to 30 lowercase letters, digits, or hyphens. It must start with a letter.
93+ * Trailing hyphens are prohibited. This field cannot be changed after the server creates the
94+ * project.
95+ */
6996 public Builder id (String id ) {
7097 this .id = id ;
7198 return this ;
7299 }
73100
101+ /**
102+ * Add a label associated with this project.
103+ *
104+ * See {@link #labels} for label restrictions.
105+ */
74106 public Builder addLabel (String key , String value ) {
75107 this .labels .put (key , value );
76108 return this ;
77109 }
78110
111+ /**
112+ * Remove a label associated with this project.
113+ */
79114 public Builder removeLabel (String key ) {
80115 this .labels .remove (key );
81116 return this ;
82117 }
83118
119+ /**
120+ * Clear the labels associated with this project.
121+ */
84122 public Builder clearLabels () {
85123 this .labels .clear ();
86124 return this ;
87125 }
88126
127+ /**
128+ * Set the labels associated with this project.
129+ *
130+ * Label keys must be between 1 and 63 characters long and must conform to the following regular
131+ * expression: [a-z]([-a-z0-9]*[a-z0-9])?. Label values must be between 0 and 63 characters long
132+ * and must conform to the regular expression ([a-z]([-a-z0-9]*[a-z0-9])?)?. No more than 256
133+ * labels can be associated with a given resource. This field can be changed after project
134+ * creation.
135+ */
89136 public Builder labels (Map <String , String > labels ) {
90137 this .labels = Maps .newHashMap (checkNotNull (labels ));
91138 return this ;
@@ -106,6 +153,15 @@ Builder createTimeMillis(Long createTimeMillis) {
106153 return this ;
107154 }
108155
156+ /**
157+ * Set the parent of the project.
158+ *
159+ * If this field is left unset in a project creation request, the server will set this field by
160+ * default to the creator of the project. The parent cannot be changed after the server creates
161+ * the project. When calling {@link ResourceManager#replace}, be sure to set the parent of the
162+ * new ProjectInfo instance. Leaving the parent unset or setting it to null in a replace request
163+ * will cause an error.
164+ */
109165 public Builder parent (ResourceId parent ) {
110166 this .parent = parent ;
111167 return this ;
@@ -126,30 +182,64 @@ public ProjectInfo build() {
126182 this .parent = builder .parent ;
127183 }
128184
185+ /**
186+ * Get the unique, user-assigned ID of the project.
187+ *
188+ * This field cannot be changed after the server creates the project.
189+ */
129190 public String id () {
130191 return id ;
131192 }
132193
194+ /**
195+ * Get the user-assigned name of the project.
196+ *
197+ * This field is optional, can remain unset, and can be changed after project creation.
198+ */
133199 public String name () {
134200 return name ;
135201 }
136202
203+ /**
204+ * Get number uniquely identifying the project.
205+ *
206+ * This field is set by the server and is read-only.
207+ */
137208 public Long number () {
138209 return number ;
139210 }
140211
212+ /**
213+ * Get the immutable map of labels associated with this project.
214+ */
141215 public Map <String , String > labels () {
142216 return labels ;
143217 }
144218
219+ /**
220+ * Get the project's lifecycle state.
221+ *
222+ * This is a read-only field. To change the lifecycle state of your project, use the
223+ * {@code delete} or {@code undelete} method.
224+ */
145225 public State state () {
146226 return state ;
147227 }
148228
229+ /**
230+ * Get the project's creation time (in milliseconds).
231+ *
232+ * This field is set by the server and is read-only.
233+ */
149234 public Long createTimeMillis () {
150235 return createTimeMillis ;
151236 }
152237
238+ /**
239+ * Get the parent of the project.
240+ *
241+ * The parent cannot be changed after the server creates the project.
242+ */
153243 public ResourceId parent () {
154244 return parent ;
155245 }
0 commit comments