11/*
2- * Copyright 2021 , Backblaze Inc. All Rights Reserved.
2+ * Copyright 2022 , Backblaze Inc. All Rights Reserved.
33 * License https://www.backblaze.com/using_b2_code.html
44 */
55package com .backblaze .b2 .client .structures ;
@@ -38,11 +38,14 @@ public class B2UpdateBucketRequest {
3838 @ B2Json .optional
3939 private final B2BucketReplicationConfiguration replicationConfiguration ;
4040
41+ @ B2Json .optional
42+ private final Boolean fileLockEnabled ;
43+
4144 @ B2Json .optional
4245 private final Integer ifRevisionIs ;
4346
4447 @ B2Json .constructor (params = "accountId,bucketId,bucketType,bucketInfo,corsRules,lifecycleRules," +
45- "defaultRetention,defaultServerSideEncryption,replicationConfiguration,ifRevisionIs" )
48+ "defaultRetention,defaultServerSideEncryption,replicationConfiguration,fileLockEnabled, ifRevisionIs" )
4649 private B2UpdateBucketRequest (String accountId ,
4750 String bucketId ,
4851 String bucketType ,
@@ -52,6 +55,7 @@ private B2UpdateBucketRequest(String accountId,
5255 B2BucketDefaultRetention defaultRetention ,
5356 B2BucketServerSideEncryption defaultServerSideEncryption ,
5457 B2BucketReplicationConfiguration replicationConfiguration ,
58+ Boolean fileLockEnabled ,
5559 Integer ifRevisionIs ) {
5660 this .accountId = accountId ;
5761 this .bucketId = bucketId ;
@@ -62,6 +66,7 @@ private B2UpdateBucketRequest(String accountId,
6266 this .defaultRetention = defaultRetention ;
6367 this .defaultServerSideEncryption = defaultServerSideEncryption ;
6468 this .replicationConfiguration = replicationConfiguration ;
69+ this .fileLockEnabled = fileLockEnabled ;
6570 this .ifRevisionIs = ifRevisionIs ;
6671 }
6772
@@ -100,6 +105,10 @@ public B2BucketReplicationConfiguration getReplicationConfiguration() {
100105 return replicationConfiguration ;
101106 }
102107
108+ public Boolean getFileLockEnabled () {
109+ return fileLockEnabled ;
110+ }
111+
103112 public Integer getIfRevisionIs () {
104113 return ifRevisionIs ;
105114 }
@@ -118,6 +127,7 @@ public boolean equals(Object o) {
118127 Objects .equals (getDefaultRetention (), that .getDefaultRetention ()) &&
119128 Objects .equals (getDefaultServerSideEncryption (), that .getDefaultServerSideEncryption ()) &&
120129 Objects .equals (getReplicationConfiguration (), that .getReplicationConfiguration ()) &&
130+ Objects .equals (getFileLockEnabled () , that .getFileLockEnabled ()) &&
121131 Objects .equals (getIfRevisionIs (), that .getIfRevisionIs ());
122132 }
123133
@@ -133,6 +143,7 @@ public int hashCode() {
133143 getDefaultRetention (),
134144 getDefaultServerSideEncryption (),
135145 getReplicationConfiguration (),
146+ getFileLockEnabled (),
136147 getIfRevisionIs ()
137148 );
138149 }
@@ -156,6 +167,7 @@ public static class Builder {
156167 private B2BucketDefaultRetention defaultRetention ;
157168 private B2BucketServerSideEncryption defaultServerSideEncryption ;
158169 private B2BucketReplicationConfiguration replicationConfiguration ;
170+ private Boolean fileLockEnabled ;
159171
160172 private Builder (B2Bucket bucket ) {
161173 this .accountId = bucket .getAccountId ();
@@ -198,6 +210,11 @@ public Builder setReplicationConfiguration(B2BucketReplicationConfiguration repl
198210 return this ;
199211 }
200212
213+ public Builder setFileLockEnabled (Boolean fileLockEnabled ) {
214+ this .fileLockEnabled = fileLockEnabled ;
215+ return this ;
216+ }
217+
201218 public B2UpdateBucketRequest build () {
202219 return new B2UpdateBucketRequest (
203220 accountId ,
@@ -209,6 +226,7 @@ public B2UpdateBucketRequest build() {
209226 defaultRetention ,
210227 defaultServerSideEncryption ,
211228 replicationConfiguration ,
229+ fileLockEnabled ,
212230 ifRevisionIs
213231 );
214232 }
0 commit comments