From 88f0e51e0beafbfca1eb2bbe85083c59f237e1d6 Mon Sep 17 00:00:00 2001 From: box-sdk-build Date: Fri, 12 Jun 2026 01:53:55 -0700 Subject: [PATCH 1/5] chore: Update `.codegen.json` with commit hash of `codegen` and `openapi` spec [skip ci] --- .codegen.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.codegen.json b/.codegen.json index 3a498ab8f..37ba0ddf3 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1 +1 @@ -{ "engineHash": "e392e8c", "specHash": "dd7f7a9", "version": "10.14.0" } +{ "engineHash": "b29f419", "specHash": "dd7f7a9", "version": "10.14.0" } From 71aebc1ce373a5c8df41e44616a57e64e0db92b6 Mon Sep 17 00:00:00 2001 From: box-sdk-build Date: Thu, 25 Jun 2026 11:50:53 -0700 Subject: [PATCH 2/5] feat: add direct link to search files by keywords results [PARTNERS-44231] (box/box-codegen#963) --- .codegen.json | 2 +- .github/workflows/fossa.yml | 22 ---------------------- 2 files changed, 1 insertion(+), 23 deletions(-) delete mode 100644 .github/workflows/fossa.yml diff --git a/.codegen.json b/.codegen.json index 37ba0ddf3..1eac0315c 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1 +1 @@ -{ "engineHash": "b29f419", "specHash": "dd7f7a9", "version": "10.14.0" } +{ "engineHash": "6f9492d", "specHash": "dd7f7a9", "version": "10.14.0" } diff --git a/.github/workflows/fossa.yml b/.github/workflows/fossa.yml deleted file mode 100644 index 3da49d58c..000000000 --- a/.github/workflows/fossa.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: FOSSA Scan - -on: - push: - branches: [main, combined-sdk] - pull_request: - branches: [main, combined-sdk] - -permissions: - contents: read - -jobs: - fossa: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - uses: fossas/fossa-action@main - with: - api-key: ${{ secrets.FOSSA_API_KEY }} - branch: ${{ github.head_ref || github.ref_name }} From b67791dac7ee9948954aee33d4fb110b4d44fff5 Mon Sep 17 00:00:00 2001 From: box-sdk-build Date: Mon, 29 Jun 2026 06:20:50 -0700 Subject: [PATCH 3/5] docs: (DDOC-1751) Surfaced AI Hubs functionality (box/box-openapi#606) --- .codegen.json | 2 +- docs/ai.md | 4 ++ .../com/box/sdkgen/managers/ai/AiManager.java | 16 +++++ .../com/box/sdkgen/schemas/aiask/AiAsk.java | 6 +- .../sdkgen/schemas/aiitemask/AiItemAsk.java | 8 ++- .../schemas/signrequest/SignRequest.java | 13 ++++ .../signrequestbase/SignRequestBase.java | 31 ++++++++- .../SignRequestCreateRequest.java | 13 ++++ .../SignRequestSignerInput.java | 58 +++++++++++++++- .../schemas/signtemplate/SignTemplate.java | 31 ++++++++- .../HubCopyRequestV2025R0.java | 30 ++++++++- .../HubUpdateRequestV2025R0.java | 49 +++++++++++++- ...pdateRequestV2025R0CopyHubAccessField.java | 66 +++++++++++++++++++ .../v2025r0/hubv2025r0/HubV2025R0.java | 39 ++++++++++- .../HubV2025R0CopyHubAccessField.java | 66 +++++++++++++++++++ 15 files changed, 416 insertions(+), 16 deletions(-) create mode 100644 src/main/java/com/box/sdkgen/schemas/v2025r0/hubupdaterequestv2025r0/HubUpdateRequestV2025R0CopyHubAccessField.java create mode 100644 src/main/java/com/box/sdkgen/schemas/v2025r0/hubv2025r0/HubV2025R0CopyHubAccessField.java diff --git a/.codegen.json b/.codegen.json index 1eac0315c..53db925b9 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1 +1 @@ -{ "engineHash": "6f9492d", "specHash": "dd7f7a9", "version": "10.14.0" } +{ "engineHash": "6f9492d", "specHash": "131c54a", "version": "10.14.0" } diff --git a/docs/ai.md b/docs/ai.md index 32a0c2d1a..d324a5962 100644 --- a/docs/ai.md +++ b/docs/ai.md @@ -11,6 +11,10 @@ Sends an AI request to supported LLMs and returns an answer specifically focused on the user's question given the provided context. +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. + +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. + This operation is performed by calling function `createAiAsk`. See the endpoint docs at diff --git a/src/main/java/com/box/sdkgen/managers/ai/AiManager.java b/src/main/java/com/box/sdkgen/managers/ai/AiManager.java index ee8b542dd..6fe3a32f1 100644 --- a/src/main/java/com/box/sdkgen/managers/ai/AiManager.java +++ b/src/main/java/com/box/sdkgen/managers/ai/AiManager.java @@ -41,6 +41,14 @@ protected AiManager(Builder builder) { * Sends an AI request to supported LLMs and returns an answer specifically focused on the user's * question given the provided context. * + *

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. + * + *

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. + * * @param requestBody Request body of createAiAsk method */ public AiResponseFull createAiAsk(AiAsk requestBody) { @@ -51,6 +59,14 @@ public AiResponseFull createAiAsk(AiAsk requestBody) { * Sends an AI request to supported LLMs and returns an answer specifically focused on the user's * question given the provided context. * + *

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. + * + *

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. + * * @param requestBody Request body of createAiAsk method * @param headers Headers of createAiAsk method */ diff --git a/src/main/java/com/box/sdkgen/schemas/aiask/AiAsk.java b/src/main/java/com/box/sdkgen/schemas/aiask/AiAsk.java index 1ce74d48b..970b2d5fc 100644 --- a/src/main/java/com/box/sdkgen/schemas/aiask/AiAsk.java +++ b/src/main/java/com/box/sdkgen/schemas/aiask/AiAsk.java @@ -39,7 +39,11 @@ public class AiAsk extends SerializableObject { */ protected final String prompt; - /** The items to be processed by the LLM, often files. */ + /** + * The items to be processed by the LLM, often files. To search across and ask questions about the + * contents of a Box Hub, pass a single item with `type` set to `hubs`. See the item `type` + * property for details. + */ protected final List items; /** diff --git a/src/main/java/com/box/sdkgen/schemas/aiitemask/AiItemAsk.java b/src/main/java/com/box/sdkgen/schemas/aiitemask/AiItemAsk.java index 69f9c367b..dea3e0f89 100644 --- a/src/main/java/com/box/sdkgen/schemas/aiitemask/AiItemAsk.java +++ b/src/main/java/com/box/sdkgen/schemas/aiitemask/AiItemAsk.java @@ -13,10 +13,14 @@ @JsonFilter("nullablePropertyFilter") public class AiItemAsk extends SerializableObject { - /** The ID of the file. */ + /** The ID of the file, or the ID of the Box Hub when `type` is `hubs`. */ protected final String id; - /** The type of the item. A `hubs` item must be used as a single item. */ + /** + * The type of the item. Use `file` to ask a question about a file, or `hubs` to search across and + * ask a question about the entire contents of a Box Hub. A `hubs` item must be the only item in + * the request. + */ @JsonDeserialize(using = AiItemAskTypeField.AiItemAskTypeFieldDeserializer.class) @JsonSerialize(using = AiItemAskTypeField.AiItemAskTypeFieldSerializer.class) protected final EnumWrapper type; diff --git a/src/main/java/com/box/sdkgen/schemas/signrequest/SignRequest.java b/src/main/java/com/box/sdkgen/schemas/signrequest/SignRequest.java index e381b1825..9fa6903f1 100644 --- a/src/main/java/com/box/sdkgen/schemas/signrequest/SignRequest.java +++ b/src/main/java/com/box/sdkgen/schemas/signrequest/SignRequest.java @@ -246,6 +246,7 @@ public boolean equals(Object o) { && Objects.equals(externalId, casted.externalId) && Objects.equals(templateId, casted.templateId) && Objects.equals(externalSystemName, casted.externalSystemName) + && Objects.equals(requestFlow, casted.requestFlow) && Objects.equals(type, casted.type) && Objects.equals(sourceFiles, casted.sourceFiles) && Objects.equals(signers, casted.signers) @@ -282,6 +283,7 @@ public int hashCode() { externalId, templateId, externalSystemName, + requestFlow, type, sourceFiles, signers, @@ -357,6 +359,10 @@ public String toString() { + externalSystemName + '\'' + ", " + + "requestFlow='" + + requestFlow + + '\'' + + ", " + "type='" + type + '\'' @@ -663,6 +669,13 @@ public Builder externalSystemName(String externalSystemName) { return this; } + @Override + public Builder requestFlow(String requestFlow) { + this.requestFlow = requestFlow; + this.markNullableFieldAsSet("request_flow"); + return this; + } + public SignRequest build() { return new SignRequest(this); } diff --git a/src/main/java/com/box/sdkgen/schemas/signrequestbase/SignRequestBase.java b/src/main/java/com/box/sdkgen/schemas/signrequestbase/SignRequestBase.java index 6c20c6c8b..b144af275 100644 --- a/src/main/java/com/box/sdkgen/schemas/signrequestbase/SignRequestBase.java +++ b/src/main/java/com/box/sdkgen/schemas/signrequestbase/SignRequestBase.java @@ -107,6 +107,14 @@ public class SignRequestBase extends SerializableObject { @Nullable protected String externalSystemName; + /** + * The flow type of the sign request. Values can include `standard` or `cfr11`. When not specified + * during creation, a default is chosen based on admin settings. + */ + @JsonProperty("request_flow") + @Nullable + protected String requestFlow; + public SignRequestBase() { super(); } @@ -126,6 +134,7 @@ protected SignRequestBase(Builder builder) { this.externalId = builder.externalId; this.templateId = builder.templateId; this.externalSystemName = builder.externalSystemName; + this.requestFlow = builder.requestFlow; markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); } @@ -181,6 +190,10 @@ public String getExternalSystemName() { return externalSystemName; } + public String getRequestFlow() { + return requestFlow; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -202,7 +215,8 @@ public boolean equals(Object o) { && Objects.equals(daysValid, casted.daysValid) && Objects.equals(externalId, casted.externalId) && Objects.equals(templateId, casted.templateId) - && Objects.equals(externalSystemName, casted.externalSystemName); + && Objects.equals(externalSystemName, casted.externalSystemName) + && Objects.equals(requestFlow, casted.requestFlow); } @Override @@ -220,7 +234,8 @@ public int hashCode() { daysValid, externalId, templateId, - externalSystemName); + externalSystemName, + requestFlow); } @Override @@ -277,6 +292,10 @@ public String toString() { + "externalSystemName='" + externalSystemName + '\'' + + ", " + + "requestFlow='" + + requestFlow + + '\'' + "}"; } @@ -308,6 +327,8 @@ public static class Builder extends NullableFieldTracker { protected String externalSystemName; + protected String requestFlow; + public Builder isDocumentPreparationNeeded(Boolean isDocumentPreparationNeeded) { this.isDocumentPreparationNeeded = isDocumentPreparationNeeded; return this; @@ -381,6 +402,12 @@ public Builder externalSystemName(String externalSystemName) { return this; } + public Builder requestFlow(String requestFlow) { + this.requestFlow = requestFlow; + this.markNullableFieldAsSet("request_flow"); + return this; + } + public SignRequestBase build() { return new SignRequestBase(this); } diff --git a/src/main/java/com/box/sdkgen/schemas/signrequestcreaterequest/SignRequestCreateRequest.java b/src/main/java/com/box/sdkgen/schemas/signrequestcreaterequest/SignRequestCreateRequest.java index 59c0e5663..63368bed5 100644 --- a/src/main/java/com/box/sdkgen/schemas/signrequestcreaterequest/SignRequestCreateRequest.java +++ b/src/main/java/com/box/sdkgen/schemas/signrequestcreaterequest/SignRequestCreateRequest.java @@ -108,6 +108,7 @@ public boolean equals(Object o) { && Objects.equals(externalId, casted.externalId) && Objects.equals(templateId, casted.templateId) && Objects.equals(externalSystemName, casted.externalSystemName) + && Objects.equals(requestFlow, casted.requestFlow) && Objects.equals(sourceFiles, casted.sourceFiles) && Objects.equals(signatureColor, casted.signatureColor) && Objects.equals(signers, casted.signers) @@ -130,6 +131,7 @@ public int hashCode() { externalId, templateId, externalSystemName, + requestFlow, sourceFiles, signatureColor, signers, @@ -191,6 +193,10 @@ public String toString() { + externalSystemName + '\'' + ", " + + "requestFlow='" + + requestFlow + + '\'' + + ", " + "sourceFiles='" + sourceFiles + '\'' @@ -335,6 +341,13 @@ public Builder externalSystemName(String externalSystemName) { return this; } + @Override + public Builder requestFlow(String requestFlow) { + this.requestFlow = requestFlow; + this.markNullableFieldAsSet("request_flow"); + return this; + } + public SignRequestCreateRequest build() { return new SignRequestCreateRequest(this); } diff --git a/src/main/java/com/box/sdkgen/schemas/signrequestsignerinput/SignRequestSignerInput.java b/src/main/java/com/box/sdkgen/schemas/signrequestsignerinput/SignRequestSignerInput.java index 9af6c3971..d5dabd263 100644 --- a/src/main/java/com/box/sdkgen/schemas/signrequestsignerinput/SignRequestSignerInput.java +++ b/src/main/java/com/box/sdkgen/schemas/signrequestsignerinput/SignRequestSignerInput.java @@ -1,5 +1,6 @@ package com.box.sdkgen.schemas.signrequestsignerinput; +import com.box.sdkgen.internal.Nullable; import com.box.sdkgen.schemas.signrequestprefilltag.SignRequestPrefillTag; import com.box.sdkgen.schemas.signrequestsignerinputcustomvalidation.SignRequestSignerInputCustomValidation; import com.box.sdkgen.schemas.signrequestsignerinputdateasiavalidation.SignRequestSignerInputDateAsiaValidation; @@ -58,6 +59,21 @@ public class SignRequestSignerInput extends SignRequestPrefillTag { */ protected SignRequestSignerInputValidation validation; + /** + * The reason for the signer's input, applicable to signature or initial content types in a + * `cfr11` request flow. The value is `null` when not applicable. + */ + @Nullable protected String reason; + + /** + * Indicates whether the signer's input has been validated through re-authentication. Applicable + * only for signature or initial content types in a `cfr11` request flow. The value is `null` for + * standard request flows or non-applicable input types. + */ + @JsonProperty("is_validated") + @Nullable + protected Boolean isValidated; + public SignRequestSignerInput(@JsonProperty("page_index") long pageIndex) { super(); this.pageIndex = pageIndex; @@ -70,6 +86,8 @@ protected SignRequestSignerInput(Builder builder) { this.pageIndex = builder.pageIndex; this.readOnly = builder.readOnly; this.validation = builder.validation; + this.reason = builder.reason; + this.isValidated = builder.isValidated; markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); } @@ -93,6 +111,14 @@ public SignRequestSignerInputValidation getValidation() { return validation; } + public String getReason() { + return reason; + } + + public Boolean getIsValidated() { + return isValidated; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -110,7 +136,9 @@ public boolean equals(Object o) { && Objects.equals(contentType, casted.contentType) && Objects.equals(pageIndex, casted.pageIndex) && Objects.equals(readOnly, casted.readOnly) - && Objects.equals(validation, casted.validation); + && Objects.equals(validation, casted.validation) + && Objects.equals(reason, casted.reason) + && Objects.equals(isValidated, casted.isValidated); } @Override @@ -124,7 +152,9 @@ public int hashCode() { contentType, pageIndex, readOnly, - validation); + validation, + reason, + isValidated); } @Override @@ -165,6 +195,14 @@ public String toString() { + "validation='" + validation + '\'' + + ", " + + "reason='" + + reason + + '\'' + + ", " + + "isValidated='" + + isValidated + + '\'' + "}"; } @@ -180,6 +218,10 @@ public static class Builder extends SignRequestPrefillTag.Builder { protected SignRequestSignerInputValidation validation; + protected String reason; + + protected Boolean isValidated; + public Builder(long pageIndex) { super(); this.pageIndex = pageIndex; @@ -270,6 +312,18 @@ public Builder validation(SignRequestSignerInputValidation validation) { return this; } + public Builder reason(String reason) { + this.reason = reason; + this.markNullableFieldAsSet("reason"); + return this; + } + + public Builder isValidated(Boolean isValidated) { + this.isValidated = isValidated; + this.markNullableFieldAsSet("is_validated"); + return this; + } + @Override public Builder documentTagId(String documentTagId) { this.documentTagId = documentTagId; diff --git a/src/main/java/com/box/sdkgen/schemas/signtemplate/SignTemplate.java b/src/main/java/com/box/sdkgen/schemas/signtemplate/SignTemplate.java index 80d926b10..80f45b1d9 100644 --- a/src/main/java/com/box/sdkgen/schemas/signtemplate/SignTemplate.java +++ b/src/main/java/com/box/sdkgen/schemas/signtemplate/SignTemplate.java @@ -130,6 +130,14 @@ public class SignTemplate extends SerializableObject { @Nullable protected SignTemplateCustomBrandingField customBranding; + /** + * The sign flow of sign requests created from the template. Values can include `standard` or + * `cfr11`. + */ + @JsonProperty("request_flow") + @Nullable + protected String requestFlow; + public SignTemplate() { super(); } @@ -153,6 +161,7 @@ protected SignTemplate(Builder builder) { this.additionalInfo = builder.additionalInfo; this.readySignLink = builder.readySignLink; this.customBranding = builder.customBranding; + this.requestFlow = builder.requestFlow; markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); } @@ -224,6 +233,10 @@ public SignTemplateCustomBrandingField getCustomBranding() { return customBranding; } + public String getRequestFlow() { + return requestFlow; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -249,7 +262,8 @@ public boolean equals(Object o) { && Objects.equals(signers, casted.signers) && Objects.equals(additionalInfo, casted.additionalInfo) && Objects.equals(readySignLink, casted.readySignLink) - && Objects.equals(customBranding, casted.customBranding); + && Objects.equals(customBranding, casted.customBranding) + && Objects.equals(requestFlow, casted.requestFlow); } @Override @@ -271,7 +285,8 @@ public int hashCode() { signers, additionalInfo, readySignLink, - customBranding); + customBranding, + requestFlow); } @Override @@ -344,6 +359,10 @@ public String toString() { + "customBranding='" + customBranding + '\'' + + ", " + + "requestFlow='" + + requestFlow + + '\'' + "}"; } @@ -383,6 +402,8 @@ public static class Builder extends NullableFieldTracker { protected SignTemplateCustomBrandingField customBranding; + protected String requestFlow; + public Builder type(SignTemplateTypeField type) { this.type = new EnumWrapper(type); return this; @@ -479,6 +500,12 @@ public Builder customBranding(SignTemplateCustomBrandingField customBranding) { return this; } + public Builder requestFlow(String requestFlow) { + this.requestFlow = requestFlow; + this.markNullableFieldAsSet("request_flow"); + return this; + } + public SignTemplate build() { return new SignTemplate(this); } diff --git a/src/main/java/com/box/sdkgen/schemas/v2025r0/hubcopyrequestv2025r0/HubCopyRequestV2025R0.java b/src/main/java/com/box/sdkgen/schemas/v2025r0/hubcopyrequestv2025r0/HubCopyRequestV2025R0.java index 3ceb1c0a9..61a195989 100644 --- a/src/main/java/com/box/sdkgen/schemas/v2025r0/hubcopyrequestv2025r0/HubCopyRequestV2025R0.java +++ b/src/main/java/com/box/sdkgen/schemas/v2025r0/hubcopyrequestv2025r0/HubCopyRequestV2025R0.java @@ -3,6 +3,7 @@ import com.box.sdkgen.internal.NullableFieldTracker; import com.box.sdkgen.internal.SerializableObject; import com.fasterxml.jackson.annotation.JsonFilter; +import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Objects; /** Request schema for copying a Box Hub. */ @@ -15,6 +16,13 @@ public class HubCopyRequestV2025R0 extends SerializableObject { /** Description of the Box Hub. */ protected String description; + /** + * If true, the items which the user has Editor or Owner access to in the original Box Hub will be + * copied to the new Box Hub. Defaults to false. + */ + @JsonProperty("include_items") + protected Boolean includeItems; + public HubCopyRequestV2025R0() { super(); } @@ -23,6 +31,7 @@ protected HubCopyRequestV2025R0(Builder builder) { super(); this.title = builder.title; this.description = builder.description; + this.includeItems = builder.includeItems; markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); } @@ -34,6 +43,10 @@ public String getDescription() { return description; } + public Boolean getIncludeItems() { + return includeItems; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -43,12 +56,14 @@ public boolean equals(Object o) { return false; } HubCopyRequestV2025R0 casted = (HubCopyRequestV2025R0) o; - return Objects.equals(title, casted.title) && Objects.equals(description, casted.description); + return Objects.equals(title, casted.title) + && Objects.equals(description, casted.description) + && Objects.equals(includeItems, casted.includeItems); } @Override public int hashCode() { - return Objects.hash(title, description); + return Objects.hash(title, description, includeItems); } @Override @@ -61,6 +76,10 @@ public String toString() { + "description='" + description + '\'' + + ", " + + "includeItems='" + + includeItems + + '\'' + "}"; } @@ -70,6 +89,8 @@ public static class Builder extends NullableFieldTracker { protected String description; + protected Boolean includeItems; + public Builder title(String title) { this.title = title; return this; @@ -80,6 +101,11 @@ public Builder description(String description) { return this; } + public Builder includeItems(Boolean includeItems) { + this.includeItems = includeItems; + return this; + } + public HubCopyRequestV2025R0 build() { return new HubCopyRequestV2025R0(this); } diff --git a/src/main/java/com/box/sdkgen/schemas/v2025r0/hubupdaterequestv2025r0/HubUpdateRequestV2025R0.java b/src/main/java/com/box/sdkgen/schemas/v2025r0/hubupdaterequestv2025r0/HubUpdateRequestV2025R0.java index dad3150c2..f3312e860 100644 --- a/src/main/java/com/box/sdkgen/schemas/v2025r0/hubupdaterequestv2025r0/HubUpdateRequestV2025R0.java +++ b/src/main/java/com/box/sdkgen/schemas/v2025r0/hubupdaterequestv2025r0/HubUpdateRequestV2025R0.java @@ -2,8 +2,11 @@ import com.box.sdkgen.internal.NullableFieldTracker; import com.box.sdkgen.internal.SerializableObject; +import com.box.sdkgen.serialization.json.EnumWrapper; import com.fasterxml.jackson.annotation.JsonFilter; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; import java.util.Objects; /** Request schema for updating an existing Box Hub. */ @@ -36,6 +39,23 @@ public class HubUpdateRequestV2025R0 extends SerializableObject { @JsonProperty("can_public_shared_link_be_created") protected Boolean canPublicSharedLinkBeCreated; + /** + * Specifies who is allowed to copy the Box Hub. + * + *

* `all` - Any user with access to the Hub can copy it. * `company` - Only users within the + * same enterprise as the Hub can copy it. * `none` - No one can copy the Hub. + */ + @JsonDeserialize( + using = + HubUpdateRequestV2025R0CopyHubAccessField + .HubUpdateRequestV2025R0CopyHubAccessFieldDeserializer.class) + @JsonSerialize( + using = + HubUpdateRequestV2025R0CopyHubAccessField + .HubUpdateRequestV2025R0CopyHubAccessFieldSerializer.class) + @JsonProperty("copy_hub_access") + protected EnumWrapper copyHubAccess; + public HubUpdateRequestV2025R0() { super(); } @@ -49,6 +69,7 @@ protected HubUpdateRequestV2025R0(Builder builder) { this.canNonOwnersInvite = builder.canNonOwnersInvite; this.canSharedLinkBeCreated = builder.canSharedLinkBeCreated; this.canPublicSharedLinkBeCreated = builder.canPublicSharedLinkBeCreated; + this.copyHubAccess = builder.copyHubAccess; markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); } @@ -80,6 +101,10 @@ public Boolean getCanPublicSharedLinkBeCreated() { return canPublicSharedLinkBeCreated; } + public EnumWrapper getCopyHubAccess() { + return copyHubAccess; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -96,7 +121,8 @@ public boolean equals(Object o) { isCollaborationRestrictedToEnterprise, casted.isCollaborationRestrictedToEnterprise) && Objects.equals(canNonOwnersInvite, casted.canNonOwnersInvite) && Objects.equals(canSharedLinkBeCreated, casted.canSharedLinkBeCreated) - && Objects.equals(canPublicSharedLinkBeCreated, casted.canPublicSharedLinkBeCreated); + && Objects.equals(canPublicSharedLinkBeCreated, casted.canPublicSharedLinkBeCreated) + && Objects.equals(copyHubAccess, casted.copyHubAccess); } @Override @@ -108,7 +134,8 @@ public int hashCode() { isCollaborationRestrictedToEnterprise, canNonOwnersInvite, canSharedLinkBeCreated, - canPublicSharedLinkBeCreated); + canPublicSharedLinkBeCreated, + copyHubAccess); } @Override @@ -141,6 +168,10 @@ public String toString() { + "canPublicSharedLinkBeCreated='" + canPublicSharedLinkBeCreated + '\'' + + ", " + + "copyHubAccess='" + + copyHubAccess + + '\'' + "}"; } @@ -160,6 +191,8 @@ public static class Builder extends NullableFieldTracker { protected Boolean canPublicSharedLinkBeCreated; + protected EnumWrapper copyHubAccess; + public Builder title(String title) { this.title = title; return this; @@ -196,6 +229,18 @@ public Builder canPublicSharedLinkBeCreated(Boolean canPublicSharedLinkBeCreated return this; } + public Builder copyHubAccess(HubUpdateRequestV2025R0CopyHubAccessField copyHubAccess) { + this.copyHubAccess = + new EnumWrapper(copyHubAccess); + return this; + } + + public Builder copyHubAccess( + EnumWrapper copyHubAccess) { + this.copyHubAccess = copyHubAccess; + return this; + } + public HubUpdateRequestV2025R0 build() { return new HubUpdateRequestV2025R0(this); } diff --git a/src/main/java/com/box/sdkgen/schemas/v2025r0/hubupdaterequestv2025r0/HubUpdateRequestV2025R0CopyHubAccessField.java b/src/main/java/com/box/sdkgen/schemas/v2025r0/hubupdaterequestv2025r0/HubUpdateRequestV2025R0CopyHubAccessField.java new file mode 100644 index 000000000..669e855ec --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/v2025r0/hubupdaterequestv2025r0/HubUpdateRequestV2025R0CopyHubAccessField.java @@ -0,0 +1,66 @@ +package com.box.sdkgen.schemas.v2025r0.hubupdaterequestv2025r0; + +import com.box.sdkgen.serialization.json.EnumWrapper; +import com.box.sdkgen.serialization.json.Valuable; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; +import java.io.IOException; +import java.util.Arrays; + +public enum HubUpdateRequestV2025R0CopyHubAccessField implements Valuable { + ALL("all"), + COMPANY("company"), + NONE("none"); + + private final String value; + + HubUpdateRequestV2025R0CopyHubAccessField(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + public static class HubUpdateRequestV2025R0CopyHubAccessFieldDeserializer + extends JsonDeserializer> { + + public HubUpdateRequestV2025R0CopyHubAccessFieldDeserializer() { + super(); + } + + @Override + public EnumWrapper deserialize( + JsonParser p, DeserializationContext ctxt) throws IOException { + String value = p.getValueAsString(); + return Arrays.stream(HubUpdateRequestV2025R0CopyHubAccessField.values()) + .filter((v) -> v.getValue().equalsIgnoreCase(value)) + .findFirst() + .map(EnumWrapper::new) + .orElse(new EnumWrapper(value)); + } + } + + public static class HubUpdateRequestV2025R0CopyHubAccessFieldSerializer + extends JsonSerializer> { + + public HubUpdateRequestV2025R0CopyHubAccessFieldSerializer() { + super(); + } + + @Override + public void serialize( + EnumWrapper value, + JsonGenerator gen, + SerializerProvider serializers) + throws IOException { + gen.writeString(value.getStringValue()); + } + } +} diff --git a/src/main/java/com/box/sdkgen/schemas/v2025r0/hubv2025r0/HubV2025R0.java b/src/main/java/com/box/sdkgen/schemas/v2025r0/hubv2025r0/HubV2025R0.java index c49674bd8..a4fa51f5e 100644 --- a/src/main/java/com/box/sdkgen/schemas/v2025r0/hubv2025r0/HubV2025R0.java +++ b/src/main/java/com/box/sdkgen/schemas/v2025r0/hubv2025r0/HubV2025R0.java @@ -69,6 +69,18 @@ public class HubV2025R0 extends HubBaseV2025R0 { @JsonProperty("can_public_shared_link_be_created") protected Boolean canPublicSharedLinkBeCreated; + /** + * Specifies who is allowed to copy the Box Hub. + * + *

* `all` - Any user with access to the Hub can copy it. * `company` - Only users within the + * same enterprise as the Hub can copy it. * `none` - No one can copy the Hub. + */ + @JsonDeserialize( + using = HubV2025R0CopyHubAccessField.HubV2025R0CopyHubAccessFieldDeserializer.class) + @JsonSerialize(using = HubV2025R0CopyHubAccessField.HubV2025R0CopyHubAccessFieldSerializer.class) + @JsonProperty("copy_hub_access") + protected EnumWrapper copyHubAccess; + public HubV2025R0(@JsonProperty("id") String id) { super(id); } @@ -87,6 +99,7 @@ protected HubV2025R0(Builder builder) { this.canNonOwnersInvite = builder.canNonOwnersInvite; this.canSharedLinkBeCreated = builder.canSharedLinkBeCreated; this.canPublicSharedLinkBeCreated = builder.canPublicSharedLinkBeCreated; + this.copyHubAccess = builder.copyHubAccess; markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); } @@ -138,6 +151,10 @@ public Boolean getCanPublicSharedLinkBeCreated() { return canPublicSharedLinkBeCreated; } + public EnumWrapper getCopyHubAccess() { + return copyHubAccess; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -161,7 +178,8 @@ public boolean equals(Object o) { isCollaborationRestrictedToEnterprise, casted.isCollaborationRestrictedToEnterprise) && Objects.equals(canNonOwnersInvite, casted.canNonOwnersInvite) && Objects.equals(canSharedLinkBeCreated, casted.canSharedLinkBeCreated) - && Objects.equals(canPublicSharedLinkBeCreated, casted.canPublicSharedLinkBeCreated); + && Objects.equals(canPublicSharedLinkBeCreated, casted.canPublicSharedLinkBeCreated) + && Objects.equals(copyHubAccess, casted.copyHubAccess); } @Override @@ -180,7 +198,8 @@ public int hashCode() { isCollaborationRestrictedToEnterprise, canNonOwnersInvite, canSharedLinkBeCreated, - canPublicSharedLinkBeCreated); + canPublicSharedLinkBeCreated, + copyHubAccess); } @Override @@ -241,6 +260,10 @@ public String toString() { + "canPublicSharedLinkBeCreated='" + canPublicSharedLinkBeCreated + '\'' + + ", " + + "copyHubAccess='" + + copyHubAccess + + '\'' + "}"; } @@ -270,6 +293,8 @@ public static class Builder extends HubBaseV2025R0.Builder { protected Boolean canPublicSharedLinkBeCreated; + protected EnumWrapper copyHubAccess; + public Builder(String id) { super(id); } @@ -335,6 +360,16 @@ public Builder canPublicSharedLinkBeCreated(Boolean canPublicSharedLinkBeCreated return this; } + public Builder copyHubAccess(HubV2025R0CopyHubAccessField copyHubAccess) { + this.copyHubAccess = new EnumWrapper(copyHubAccess); + return this; + } + + public Builder copyHubAccess(EnumWrapper copyHubAccess) { + this.copyHubAccess = copyHubAccess; + return this; + } + @Override public Builder type(HubBaseV2025R0TypeField type) { this.type = new EnumWrapper(type); diff --git a/src/main/java/com/box/sdkgen/schemas/v2025r0/hubv2025r0/HubV2025R0CopyHubAccessField.java b/src/main/java/com/box/sdkgen/schemas/v2025r0/hubv2025r0/HubV2025R0CopyHubAccessField.java new file mode 100644 index 000000000..f6927d8f5 --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/v2025r0/hubv2025r0/HubV2025R0CopyHubAccessField.java @@ -0,0 +1,66 @@ +package com.box.sdkgen.schemas.v2025r0.hubv2025r0; + +import com.box.sdkgen.serialization.json.EnumWrapper; +import com.box.sdkgen.serialization.json.Valuable; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; +import java.io.IOException; +import java.util.Arrays; + +public enum HubV2025R0CopyHubAccessField implements Valuable { + ALL("all"), + COMPANY("company"), + NONE("none"); + + private final String value; + + HubV2025R0CopyHubAccessField(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + public static class HubV2025R0CopyHubAccessFieldDeserializer + extends JsonDeserializer> { + + public HubV2025R0CopyHubAccessFieldDeserializer() { + super(); + } + + @Override + public EnumWrapper deserialize( + JsonParser p, DeserializationContext ctxt) throws IOException { + String value = p.getValueAsString(); + return Arrays.stream(HubV2025R0CopyHubAccessField.values()) + .filter((v) -> v.getValue().equalsIgnoreCase(value)) + .findFirst() + .map(EnumWrapper::new) + .orElse(new EnumWrapper(value)); + } + } + + public static class HubV2025R0CopyHubAccessFieldSerializer + extends JsonSerializer> { + + public HubV2025R0CopyHubAccessFieldSerializer() { + super(); + } + + @Override + public void serialize( + EnumWrapper value, + JsonGenerator gen, + SerializerProvider serializers) + throws IOException { + gen.writeString(value.getStringValue()); + } + } +} From 7acdb4facaf90c0c473c0a49004a9390ca123807 Mon Sep 17 00:00:00 2001 From: box-sdk-build Date: Mon, 29 Jun 2026 08:51:21 -0700 Subject: [PATCH 4/5] chore: Update `.codegen.json` with commit hash of `codegen` and `openapi` spec [skip ci] --- .codegen.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.codegen.json b/.codegen.json index 53db925b9..c199f0de2 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1 +1 @@ -{ "engineHash": "6f9492d", "specHash": "131c54a", "version": "10.14.0" } +{ "engineHash": "9c2d390", "specHash": "131c54a", "version": "10.14.0" } From 7e72ae2e3278b72c2c9389a01e0d806f5e416c15 Mon Sep 17 00:00:00 2001 From: box-sdk-build Date: Tue, 30 Jun 2026 02:20:51 -0700 Subject: [PATCH 5/5] feat: Setup common default timeout (box/box-codegen#965) --- .codegen.json | 2 +- docs/client.md | 5 ++++- docs/configuration.md | 19 +++++++++++++------ .../boxnetworkclient/BoxNetworkClient.java | 8 ++++++++ .../networking/network/NetworkSession.java | 7 +++++++ .../timeoutconfig/TimeoutConfig.java | 14 ++++++++++++++ 6 files changed, 47 insertions(+), 8 deletions(-) diff --git a/.codegen.json b/.codegen.json index c199f0de2..feb6a33d0 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1 +1 @@ -{ "engineHash": "9c2d390", "specHash": "131c54a", "version": "10.14.0" } +{ "engineHash": "ed5236c", "specHash": "131c54a", "version": "10.14.0" } diff --git a/docs/client.md b/docs/client.md index 7e63120f4..c78e51b7e 100644 --- a/docs/client.md +++ b/docs/client.md @@ -183,10 +183,13 @@ BoxClient clientWithInterceptor = client.withInterceptors(interceptors); In order to configure timeout for API calls, calling the `client.withTimeouts(config)` method creates a new client with timeout settings, leaving the original client unmodified. +All timeout values are in milliseconds. + ```java TimeoutConfig timeoutConfig = new TimeoutConfig.Builder() - .connectionTimeoutMs(10000L) + .connectionTimeoutMs(5000L) .readTimeoutMs(30000L) + .requestTimeoutMs(60000L) .build(); BoxClient newClient = client.withTimeouts(timeoutConfig); ``` diff --git a/docs/configuration.md b/docs/configuration.md index ebb79bdcd..a07fc503f 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -178,13 +178,20 @@ BoxClient client = new BoxClient.Builder(auth) ## Timeouts You can configure network timeouts with `TimeoutConfig` on `NetworkSession`. -Java SDK supports separate values for connection and read timeouts, both in milliseconds. +The SDK supports three timeout values, all in milliseconds: + +| Parameter | Description | +| --------------------- | -------------------------------------------------------------------------------------------------------- | +| `connectionTimeoutMs` | Maximum time to wait for the TCP connection to be established. Maps to OkHttp `connectTimeout`. | +| `readTimeoutMs` | Maximum idle time between data packets while reading the response. Maps to OkHttp `readTimeout`. | +| `requestTimeoutMs` | Maximum total time for the entire HTTP request (connect + send + receive). Maps to OkHttp `callTimeout`. | ```java BoxDeveloperTokenAuth auth = new BoxDeveloperTokenAuth("DEVELOPER_TOKEN"); TimeoutConfig timeoutConfig = new TimeoutConfig.Builder() - .connectionTimeoutMs(10000L) + .connectionTimeoutMs(5000L) .readTimeoutMs(30000L) + .requestTimeoutMs(60000L) .build(); NetworkSession session = new NetworkSession() @@ -199,10 +206,10 @@ How timeout handling works: - `connectionTimeoutMs` controls how long the client waits to establish a connection. - `readTimeoutMs` controls how long the client waits for data while reading the response. -- If timeout config is not provided, the SDK uses the OkHttp default timeout settings: connect timeout of 10 seconds, read timeout of 10 seconds, and write timeout of 10 seconds. +- `requestTimeoutMs` controls the maximum total time for the entire request lifecycle, including connection, sending the request body, and reading the response. +- If timeout config is not provided, the SDK uses default timeouts: `connectionTimeoutMs: 10000` (10 seconds), `readTimeoutMs: 60000` (60 seconds), and `requestTimeoutMs: 21600000` (6 hours). - Each timeout is optional. If a value is not provided, the client keeps its existing timeout for that setting. -- To disable both timeouts, set `connectionTimeoutMs(0L)` and `readTimeoutMs(0L)`. -- You can also disable only one timeout by setting just one of them to `0L` and leaving the other configured. -- Timeout failures are handled as request exceptions, then retry behavior is controlled by the configured retry strategy +- To disable a timeout, set its value to `0L`. +- Timeout failures are handled as request exceptions, then retry behavior is controlled by the configured retry strategy. - If retries are exhausted after timeout failures, the SDK throws `BoxSDKError` with the underlying timeout exception as the cause. - Timeout applies to a single HTTP request attempt to the Box API (not the total time across all retries). diff --git a/src/main/java/com/box/sdkgen/networking/boxnetworkclient/BoxNetworkClient.java b/src/main/java/com/box/sdkgen/networking/boxnetworkclient/BoxNetworkClient.java index b7278de44..208cd0603 100644 --- a/src/main/java/com/box/sdkgen/networking/boxnetworkclient/BoxNetworkClient.java +++ b/src/main/java/com/box/sdkgen/networking/boxnetworkclient/BoxNetworkClient.java @@ -120,6 +120,14 @@ public BoxNetworkClient withTimeoutConfig(TimeoutConfig config) { } clientBuilder.readTimeout(readTimeoutMs.longValue(), TimeUnit.MILLISECONDS); } + + Long requestTimeoutMs = config.getRequestTimeoutMs(); + if (requestTimeoutMs != null) { + if (requestTimeoutMs < 0) { + throw new IllegalArgumentException("requestTimeoutMs cannot be negative"); + } + clientBuilder.callTimeout(requestTimeoutMs.longValue(), TimeUnit.MILLISECONDS); + } return new BoxNetworkClient(clientBuilder.build()); } diff --git a/src/main/java/com/box/sdkgen/networking/network/NetworkSession.java b/src/main/java/com/box/sdkgen/networking/network/NetworkSession.java index 60a32bff6..5b553561e 100644 --- a/src/main/java/com/box/sdkgen/networking/network/NetworkSession.java +++ b/src/main/java/com/box/sdkgen/networking/network/NetworkSession.java @@ -38,6 +38,13 @@ public NetworkSession() { networkClient = new BoxNetworkClient(); retryStrategy = new BoxRetryStrategy(); dataSanitizer = new DataSanitizer(); + timeoutConfig = + new TimeoutConfig.Builder() + .connectionTimeoutMs(10000L) + .readTimeoutMs(60000L) + .requestTimeoutMs(21600000L) + .build(); + networkClient = ((BoxNetworkClient) networkClient).withTimeoutConfig(timeoutConfig); } protected NetworkSession(Builder builder) { diff --git a/src/main/java/com/box/sdkgen/networking/timeoutconfig/TimeoutConfig.java b/src/main/java/com/box/sdkgen/networking/timeoutconfig/TimeoutConfig.java index 728f5b092..bdd2fc665 100644 --- a/src/main/java/com/box/sdkgen/networking/timeoutconfig/TimeoutConfig.java +++ b/src/main/java/com/box/sdkgen/networking/timeoutconfig/TimeoutConfig.java @@ -6,11 +6,14 @@ public class TimeoutConfig { public Long readTimeoutMs; + public Long requestTimeoutMs; + public TimeoutConfig() {} protected TimeoutConfig(Builder builder) { this.connectionTimeoutMs = builder.connectionTimeoutMs; this.readTimeoutMs = builder.readTimeoutMs; + this.requestTimeoutMs = builder.requestTimeoutMs; } public Long getConnectionTimeoutMs() { @@ -21,12 +24,18 @@ public Long getReadTimeoutMs() { return readTimeoutMs; } + public Long getRequestTimeoutMs() { + return requestTimeoutMs; + } + public static class Builder { protected Long connectionTimeoutMs; protected Long readTimeoutMs; + protected Long requestTimeoutMs; + public Builder connectionTimeoutMs(Long connectionTimeoutMs) { this.connectionTimeoutMs = connectionTimeoutMs; return this; @@ -37,6 +46,11 @@ public Builder readTimeoutMs(Long readTimeoutMs) { return this; } + public Builder requestTimeoutMs(Long requestTimeoutMs) { + this.requestTimeoutMs = requestTimeoutMs; + return this; + } + public TimeoutConfig build() { return new TimeoutConfig(this); }