Skip to content

Commit fc91872

Browse files
feat: Add max_extension_length field to Retention Policies (box/box-openapi#593) (#1799)
1 parent 122b1d5 commit fc91872

17 files changed

Lines changed: 484 additions & 54 deletions

‎.codegen.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "engineHash": "450fb53", "specHash": "f8e0d99", "version": "10.8.0" }
1+
{ "engineHash": "450fb53", "specHash": "d0976fc", "version": "10.8.0" }

‎docs/ai.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ See the endpoint docs at
149149

150150
<!-- sample post_ai_extract_structured -->
151151
```
152-
client.getAi().createAiExtractStructured(new AiExtractStructured.Builder(Arrays.asList(new AiItemBase(file.getId()))).fields(Arrays.asList(new AiExtractStructuredFieldsField.Builder("firstName").description("Person first name").displayName("First name").prompt("What is the your first name?").type("string").build(), new AiExtractStructuredFieldsField.Builder("lastName").description("Person last name").displayName("Last name").prompt("What is the your last name?").type("string").build(), new AiExtractStructuredFieldsField.Builder("dateOfBirth").description("Person date of birth").displayName("Birth date").prompt("What is the date of your birth?").type("date").build(), new AiExtractStructuredFieldsField.Builder("age").description("Person age").displayName("Age").prompt("How old are you?").type("float").build(), new AiExtractStructuredFieldsField.Builder("hobby").description("Person hobby").displayName("Hobby").prompt("What is your hobby?").type("multiSelect").options(Arrays.asList(new AiExtractStructuredFieldsOptionsField("guitar"), new AiExtractStructuredFieldsOptionsField("books"))).build())).includeConfidenceScore(true).aiAgent(aiExtractStructuredAgentBasicTextConfig).build())
152+
client.getAi().createAiExtractStructured(new AiExtractStructured.Builder(Arrays.asList(new AiItemBase(file.getId()))).fields(Arrays.asList(new AiExtractStructuredFieldsField.Builder("firstName").description("Person first name").displayName("First name").prompt("What is the your first name?").type("string").build(), new AiExtractStructuredFieldsField.Builder("lastName").description("Person last name").displayName("Last name").prompt("What is the your last name?").type("string").build(), new AiExtractStructuredFieldsField.Builder("dateOfBirth").description("Person date of birth").displayName("Birth date").prompt("What is the date of your birth?").type("date").build(), new AiExtractStructuredFieldsField.Builder("age").description("Person age").displayName("Age").prompt("How old are you?").type("float").build(), new AiExtractStructuredFieldsField.Builder("hobby").description("Person hobby").displayName("Hobby").prompt("What is your hobby?").type("multiSelect").options(Arrays.asList(new AiExtractStructuredFieldsOptionsField("guitar"), new AiExtractStructuredFieldsOptionsField("books"))).build())).aiAgent(aiExtractStructuredAgentBasicTextConfig).includeConfidenceScore(true).build())
153153
```
154154

155155
### Arguments

‎docs/users.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ Returns the updated user object.
197197
## Delete user
198198

199199
Deletes a user. By default, this operation fails if the user
200-
still owns any content, was recently active, or recently joined the enterprise from a free account.
200+
still owns any content.
201201
To proceed, move their owned content first, or use the `force` parameter to delete
202202
the user and their files.
203203

‎src/main/java/com/box/sdkgen/managers/retentionpolicies/CreateRetentionPolicyRequestBody.java‎

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
import com.box.sdkgen.internal.NullableFieldTracker;
44
import com.box.sdkgen.internal.SerializableObject;
5+
import com.box.sdkgen.schemas.retentionpolicymaxextensionlengthrequest.RetentionPolicyMaxExtensionLengthRequest;
6+
import com.box.sdkgen.schemas.retentionpolicymaxextensionlengthrequest.RetentionPolicyMaxExtensionLengthRequestEnum;
57
import com.box.sdkgen.schemas.usermini.UserMini;
68
import com.box.sdkgen.serialization.json.EnumWrapper;
79
import com.fasterxml.jackson.annotation.JsonFilter;
@@ -89,6 +91,9 @@ public class CreateRetentionPolicyRequestBody extends SerializableObject {
8991
@JsonProperty("can_owner_extend_retention")
9092
protected Boolean canOwnerExtendRetention;
9193

94+
@JsonProperty("max_extension_length")
95+
protected RetentionPolicyMaxExtensionLengthRequest maxExtensionLength;
96+
9297
/** Whether owner and co-owners of a file are notified when the policy nears expiration. */
9398
@JsonProperty("are_owners_notified")
9499
protected Boolean areOwnersNotified;
@@ -150,6 +155,7 @@ protected CreateRetentionPolicyRequestBody(Builder builder) {
150155
this.retentionLength = builder.retentionLength;
151156
this.retentionType = builder.retentionType;
152157
this.canOwnerExtendRetention = builder.canOwnerExtendRetention;
158+
this.maxExtensionLength = builder.maxExtensionLength;
153159
this.areOwnersNotified = builder.areOwnersNotified;
154160
this.customNotificationRecipients = builder.customNotificationRecipients;
155161
markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
@@ -184,6 +190,10 @@ public Boolean getCanOwnerExtendRetention() {
184190
return canOwnerExtendRetention;
185191
}
186192

193+
public RetentionPolicyMaxExtensionLengthRequest getMaxExtensionLength() {
194+
return maxExtensionLength;
195+
}
196+
187197
public Boolean getAreOwnersNotified() {
188198
return areOwnersNotified;
189199
}
@@ -208,6 +218,7 @@ public boolean equals(Object o) {
208218
&& Objects.equals(retentionLength, casted.retentionLength)
209219
&& Objects.equals(retentionType, casted.retentionType)
210220
&& Objects.equals(canOwnerExtendRetention, casted.canOwnerExtendRetention)
221+
&& Objects.equals(maxExtensionLength, casted.maxExtensionLength)
211222
&& Objects.equals(areOwnersNotified, casted.areOwnersNotified)
212223
&& Objects.equals(customNotificationRecipients, casted.customNotificationRecipients);
213224
}
@@ -222,6 +233,7 @@ public int hashCode() {
222233
retentionLength,
223234
retentionType,
224235
canOwnerExtendRetention,
236+
maxExtensionLength,
225237
areOwnersNotified,
226238
customNotificationRecipients);
227239
}
@@ -257,6 +269,10 @@ public String toString() {
257269
+ canOwnerExtendRetention
258270
+ '\''
259271
+ ", "
272+
+ "maxExtensionLength='"
273+
+ maxExtensionLength
274+
+ '\''
275+
+ ", "
260276
+ "areOwnersNotified='"
261277
+ areOwnersNotified
262278
+ '\''
@@ -284,6 +300,8 @@ public static class Builder extends NullableFieldTracker {
284300

285301
protected Boolean canOwnerExtendRetention;
286302

303+
protected RetentionPolicyMaxExtensionLengthRequest maxExtensionLength;
304+
287305
protected Boolean areOwnersNotified;
288306

289307
protected List<UserMini> customNotificationRecipients;
@@ -374,6 +392,27 @@ public Builder canOwnerExtendRetention(Boolean canOwnerExtendRetention) {
374392
return this;
375393
}
376394

395+
public Builder maxExtensionLength(
396+
RetentionPolicyMaxExtensionLengthRequestEnum maxExtensionLength) {
397+
this.maxExtensionLength = new RetentionPolicyMaxExtensionLengthRequest(maxExtensionLength);
398+
return this;
399+
}
400+
401+
public Builder maxExtensionLength(String maxExtensionLength) {
402+
this.maxExtensionLength = new RetentionPolicyMaxExtensionLengthRequest(maxExtensionLength);
403+
return this;
404+
}
405+
406+
public Builder maxExtensionLength(int maxExtensionLength) {
407+
this.maxExtensionLength = new RetentionPolicyMaxExtensionLengthRequest(maxExtensionLength);
408+
return this;
409+
}
410+
411+
public Builder maxExtensionLength(RetentionPolicyMaxExtensionLengthRequest maxExtensionLength) {
412+
this.maxExtensionLength = maxExtensionLength;
413+
return this;
414+
}
415+
377416
public Builder areOwnersNotified(Boolean areOwnersNotified) {
378417
this.areOwnersNotified = areOwnersNotified;
379418
return this;

‎src/main/java/com/box/sdkgen/managers/retentionpolicies/UpdateRetentionPolicyByIdRequestBody.java‎

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import com.box.sdkgen.internal.Nullable;
44
import com.box.sdkgen.internal.NullableFieldTracker;
55
import com.box.sdkgen.internal.SerializableObject;
6+
import com.box.sdkgen.schemas.retentionpolicymaxextensionlengthrequest.RetentionPolicyMaxExtensionLengthRequest;
7+
import com.box.sdkgen.schemas.retentionpolicymaxextensionlengthrequest.RetentionPolicyMaxExtensionLengthRequestEnum;
68
import com.box.sdkgen.schemas.userbase.UserBase;
79
import com.fasterxml.jackson.annotation.JsonFilter;
810
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -71,6 +73,9 @@ public class UpdateRetentionPolicyByIdRequestBody extends SerializableObject {
7173
@Nullable
7274
protected Boolean canOwnerExtendRetention;
7375

76+
@JsonProperty("max_extension_length")
77+
protected RetentionPolicyMaxExtensionLengthRequest maxExtensionLength;
78+
7479
/**
7580
* Determines if owners and co-owners of items under the policy are notified when the retention
7681
* duration is about to end.
@@ -97,6 +102,7 @@ protected UpdateRetentionPolicyByIdRequestBody(Builder builder) {
97102
this.retentionLength = builder.retentionLength;
98103
this.status = builder.status;
99104
this.canOwnerExtendRetention = builder.canOwnerExtendRetention;
105+
this.maxExtensionLength = builder.maxExtensionLength;
100106
this.areOwnersNotified = builder.areOwnersNotified;
101107
this.customNotificationRecipients = builder.customNotificationRecipients;
102108
markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
@@ -130,6 +136,10 @@ public Boolean getCanOwnerExtendRetention() {
130136
return canOwnerExtendRetention;
131137
}
132138

139+
public RetentionPolicyMaxExtensionLengthRequest getMaxExtensionLength() {
140+
return maxExtensionLength;
141+
}
142+
133143
public Boolean getAreOwnersNotified() {
134144
return areOwnersNotified;
135145
}
@@ -154,6 +164,7 @@ public boolean equals(Object o) {
154164
&& Objects.equals(retentionLength, casted.retentionLength)
155165
&& Objects.equals(status, casted.status)
156166
&& Objects.equals(canOwnerExtendRetention, casted.canOwnerExtendRetention)
167+
&& Objects.equals(maxExtensionLength, casted.maxExtensionLength)
157168
&& Objects.equals(areOwnersNotified, casted.areOwnersNotified)
158169
&& Objects.equals(customNotificationRecipients, casted.customNotificationRecipients);
159170
}
@@ -168,6 +179,7 @@ public int hashCode() {
168179
retentionLength,
169180
status,
170181
canOwnerExtendRetention,
182+
maxExtensionLength,
171183
areOwnersNotified,
172184
customNotificationRecipients);
173185
}
@@ -203,6 +215,10 @@ public String toString() {
203215
+ canOwnerExtendRetention
204216
+ '\''
205217
+ ", "
218+
+ "maxExtensionLength='"
219+
+ maxExtensionLength
220+
+ '\''
221+
+ ", "
206222
+ "areOwnersNotified='"
207223
+ areOwnersNotified
208224
+ '\''
@@ -229,6 +245,8 @@ public static class Builder extends NullableFieldTracker {
229245

230246
protected Boolean canOwnerExtendRetention;
231247

248+
protected RetentionPolicyMaxExtensionLengthRequest maxExtensionLength;
249+
232250
protected Boolean areOwnersNotified;
233251

234252
protected List<UserBase> customNotificationRecipients;
@@ -286,6 +304,27 @@ public Builder canOwnerExtendRetention(Boolean canOwnerExtendRetention) {
286304
return this;
287305
}
288306

307+
public Builder maxExtensionLength(
308+
RetentionPolicyMaxExtensionLengthRequestEnum maxExtensionLength) {
309+
this.maxExtensionLength = new RetentionPolicyMaxExtensionLengthRequest(maxExtensionLength);
310+
return this;
311+
}
312+
313+
public Builder maxExtensionLength(String maxExtensionLength) {
314+
this.maxExtensionLength = new RetentionPolicyMaxExtensionLengthRequest(maxExtensionLength);
315+
return this;
316+
}
317+
318+
public Builder maxExtensionLength(int maxExtensionLength) {
319+
this.maxExtensionLength = new RetentionPolicyMaxExtensionLengthRequest(maxExtensionLength);
320+
return this;
321+
}
322+
323+
public Builder maxExtensionLength(RetentionPolicyMaxExtensionLengthRequest maxExtensionLength) {
324+
this.maxExtensionLength = maxExtensionLength;
325+
return this;
326+
}
327+
289328
public Builder areOwnersNotified(Boolean areOwnersNotified) {
290329
this.areOwnersNotified = areOwnersNotified;
291330
this.markNullableFieldAsSet("are_owners_notified");

‎src/main/java/com/box/sdkgen/managers/users/DeleteUserByIdQueryParams.java‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@ public class DeleteUserByIdQueryParams {
55
/** Whether the user will receive email notification of the deletion. */
66
public Boolean notify;
77

8-
/**
9-
* Specifies whether to delete the user even if they still own files, were recently active, or
10-
* recently joined the enterprise from a free account.
11-
*/
8+
/** Specifies whether to delete the user even if they still own files. */
129
public Boolean force;
1310

1411
public DeleteUserByIdQueryParams() {}

‎src/main/java/com/box/sdkgen/managers/users/UsersManager.java‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -477,9 +477,9 @@ public UserFull updateUserById(
477477
}
478478

479479
/**
480-
* Deletes a user. By default, this operation fails if the user still owns any content, was
481-
* recently active, or recently joined the enterprise from a free account. To proceed, move their
482-
* owned content first, or use the `force` parameter to delete the user and their files.
480+
* Deletes a user. By default, this operation fails if the user still owns any content. To
481+
* proceed, move their owned content first, or use the `force` parameter to delete the user and
482+
* their files.
483483
*
484484
* @param userId The ID of the user. Example: "12345"
485485
*/
@@ -488,9 +488,9 @@ public void deleteUserById(String userId) {
488488
}
489489

490490
/**
491-
* Deletes a user. By default, this operation fails if the user still owns any content, was
492-
* recently active, or recently joined the enterprise from a free account. To proceed, move their
493-
* owned content first, or use the `force` parameter to delete the user and their files.
491+
* Deletes a user. By default, this operation fails if the user still owns any content. To
492+
* proceed, move their owned content first, or use the `force` parameter to delete the user and
493+
* their files.
494494
*
495495
* @param userId The ID of the user. Example: "12345"
496496
* @param queryParams Query parameters of deleteUserById method
@@ -500,9 +500,9 @@ public void deleteUserById(String userId, DeleteUserByIdQueryParams queryParams)
500500
}
501501

502502
/**
503-
* Deletes a user. By default, this operation fails if the user still owns any content, was
504-
* recently active, or recently joined the enterprise from a free account. To proceed, move their
505-
* owned content first, or use the `force` parameter to delete the user and their files.
503+
* Deletes a user. By default, this operation fails if the user still owns any content. To
504+
* proceed, move their owned content first, or use the `force` parameter to delete the user and
505+
* their files.
506506
*
507507
* @param userId The ID of the user. Example: "12345"
508508
* @param headers Headers of deleteUserById method
@@ -512,9 +512,9 @@ public void deleteUserById(String userId, DeleteUserByIdHeaders headers) {
512512
}
513513

514514
/**
515-
* Deletes a user. By default, this operation fails if the user still owns any content, was
516-
* recently active, or recently joined the enterprise from a free account. To proceed, move their
517-
* owned content first, or use the `force` parameter to delete the user and their files.
515+
* Deletes a user. By default, this operation fails if the user still owns any content. To
516+
* proceed, move their owned content first, or use the `force` parameter to delete the user and
517+
* their files.
518518
*
519519
* @param userId The ID of the user. Example: "12345"
520520
* @param queryParams Query parameters of deleteUserById method

0 commit comments

Comments
 (0)