@@ -85,9 +85,6 @@ public StorageObject apply(BlobInfo blobInfo) {
8585 private final boolean isDirectory ;
8686 private final CustomerEncryption customerEncryption ;
8787 private final String kmsKeyName ;
88- private final Boolean eventBasedHold ;
89- private final Boolean temporaryHold ;
90- private final Long retentionExpirationTime ;
9188
9289 /**
9390 * This class is meant for internal use only. Users are discouraged from using this class.
@@ -271,19 +268,12 @@ public abstract static class Builder {
271268
272269 abstract Builder setCustomerEncryption (CustomerEncryption customerEncryption );
273270
274- abstract Builder setKmsKeyName (String kmsKeyName );
275-
276- /**
277- * Sets the blob's event based hold.
278- */
279- public abstract Builder setEventBasedHold (Boolean eventBasedHold );
280-
281271 /**
282- * Sets the blob's temporary hold.
272+ *
273+ * Sets the blob's kmsKeyName.
283274 */
284- public abstract Builder setTemporaryHold (Boolean temporaryHold );
285-
286- abstract Builder setRetentionExpirationTime (Long retentionExpirationTime );
275+ @ GcpLaunchStage .Beta
276+ abstract Builder setKmsKeyName (String kmsKeyName );
287277
288278 /**
289279 * Creates a {@code BlobInfo} object.
@@ -318,9 +308,6 @@ static final class BuilderImpl extends Builder {
318308 private CustomerEncryption customerEncryption ;
319309 private StorageClass storageClass ;
320310 private String kmsKeyName ;
321- private Boolean eventBasedHold ;
322- private Boolean temporaryHold ;
323- private Long retentionExpirationTime ;
324311
325312 BuilderImpl (BlobId blobId ) {
326313 this .blobId = blobId ;
@@ -352,9 +339,6 @@ static final class BuilderImpl extends Builder {
352339 isDirectory = blobInfo .isDirectory ;
353340 storageClass = blobInfo .storageClass ;
354341 kmsKeyName = blobInfo .kmsKeyName ;
355- eventBasedHold = blobInfo .eventBasedHold ;
356- temporaryHold = blobInfo .temporaryHold ;
357- retentionExpirationTime = blobInfo .retentionExpirationTime ;
358342 }
359343
360344 @ Override
@@ -502,30 +486,13 @@ Builder setCustomerEncryption(CustomerEncryption customerEncryption) {
502486 return this ;
503487 }
504488
489+ @ GcpLaunchStage .Beta
505490 @ Override
506491 Builder setKmsKeyName (String kmsKeyName ) {
507492 this .kmsKeyName = kmsKeyName ;
508493 return this ;
509494 }
510495
511- @ Override
512- public Builder setEventBasedHold (Boolean eventBasedHold ) {
513- this .eventBasedHold = eventBasedHold ;
514- return this ;
515- }
516-
517- @ Override
518- public Builder setTemporaryHold (Boolean temporaryHold ) {
519- this .temporaryHold = temporaryHold ;
520- return this ;
521- }
522-
523- @ Override
524- Builder setRetentionExpirationTime (Long retentionExpirationTime ) {
525- this .retentionExpirationTime = retentionExpirationTime ;
526- return this ;
527- }
528-
529496 @ Override
530497 public BlobInfo build () {
531498 checkNotNull (blobId );
@@ -559,9 +526,6 @@ public BlobInfo build() {
559526 isDirectory = firstNonNull (builder .isDirectory , Boolean .FALSE );
560527 storageClass = builder .storageClass ;
561528 kmsKeyName = builder .kmsKeyName ;
562- eventBasedHold = builder .eventBasedHold ;
563- temporaryHold = builder .temporaryHold ;
564- retentionExpirationTime = builder .retentionExpirationTime ;
565529 }
566530
567531 /**
@@ -795,31 +759,11 @@ public StorageClass getStorageClass() {
795759 /**
796760 * Returns the Cloud KMS key used to encrypt the blob, if any.
797761 */
762+ @ GcpLaunchStage .Beta
798763 public String getKmsKeyName () {
799764 return kmsKeyName ;
800765 }
801766
802- /**
803- * Returns the event based hold status of the blob, if any.
804- */
805- public Boolean getEventBasedHold () {
806- return eventBasedHold ;
807- }
808-
809- /**
810- * Returns the temporary hold status of the blob, if any.
811- */
812- public Boolean getTemporaryHold () {
813- return temporaryHold ;
814- }
815-
816- /**
817- * Returns the retention expiration time of the blob, if a retention period is defined.
818- */
819- public Long getRetentionExpirationTime () {
820- return retentionExpirationTime ;
821- }
822-
823767 /**
824768 * Returns a builder for the current blob.
825769 */
@@ -892,13 +836,8 @@ public ObjectAccessControl apply(Acl acl) {
892836 if (customerEncryption != null ) {
893837 storageObject .setCustomerEncryption (customerEncryption .toPb ());
894838 }
895- if (retentionExpirationTime != null ) {
896- storageObject .setRetentionExpirationTime (new DateTime (retentionExpirationTime ));
897- }
898839
899840 storageObject .setKmsKeyName (kmsKeyName );
900- storageObject .setEventBasedHold (eventBasedHold );
901- storageObject .setTemporaryHold (temporaryHold );
902841 storageObject .setMetadata (pbMetadata );
903842 storageObject .setCacheControl (cacheControl );
904843 storageObject .setContentEncoding (contentEncoding );
@@ -1032,15 +971,6 @@ public Acl apply(ObjectAccessControl objectAccessControl) {
1032971 if (storageObject .getKmsKeyName () != null ) {
1033972 builder .setKmsKeyName (storageObject .getKmsKeyName ());
1034973 }
1035- if (storageObject .getEventBasedHold () != null ) {
1036- builder .setEventBasedHold (storageObject .getEventBasedHold ());
1037- }
1038- if (storageObject .getTemporaryHold () != null ) {
1039- builder .setTemporaryHold (storageObject .getTemporaryHold ());
1040- }
1041- if (storageObject .getRetentionExpirationTime () != null ) {
1042- builder .setRetentionExpirationTime (storageObject .getRetentionExpirationTime ().getValue ());
1043- }
1044974 return builder .build ();
1045975 }
1046976}
0 commit comments