@@ -22,6 +22,13 @@ public class BranchSpec {
2222 @ JsonProperty ("is_protected" )
2323 private Boolean isProtected ;
2424
25+ /**
26+ * Explicitly disable expiration. When set to true, the branch will not expire. If set to false,
27+ * the request is invalid; provide either ttl or expire_time instead.
28+ */
29+ @ JsonProperty ("no_expiry" )
30+ private Boolean noExpiry ;
31+
2532 /**
2633 * The name of the source branch from which this branch was created (data lineage for
2734 * point-in-time recovery). If not specified, defaults to the project's default branch. Format:
@@ -38,10 +45,7 @@ public class BranchSpec {
3845 @ JsonProperty ("source_branch_time" )
3946 private Timestamp sourceBranchTime ;
4047
41- /**
42- * Relative time-to-live duration. When set, the branch will expire at creation_time + ttl. Set to
43- * -1 second to explicitly disable expiration.
44- */
48+ /** Relative time-to-live duration. When set, the branch will expire at creation_time + ttl. */
4549 @ JsonProperty ("ttl" )
4650 private Duration ttl ;
4751
@@ -63,6 +67,15 @@ public Boolean getIsProtected() {
6367 return isProtected ;
6468 }
6569
70+ public BranchSpec setNoExpiry (Boolean noExpiry ) {
71+ this .noExpiry = noExpiry ;
72+ return this ;
73+ }
74+
75+ public Boolean getNoExpiry () {
76+ return noExpiry ;
77+ }
78+
6679 public BranchSpec setSourceBranch (String sourceBranch ) {
6780 this .sourceBranch = sourceBranch ;
6881 return this ;
@@ -106,6 +119,7 @@ public boolean equals(Object o) {
106119 BranchSpec that = (BranchSpec ) o ;
107120 return Objects .equals (expireTime , that .expireTime )
108121 && Objects .equals (isProtected , that .isProtected )
122+ && Objects .equals (noExpiry , that .noExpiry )
109123 && Objects .equals (sourceBranch , that .sourceBranch )
110124 && Objects .equals (sourceBranchLsn , that .sourceBranchLsn )
111125 && Objects .equals (sourceBranchTime , that .sourceBranchTime )
@@ -115,14 +129,15 @@ public boolean equals(Object o) {
115129 @ Override
116130 public int hashCode () {
117131 return Objects .hash (
118- expireTime , isProtected , sourceBranch , sourceBranchLsn , sourceBranchTime , ttl );
132+ expireTime , isProtected , noExpiry , sourceBranch , sourceBranchLsn , sourceBranchTime , ttl );
119133 }
120134
121135 @ Override
122136 public String toString () {
123137 return new ToStringer (BranchSpec .class )
124138 .add ("expireTime" , expireTime )
125139 .add ("isProtected" , isProtected )
140+ .add ("noExpiry" , noExpiry )
126141 .add ("sourceBranch" , sourceBranch )
127142 .add ("sourceBranchLsn" , sourceBranchLsn )
128143 .add ("sourceBranchTime" , sourceBranchTime )
0 commit comments