@@ -58,6 +58,7 @@ public com.google.api.services.compute.model.Region apply(Region region) {
5858 private final Status status ;
5959 private final List <ZoneId > zones ;
6060 private final List <Quota > quotas ;
61+ private final DeprecationStatus <RegionId > deprecationStatus ;
6162
6263 /**
6364 * Status of the region.
@@ -160,6 +161,7 @@ static final class Builder {
160161 private Status status ;
161162 private List <ZoneId > zones ;
162163 private List <Quota > quotas ;
164+ private DeprecationStatus <RegionId > deprecationStatus ;
163165
164166 private Builder () {}
165167
@@ -203,6 +205,11 @@ Builder quotas(List<Quota> quotas) {
203205 return this ;
204206 }
205207
208+ Builder deprecationStatus (DeprecationStatus <RegionId > deprecationStatus ) {
209+ this .deprecationStatus = deprecationStatus ;
210+ return this ;
211+ }
212+
206213 Region build () {
207214 return new Region (this );
208215 }
@@ -217,40 +224,76 @@ private Region(Builder builder) {
217224 this .status = builder .status ;
218225 this .zones = builder .zones ;
219226 this .quotas = builder .quotas ;
227+ this .deprecationStatus = builder .deprecationStatus ;
220228 }
221229
230+ /**
231+ * Returns the region's identity.
232+ */
222233 public RegionId regionId () {
223234 return regionId ;
224235 }
225236
237+ /**
238+ * Returns an unique identifier for the region; defined by the service.
239+ */
226240 public BigInteger id () {
227241 return id ;
228242 }
229243
244+ /**
245+ * Returns the creation timestamp in RFC3339 text format.
246+ *
247+ * @see <a href="https://www.ietf.org/rfc/rfc3339.txt">RFC3339</a>
248+ */
230249 public String creationTimestamp () {
231250 return creationTimestamp ;
232251 }
233252
253+ /**
254+ * Returns an optional textual description of the region.
255+ */
234256 public String description () {
235257 return description ;
236258 }
237259
260+ /**
261+ * Returns a service-defined URL for the region.
262+ */
238263 public String selfLink () {
239264 return selfLink ;
240265 }
241266
267+ /**
268+ * Returns the status of the status.
269+ */
242270 public Status status () {
243271 return status ;
244272 }
245273
274+ /**
275+ * Returns a list of identities of zones available in this region.
276+ */
246277 public List <ZoneId > zones () {
247278 return zones ;
248279 }
249280
281+ /**
282+ * Returns quotas assigned to this region.
283+ */
250284 public List <Quota > quotas () {
251285 return quotas ;
252286 }
253287
288+ /**
289+ * Returns the deprecation status of the region. If {@link DeprecationStatus#status()} is either
290+ * {@link DeprecationStatus.Status#DELETED} or {@link DeprecationStatus.Status#OBSOLETE} the
291+ * region should not be used. Returns {@code null} if the region is not deprecated.
292+ */
293+ public DeprecationStatus <RegionId > deprecationStatus () {
294+ return deprecationStatus ;
295+ }
296+
254297 @ Override
255298 public String toString () {
256299 return MoreObjects .toStringHelper (this )
@@ -262,6 +305,7 @@ public String toString() {
262305 .add ("status" , status )
263306 .add ("zones" , zones )
264307 .add ("quotas" , quotas )
308+ .add ("deprecationStatus" , deprecationStatus )
265309 .toString ();
266310 }
267311
@@ -290,6 +334,9 @@ com.google.api.services.compute.model.Region toPb() {
290334 if (quotas != null ) {
291335 regionPb .setQuotas (Lists .transform (quotas , Quota .TO_PB_FUNCTION ));
292336 }
337+ if (deprecationStatus != null ) {
338+ regionPb .setDeprecated (deprecationStatus .toPb ());
339+ }
293340 return regionPb ;
294341 }
295342
@@ -313,6 +360,10 @@ static Region fromPb(com.google.api.services.compute.model.Region regionPb) {
313360 if (regionPb .getQuotas () != null ) {
314361 builder .quotas (Lists .transform (regionPb .getQuotas (), Quota .FROM_PB_FUNCTION ));
315362 }
363+ if (regionPb .getDeprecated () != null ) {
364+ builder .deprecationStatus (
365+ DeprecationStatus .fromPb (regionPb .getDeprecated (), RegionId .FROM_URL_FUNCTION ));
366+ }
316367 return builder .build ();
317368 }
318369}
0 commit comments