@@ -36,9 +36,8 @@ public class Organization {
3636 /**
3737 * The maximum memory in MB that can be used by any process in this org.
3838 */
39- @ JsonInclude (Include .NON_ABSENT )
4039 @ JsonProperty ("maxRequestedMemoryMB" )
41- private Optional < Double > maxRequestedMemoryMB ;
40+ private double maxRequestedMemoryMB ;
4241
4342 /**
4443 * The name of an organization.
@@ -54,11 +53,17 @@ public class Organization {
5453 private String orgId ;
5554
5655 /**
57- * The scopes the user who loaded this has on this org .
56+ * The maximum lifespan in hours of a pod .
5857 */
5958 @ JsonInclude (Include .NON_ABSENT )
59+ @ JsonProperty ("podMaxLifespanHrs" )
60+ private Optional <Double > podMaxLifespanHrs ;
61+
62+ /**
63+ * The scopes the user who loaded this has on this org.
64+ */
6065 @ JsonProperty ("scopes" )
61- private Optional <? extends List <Scope > > scopes ;
66+ private List <Scope > scopes ;
6267
6368 @ JsonProperty ("stripeCustomerId" )
6469 private String stripeCustomerId ;
@@ -67,32 +72,37 @@ public class Organization {
6772 public Organization (
6873 @ JsonProperty ("enabledFeatureFlags" ) Optional <? extends List <String >> enabledFeatureFlags ,
6974 @ JsonProperty ("isSingleTenant" ) boolean isSingleTenant ,
70- @ JsonProperty ("maxRequestedMemoryMB" ) Optional < Double > maxRequestedMemoryMB ,
75+ @ JsonProperty ("maxRequestedMemoryMB" ) double maxRequestedMemoryMB ,
7176 @ JsonProperty ("name" ) Optional <String > name ,
7277 @ JsonProperty ("orgId" ) String orgId ,
73- @ JsonProperty ("scopes" ) Optional <? extends List <Scope >> scopes ,
78+ @ JsonProperty ("podMaxLifespanHrs" ) Optional <Double > podMaxLifespanHrs ,
79+ @ JsonProperty ("scopes" ) List <Scope > scopes ,
7480 @ JsonProperty ("stripeCustomerId" ) String stripeCustomerId ) {
7581 Utils .checkNotNull (enabledFeatureFlags , "enabledFeatureFlags" );
7682 Utils .checkNotNull (isSingleTenant , "isSingleTenant" );
7783 Utils .checkNotNull (maxRequestedMemoryMB , "maxRequestedMemoryMB" );
7884 Utils .checkNotNull (name , "name" );
7985 Utils .checkNotNull (orgId , "orgId" );
86+ Utils .checkNotNull (podMaxLifespanHrs , "podMaxLifespanHrs" );
8087 Utils .checkNotNull (scopes , "scopes" );
8188 Utils .checkNotNull (stripeCustomerId , "stripeCustomerId" );
8289 this .enabledFeatureFlags = enabledFeatureFlags ;
8390 this .isSingleTenant = isSingleTenant ;
8491 this .maxRequestedMemoryMB = maxRequestedMemoryMB ;
8592 this .name = name ;
8693 this .orgId = orgId ;
94+ this .podMaxLifespanHrs = podMaxLifespanHrs ;
8795 this .scopes = scopes ;
8896 this .stripeCustomerId = stripeCustomerId ;
8997 }
9098
9199 public Organization (
92100 boolean isSingleTenant ,
101+ double maxRequestedMemoryMB ,
93102 String orgId ,
103+ List <Scope > scopes ,
94104 String stripeCustomerId ) {
95- this (Optional .empty (), isSingleTenant , Optional . empty () , Optional .empty (), orgId , Optional .empty (), stripeCustomerId );
105+ this (Optional .empty (), isSingleTenant , maxRequestedMemoryMB , Optional .empty (), orgId , Optional .empty (), scopes , stripeCustomerId );
96106 }
97107
98108 /**
@@ -113,7 +123,7 @@ public boolean isSingleTenant() {
113123 * The maximum memory in MB that can be used by any process in this org.
114124 */
115125 @ JsonIgnore
116- public Optional < Double > maxRequestedMemoryMB () {
126+ public double maxRequestedMemoryMB () {
117127 return maxRequestedMemoryMB ;
118128 }
119129
@@ -133,13 +143,20 @@ public String orgId() {
133143 return orgId ;
134144 }
135145
146+ /**
147+ * The maximum lifespan in hours of a pod.
148+ */
149+ @ JsonIgnore
150+ public Optional <Double > podMaxLifespanHrs () {
151+ return podMaxLifespanHrs ;
152+ }
153+
136154 /**
137155 * The scopes the user who loaded this has on this org.
138156 */
139- @ SuppressWarnings ("unchecked" )
140157 @ JsonIgnore
141- public Optional < List <Scope > > scopes () {
142- return ( Optional < List < Scope >>) scopes ;
158+ public List <Scope > scopes () {
159+ return scopes ;
143160 }
144161
145162 @ JsonIgnore
@@ -179,15 +196,6 @@ public Organization withIsSingleTenant(boolean isSingleTenant) {
179196 * The maximum memory in MB that can be used by any process in this org.
180197 */
181198 public Organization withMaxRequestedMemoryMB (double maxRequestedMemoryMB ) {
182- Utils .checkNotNull (maxRequestedMemoryMB , "maxRequestedMemoryMB" );
183- this .maxRequestedMemoryMB = Optional .ofNullable (maxRequestedMemoryMB );
184- return this ;
185- }
186-
187- /**
188- * The maximum memory in MB that can be used by any process in this org.
189- */
190- public Organization withMaxRequestedMemoryMB (Optional <Double > maxRequestedMemoryMB ) {
191199 Utils .checkNotNull (maxRequestedMemoryMB , "maxRequestedMemoryMB" );
192200 this .maxRequestedMemoryMB = maxRequestedMemoryMB ;
193201 return this ;
@@ -221,18 +229,27 @@ public Organization withOrgId(String orgId) {
221229 }
222230
223231 /**
224- * The scopes the user who loaded this has on this org .
232+ * The maximum lifespan in hours of a pod .
225233 */
226- public Organization withScopes (List <Scope > scopes ) {
227- Utils .checkNotNull (scopes , "scopes" );
228- this .scopes = Optional .ofNullable (scopes );
234+ public Organization withPodMaxLifespanHrs (double podMaxLifespanHrs ) {
235+ Utils .checkNotNull (podMaxLifespanHrs , "podMaxLifespanHrs" );
236+ this .podMaxLifespanHrs = Optional .ofNullable (podMaxLifespanHrs );
237+ return this ;
238+ }
239+
240+ /**
241+ * The maximum lifespan in hours of a pod.
242+ */
243+ public Organization withPodMaxLifespanHrs (Optional <Double > podMaxLifespanHrs ) {
244+ Utils .checkNotNull (podMaxLifespanHrs , "podMaxLifespanHrs" );
245+ this .podMaxLifespanHrs = podMaxLifespanHrs ;
229246 return this ;
230247 }
231248
232249 /**
233250 * The scopes the user who loaded this has on this org.
234251 */
235- public Organization withScopes (Optional <? extends List <Scope > > scopes ) {
252+ public Organization withScopes (List <Scope > scopes ) {
236253 Utils .checkNotNull (scopes , "scopes" );
237254 this .scopes = scopes ;
238255 return this ;
@@ -259,6 +276,7 @@ public boolean equals(java.lang.Object o) {
259276 Objects .deepEquals (this .maxRequestedMemoryMB , other .maxRequestedMemoryMB ) &&
260277 Objects .deepEquals (this .name , other .name ) &&
261278 Objects .deepEquals (this .orgId , other .orgId ) &&
279+ Objects .deepEquals (this .podMaxLifespanHrs , other .podMaxLifespanHrs ) &&
262280 Objects .deepEquals (this .scopes , other .scopes ) &&
263281 Objects .deepEquals (this .stripeCustomerId , other .stripeCustomerId );
264282 }
@@ -271,6 +289,7 @@ public int hashCode() {
271289 maxRequestedMemoryMB ,
272290 name ,
273291 orgId ,
292+ podMaxLifespanHrs ,
274293 scopes ,
275294 stripeCustomerId );
276295 }
@@ -283,6 +302,7 @@ public String toString() {
283302 "maxRequestedMemoryMB" , maxRequestedMemoryMB ,
284303 "name" , name ,
285304 "orgId" , orgId ,
305+ "podMaxLifespanHrs" , podMaxLifespanHrs ,
286306 "scopes" , scopes ,
287307 "stripeCustomerId" , stripeCustomerId );
288308 }
@@ -293,13 +313,15 @@ public final static class Builder {
293313
294314 private Boolean isSingleTenant ;
295315
296- private Optional < Double > maxRequestedMemoryMB = Optional . empty () ;
316+ private Double maxRequestedMemoryMB ;
297317
298318 private Optional <String > name = Optional .empty ();
299319
300320 private String orgId ;
301321
302- private Optional <? extends List <Scope >> scopes = Optional .empty ();
322+ private Optional <Double > podMaxLifespanHrs = Optional .empty ();
323+
324+ private List <Scope > scopes ;
303325
304326 private String stripeCustomerId ;
305327
@@ -335,15 +357,6 @@ public Builder isSingleTenant(boolean isSingleTenant) {
335357 * The maximum memory in MB that can be used by any process in this org.
336358 */
337359 public Builder maxRequestedMemoryMB (double maxRequestedMemoryMB ) {
338- Utils .checkNotNull (maxRequestedMemoryMB , "maxRequestedMemoryMB" );
339- this .maxRequestedMemoryMB = Optional .ofNullable (maxRequestedMemoryMB );
340- return this ;
341- }
342-
343- /**
344- * The maximum memory in MB that can be used by any process in this org.
345- */
346- public Builder maxRequestedMemoryMB (Optional <Double > maxRequestedMemoryMB ) {
347360 Utils .checkNotNull (maxRequestedMemoryMB , "maxRequestedMemoryMB" );
348361 this .maxRequestedMemoryMB = maxRequestedMemoryMB ;
349362 return this ;
@@ -377,18 +390,27 @@ public Builder orgId(String orgId) {
377390 }
378391
379392 /**
380- * The scopes the user who loaded this has on this org .
393+ * The maximum lifespan in hours of a pod .
381394 */
382- public Builder scopes (List <Scope > scopes ) {
383- Utils .checkNotNull (scopes , "scopes" );
384- this .scopes = Optional .ofNullable (scopes );
395+ public Builder podMaxLifespanHrs (double podMaxLifespanHrs ) {
396+ Utils .checkNotNull (podMaxLifespanHrs , "podMaxLifespanHrs" );
397+ this .podMaxLifespanHrs = Optional .ofNullable (podMaxLifespanHrs );
398+ return this ;
399+ }
400+
401+ /**
402+ * The maximum lifespan in hours of a pod.
403+ */
404+ public Builder podMaxLifespanHrs (Optional <Double > podMaxLifespanHrs ) {
405+ Utils .checkNotNull (podMaxLifespanHrs , "podMaxLifespanHrs" );
406+ this .podMaxLifespanHrs = podMaxLifespanHrs ;
385407 return this ;
386408 }
387409
388410 /**
389411 * The scopes the user who loaded this has on this org.
390412 */
391- public Builder scopes (Optional <? extends List <Scope > > scopes ) {
413+ public Builder scopes (List <Scope > scopes ) {
392414 Utils .checkNotNull (scopes , "scopes" );
393415 this .scopes = scopes ;
394416 return this ;
@@ -407,6 +429,7 @@ public Organization build() {
407429 maxRequestedMemoryMB ,
408430 name ,
409431 orgId ,
432+ podMaxLifespanHrs ,
410433 scopes ,
411434 stripeCustomerId );
412435 }
0 commit comments