Skip to content

Commit ce54ef6

Browse files
box-sdk-buildbox-sdk-build
andauthored
feat(boxsdkgen): Add new fields to Hubs (box/box-openapi#606) (#1900)
Co-authored-by: box-sdk-build <box-sdk-build@box.com>
1 parent b7907d6 commit ce54ef6

15 files changed

Lines changed: 416 additions & 16 deletions

File tree

‎.codegen.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "engineHash": "e392e8c", "specHash": "dd7f7a9", "version": "5.13.0" }
1+
{ "engineHash": "6f9492d", "specHash": "131c54a", "version": "5.13.0" }

‎docs/sdkgen/ai.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111

1212
Sends an AI request to supported LLMs and returns an answer specifically focused on the user's question given the provided context.
1313

14+
You can ask a question about a single file, several files, or the entire contents of a Box Hub. To search across and ask questions about everything in a Box Hub, send a single item with `type` set to `hubs` and the Hub's ID as the `id`. Box AI answers the question using the indexed content of all files in that Hub.
15+
16+
Asking questions about a Box Hub requires Box AI for Hubs to be enabled in the Admin Console before the Hub is created, so that its content is indexed.
17+
1418
This operation is performed by calling function `createAiAsk`.
1519

1620
See the endpoint docs at

‎src/main/java/com/box/sdkgen/managers/ai/AiManager.java‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@ protected AiManager(Builder builder) {
4141
* Sends an AI request to supported LLMs and returns an answer specifically focused on the user's
4242
* question given the provided context.
4343
*
44+
* <p>You can ask a question about a single file, several files, or the entire contents of a Box
45+
* Hub. To search across and ask questions about everything in a Box Hub, send a single item with
46+
* `type` set to `hubs` and the Hub's ID as the `id`. Box AI answers the question using the
47+
* indexed content of all files in that Hub.
48+
*
49+
* <p>Asking questions about a Box Hub requires Box AI for Hubs to be enabled in the Admin Console
50+
* before the Hub is created, so that its content is indexed.
51+
*
4452
* @param requestBody Request body of createAiAsk method
4553
*/
4654
public AiResponseFull createAiAsk(AiAsk requestBody) {
@@ -51,6 +59,14 @@ public AiResponseFull createAiAsk(AiAsk requestBody) {
5159
* Sends an AI request to supported LLMs and returns an answer specifically focused on the user's
5260
* question given the provided context.
5361
*
62+
* <p>You can ask a question about a single file, several files, or the entire contents of a Box
63+
* Hub. To search across and ask questions about everything in a Box Hub, send a single item with
64+
* `type` set to `hubs` and the Hub's ID as the `id`. Box AI answers the question using the
65+
* indexed content of all files in that Hub.
66+
*
67+
* <p>Asking questions about a Box Hub requires Box AI for Hubs to be enabled in the Admin Console
68+
* before the Hub is created, so that its content is indexed.
69+
*
5470
* @param requestBody Request body of createAiAsk method
5571
* @param headers Headers of createAiAsk method
5672
*/

‎src/main/java/com/box/sdkgen/schemas/aiask/AiAsk.java‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ public class AiAsk extends SerializableObject {
3939
*/
4040
protected final String prompt;
4141

42-
/** The items to be processed by the LLM, often files. */
42+
/**
43+
* The items to be processed by the LLM, often files. To search across and ask questions about the
44+
* contents of a Box Hub, pass a single item with `type` set to `hubs`. See the item `type`
45+
* property for details.
46+
*/
4347
protected final List<AiItemAsk> items;
4448

4549
/**

‎src/main/java/com/box/sdkgen/schemas/aiitemask/AiItemAsk.java‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,14 @@
1313
@JsonFilter("nullablePropertyFilter")
1414
public class AiItemAsk extends SerializableObject {
1515

16-
/** The ID of the file. */
16+
/** The ID of the file, or the ID of the Box Hub when `type` is `hubs`. */
1717
protected final String id;
1818

19-
/** The type of the item. A `hubs` item must be used as a single item. */
19+
/**
20+
* The type of the item. Use `file` to ask a question about a file, or `hubs` to search across and
21+
* ask a question about the entire contents of a Box Hub. A `hubs` item must be the only item in
22+
* the request.
23+
*/
2024
@JsonDeserialize(using = AiItemAskTypeField.AiItemAskTypeFieldDeserializer.class)
2125
@JsonSerialize(using = AiItemAskTypeField.AiItemAskTypeFieldSerializer.class)
2226
protected final EnumWrapper<AiItemAskTypeField> type;

‎src/main/java/com/box/sdkgen/schemas/signrequest/SignRequest.java‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ public boolean equals(Object o) {
246246
&& Objects.equals(externalId, casted.externalId)
247247
&& Objects.equals(templateId, casted.templateId)
248248
&& Objects.equals(externalSystemName, casted.externalSystemName)
249+
&& Objects.equals(requestFlow, casted.requestFlow)
249250
&& Objects.equals(type, casted.type)
250251
&& Objects.equals(sourceFiles, casted.sourceFiles)
251252
&& Objects.equals(signers, casted.signers)
@@ -282,6 +283,7 @@ public int hashCode() {
282283
externalId,
283284
templateId,
284285
externalSystemName,
286+
requestFlow,
285287
type,
286288
sourceFiles,
287289
signers,
@@ -357,6 +359,10 @@ public String toString() {
357359
+ externalSystemName
358360
+ '\''
359361
+ ", "
362+
+ "requestFlow='"
363+
+ requestFlow
364+
+ '\''
365+
+ ", "
360366
+ "type='"
361367
+ type
362368
+ '\''
@@ -663,6 +669,13 @@ public Builder externalSystemName(String externalSystemName) {
663669
return this;
664670
}
665671

672+
@Override
673+
public Builder requestFlow(String requestFlow) {
674+
this.requestFlow = requestFlow;
675+
this.markNullableFieldAsSet("request_flow");
676+
return this;
677+
}
678+
666679
public SignRequest build() {
667680
return new SignRequest(this);
668681
}

‎src/main/java/com/box/sdkgen/schemas/signrequestbase/SignRequestBase.java‎

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,14 @@ public class SignRequestBase extends SerializableObject {
107107
@Nullable
108108
protected String externalSystemName;
109109

110+
/**
111+
* The flow type of the sign request. Values can include `standard` or `cfr11`. When not specified
112+
* during creation, a default is chosen based on admin settings.
113+
*/
114+
@JsonProperty("request_flow")
115+
@Nullable
116+
protected String requestFlow;
117+
110118
public SignRequestBase() {
111119
super();
112120
}
@@ -126,6 +134,7 @@ protected SignRequestBase(Builder builder) {
126134
this.externalId = builder.externalId;
127135
this.templateId = builder.templateId;
128136
this.externalSystemName = builder.externalSystemName;
137+
this.requestFlow = builder.requestFlow;
129138
markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
130139
}
131140

@@ -181,6 +190,10 @@ public String getExternalSystemName() {
181190
return externalSystemName;
182191
}
183192

193+
public String getRequestFlow() {
194+
return requestFlow;
195+
}
196+
184197
@Override
185198
public boolean equals(Object o) {
186199
if (this == o) {
@@ -202,7 +215,8 @@ public boolean equals(Object o) {
202215
&& Objects.equals(daysValid, casted.daysValid)
203216
&& Objects.equals(externalId, casted.externalId)
204217
&& Objects.equals(templateId, casted.templateId)
205-
&& Objects.equals(externalSystemName, casted.externalSystemName);
218+
&& Objects.equals(externalSystemName, casted.externalSystemName)
219+
&& Objects.equals(requestFlow, casted.requestFlow);
206220
}
207221

208222
@Override
@@ -220,7 +234,8 @@ public int hashCode() {
220234
daysValid,
221235
externalId,
222236
templateId,
223-
externalSystemName);
237+
externalSystemName,
238+
requestFlow);
224239
}
225240

226241
@Override
@@ -277,6 +292,10 @@ public String toString() {
277292
+ "externalSystemName='"
278293
+ externalSystemName
279294
+ '\''
295+
+ ", "
296+
+ "requestFlow='"
297+
+ requestFlow
298+
+ '\''
280299
+ "}";
281300
}
282301

@@ -308,6 +327,8 @@ public static class Builder extends NullableFieldTracker {
308327

309328
protected String externalSystemName;
310329

330+
protected String requestFlow;
331+
311332
public Builder isDocumentPreparationNeeded(Boolean isDocumentPreparationNeeded) {
312333
this.isDocumentPreparationNeeded = isDocumentPreparationNeeded;
313334
return this;
@@ -381,6 +402,12 @@ public Builder externalSystemName(String externalSystemName) {
381402
return this;
382403
}
383404

405+
public Builder requestFlow(String requestFlow) {
406+
this.requestFlow = requestFlow;
407+
this.markNullableFieldAsSet("request_flow");
408+
return this;
409+
}
410+
384411
public SignRequestBase build() {
385412
return new SignRequestBase(this);
386413
}

‎src/main/java/com/box/sdkgen/schemas/signrequestcreaterequest/SignRequestCreateRequest.java‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ public boolean equals(Object o) {
108108
&& Objects.equals(externalId, casted.externalId)
109109
&& Objects.equals(templateId, casted.templateId)
110110
&& Objects.equals(externalSystemName, casted.externalSystemName)
111+
&& Objects.equals(requestFlow, casted.requestFlow)
111112
&& Objects.equals(sourceFiles, casted.sourceFiles)
112113
&& Objects.equals(signatureColor, casted.signatureColor)
113114
&& Objects.equals(signers, casted.signers)
@@ -130,6 +131,7 @@ public int hashCode() {
130131
externalId,
131132
templateId,
132133
externalSystemName,
134+
requestFlow,
133135
sourceFiles,
134136
signatureColor,
135137
signers,
@@ -191,6 +193,10 @@ public String toString() {
191193
+ externalSystemName
192194
+ '\''
193195
+ ", "
196+
+ "requestFlow='"
197+
+ requestFlow
198+
+ '\''
199+
+ ", "
194200
+ "sourceFiles='"
195201
+ sourceFiles
196202
+ '\''
@@ -335,6 +341,13 @@ public Builder externalSystemName(String externalSystemName) {
335341
return this;
336342
}
337343

344+
@Override
345+
public Builder requestFlow(String requestFlow) {
346+
this.requestFlow = requestFlow;
347+
this.markNullableFieldAsSet("request_flow");
348+
return this;
349+
}
350+
338351
public SignRequestCreateRequest build() {
339352
return new SignRequestCreateRequest(this);
340353
}

‎src/main/java/com/box/sdkgen/schemas/signrequestsignerinput/SignRequestSignerInput.java‎

Lines changed: 56 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.box.sdkgen.schemas.signrequestsignerinput;
22

3+
import com.box.sdkgen.internal.Nullable;
34
import com.box.sdkgen.schemas.signrequestprefilltag.SignRequestPrefillTag;
45
import com.box.sdkgen.schemas.signrequestsignerinputcustomvalidation.SignRequestSignerInputCustomValidation;
56
import com.box.sdkgen.schemas.signrequestsignerinputdateasiavalidation.SignRequestSignerInputDateAsiaValidation;
@@ -58,6 +59,21 @@ public class SignRequestSignerInput extends SignRequestPrefillTag {
5859
*/
5960
protected SignRequestSignerInputValidation validation;
6061

62+
/**
63+
* The reason for the signer's input, applicable to signature or initial content types in a
64+
* `cfr11` request flow. The value is `null` when not applicable.
65+
*/
66+
@Nullable protected String reason;
67+
68+
/**
69+
* Indicates whether the signer's input has been validated through re-authentication. Applicable
70+
* only for signature or initial content types in a `cfr11` request flow. The value is `null` for
71+
* standard request flows or non-applicable input types.
72+
*/
73+
@JsonProperty("is_validated")
74+
@Nullable
75+
protected Boolean isValidated;
76+
6177
public SignRequestSignerInput(@JsonProperty("page_index") long pageIndex) {
6278
super();
6379
this.pageIndex = pageIndex;
@@ -70,6 +86,8 @@ protected SignRequestSignerInput(Builder builder) {
7086
this.pageIndex = builder.pageIndex;
7187
this.readOnly = builder.readOnly;
7288
this.validation = builder.validation;
89+
this.reason = builder.reason;
90+
this.isValidated = builder.isValidated;
7391
markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
7492
}
7593

@@ -93,6 +111,14 @@ public SignRequestSignerInputValidation getValidation() {
93111
return validation;
94112
}
95113

114+
public String getReason() {
115+
return reason;
116+
}
117+
118+
public Boolean getIsValidated() {
119+
return isValidated;
120+
}
121+
96122
@Override
97123
public boolean equals(Object o) {
98124
if (this == o) {
@@ -110,7 +136,9 @@ public boolean equals(Object o) {
110136
&& Objects.equals(contentType, casted.contentType)
111137
&& Objects.equals(pageIndex, casted.pageIndex)
112138
&& Objects.equals(readOnly, casted.readOnly)
113-
&& Objects.equals(validation, casted.validation);
139+
&& Objects.equals(validation, casted.validation)
140+
&& Objects.equals(reason, casted.reason)
141+
&& Objects.equals(isValidated, casted.isValidated);
114142
}
115143

116144
@Override
@@ -124,7 +152,9 @@ public int hashCode() {
124152
contentType,
125153
pageIndex,
126154
readOnly,
127-
validation);
155+
validation,
156+
reason,
157+
isValidated);
128158
}
129159

130160
@Override
@@ -165,6 +195,14 @@ public String toString() {
165195
+ "validation='"
166196
+ validation
167197
+ '\''
198+
+ ", "
199+
+ "reason='"
200+
+ reason
201+
+ '\''
202+
+ ", "
203+
+ "isValidated='"
204+
+ isValidated
205+
+ '\''
168206
+ "}";
169207
}
170208

@@ -180,6 +218,10 @@ public static class Builder extends SignRequestPrefillTag.Builder {
180218

181219
protected SignRequestSignerInputValidation validation;
182220

221+
protected String reason;
222+
223+
protected Boolean isValidated;
224+
183225
public Builder(long pageIndex) {
184226
super();
185227
this.pageIndex = pageIndex;
@@ -270,6 +312,18 @@ public Builder validation(SignRequestSignerInputValidation validation) {
270312
return this;
271313
}
272314

315+
public Builder reason(String reason) {
316+
this.reason = reason;
317+
this.markNullableFieldAsSet("reason");
318+
return this;
319+
}
320+
321+
public Builder isValidated(Boolean isValidated) {
322+
this.isValidated = isValidated;
323+
this.markNullableFieldAsSet("is_validated");
324+
return this;
325+
}
326+
273327
@Override
274328
public Builder documentTagId(String documentTagId) {
275329
this.documentTagId = documentTagId;

0 commit comments

Comments
 (0)