diff --git a/.codegen.json b/.codegen.json index 0cb5e2d64..c77aec508 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1 +1 @@ -{ "engineHash": "d55532c", "specHash": "e21eebc", "version": "10.20.0" } +{ "engineHash": "d55532c", "specHash": "fcfcd5d", "version": "10.20.0" } diff --git a/docs/README.md b/docs/README.md index c41719199..24f6caaca 100644 --- a/docs/README.md +++ b/docs/README.md @@ -29,6 +29,7 @@ the SDK are available by topic: * [Devicepinners](devicepinners.md) * [Docgen](docgen.md) * [Docgentemplate](docgentemplate.md) +* [Documentsplit](documentsplit.md) * [Downloads](downloads.md) * [Emailaliases](emailaliases.md) * [Enterpriseconfigurations](enterpriseconfigurations.md) diff --git a/docs/documentsplit.md b/docs/documentsplit.md new file mode 100644 index 000000000..477f5dc3b --- /dev/null +++ b/docs/documentsplit.md @@ -0,0 +1,101 @@ +# DocumentSplitManager + + +- [Create Document Split job](#create-document-split-job) +- [List Document Split jobs](#list-document-split-jobs) +- [Get Document Split job by ID](#get-document-split-job-by-id) + +## Create Document Split job + +Initiates a Document Split job for the supplied source file. The job runs +asynchronously; clients can poll the returned job ID to track progress. + +All split-specific input lives under `split_input`. When +`split_input.split_type` is `manual`, provide +`split_input.split_definition` (continuous page ranges; `version` may be +omitted or `v_1`). When `split_input.split_type` is `page_selection`, +provide `split_input.page_selection` (non-linear page segments; `version` +may be omitted or `v_2`). `split_input.prompt` must not be provided for +either of those variants. When `split_input.split_type` is `smart`, +`split_input.prompt` is required and neither +`split_input.split_definition` nor `split_input.page_selection` must be +provided. + +This operation is performed by calling function `createDocumentSplitV2026R0`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/v2026.0/post-document-splits/). + +*Currently we don't have an example for calling `createDocumentSplitV2026R0` in integration tests* + +### Arguments + +- requestBody `DocumentSplitCreateRequestV2026R0` + - Request body of createDocumentSplitV2026R0 method +- headers `CreateDocumentSplitV2026R0Headers` + - Headers of createDocumentSplitV2026R0 method + + +### Returns + +This function returns a value of type `DocumentSplitCreateResponseV2026R0`. + +The Document Split job was accepted for processing. Returns a reference +to the newly created job. + + +## List Document Split jobs + +Returns a paginated list of Document Split jobs accessible to the +authenticated user. + +This operation is performed by calling function `getDocumentSplitsV2026R0`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/v2026.0/get-document-splits/). + +*Currently we don't have an example for calling `getDocumentSplitsV2026R0` in integration tests* + +### Arguments + +- queryParams `GetDocumentSplitsV2026R0QueryParams` + - Query parameters of getDocumentSplitsV2026R0 method +- headers `GetDocumentSplitsV2026R0Headers` + - Headers of getDocumentSplitsV2026R0 method + + +### Returns + +This function returns a value of type `DocumentSplitsV2026R0`. + +Returns a paginated list of Document Split jobs. + + +## Get Document Split job by ID + +Returns details for a single Document Split job identified by its ID, +including the current status, the input definition, and any output files +produced by the job. + +This operation is performed by calling function `getDocumentSplitByIdV2026R0`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/v2026.0/get-document-splits-id/). + +*Currently we don't have an example for calling `getDocumentSplitByIdV2026R0` in integration tests* + +### Arguments + +- documentSplitId `String` + - The unique identifier for the Document Split job. Example: "1748426" +- headers `GetDocumentSplitByIdV2026R0Headers` + - Headers of getDocumentSplitByIdV2026R0 method + + +### Returns + +This function returns a value of type `DocumentSplitV2026R0`. + +Returns the Document Split job. + + diff --git a/docs/users.md b/docs/users.md index 3eb493ae0..9081c5a71 100644 --- a/docs/users.md +++ b/docs/users.md @@ -201,6 +201,12 @@ still owns any content. To proceed, move their owned content first, or use the `force` parameter to delete the user and their files. +If the enterprise has a retention policy, including a retired one, or a +legal hold that is not fully released, you can't delete a user who owns +content, even with `force`. Transfer the user's content first by using the +[Transfer owned folders](https://developer.box.com/reference/put-users-id-folders-0) +endpoint. + This operation is performed by calling function `deleteUserById`. See the endpoint docs at diff --git a/src/main/java/com/box/sdkgen/client/BoxClient.java b/src/main/java/com/box/sdkgen/client/BoxClient.java index ca6d8f7d3..07d11e9cd 100644 --- a/src/main/java/com/box/sdkgen/client/BoxClient.java +++ b/src/main/java/com/box/sdkgen/client/BoxClient.java @@ -19,6 +19,7 @@ import com.box.sdkgen.managers.devicepinners.DevicePinnersManager; import com.box.sdkgen.managers.docgen.DocgenManager; import com.box.sdkgen.managers.docgentemplate.DocgenTemplateManager; +import com.box.sdkgen.managers.documentsplit.DocumentSplitManager; import com.box.sdkgen.managers.downloads.DownloadsManager; import com.box.sdkgen.managers.emailaliases.EmailAliasesManager; import com.box.sdkgen.managers.enterpriseconfigurations.EnterpriseConfigurationsManager; @@ -277,6 +278,8 @@ public class BoxClient { public final NotesManager notes; + public final DocumentSplitManager documentSplit; + public final QueryManager query; public BoxClient(Authentication auth) { @@ -634,6 +637,11 @@ public BoxClient(Authentication auth) { .build(); this.notes = new NotesManager.Builder().auth(this.auth).networkSession(this.networkSession).build(); + this.documentSplit = + new DocumentSplitManager.Builder() + .auth(this.auth) + .networkSession(this.networkSession) + .build(); this.query = new QueryManager.Builder().auth(this.auth).networkSession(this.networkSession).build(); } @@ -993,6 +1001,11 @@ protected BoxClient(Builder builder) { .build(); this.notes = new NotesManager.Builder().auth(this.auth).networkSession(this.networkSession).build(); + this.documentSplit = + new DocumentSplitManager.Builder() + .auth(this.auth) + .networkSession(this.networkSession) + .build(); this.query = new QueryManager.Builder().auth(this.auth).networkSession(this.networkSession).build(); } @@ -1458,6 +1471,10 @@ public NotesManager getNotes() { return notes; } + public DocumentSplitManager getDocumentSplit() { + return documentSplit; + } + public QueryManager getQuery() { return query; } diff --git a/src/main/java/com/box/sdkgen/managers/documentsplit/CreateDocumentSplitV2026R0Headers.java b/src/main/java/com/box/sdkgen/managers/documentsplit/CreateDocumentSplitV2026R0Headers.java new file mode 100644 index 000000000..b4e952d94 --- /dev/null +++ b/src/main/java/com/box/sdkgen/managers/documentsplit/CreateDocumentSplitV2026R0Headers.java @@ -0,0 +1,68 @@ +package com.box.sdkgen.managers.documentsplit; + +import static com.box.sdkgen.internal.utils.UtilsManager.mapOf; + +import com.box.sdkgen.parameters.v2026r0.boxversionheaderv2026r0.BoxVersionHeaderV2026R0; +import com.box.sdkgen.serialization.json.EnumWrapper; +import java.util.Map; + +public class CreateDocumentSplitV2026R0Headers { + + /** Version header. */ + public EnumWrapper boxVersion; + + /** Extra headers that will be included in the HTTP request. */ + public Map extraHeaders; + + public CreateDocumentSplitV2026R0Headers() { + this.boxVersion = new EnumWrapper(BoxVersionHeaderV2026R0._2026_0); + this.extraHeaders = mapOf(); + } + + protected CreateDocumentSplitV2026R0Headers(Builder builder) { + this.boxVersion = builder.boxVersion; + this.extraHeaders = builder.extraHeaders; + } + + public EnumWrapper getBoxVersion() { + return boxVersion; + } + + public Map getExtraHeaders() { + return extraHeaders; + } + + public static class Builder { + + protected EnumWrapper boxVersion; + + protected Map extraHeaders; + + public Builder() {} + + public Builder boxVersion(BoxVersionHeaderV2026R0 boxVersion) { + this.boxVersion = new EnumWrapper(boxVersion); + return this; + } + + public Builder boxVersion(EnumWrapper boxVersion) { + this.boxVersion = boxVersion; + return this; + } + + public Builder extraHeaders(Map extraHeaders) { + this.extraHeaders = extraHeaders; + return this; + } + + public CreateDocumentSplitV2026R0Headers build() { + if (this.boxVersion == null) { + this.boxVersion = new EnumWrapper(BoxVersionHeaderV2026R0._2026_0); + } + if (this.extraHeaders == null) { + this.extraHeaders = mapOf(); + } + return new CreateDocumentSplitV2026R0Headers(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/managers/documentsplit/DocumentSplitManager.java b/src/main/java/com/box/sdkgen/managers/documentsplit/DocumentSplitManager.java new file mode 100644 index 000000000..978756afb --- /dev/null +++ b/src/main/java/com/box/sdkgen/managers/documentsplit/DocumentSplitManager.java @@ -0,0 +1,235 @@ +package com.box.sdkgen.managers.documentsplit; + +import static com.box.sdkgen.internal.utils.UtilsManager.convertToString; +import static com.box.sdkgen.internal.utils.UtilsManager.entryOf; +import static com.box.sdkgen.internal.utils.UtilsManager.mapOf; +import static com.box.sdkgen.internal.utils.UtilsManager.mergeMaps; +import static com.box.sdkgen.internal.utils.UtilsManager.prepareParams; + +import com.box.sdkgen.networking.auth.Authentication; +import com.box.sdkgen.networking.fetchoptions.FetchOptions; +import com.box.sdkgen.networking.fetchoptions.ResponseFormat; +import com.box.sdkgen.networking.fetchresponse.FetchResponse; +import com.box.sdkgen.networking.network.NetworkSession; +import com.box.sdkgen.schemas.v2026r0.documentsplitcreaterequestv2026r0.DocumentSplitCreateRequestV2026R0; +import com.box.sdkgen.schemas.v2026r0.documentsplitcreateresponsev2026r0.DocumentSplitCreateResponseV2026R0; +import com.box.sdkgen.schemas.v2026r0.documentsplitsv2026r0.DocumentSplitsV2026R0; +import com.box.sdkgen.schemas.v2026r0.documentsplitv2026r0.DocumentSplitV2026R0; +import com.box.sdkgen.serialization.json.JsonManager; +import java.util.Map; + +public class DocumentSplitManager { + + public Authentication auth; + + public NetworkSession networkSession; + + public DocumentSplitManager() { + this.networkSession = new NetworkSession(); + } + + protected DocumentSplitManager(Builder builder) { + this.auth = builder.auth; + this.networkSession = builder.networkSession; + } + + /** + * Initiates a Document Split job for the supplied source file. The job runs asynchronously; + * clients can poll the returned job ID to track progress. + * + *

All split-specific input lives under `split_input`. When `split_input.split_type` is + * `manual`, provide `split_input.split_definition` (continuous page ranges; `version` may be + * omitted or `v_1`). When `split_input.split_type` is `page_selection`, provide + * `split_input.page_selection` (non-linear page segments; `version` may be omitted or `v_2`). + * `split_input.prompt` must not be provided for either of those variants. When + * `split_input.split_type` is `smart`, `split_input.prompt` is required and neither + * `split_input.split_definition` nor `split_input.page_selection` must be provided. + * + * @param requestBody Request body of createDocumentSplitV2026R0 method + */ + public DocumentSplitCreateResponseV2026R0 createDocumentSplitV2026R0( + DocumentSplitCreateRequestV2026R0 requestBody) { + return createDocumentSplitV2026R0(requestBody, new CreateDocumentSplitV2026R0Headers()); + } + + /** + * Initiates a Document Split job for the supplied source file. The job runs asynchronously; + * clients can poll the returned job ID to track progress. + * + *

All split-specific input lives under `split_input`. When `split_input.split_type` is + * `manual`, provide `split_input.split_definition` (continuous page ranges; `version` may be + * omitted or `v_1`). When `split_input.split_type` is `page_selection`, provide + * `split_input.page_selection` (non-linear page segments; `version` may be omitted or `v_2`). + * `split_input.prompt` must not be provided for either of those variants. When + * `split_input.split_type` is `smart`, `split_input.prompt` is required and neither + * `split_input.split_definition` nor `split_input.page_selection` must be provided. + * + * @param requestBody Request body of createDocumentSplitV2026R0 method + * @param headers Headers of createDocumentSplitV2026R0 method + */ + public DocumentSplitCreateResponseV2026R0 createDocumentSplitV2026R0( + DocumentSplitCreateRequestV2026R0 requestBody, CreateDocumentSplitV2026R0Headers headers) { + Map headersMap = + prepareParams( + mergeMaps( + mapOf(entryOf("box-version", convertToString(headers.getBoxVersion()))), + headers.getExtraHeaders())); + FetchResponse response = + this.networkSession + .getNetworkClient() + .fetch( + new FetchOptions.Builder( + String.join( + "", + this.networkSession.getBaseUrls().getBaseUrl(), + "/2.0/document_splits"), + "POST") + .headers(headersMap) + .data(JsonManager.serialize(requestBody)) + .contentType("application/json") + .responseFormat(ResponseFormat.JSON) + .auth(this.auth) + .networkSession(this.networkSession) + .build()); + return JsonManager.deserialize(response.getData(), DocumentSplitCreateResponseV2026R0.class); + } + + /** Returns a paginated list of Document Split jobs accessible to the authenticated user. */ + public DocumentSplitsV2026R0 getDocumentSplitsV2026R0() { + return getDocumentSplitsV2026R0( + new GetDocumentSplitsV2026R0QueryParams(), new GetDocumentSplitsV2026R0Headers()); + } + + /** + * Returns a paginated list of Document Split jobs accessible to the authenticated user. + * + * @param queryParams Query parameters of getDocumentSplitsV2026R0 method + */ + public DocumentSplitsV2026R0 getDocumentSplitsV2026R0( + GetDocumentSplitsV2026R0QueryParams queryParams) { + return getDocumentSplitsV2026R0(queryParams, new GetDocumentSplitsV2026R0Headers()); + } + + /** + * Returns a paginated list of Document Split jobs accessible to the authenticated user. + * + * @param headers Headers of getDocumentSplitsV2026R0 method + */ + public DocumentSplitsV2026R0 getDocumentSplitsV2026R0(GetDocumentSplitsV2026R0Headers headers) { + return getDocumentSplitsV2026R0(new GetDocumentSplitsV2026R0QueryParams(), headers); + } + + /** + * Returns a paginated list of Document Split jobs accessible to the authenticated user. + * + * @param queryParams Query parameters of getDocumentSplitsV2026R0 method + * @param headers Headers of getDocumentSplitsV2026R0 method + */ + public DocumentSplitsV2026R0 getDocumentSplitsV2026R0( + GetDocumentSplitsV2026R0QueryParams queryParams, GetDocumentSplitsV2026R0Headers headers) { + Map queryParamsMap = + prepareParams( + mapOf( + entryOf("marker", convertToString(queryParams.getMarker())), + entryOf("limit", convertToString(queryParams.getLimit())))); + Map headersMap = + prepareParams( + mergeMaps( + mapOf(entryOf("box-version", convertToString(headers.getBoxVersion()))), + headers.getExtraHeaders())); + FetchResponse response = + this.networkSession + .getNetworkClient() + .fetch( + new FetchOptions.Builder( + String.join( + "", + this.networkSession.getBaseUrls().getBaseUrl(), + "/2.0/document_splits"), + "GET") + .params(queryParamsMap) + .headers(headersMap) + .responseFormat(ResponseFormat.JSON) + .auth(this.auth) + .networkSession(this.networkSession) + .build()); + return JsonManager.deserialize(response.getData(), DocumentSplitsV2026R0.class); + } + + /** + * Returns details for a single Document Split job identified by its ID, including the current + * status, the input definition, and any output files produced by the job. + * + * @param documentSplitId The unique identifier for the Document Split job. Example: "1748426" + */ + public DocumentSplitV2026R0 getDocumentSplitByIdV2026R0(String documentSplitId) { + return getDocumentSplitByIdV2026R0(documentSplitId, new GetDocumentSplitByIdV2026R0Headers()); + } + + /** + * Returns details for a single Document Split job identified by its ID, including the current + * status, the input definition, and any output files produced by the job. + * + * @param documentSplitId The unique identifier for the Document Split job. Example: "1748426" + * @param headers Headers of getDocumentSplitByIdV2026R0 method + */ + public DocumentSplitV2026R0 getDocumentSplitByIdV2026R0( + String documentSplitId, GetDocumentSplitByIdV2026R0Headers headers) { + Map headersMap = + prepareParams( + mergeMaps( + mapOf(entryOf("box-version", convertToString(headers.getBoxVersion()))), + headers.getExtraHeaders())); + FetchResponse response = + this.networkSession + .getNetworkClient() + .fetch( + new FetchOptions.Builder( + String.join( + "", + this.networkSession.getBaseUrls().getBaseUrl(), + "/2.0/document_splits/", + convertToString(documentSplitId)), + "GET") + .headers(headersMap) + .responseFormat(ResponseFormat.JSON) + .auth(this.auth) + .networkSession(this.networkSession) + .build()); + return JsonManager.deserialize(response.getData(), DocumentSplitV2026R0.class); + } + + public Authentication getAuth() { + return auth; + } + + public NetworkSession getNetworkSession() { + return networkSession; + } + + public static class Builder { + + protected Authentication auth; + + protected NetworkSession networkSession; + + public Builder() {} + + public Builder auth(Authentication auth) { + this.auth = auth; + return this; + } + + public Builder networkSession(NetworkSession networkSession) { + this.networkSession = networkSession; + return this; + } + + public DocumentSplitManager build() { + if (this.networkSession == null) { + this.networkSession = new NetworkSession(); + } + return new DocumentSplitManager(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/managers/documentsplit/GetDocumentSplitByIdV2026R0Headers.java b/src/main/java/com/box/sdkgen/managers/documentsplit/GetDocumentSplitByIdV2026R0Headers.java new file mode 100644 index 000000000..4b135473d --- /dev/null +++ b/src/main/java/com/box/sdkgen/managers/documentsplit/GetDocumentSplitByIdV2026R0Headers.java @@ -0,0 +1,68 @@ +package com.box.sdkgen.managers.documentsplit; + +import static com.box.sdkgen.internal.utils.UtilsManager.mapOf; + +import com.box.sdkgen.parameters.v2026r0.boxversionheaderv2026r0.BoxVersionHeaderV2026R0; +import com.box.sdkgen.serialization.json.EnumWrapper; +import java.util.Map; + +public class GetDocumentSplitByIdV2026R0Headers { + + /** Version header. */ + public EnumWrapper boxVersion; + + /** Extra headers that will be included in the HTTP request. */ + public Map extraHeaders; + + public GetDocumentSplitByIdV2026R0Headers() { + this.boxVersion = new EnumWrapper(BoxVersionHeaderV2026R0._2026_0); + this.extraHeaders = mapOf(); + } + + protected GetDocumentSplitByIdV2026R0Headers(Builder builder) { + this.boxVersion = builder.boxVersion; + this.extraHeaders = builder.extraHeaders; + } + + public EnumWrapper getBoxVersion() { + return boxVersion; + } + + public Map getExtraHeaders() { + return extraHeaders; + } + + public static class Builder { + + protected EnumWrapper boxVersion; + + protected Map extraHeaders; + + public Builder() {} + + public Builder boxVersion(BoxVersionHeaderV2026R0 boxVersion) { + this.boxVersion = new EnumWrapper(boxVersion); + return this; + } + + public Builder boxVersion(EnumWrapper boxVersion) { + this.boxVersion = boxVersion; + return this; + } + + public Builder extraHeaders(Map extraHeaders) { + this.extraHeaders = extraHeaders; + return this; + } + + public GetDocumentSplitByIdV2026R0Headers build() { + if (this.boxVersion == null) { + this.boxVersion = new EnumWrapper(BoxVersionHeaderV2026R0._2026_0); + } + if (this.extraHeaders == null) { + this.extraHeaders = mapOf(); + } + return new GetDocumentSplitByIdV2026R0Headers(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/managers/documentsplit/GetDocumentSplitsV2026R0Headers.java b/src/main/java/com/box/sdkgen/managers/documentsplit/GetDocumentSplitsV2026R0Headers.java new file mode 100644 index 000000000..47092d613 --- /dev/null +++ b/src/main/java/com/box/sdkgen/managers/documentsplit/GetDocumentSplitsV2026R0Headers.java @@ -0,0 +1,68 @@ +package com.box.sdkgen.managers.documentsplit; + +import static com.box.sdkgen.internal.utils.UtilsManager.mapOf; + +import com.box.sdkgen.parameters.v2026r0.boxversionheaderv2026r0.BoxVersionHeaderV2026R0; +import com.box.sdkgen.serialization.json.EnumWrapper; +import java.util.Map; + +public class GetDocumentSplitsV2026R0Headers { + + /** Version header. */ + public EnumWrapper boxVersion; + + /** Extra headers that will be included in the HTTP request. */ + public Map extraHeaders; + + public GetDocumentSplitsV2026R0Headers() { + this.boxVersion = new EnumWrapper(BoxVersionHeaderV2026R0._2026_0); + this.extraHeaders = mapOf(); + } + + protected GetDocumentSplitsV2026R0Headers(Builder builder) { + this.boxVersion = builder.boxVersion; + this.extraHeaders = builder.extraHeaders; + } + + public EnumWrapper getBoxVersion() { + return boxVersion; + } + + public Map getExtraHeaders() { + return extraHeaders; + } + + public static class Builder { + + protected EnumWrapper boxVersion; + + protected Map extraHeaders; + + public Builder() {} + + public Builder boxVersion(BoxVersionHeaderV2026R0 boxVersion) { + this.boxVersion = new EnumWrapper(boxVersion); + return this; + } + + public Builder boxVersion(EnumWrapper boxVersion) { + this.boxVersion = boxVersion; + return this; + } + + public Builder extraHeaders(Map extraHeaders) { + this.extraHeaders = extraHeaders; + return this; + } + + public GetDocumentSplitsV2026R0Headers build() { + if (this.boxVersion == null) { + this.boxVersion = new EnumWrapper(BoxVersionHeaderV2026R0._2026_0); + } + if (this.extraHeaders == null) { + this.extraHeaders = mapOf(); + } + return new GetDocumentSplitsV2026R0Headers(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/managers/documentsplit/GetDocumentSplitsV2026R0QueryParams.java b/src/main/java/com/box/sdkgen/managers/documentsplit/GetDocumentSplitsV2026R0QueryParams.java new file mode 100644 index 000000000..a346c9b30 --- /dev/null +++ b/src/main/java/com/box/sdkgen/managers/documentsplit/GetDocumentSplitsV2026R0QueryParams.java @@ -0,0 +1,51 @@ +package com.box.sdkgen.managers.documentsplit; + +public class GetDocumentSplitsV2026R0QueryParams { + + /** + * Defines the position marker at which to begin returning results. This is used when paginating + * using marker-based pagination. + * + *

This requires `usemarker` to be set to `true`. + */ + public String marker; + + /** The maximum number of items to return per page. */ + public Long limit; + + public GetDocumentSplitsV2026R0QueryParams() {} + + protected GetDocumentSplitsV2026R0QueryParams(Builder builder) { + this.marker = builder.marker; + this.limit = builder.limit; + } + + public String getMarker() { + return marker; + } + + public Long getLimit() { + return limit; + } + + public static class Builder { + + protected String marker; + + protected Long limit; + + public Builder marker(String marker) { + this.marker = marker; + return this; + } + + public Builder limit(Long limit) { + this.limit = limit; + return this; + } + + public GetDocumentSplitsV2026R0QueryParams build() { + return new GetDocumentSplitsV2026R0QueryParams(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/managers/files/UpdateFileByIdRequestBodySharedLinkField.java b/src/main/java/com/box/sdkgen/managers/files/UpdateFileByIdRequestBodySharedLinkField.java index 5036d60f8..288b39a1d 100644 --- a/src/main/java/com/box/sdkgen/managers/files/UpdateFileByIdRequestBodySharedLinkField.java +++ b/src/main/java/com/box/sdkgen/managers/files/UpdateFileByIdRequestBodySharedLinkField.java @@ -4,6 +4,10 @@ import com.box.sdkgen.internal.NullableFieldTracker; import com.box.sdkgen.internal.SerializableObject; import com.box.sdkgen.internal.utils.DateTimeUtils; +import com.box.sdkgen.schemas.sharedlinkotpwritable.SharedLinkOtpWritable; +import com.box.sdkgen.schemas.sharedlinkotpwritableallowlist.SharedLinkOtpWritableAllowlist; +import com.box.sdkgen.schemas.sharedlinkotpwritablenone.SharedLinkOtpWritableNone; +import com.box.sdkgen.schemas.sharedlinkotpwritableopen.SharedLinkOtpWritableOpen; import com.box.sdkgen.serialization.json.EnumWrapper; import com.fasterxml.jackson.annotation.JsonFilter; import com.fasterxml.jackson.annotation.JsonProperty; @@ -65,6 +69,9 @@ public class UpdateFileByIdRequestBodySharedLinkField extends SerializableObject protected UpdateFileByIdRequestBodySharedLinkPermissionsField permissions; + @JsonProperty("one_time_passcode") + protected SharedLinkOtpWritable oneTimePasscode; + public UpdateFileByIdRequestBodySharedLinkField() { super(); } @@ -76,6 +83,7 @@ protected UpdateFileByIdRequestBodySharedLinkField(Builder builder) { this.vanityName = builder.vanityName; this.unsharedAt = builder.unsharedAt; this.permissions = builder.permissions; + this.oneTimePasscode = builder.oneTimePasscode; markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); } @@ -99,6 +107,10 @@ public UpdateFileByIdRequestBodySharedLinkPermissionsField getPermissions() { return permissions; } + public SharedLinkOtpWritable getOneTimePasscode() { + return oneTimePasscode; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -112,12 +124,13 @@ public boolean equals(Object o) { && Objects.equals(password, casted.password) && Objects.equals(vanityName, casted.vanityName) && Objects.equals(unsharedAt, casted.unsharedAt) - && Objects.equals(permissions, casted.permissions); + && Objects.equals(permissions, casted.permissions) + && Objects.equals(oneTimePasscode, casted.oneTimePasscode); } @Override public int hashCode() { - return Objects.hash(access, password, vanityName, unsharedAt, permissions); + return Objects.hash(access, password, vanityName, unsharedAt, permissions, oneTimePasscode); } @Override @@ -142,6 +155,10 @@ public String toString() { + "permissions='" + permissions + '\'' + + ", " + + "oneTimePasscode='" + + oneTimePasscode + + '\'' + "}"; } @@ -157,6 +174,8 @@ public static class Builder extends NullableFieldTracker { protected UpdateFileByIdRequestBodySharedLinkPermissionsField permissions; + protected SharedLinkOtpWritable oneTimePasscode; + public Builder access(UpdateFileByIdRequestBodySharedLinkAccessField access) { this.access = new EnumWrapper(access); return this; @@ -188,6 +207,26 @@ public Builder permissions(UpdateFileByIdRequestBodySharedLinkPermissionsField p return this; } + public Builder oneTimePasscode(SharedLinkOtpWritableNone oneTimePasscode) { + this.oneTimePasscode = new SharedLinkOtpWritable(oneTimePasscode); + return this; + } + + public Builder oneTimePasscode(SharedLinkOtpWritableOpen oneTimePasscode) { + this.oneTimePasscode = new SharedLinkOtpWritable(oneTimePasscode); + return this; + } + + public Builder oneTimePasscode(SharedLinkOtpWritableAllowlist oneTimePasscode) { + this.oneTimePasscode = new SharedLinkOtpWritable(oneTimePasscode); + return this; + } + + public Builder oneTimePasscode(SharedLinkOtpWritable oneTimePasscode) { + this.oneTimePasscode = oneTimePasscode; + return this; + } + public UpdateFileByIdRequestBodySharedLinkField build() { return new UpdateFileByIdRequestBodySharedLinkField(this); } diff --git a/src/main/java/com/box/sdkgen/managers/folders/UpdateFolderByIdRequestBodySharedLinkField.java b/src/main/java/com/box/sdkgen/managers/folders/UpdateFolderByIdRequestBodySharedLinkField.java index 432dd689d..b5c190a7d 100644 --- a/src/main/java/com/box/sdkgen/managers/folders/UpdateFolderByIdRequestBodySharedLinkField.java +++ b/src/main/java/com/box/sdkgen/managers/folders/UpdateFolderByIdRequestBodySharedLinkField.java @@ -4,6 +4,10 @@ import com.box.sdkgen.internal.NullableFieldTracker; import com.box.sdkgen.internal.SerializableObject; import com.box.sdkgen.internal.utils.DateTimeUtils; +import com.box.sdkgen.schemas.sharedlinkotpwritable.SharedLinkOtpWritable; +import com.box.sdkgen.schemas.sharedlinkotpwritableallowlist.SharedLinkOtpWritableAllowlist; +import com.box.sdkgen.schemas.sharedlinkotpwritablenone.SharedLinkOtpWritableNone; +import com.box.sdkgen.schemas.sharedlinkotpwritableopen.SharedLinkOtpWritableOpen; import com.box.sdkgen.serialization.json.EnumWrapper; import com.fasterxml.jackson.annotation.JsonFilter; import com.fasterxml.jackson.annotation.JsonProperty; @@ -65,6 +69,9 @@ public class UpdateFolderByIdRequestBodySharedLinkField extends SerializableObje protected UpdateFolderByIdRequestBodySharedLinkPermissionsField permissions; + @JsonProperty("one_time_passcode") + protected SharedLinkOtpWritable oneTimePasscode; + public UpdateFolderByIdRequestBodySharedLinkField() { super(); } @@ -76,6 +83,7 @@ protected UpdateFolderByIdRequestBodySharedLinkField(Builder builder) { this.vanityName = builder.vanityName; this.unsharedAt = builder.unsharedAt; this.permissions = builder.permissions; + this.oneTimePasscode = builder.oneTimePasscode; markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); } @@ -99,6 +107,10 @@ public UpdateFolderByIdRequestBodySharedLinkPermissionsField getPermissions() { return permissions; } + public SharedLinkOtpWritable getOneTimePasscode() { + return oneTimePasscode; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -113,12 +125,13 @@ public boolean equals(Object o) { && Objects.equals(password, casted.password) && Objects.equals(vanityName, casted.vanityName) && Objects.equals(unsharedAt, casted.unsharedAt) - && Objects.equals(permissions, casted.permissions); + && Objects.equals(permissions, casted.permissions) + && Objects.equals(oneTimePasscode, casted.oneTimePasscode); } @Override public int hashCode() { - return Objects.hash(access, password, vanityName, unsharedAt, permissions); + return Objects.hash(access, password, vanityName, unsharedAt, permissions, oneTimePasscode); } @Override @@ -143,6 +156,10 @@ public String toString() { + "permissions='" + permissions + '\'' + + ", " + + "oneTimePasscode='" + + oneTimePasscode + + '\'' + "}"; } @@ -158,6 +175,8 @@ public static class Builder extends NullableFieldTracker { protected UpdateFolderByIdRequestBodySharedLinkPermissionsField permissions; + protected SharedLinkOtpWritable oneTimePasscode; + public Builder access(UpdateFolderByIdRequestBodySharedLinkAccessField access) { this.access = new EnumWrapper(access); return this; @@ -189,6 +208,26 @@ public Builder permissions(UpdateFolderByIdRequestBodySharedLinkPermissionsField return this; } + public Builder oneTimePasscode(SharedLinkOtpWritableNone oneTimePasscode) { + this.oneTimePasscode = new SharedLinkOtpWritable(oneTimePasscode); + return this; + } + + public Builder oneTimePasscode(SharedLinkOtpWritableOpen oneTimePasscode) { + this.oneTimePasscode = new SharedLinkOtpWritable(oneTimePasscode); + return this; + } + + public Builder oneTimePasscode(SharedLinkOtpWritableAllowlist oneTimePasscode) { + this.oneTimePasscode = new SharedLinkOtpWritable(oneTimePasscode); + return this; + } + + public Builder oneTimePasscode(SharedLinkOtpWritable oneTimePasscode) { + this.oneTimePasscode = oneTimePasscode; + return this; + } + public UpdateFolderByIdRequestBodySharedLinkField build() { return new UpdateFolderByIdRequestBodySharedLinkField(this); } diff --git a/src/main/java/com/box/sdkgen/managers/sharedlinksfiles/AddShareLinkToFileRequestBodySharedLinkField.java b/src/main/java/com/box/sdkgen/managers/sharedlinksfiles/AddShareLinkToFileRequestBodySharedLinkField.java index e777ed4a4..fed620b93 100644 --- a/src/main/java/com/box/sdkgen/managers/sharedlinksfiles/AddShareLinkToFileRequestBodySharedLinkField.java +++ b/src/main/java/com/box/sdkgen/managers/sharedlinksfiles/AddShareLinkToFileRequestBodySharedLinkField.java @@ -4,6 +4,10 @@ import com.box.sdkgen.internal.NullableFieldTracker; import com.box.sdkgen.internal.SerializableObject; import com.box.sdkgen.internal.utils.DateTimeUtils; +import com.box.sdkgen.schemas.sharedlinkotpwritable.SharedLinkOtpWritable; +import com.box.sdkgen.schemas.sharedlinkotpwritableallowlist.SharedLinkOtpWritableAllowlist; +import com.box.sdkgen.schemas.sharedlinkotpwritablenone.SharedLinkOtpWritableNone; +import com.box.sdkgen.schemas.sharedlinkotpwritableopen.SharedLinkOtpWritableOpen; import com.box.sdkgen.serialization.json.EnumWrapper; import com.fasterxml.jackson.annotation.JsonFilter; import com.fasterxml.jackson.annotation.JsonProperty; @@ -65,6 +69,9 @@ public class AddShareLinkToFileRequestBodySharedLinkField extends SerializableOb protected AddShareLinkToFileRequestBodySharedLinkPermissionsField permissions; + @JsonProperty("one_time_passcode") + protected SharedLinkOtpWritable oneTimePasscode; + public AddShareLinkToFileRequestBodySharedLinkField() { super(); } @@ -76,6 +83,7 @@ protected AddShareLinkToFileRequestBodySharedLinkField(Builder builder) { this.vanityName = builder.vanityName; this.unsharedAt = builder.unsharedAt; this.permissions = builder.permissions; + this.oneTimePasscode = builder.oneTimePasscode; markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); } @@ -99,6 +107,10 @@ public AddShareLinkToFileRequestBodySharedLinkPermissionsField getPermissions() return permissions; } + public SharedLinkOtpWritable getOneTimePasscode() { + return oneTimePasscode; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -113,12 +125,13 @@ public boolean equals(Object o) { && Objects.equals(password, casted.password) && Objects.equals(vanityName, casted.vanityName) && Objects.equals(unsharedAt, casted.unsharedAt) - && Objects.equals(permissions, casted.permissions); + && Objects.equals(permissions, casted.permissions) + && Objects.equals(oneTimePasscode, casted.oneTimePasscode); } @Override public int hashCode() { - return Objects.hash(access, password, vanityName, unsharedAt, permissions); + return Objects.hash(access, password, vanityName, unsharedAt, permissions, oneTimePasscode); } @Override @@ -143,6 +156,10 @@ public String toString() { + "permissions='" + permissions + '\'' + + ", " + + "oneTimePasscode='" + + oneTimePasscode + + '\'' + "}"; } @@ -158,6 +175,8 @@ public static class Builder extends NullableFieldTracker { protected AddShareLinkToFileRequestBodySharedLinkPermissionsField permissions; + protected SharedLinkOtpWritable oneTimePasscode; + public Builder access(AddShareLinkToFileRequestBodySharedLinkAccessField access) { this.access = new EnumWrapper(access); return this; @@ -190,6 +209,26 @@ public Builder permissions( return this; } + public Builder oneTimePasscode(SharedLinkOtpWritableNone oneTimePasscode) { + this.oneTimePasscode = new SharedLinkOtpWritable(oneTimePasscode); + return this; + } + + public Builder oneTimePasscode(SharedLinkOtpWritableOpen oneTimePasscode) { + this.oneTimePasscode = new SharedLinkOtpWritable(oneTimePasscode); + return this; + } + + public Builder oneTimePasscode(SharedLinkOtpWritableAllowlist oneTimePasscode) { + this.oneTimePasscode = new SharedLinkOtpWritable(oneTimePasscode); + return this; + } + + public Builder oneTimePasscode(SharedLinkOtpWritable oneTimePasscode) { + this.oneTimePasscode = oneTimePasscode; + return this; + } + public AddShareLinkToFileRequestBodySharedLinkField build() { return new AddShareLinkToFileRequestBodySharedLinkField(this); } diff --git a/src/main/java/com/box/sdkgen/managers/sharedlinksfiles/UpdateSharedLinkOnFileRequestBodySharedLinkField.java b/src/main/java/com/box/sdkgen/managers/sharedlinksfiles/UpdateSharedLinkOnFileRequestBodySharedLinkField.java index 574f38374..d3f345bf1 100644 --- a/src/main/java/com/box/sdkgen/managers/sharedlinksfiles/UpdateSharedLinkOnFileRequestBodySharedLinkField.java +++ b/src/main/java/com/box/sdkgen/managers/sharedlinksfiles/UpdateSharedLinkOnFileRequestBodySharedLinkField.java @@ -4,6 +4,10 @@ import com.box.sdkgen.internal.NullableFieldTracker; import com.box.sdkgen.internal.SerializableObject; import com.box.sdkgen.internal.utils.DateTimeUtils; +import com.box.sdkgen.schemas.sharedlinkotpwritable.SharedLinkOtpWritable; +import com.box.sdkgen.schemas.sharedlinkotpwritableallowlist.SharedLinkOtpWritableAllowlist; +import com.box.sdkgen.schemas.sharedlinkotpwritablenone.SharedLinkOtpWritableNone; +import com.box.sdkgen.schemas.sharedlinkotpwritableopen.SharedLinkOtpWritableOpen; import com.box.sdkgen.serialization.json.EnumWrapper; import com.fasterxml.jackson.annotation.JsonFilter; import com.fasterxml.jackson.annotation.JsonProperty; @@ -65,6 +69,9 @@ public class UpdateSharedLinkOnFileRequestBodySharedLinkField extends Serializab protected UpdateSharedLinkOnFileRequestBodySharedLinkPermissionsField permissions; + @JsonProperty("one_time_passcode") + protected SharedLinkOtpWritable oneTimePasscode; + public UpdateSharedLinkOnFileRequestBodySharedLinkField() { super(); } @@ -76,6 +83,7 @@ protected UpdateSharedLinkOnFileRequestBodySharedLinkField(Builder builder) { this.vanityName = builder.vanityName; this.unsharedAt = builder.unsharedAt; this.permissions = builder.permissions; + this.oneTimePasscode = builder.oneTimePasscode; markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); } @@ -99,6 +107,10 @@ public UpdateSharedLinkOnFileRequestBodySharedLinkPermissionsField getPermission return permissions; } + public SharedLinkOtpWritable getOneTimePasscode() { + return oneTimePasscode; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -113,12 +125,13 @@ public boolean equals(Object o) { && Objects.equals(password, casted.password) && Objects.equals(vanityName, casted.vanityName) && Objects.equals(unsharedAt, casted.unsharedAt) - && Objects.equals(permissions, casted.permissions); + && Objects.equals(permissions, casted.permissions) + && Objects.equals(oneTimePasscode, casted.oneTimePasscode); } @Override public int hashCode() { - return Objects.hash(access, password, vanityName, unsharedAt, permissions); + return Objects.hash(access, password, vanityName, unsharedAt, permissions, oneTimePasscode); } @Override @@ -143,6 +156,10 @@ public String toString() { + "permissions='" + permissions + '\'' + + ", " + + "oneTimePasscode='" + + oneTimePasscode + + '\'' + "}"; } @@ -158,6 +175,8 @@ public static class Builder extends NullableFieldTracker { protected UpdateSharedLinkOnFileRequestBodySharedLinkPermissionsField permissions; + protected SharedLinkOtpWritable oneTimePasscode; + public Builder access(UpdateSharedLinkOnFileRequestBodySharedLinkAccessField access) { this.access = new EnumWrapper(access); return this; @@ -191,6 +210,26 @@ public Builder permissions( return this; } + public Builder oneTimePasscode(SharedLinkOtpWritableNone oneTimePasscode) { + this.oneTimePasscode = new SharedLinkOtpWritable(oneTimePasscode); + return this; + } + + public Builder oneTimePasscode(SharedLinkOtpWritableOpen oneTimePasscode) { + this.oneTimePasscode = new SharedLinkOtpWritable(oneTimePasscode); + return this; + } + + public Builder oneTimePasscode(SharedLinkOtpWritableAllowlist oneTimePasscode) { + this.oneTimePasscode = new SharedLinkOtpWritable(oneTimePasscode); + return this; + } + + public Builder oneTimePasscode(SharedLinkOtpWritable oneTimePasscode) { + this.oneTimePasscode = oneTimePasscode; + return this; + } + public UpdateSharedLinkOnFileRequestBodySharedLinkField build() { return new UpdateSharedLinkOnFileRequestBodySharedLinkField(this); } diff --git a/src/main/java/com/box/sdkgen/managers/sharedlinksfolders/AddShareLinkToFolderRequestBodySharedLinkField.java b/src/main/java/com/box/sdkgen/managers/sharedlinksfolders/AddShareLinkToFolderRequestBodySharedLinkField.java index e27d854da..e4d3ca5d2 100644 --- a/src/main/java/com/box/sdkgen/managers/sharedlinksfolders/AddShareLinkToFolderRequestBodySharedLinkField.java +++ b/src/main/java/com/box/sdkgen/managers/sharedlinksfolders/AddShareLinkToFolderRequestBodySharedLinkField.java @@ -4,6 +4,10 @@ import com.box.sdkgen.internal.NullableFieldTracker; import com.box.sdkgen.internal.SerializableObject; import com.box.sdkgen.internal.utils.DateTimeUtils; +import com.box.sdkgen.schemas.sharedlinkotpwritable.SharedLinkOtpWritable; +import com.box.sdkgen.schemas.sharedlinkotpwritableallowlist.SharedLinkOtpWritableAllowlist; +import com.box.sdkgen.schemas.sharedlinkotpwritablenone.SharedLinkOtpWritableNone; +import com.box.sdkgen.schemas.sharedlinkotpwritableopen.SharedLinkOtpWritableOpen; import com.box.sdkgen.serialization.json.EnumWrapper; import com.fasterxml.jackson.annotation.JsonFilter; import com.fasterxml.jackson.annotation.JsonProperty; @@ -65,6 +69,9 @@ public class AddShareLinkToFolderRequestBodySharedLinkField extends Serializable protected AddShareLinkToFolderRequestBodySharedLinkPermissionsField permissions; + @JsonProperty("one_time_passcode") + protected SharedLinkOtpWritable oneTimePasscode; + public AddShareLinkToFolderRequestBodySharedLinkField() { super(); } @@ -76,6 +83,7 @@ protected AddShareLinkToFolderRequestBodySharedLinkField(Builder builder) { this.vanityName = builder.vanityName; this.unsharedAt = builder.unsharedAt; this.permissions = builder.permissions; + this.oneTimePasscode = builder.oneTimePasscode; markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); } @@ -99,6 +107,10 @@ public AddShareLinkToFolderRequestBodySharedLinkPermissionsField getPermissions( return permissions; } + public SharedLinkOtpWritable getOneTimePasscode() { + return oneTimePasscode; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -113,12 +125,13 @@ public boolean equals(Object o) { && Objects.equals(password, casted.password) && Objects.equals(vanityName, casted.vanityName) && Objects.equals(unsharedAt, casted.unsharedAt) - && Objects.equals(permissions, casted.permissions); + && Objects.equals(permissions, casted.permissions) + && Objects.equals(oneTimePasscode, casted.oneTimePasscode); } @Override public int hashCode() { - return Objects.hash(access, password, vanityName, unsharedAt, permissions); + return Objects.hash(access, password, vanityName, unsharedAt, permissions, oneTimePasscode); } @Override @@ -143,6 +156,10 @@ public String toString() { + "permissions='" + permissions + '\'' + + ", " + + "oneTimePasscode='" + + oneTimePasscode + + '\'' + "}"; } @@ -158,6 +175,8 @@ public static class Builder extends NullableFieldTracker { protected AddShareLinkToFolderRequestBodySharedLinkPermissionsField permissions; + protected SharedLinkOtpWritable oneTimePasscode; + public Builder access(AddShareLinkToFolderRequestBodySharedLinkAccessField access) { this.access = new EnumWrapper(access); return this; @@ -191,6 +210,26 @@ public Builder permissions( return this; } + public Builder oneTimePasscode(SharedLinkOtpWritableNone oneTimePasscode) { + this.oneTimePasscode = new SharedLinkOtpWritable(oneTimePasscode); + return this; + } + + public Builder oneTimePasscode(SharedLinkOtpWritableOpen oneTimePasscode) { + this.oneTimePasscode = new SharedLinkOtpWritable(oneTimePasscode); + return this; + } + + public Builder oneTimePasscode(SharedLinkOtpWritableAllowlist oneTimePasscode) { + this.oneTimePasscode = new SharedLinkOtpWritable(oneTimePasscode); + return this; + } + + public Builder oneTimePasscode(SharedLinkOtpWritable oneTimePasscode) { + this.oneTimePasscode = oneTimePasscode; + return this; + } + public AddShareLinkToFolderRequestBodySharedLinkField build() { return new AddShareLinkToFolderRequestBodySharedLinkField(this); } diff --git a/src/main/java/com/box/sdkgen/managers/sharedlinksfolders/UpdateSharedLinkOnFolderRequestBodySharedLinkField.java b/src/main/java/com/box/sdkgen/managers/sharedlinksfolders/UpdateSharedLinkOnFolderRequestBodySharedLinkField.java index 3eb56e05f..6dcbb7e74 100644 --- a/src/main/java/com/box/sdkgen/managers/sharedlinksfolders/UpdateSharedLinkOnFolderRequestBodySharedLinkField.java +++ b/src/main/java/com/box/sdkgen/managers/sharedlinksfolders/UpdateSharedLinkOnFolderRequestBodySharedLinkField.java @@ -3,6 +3,10 @@ import com.box.sdkgen.internal.NullableFieldTracker; import com.box.sdkgen.internal.SerializableObject; import com.box.sdkgen.internal.utils.DateTimeUtils; +import com.box.sdkgen.schemas.sharedlinkotpwritable.SharedLinkOtpWritable; +import com.box.sdkgen.schemas.sharedlinkotpwritableallowlist.SharedLinkOtpWritableAllowlist; +import com.box.sdkgen.schemas.sharedlinkotpwritablenone.SharedLinkOtpWritableNone; +import com.box.sdkgen.schemas.sharedlinkotpwritableopen.SharedLinkOtpWritableOpen; import com.box.sdkgen.serialization.json.EnumWrapper; import com.fasterxml.jackson.annotation.JsonFilter; import com.fasterxml.jackson.annotation.JsonProperty; @@ -64,6 +68,9 @@ public class UpdateSharedLinkOnFolderRequestBodySharedLinkField extends Serializ protected UpdateSharedLinkOnFolderRequestBodySharedLinkPermissionsField permissions; + @JsonProperty("one_time_passcode") + protected SharedLinkOtpWritable oneTimePasscode; + public UpdateSharedLinkOnFolderRequestBodySharedLinkField() { super(); } @@ -75,6 +82,7 @@ protected UpdateSharedLinkOnFolderRequestBodySharedLinkField(Builder builder) { this.vanityName = builder.vanityName; this.unsharedAt = builder.unsharedAt; this.permissions = builder.permissions; + this.oneTimePasscode = builder.oneTimePasscode; markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); } @@ -98,6 +106,10 @@ public UpdateSharedLinkOnFolderRequestBodySharedLinkPermissionsField getPermissi return permissions; } + public SharedLinkOtpWritable getOneTimePasscode() { + return oneTimePasscode; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -112,12 +124,13 @@ public boolean equals(Object o) { && Objects.equals(password, casted.password) && Objects.equals(vanityName, casted.vanityName) && Objects.equals(unsharedAt, casted.unsharedAt) - && Objects.equals(permissions, casted.permissions); + && Objects.equals(permissions, casted.permissions) + && Objects.equals(oneTimePasscode, casted.oneTimePasscode); } @Override public int hashCode() { - return Objects.hash(access, password, vanityName, unsharedAt, permissions); + return Objects.hash(access, password, vanityName, unsharedAt, permissions, oneTimePasscode); } @Override @@ -142,6 +155,10 @@ public String toString() { + "permissions='" + permissions + '\'' + + ", " + + "oneTimePasscode='" + + oneTimePasscode + + '\'' + "}"; } @@ -157,6 +174,8 @@ public static class Builder extends NullableFieldTracker { protected UpdateSharedLinkOnFolderRequestBodySharedLinkPermissionsField permissions; + protected SharedLinkOtpWritable oneTimePasscode; + public Builder access(UpdateSharedLinkOnFolderRequestBodySharedLinkAccessField access) { this.access = new EnumWrapper(access); @@ -190,6 +209,26 @@ public Builder permissions( return this; } + public Builder oneTimePasscode(SharedLinkOtpWritableNone oneTimePasscode) { + this.oneTimePasscode = new SharedLinkOtpWritable(oneTimePasscode); + return this; + } + + public Builder oneTimePasscode(SharedLinkOtpWritableOpen oneTimePasscode) { + this.oneTimePasscode = new SharedLinkOtpWritable(oneTimePasscode); + return this; + } + + public Builder oneTimePasscode(SharedLinkOtpWritableAllowlist oneTimePasscode) { + this.oneTimePasscode = new SharedLinkOtpWritable(oneTimePasscode); + return this; + } + + public Builder oneTimePasscode(SharedLinkOtpWritable oneTimePasscode) { + this.oneTimePasscode = oneTimePasscode; + return this; + } + public UpdateSharedLinkOnFolderRequestBodySharedLinkField build() { return new UpdateSharedLinkOnFolderRequestBodySharedLinkField(this); } diff --git a/src/main/java/com/box/sdkgen/managers/sharedlinksweblinks/AddShareLinkToWebLinkRequestBodySharedLinkField.java b/src/main/java/com/box/sdkgen/managers/sharedlinksweblinks/AddShareLinkToWebLinkRequestBodySharedLinkField.java index 381060bb8..4bea28289 100644 --- a/src/main/java/com/box/sdkgen/managers/sharedlinksweblinks/AddShareLinkToWebLinkRequestBodySharedLinkField.java +++ b/src/main/java/com/box/sdkgen/managers/sharedlinksweblinks/AddShareLinkToWebLinkRequestBodySharedLinkField.java @@ -4,6 +4,10 @@ import com.box.sdkgen.internal.NullableFieldTracker; import com.box.sdkgen.internal.SerializableObject; import com.box.sdkgen.internal.utils.DateTimeUtils; +import com.box.sdkgen.schemas.sharedlinkotpwritable.SharedLinkOtpWritable; +import com.box.sdkgen.schemas.sharedlinkotpwritableallowlist.SharedLinkOtpWritableAllowlist; +import com.box.sdkgen.schemas.sharedlinkotpwritablenone.SharedLinkOtpWritableNone; +import com.box.sdkgen.schemas.sharedlinkotpwritableopen.SharedLinkOtpWritableOpen; import com.box.sdkgen.serialization.json.EnumWrapper; import com.fasterxml.jackson.annotation.JsonFilter; import com.fasterxml.jackson.annotation.JsonProperty; @@ -65,6 +69,9 @@ public class AddShareLinkToWebLinkRequestBodySharedLinkField extends Serializabl protected AddShareLinkToWebLinkRequestBodySharedLinkPermissionsField permissions; + @JsonProperty("one_time_passcode") + protected SharedLinkOtpWritable oneTimePasscode; + public AddShareLinkToWebLinkRequestBodySharedLinkField() { super(); } @@ -76,6 +83,7 @@ protected AddShareLinkToWebLinkRequestBodySharedLinkField(Builder builder) { this.vanityName = builder.vanityName; this.unsharedAt = builder.unsharedAt; this.permissions = builder.permissions; + this.oneTimePasscode = builder.oneTimePasscode; markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); } @@ -99,6 +107,10 @@ public AddShareLinkToWebLinkRequestBodySharedLinkPermissionsField getPermissions return permissions; } + public SharedLinkOtpWritable getOneTimePasscode() { + return oneTimePasscode; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -113,12 +125,13 @@ public boolean equals(Object o) { && Objects.equals(password, casted.password) && Objects.equals(vanityName, casted.vanityName) && Objects.equals(unsharedAt, casted.unsharedAt) - && Objects.equals(permissions, casted.permissions); + && Objects.equals(permissions, casted.permissions) + && Objects.equals(oneTimePasscode, casted.oneTimePasscode); } @Override public int hashCode() { - return Objects.hash(access, password, vanityName, unsharedAt, permissions); + return Objects.hash(access, password, vanityName, unsharedAt, permissions, oneTimePasscode); } @Override @@ -143,6 +156,10 @@ public String toString() { + "permissions='" + permissions + '\'' + + ", " + + "oneTimePasscode='" + + oneTimePasscode + + '\'' + "}"; } @@ -158,6 +175,8 @@ public static class Builder extends NullableFieldTracker { protected AddShareLinkToWebLinkRequestBodySharedLinkPermissionsField permissions; + protected SharedLinkOtpWritable oneTimePasscode; + public Builder access(AddShareLinkToWebLinkRequestBodySharedLinkAccessField access) { this.access = new EnumWrapper(access); return this; @@ -191,6 +210,26 @@ public Builder permissions( return this; } + public Builder oneTimePasscode(SharedLinkOtpWritableNone oneTimePasscode) { + this.oneTimePasscode = new SharedLinkOtpWritable(oneTimePasscode); + return this; + } + + public Builder oneTimePasscode(SharedLinkOtpWritableOpen oneTimePasscode) { + this.oneTimePasscode = new SharedLinkOtpWritable(oneTimePasscode); + return this; + } + + public Builder oneTimePasscode(SharedLinkOtpWritableAllowlist oneTimePasscode) { + this.oneTimePasscode = new SharedLinkOtpWritable(oneTimePasscode); + return this; + } + + public Builder oneTimePasscode(SharedLinkOtpWritable oneTimePasscode) { + this.oneTimePasscode = oneTimePasscode; + return this; + } + public AddShareLinkToWebLinkRequestBodySharedLinkField build() { return new AddShareLinkToWebLinkRequestBodySharedLinkField(this); } diff --git a/src/main/java/com/box/sdkgen/managers/sharedlinksweblinks/UpdateSharedLinkOnWebLinkRequestBodySharedLinkField.java b/src/main/java/com/box/sdkgen/managers/sharedlinksweblinks/UpdateSharedLinkOnWebLinkRequestBodySharedLinkField.java index 619ad3772..ee20f1936 100644 --- a/src/main/java/com/box/sdkgen/managers/sharedlinksweblinks/UpdateSharedLinkOnWebLinkRequestBodySharedLinkField.java +++ b/src/main/java/com/box/sdkgen/managers/sharedlinksweblinks/UpdateSharedLinkOnWebLinkRequestBodySharedLinkField.java @@ -4,6 +4,10 @@ import com.box.sdkgen.internal.NullableFieldTracker; import com.box.sdkgen.internal.SerializableObject; import com.box.sdkgen.internal.utils.DateTimeUtils; +import com.box.sdkgen.schemas.sharedlinkotpwritable.SharedLinkOtpWritable; +import com.box.sdkgen.schemas.sharedlinkotpwritableallowlist.SharedLinkOtpWritableAllowlist; +import com.box.sdkgen.schemas.sharedlinkotpwritablenone.SharedLinkOtpWritableNone; +import com.box.sdkgen.schemas.sharedlinkotpwritableopen.SharedLinkOtpWritableOpen; import com.box.sdkgen.serialization.json.EnumWrapper; import com.fasterxml.jackson.annotation.JsonFilter; import com.fasterxml.jackson.annotation.JsonProperty; @@ -65,6 +69,9 @@ public class UpdateSharedLinkOnWebLinkRequestBodySharedLinkField extends Seriali protected UpdateSharedLinkOnWebLinkRequestBodySharedLinkPermissionsField permissions; + @JsonProperty("one_time_passcode") + protected SharedLinkOtpWritable oneTimePasscode; + public UpdateSharedLinkOnWebLinkRequestBodySharedLinkField() { super(); } @@ -76,6 +83,7 @@ protected UpdateSharedLinkOnWebLinkRequestBodySharedLinkField(Builder builder) { this.vanityName = builder.vanityName; this.unsharedAt = builder.unsharedAt; this.permissions = builder.permissions; + this.oneTimePasscode = builder.oneTimePasscode; markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); } @@ -99,6 +107,10 @@ public UpdateSharedLinkOnWebLinkRequestBodySharedLinkPermissionsField getPermiss return permissions; } + public SharedLinkOtpWritable getOneTimePasscode() { + return oneTimePasscode; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -113,12 +125,13 @@ public boolean equals(Object o) { && Objects.equals(password, casted.password) && Objects.equals(vanityName, casted.vanityName) && Objects.equals(unsharedAt, casted.unsharedAt) - && Objects.equals(permissions, casted.permissions); + && Objects.equals(permissions, casted.permissions) + && Objects.equals(oneTimePasscode, casted.oneTimePasscode); } @Override public int hashCode() { - return Objects.hash(access, password, vanityName, unsharedAt, permissions); + return Objects.hash(access, password, vanityName, unsharedAt, permissions, oneTimePasscode); } @Override @@ -143,6 +156,10 @@ public String toString() { + "permissions='" + permissions + '\'' + + ", " + + "oneTimePasscode='" + + oneTimePasscode + + '\'' + "}"; } @@ -158,6 +175,8 @@ public static class Builder extends NullableFieldTracker { protected UpdateSharedLinkOnWebLinkRequestBodySharedLinkPermissionsField permissions; + protected SharedLinkOtpWritable oneTimePasscode; + public Builder access(UpdateSharedLinkOnWebLinkRequestBodySharedLinkAccessField access) { this.access = new EnumWrapper(access); @@ -192,6 +211,26 @@ public Builder permissions( return this; } + public Builder oneTimePasscode(SharedLinkOtpWritableNone oneTimePasscode) { + this.oneTimePasscode = new SharedLinkOtpWritable(oneTimePasscode); + return this; + } + + public Builder oneTimePasscode(SharedLinkOtpWritableOpen oneTimePasscode) { + this.oneTimePasscode = new SharedLinkOtpWritable(oneTimePasscode); + return this; + } + + public Builder oneTimePasscode(SharedLinkOtpWritableAllowlist oneTimePasscode) { + this.oneTimePasscode = new SharedLinkOtpWritable(oneTimePasscode); + return this; + } + + public Builder oneTimePasscode(SharedLinkOtpWritable oneTimePasscode) { + this.oneTimePasscode = oneTimePasscode; + return this; + } + public UpdateSharedLinkOnWebLinkRequestBodySharedLinkField build() { return new UpdateSharedLinkOnWebLinkRequestBodySharedLinkField(this); } diff --git a/src/main/java/com/box/sdkgen/managers/users/DeleteUserByIdQueryParams.java b/src/main/java/com/box/sdkgen/managers/users/DeleteUserByIdQueryParams.java index 28d250932..60c37c088 100644 --- a/src/main/java/com/box/sdkgen/managers/users/DeleteUserByIdQueryParams.java +++ b/src/main/java/com/box/sdkgen/managers/users/DeleteUserByIdQueryParams.java @@ -5,7 +5,14 @@ public class DeleteUserByIdQueryParams { /** Whether the user will receive email notification of the deletion. */ public Boolean notify; - /** Specifies whether to delete the user even if they still own files. */ + /** + * Specifies whether to delete the user even if they still own files. + * + *

If the user owns content and the enterprise has a retention policy, including a retired one, + * or a legal hold that is not fully released, setting `force` to `true` doesn't delete the user. + * The request returns a `403` error, and you must transfer the user's content before deleting the + * user. + */ public Boolean force; public DeleteUserByIdQueryParams() {} diff --git a/src/main/java/com/box/sdkgen/managers/users/UsersManager.java b/src/main/java/com/box/sdkgen/managers/users/UsersManager.java index 92cc5f078..66e0cea16 100644 --- a/src/main/java/com/box/sdkgen/managers/users/UsersManager.java +++ b/src/main/java/com/box/sdkgen/managers/users/UsersManager.java @@ -481,6 +481,11 @@ public UserFull updateUserById( * proceed, move their owned content first, or use the `force` parameter to delete the user and * their files. * + *

If the enterprise has a retention policy, including a retired one, or a legal hold that is + * not fully released, you can't delete a user who owns content, even with `force`. Transfer the + * user's content first by using the [Transfer owned + * folders](https://developer.box.com/reference/put-users-id-folders-0) endpoint. + * * @param userId The ID of the user. Example: "12345" */ public void deleteUserById(String userId) { @@ -492,6 +497,11 @@ public void deleteUserById(String userId) { * proceed, move their owned content first, or use the `force` parameter to delete the user and * their files. * + *

If the enterprise has a retention policy, including a retired one, or a legal hold that is + * not fully released, you can't delete a user who owns content, even with `force`. Transfer the + * user's content first by using the [Transfer owned + * folders](https://developer.box.com/reference/put-users-id-folders-0) endpoint. + * * @param userId The ID of the user. Example: "12345" * @param queryParams Query parameters of deleteUserById method */ @@ -504,6 +514,11 @@ public void deleteUserById(String userId, DeleteUserByIdQueryParams queryParams) * proceed, move their owned content first, or use the `force` parameter to delete the user and * their files. * + *

If the enterprise has a retention policy, including a retired one, or a legal hold that is + * not fully released, you can't delete a user who owns content, even with `force`. Transfer the + * user's content first by using the [Transfer owned + * folders](https://developer.box.com/reference/put-users-id-folders-0) endpoint. + * * @param userId The ID of the user. Example: "12345" * @param headers Headers of deleteUserById method */ @@ -516,6 +531,11 @@ public void deleteUserById(String userId, DeleteUserByIdHeaders headers) { * proceed, move their owned content first, or use the `force` parameter to delete the user and * their files. * + *

If the enterprise has a retention policy, including a retired one, or a legal hold that is + * not fully released, you can't delete a user who owns content, even with `force`. Transfer the + * user's content first by using the [Transfer owned + * folders](https://developer.box.com/reference/put-users-id-folders-0) endpoint. + * * @param userId The ID of the user. Example: "12345" * @param queryParams Query parameters of deleteUserById method * @param headers Headers of deleteUserById method diff --git a/src/main/java/com/box/sdkgen/managers/weblinks/UpdateWebLinkByIdRequestBodySharedLinkField.java b/src/main/java/com/box/sdkgen/managers/weblinks/UpdateWebLinkByIdRequestBodySharedLinkField.java index 0dabfd364..be39cca8c 100644 --- a/src/main/java/com/box/sdkgen/managers/weblinks/UpdateWebLinkByIdRequestBodySharedLinkField.java +++ b/src/main/java/com/box/sdkgen/managers/weblinks/UpdateWebLinkByIdRequestBodySharedLinkField.java @@ -4,6 +4,10 @@ import com.box.sdkgen.internal.NullableFieldTracker; import com.box.sdkgen.internal.SerializableObject; import com.box.sdkgen.internal.utils.DateTimeUtils; +import com.box.sdkgen.schemas.sharedlinkotpwritable.SharedLinkOtpWritable; +import com.box.sdkgen.schemas.sharedlinkotpwritableallowlist.SharedLinkOtpWritableAllowlist; +import com.box.sdkgen.schemas.sharedlinkotpwritablenone.SharedLinkOtpWritableNone; +import com.box.sdkgen.schemas.sharedlinkotpwritableopen.SharedLinkOtpWritableOpen; import com.box.sdkgen.serialization.json.EnumWrapper; import com.fasterxml.jackson.annotation.JsonFilter; import com.fasterxml.jackson.annotation.JsonProperty; @@ -63,6 +67,9 @@ public class UpdateWebLinkByIdRequestBodySharedLinkField extends SerializableObj @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class) protected OffsetDateTime unsharedAt; + @JsonProperty("one_time_passcode") + protected SharedLinkOtpWritable oneTimePasscode; + public UpdateWebLinkByIdRequestBodySharedLinkField() { super(); } @@ -73,6 +80,7 @@ protected UpdateWebLinkByIdRequestBodySharedLinkField(Builder builder) { this.password = builder.password; this.vanityName = builder.vanityName; this.unsharedAt = builder.unsharedAt; + this.oneTimePasscode = builder.oneTimePasscode; markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); } @@ -92,6 +100,10 @@ public OffsetDateTime getUnsharedAt() { return unsharedAt; } + public SharedLinkOtpWritable getOneTimePasscode() { + return oneTimePasscode; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -105,12 +117,13 @@ public boolean equals(Object o) { return Objects.equals(access, casted.access) && Objects.equals(password, casted.password) && Objects.equals(vanityName, casted.vanityName) - && Objects.equals(unsharedAt, casted.unsharedAt); + && Objects.equals(unsharedAt, casted.unsharedAt) + && Objects.equals(oneTimePasscode, casted.oneTimePasscode); } @Override public int hashCode() { - return Objects.hash(access, password, vanityName, unsharedAt); + return Objects.hash(access, password, vanityName, unsharedAt, oneTimePasscode); } @Override @@ -131,6 +144,10 @@ public String toString() { + "unsharedAt='" + unsharedAt + '\'' + + ", " + + "oneTimePasscode='" + + oneTimePasscode + + '\'' + "}"; } @@ -144,6 +161,8 @@ public static class Builder extends NullableFieldTracker { protected OffsetDateTime unsharedAt; + protected SharedLinkOtpWritable oneTimePasscode; + public Builder access(UpdateWebLinkByIdRequestBodySharedLinkAccessField access) { this.access = new EnumWrapper(access); return this; @@ -170,6 +189,26 @@ public Builder unsharedAt(OffsetDateTime unsharedAt) { return this; } + public Builder oneTimePasscode(SharedLinkOtpWritableNone oneTimePasscode) { + this.oneTimePasscode = new SharedLinkOtpWritable(oneTimePasscode); + return this; + } + + public Builder oneTimePasscode(SharedLinkOtpWritableOpen oneTimePasscode) { + this.oneTimePasscode = new SharedLinkOtpWritable(oneTimePasscode); + return this; + } + + public Builder oneTimePasscode(SharedLinkOtpWritableAllowlist oneTimePasscode) { + this.oneTimePasscode = new SharedLinkOtpWritable(oneTimePasscode); + return this; + } + + public Builder oneTimePasscode(SharedLinkOtpWritable oneTimePasscode) { + this.oneTimePasscode = oneTimePasscode; + return this; + } + public UpdateWebLinkByIdRequestBodySharedLinkField build() { return new UpdateWebLinkByIdRequestBodySharedLinkField(this); } diff --git a/src/main/java/com/box/sdkgen/schemas/file/FileSharedLinkField.java b/src/main/java/com/box/sdkgen/schemas/file/FileSharedLinkField.java index 2ec833a4a..fa6a25781 100644 --- a/src/main/java/com/box/sdkgen/schemas/file/FileSharedLinkField.java +++ b/src/main/java/com/box/sdkgen/schemas/file/FileSharedLinkField.java @@ -121,13 +121,17 @@ public class FileSharedLinkField extends SerializableObject { @JsonProperty("preview_count") protected final long previewCount; + @JsonProperty("one_time_passcode") + protected final FileSharedLinkOneTimePasscodeField oneTimePasscode; + public FileSharedLinkField( String url, FileSharedLinkEffectiveAccessField effectiveAccess, FileSharedLinkEffectivePermissionField effectivePermission, boolean isPasswordEnabled, long downloadCount, - long previewCount) { + long previewCount, + FileSharedLinkOneTimePasscodeField oneTimePasscode) { super(); this.url = url; this.effectiveAccess = new EnumWrapper(effectiveAccess); @@ -136,6 +140,7 @@ public FileSharedLinkField( this.isPasswordEnabled = isPasswordEnabled; this.downloadCount = downloadCount; this.previewCount = previewCount; + this.oneTimePasscode = oneTimePasscode; } public FileSharedLinkField( @@ -144,7 +149,8 @@ public FileSharedLinkField( EnumWrapper effectivePermission, boolean isPasswordEnabled, long downloadCount, - long previewCount) { + long previewCount, + FileSharedLinkOneTimePasscodeField oneTimePasscode) { super(); this.url = url; this.effectiveAccess = new EnumWrapper(effectiveAccess); @@ -152,6 +158,7 @@ public FileSharedLinkField( this.isPasswordEnabled = isPasswordEnabled; this.downloadCount = downloadCount; this.previewCount = previewCount; + this.oneTimePasscode = oneTimePasscode; } public FileSharedLinkField( @@ -160,7 +167,8 @@ public FileSharedLinkField( FileSharedLinkEffectivePermissionField effectivePermission, boolean isPasswordEnabled, long downloadCount, - long previewCount) { + long previewCount, + FileSharedLinkOneTimePasscodeField oneTimePasscode) { super(); this.url = url; this.effectiveAccess = effectiveAccess; @@ -169,6 +177,7 @@ public FileSharedLinkField( this.isPasswordEnabled = isPasswordEnabled; this.downloadCount = downloadCount; this.previewCount = previewCount; + this.oneTimePasscode = oneTimePasscode; } public FileSharedLinkField( @@ -179,7 +188,8 @@ public FileSharedLinkField( EnumWrapper effectivePermission, @JsonProperty("is_password_enabled") boolean isPasswordEnabled, @JsonProperty("download_count") long downloadCount, - @JsonProperty("preview_count") long previewCount) { + @JsonProperty("preview_count") long previewCount, + @JsonProperty("one_time_passcode") FileSharedLinkOneTimePasscodeField oneTimePasscode) { super(); this.url = url; this.effectiveAccess = effectiveAccess; @@ -187,6 +197,7 @@ public FileSharedLinkField( this.isPasswordEnabled = isPasswordEnabled; this.downloadCount = downloadCount; this.previewCount = previewCount; + this.oneTimePasscode = oneTimePasscode; } protected FileSharedLinkField(Builder builder) { @@ -203,6 +214,7 @@ protected FileSharedLinkField(Builder builder) { this.permissions = builder.permissions; this.downloadCount = builder.downloadCount; this.previewCount = builder.previewCount; + this.oneTimePasscode = builder.oneTimePasscode; markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); } @@ -254,6 +266,10 @@ public long getPreviewCount() { return previewCount; } + public FileSharedLinkOneTimePasscodeField getOneTimePasscode() { + return oneTimePasscode; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -274,7 +290,8 @@ public boolean equals(Object o) { && Objects.equals(isPasswordEnabled, casted.isPasswordEnabled) && Objects.equals(permissions, casted.permissions) && Objects.equals(downloadCount, casted.downloadCount) - && Objects.equals(previewCount, casted.previewCount); + && Objects.equals(previewCount, casted.previewCount) + && Objects.equals(oneTimePasscode, casted.oneTimePasscode); } @Override @@ -291,7 +308,8 @@ public int hashCode() { isPasswordEnabled, permissions, downloadCount, - previewCount); + previewCount, + oneTimePasscode); } @Override @@ -344,6 +362,10 @@ public String toString() { + "previewCount='" + previewCount + '\'' + + ", " + + "oneTimePasscode='" + + oneTimePasscode + + '\'' + "}"; } @@ -373,13 +395,16 @@ public static class Builder extends NullableFieldTracker { protected final long previewCount; + protected final FileSharedLinkOneTimePasscodeField oneTimePasscode; + public Builder( String url, FileSharedLinkEffectiveAccessField effectiveAccess, FileSharedLinkEffectivePermissionField effectivePermission, boolean isPasswordEnabled, long downloadCount, - long previewCount) { + long previewCount, + FileSharedLinkOneTimePasscodeField oneTimePasscode) { super(); this.url = url; this.effectiveAccess = new EnumWrapper(effectiveAccess); @@ -388,6 +413,7 @@ public Builder( this.isPasswordEnabled = isPasswordEnabled; this.downloadCount = downloadCount; this.previewCount = previewCount; + this.oneTimePasscode = oneTimePasscode; } public Builder( @@ -396,7 +422,8 @@ public Builder( EnumWrapper effectivePermission, boolean isPasswordEnabled, long downloadCount, - long previewCount) { + long previewCount, + FileSharedLinkOneTimePasscodeField oneTimePasscode) { super(); this.url = url; this.effectiveAccess = new EnumWrapper(effectiveAccess); @@ -404,6 +431,7 @@ public Builder( this.isPasswordEnabled = isPasswordEnabled; this.downloadCount = downloadCount; this.previewCount = previewCount; + this.oneTimePasscode = oneTimePasscode; } public Builder( @@ -412,7 +440,8 @@ public Builder( FileSharedLinkEffectivePermissionField effectivePermission, boolean isPasswordEnabled, long downloadCount, - long previewCount) { + long previewCount, + FileSharedLinkOneTimePasscodeField oneTimePasscode) { super(); this.url = url; this.effectiveAccess = effectiveAccess; @@ -421,6 +450,7 @@ public Builder( this.isPasswordEnabled = isPasswordEnabled; this.downloadCount = downloadCount; this.previewCount = previewCount; + this.oneTimePasscode = oneTimePasscode; } public Builder( @@ -429,7 +459,8 @@ public Builder( EnumWrapper effectivePermission, boolean isPasswordEnabled, long downloadCount, - long previewCount) { + long previewCount, + FileSharedLinkOneTimePasscodeField oneTimePasscode) { super(); this.url = url; this.effectiveAccess = effectiveAccess; @@ -437,6 +468,7 @@ public Builder( this.isPasswordEnabled = isPasswordEnabled; this.downloadCount = downloadCount; this.previewCount = previewCount; + this.oneTimePasscode = oneTimePasscode; } public Builder downloadUrl(String downloadUrl) { diff --git a/src/main/java/com/box/sdkgen/schemas/file/FileSharedLinkOneTimePasscodeField.java b/src/main/java/com/box/sdkgen/schemas/file/FileSharedLinkOneTimePasscodeField.java new file mode 100644 index 000000000..fc2a28b29 --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/file/FileSharedLinkOneTimePasscodeField.java @@ -0,0 +1,110 @@ +package com.box.sdkgen.schemas.file; + +import com.box.sdkgen.internal.NullableFieldTracker; +import com.box.sdkgen.internal.SerializableObject; +import com.box.sdkgen.schemas.sharedlinkotpallowlistentry.SharedLinkOtpAllowlistEntry; +import com.fasterxml.jackson.annotation.JsonFilter; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Objects; + +@JsonFilter("nullablePropertyFilter") +public class FileSharedLinkOneTimePasscodeField extends SerializableObject { + + /** + * The current OTP enforcement mode for the shared link. + * + *

* `none` - OTP enforcement is turned off. The shared link is accessible without any + * one-time-passcode verification. * `open` - Any anonymous recipient can request a + * one-time-passcode to any email address and access the shared link after verifying it. + * Collaborators and registered Box users access the link without being prompted. * `allowlist` - + * Anonymous recipients can request a one-time-passcode only when they enter an email that matches + * an entry on the `allowlist`. + */ + protected final String mode; + + /** + * The list of email and domain entries that are permitted to access the shared link when `mode` + * is `allowlist`. Anonymous users whose email matches an entry can request and verify a + * one-time-passcode. + * + *

Because the entries carry recipient email addresses and the identity of the user who added + * them, this field is only returned to users with owner, co-owner, or editor access on the item. + * For viewer collaborators and below the field is omitted. + * + *

An allowlist contains at most 1000 entries, matching the limit enforced when setting the + * allowlist on a shared link. + */ + protected List allowlist; + + public FileSharedLinkOneTimePasscodeField(@JsonProperty("mode") String mode) { + super(); + this.mode = mode; + } + + protected FileSharedLinkOneTimePasscodeField(Builder builder) { + super(); + this.mode = builder.mode; + this.allowlist = builder.allowlist; + markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); + } + + public String getMode() { + return mode; + } + + public List getAllowlist() { + return allowlist; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FileSharedLinkOneTimePasscodeField casted = (FileSharedLinkOneTimePasscodeField) o; + return Objects.equals(mode, casted.mode) && Objects.equals(allowlist, casted.allowlist); + } + + @Override + public int hashCode() { + return Objects.hash(mode, allowlist); + } + + @Override + public String toString() { + return "FileSharedLinkOneTimePasscodeField{" + + "mode='" + + mode + + '\'' + + ", " + + "allowlist='" + + allowlist + + '\'' + + "}"; + } + + public static class Builder extends NullableFieldTracker { + + protected final String mode; + + protected List allowlist; + + public Builder(String mode) { + super(); + this.mode = mode; + } + + public Builder allowlist(List allowlist) { + this.allowlist = allowlist; + return this; + } + + public FileSharedLinkOneTimePasscodeField build() { + return new FileSharedLinkOneTimePasscodeField(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/schemas/folder/FolderSharedLinkField.java b/src/main/java/com/box/sdkgen/schemas/folder/FolderSharedLinkField.java index a75c27421..4557eb90e 100644 --- a/src/main/java/com/box/sdkgen/schemas/folder/FolderSharedLinkField.java +++ b/src/main/java/com/box/sdkgen/schemas/folder/FolderSharedLinkField.java @@ -124,13 +124,17 @@ public class FolderSharedLinkField extends SerializableObject { @JsonProperty("preview_count") protected final long previewCount; + @JsonProperty("one_time_passcode") + protected final FolderSharedLinkOneTimePasscodeField oneTimePasscode; + public FolderSharedLinkField( String url, FolderSharedLinkEffectiveAccessField effectiveAccess, FolderSharedLinkEffectivePermissionField effectivePermission, boolean isPasswordEnabled, long downloadCount, - long previewCount) { + long previewCount, + FolderSharedLinkOneTimePasscodeField oneTimePasscode) { super(); this.url = url; this.effectiveAccess = new EnumWrapper(effectiveAccess); @@ -139,6 +143,7 @@ public FolderSharedLinkField( this.isPasswordEnabled = isPasswordEnabled; this.downloadCount = downloadCount; this.previewCount = previewCount; + this.oneTimePasscode = oneTimePasscode; } public FolderSharedLinkField( @@ -147,7 +152,8 @@ public FolderSharedLinkField( EnumWrapper effectivePermission, boolean isPasswordEnabled, long downloadCount, - long previewCount) { + long previewCount, + FolderSharedLinkOneTimePasscodeField oneTimePasscode) { super(); this.url = url; this.effectiveAccess = new EnumWrapper(effectiveAccess); @@ -155,6 +161,7 @@ public FolderSharedLinkField( this.isPasswordEnabled = isPasswordEnabled; this.downloadCount = downloadCount; this.previewCount = previewCount; + this.oneTimePasscode = oneTimePasscode; } public FolderSharedLinkField( @@ -163,7 +170,8 @@ public FolderSharedLinkField( FolderSharedLinkEffectivePermissionField effectivePermission, boolean isPasswordEnabled, long downloadCount, - long previewCount) { + long previewCount, + FolderSharedLinkOneTimePasscodeField oneTimePasscode) { super(); this.url = url; this.effectiveAccess = effectiveAccess; @@ -172,6 +180,7 @@ public FolderSharedLinkField( this.isPasswordEnabled = isPasswordEnabled; this.downloadCount = downloadCount; this.previewCount = previewCount; + this.oneTimePasscode = oneTimePasscode; } public FolderSharedLinkField( @@ -182,7 +191,8 @@ public FolderSharedLinkField( EnumWrapper effectivePermission, @JsonProperty("is_password_enabled") boolean isPasswordEnabled, @JsonProperty("download_count") long downloadCount, - @JsonProperty("preview_count") long previewCount) { + @JsonProperty("preview_count") long previewCount, + @JsonProperty("one_time_passcode") FolderSharedLinkOneTimePasscodeField oneTimePasscode) { super(); this.url = url; this.effectiveAccess = effectiveAccess; @@ -190,6 +200,7 @@ public FolderSharedLinkField( this.isPasswordEnabled = isPasswordEnabled; this.downloadCount = downloadCount; this.previewCount = previewCount; + this.oneTimePasscode = oneTimePasscode; } protected FolderSharedLinkField(Builder builder) { @@ -206,6 +217,7 @@ protected FolderSharedLinkField(Builder builder) { this.permissions = builder.permissions; this.downloadCount = builder.downloadCount; this.previewCount = builder.previewCount; + this.oneTimePasscode = builder.oneTimePasscode; markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); } @@ -257,6 +269,10 @@ public long getPreviewCount() { return previewCount; } + public FolderSharedLinkOneTimePasscodeField getOneTimePasscode() { + return oneTimePasscode; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -277,7 +293,8 @@ public boolean equals(Object o) { && Objects.equals(isPasswordEnabled, casted.isPasswordEnabled) && Objects.equals(permissions, casted.permissions) && Objects.equals(downloadCount, casted.downloadCount) - && Objects.equals(previewCount, casted.previewCount); + && Objects.equals(previewCount, casted.previewCount) + && Objects.equals(oneTimePasscode, casted.oneTimePasscode); } @Override @@ -294,7 +311,8 @@ public int hashCode() { isPasswordEnabled, permissions, downloadCount, - previewCount); + previewCount, + oneTimePasscode); } @Override @@ -347,6 +365,10 @@ public String toString() { + "previewCount='" + previewCount + '\'' + + ", " + + "oneTimePasscode='" + + oneTimePasscode + + '\'' + "}"; } @@ -376,13 +398,16 @@ public static class Builder extends NullableFieldTracker { protected final long previewCount; + protected final FolderSharedLinkOneTimePasscodeField oneTimePasscode; + public Builder( String url, FolderSharedLinkEffectiveAccessField effectiveAccess, FolderSharedLinkEffectivePermissionField effectivePermission, boolean isPasswordEnabled, long downloadCount, - long previewCount) { + long previewCount, + FolderSharedLinkOneTimePasscodeField oneTimePasscode) { super(); this.url = url; this.effectiveAccess = new EnumWrapper(effectiveAccess); @@ -391,6 +416,7 @@ public Builder( this.isPasswordEnabled = isPasswordEnabled; this.downloadCount = downloadCount; this.previewCount = previewCount; + this.oneTimePasscode = oneTimePasscode; } public Builder( @@ -399,7 +425,8 @@ public Builder( EnumWrapper effectivePermission, boolean isPasswordEnabled, long downloadCount, - long previewCount) { + long previewCount, + FolderSharedLinkOneTimePasscodeField oneTimePasscode) { super(); this.url = url; this.effectiveAccess = new EnumWrapper(effectiveAccess); @@ -407,6 +434,7 @@ public Builder( this.isPasswordEnabled = isPasswordEnabled; this.downloadCount = downloadCount; this.previewCount = previewCount; + this.oneTimePasscode = oneTimePasscode; } public Builder( @@ -415,7 +443,8 @@ public Builder( FolderSharedLinkEffectivePermissionField effectivePermission, boolean isPasswordEnabled, long downloadCount, - long previewCount) { + long previewCount, + FolderSharedLinkOneTimePasscodeField oneTimePasscode) { super(); this.url = url; this.effectiveAccess = effectiveAccess; @@ -424,6 +453,7 @@ public Builder( this.isPasswordEnabled = isPasswordEnabled; this.downloadCount = downloadCount; this.previewCount = previewCount; + this.oneTimePasscode = oneTimePasscode; } public Builder( @@ -432,7 +462,8 @@ public Builder( EnumWrapper effectivePermission, boolean isPasswordEnabled, long downloadCount, - long previewCount) { + long previewCount, + FolderSharedLinkOneTimePasscodeField oneTimePasscode) { super(); this.url = url; this.effectiveAccess = effectiveAccess; @@ -440,6 +471,7 @@ public Builder( this.isPasswordEnabled = isPasswordEnabled; this.downloadCount = downloadCount; this.previewCount = previewCount; + this.oneTimePasscode = oneTimePasscode; } public Builder downloadUrl(String downloadUrl) { diff --git a/src/main/java/com/box/sdkgen/schemas/folder/FolderSharedLinkOneTimePasscodeField.java b/src/main/java/com/box/sdkgen/schemas/folder/FolderSharedLinkOneTimePasscodeField.java new file mode 100644 index 000000000..5dc063fd6 --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/folder/FolderSharedLinkOneTimePasscodeField.java @@ -0,0 +1,110 @@ +package com.box.sdkgen.schemas.folder; + +import com.box.sdkgen.internal.NullableFieldTracker; +import com.box.sdkgen.internal.SerializableObject; +import com.box.sdkgen.schemas.sharedlinkotpallowlistentry.SharedLinkOtpAllowlistEntry; +import com.fasterxml.jackson.annotation.JsonFilter; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Objects; + +@JsonFilter("nullablePropertyFilter") +public class FolderSharedLinkOneTimePasscodeField extends SerializableObject { + + /** + * The current OTP enforcement mode for the shared link. + * + *

* `none` - OTP enforcement is turned off. The shared link is accessible without any + * one-time-passcode verification. * `open` - Any anonymous recipient can request a + * one-time-passcode to any email address and access the shared link after verifying it. + * Collaborators and registered Box users access the link without being prompted. * `allowlist` - + * Anonymous recipients can request a one-time-passcode only when they enter an email that matches + * an entry on the `allowlist`. + */ + protected final String mode; + + /** + * The list of email and domain entries that are permitted to access the shared link when `mode` + * is `allowlist`. Anonymous users whose email matches an entry can request and verify a + * one-time-passcode. + * + *

Because the entries carry recipient email addresses and the identity of the user who added + * them, this field is only returned to users with owner, co-owner, or editor access on the item. + * For viewer collaborators and below the field is omitted. + * + *

An allowlist contains at most 1000 entries, matching the limit enforced when setting the + * allowlist on a shared link. + */ + protected List allowlist; + + public FolderSharedLinkOneTimePasscodeField(@JsonProperty("mode") String mode) { + super(); + this.mode = mode; + } + + protected FolderSharedLinkOneTimePasscodeField(Builder builder) { + super(); + this.mode = builder.mode; + this.allowlist = builder.allowlist; + markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); + } + + public String getMode() { + return mode; + } + + public List getAllowlist() { + return allowlist; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FolderSharedLinkOneTimePasscodeField casted = (FolderSharedLinkOneTimePasscodeField) o; + return Objects.equals(mode, casted.mode) && Objects.equals(allowlist, casted.allowlist); + } + + @Override + public int hashCode() { + return Objects.hash(mode, allowlist); + } + + @Override + public String toString() { + return "FolderSharedLinkOneTimePasscodeField{" + + "mode='" + + mode + + '\'' + + ", " + + "allowlist='" + + allowlist + + '\'' + + "}"; + } + + public static class Builder extends NullableFieldTracker { + + protected final String mode; + + protected List allowlist; + + public Builder(String mode) { + super(); + this.mode = mode; + } + + public Builder allowlist(List allowlist) { + this.allowlist = allowlist; + return this; + } + + public FolderSharedLinkOneTimePasscodeField build() { + return new FolderSharedLinkOneTimePasscodeField(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/schemas/keywordskillcard/KeywordSkillCard.java b/src/main/java/com/box/sdkgen/schemas/keywordskillcard/KeywordSkillCard.java index 42236acb4..d743a6fa2 100644 --- a/src/main/java/com/box/sdkgen/schemas/keywordskillcard/KeywordSkillCard.java +++ b/src/main/java/com/box/sdkgen/schemas/keywordskillcard/KeywordSkillCard.java @@ -48,7 +48,7 @@ public class KeywordSkillCard extends SerializableObject { */ protected final KeywordSkillCardInvocationField invocation; - /** An list of entries in the metadata card. */ + /** A list of entries in the metadata card. */ protected final List entries; public KeywordSkillCard( diff --git a/src/main/java/com/box/sdkgen/schemas/sharedlinkotpallowlistentry/SharedLinkOtpAllowlistEntry.java b/src/main/java/com/box/sdkgen/schemas/sharedlinkotpallowlistentry/SharedLinkOtpAllowlistEntry.java new file mode 100644 index 000000000..61b49fcdc --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/sharedlinkotpallowlistentry/SharedLinkOtpAllowlistEntry.java @@ -0,0 +1,133 @@ +package com.box.sdkgen.schemas.sharedlinkotpallowlistentry; + +import com.box.sdkgen.internal.SerializableObject; +import com.box.sdkgen.internal.utils.DateTimeUtils; +import com.box.sdkgen.schemas.userbase.UserBase; +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.time.OffsetDateTime; +import java.util.Objects; + +/** + * An entry on the OTP allowlist for a shared link. The entry can match either a specific email + * address or every email address that belongs to a domain. + */ +@JsonFilter("nullablePropertyFilter") +public class SharedLinkOtpAllowlistEntry extends SerializableObject { + + /** + * The kind of allowlist entry. + * + *

* `email` - The entry matches a single email address. * `domain` - The entry matches every + * email address under the given domain. + */ + @JsonDeserialize( + using = + SharedLinkOtpAllowlistEntryTypeField.SharedLinkOtpAllowlistEntryTypeFieldDeserializer + .class) + @JsonSerialize( + using = + SharedLinkOtpAllowlistEntryTypeField.SharedLinkOtpAllowlistEntryTypeFieldSerializer.class) + protected final EnumWrapper type; + + /** + * The value of the allowlist entry. + * + *

* For `email` entries, the full email address (must contain `@`). * For `domain` + * entries, the bare domain (e.g. `example.com`). + */ + protected final String value; + + /** The date and time when the allowlist entry was added. */ + @JsonProperty("created_at") + @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class) + @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class) + protected final OffsetDateTime createdAt; + + @JsonProperty("created_by") + protected final UserBase createdBy; + + public SharedLinkOtpAllowlistEntry( + SharedLinkOtpAllowlistEntryTypeField type, + String value, + OffsetDateTime createdAt, + UserBase createdBy) { + super(); + this.type = new EnumWrapper(type); + this.value = value; + this.createdAt = createdAt; + this.createdBy = createdBy; + } + + public SharedLinkOtpAllowlistEntry( + @JsonProperty("type") EnumWrapper type, + @JsonProperty("value") String value, + @JsonProperty("created_at") OffsetDateTime createdAt, + @JsonProperty("created_by") UserBase createdBy) { + super(); + this.type = type; + this.value = value; + this.createdAt = createdAt; + this.createdBy = createdBy; + } + + public EnumWrapper getType() { + return type; + } + + public String getValue() { + return value; + } + + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public UserBase getCreatedBy() { + return createdBy; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SharedLinkOtpAllowlistEntry casted = (SharedLinkOtpAllowlistEntry) o; + return Objects.equals(type, casted.type) + && Objects.equals(value, casted.value) + && Objects.equals(createdAt, casted.createdAt) + && Objects.equals(createdBy, casted.createdBy); + } + + @Override + public int hashCode() { + return Objects.hash(type, value, createdAt, createdBy); + } + + @Override + public String toString() { + return "SharedLinkOtpAllowlistEntry{" + + "type='" + + type + + '\'' + + ", " + + "value='" + + value + + '\'' + + ", " + + "createdAt='" + + createdAt + + '\'' + + ", " + + "createdBy='" + + createdBy + + '\'' + + "}"; + } +} diff --git a/src/main/java/com/box/sdkgen/schemas/sharedlinkotpallowlistentry/SharedLinkOtpAllowlistEntryTypeField.java b/src/main/java/com/box/sdkgen/schemas/sharedlinkotpallowlistentry/SharedLinkOtpAllowlistEntryTypeField.java new file mode 100644 index 000000000..6dafe9e47 --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/sharedlinkotpallowlistentry/SharedLinkOtpAllowlistEntryTypeField.java @@ -0,0 +1,65 @@ +package com.box.sdkgen.schemas.sharedlinkotpallowlistentry; + +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 SharedLinkOtpAllowlistEntryTypeField implements Valuable { + EMAIL("email"), + DOMAIN("domain"); + + private final String value; + + SharedLinkOtpAllowlistEntryTypeField(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + public static class SharedLinkOtpAllowlistEntryTypeFieldDeserializer + extends JsonDeserializer> { + + public SharedLinkOtpAllowlistEntryTypeFieldDeserializer() { + super(); + } + + @Override + public EnumWrapper deserialize( + JsonParser p, DeserializationContext ctxt) throws IOException { + String value = p.getValueAsString(); + return Arrays.stream(SharedLinkOtpAllowlistEntryTypeField.values()) + .filter((v) -> v.getValue().equalsIgnoreCase(value)) + .findFirst() + .map(EnumWrapper::new) + .orElse(new EnumWrapper(value)); + } + } + + public static class SharedLinkOtpAllowlistEntryTypeFieldSerializer + extends JsonSerializer> { + + public SharedLinkOtpAllowlistEntryTypeFieldSerializer() { + 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/sharedlinkotpallowlistentrywritable/SharedLinkOtpAllowlistEntryWritable.java b/src/main/java/com/box/sdkgen/schemas/sharedlinkotpallowlistentrywritable/SharedLinkOtpAllowlistEntryWritable.java new file mode 100644 index 000000000..3897ba1d8 --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/sharedlinkotpallowlistentrywritable/SharedLinkOtpAllowlistEntryWritable.java @@ -0,0 +1,94 @@ +package com.box.sdkgen.schemas.sharedlinkotpallowlistentrywritable; + +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; + +/** + * An entry used to write the OTP allowlist for a shared link. The entry can match either a specific + * email address or every email address that belongs to a domain. + */ +@JsonFilter("nullablePropertyFilter") +public class SharedLinkOtpAllowlistEntryWritable extends SerializableObject { + + /** + * The kind of allowlist entry. + * + *

* `email` - The entry matches a single email address. * `domain` - The entry matches every + * email address under the given domain. + */ + @JsonDeserialize( + using = + SharedLinkOtpAllowlistEntryWritableTypeField + .SharedLinkOtpAllowlistEntryWritableTypeFieldDeserializer.class) + @JsonSerialize( + using = + SharedLinkOtpAllowlistEntryWritableTypeField + .SharedLinkOtpAllowlistEntryWritableTypeFieldSerializer.class) + protected final EnumWrapper type; + + /** + * The value of the allowlist entry. + * + *

* For `email` entries, the full email address (must contain `@`). * For `domain` + * entries, the bare domain (e.g. `example.com`). + */ + protected final String value; + + public SharedLinkOtpAllowlistEntryWritable( + SharedLinkOtpAllowlistEntryWritableTypeField type, String value) { + super(); + this.type = new EnumWrapper(type); + this.value = value; + } + + public SharedLinkOtpAllowlistEntryWritable( + @JsonProperty("type") EnumWrapper type, + @JsonProperty("value") String value) { + super(); + this.type = type; + this.value = value; + } + + public EnumWrapper getType() { + return type; + } + + public String getValue() { + return value; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SharedLinkOtpAllowlistEntryWritable casted = (SharedLinkOtpAllowlistEntryWritable) o; + return Objects.equals(type, casted.type) && Objects.equals(value, casted.value); + } + + @Override + public int hashCode() { + return Objects.hash(type, value); + } + + @Override + public String toString() { + return "SharedLinkOtpAllowlistEntryWritable{" + + "type='" + + type + + '\'' + + ", " + + "value='" + + value + + '\'' + + "}"; + } +} diff --git a/src/main/java/com/box/sdkgen/schemas/sharedlinkotpallowlistentrywritable/SharedLinkOtpAllowlistEntryWritableTypeField.java b/src/main/java/com/box/sdkgen/schemas/sharedlinkotpallowlistentrywritable/SharedLinkOtpAllowlistEntryWritableTypeField.java new file mode 100644 index 000000000..b32749d8a --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/sharedlinkotpallowlistentrywritable/SharedLinkOtpAllowlistEntryWritableTypeField.java @@ -0,0 +1,65 @@ +package com.box.sdkgen.schemas.sharedlinkotpallowlistentrywritable; + +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 SharedLinkOtpAllowlistEntryWritableTypeField implements Valuable { + EMAIL("email"), + DOMAIN("domain"); + + private final String value; + + SharedLinkOtpAllowlistEntryWritableTypeField(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + public static class SharedLinkOtpAllowlistEntryWritableTypeFieldDeserializer + extends JsonDeserializer> { + + public SharedLinkOtpAllowlistEntryWritableTypeFieldDeserializer() { + super(); + } + + @Override + public EnumWrapper deserialize( + JsonParser p, DeserializationContext ctxt) throws IOException { + String value = p.getValueAsString(); + return Arrays.stream(SharedLinkOtpAllowlistEntryWritableTypeField.values()) + .filter((v) -> v.getValue().equalsIgnoreCase(value)) + .findFirst() + .map(EnumWrapper::new) + .orElse(new EnumWrapper(value)); + } + } + + public static class SharedLinkOtpAllowlistEntryWritableTypeFieldSerializer + extends JsonSerializer> { + + public SharedLinkOtpAllowlistEntryWritableTypeFieldSerializer() { + 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/sharedlinkotpwritable/SharedLinkOtpWritable.java b/src/main/java/com/box/sdkgen/schemas/sharedlinkotpwritable/SharedLinkOtpWritable.java new file mode 100644 index 000000000..0b8045e03 --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/sharedlinkotpwritable/SharedLinkOtpWritable.java @@ -0,0 +1,97 @@ +package com.box.sdkgen.schemas.sharedlinkotpwritable; + +import com.box.sdkgen.internal.OneOfThree; +import com.box.sdkgen.schemas.sharedlinkotpwritableallowlist.SharedLinkOtpWritableAllowlist; +import com.box.sdkgen.schemas.sharedlinkotpwritablenone.SharedLinkOtpWritableNone; +import com.box.sdkgen.schemas.sharedlinkotpwritableopen.SharedLinkOtpWritableOpen; +import com.box.sdkgen.serialization.json.EnumWrapper; +import com.box.sdkgen.serialization.json.JsonManager; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import java.io.IOException; + +@JsonDeserialize(using = SharedLinkOtpWritable.SharedLinkOtpWritableDeserializer.class) +@JsonSerialize(using = OneOfThree.OneOfThreeSerializer.class) +public class SharedLinkOtpWritable + extends OneOfThree< + SharedLinkOtpWritableNone, SharedLinkOtpWritableOpen, SharedLinkOtpWritableAllowlist> { + + protected final String mode; + + public SharedLinkOtpWritable(SharedLinkOtpWritableNone sharedLinkOtpWritableNone) { + super(sharedLinkOtpWritableNone, null, null); + this.mode = EnumWrapper.convertToString(sharedLinkOtpWritableNone.getMode()); + } + + public SharedLinkOtpWritable(SharedLinkOtpWritableOpen sharedLinkOtpWritableOpen) { + super(null, sharedLinkOtpWritableOpen, null); + this.mode = EnumWrapper.convertToString(sharedLinkOtpWritableOpen.getMode()); + } + + public SharedLinkOtpWritable(SharedLinkOtpWritableAllowlist sharedLinkOtpWritableAllowlist) { + super(null, null, sharedLinkOtpWritableAllowlist); + this.mode = EnumWrapper.convertToString(sharedLinkOtpWritableAllowlist.getMode()); + } + + public boolean isSharedLinkOtpWritableNone() { + return value0 != null; + } + + public SharedLinkOtpWritableNone getSharedLinkOtpWritableNone() { + return value0; + } + + public boolean isSharedLinkOtpWritableOpen() { + return value1 != null; + } + + public SharedLinkOtpWritableOpen getSharedLinkOtpWritableOpen() { + return value1; + } + + public boolean isSharedLinkOtpWritableAllowlist() { + return value2 != null; + } + + public SharedLinkOtpWritableAllowlist getSharedLinkOtpWritableAllowlist() { + return value2; + } + + public String getMode() { + return mode; + } + + static class SharedLinkOtpWritableDeserializer extends JsonDeserializer { + + public SharedLinkOtpWritableDeserializer() { + super(); + } + + @Override + public SharedLinkOtpWritable deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException { + JsonNode node = JsonManager.jsonToSerializedData(jp); + try { + return new SharedLinkOtpWritable( + OneOfThree.OBJECT_MAPPER.convertValue(node, SharedLinkOtpWritableNone.class)); + } catch (Exception ignored) { + } + try { + return new SharedLinkOtpWritable( + OneOfThree.OBJECT_MAPPER.convertValue(node, SharedLinkOtpWritableOpen.class)); + } catch (Exception ignored) { + } + try { + return new SharedLinkOtpWritable( + OneOfThree.OBJECT_MAPPER.convertValue(node, SharedLinkOtpWritableAllowlist.class)); + } catch (Exception ignored) { + } + throw new JsonMappingException(jp, "Unable to deserialize SharedLinkOtpWritable"); + } + } +} diff --git a/src/main/java/com/box/sdkgen/schemas/sharedlinkotpwritableallowlist/SharedLinkOtpWritableAllowlist.java b/src/main/java/com/box/sdkgen/schemas/sharedlinkotpwritableallowlist/SharedLinkOtpWritableAllowlist.java new file mode 100644 index 000000000..47a071396 --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/sharedlinkotpwritableallowlist/SharedLinkOtpWritableAllowlist.java @@ -0,0 +1,126 @@ +package com.box.sdkgen.schemas.sharedlinkotpwritableallowlist; + +import com.box.sdkgen.internal.NullableFieldTracker; +import com.box.sdkgen.internal.SerializableObject; +import com.box.sdkgen.schemas.sharedlinkotpallowlistentrywritable.SharedLinkOtpAllowlistEntryWritable; +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.List; +import java.util.Objects; + +/** + * Anonymous recipients can request a one-time-passcode only when they enter an email that matches + * an entry on the `allowlist`. + */ +@JsonFilter("nullablePropertyFilter") +public class SharedLinkOtpWritableAllowlist extends SerializableObject { + + /** Set to `allowlist` to restrict OTP requests to emails matching an entry on the `allowlist`. */ + @JsonDeserialize( + using = + SharedLinkOtpWritableAllowlistModeField + .SharedLinkOtpWritableAllowlistModeFieldDeserializer.class) + @JsonSerialize( + using = + SharedLinkOtpWritableAllowlistModeField.SharedLinkOtpWritableAllowlistModeFieldSerializer + .class) + protected EnumWrapper mode; + + /** + * The list of email and domain entries that are permitted to access the shared link when `mode` + * is `allowlist`. Anonymous users whose email matches an entry can request and verify a + * one-time-passcode. + * + *

Providing this field replaces the entire existing allowlist; passing an empty array clears + * all entries. Required when `mode` is `allowlist`. + */ + protected final List allowlist; + + public SharedLinkOtpWritableAllowlist( + @JsonProperty("allowlist") List allowlist) { + super(); + this.allowlist = allowlist; + this.mode = + new EnumWrapper( + SharedLinkOtpWritableAllowlistModeField.ALLOWLIST); + } + + protected SharedLinkOtpWritableAllowlist(Builder builder) { + super(); + this.mode = builder.mode; + this.allowlist = builder.allowlist; + markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); + } + + public EnumWrapper getMode() { + return mode; + } + + public List getAllowlist() { + return allowlist; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SharedLinkOtpWritableAllowlist casted = (SharedLinkOtpWritableAllowlist) o; + return Objects.equals(mode, casted.mode) && Objects.equals(allowlist, casted.allowlist); + } + + @Override + public int hashCode() { + return Objects.hash(mode, allowlist); + } + + @Override + public String toString() { + return "SharedLinkOtpWritableAllowlist{" + + "mode='" + + mode + + '\'' + + ", " + + "allowlist='" + + allowlist + + '\'' + + "}"; + } + + public static class Builder extends NullableFieldTracker { + + protected EnumWrapper mode; + + protected final List allowlist; + + public Builder(List allowlist) { + super(); + this.allowlist = allowlist; + } + + public Builder mode(SharedLinkOtpWritableAllowlistModeField mode) { + this.mode = new EnumWrapper(mode); + return this; + } + + public Builder mode(EnumWrapper mode) { + this.mode = mode; + return this; + } + + public SharedLinkOtpWritableAllowlist build() { + if (this.mode == null) { + this.mode = + new EnumWrapper( + SharedLinkOtpWritableAllowlistModeField.ALLOWLIST); + } + return new SharedLinkOtpWritableAllowlist(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/schemas/sharedlinkotpwritableallowlist/SharedLinkOtpWritableAllowlistModeField.java b/src/main/java/com/box/sdkgen/schemas/sharedlinkotpwritableallowlist/SharedLinkOtpWritableAllowlistModeField.java new file mode 100644 index 000000000..c6ab7fd46 --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/sharedlinkotpwritableallowlist/SharedLinkOtpWritableAllowlistModeField.java @@ -0,0 +1,64 @@ +package com.box.sdkgen.schemas.sharedlinkotpwritableallowlist; + +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 SharedLinkOtpWritableAllowlistModeField implements Valuable { + ALLOWLIST("allowlist"); + + private final String value; + + SharedLinkOtpWritableAllowlistModeField(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + public static class SharedLinkOtpWritableAllowlistModeFieldDeserializer + extends JsonDeserializer> { + + public SharedLinkOtpWritableAllowlistModeFieldDeserializer() { + super(); + } + + @Override + public EnumWrapper deserialize( + JsonParser p, DeserializationContext ctxt) throws IOException { + String value = p.getValueAsString(); + return Arrays.stream(SharedLinkOtpWritableAllowlistModeField.values()) + .filter((v) -> v.getValue().equalsIgnoreCase(value)) + .findFirst() + .map(EnumWrapper::new) + .orElse(new EnumWrapper(value)); + } + } + + public static class SharedLinkOtpWritableAllowlistModeFieldSerializer + extends JsonSerializer> { + + public SharedLinkOtpWritableAllowlistModeFieldSerializer() { + 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/sharedlinkotpwritablenone/SharedLinkOtpWritableNone.java b/src/main/java/com/box/sdkgen/schemas/sharedlinkotpwritablenone/SharedLinkOtpWritableNone.java new file mode 100644 index 000000000..116aedc01 --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/sharedlinkotpwritablenone/SharedLinkOtpWritableNone.java @@ -0,0 +1,92 @@ +package com.box.sdkgen.schemas.sharedlinkotpwritablenone; + +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.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import java.util.Objects; + +/** + * One-time-passcode (OTP) enforcement is turned off. The shared link is accessible without any + * one-time-passcode verification. + */ +@JsonFilter("nullablePropertyFilter") +public class SharedLinkOtpWritableNone extends SerializableObject { + + /** Set to `none` to disable OTP enforcement for the shared link. */ + @JsonDeserialize( + using = + SharedLinkOtpWritableNoneModeField.SharedLinkOtpWritableNoneModeFieldDeserializer.class) + @JsonSerialize( + using = SharedLinkOtpWritableNoneModeField.SharedLinkOtpWritableNoneModeFieldSerializer.class) + protected EnumWrapper mode; + + public SharedLinkOtpWritableNone() { + super(); + this.mode = + new EnumWrapper( + SharedLinkOtpWritableNoneModeField.NONE); + } + + protected SharedLinkOtpWritableNone(Builder builder) { + super(); + this.mode = builder.mode; + markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); + } + + public EnumWrapper getMode() { + return mode; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SharedLinkOtpWritableNone casted = (SharedLinkOtpWritableNone) o; + return Objects.equals(mode, casted.mode); + } + + @Override + public int hashCode() { + return Objects.hash(mode); + } + + @Override + public String toString() { + return "SharedLinkOtpWritableNone{" + "mode='" + mode + '\'' + "}"; + } + + public static class Builder extends NullableFieldTracker { + + protected EnumWrapper mode; + + public Builder() { + super(); + } + + public Builder mode(SharedLinkOtpWritableNoneModeField mode) { + this.mode = new EnumWrapper(mode); + return this; + } + + public Builder mode(EnumWrapper mode) { + this.mode = mode; + return this; + } + + public SharedLinkOtpWritableNone build() { + if (this.mode == null) { + this.mode = + new EnumWrapper( + SharedLinkOtpWritableNoneModeField.NONE); + } + return new SharedLinkOtpWritableNone(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/schemas/sharedlinkotpwritablenone/SharedLinkOtpWritableNoneModeField.java b/src/main/java/com/box/sdkgen/schemas/sharedlinkotpwritablenone/SharedLinkOtpWritableNoneModeField.java new file mode 100644 index 000000000..fd7a1bb79 --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/sharedlinkotpwritablenone/SharedLinkOtpWritableNoneModeField.java @@ -0,0 +1,64 @@ +package com.box.sdkgen.schemas.sharedlinkotpwritablenone; + +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 SharedLinkOtpWritableNoneModeField implements Valuable { + NONE("none"); + + private final String value; + + SharedLinkOtpWritableNoneModeField(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + public static class SharedLinkOtpWritableNoneModeFieldDeserializer + extends JsonDeserializer> { + + public SharedLinkOtpWritableNoneModeFieldDeserializer() { + super(); + } + + @Override + public EnumWrapper deserialize( + JsonParser p, DeserializationContext ctxt) throws IOException { + String value = p.getValueAsString(); + return Arrays.stream(SharedLinkOtpWritableNoneModeField.values()) + .filter((v) -> v.getValue().equalsIgnoreCase(value)) + .findFirst() + .map(EnumWrapper::new) + .orElse(new EnumWrapper(value)); + } + } + + public static class SharedLinkOtpWritableNoneModeFieldSerializer + extends JsonSerializer> { + + public SharedLinkOtpWritableNoneModeFieldSerializer() { + 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/sharedlinkotpwritableopen/SharedLinkOtpWritableOpen.java b/src/main/java/com/box/sdkgen/schemas/sharedlinkotpwritableopen/SharedLinkOtpWritableOpen.java new file mode 100644 index 000000000..b44909883 --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/sharedlinkotpwritableopen/SharedLinkOtpWritableOpen.java @@ -0,0 +1,96 @@ +package com.box.sdkgen.schemas.sharedlinkotpwritableopen; + +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.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import java.util.Objects; + +/** + * Any anonymous recipient can request a one-time-passcode to any email address and access the + * shared link after verifying it. Collaborators and registered Box users access the link without + * being prompted. + */ +@JsonFilter("nullablePropertyFilter") +public class SharedLinkOtpWritableOpen extends SerializableObject { + + /** + * Set to `open` to allow any anonymous recipient to request a one-time-passcode to any email + * address. + */ + @JsonDeserialize( + using = + SharedLinkOtpWritableOpenModeField.SharedLinkOtpWritableOpenModeFieldDeserializer.class) + @JsonSerialize( + using = SharedLinkOtpWritableOpenModeField.SharedLinkOtpWritableOpenModeFieldSerializer.class) + protected EnumWrapper mode; + + public SharedLinkOtpWritableOpen() { + super(); + this.mode = + new EnumWrapper( + SharedLinkOtpWritableOpenModeField.OPEN); + } + + protected SharedLinkOtpWritableOpen(Builder builder) { + super(); + this.mode = builder.mode; + markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); + } + + public EnumWrapper getMode() { + return mode; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SharedLinkOtpWritableOpen casted = (SharedLinkOtpWritableOpen) o; + return Objects.equals(mode, casted.mode); + } + + @Override + public int hashCode() { + return Objects.hash(mode); + } + + @Override + public String toString() { + return "SharedLinkOtpWritableOpen{" + "mode='" + mode + '\'' + "}"; + } + + public static class Builder extends NullableFieldTracker { + + protected EnumWrapper mode; + + public Builder() { + super(); + } + + public Builder mode(SharedLinkOtpWritableOpenModeField mode) { + this.mode = new EnumWrapper(mode); + return this; + } + + public Builder mode(EnumWrapper mode) { + this.mode = mode; + return this; + } + + public SharedLinkOtpWritableOpen build() { + if (this.mode == null) { + this.mode = + new EnumWrapper( + SharedLinkOtpWritableOpenModeField.OPEN); + } + return new SharedLinkOtpWritableOpen(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/schemas/sharedlinkotpwritableopen/SharedLinkOtpWritableOpenModeField.java b/src/main/java/com/box/sdkgen/schemas/sharedlinkotpwritableopen/SharedLinkOtpWritableOpenModeField.java new file mode 100644 index 000000000..99b6414ba --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/sharedlinkotpwritableopen/SharedLinkOtpWritableOpenModeField.java @@ -0,0 +1,64 @@ +package com.box.sdkgen.schemas.sharedlinkotpwritableopen; + +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 SharedLinkOtpWritableOpenModeField implements Valuable { + OPEN("open"); + + private final String value; + + SharedLinkOtpWritableOpenModeField(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + public static class SharedLinkOtpWritableOpenModeFieldDeserializer + extends JsonDeserializer> { + + public SharedLinkOtpWritableOpenModeFieldDeserializer() { + super(); + } + + @Override + public EnumWrapper deserialize( + JsonParser p, DeserializationContext ctxt) throws IOException { + String value = p.getValueAsString(); + return Arrays.stream(SharedLinkOtpWritableOpenModeField.values()) + .filter((v) -> v.getValue().equalsIgnoreCase(value)) + .findFirst() + .map(EnumWrapper::new) + .orElse(new EnumWrapper(value)); + } + } + + public static class SharedLinkOtpWritableOpenModeFieldSerializer + extends JsonSerializer> { + + public SharedLinkOtpWritableOpenModeFieldSerializer() { + 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/transcriptskillcard/TranscriptSkillCard.java b/src/main/java/com/box/sdkgen/schemas/transcriptskillcard/TranscriptSkillCard.java index e248ab8af..e6dd4748c 100644 --- a/src/main/java/com/box/sdkgen/schemas/transcriptskillcard/TranscriptSkillCard.java +++ b/src/main/java/com/box/sdkgen/schemas/transcriptskillcard/TranscriptSkillCard.java @@ -60,7 +60,7 @@ public class TranscriptSkillCard extends SerializableObject { protected Long duration; /** - * An list of entries for the card. This represents the individual entries of the transcription. + * A list of entries for the card. This represents the individual entries of the transcription. */ protected final List entries; diff --git a/src/main/java/com/box/sdkgen/schemas/uploadsession/UploadSession.java b/src/main/java/com/box/sdkgen/schemas/uploadsession/UploadSession.java index 9276f593f..3849139d1 100644 --- a/src/main/java/com/box/sdkgen/schemas/uploadsession/UploadSession.java +++ b/src/main/java/com/box/sdkgen/schemas/uploadsession/UploadSession.java @@ -30,7 +30,7 @@ public class UploadSession extends SerializableObject { protected OffsetDateTime sessionExpiresAt; /** - * The size in bytes that must be used for all parts of of the upload. + * The size in bytes that must be used for all parts of the upload. * *

Only the last part is allowed to be of a smaller size. */ @@ -47,8 +47,8 @@ public class UploadSession extends SerializableObject { /** * The number of parts that have been uploaded and processed by the server. This starts at `0`. * - *

When committing a file files, inspecting this property can provide insight if all parts have - * been uploaded correctly. + *

When committing a file, inspecting this property can provide insight if all parts have been + * uploaded correctly. */ @JsonProperty("num_parts_processed") protected Integer numPartsProcessed; diff --git a/src/main/java/com/box/sdkgen/schemas/v2026r0/documentfailuresv2026r0/DocumentFailuresV2026R0.java b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentfailuresv2026r0/DocumentFailuresV2026R0.java new file mode 100644 index 000000000..b5ea21640 --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentfailuresv2026r0/DocumentFailuresV2026R0.java @@ -0,0 +1,64 @@ +package com.box.sdkgen.schemas.v2026r0.documentfailuresv2026r0; + +import com.box.sdkgen.internal.SerializableObject; +import com.fasterxml.jackson.annotation.JsonFilter; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Objects; + +/** Errors and warnings that occurred during a document job. */ +@JsonFilter("nullablePropertyFilter") +public class DocumentFailuresV2026R0 extends SerializableObject { + + /** A list of errors that occurred during the document job. */ + protected final List errors; + + /** A list of warnings that occurred during the document job. */ + protected final List warnings; + + public DocumentFailuresV2026R0( + @JsonProperty("errors") List errors, + @JsonProperty("warnings") List warnings) { + super(); + this.errors = errors; + this.warnings = warnings; + } + + public List getErrors() { + return errors; + } + + public List getWarnings() { + return warnings; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DocumentFailuresV2026R0 casted = (DocumentFailuresV2026R0) o; + return Objects.equals(errors, casted.errors) && Objects.equals(warnings, casted.warnings); + } + + @Override + public int hashCode() { + return Objects.hash(errors, warnings); + } + + @Override + public String toString() { + return "DocumentFailuresV2026R0{" + + "errors='" + + errors + + '\'' + + ", " + + "warnings='" + + warnings + + '\'' + + "}"; + } +} diff --git a/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitcreaterequestmanualv2026r0/DocumentSplitCreateRequestManualV2026R0.java b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitcreaterequestmanualv2026r0/DocumentSplitCreateRequestManualV2026R0.java new file mode 100644 index 000000000..b2f0e7467 --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitcreaterequestmanualv2026r0/DocumentSplitCreateRequestManualV2026R0.java @@ -0,0 +1,161 @@ +package com.box.sdkgen.schemas.v2026r0.documentsplitcreaterequestmanualv2026r0; + +import com.box.sdkgen.internal.NullableFieldTracker; +import com.box.sdkgen.internal.SerializableObject; +import com.box.sdkgen.schemas.v2026r0.documentsplitpagerangev2026r0.DocumentSplitPageRangeV2026R0; +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.List; +import java.util.Objects; + +/** Validation rules for creating a Document Split job using caller-supplied page ranges. */ +@JsonFilter("nullablePropertyFilter") +public class DocumentSplitCreateRequestManualV2026R0 extends SerializableObject { + + /** Discriminator. Must be `manual` for this variant. */ + @JsonDeserialize( + using = + DocumentSplitCreateRequestManualV2026R0SplitTypeField + .DocumentSplitCreateRequestManualV2026R0SplitTypeFieldDeserializer.class) + @JsonSerialize( + using = + DocumentSplitCreateRequestManualV2026R0SplitTypeField + .DocumentSplitCreateRequestManualV2026R0SplitTypeFieldSerializer.class) + @JsonProperty("split_type") + protected EnumWrapper splitType; + + /** + * The version of the manual split input format. Omitted or `v_1` is the legacy `split_definition` + * format. Existing clients may omit this field. + */ + @JsonDeserialize( + using = + DocumentSplitCreateRequestManualV2026R0VersionField + .DocumentSplitCreateRequestManualV2026R0VersionFieldDeserializer.class) + @JsonSerialize( + using = + DocumentSplitCreateRequestManualV2026R0VersionField + .DocumentSplitCreateRequestManualV2026R0VersionFieldSerializer.class) + protected EnumWrapper version; + + /** + * Page ranges that define the split. Each entry produces one output file containing the inclusive + * page range `[start, end]`. + */ + @JsonProperty("split_definition") + protected final List splitDefinition; + + public DocumentSplitCreateRequestManualV2026R0( + @JsonProperty("split_definition") List splitDefinition) { + super(); + this.splitDefinition = splitDefinition; + this.splitType = + new EnumWrapper( + DocumentSplitCreateRequestManualV2026R0SplitTypeField.MANUAL); + } + + protected DocumentSplitCreateRequestManualV2026R0(Builder builder) { + super(); + this.splitType = builder.splitType; + this.version = builder.version; + this.splitDefinition = builder.splitDefinition; + markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); + } + + public EnumWrapper getSplitType() { + return splitType; + } + + public EnumWrapper getVersion() { + return version; + } + + public List getSplitDefinition() { + return splitDefinition; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DocumentSplitCreateRequestManualV2026R0 casted = (DocumentSplitCreateRequestManualV2026R0) o; + return Objects.equals(splitType, casted.splitType) + && Objects.equals(version, casted.version) + && Objects.equals(splitDefinition, casted.splitDefinition); + } + + @Override + public int hashCode() { + return Objects.hash(splitType, version, splitDefinition); + } + + @Override + public String toString() { + return "DocumentSplitCreateRequestManualV2026R0{" + + "splitType='" + + splitType + + '\'' + + ", " + + "version='" + + version + + '\'' + + ", " + + "splitDefinition='" + + splitDefinition + + '\'' + + "}"; + } + + public static class Builder extends NullableFieldTracker { + + protected EnumWrapper splitType; + + protected EnumWrapper version; + + protected final List splitDefinition; + + public Builder(List splitDefinition) { + super(); + this.splitDefinition = splitDefinition; + } + + public Builder splitType(DocumentSplitCreateRequestManualV2026R0SplitTypeField splitType) { + this.splitType = + new EnumWrapper(splitType); + return this; + } + + public Builder splitType( + EnumWrapper splitType) { + this.splitType = splitType; + return this; + } + + public Builder version(DocumentSplitCreateRequestManualV2026R0VersionField version) { + this.version = new EnumWrapper(version); + return this; + } + + public Builder version( + EnumWrapper version) { + this.version = version; + return this; + } + + public DocumentSplitCreateRequestManualV2026R0 build() { + if (this.splitType == null) { + this.splitType = + new EnumWrapper( + DocumentSplitCreateRequestManualV2026R0SplitTypeField.MANUAL); + } + return new DocumentSplitCreateRequestManualV2026R0(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitcreaterequestmanualv2026r0/DocumentSplitCreateRequestManualV2026R0SplitTypeField.java b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitcreaterequestmanualv2026r0/DocumentSplitCreateRequestManualV2026R0SplitTypeField.java new file mode 100644 index 000000000..9e583b56a --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitcreaterequestmanualv2026r0/DocumentSplitCreateRequestManualV2026R0SplitTypeField.java @@ -0,0 +1,64 @@ +package com.box.sdkgen.schemas.v2026r0.documentsplitcreaterequestmanualv2026r0; + +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 DocumentSplitCreateRequestManualV2026R0SplitTypeField implements Valuable { + MANUAL("manual"); + + private final String value; + + DocumentSplitCreateRequestManualV2026R0SplitTypeField(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + public static class DocumentSplitCreateRequestManualV2026R0SplitTypeFieldDeserializer + extends JsonDeserializer> { + + public DocumentSplitCreateRequestManualV2026R0SplitTypeFieldDeserializer() { + super(); + } + + @Override + public EnumWrapper deserialize( + JsonParser p, DeserializationContext ctxt) throws IOException { + String value = p.getValueAsString(); + return Arrays.stream(DocumentSplitCreateRequestManualV2026R0SplitTypeField.values()) + .filter((v) -> v.getValue().equalsIgnoreCase(value)) + .findFirst() + .map(EnumWrapper::new) + .orElse(new EnumWrapper(value)); + } + } + + public static class DocumentSplitCreateRequestManualV2026R0SplitTypeFieldSerializer + extends JsonSerializer> { + + public DocumentSplitCreateRequestManualV2026R0SplitTypeFieldSerializer() { + 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/v2026r0/documentsplitcreaterequestmanualv2026r0/DocumentSplitCreateRequestManualV2026R0VersionField.java b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitcreaterequestmanualv2026r0/DocumentSplitCreateRequestManualV2026R0VersionField.java new file mode 100644 index 000000000..d3bb125fb --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitcreaterequestmanualv2026r0/DocumentSplitCreateRequestManualV2026R0VersionField.java @@ -0,0 +1,64 @@ +package com.box.sdkgen.schemas.v2026r0.documentsplitcreaterequestmanualv2026r0; + +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 DocumentSplitCreateRequestManualV2026R0VersionField implements Valuable { + V_1("v_1"); + + private final String value; + + DocumentSplitCreateRequestManualV2026R0VersionField(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + public static class DocumentSplitCreateRequestManualV2026R0VersionFieldDeserializer + extends JsonDeserializer> { + + public DocumentSplitCreateRequestManualV2026R0VersionFieldDeserializer() { + super(); + } + + @Override + public EnumWrapper deserialize( + JsonParser p, DeserializationContext ctxt) throws IOException { + String value = p.getValueAsString(); + return Arrays.stream(DocumentSplitCreateRequestManualV2026R0VersionField.values()) + .filter((v) -> v.getValue().equalsIgnoreCase(value)) + .findFirst() + .map(EnumWrapper::new) + .orElse(new EnumWrapper(value)); + } + } + + public static class DocumentSplitCreateRequestManualV2026R0VersionFieldSerializer + extends JsonSerializer> { + + public DocumentSplitCreateRequestManualV2026R0VersionFieldSerializer() { + 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/v2026r0/documentsplitcreaterequestpageselectionv2026r0/DocumentSplitCreateRequestPageSelectionV2026R0.java b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitcreaterequestpageselectionv2026r0/DocumentSplitCreateRequestPageSelectionV2026R0.java new file mode 100644 index 000000000..57a51b98b --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitcreaterequestpageselectionv2026r0/DocumentSplitCreateRequestPageSelectionV2026R0.java @@ -0,0 +1,159 @@ +package com.box.sdkgen.schemas.v2026r0.documentsplitcreaterequestpageselectionv2026r0; + +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.List; +import java.util.Objects; + +/** + * Validation rules for creating a Document Split job using non-linear page selections. Each item + * produces one output file from the declared page segments. + */ +@JsonFilter("nullablePropertyFilter") +public class DocumentSplitCreateRequestPageSelectionV2026R0 extends SerializableObject { + + /** Discriminator. Must be `page_selection` for this variant. */ + @JsonDeserialize( + using = + DocumentSplitCreateRequestPageSelectionV2026R0SplitTypeField + .DocumentSplitCreateRequestPageSelectionV2026R0SplitTypeFieldDeserializer.class) + @JsonSerialize( + using = + DocumentSplitCreateRequestPageSelectionV2026R0SplitTypeField + .DocumentSplitCreateRequestPageSelectionV2026R0SplitTypeFieldSerializer.class) + @JsonProperty("split_type") + protected EnumWrapper splitType; + + /** The version of the page selection input format. Optional. When provided must be `v_2`. */ + @JsonDeserialize( + using = + DocumentSplitCreateRequestPageSelectionV2026R0VersionField + .DocumentSplitCreateRequestPageSelectionV2026R0VersionFieldDeserializer.class) + @JsonSerialize( + using = + DocumentSplitCreateRequestPageSelectionV2026R0VersionField + .DocumentSplitCreateRequestPageSelectionV2026R0VersionFieldSerializer.class) + protected EnumWrapper version; + + @JsonProperty("page_selection") + protected final List pageSelection; + + public DocumentSplitCreateRequestPageSelectionV2026R0( + @JsonProperty("page_selection") List pageSelection) { + super(); + this.pageSelection = pageSelection; + this.splitType = + new EnumWrapper( + DocumentSplitCreateRequestPageSelectionV2026R0SplitTypeField.PAGE_SELECTION); + } + + protected DocumentSplitCreateRequestPageSelectionV2026R0(Builder builder) { + super(); + this.splitType = builder.splitType; + this.version = builder.version; + this.pageSelection = builder.pageSelection; + markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); + } + + public EnumWrapper getSplitType() { + return splitType; + } + + public EnumWrapper getVersion() { + return version; + } + + public List getPageSelection() { + return pageSelection; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DocumentSplitCreateRequestPageSelectionV2026R0 casted = + (DocumentSplitCreateRequestPageSelectionV2026R0) o; + return Objects.equals(splitType, casted.splitType) + && Objects.equals(version, casted.version) + && Objects.equals(pageSelection, casted.pageSelection); + } + + @Override + public int hashCode() { + return Objects.hash(splitType, version, pageSelection); + } + + @Override + public String toString() { + return "DocumentSplitCreateRequestPageSelectionV2026R0{" + + "splitType='" + + splitType + + '\'' + + ", " + + "version='" + + version + + '\'' + + ", " + + "pageSelection='" + + pageSelection + + '\'' + + "}"; + } + + public static class Builder extends NullableFieldTracker { + + protected EnumWrapper splitType; + + protected EnumWrapper version; + + protected final List pageSelection; + + public Builder(List pageSelection) { + super(); + this.pageSelection = pageSelection; + } + + public Builder splitType( + DocumentSplitCreateRequestPageSelectionV2026R0SplitTypeField splitType) { + this.splitType = + new EnumWrapper(splitType); + return this; + } + + public Builder splitType( + EnumWrapper splitType) { + this.splitType = splitType; + return this; + } + + public Builder version(DocumentSplitCreateRequestPageSelectionV2026R0VersionField version) { + this.version = + new EnumWrapper(version); + return this; + } + + public Builder version( + EnumWrapper version) { + this.version = version; + return this; + } + + public DocumentSplitCreateRequestPageSelectionV2026R0 build() { + if (this.splitType == null) { + this.splitType = + new EnumWrapper( + DocumentSplitCreateRequestPageSelectionV2026R0SplitTypeField.PAGE_SELECTION); + } + return new DocumentSplitCreateRequestPageSelectionV2026R0(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitcreaterequestpageselectionv2026r0/DocumentSplitCreateRequestPageSelectionV2026R0SplitTypeField.java b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitcreaterequestpageselectionv2026r0/DocumentSplitCreateRequestPageSelectionV2026R0SplitTypeField.java new file mode 100644 index 000000000..526d597fe --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitcreaterequestpageselectionv2026r0/DocumentSplitCreateRequestPageSelectionV2026R0SplitTypeField.java @@ -0,0 +1,67 @@ +package com.box.sdkgen.schemas.v2026r0.documentsplitcreaterequestpageselectionv2026r0; + +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 DocumentSplitCreateRequestPageSelectionV2026R0SplitTypeField implements Valuable { + PAGE_SELECTION("page_selection"); + + private final String value; + + DocumentSplitCreateRequestPageSelectionV2026R0SplitTypeField(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + public static class DocumentSplitCreateRequestPageSelectionV2026R0SplitTypeFieldDeserializer + extends JsonDeserializer< + EnumWrapper> { + + public DocumentSplitCreateRequestPageSelectionV2026R0SplitTypeFieldDeserializer() { + super(); + } + + @Override + public EnumWrapper deserialize( + JsonParser p, DeserializationContext ctxt) throws IOException { + String value = p.getValueAsString(); + return Arrays.stream(DocumentSplitCreateRequestPageSelectionV2026R0SplitTypeField.values()) + .filter((v) -> v.getValue().equalsIgnoreCase(value)) + .findFirst() + .map(EnumWrapper::new) + .orElse( + new EnumWrapper(value)); + } + } + + public static class DocumentSplitCreateRequestPageSelectionV2026R0SplitTypeFieldSerializer + extends JsonSerializer< + EnumWrapper> { + + public DocumentSplitCreateRequestPageSelectionV2026R0SplitTypeFieldSerializer() { + 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/v2026r0/documentsplitcreaterequestpageselectionv2026r0/DocumentSplitCreateRequestPageSelectionV2026R0VersionField.java b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitcreaterequestpageselectionv2026r0/DocumentSplitCreateRequestPageSelectionV2026R0VersionField.java new file mode 100644 index 000000000..feef61129 --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitcreaterequestpageselectionv2026r0/DocumentSplitCreateRequestPageSelectionV2026R0VersionField.java @@ -0,0 +1,67 @@ +package com.box.sdkgen.schemas.v2026r0.documentsplitcreaterequestpageselectionv2026r0; + +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 DocumentSplitCreateRequestPageSelectionV2026R0VersionField implements Valuable { + V_2("v_2"); + + private final String value; + + DocumentSplitCreateRequestPageSelectionV2026R0VersionField(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + public static class DocumentSplitCreateRequestPageSelectionV2026R0VersionFieldDeserializer + extends JsonDeserializer< + EnumWrapper> { + + public DocumentSplitCreateRequestPageSelectionV2026R0VersionFieldDeserializer() { + super(); + } + + @Override + public EnumWrapper deserialize( + JsonParser p, DeserializationContext ctxt) throws IOException { + String value = p.getValueAsString(); + return Arrays.stream(DocumentSplitCreateRequestPageSelectionV2026R0VersionField.values()) + .filter((v) -> v.getValue().equalsIgnoreCase(value)) + .findFirst() + .map(EnumWrapper::new) + .orElse( + new EnumWrapper(value)); + } + } + + public static class DocumentSplitCreateRequestPageSelectionV2026R0VersionFieldSerializer + extends JsonSerializer< + EnumWrapper> { + + public DocumentSplitCreateRequestPageSelectionV2026R0VersionFieldSerializer() { + 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/v2026r0/documentsplitcreaterequestsmartv2026r0/DocumentSplitCreateRequestSmartV2026R0.java b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitcreaterequestsmartv2026r0/DocumentSplitCreateRequestSmartV2026R0.java new file mode 100644 index 000000000..91e27e4fd --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitcreaterequestsmartv2026r0/DocumentSplitCreateRequestSmartV2026R0.java @@ -0,0 +1,119 @@ +package com.box.sdkgen.schemas.v2026r0.documentsplitcreaterequestsmartv2026r0; + +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; + +/** + * Validation rules for creating a Document Split job using Box-generated page ranges guided by a + * caller-supplied prompt. + */ +@JsonFilter("nullablePropertyFilter") +public class DocumentSplitCreateRequestSmartV2026R0 extends SerializableObject { + + /** Discriminator. Must be `smart` for this variant. */ + @JsonDeserialize( + using = + DocumentSplitCreateRequestSmartV2026R0SplitTypeField + .DocumentSplitCreateRequestSmartV2026R0SplitTypeFieldDeserializer.class) + @JsonSerialize( + using = + DocumentSplitCreateRequestSmartV2026R0SplitTypeField + .DocumentSplitCreateRequestSmartV2026R0SplitTypeFieldSerializer.class) + @JsonProperty("split_type") + protected EnumWrapper splitType; + + /** A natural language prompt that guides automatic page range detection. */ + protected final String prompt; + + public DocumentSplitCreateRequestSmartV2026R0(@JsonProperty("prompt") String prompt) { + super(); + this.prompt = prompt; + this.splitType = + new EnumWrapper( + DocumentSplitCreateRequestSmartV2026R0SplitTypeField.SMART); + } + + protected DocumentSplitCreateRequestSmartV2026R0(Builder builder) { + super(); + this.splitType = builder.splitType; + this.prompt = builder.prompt; + markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); + } + + public EnumWrapper getSplitType() { + return splitType; + } + + public String getPrompt() { + return prompt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DocumentSplitCreateRequestSmartV2026R0 casted = (DocumentSplitCreateRequestSmartV2026R0) o; + return Objects.equals(splitType, casted.splitType) && Objects.equals(prompt, casted.prompt); + } + + @Override + public int hashCode() { + return Objects.hash(splitType, prompt); + } + + @Override + public String toString() { + return "DocumentSplitCreateRequestSmartV2026R0{" + + "splitType='" + + splitType + + '\'' + + ", " + + "prompt='" + + prompt + + '\'' + + "}"; + } + + public static class Builder extends NullableFieldTracker { + + protected EnumWrapper splitType; + + protected final String prompt; + + public Builder(String prompt) { + super(); + this.prompt = prompt; + } + + public Builder splitType(DocumentSplitCreateRequestSmartV2026R0SplitTypeField splitType) { + this.splitType = + new EnumWrapper(splitType); + return this; + } + + public Builder splitType( + EnumWrapper splitType) { + this.splitType = splitType; + return this; + } + + public DocumentSplitCreateRequestSmartV2026R0 build() { + if (this.splitType == null) { + this.splitType = + new EnumWrapper( + DocumentSplitCreateRequestSmartV2026R0SplitTypeField.SMART); + } + return new DocumentSplitCreateRequestSmartV2026R0(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitcreaterequestsmartv2026r0/DocumentSplitCreateRequestSmartV2026R0SplitTypeField.java b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitcreaterequestsmartv2026r0/DocumentSplitCreateRequestSmartV2026R0SplitTypeField.java new file mode 100644 index 000000000..d0f5c7016 --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitcreaterequestsmartv2026r0/DocumentSplitCreateRequestSmartV2026R0SplitTypeField.java @@ -0,0 +1,64 @@ +package com.box.sdkgen.schemas.v2026r0.documentsplitcreaterequestsmartv2026r0; + +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 DocumentSplitCreateRequestSmartV2026R0SplitTypeField implements Valuable { + SMART("smart"); + + private final String value; + + DocumentSplitCreateRequestSmartV2026R0SplitTypeField(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + public static class DocumentSplitCreateRequestSmartV2026R0SplitTypeFieldDeserializer + extends JsonDeserializer> { + + public DocumentSplitCreateRequestSmartV2026R0SplitTypeFieldDeserializer() { + super(); + } + + @Override + public EnumWrapper deserialize( + JsonParser p, DeserializationContext ctxt) throws IOException { + String value = p.getValueAsString(); + return Arrays.stream(DocumentSplitCreateRequestSmartV2026R0SplitTypeField.values()) + .filter((v) -> v.getValue().equalsIgnoreCase(value)) + .findFirst() + .map(EnumWrapper::new) + .orElse(new EnumWrapper(value)); + } + } + + public static class DocumentSplitCreateRequestSmartV2026R0SplitTypeFieldSerializer + extends JsonSerializer> { + + public DocumentSplitCreateRequestSmartV2026R0SplitTypeFieldSerializer() { + 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/v2026r0/documentsplitcreaterequesttypev2026r0/DocumentSplitCreateRequestTypeV2026R0.java b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitcreaterequesttypev2026r0/DocumentSplitCreateRequestTypeV2026R0.java new file mode 100644 index 000000000..4fd6429e7 --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitcreaterequesttypev2026r0/DocumentSplitCreateRequestTypeV2026R0.java @@ -0,0 +1,115 @@ +package com.box.sdkgen.schemas.v2026r0.documentsplitcreaterequesttypev2026r0; + +import com.box.sdkgen.internal.OneOfThree; +import com.box.sdkgen.schemas.v2026r0.documentsplitcreaterequestmanualv2026r0.DocumentSplitCreateRequestManualV2026R0; +import com.box.sdkgen.schemas.v2026r0.documentsplitcreaterequestpageselectionv2026r0.DocumentSplitCreateRequestPageSelectionV2026R0; +import com.box.sdkgen.schemas.v2026r0.documentsplitcreaterequestsmartv2026r0.DocumentSplitCreateRequestSmartV2026R0; +import com.box.sdkgen.serialization.json.EnumWrapper; +import com.box.sdkgen.serialization.json.JsonManager; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import java.io.IOException; + +@JsonDeserialize( + using = + DocumentSplitCreateRequestTypeV2026R0.DocumentSplitCreateRequestTypeV2026R0Deserializer + .class) +@JsonSerialize(using = OneOfThree.OneOfThreeSerializer.class) +public class DocumentSplitCreateRequestTypeV2026R0 + extends OneOfThree< + DocumentSplitCreateRequestManualV2026R0, + DocumentSplitCreateRequestPageSelectionV2026R0, + DocumentSplitCreateRequestSmartV2026R0> { + + protected final String splitType; + + public DocumentSplitCreateRequestTypeV2026R0( + DocumentSplitCreateRequestManualV2026R0 documentSplitCreateRequestManualV2026R0) { + super(documentSplitCreateRequestManualV2026R0, null, null); + this.splitType = + EnumWrapper.convertToString(documentSplitCreateRequestManualV2026R0.getSplitType()); + } + + public DocumentSplitCreateRequestTypeV2026R0( + DocumentSplitCreateRequestPageSelectionV2026R0 + documentSplitCreateRequestPageSelectionV2026R0) { + super(null, documentSplitCreateRequestPageSelectionV2026R0, null); + this.splitType = + EnumWrapper.convertToString(documentSplitCreateRequestPageSelectionV2026R0.getSplitType()); + } + + public DocumentSplitCreateRequestTypeV2026R0( + DocumentSplitCreateRequestSmartV2026R0 documentSplitCreateRequestSmartV2026R0) { + super(null, null, documentSplitCreateRequestSmartV2026R0); + this.splitType = + EnumWrapper.convertToString(documentSplitCreateRequestSmartV2026R0.getSplitType()); + } + + public boolean isDocumentSplitCreateRequestManualV2026R0() { + return value0 != null; + } + + public DocumentSplitCreateRequestManualV2026R0 getDocumentSplitCreateRequestManualV2026R0() { + return value0; + } + + public boolean isDocumentSplitCreateRequestPageSelectionV2026R0() { + return value1 != null; + } + + public DocumentSplitCreateRequestPageSelectionV2026R0 + getDocumentSplitCreateRequestPageSelectionV2026R0() { + return value1; + } + + public boolean isDocumentSplitCreateRequestSmartV2026R0() { + return value2 != null; + } + + public DocumentSplitCreateRequestSmartV2026R0 getDocumentSplitCreateRequestSmartV2026R0() { + return value2; + } + + public String getSplitType() { + return splitType; + } + + static class DocumentSplitCreateRequestTypeV2026R0Deserializer + extends JsonDeserializer { + + public DocumentSplitCreateRequestTypeV2026R0Deserializer() { + super(); + } + + @Override + public DocumentSplitCreateRequestTypeV2026R0 deserialize( + JsonParser jp, DeserializationContext ctxt) throws IOException { + JsonNode node = JsonManager.jsonToSerializedData(jp); + try { + return new DocumentSplitCreateRequestTypeV2026R0( + OneOfThree.OBJECT_MAPPER.convertValue( + node, DocumentSplitCreateRequestManualV2026R0.class)); + } catch (Exception ignored) { + } + try { + return new DocumentSplitCreateRequestTypeV2026R0( + OneOfThree.OBJECT_MAPPER.convertValue( + node, DocumentSplitCreateRequestPageSelectionV2026R0.class)); + } catch (Exception ignored) { + } + try { + return new DocumentSplitCreateRequestTypeV2026R0( + OneOfThree.OBJECT_MAPPER.convertValue( + node, DocumentSplitCreateRequestSmartV2026R0.class)); + } catch (Exception ignored) { + } + throw new JsonMappingException( + jp, "Unable to deserialize DocumentSplitCreateRequestTypeV2026R0"); + } + } +} diff --git a/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitcreaterequestv2026r0/DocumentSplitCreateRequestV2026R0.java b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitcreaterequestv2026r0/DocumentSplitCreateRequestV2026R0.java new file mode 100644 index 000000000..c09e08f86 --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitcreaterequestv2026r0/DocumentSplitCreateRequestV2026R0.java @@ -0,0 +1,352 @@ +package com.box.sdkgen.schemas.v2026r0.documentsplitcreaterequestv2026r0; + +import com.box.sdkgen.internal.NullableFieldTracker; +import com.box.sdkgen.internal.SerializableObject; +import com.box.sdkgen.schemas.v2026r0.documentsplitcreaterequestmanualv2026r0.DocumentSplitCreateRequestManualV2026R0; +import com.box.sdkgen.schemas.v2026r0.documentsplitcreaterequestpageselectionv2026r0.DocumentSplitCreateRequestPageSelectionV2026R0; +import com.box.sdkgen.schemas.v2026r0.documentsplitcreaterequestsmartv2026r0.DocumentSplitCreateRequestSmartV2026R0; +import com.box.sdkgen.schemas.v2026r0.documentsplitcreaterequesttypev2026r0.DocumentSplitCreateRequestTypeV2026R0; +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; + +/** + * The request body for creating a Document Split job. The `split_input` property carries the + * caller-supplied input that determines how the split is performed. + */ +@JsonFilter("nullablePropertyFilter") +public class DocumentSplitCreateRequestV2026R0 extends SerializableObject { + + /** The ID of the source file to split. */ + @JsonProperty("source_file_id") + protected final String sourceFileId; + + /** The ID of the folder where the resulting files will be uploaded. */ + @JsonProperty("destination_folder_id") + protected final String destinationFolderId; + + /** The system that initiated the request, used for analytics and traceability. */ + @JsonDeserialize( + using = + DocumentSplitCreateRequestV2026R0InputSourceField + .DocumentSplitCreateRequestV2026R0InputSourceFieldDeserializer.class) + @JsonSerialize( + using = + DocumentSplitCreateRequestV2026R0InputSourceField + .DocumentSplitCreateRequestV2026R0InputSourceFieldSerializer.class) + @JsonProperty("input_source") + protected final EnumWrapper inputSource; + + @JsonProperty("split_input") + protected final DocumentSplitCreateRequestTypeV2026R0 splitInput; + + /** + * An optional identifier supplied by the caller for this Document Split job. The value is + * returned on job responses for correlation only. It is not a Box resource ID, is not required to + * be unique, and cannot be used to look up the job. + */ + @JsonProperty("external_id") + protected String externalId; + + public DocumentSplitCreateRequestV2026R0( + String sourceFileId, + String destinationFolderId, + DocumentSplitCreateRequestV2026R0InputSourceField inputSource, + DocumentSplitCreateRequestManualV2026R0 splitInput) { + super(); + this.sourceFileId = sourceFileId; + this.destinationFolderId = destinationFolderId; + this.inputSource = + new EnumWrapper(inputSource); + this.splitInput = new DocumentSplitCreateRequestTypeV2026R0(splitInput); + } + + public DocumentSplitCreateRequestV2026R0( + String sourceFileId, + String destinationFolderId, + DocumentSplitCreateRequestV2026R0InputSourceField inputSource, + DocumentSplitCreateRequestPageSelectionV2026R0 splitInput) { + super(); + this.sourceFileId = sourceFileId; + this.destinationFolderId = destinationFolderId; + this.inputSource = + new EnumWrapper(inputSource); + this.splitInput = new DocumentSplitCreateRequestTypeV2026R0(splitInput); + } + + public DocumentSplitCreateRequestV2026R0( + String sourceFileId, + String destinationFolderId, + DocumentSplitCreateRequestV2026R0InputSourceField inputSource, + DocumentSplitCreateRequestSmartV2026R0 splitInput) { + super(); + this.sourceFileId = sourceFileId; + this.destinationFolderId = destinationFolderId; + this.inputSource = + new EnumWrapper(inputSource); + this.splitInput = new DocumentSplitCreateRequestTypeV2026R0(splitInput); + } + + public DocumentSplitCreateRequestV2026R0( + String sourceFileId, + String destinationFolderId, + DocumentSplitCreateRequestV2026R0InputSourceField inputSource, + DocumentSplitCreateRequestTypeV2026R0 splitInput) { + super(); + this.sourceFileId = sourceFileId; + this.destinationFolderId = destinationFolderId; + this.inputSource = + new EnumWrapper(inputSource); + this.splitInput = splitInput; + } + + public DocumentSplitCreateRequestV2026R0( + String sourceFileId, + String destinationFolderId, + EnumWrapper inputSource, + DocumentSplitCreateRequestManualV2026R0 splitInput) { + super(); + this.sourceFileId = sourceFileId; + this.destinationFolderId = destinationFolderId; + this.inputSource = inputSource; + this.splitInput = new DocumentSplitCreateRequestTypeV2026R0(splitInput); + } + + public DocumentSplitCreateRequestV2026R0( + String sourceFileId, + String destinationFolderId, + EnumWrapper inputSource, + DocumentSplitCreateRequestPageSelectionV2026R0 splitInput) { + super(); + this.sourceFileId = sourceFileId; + this.destinationFolderId = destinationFolderId; + this.inputSource = inputSource; + this.splitInput = new DocumentSplitCreateRequestTypeV2026R0(splitInput); + } + + public DocumentSplitCreateRequestV2026R0( + String sourceFileId, + String destinationFolderId, + EnumWrapper inputSource, + DocumentSplitCreateRequestSmartV2026R0 splitInput) { + super(); + this.sourceFileId = sourceFileId; + this.destinationFolderId = destinationFolderId; + this.inputSource = inputSource; + this.splitInput = new DocumentSplitCreateRequestTypeV2026R0(splitInput); + } + + public DocumentSplitCreateRequestV2026R0( + @JsonProperty("source_file_id") String sourceFileId, + @JsonProperty("destination_folder_id") String destinationFolderId, + @JsonProperty("input_source") + EnumWrapper inputSource, + @JsonProperty("split_input") DocumentSplitCreateRequestTypeV2026R0 splitInput) { + super(); + this.sourceFileId = sourceFileId; + this.destinationFolderId = destinationFolderId; + this.inputSource = inputSource; + this.splitInput = splitInput; + } + + protected DocumentSplitCreateRequestV2026R0(Builder builder) { + super(); + this.sourceFileId = builder.sourceFileId; + this.destinationFolderId = builder.destinationFolderId; + this.inputSource = builder.inputSource; + this.splitInput = builder.splitInput; + this.externalId = builder.externalId; + markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); + } + + public String getSourceFileId() { + return sourceFileId; + } + + public String getDestinationFolderId() { + return destinationFolderId; + } + + public EnumWrapper getInputSource() { + return inputSource; + } + + public DocumentSplitCreateRequestTypeV2026R0 getSplitInput() { + return splitInput; + } + + public String getExternalId() { + return externalId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DocumentSplitCreateRequestV2026R0 casted = (DocumentSplitCreateRequestV2026R0) o; + return Objects.equals(sourceFileId, casted.sourceFileId) + && Objects.equals(destinationFolderId, casted.destinationFolderId) + && Objects.equals(inputSource, casted.inputSource) + && Objects.equals(splitInput, casted.splitInput) + && Objects.equals(externalId, casted.externalId); + } + + @Override + public int hashCode() { + return Objects.hash(sourceFileId, destinationFolderId, inputSource, splitInput, externalId); + } + + @Override + public String toString() { + return "DocumentSplitCreateRequestV2026R0{" + + "sourceFileId='" + + sourceFileId + + '\'' + + ", " + + "destinationFolderId='" + + destinationFolderId + + '\'' + + ", " + + "inputSource='" + + inputSource + + '\'' + + ", " + + "splitInput='" + + splitInput + + '\'' + + ", " + + "externalId='" + + externalId + + '\'' + + "}"; + } + + public static class Builder extends NullableFieldTracker { + + protected final String sourceFileId; + + protected final String destinationFolderId; + + protected final EnumWrapper inputSource; + + protected final DocumentSplitCreateRequestTypeV2026R0 splitInput; + + protected String externalId; + + public Builder( + String sourceFileId, + String destinationFolderId, + DocumentSplitCreateRequestV2026R0InputSourceField inputSource, + DocumentSplitCreateRequestManualV2026R0 splitInput) { + super(); + this.sourceFileId = sourceFileId; + this.destinationFolderId = destinationFolderId; + this.inputSource = + new EnumWrapper(inputSource); + this.splitInput = new DocumentSplitCreateRequestTypeV2026R0(splitInput); + } + + public Builder( + String sourceFileId, + String destinationFolderId, + DocumentSplitCreateRequestV2026R0InputSourceField inputSource, + DocumentSplitCreateRequestPageSelectionV2026R0 splitInput) { + super(); + this.sourceFileId = sourceFileId; + this.destinationFolderId = destinationFolderId; + this.inputSource = + new EnumWrapper(inputSource); + this.splitInput = new DocumentSplitCreateRequestTypeV2026R0(splitInput); + } + + public Builder( + String sourceFileId, + String destinationFolderId, + DocumentSplitCreateRequestV2026R0InputSourceField inputSource, + DocumentSplitCreateRequestSmartV2026R0 splitInput) { + super(); + this.sourceFileId = sourceFileId; + this.destinationFolderId = destinationFolderId; + this.inputSource = + new EnumWrapper(inputSource); + this.splitInput = new DocumentSplitCreateRequestTypeV2026R0(splitInput); + } + + public Builder( + String sourceFileId, + String destinationFolderId, + DocumentSplitCreateRequestV2026R0InputSourceField inputSource, + DocumentSplitCreateRequestTypeV2026R0 splitInput) { + super(); + this.sourceFileId = sourceFileId; + this.destinationFolderId = destinationFolderId; + this.inputSource = + new EnumWrapper(inputSource); + this.splitInput = splitInput; + } + + public Builder( + String sourceFileId, + String destinationFolderId, + EnumWrapper inputSource, + DocumentSplitCreateRequestManualV2026R0 splitInput) { + super(); + this.sourceFileId = sourceFileId; + this.destinationFolderId = destinationFolderId; + this.inputSource = inputSource; + this.splitInput = new DocumentSplitCreateRequestTypeV2026R0(splitInput); + } + + public Builder( + String sourceFileId, + String destinationFolderId, + EnumWrapper inputSource, + DocumentSplitCreateRequestPageSelectionV2026R0 splitInput) { + super(); + this.sourceFileId = sourceFileId; + this.destinationFolderId = destinationFolderId; + this.inputSource = inputSource; + this.splitInput = new DocumentSplitCreateRequestTypeV2026R0(splitInput); + } + + public Builder( + String sourceFileId, + String destinationFolderId, + EnumWrapper inputSource, + DocumentSplitCreateRequestSmartV2026R0 splitInput) { + super(); + this.sourceFileId = sourceFileId; + this.destinationFolderId = destinationFolderId; + this.inputSource = inputSource; + this.splitInput = new DocumentSplitCreateRequestTypeV2026R0(splitInput); + } + + public Builder( + String sourceFileId, + String destinationFolderId, + EnumWrapper inputSource, + DocumentSplitCreateRequestTypeV2026R0 splitInput) { + super(); + this.sourceFileId = sourceFileId; + this.destinationFolderId = destinationFolderId; + this.inputSource = inputSource; + this.splitInput = splitInput; + } + + public Builder externalId(String externalId) { + this.externalId = externalId; + return this; + } + + public DocumentSplitCreateRequestV2026R0 build() { + return new DocumentSplitCreateRequestV2026R0(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitcreaterequestv2026r0/DocumentSplitCreateRequestV2026R0InputSourceField.java b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitcreaterequestv2026r0/DocumentSplitCreateRequestV2026R0InputSourceField.java new file mode 100644 index 000000000..08de09fd6 --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitcreaterequestv2026r0/DocumentSplitCreateRequestV2026R0InputSourceField.java @@ -0,0 +1,67 @@ +package com.box.sdkgen.schemas.v2026r0.documentsplitcreaterequestv2026r0; + +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 DocumentSplitCreateRequestV2026R0InputSourceField implements Valuable { + API("api"), + BOX("box"), + RELAY("relay"), + SALESFORCE("salesforce"); + + private final String value; + + DocumentSplitCreateRequestV2026R0InputSourceField(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + public static class DocumentSplitCreateRequestV2026R0InputSourceFieldDeserializer + extends JsonDeserializer> { + + public DocumentSplitCreateRequestV2026R0InputSourceFieldDeserializer() { + super(); + } + + @Override + public EnumWrapper deserialize( + JsonParser p, DeserializationContext ctxt) throws IOException { + String value = p.getValueAsString(); + return Arrays.stream(DocumentSplitCreateRequestV2026R0InputSourceField.values()) + .filter((v) -> v.getValue().equalsIgnoreCase(value)) + .findFirst() + .map(EnumWrapper::new) + .orElse(new EnumWrapper(value)); + } + } + + public static class DocumentSplitCreateRequestV2026R0InputSourceFieldSerializer + extends JsonSerializer> { + + public DocumentSplitCreateRequestV2026R0InputSourceFieldSerializer() { + 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/v2026r0/documentsplitcreateresponsev2026r0/DocumentSplitCreateResponseV2026R0.java b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitcreateresponsev2026r0/DocumentSplitCreateResponseV2026R0.java new file mode 100644 index 000000000..cc4affc37 --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitcreateresponsev2026r0/DocumentSplitCreateResponseV2026R0.java @@ -0,0 +1,116 @@ +package com.box.sdkgen.schemas.v2026r0.documentsplitcreateresponsev2026r0; + +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; + +/** + * A reference to a newly created Document Split job. Returned when a Document Split job is accepted + * for asynchronous processing. Clients can poll the full job representation using this ID. + */ +@JsonFilter("nullablePropertyFilter") +public class DocumentSplitCreateResponseV2026R0 extends SerializableObject { + + /** The value will always be `document_split`. */ + @JsonDeserialize( + using = + DocumentSplitCreateResponseV2026R0TypeField + .DocumentSplitCreateResponseV2026R0TypeFieldDeserializer.class) + @JsonSerialize( + using = + DocumentSplitCreateResponseV2026R0TypeField + .DocumentSplitCreateResponseV2026R0TypeFieldSerializer.class) + protected EnumWrapper type; + + /** The unique identifier of the created Document Split job. */ + protected final String id; + + public DocumentSplitCreateResponseV2026R0(@JsonProperty("id") String id) { + super(); + this.id = id; + this.type = + new EnumWrapper( + DocumentSplitCreateResponseV2026R0TypeField.DOCUMENT_SPLIT); + } + + protected DocumentSplitCreateResponseV2026R0(Builder builder) { + super(); + this.type = builder.type; + this.id = builder.id; + markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); + } + + public EnumWrapper getType() { + return type; + } + + public String getId() { + return id; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DocumentSplitCreateResponseV2026R0 casted = (DocumentSplitCreateResponseV2026R0) o; + return Objects.equals(type, casted.type) && Objects.equals(id, casted.id); + } + + @Override + public int hashCode() { + return Objects.hash(type, id); + } + + @Override + public String toString() { + return "DocumentSplitCreateResponseV2026R0{" + + "type='" + + type + + '\'' + + ", " + + "id='" + + id + + '\'' + + "}"; + } + + public static class Builder extends NullableFieldTracker { + + protected EnumWrapper type; + + protected final String id; + + public Builder(String id) { + super(); + this.id = id; + } + + public Builder type(DocumentSplitCreateResponseV2026R0TypeField type) { + this.type = new EnumWrapper(type); + return this; + } + + public Builder type(EnumWrapper type) { + this.type = type; + return this; + } + + public DocumentSplitCreateResponseV2026R0 build() { + if (this.type == null) { + this.type = + new EnumWrapper( + DocumentSplitCreateResponseV2026R0TypeField.DOCUMENT_SPLIT); + } + return new DocumentSplitCreateResponseV2026R0(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitcreateresponsev2026r0/DocumentSplitCreateResponseV2026R0TypeField.java b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitcreateresponsev2026r0/DocumentSplitCreateResponseV2026R0TypeField.java new file mode 100644 index 000000000..e776439c7 --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitcreateresponsev2026r0/DocumentSplitCreateResponseV2026R0TypeField.java @@ -0,0 +1,64 @@ +package com.box.sdkgen.schemas.v2026r0.documentsplitcreateresponsev2026r0; + +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 DocumentSplitCreateResponseV2026R0TypeField implements Valuable { + DOCUMENT_SPLIT("document_split"); + + private final String value; + + DocumentSplitCreateResponseV2026R0TypeField(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + public static class DocumentSplitCreateResponseV2026R0TypeFieldDeserializer + extends JsonDeserializer> { + + public DocumentSplitCreateResponseV2026R0TypeFieldDeserializer() { + super(); + } + + @Override + public EnumWrapper deserialize( + JsonParser p, DeserializationContext ctxt) throws IOException { + String value = p.getValueAsString(); + return Arrays.stream(DocumentSplitCreateResponseV2026R0TypeField.values()) + .filter((v) -> v.getValue().equalsIgnoreCase(value)) + .findFirst() + .map(EnumWrapper::new) + .orElse(new EnumWrapper(value)); + } + } + + public static class DocumentSplitCreateResponseV2026R0TypeFieldSerializer + extends JsonSerializer> { + + public DocumentSplitCreateResponseV2026R0TypeFieldSerializer() { + 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/v2026r0/documentsplitfailuresv2026r0/DocumentSplitFailuresV2026R0.java b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitfailuresv2026r0/DocumentSplitFailuresV2026R0.java new file mode 100644 index 000000000..583ac2c8d --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitfailuresv2026r0/DocumentSplitFailuresV2026R0.java @@ -0,0 +1,48 @@ +package com.box.sdkgen.schemas.v2026r0.documentsplitfailuresv2026r0; + +import com.box.sdkgen.schemas.v2026r0.documentfailuresv2026r0.DocumentFailuresV2026R0; +import com.fasterxml.jackson.annotation.JsonFilter; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Objects; + +/** Errors and warnings that occurred during a Document Split job. */ +@JsonFilter("nullablePropertyFilter") +public class DocumentSplitFailuresV2026R0 extends DocumentFailuresV2026R0 { + + public DocumentSplitFailuresV2026R0( + @JsonProperty("errors") List errors, + @JsonProperty("warnings") List warnings) { + super(errors, warnings); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DocumentSplitFailuresV2026R0 casted = (DocumentSplitFailuresV2026R0) o; + return Objects.equals(errors, casted.errors) && Objects.equals(warnings, casted.warnings); + } + + @Override + public int hashCode() { + return Objects.hash(errors, warnings); + } + + @Override + public String toString() { + return "DocumentSplitFailuresV2026R0{" + + "errors='" + + errors + + '\'' + + ", " + + "warnings='" + + warnings + + '\'' + + "}"; + } +} diff --git a/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitoutputv2026r0/DocumentSplitOutputV2026R0.java b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitoutputv2026r0/DocumentSplitOutputV2026R0.java new file mode 100644 index 000000000..9c719a508 --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitoutputv2026r0/DocumentSplitOutputV2026R0.java @@ -0,0 +1,103 @@ +package com.box.sdkgen.schemas.v2026r0.documentsplitoutputv2026r0; + +import com.box.sdkgen.internal.Nullable; +import com.box.sdkgen.internal.NullableFieldTracker; +import com.box.sdkgen.internal.SerializableObject; +import com.box.sdkgen.schemas.v2026r0.documentsplitpagerangev2026r0.DocumentSplitPageRangeV2026R0; +import com.box.sdkgen.schemas.v2026r0.filereferencev2026r0.FileReferenceV2026R0; +import com.fasterxml.jackson.annotation.JsonFilter; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Objects; + +/** The set of files produced by a completed Document Split job. */ +@JsonFilter("nullablePropertyFilter") +public class DocumentSplitOutputV2026R0 extends SerializableObject { + + /** References to the files that were created by the split. */ + @JsonProperty("generated_files") + protected List generatedFiles; + + /** + * The page ranges that Box produced for a `smart` split. Each entry corresponds to one generated + * file with the inclusive page range `[start, end]`. Omitted or `null` for `manual` splits, where + * the caller-supplied ranges are available in `split_input.split_definition`. Omitted for + * `page_selection` splits, where the caller-supplied page layout is available in + * `split_input.page_selection`. + */ + @JsonProperty("split_definition") + @Nullable + protected List splitDefinition; + + public DocumentSplitOutputV2026R0() { + super(); + } + + protected DocumentSplitOutputV2026R0(Builder builder) { + super(); + this.generatedFiles = builder.generatedFiles; + this.splitDefinition = builder.splitDefinition; + markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); + } + + public List getGeneratedFiles() { + return generatedFiles; + } + + public List getSplitDefinition() { + return splitDefinition; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DocumentSplitOutputV2026R0 casted = (DocumentSplitOutputV2026R0) o; + return Objects.equals(generatedFiles, casted.generatedFiles) + && Objects.equals(splitDefinition, casted.splitDefinition); + } + + @Override + public int hashCode() { + return Objects.hash(generatedFiles, splitDefinition); + } + + @Override + public String toString() { + return "DocumentSplitOutputV2026R0{" + + "generatedFiles='" + + generatedFiles + + '\'' + + ", " + + "splitDefinition='" + + splitDefinition + + '\'' + + "}"; + } + + public static class Builder extends NullableFieldTracker { + + protected List generatedFiles; + + protected List splitDefinition; + + public Builder generatedFiles(List generatedFiles) { + this.generatedFiles = generatedFiles; + return this; + } + + public Builder splitDefinition(List splitDefinition) { + this.splitDefinition = splitDefinition; + this.markNullableFieldAsSet("split_definition"); + return this; + } + + public DocumentSplitOutputV2026R0 build() { + return new DocumentSplitOutputV2026R0(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitpagerangev2026r0/DocumentSplitPageRangeV2026R0.java b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitpagerangev2026r0/DocumentSplitPageRangeV2026R0.java new file mode 100644 index 000000000..f2771264d --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitpagerangev2026r0/DocumentSplitPageRangeV2026R0.java @@ -0,0 +1,62 @@ +package com.box.sdkgen.schemas.v2026r0.documentsplitpagerangev2026r0; + +import com.box.sdkgen.internal.SerializableObject; +import com.fasterxml.jackson.annotation.JsonFilter; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** An inclusive page range used to define one slice of a manual Document Split job. */ +@JsonFilter("nullablePropertyFilter") +public class DocumentSplitPageRangeV2026R0 extends SerializableObject { + + /** The first page (inclusive) included in this slice. */ + protected final int start; + + /** The last page (inclusive) included in this slice. */ + protected final int end; + + public DocumentSplitPageRangeV2026R0( + @JsonProperty("start") int start, @JsonProperty("end") int end) { + super(); + this.start = start; + this.end = end; + } + + public int getStart() { + return start; + } + + public int getEnd() { + return end; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DocumentSplitPageRangeV2026R0 casted = (DocumentSplitPageRangeV2026R0) o; + return Objects.equals(start, casted.start) && Objects.equals(end, casted.end); + } + + @Override + public int hashCode() { + return Objects.hash(start, end); + } + + @Override + public String toString() { + return "DocumentSplitPageRangeV2026R0{" + + "start='" + + start + + '\'' + + ", " + + "end='" + + end + + '\'' + + "}"; + } +} diff --git a/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitpageselectionitemv2026r0/DocumentSplitPageSelectionItemV2026R0.java b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitpageselectionitemv2026r0/DocumentSplitPageSelectionItemV2026R0.java new file mode 100644 index 000000000..6bb0015c3 --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitpageselectionitemv2026r0/DocumentSplitPageSelectionItemV2026R0.java @@ -0,0 +1,101 @@ +package com.box.sdkgen.schemas.v2026r0.documentsplitpageselectionitemv2026r0; + +import com.box.sdkgen.internal.NullableFieldTracker; +import com.box.sdkgen.internal.SerializableObject; +import com.box.sdkgen.schemas.v2026r0.documentsplitpageselectionsegmentv2026r0.DocumentSplitPageSelectionSegmentV2026R0; +import com.fasterxml.jackson.annotation.JsonFilter; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Objects; + +/** + * A single output file definition within a page selection request. Each item produces one PDF + * containing the pages specified by its segments array. + */ +@JsonFilter("nullablePropertyFilter") +public class DocumentSplitPageSelectionItemV2026R0 extends SerializableObject { + + /** + * Optional name for the output file (without extension). When omitted the system generates a + * sequential name based on the source file name. + */ + protected String name; + + /** + * An ordered list of page segments to include in this output file. Each segment specifies either + * a single page or a contiguous page range. + */ + protected final List segments; + + public DocumentSplitPageSelectionItemV2026R0( + @JsonProperty("segments") List segments) { + super(); + this.segments = segments; + } + + protected DocumentSplitPageSelectionItemV2026R0(Builder builder) { + super(); + this.name = builder.name; + this.segments = builder.segments; + markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); + } + + public String getName() { + return name; + } + + public List getSegments() { + return segments; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DocumentSplitPageSelectionItemV2026R0 casted = (DocumentSplitPageSelectionItemV2026R0) o; + return Objects.equals(name, casted.name) && Objects.equals(segments, casted.segments); + } + + @Override + public int hashCode() { + return Objects.hash(name, segments); + } + + @Override + public String toString() { + return "DocumentSplitPageSelectionItemV2026R0{" + + "name='" + + name + + '\'' + + ", " + + "segments='" + + segments + + '\'' + + "}"; + } + + public static class Builder extends NullableFieldTracker { + + protected String name; + + protected final List segments; + + public Builder(List segments) { + super(); + this.segments = segments; + } + + public Builder name(String name) { + this.name = name; + return this; + } + + public DocumentSplitPageSelectionItemV2026R0 build() { + return new DocumentSplitPageSelectionItemV2026R0(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitpageselectionpagerangev2026r0/DocumentSplitPageSelectionPageRangeV2026R0.java b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitpageselectionpagerangev2026r0/DocumentSplitPageSelectionPageRangeV2026R0.java new file mode 100644 index 000000000..afdc9fa0e --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitpageselectionpagerangev2026r0/DocumentSplitPageSelectionPageRangeV2026R0.java @@ -0,0 +1,133 @@ +package com.box.sdkgen.schemas.v2026r0.documentsplitpageselectionpagerangev2026r0; + +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; + +/** A page selection segment that includes an inclusive page range from the source document. */ +@JsonFilter("nullablePropertyFilter") +public class DocumentSplitPageSelectionPageRangeV2026R0 extends SerializableObject { + + /** Discriminator. Must be `page_range` for this variant. */ + @JsonDeserialize( + using = + DocumentSplitPageSelectionPageRangeV2026R0TypeField + .DocumentSplitPageSelectionPageRangeV2026R0TypeFieldDeserializer.class) + @JsonSerialize( + using = + DocumentSplitPageSelectionPageRangeV2026R0TypeField + .DocumentSplitPageSelectionPageRangeV2026R0TypeFieldSerializer.class) + protected EnumWrapper type; + + /** The first page (inclusive) included in this segment. */ + protected final int start; + + /** The last page (inclusive) included in this segment. */ + protected final int end; + + public DocumentSplitPageSelectionPageRangeV2026R0( + @JsonProperty("start") int start, @JsonProperty("end") int end) { + super(); + this.start = start; + this.end = end; + this.type = + new EnumWrapper( + DocumentSplitPageSelectionPageRangeV2026R0TypeField.PAGE_RANGE); + } + + protected DocumentSplitPageSelectionPageRangeV2026R0(Builder builder) { + super(); + this.type = builder.type; + this.start = builder.start; + this.end = builder.end; + markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); + } + + public EnumWrapper getType() { + return type; + } + + public int getStart() { + return start; + } + + public int getEnd() { + return end; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DocumentSplitPageSelectionPageRangeV2026R0 casted = + (DocumentSplitPageSelectionPageRangeV2026R0) o; + return Objects.equals(type, casted.type) + && Objects.equals(start, casted.start) + && Objects.equals(end, casted.end); + } + + @Override + public int hashCode() { + return Objects.hash(type, start, end); + } + + @Override + public String toString() { + return "DocumentSplitPageSelectionPageRangeV2026R0{" + + "type='" + + type + + '\'' + + ", " + + "start='" + + start + + '\'' + + ", " + + "end='" + + end + + '\'' + + "}"; + } + + public static class Builder extends NullableFieldTracker { + + protected EnumWrapper type; + + protected final int start; + + protected final int end; + + public Builder(int start, int end) { + super(); + this.start = start; + this.end = end; + } + + public Builder type(DocumentSplitPageSelectionPageRangeV2026R0TypeField type) { + this.type = new EnumWrapper(type); + return this; + } + + public Builder type(EnumWrapper type) { + this.type = type; + return this; + } + + public DocumentSplitPageSelectionPageRangeV2026R0 build() { + if (this.type == null) { + this.type = + new EnumWrapper( + DocumentSplitPageSelectionPageRangeV2026R0TypeField.PAGE_RANGE); + } + return new DocumentSplitPageSelectionPageRangeV2026R0(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitpageselectionpagerangev2026r0/DocumentSplitPageSelectionPageRangeV2026R0TypeField.java b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitpageselectionpagerangev2026r0/DocumentSplitPageSelectionPageRangeV2026R0TypeField.java new file mode 100644 index 000000000..877ed631d --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitpageselectionpagerangev2026r0/DocumentSplitPageSelectionPageRangeV2026R0TypeField.java @@ -0,0 +1,64 @@ +package com.box.sdkgen.schemas.v2026r0.documentsplitpageselectionpagerangev2026r0; + +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 DocumentSplitPageSelectionPageRangeV2026R0TypeField implements Valuable { + PAGE_RANGE("page_range"); + + private final String value; + + DocumentSplitPageSelectionPageRangeV2026R0TypeField(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + public static class DocumentSplitPageSelectionPageRangeV2026R0TypeFieldDeserializer + extends JsonDeserializer> { + + public DocumentSplitPageSelectionPageRangeV2026R0TypeFieldDeserializer() { + super(); + } + + @Override + public EnumWrapper deserialize( + JsonParser p, DeserializationContext ctxt) throws IOException { + String value = p.getValueAsString(); + return Arrays.stream(DocumentSplitPageSelectionPageRangeV2026R0TypeField.values()) + .filter((v) -> v.getValue().equalsIgnoreCase(value)) + .findFirst() + .map(EnumWrapper::new) + .orElse(new EnumWrapper(value)); + } + } + + public static class DocumentSplitPageSelectionPageRangeV2026R0TypeFieldSerializer + extends JsonSerializer> { + + public DocumentSplitPageSelectionPageRangeV2026R0TypeFieldSerializer() { + 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/v2026r0/documentsplitpageselectionsegmentv2026r0/DocumentSplitPageSelectionSegmentV2026R0.java b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitpageselectionsegmentv2026r0/DocumentSplitPageSelectionSegmentV2026R0.java new file mode 100644 index 000000000..bad8ae34a --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitpageselectionsegmentv2026r0/DocumentSplitPageSelectionSegmentV2026R0.java @@ -0,0 +1,88 @@ +package com.box.sdkgen.schemas.v2026r0.documentsplitpageselectionsegmentv2026r0; + +import com.box.sdkgen.internal.OneOfTwo; +import com.box.sdkgen.schemas.v2026r0.documentsplitpageselectionpagerangev2026r0.DocumentSplitPageSelectionPageRangeV2026R0; +import com.box.sdkgen.schemas.v2026r0.documentsplitpageselectionsinglepagev2026r0.DocumentSplitPageSelectionSinglePageV2026R0; +import com.box.sdkgen.serialization.json.EnumWrapper; +import com.box.sdkgen.serialization.json.JsonManager; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import java.io.IOException; + +@JsonDeserialize( + using = + DocumentSplitPageSelectionSegmentV2026R0 + .DocumentSplitPageSelectionSegmentV2026R0Deserializer.class) +@JsonSerialize(using = OneOfTwo.OneOfTwoSerializer.class) +public class DocumentSplitPageSelectionSegmentV2026R0 + extends OneOfTwo< + DocumentSplitPageSelectionSinglePageV2026R0, DocumentSplitPageSelectionPageRangeV2026R0> { + + protected final String type; + + public DocumentSplitPageSelectionSegmentV2026R0( + DocumentSplitPageSelectionSinglePageV2026R0 documentSplitPageSelectionSinglePageV2026R0) { + super(documentSplitPageSelectionSinglePageV2026R0, null); + this.type = EnumWrapper.convertToString(documentSplitPageSelectionSinglePageV2026R0.getType()); + } + + public DocumentSplitPageSelectionSegmentV2026R0( + DocumentSplitPageSelectionPageRangeV2026R0 documentSplitPageSelectionPageRangeV2026R0) { + super(null, documentSplitPageSelectionPageRangeV2026R0); + this.type = EnumWrapper.convertToString(documentSplitPageSelectionPageRangeV2026R0.getType()); + } + + public boolean isDocumentSplitPageSelectionSinglePageV2026R0() { + return value0 != null; + } + + public DocumentSplitPageSelectionSinglePageV2026R0 + getDocumentSplitPageSelectionSinglePageV2026R0() { + return value0; + } + + public boolean isDocumentSplitPageSelectionPageRangeV2026R0() { + return value1 != null; + } + + public DocumentSplitPageSelectionPageRangeV2026R0 + getDocumentSplitPageSelectionPageRangeV2026R0() { + return value1; + } + + public String getType() { + return type; + } + + static class DocumentSplitPageSelectionSegmentV2026R0Deserializer + extends JsonDeserializer { + + public DocumentSplitPageSelectionSegmentV2026R0Deserializer() { + super(); + } + + @Override + public DocumentSplitPageSelectionSegmentV2026R0 deserialize( + JsonParser jp, DeserializationContext ctxt) throws IOException { + JsonNode node = JsonManager.jsonToSerializedData(jp); + JsonNode discriminant0 = node.get("type"); + if (!(discriminant0 == null)) { + switch (discriminant0.asText()) { + case "single_page": + return new DocumentSplitPageSelectionSegmentV2026R0( + JsonManager.deserialize(node, DocumentSplitPageSelectionSinglePageV2026R0.class)); + case "page_range": + return new DocumentSplitPageSelectionSegmentV2026R0( + JsonManager.deserialize(node, DocumentSplitPageSelectionPageRangeV2026R0.class)); + } + } + throw new JsonMappingException( + jp, "Unable to deserialize DocumentSplitPageSelectionSegmentV2026R0"); + } + } +} diff --git a/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitpageselectionsinglepagev2026r0/DocumentSplitPageSelectionSinglePageV2026R0.java b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitpageselectionsinglepagev2026r0/DocumentSplitPageSelectionSinglePageV2026R0.java new file mode 100644 index 000000000..abf13e25c --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitpageselectionsinglepagev2026r0/DocumentSplitPageSelectionSinglePageV2026R0.java @@ -0,0 +1,114 @@ +package com.box.sdkgen.schemas.v2026r0.documentsplitpageselectionsinglepagev2026r0; + +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; + +/** A page selection segment that includes a single page from the source document. */ +@JsonFilter("nullablePropertyFilter") +public class DocumentSplitPageSelectionSinglePageV2026R0 extends SerializableObject { + + /** Discriminator. Must be `single_page` for this variant. */ + @JsonDeserialize( + using = + DocumentSplitPageSelectionSinglePageV2026R0TypeField + .DocumentSplitPageSelectionSinglePageV2026R0TypeFieldDeserializer.class) + @JsonSerialize( + using = + DocumentSplitPageSelectionSinglePageV2026R0TypeField + .DocumentSplitPageSelectionSinglePageV2026R0TypeFieldSerializer.class) + protected EnumWrapper type; + + /** A single page number to include. */ + protected final int page; + + public DocumentSplitPageSelectionSinglePageV2026R0(@JsonProperty("page") int page) { + super(); + this.page = page; + this.type = + new EnumWrapper( + DocumentSplitPageSelectionSinglePageV2026R0TypeField.SINGLE_PAGE); + } + + protected DocumentSplitPageSelectionSinglePageV2026R0(Builder builder) { + super(); + this.type = builder.type; + this.page = builder.page; + markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); + } + + public EnumWrapper getType() { + return type; + } + + public int getPage() { + return page; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DocumentSplitPageSelectionSinglePageV2026R0 casted = + (DocumentSplitPageSelectionSinglePageV2026R0) o; + return Objects.equals(type, casted.type) && Objects.equals(page, casted.page); + } + + @Override + public int hashCode() { + return Objects.hash(type, page); + } + + @Override + public String toString() { + return "DocumentSplitPageSelectionSinglePageV2026R0{" + + "type='" + + type + + '\'' + + ", " + + "page='" + + page + + '\'' + + "}"; + } + + public static class Builder extends NullableFieldTracker { + + protected EnumWrapper type; + + protected final int page; + + public Builder(int page) { + super(); + this.page = page; + } + + public Builder type(DocumentSplitPageSelectionSinglePageV2026R0TypeField type) { + this.type = new EnumWrapper(type); + return this; + } + + public Builder type(EnumWrapper type) { + this.type = type; + return this; + } + + public DocumentSplitPageSelectionSinglePageV2026R0 build() { + if (this.type == null) { + this.type = + new EnumWrapper( + DocumentSplitPageSelectionSinglePageV2026R0TypeField.SINGLE_PAGE); + } + return new DocumentSplitPageSelectionSinglePageV2026R0(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitpageselectionsinglepagev2026r0/DocumentSplitPageSelectionSinglePageV2026R0TypeField.java b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitpageselectionsinglepagev2026r0/DocumentSplitPageSelectionSinglePageV2026R0TypeField.java new file mode 100644 index 000000000..5386e308d --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitpageselectionsinglepagev2026r0/DocumentSplitPageSelectionSinglePageV2026R0TypeField.java @@ -0,0 +1,64 @@ +package com.box.sdkgen.schemas.v2026r0.documentsplitpageselectionsinglepagev2026r0; + +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 DocumentSplitPageSelectionSinglePageV2026R0TypeField implements Valuable { + SINGLE_PAGE("single_page"); + + private final String value; + + DocumentSplitPageSelectionSinglePageV2026R0TypeField(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + public static class DocumentSplitPageSelectionSinglePageV2026R0TypeFieldDeserializer + extends JsonDeserializer> { + + public DocumentSplitPageSelectionSinglePageV2026R0TypeFieldDeserializer() { + super(); + } + + @Override + public EnumWrapper deserialize( + JsonParser p, DeserializationContext ctxt) throws IOException { + String value = p.getValueAsString(); + return Arrays.stream(DocumentSplitPageSelectionSinglePageV2026R0TypeField.values()) + .filter((v) -> v.getValue().equalsIgnoreCase(value)) + .findFirst() + .map(EnumWrapper::new) + .orElse(new EnumWrapper(value)); + } + } + + public static class DocumentSplitPageSelectionSinglePageV2026R0TypeFieldSerializer + extends JsonSerializer> { + + public DocumentSplitPageSelectionSinglePageV2026R0TypeFieldSerializer() { + 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/v2026r0/documentsplitsv2026r0/DocumentSplitsV2026R0.java b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitsv2026r0/DocumentSplitsV2026R0.java new file mode 100644 index 000000000..9e5130938 --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitsv2026r0/DocumentSplitsV2026R0.java @@ -0,0 +1,118 @@ +package com.box.sdkgen.schemas.v2026r0.documentsplitsv2026r0; + +import com.box.sdkgen.internal.Nullable; +import com.box.sdkgen.internal.NullableFieldTracker; +import com.box.sdkgen.internal.SerializableObject; +import com.box.sdkgen.schemas.v2026r0.documentsplitv2026r0.DocumentSplitV2026R0; +import com.fasterxml.jackson.annotation.JsonFilter; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Objects; + +/** A paginated list of Document Split jobs. */ +@JsonFilter("nullablePropertyFilter") +public class DocumentSplitsV2026R0 extends SerializableObject { + + /** A list of Document Split jobs. */ + protected List entries; + + /** + * The limit that was used for these entries. This will be the same as the `limit` query parameter + * unless that value exceeded the maximum value allowed. The maximum value varies by API. + */ + protected Long limit; + + /** The marker for the start of the next page of results. */ + @JsonProperty("next_marker") + @Nullable + protected String nextMarker; + + public DocumentSplitsV2026R0() { + super(); + } + + protected DocumentSplitsV2026R0(Builder builder) { + super(); + this.entries = builder.entries; + this.limit = builder.limit; + this.nextMarker = builder.nextMarker; + markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); + } + + public List getEntries() { + return entries; + } + + public Long getLimit() { + return limit; + } + + public String getNextMarker() { + return nextMarker; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DocumentSplitsV2026R0 casted = (DocumentSplitsV2026R0) o; + return Objects.equals(entries, casted.entries) + && Objects.equals(limit, casted.limit) + && Objects.equals(nextMarker, casted.nextMarker); + } + + @Override + public int hashCode() { + return Objects.hash(entries, limit, nextMarker); + } + + @Override + public String toString() { + return "DocumentSplitsV2026R0{" + + "entries='" + + entries + + '\'' + + ", " + + "limit='" + + limit + + '\'' + + ", " + + "nextMarker='" + + nextMarker + + '\'' + + "}"; + } + + public static class Builder extends NullableFieldTracker { + + protected List entries; + + protected Long limit; + + protected String nextMarker; + + public Builder entries(List entries) { + this.entries = entries; + return this; + } + + public Builder limit(Long limit) { + this.limit = limit; + return this; + } + + public Builder nextMarker(String nextMarker) { + this.nextMarker = nextMarker; + this.markNullableFieldAsSet("next_marker"); + return this; + } + + public DocumentSplitsV2026R0 build() { + return new DocumentSplitsV2026R0(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitv2026r0/DocumentSplitV2026R0.java b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitv2026r0/DocumentSplitV2026R0.java new file mode 100644 index 000000000..3b6db009d --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitv2026r0/DocumentSplitV2026R0.java @@ -0,0 +1,903 @@ +package com.box.sdkgen.schemas.v2026r0.documentsplitv2026r0; + +import com.box.sdkgen.internal.NullableFieldTracker; +import com.box.sdkgen.internal.SerializableObject; +import com.box.sdkgen.internal.utils.DateTimeUtils; +import com.box.sdkgen.schemas.v2026r0.documentsplitcreaterequestmanualv2026r0.DocumentSplitCreateRequestManualV2026R0; +import com.box.sdkgen.schemas.v2026r0.documentsplitcreaterequestpageselectionv2026r0.DocumentSplitCreateRequestPageSelectionV2026R0; +import com.box.sdkgen.schemas.v2026r0.documentsplitcreaterequestsmartv2026r0.DocumentSplitCreateRequestSmartV2026R0; +import com.box.sdkgen.schemas.v2026r0.documentsplitcreaterequesttypev2026r0.DocumentSplitCreateRequestTypeV2026R0; +import com.box.sdkgen.schemas.v2026r0.documentsplitfailuresv2026r0.DocumentSplitFailuresV2026R0; +import com.box.sdkgen.schemas.v2026r0.documentsplitoutputv2026r0.DocumentSplitOutputV2026R0; +import com.box.sdkgen.schemas.v2026r0.enterprisereferencev2026r0.EnterpriseReferenceV2026R0; +import com.box.sdkgen.schemas.v2026r0.filereferencev2026r0.FileReferenceV2026R0; +import com.box.sdkgen.schemas.v2026r0.folderreferencev2026r0.FolderReferenceV2026R0; +import com.box.sdkgen.schemas.v2026r0.userminiv2026r0.UserMiniV2026R0; +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.time.OffsetDateTime; +import java.util.Objects; + +/** + * A standard representation of a Document Split job. The job represents a request to split a + * paginated source document into multiple files based on either a manual set of page ranges, a + * non-linear page selection, or a smart prompt-driven analysis. + */ +@JsonFilter("nullablePropertyFilter") +public class DocumentSplitV2026R0 extends SerializableObject { + + /** The unique identifier for the Document Split job. */ + protected final String id; + + /** The value will always be `document_split`. */ + @JsonDeserialize( + using = DocumentSplitV2026R0TypeField.DocumentSplitV2026R0TypeFieldDeserializer.class) + @JsonSerialize( + using = DocumentSplitV2026R0TypeField.DocumentSplitV2026R0TypeFieldSerializer.class) + protected EnumWrapper type; + + @JsonProperty("source_file") + protected final FileReferenceV2026R0 sourceFile; + + /** The current state of the Document Split job. */ + @JsonDeserialize( + using = DocumentSplitV2026R0StatusField.DocumentSplitV2026R0StatusFieldDeserializer.class) + @JsonSerialize( + using = DocumentSplitV2026R0StatusField.DocumentSplitV2026R0StatusFieldSerializer.class) + protected final EnumWrapper status; + + @JsonProperty("split_input") + protected final DocumentSplitCreateRequestTypeV2026R0 splitInput; + + /** The result of the Document Split job. `null` until the job has produced output. */ + protected DocumentSplitOutputV2026R0 output; + + @JsonProperty("destination_folder") + protected final FolderReferenceV2026R0 destinationFolder; + + /** The system that initiated the request, used for analytics and traceability. */ + @JsonDeserialize( + using = + DocumentSplitV2026R0InputSourceField.DocumentSplitV2026R0InputSourceFieldDeserializer + .class) + @JsonSerialize( + using = + DocumentSplitV2026R0InputSourceField.DocumentSplitV2026R0InputSourceFieldSerializer.class) + @JsonProperty("input_source") + protected final EnumWrapper inputSource; + + /** When the Document Split job was created. */ + @JsonProperty("created_at") + @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class) + @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class) + protected OffsetDateTime createdAt; + + @JsonProperty("created_by") + protected UserMiniV2026R0 createdBy; + + protected EnterpriseReferenceV2026R0 enterprise; + + /** + * Errors and warnings that occurred during the document split. `null` when no failures were + * recorded. + */ + protected DocumentSplitFailuresV2026R0 failures; + + /** + * An optional identifier supplied by the caller when the Document Split job was created. Returned + * for correlation only. It is not a Box resource ID, is not required to be unique, and cannot be + * used to look up the job. + */ + @JsonProperty("external_id") + protected String externalId; + + public DocumentSplitV2026R0( + String id, + FileReferenceV2026R0 sourceFile, + DocumentSplitV2026R0StatusField status, + DocumentSplitCreateRequestManualV2026R0 splitInput, + FolderReferenceV2026R0 destinationFolder, + DocumentSplitV2026R0InputSourceField inputSource) { + super(); + this.id = id; + this.sourceFile = sourceFile; + this.status = new EnumWrapper(status); + this.splitInput = new DocumentSplitCreateRequestTypeV2026R0(splitInput); + this.destinationFolder = destinationFolder; + this.inputSource = new EnumWrapper(inputSource); + this.type = + new EnumWrapper( + DocumentSplitV2026R0TypeField.DOCUMENT_SPLIT); + } + + public DocumentSplitV2026R0( + String id, + FileReferenceV2026R0 sourceFile, + DocumentSplitV2026R0StatusField status, + DocumentSplitCreateRequestManualV2026R0 splitInput, + FolderReferenceV2026R0 destinationFolder, + EnumWrapper inputSource) { + super(); + this.id = id; + this.sourceFile = sourceFile; + this.status = new EnumWrapper(status); + this.splitInput = new DocumentSplitCreateRequestTypeV2026R0(splitInput); + this.destinationFolder = destinationFolder; + this.inputSource = inputSource; + this.type = + new EnumWrapper( + DocumentSplitV2026R0TypeField.DOCUMENT_SPLIT); + } + + public DocumentSplitV2026R0( + String id, + FileReferenceV2026R0 sourceFile, + DocumentSplitV2026R0StatusField status, + DocumentSplitCreateRequestPageSelectionV2026R0 splitInput, + FolderReferenceV2026R0 destinationFolder, + DocumentSplitV2026R0InputSourceField inputSource) { + super(); + this.id = id; + this.sourceFile = sourceFile; + this.status = new EnumWrapper(status); + this.splitInput = new DocumentSplitCreateRequestTypeV2026R0(splitInput); + this.destinationFolder = destinationFolder; + this.inputSource = new EnumWrapper(inputSource); + this.type = + new EnumWrapper( + DocumentSplitV2026R0TypeField.DOCUMENT_SPLIT); + } + + public DocumentSplitV2026R0( + String id, + FileReferenceV2026R0 sourceFile, + DocumentSplitV2026R0StatusField status, + DocumentSplitCreateRequestPageSelectionV2026R0 splitInput, + FolderReferenceV2026R0 destinationFolder, + EnumWrapper inputSource) { + super(); + this.id = id; + this.sourceFile = sourceFile; + this.status = new EnumWrapper(status); + this.splitInput = new DocumentSplitCreateRequestTypeV2026R0(splitInput); + this.destinationFolder = destinationFolder; + this.inputSource = inputSource; + this.type = + new EnumWrapper( + DocumentSplitV2026R0TypeField.DOCUMENT_SPLIT); + } + + public DocumentSplitV2026R0( + String id, + FileReferenceV2026R0 sourceFile, + DocumentSplitV2026R0StatusField status, + DocumentSplitCreateRequestSmartV2026R0 splitInput, + FolderReferenceV2026R0 destinationFolder, + DocumentSplitV2026R0InputSourceField inputSource) { + super(); + this.id = id; + this.sourceFile = sourceFile; + this.status = new EnumWrapper(status); + this.splitInput = new DocumentSplitCreateRequestTypeV2026R0(splitInput); + this.destinationFolder = destinationFolder; + this.inputSource = new EnumWrapper(inputSource); + this.type = + new EnumWrapper( + DocumentSplitV2026R0TypeField.DOCUMENT_SPLIT); + } + + public DocumentSplitV2026R0( + String id, + FileReferenceV2026R0 sourceFile, + DocumentSplitV2026R0StatusField status, + DocumentSplitCreateRequestSmartV2026R0 splitInput, + FolderReferenceV2026R0 destinationFolder, + EnumWrapper inputSource) { + super(); + this.id = id; + this.sourceFile = sourceFile; + this.status = new EnumWrapper(status); + this.splitInput = new DocumentSplitCreateRequestTypeV2026R0(splitInput); + this.destinationFolder = destinationFolder; + this.inputSource = inputSource; + this.type = + new EnumWrapper( + DocumentSplitV2026R0TypeField.DOCUMENT_SPLIT); + } + + public DocumentSplitV2026R0( + String id, + FileReferenceV2026R0 sourceFile, + DocumentSplitV2026R0StatusField status, + DocumentSplitCreateRequestTypeV2026R0 splitInput, + FolderReferenceV2026R0 destinationFolder, + DocumentSplitV2026R0InputSourceField inputSource) { + super(); + this.id = id; + this.sourceFile = sourceFile; + this.status = new EnumWrapper(status); + this.splitInput = splitInput; + this.destinationFolder = destinationFolder; + this.inputSource = new EnumWrapper(inputSource); + this.type = + new EnumWrapper( + DocumentSplitV2026R0TypeField.DOCUMENT_SPLIT); + } + + public DocumentSplitV2026R0( + String id, + FileReferenceV2026R0 sourceFile, + DocumentSplitV2026R0StatusField status, + DocumentSplitCreateRequestTypeV2026R0 splitInput, + FolderReferenceV2026R0 destinationFolder, + EnumWrapper inputSource) { + super(); + this.id = id; + this.sourceFile = sourceFile; + this.status = new EnumWrapper(status); + this.splitInput = splitInput; + this.destinationFolder = destinationFolder; + this.inputSource = inputSource; + this.type = + new EnumWrapper( + DocumentSplitV2026R0TypeField.DOCUMENT_SPLIT); + } + + public DocumentSplitV2026R0( + String id, + FileReferenceV2026R0 sourceFile, + EnumWrapper status, + DocumentSplitCreateRequestManualV2026R0 splitInput, + FolderReferenceV2026R0 destinationFolder, + DocumentSplitV2026R0InputSourceField inputSource) { + super(); + this.id = id; + this.sourceFile = sourceFile; + this.status = status; + this.splitInput = new DocumentSplitCreateRequestTypeV2026R0(splitInput); + this.destinationFolder = destinationFolder; + this.inputSource = new EnumWrapper(inputSource); + this.type = + new EnumWrapper( + DocumentSplitV2026R0TypeField.DOCUMENT_SPLIT); + } + + public DocumentSplitV2026R0( + String id, + FileReferenceV2026R0 sourceFile, + EnumWrapper status, + DocumentSplitCreateRequestManualV2026R0 splitInput, + FolderReferenceV2026R0 destinationFolder, + EnumWrapper inputSource) { + super(); + this.id = id; + this.sourceFile = sourceFile; + this.status = status; + this.splitInput = new DocumentSplitCreateRequestTypeV2026R0(splitInput); + this.destinationFolder = destinationFolder; + this.inputSource = inputSource; + this.type = + new EnumWrapper( + DocumentSplitV2026R0TypeField.DOCUMENT_SPLIT); + } + + public DocumentSplitV2026R0( + String id, + FileReferenceV2026R0 sourceFile, + EnumWrapper status, + DocumentSplitCreateRequestPageSelectionV2026R0 splitInput, + FolderReferenceV2026R0 destinationFolder, + DocumentSplitV2026R0InputSourceField inputSource) { + super(); + this.id = id; + this.sourceFile = sourceFile; + this.status = status; + this.splitInput = new DocumentSplitCreateRequestTypeV2026R0(splitInput); + this.destinationFolder = destinationFolder; + this.inputSource = new EnumWrapper(inputSource); + this.type = + new EnumWrapper( + DocumentSplitV2026R0TypeField.DOCUMENT_SPLIT); + } + + public DocumentSplitV2026R0( + String id, + FileReferenceV2026R0 sourceFile, + EnumWrapper status, + DocumentSplitCreateRequestPageSelectionV2026R0 splitInput, + FolderReferenceV2026R0 destinationFolder, + EnumWrapper inputSource) { + super(); + this.id = id; + this.sourceFile = sourceFile; + this.status = status; + this.splitInput = new DocumentSplitCreateRequestTypeV2026R0(splitInput); + this.destinationFolder = destinationFolder; + this.inputSource = inputSource; + this.type = + new EnumWrapper( + DocumentSplitV2026R0TypeField.DOCUMENT_SPLIT); + } + + public DocumentSplitV2026R0( + String id, + FileReferenceV2026R0 sourceFile, + EnumWrapper status, + DocumentSplitCreateRequestSmartV2026R0 splitInput, + FolderReferenceV2026R0 destinationFolder, + DocumentSplitV2026R0InputSourceField inputSource) { + super(); + this.id = id; + this.sourceFile = sourceFile; + this.status = status; + this.splitInput = new DocumentSplitCreateRequestTypeV2026R0(splitInput); + this.destinationFolder = destinationFolder; + this.inputSource = new EnumWrapper(inputSource); + this.type = + new EnumWrapper( + DocumentSplitV2026R0TypeField.DOCUMENT_SPLIT); + } + + public DocumentSplitV2026R0( + String id, + FileReferenceV2026R0 sourceFile, + EnumWrapper status, + DocumentSplitCreateRequestSmartV2026R0 splitInput, + FolderReferenceV2026R0 destinationFolder, + EnumWrapper inputSource) { + super(); + this.id = id; + this.sourceFile = sourceFile; + this.status = status; + this.splitInput = new DocumentSplitCreateRequestTypeV2026R0(splitInput); + this.destinationFolder = destinationFolder; + this.inputSource = inputSource; + this.type = + new EnumWrapper( + DocumentSplitV2026R0TypeField.DOCUMENT_SPLIT); + } + + public DocumentSplitV2026R0( + String id, + FileReferenceV2026R0 sourceFile, + EnumWrapper status, + DocumentSplitCreateRequestTypeV2026R0 splitInput, + FolderReferenceV2026R0 destinationFolder, + DocumentSplitV2026R0InputSourceField inputSource) { + super(); + this.id = id; + this.sourceFile = sourceFile; + this.status = status; + this.splitInput = splitInput; + this.destinationFolder = destinationFolder; + this.inputSource = new EnumWrapper(inputSource); + this.type = + new EnumWrapper( + DocumentSplitV2026R0TypeField.DOCUMENT_SPLIT); + } + + public DocumentSplitV2026R0( + @JsonProperty("id") String id, + @JsonProperty("source_file") FileReferenceV2026R0 sourceFile, + @JsonProperty("status") EnumWrapper status, + @JsonProperty("split_input") DocumentSplitCreateRequestTypeV2026R0 splitInput, + @JsonProperty("destination_folder") FolderReferenceV2026R0 destinationFolder, + @JsonProperty("input_source") EnumWrapper inputSource) { + super(); + this.id = id; + this.sourceFile = sourceFile; + this.status = status; + this.splitInput = splitInput; + this.destinationFolder = destinationFolder; + this.inputSource = inputSource; + this.type = + new EnumWrapper( + DocumentSplitV2026R0TypeField.DOCUMENT_SPLIT); + } + + protected DocumentSplitV2026R0(Builder builder) { + super(); + this.id = builder.id; + this.type = builder.type; + this.sourceFile = builder.sourceFile; + this.status = builder.status; + this.splitInput = builder.splitInput; + this.output = builder.output; + this.destinationFolder = builder.destinationFolder; + this.inputSource = builder.inputSource; + this.createdAt = builder.createdAt; + this.createdBy = builder.createdBy; + this.enterprise = builder.enterprise; + this.failures = builder.failures; + this.externalId = builder.externalId; + markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); + } + + public String getId() { + return id; + } + + public EnumWrapper getType() { + return type; + } + + public FileReferenceV2026R0 getSourceFile() { + return sourceFile; + } + + public EnumWrapper getStatus() { + return status; + } + + public DocumentSplitCreateRequestTypeV2026R0 getSplitInput() { + return splitInput; + } + + public DocumentSplitOutputV2026R0 getOutput() { + return output; + } + + public FolderReferenceV2026R0 getDestinationFolder() { + return destinationFolder; + } + + public EnumWrapper getInputSource() { + return inputSource; + } + + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public UserMiniV2026R0 getCreatedBy() { + return createdBy; + } + + public EnterpriseReferenceV2026R0 getEnterprise() { + return enterprise; + } + + public DocumentSplitFailuresV2026R0 getFailures() { + return failures; + } + + public String getExternalId() { + return externalId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DocumentSplitV2026R0 casted = (DocumentSplitV2026R0) o; + return Objects.equals(id, casted.id) + && Objects.equals(type, casted.type) + && Objects.equals(sourceFile, casted.sourceFile) + && Objects.equals(status, casted.status) + && Objects.equals(splitInput, casted.splitInput) + && Objects.equals(output, casted.output) + && Objects.equals(destinationFolder, casted.destinationFolder) + && Objects.equals(inputSource, casted.inputSource) + && Objects.equals(createdAt, casted.createdAt) + && Objects.equals(createdBy, casted.createdBy) + && Objects.equals(enterprise, casted.enterprise) + && Objects.equals(failures, casted.failures) + && Objects.equals(externalId, casted.externalId); + } + + @Override + public int hashCode() { + return Objects.hash( + id, + type, + sourceFile, + status, + splitInput, + output, + destinationFolder, + inputSource, + createdAt, + createdBy, + enterprise, + failures, + externalId); + } + + @Override + public String toString() { + return "DocumentSplitV2026R0{" + + "id='" + + id + + '\'' + + ", " + + "type='" + + type + + '\'' + + ", " + + "sourceFile='" + + sourceFile + + '\'' + + ", " + + "status='" + + status + + '\'' + + ", " + + "splitInput='" + + splitInput + + '\'' + + ", " + + "output='" + + output + + '\'' + + ", " + + "destinationFolder='" + + destinationFolder + + '\'' + + ", " + + "inputSource='" + + inputSource + + '\'' + + ", " + + "createdAt='" + + createdAt + + '\'' + + ", " + + "createdBy='" + + createdBy + + '\'' + + ", " + + "enterprise='" + + enterprise + + '\'' + + ", " + + "failures='" + + failures + + '\'' + + ", " + + "externalId='" + + externalId + + '\'' + + "}"; + } + + public static class Builder extends NullableFieldTracker { + + protected final String id; + + protected EnumWrapper type; + + protected final FileReferenceV2026R0 sourceFile; + + protected final EnumWrapper status; + + protected final DocumentSplitCreateRequestTypeV2026R0 splitInput; + + protected DocumentSplitOutputV2026R0 output; + + protected final FolderReferenceV2026R0 destinationFolder; + + protected final EnumWrapper inputSource; + + protected OffsetDateTime createdAt; + + protected UserMiniV2026R0 createdBy; + + protected EnterpriseReferenceV2026R0 enterprise; + + protected DocumentSplitFailuresV2026R0 failures; + + protected String externalId; + + public Builder( + String id, + FileReferenceV2026R0 sourceFile, + DocumentSplitV2026R0StatusField status, + DocumentSplitCreateRequestManualV2026R0 splitInput, + FolderReferenceV2026R0 destinationFolder, + DocumentSplitV2026R0InputSourceField inputSource) { + super(); + this.id = id; + this.sourceFile = sourceFile; + this.status = new EnumWrapper(status); + this.splitInput = new DocumentSplitCreateRequestTypeV2026R0(splitInput); + this.destinationFolder = destinationFolder; + this.inputSource = new EnumWrapper(inputSource); + } + + public Builder( + String id, + FileReferenceV2026R0 sourceFile, + DocumentSplitV2026R0StatusField status, + DocumentSplitCreateRequestManualV2026R0 splitInput, + FolderReferenceV2026R0 destinationFolder, + EnumWrapper inputSource) { + super(); + this.id = id; + this.sourceFile = sourceFile; + this.status = new EnumWrapper(status); + this.splitInput = new DocumentSplitCreateRequestTypeV2026R0(splitInput); + this.destinationFolder = destinationFolder; + this.inputSource = inputSource; + } + + public Builder( + String id, + FileReferenceV2026R0 sourceFile, + DocumentSplitV2026R0StatusField status, + DocumentSplitCreateRequestPageSelectionV2026R0 splitInput, + FolderReferenceV2026R0 destinationFolder, + DocumentSplitV2026R0InputSourceField inputSource) { + super(); + this.id = id; + this.sourceFile = sourceFile; + this.status = new EnumWrapper(status); + this.splitInput = new DocumentSplitCreateRequestTypeV2026R0(splitInput); + this.destinationFolder = destinationFolder; + this.inputSource = new EnumWrapper(inputSource); + } + + public Builder( + String id, + FileReferenceV2026R0 sourceFile, + DocumentSplitV2026R0StatusField status, + DocumentSplitCreateRequestPageSelectionV2026R0 splitInput, + FolderReferenceV2026R0 destinationFolder, + EnumWrapper inputSource) { + super(); + this.id = id; + this.sourceFile = sourceFile; + this.status = new EnumWrapper(status); + this.splitInput = new DocumentSplitCreateRequestTypeV2026R0(splitInput); + this.destinationFolder = destinationFolder; + this.inputSource = inputSource; + } + + public Builder( + String id, + FileReferenceV2026R0 sourceFile, + DocumentSplitV2026R0StatusField status, + DocumentSplitCreateRequestSmartV2026R0 splitInput, + FolderReferenceV2026R0 destinationFolder, + DocumentSplitV2026R0InputSourceField inputSource) { + super(); + this.id = id; + this.sourceFile = sourceFile; + this.status = new EnumWrapper(status); + this.splitInput = new DocumentSplitCreateRequestTypeV2026R0(splitInput); + this.destinationFolder = destinationFolder; + this.inputSource = new EnumWrapper(inputSource); + } + + public Builder( + String id, + FileReferenceV2026R0 sourceFile, + DocumentSplitV2026R0StatusField status, + DocumentSplitCreateRequestSmartV2026R0 splitInput, + FolderReferenceV2026R0 destinationFolder, + EnumWrapper inputSource) { + super(); + this.id = id; + this.sourceFile = sourceFile; + this.status = new EnumWrapper(status); + this.splitInput = new DocumentSplitCreateRequestTypeV2026R0(splitInput); + this.destinationFolder = destinationFolder; + this.inputSource = inputSource; + } + + public Builder( + String id, + FileReferenceV2026R0 sourceFile, + DocumentSplitV2026R0StatusField status, + DocumentSplitCreateRequestTypeV2026R0 splitInput, + FolderReferenceV2026R0 destinationFolder, + DocumentSplitV2026R0InputSourceField inputSource) { + super(); + this.id = id; + this.sourceFile = sourceFile; + this.status = new EnumWrapper(status); + this.splitInput = splitInput; + this.destinationFolder = destinationFolder; + this.inputSource = new EnumWrapper(inputSource); + } + + public Builder( + String id, + FileReferenceV2026R0 sourceFile, + DocumentSplitV2026R0StatusField status, + DocumentSplitCreateRequestTypeV2026R0 splitInput, + FolderReferenceV2026R0 destinationFolder, + EnumWrapper inputSource) { + super(); + this.id = id; + this.sourceFile = sourceFile; + this.status = new EnumWrapper(status); + this.splitInput = splitInput; + this.destinationFolder = destinationFolder; + this.inputSource = inputSource; + } + + public Builder( + String id, + FileReferenceV2026R0 sourceFile, + EnumWrapper status, + DocumentSplitCreateRequestManualV2026R0 splitInput, + FolderReferenceV2026R0 destinationFolder, + DocumentSplitV2026R0InputSourceField inputSource) { + super(); + this.id = id; + this.sourceFile = sourceFile; + this.status = status; + this.splitInput = new DocumentSplitCreateRequestTypeV2026R0(splitInput); + this.destinationFolder = destinationFolder; + this.inputSource = new EnumWrapper(inputSource); + } + + public Builder( + String id, + FileReferenceV2026R0 sourceFile, + EnumWrapper status, + DocumentSplitCreateRequestManualV2026R0 splitInput, + FolderReferenceV2026R0 destinationFolder, + EnumWrapper inputSource) { + super(); + this.id = id; + this.sourceFile = sourceFile; + this.status = status; + this.splitInput = new DocumentSplitCreateRequestTypeV2026R0(splitInput); + this.destinationFolder = destinationFolder; + this.inputSource = inputSource; + } + + public Builder( + String id, + FileReferenceV2026R0 sourceFile, + EnumWrapper status, + DocumentSplitCreateRequestPageSelectionV2026R0 splitInput, + FolderReferenceV2026R0 destinationFolder, + DocumentSplitV2026R0InputSourceField inputSource) { + super(); + this.id = id; + this.sourceFile = sourceFile; + this.status = status; + this.splitInput = new DocumentSplitCreateRequestTypeV2026R0(splitInput); + this.destinationFolder = destinationFolder; + this.inputSource = new EnumWrapper(inputSource); + } + + public Builder( + String id, + FileReferenceV2026R0 sourceFile, + EnumWrapper status, + DocumentSplitCreateRequestPageSelectionV2026R0 splitInput, + FolderReferenceV2026R0 destinationFolder, + EnumWrapper inputSource) { + super(); + this.id = id; + this.sourceFile = sourceFile; + this.status = status; + this.splitInput = new DocumentSplitCreateRequestTypeV2026R0(splitInput); + this.destinationFolder = destinationFolder; + this.inputSource = inputSource; + } + + public Builder( + String id, + FileReferenceV2026R0 sourceFile, + EnumWrapper status, + DocumentSplitCreateRequestSmartV2026R0 splitInput, + FolderReferenceV2026R0 destinationFolder, + DocumentSplitV2026R0InputSourceField inputSource) { + super(); + this.id = id; + this.sourceFile = sourceFile; + this.status = status; + this.splitInput = new DocumentSplitCreateRequestTypeV2026R0(splitInput); + this.destinationFolder = destinationFolder; + this.inputSource = new EnumWrapper(inputSource); + } + + public Builder( + String id, + FileReferenceV2026R0 sourceFile, + EnumWrapper status, + DocumentSplitCreateRequestSmartV2026R0 splitInput, + FolderReferenceV2026R0 destinationFolder, + EnumWrapper inputSource) { + super(); + this.id = id; + this.sourceFile = sourceFile; + this.status = status; + this.splitInput = new DocumentSplitCreateRequestTypeV2026R0(splitInput); + this.destinationFolder = destinationFolder; + this.inputSource = inputSource; + } + + public Builder( + String id, + FileReferenceV2026R0 sourceFile, + EnumWrapper status, + DocumentSplitCreateRequestTypeV2026R0 splitInput, + FolderReferenceV2026R0 destinationFolder, + DocumentSplitV2026R0InputSourceField inputSource) { + super(); + this.id = id; + this.sourceFile = sourceFile; + this.status = status; + this.splitInput = splitInput; + this.destinationFolder = destinationFolder; + this.inputSource = new EnumWrapper(inputSource); + } + + public Builder( + String id, + FileReferenceV2026R0 sourceFile, + EnumWrapper status, + DocumentSplitCreateRequestTypeV2026R0 splitInput, + FolderReferenceV2026R0 destinationFolder, + EnumWrapper inputSource) { + super(); + this.id = id; + this.sourceFile = sourceFile; + this.status = status; + this.splitInput = splitInput; + this.destinationFolder = destinationFolder; + this.inputSource = inputSource; + } + + public Builder type(DocumentSplitV2026R0TypeField type) { + this.type = new EnumWrapper(type); + return this; + } + + public Builder type(EnumWrapper type) { + this.type = type; + return this; + } + + public Builder output(DocumentSplitOutputV2026R0 output) { + this.output = output; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdBy(UserMiniV2026R0 createdBy) { + this.createdBy = createdBy; + return this; + } + + public Builder enterprise(EnterpriseReferenceV2026R0 enterprise) { + this.enterprise = enterprise; + return this; + } + + public Builder failures(DocumentSplitFailuresV2026R0 failures) { + this.failures = failures; + return this; + } + + public Builder externalId(String externalId) { + this.externalId = externalId; + return this; + } + + public DocumentSplitV2026R0 build() { + if (this.type == null) { + this.type = + new EnumWrapper( + DocumentSplitV2026R0TypeField.DOCUMENT_SPLIT); + } + return new DocumentSplitV2026R0(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitv2026r0/DocumentSplitV2026R0InputSourceField.java b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitv2026r0/DocumentSplitV2026R0InputSourceField.java new file mode 100644 index 000000000..09902491c --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitv2026r0/DocumentSplitV2026R0InputSourceField.java @@ -0,0 +1,67 @@ +package com.box.sdkgen.schemas.v2026r0.documentsplitv2026r0; + +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 DocumentSplitV2026R0InputSourceField implements Valuable { + API("api"), + BOX("box"), + RELAY("relay"), + SALESFORCE("salesforce"); + + private final String value; + + DocumentSplitV2026R0InputSourceField(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + public static class DocumentSplitV2026R0InputSourceFieldDeserializer + extends JsonDeserializer> { + + public DocumentSplitV2026R0InputSourceFieldDeserializer() { + super(); + } + + @Override + public EnumWrapper deserialize( + JsonParser p, DeserializationContext ctxt) throws IOException { + String value = p.getValueAsString(); + return Arrays.stream(DocumentSplitV2026R0InputSourceField.values()) + .filter((v) -> v.getValue().equalsIgnoreCase(value)) + .findFirst() + .map(EnumWrapper::new) + .orElse(new EnumWrapper(value)); + } + } + + public static class DocumentSplitV2026R0InputSourceFieldSerializer + extends JsonSerializer> { + + public DocumentSplitV2026R0InputSourceFieldSerializer() { + 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/v2026r0/documentsplitv2026r0/DocumentSplitV2026R0StatusField.java b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitv2026r0/DocumentSplitV2026R0StatusField.java new file mode 100644 index 000000000..e1e16c83f --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitv2026r0/DocumentSplitV2026R0StatusField.java @@ -0,0 +1,67 @@ +package com.box.sdkgen.schemas.v2026r0.documentsplitv2026r0; + +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 DocumentSplitV2026R0StatusField implements Valuable { + SUBMITTED("submitted"), + COMPLETED("completed"), + FAILED("failed"), + COMPLETED_WITH_ERROR("completed_with_error"); + + private final String value; + + DocumentSplitV2026R0StatusField(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + public static class DocumentSplitV2026R0StatusFieldDeserializer + extends JsonDeserializer> { + + public DocumentSplitV2026R0StatusFieldDeserializer() { + super(); + } + + @Override + public EnumWrapper deserialize( + JsonParser p, DeserializationContext ctxt) throws IOException { + String value = p.getValueAsString(); + return Arrays.stream(DocumentSplitV2026R0StatusField.values()) + .filter((v) -> v.getValue().equalsIgnoreCase(value)) + .findFirst() + .map(EnumWrapper::new) + .orElse(new EnumWrapper(value)); + } + } + + public static class DocumentSplitV2026R0StatusFieldSerializer + extends JsonSerializer> { + + public DocumentSplitV2026R0StatusFieldSerializer() { + 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/v2026r0/documentsplitv2026r0/DocumentSplitV2026R0TypeField.java b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitv2026r0/DocumentSplitV2026R0TypeField.java new file mode 100644 index 000000000..520f25115 --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/v2026r0/documentsplitv2026r0/DocumentSplitV2026R0TypeField.java @@ -0,0 +1,64 @@ +package com.box.sdkgen.schemas.v2026r0.documentsplitv2026r0; + +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 DocumentSplitV2026R0TypeField implements Valuable { + DOCUMENT_SPLIT("document_split"); + + private final String value; + + DocumentSplitV2026R0TypeField(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + public static class DocumentSplitV2026R0TypeFieldDeserializer + extends JsonDeserializer> { + + public DocumentSplitV2026R0TypeFieldDeserializer() { + super(); + } + + @Override + public EnumWrapper deserialize( + JsonParser p, DeserializationContext ctxt) throws IOException { + String value = p.getValueAsString(); + return Arrays.stream(DocumentSplitV2026R0TypeField.values()) + .filter((v) -> v.getValue().equalsIgnoreCase(value)) + .findFirst() + .map(EnumWrapper::new) + .orElse(new EnumWrapper(value)); + } + } + + public static class DocumentSplitV2026R0TypeFieldSerializer + extends JsonSerializer> { + + public DocumentSplitV2026R0TypeFieldSerializer() { + 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/v2026r0/enterprisereferencev2026r0/EnterpriseReferenceV2026R0.java b/src/main/java/com/box/sdkgen/schemas/v2026r0/enterprisereferencev2026r0/EnterpriseReferenceV2026R0.java new file mode 100644 index 000000000..e2f25a813 --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/v2026r0/enterprisereferencev2026r0/EnterpriseReferenceV2026R0.java @@ -0,0 +1,103 @@ +package com.box.sdkgen.schemas.v2026r0.enterprisereferencev2026r0; + +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; + +/** A reference to an enterprise, used when nested within another resource. */ +@JsonFilter("nullablePropertyFilter") +public class EnterpriseReferenceV2026R0 extends SerializableObject { + + /** The unique identifier for this enterprise. */ + protected final String id; + + /** The value will always be `enterprise`. */ + @JsonDeserialize( + using = + EnterpriseReferenceV2026R0TypeField.EnterpriseReferenceV2026R0TypeFieldDeserializer.class) + @JsonSerialize( + using = + EnterpriseReferenceV2026R0TypeField.EnterpriseReferenceV2026R0TypeFieldSerializer.class) + protected EnumWrapper type; + + public EnterpriseReferenceV2026R0(@JsonProperty("id") String id) { + super(); + this.id = id; + this.type = + new EnumWrapper( + EnterpriseReferenceV2026R0TypeField.ENTERPRISE); + } + + protected EnterpriseReferenceV2026R0(Builder builder) { + super(); + this.id = builder.id; + this.type = builder.type; + markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); + } + + public String getId() { + return id; + } + + public EnumWrapper getType() { + return type; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnterpriseReferenceV2026R0 casted = (EnterpriseReferenceV2026R0) o; + return Objects.equals(id, casted.id) && Objects.equals(type, casted.type); + } + + @Override + public int hashCode() { + return Objects.hash(id, type); + } + + @Override + public String toString() { + return "EnterpriseReferenceV2026R0{" + "id='" + id + '\'' + ", " + "type='" + type + '\'' + "}"; + } + + public static class Builder extends NullableFieldTracker { + + protected final String id; + + protected EnumWrapper type; + + public Builder(String id) { + super(); + this.id = id; + } + + public Builder type(EnterpriseReferenceV2026R0TypeField type) { + this.type = new EnumWrapper(type); + return this; + } + + public Builder type(EnumWrapper type) { + this.type = type; + return this; + } + + public EnterpriseReferenceV2026R0 build() { + if (this.type == null) { + this.type = + new EnumWrapper( + EnterpriseReferenceV2026R0TypeField.ENTERPRISE); + } + return new EnterpriseReferenceV2026R0(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/schemas/v2026r0/enterprisereferencev2026r0/EnterpriseReferenceV2026R0TypeField.java b/src/main/java/com/box/sdkgen/schemas/v2026r0/enterprisereferencev2026r0/EnterpriseReferenceV2026R0TypeField.java new file mode 100644 index 000000000..3612183bb --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/v2026r0/enterprisereferencev2026r0/EnterpriseReferenceV2026R0TypeField.java @@ -0,0 +1,64 @@ +package com.box.sdkgen.schemas.v2026r0.enterprisereferencev2026r0; + +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 EnterpriseReferenceV2026R0TypeField implements Valuable { + ENTERPRISE("enterprise"); + + private final String value; + + EnterpriseReferenceV2026R0TypeField(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + public static class EnterpriseReferenceV2026R0TypeFieldDeserializer + extends JsonDeserializer> { + + public EnterpriseReferenceV2026R0TypeFieldDeserializer() { + super(); + } + + @Override + public EnumWrapper deserialize( + JsonParser p, DeserializationContext ctxt) throws IOException { + String value = p.getValueAsString(); + return Arrays.stream(EnterpriseReferenceV2026R0TypeField.values()) + .filter((v) -> v.getValue().equalsIgnoreCase(value)) + .findFirst() + .map(EnumWrapper::new) + .orElse(new EnumWrapper(value)); + } + } + + public static class EnterpriseReferenceV2026R0TypeFieldSerializer + extends JsonSerializer> { + + public EnterpriseReferenceV2026R0TypeFieldSerializer() { + 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/v2026r0/filereferencev2026r0/FileReferenceV2026R0.java b/src/main/java/com/box/sdkgen/schemas/v2026r0/filereferencev2026r0/FileReferenceV2026R0.java new file mode 100644 index 000000000..1d53fe36e --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/v2026r0/filereferencev2026r0/FileReferenceV2026R0.java @@ -0,0 +1,98 @@ +package com.box.sdkgen.schemas.v2026r0.filereferencev2026r0; + +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; + +/** File reference. */ +@JsonFilter("nullablePropertyFilter") +public class FileReferenceV2026R0 extends SerializableObject { + + /** The value will always be `file`. */ + @JsonDeserialize( + using = FileReferenceV2026R0TypeField.FileReferenceV2026R0TypeFieldDeserializer.class) + @JsonSerialize( + using = FileReferenceV2026R0TypeField.FileReferenceV2026R0TypeFieldSerializer.class) + protected EnumWrapper type; + + /** ID of the file. */ + protected final String id; + + public FileReferenceV2026R0(@JsonProperty("id") String id) { + super(); + this.id = id; + this.type = new EnumWrapper(FileReferenceV2026R0TypeField.FILE); + } + + protected FileReferenceV2026R0(Builder builder) { + super(); + this.type = builder.type; + this.id = builder.id; + markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); + } + + public EnumWrapper getType() { + return type; + } + + public String getId() { + return id; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FileReferenceV2026R0 casted = (FileReferenceV2026R0) o; + return Objects.equals(type, casted.type) && Objects.equals(id, casted.id); + } + + @Override + public int hashCode() { + return Objects.hash(type, id); + } + + @Override + public String toString() { + return "FileReferenceV2026R0{" + "type='" + type + '\'' + ", " + "id='" + id + '\'' + "}"; + } + + public static class Builder extends NullableFieldTracker { + + protected EnumWrapper type; + + protected final String id; + + public Builder(String id) { + super(); + this.id = id; + } + + public Builder type(FileReferenceV2026R0TypeField type) { + this.type = new EnumWrapper(type); + return this; + } + + public Builder type(EnumWrapper type) { + this.type = type; + return this; + } + + public FileReferenceV2026R0 build() { + if (this.type == null) { + this.type = + new EnumWrapper(FileReferenceV2026R0TypeField.FILE); + } + return new FileReferenceV2026R0(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/schemas/v2026r0/filereferencev2026r0/FileReferenceV2026R0TypeField.java b/src/main/java/com/box/sdkgen/schemas/v2026r0/filereferencev2026r0/FileReferenceV2026R0TypeField.java new file mode 100644 index 000000000..3efd21fa7 --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/v2026r0/filereferencev2026r0/FileReferenceV2026R0TypeField.java @@ -0,0 +1,64 @@ +package com.box.sdkgen.schemas.v2026r0.filereferencev2026r0; + +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 FileReferenceV2026R0TypeField implements Valuable { + FILE("file"); + + private final String value; + + FileReferenceV2026R0TypeField(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + public static class FileReferenceV2026R0TypeFieldDeserializer + extends JsonDeserializer> { + + public FileReferenceV2026R0TypeFieldDeserializer() { + super(); + } + + @Override + public EnumWrapper deserialize( + JsonParser p, DeserializationContext ctxt) throws IOException { + String value = p.getValueAsString(); + return Arrays.stream(FileReferenceV2026R0TypeField.values()) + .filter((v) -> v.getValue().equalsIgnoreCase(value)) + .findFirst() + .map(EnumWrapper::new) + .orElse(new EnumWrapper(value)); + } + } + + public static class FileReferenceV2026R0TypeFieldSerializer + extends JsonSerializer> { + + public FileReferenceV2026R0TypeFieldSerializer() { + 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/weblink/WebLinkSharedLinkField.java b/src/main/java/com/box/sdkgen/schemas/weblink/WebLinkSharedLinkField.java index 4c499bd4f..289eac90c 100644 --- a/src/main/java/com/box/sdkgen/schemas/weblink/WebLinkSharedLinkField.java +++ b/src/main/java/com/box/sdkgen/schemas/weblink/WebLinkSharedLinkField.java @@ -125,13 +125,17 @@ public class WebLinkSharedLinkField extends SerializableObject { @JsonProperty("preview_count") protected final long previewCount; + @JsonProperty("one_time_passcode") + protected final WebLinkSharedLinkOneTimePasscodeField oneTimePasscode; + public WebLinkSharedLinkField( String url, WebLinkSharedLinkEffectiveAccessField effectiveAccess, WebLinkSharedLinkEffectivePermissionField effectivePermission, boolean isPasswordEnabled, long downloadCount, - long previewCount) { + long previewCount, + WebLinkSharedLinkOneTimePasscodeField oneTimePasscode) { super(); this.url = url; this.effectiveAccess = new EnumWrapper(effectiveAccess); @@ -140,6 +144,7 @@ public WebLinkSharedLinkField( this.isPasswordEnabled = isPasswordEnabled; this.downloadCount = downloadCount; this.previewCount = previewCount; + this.oneTimePasscode = oneTimePasscode; } public WebLinkSharedLinkField( @@ -148,7 +153,8 @@ public WebLinkSharedLinkField( EnumWrapper effectivePermission, boolean isPasswordEnabled, long downloadCount, - long previewCount) { + long previewCount, + WebLinkSharedLinkOneTimePasscodeField oneTimePasscode) { super(); this.url = url; this.effectiveAccess = new EnumWrapper(effectiveAccess); @@ -156,6 +162,7 @@ public WebLinkSharedLinkField( this.isPasswordEnabled = isPasswordEnabled; this.downloadCount = downloadCount; this.previewCount = previewCount; + this.oneTimePasscode = oneTimePasscode; } public WebLinkSharedLinkField( @@ -164,7 +171,8 @@ public WebLinkSharedLinkField( WebLinkSharedLinkEffectivePermissionField effectivePermission, boolean isPasswordEnabled, long downloadCount, - long previewCount) { + long previewCount, + WebLinkSharedLinkOneTimePasscodeField oneTimePasscode) { super(); this.url = url; this.effectiveAccess = effectiveAccess; @@ -173,6 +181,7 @@ public WebLinkSharedLinkField( this.isPasswordEnabled = isPasswordEnabled; this.downloadCount = downloadCount; this.previewCount = previewCount; + this.oneTimePasscode = oneTimePasscode; } public WebLinkSharedLinkField( @@ -183,7 +192,8 @@ public WebLinkSharedLinkField( EnumWrapper effectivePermission, @JsonProperty("is_password_enabled") boolean isPasswordEnabled, @JsonProperty("download_count") long downloadCount, - @JsonProperty("preview_count") long previewCount) { + @JsonProperty("preview_count") long previewCount, + @JsonProperty("one_time_passcode") WebLinkSharedLinkOneTimePasscodeField oneTimePasscode) { super(); this.url = url; this.effectiveAccess = effectiveAccess; @@ -191,6 +201,7 @@ public WebLinkSharedLinkField( this.isPasswordEnabled = isPasswordEnabled; this.downloadCount = downloadCount; this.previewCount = previewCount; + this.oneTimePasscode = oneTimePasscode; } protected WebLinkSharedLinkField(Builder builder) { @@ -207,6 +218,7 @@ protected WebLinkSharedLinkField(Builder builder) { this.permissions = builder.permissions; this.downloadCount = builder.downloadCount; this.previewCount = builder.previewCount; + this.oneTimePasscode = builder.oneTimePasscode; markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); } @@ -258,6 +270,10 @@ public long getPreviewCount() { return previewCount; } + public WebLinkSharedLinkOneTimePasscodeField getOneTimePasscode() { + return oneTimePasscode; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -278,7 +294,8 @@ public boolean equals(Object o) { && Objects.equals(isPasswordEnabled, casted.isPasswordEnabled) && Objects.equals(permissions, casted.permissions) && Objects.equals(downloadCount, casted.downloadCount) - && Objects.equals(previewCount, casted.previewCount); + && Objects.equals(previewCount, casted.previewCount) + && Objects.equals(oneTimePasscode, casted.oneTimePasscode); } @Override @@ -295,7 +312,8 @@ public int hashCode() { isPasswordEnabled, permissions, downloadCount, - previewCount); + previewCount, + oneTimePasscode); } @Override @@ -348,6 +366,10 @@ public String toString() { + "previewCount='" + previewCount + '\'' + + ", " + + "oneTimePasscode='" + + oneTimePasscode + + '\'' + "}"; } @@ -377,13 +399,16 @@ public static class Builder extends NullableFieldTracker { protected final long previewCount; + protected final WebLinkSharedLinkOneTimePasscodeField oneTimePasscode; + public Builder( String url, WebLinkSharedLinkEffectiveAccessField effectiveAccess, WebLinkSharedLinkEffectivePermissionField effectivePermission, boolean isPasswordEnabled, long downloadCount, - long previewCount) { + long previewCount, + WebLinkSharedLinkOneTimePasscodeField oneTimePasscode) { super(); this.url = url; this.effectiveAccess = @@ -393,6 +418,7 @@ public Builder( this.isPasswordEnabled = isPasswordEnabled; this.downloadCount = downloadCount; this.previewCount = previewCount; + this.oneTimePasscode = oneTimePasscode; } public Builder( @@ -401,7 +427,8 @@ public Builder( EnumWrapper effectivePermission, boolean isPasswordEnabled, long downloadCount, - long previewCount) { + long previewCount, + WebLinkSharedLinkOneTimePasscodeField oneTimePasscode) { super(); this.url = url; this.effectiveAccess = @@ -410,6 +437,7 @@ public Builder( this.isPasswordEnabled = isPasswordEnabled; this.downloadCount = downloadCount; this.previewCount = previewCount; + this.oneTimePasscode = oneTimePasscode; } public Builder( @@ -418,7 +446,8 @@ public Builder( WebLinkSharedLinkEffectivePermissionField effectivePermission, boolean isPasswordEnabled, long downloadCount, - long previewCount) { + long previewCount, + WebLinkSharedLinkOneTimePasscodeField oneTimePasscode) { super(); this.url = url; this.effectiveAccess = effectiveAccess; @@ -427,6 +456,7 @@ public Builder( this.isPasswordEnabled = isPasswordEnabled; this.downloadCount = downloadCount; this.previewCount = previewCount; + this.oneTimePasscode = oneTimePasscode; } public Builder( @@ -435,7 +465,8 @@ public Builder( EnumWrapper effectivePermission, boolean isPasswordEnabled, long downloadCount, - long previewCount) { + long previewCount, + WebLinkSharedLinkOneTimePasscodeField oneTimePasscode) { super(); this.url = url; this.effectiveAccess = effectiveAccess; @@ -443,6 +474,7 @@ public Builder( this.isPasswordEnabled = isPasswordEnabled; this.downloadCount = downloadCount; this.previewCount = previewCount; + this.oneTimePasscode = oneTimePasscode; } public Builder downloadUrl(String downloadUrl) { diff --git a/src/main/java/com/box/sdkgen/schemas/weblink/WebLinkSharedLinkOneTimePasscodeField.java b/src/main/java/com/box/sdkgen/schemas/weblink/WebLinkSharedLinkOneTimePasscodeField.java new file mode 100644 index 000000000..07f4c5023 --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/weblink/WebLinkSharedLinkOneTimePasscodeField.java @@ -0,0 +1,110 @@ +package com.box.sdkgen.schemas.weblink; + +import com.box.sdkgen.internal.NullableFieldTracker; +import com.box.sdkgen.internal.SerializableObject; +import com.box.sdkgen.schemas.sharedlinkotpallowlistentry.SharedLinkOtpAllowlistEntry; +import com.fasterxml.jackson.annotation.JsonFilter; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Objects; + +@JsonFilter("nullablePropertyFilter") +public class WebLinkSharedLinkOneTimePasscodeField extends SerializableObject { + + /** + * The current OTP enforcement mode for the shared link. + * + *

* `none` - OTP enforcement is turned off. The shared link is accessible without any + * one-time-passcode verification. * `open` - Any anonymous recipient can request a + * one-time-passcode to any email address and access the shared link after verifying it. + * Collaborators and registered Box users access the link without being prompted. * `allowlist` - + * Anonymous recipients can request a one-time-passcode only when they enter an email that matches + * an entry on the `allowlist`. + */ + protected final String mode; + + /** + * The list of email and domain entries that are permitted to access the shared link when `mode` + * is `allowlist`. Anonymous users whose email matches an entry can request and verify a + * one-time-passcode. + * + *

Because the entries carry recipient email addresses and the identity of the user who added + * them, this field is only returned to users with owner, co-owner, or editor access on the item. + * For viewer collaborators and below the field is omitted. + * + *

An allowlist contains at most 1000 entries, matching the limit enforced when setting the + * allowlist on a shared link. + */ + protected List allowlist; + + public WebLinkSharedLinkOneTimePasscodeField(@JsonProperty("mode") String mode) { + super(); + this.mode = mode; + } + + protected WebLinkSharedLinkOneTimePasscodeField(Builder builder) { + super(); + this.mode = builder.mode; + this.allowlist = builder.allowlist; + markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); + } + + public String getMode() { + return mode; + } + + public List getAllowlist() { + return allowlist; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebLinkSharedLinkOneTimePasscodeField casted = (WebLinkSharedLinkOneTimePasscodeField) o; + return Objects.equals(mode, casted.mode) && Objects.equals(allowlist, casted.allowlist); + } + + @Override + public int hashCode() { + return Objects.hash(mode, allowlist); + } + + @Override + public String toString() { + return "WebLinkSharedLinkOneTimePasscodeField{" + + "mode='" + + mode + + '\'' + + ", " + + "allowlist='" + + allowlist + + '\'' + + "}"; + } + + public static class Builder extends NullableFieldTracker { + + protected final String mode; + + protected List allowlist; + + public Builder(String mode) { + super(); + this.mode = mode; + } + + public Builder allowlist(List allowlist) { + this.allowlist = allowlist; + return this; + } + + public WebLinkSharedLinkOneTimePasscodeField build() { + return new WebLinkSharedLinkOneTimePasscodeField(this); + } + } +}