diff --git a/.codegen.json b/.codegen.json index c4b187e9a..8fc2f4cfa 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1 +1 @@ -{ "engineHash": "976bbb9", "specHash": "a0e8038", "version": "5.19.0" } +{ "engineHash": "2dcb7e8", "specHash": "74452eb", "version": "5.19.0" } diff --git a/docs/sdkgen/documentsplit.md b/docs/sdkgen/documentsplit.md index 477f5dc3b..ce38296a2 100644 --- a/docs/sdkgen/documentsplit.md +++ b/docs/sdkgen/documentsplit.md @@ -26,7 +26,10 @@ 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* + +``` +client.getDocumentSplit().createDocumentSplitV2026R0(new DocumentSplitCreateRequestV2026R0.Builder(file.getId(), folder.getId(), DocumentSplitCreateRequestV2026R0InputSourceField.API, new DocumentSplitCreateRequestManualV2026R0.Builder(Arrays.asList(new DocumentSplitPageRangeV2026R0(1, 1))).splitType(DocumentSplitCreateRequestManualV2026R0SplitTypeField.MANUAL).build()).externalId(externalId).build()) +``` ### Arguments @@ -54,7 +57,10 @@ 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* + +``` +client.getDocumentSplit().getDocumentSplitsV2026R0(new GetDocumentSplitsV2026R0QueryParams.Builder().limit(10L).build()) +``` ### Arguments @@ -82,7 +88,10 @@ 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* + +``` +client.getDocumentSplit().getDocumentSplitByIdV2026R0(createdDocumentSplit.getId()) +``` ### Arguments diff --git a/docs/sdkgen/legalholdpolicyassignments.md b/docs/sdkgen/legalholdpolicyassignments.md index 592003406..8e3e3a2de 100644 --- a/docs/sdkgen/legalholdpolicyassignments.md +++ b/docs/sdkgen/legalholdpolicyassignments.md @@ -38,7 +38,7 @@ Returns a list of legal hold policy assignments. ## Assign legal hold policy -Assign a legal hold to an item type of: file, file version, folder, user, ownership, or interactions. +Assign a legal hold to an item type of: file, file version, folder, user, ownership, interactions, or metadata template. This operation is performed by calling function `createLegalHoldPolicyAssignment`. diff --git a/docs/sdkgen/shuttle.md b/docs/sdkgen/shuttle.md index dcfd7b519..53b35b68f 100644 --- a/docs/sdkgen/shuttle.md +++ b/docs/sdkgen/shuttle.md @@ -51,7 +51,10 @@ This operation is performed by calling function `getShuttleSystemsV2026R0`. See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/get-shuttle-systems/). -*Currently we don't have an example for calling `getShuttleSystemsV2026R0` in integration tests* + +``` +client.getShuttle().getShuttleSystemsV2026R0() +``` ### Arguments @@ -79,7 +82,10 @@ This operation is performed by calling function `createShuttleSystemV2026R0`. See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/post-shuttle-systems/). -*Currently we don't have an example for calling `createShuttleSystemV2026R0` in integration tests* + +``` +client.getShuttle().createShuttleSystemV2026R0(new ShuttleSystemCreateRequestV2026R0.Builder(systemName).systemType(ShuttleSystemCreateRequestV2026R0SystemTypeField.WINDOWS).build()) +``` ### Arguments @@ -106,7 +112,10 @@ This operation is performed by calling function `getShuttleSystemByIdV2026R0`. See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/get-shuttle-systems-id/). -*Currently we don't have an example for calling `getShuttleSystemByIdV2026R0` in integration tests* + +``` +client.getShuttle().getShuttleSystemByIdV2026R0(createdSystem.getId()) +``` ### Arguments @@ -133,7 +142,10 @@ This operation is performed by calling function `updateShuttleSystemByIdV2026R0` See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/put-shuttle-systems-id/). -*Currently we don't have an example for calling `updateShuttleSystemByIdV2026R0` in integration tests* + +``` +client.getShuttle().updateShuttleSystemByIdV2026R0(createdSystem.getId(), new ShuttleSystemUpdateRequestV2026R0.Builder().name(updatedSystemName).build()) +``` ### Arguments @@ -162,7 +174,10 @@ This operation is performed by calling function `deleteShuttleSystemByIdV2026R0` See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/delete-shuttle-systems-id/). -*Currently we don't have an example for calling `deleteShuttleSystemByIdV2026R0` in integration tests* + +``` +client.getShuttle().deleteShuttleSystemByIdV2026R0(createdSystem.getId()) +``` ### Arguments @@ -191,7 +206,10 @@ This operation is performed by calling function `createShuttleSystemIssueRegistr See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/post-shuttle-systems-id-issue-registration-token/). -*Currently we don't have an example for calling `createShuttleSystemIssueRegistrationTokenV2026R0` in integration tests* + +``` +client.getShuttle().createShuttleSystemIssueRegistrationTokenV2026R0(createdSystem.getId()) +``` ### Arguments @@ -218,7 +236,10 @@ This operation is performed by calling function `getShuttleJobsV2026R0`. See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/get-shuttle-jobs/). -*Currently we don't have an example for calling `getShuttleJobsV2026R0` in integration tests* + +``` +client.getShuttle().getShuttleJobsV2026R0() +``` ### Arguments @@ -245,7 +266,10 @@ This operation is performed by calling function `createShuttleJobV2026R0`. See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/post-shuttle-jobs/). -*Currently we don't have an example for calling `createShuttleJobV2026R0` in integration tests* + +``` +client.getShuttle().createShuttleJobV2026R0(new ShuttleJobCreateRequestV2026R0(getUuid(), ShuttleJobCreateRequestV2026R0JobTypeField.TRANSFER, resourceId)) +``` ### Arguments @@ -272,7 +296,10 @@ This operation is performed by calling function `getShuttleJobByIdV2026R0`. See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/get-shuttle-jobs-id/). -*Currently we don't have an example for calling `getShuttleJobByIdV2026R0` in integration tests* + +``` +client.getShuttle().getShuttleJobByIdV2026R0(resourceId) +``` ### Arguments @@ -299,7 +326,10 @@ This operation is performed by calling function `updateShuttleJobByIdV2026R0`. See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/put-shuttle-jobs-id/). -*Currently we don't have an example for calling `updateShuttleJobByIdV2026R0` in integration tests* + +``` +client.getShuttle().updateShuttleJobByIdV2026R0(resourceId, new ShuttleJobUpdateRequestV2026R0.Builder().name(getUuid()).build()) +``` ### Arguments @@ -328,7 +358,10 @@ This operation is performed by calling function `deleteShuttleJobByIdV2026R0`. See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/delete-shuttle-jobs-id/). -*Currently we don't have an example for calling `deleteShuttleJobByIdV2026R0` in integration tests* + +``` +client.getShuttle().deleteShuttleJobByIdV2026R0(resourceId) +``` ### Arguments @@ -355,7 +388,10 @@ This operation is performed by calling function `createShuttleJobStartV2026R0`. See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/post-shuttle-jobs-id-start/). -*Currently we don't have an example for calling `createShuttleJobStartV2026R0` in integration tests* + +``` +client.getShuttle().createShuttleJobStartV2026R0(resourceId) +``` ### Arguments @@ -385,7 +421,10 @@ This operation is performed by calling function `createShuttleJobStopV2026R0`. See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/post-shuttle-jobs-id-stop/). -*Currently we don't have an example for calling `createShuttleJobStopV2026R0` in integration tests* + +``` +client.getShuttle().createShuttleJobStopV2026R0(resourceId) +``` ### Arguments @@ -412,7 +451,10 @@ This operation is performed by calling function `createShuttleJobPrepareMigratio See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/post-shuttle-jobs-id-prepare-migration/). -*Currently we don't have an example for calling `createShuttleJobPrepareMigrationV2026R0` in integration tests* + +``` +client.getShuttle().createShuttleJobPrepareMigrationV2026R0(resourceId) +``` ### Arguments @@ -439,7 +481,10 @@ This operation is performed by calling function `getShuttleRunsV2026R0`. See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/get-shuttle-runs/). -*Currently we don't have an example for calling `getShuttleRunsV2026R0` in integration tests* + +``` +client.getShuttle().getShuttleRunsV2026R0(new GetShuttleRunsV2026R0QueryParams(resourceId)) +``` ### Arguments @@ -466,7 +511,10 @@ This operation is performed by calling function `getShuttleRunByIdV2026R0`. See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/get-shuttle-runs-id/). -*Currently we don't have an example for calling `getShuttleRunByIdV2026R0` in integration tests* + +``` +client.getShuttle().getShuttleRunByIdV2026R0(resourceId) +``` ### Arguments @@ -493,7 +541,10 @@ This operation is performed by calling function `getShuttleJobSchedulesV2026R0`. See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/get-shuttle-job-schedules/). -*Currently we don't have an example for calling `getShuttleJobSchedulesV2026R0` in integration tests* + +``` +client.getShuttle().getShuttleJobSchedulesV2026R0(new GetShuttleJobSchedulesV2026R0QueryParams(resourceId)) +``` ### Arguments @@ -522,7 +573,10 @@ This operation is performed by calling function `createShuttleJobScheduleV2026R0 See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/post-shuttle-job-schedules/). -*Currently we don't have an example for calling `createShuttleJobScheduleV2026R0` in integration tests* + +``` +client.getShuttle().createShuttleJobScheduleV2026R0(new ShuttleJobScheduleCreateRequestV2026R0.Builder(resourceId, ShuttleJobScheduleCreateRequestV2026R0RunModeField.TRANSFER, new ShuttleJobScheduleTriggerByTimeV2026R0.Builder("2030-01-01T09:00:00", "America/Los_Angeles", ShuttleJobScheduleTriggerByTimeV2026R0RepeatField.DAILY).type(ShuttleJobScheduleTriggerByTimeV2026R0TypeField.BY_TIME).build()).state(ShuttleJobScheduleCreateRequestV2026R0StateField.PAUSED).build()) +``` ### Arguments @@ -548,7 +602,10 @@ This operation is performed by calling function `getShuttleJobScheduleByIdV2026R See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/get-shuttle-job-schedules-id/). -*Currently we don't have an example for calling `getShuttleJobScheduleByIdV2026R0` in integration tests* + +``` +client.getShuttle().getShuttleJobScheduleByIdV2026R0(resourceId) +``` ### Arguments @@ -576,7 +633,10 @@ This operation is performed by calling function `updateShuttleJobScheduleByIdV20 See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/put-shuttle-job-schedules-id/). -*Currently we don't have an example for calling `updateShuttleJobScheduleByIdV2026R0` in integration tests* + +``` +client.getShuttle().updateShuttleJobScheduleByIdV2026R0(resourceId, new ShuttleJobScheduleUpdateRequestV2026R0.Builder().runMode(ShuttleJobScheduleUpdateRequestV2026R0RunModeField.SIMULATION).build()) +``` ### Arguments @@ -605,7 +665,10 @@ This operation is performed by calling function `deleteShuttleJobScheduleByIdV20 See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/delete-shuttle-job-schedules-id/). -*Currently we don't have an example for calling `deleteShuttleJobScheduleByIdV2026R0` in integration tests* + +``` +client.getShuttle().deleteShuttleJobScheduleByIdV2026R0(resourceId) +``` ### Arguments @@ -633,7 +696,10 @@ This operation is performed by calling function `getShuttlePathMappingsV2026R0`. See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/get-shuttle-path-mappings/). -*Currently we don't have an example for calling `getShuttlePathMappingsV2026R0` in integration tests* + +``` +client.getShuttle().getShuttlePathMappingsV2026R0(new GetShuttlePathMappingsV2026R0QueryParams(resourceId)) +``` ### Arguments @@ -660,7 +726,10 @@ This operation is performed by calling function `createShuttlePathMappingV2026R0 See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/post-shuttle-path-mappings/). -*Currently we don't have an example for calling `createShuttlePathMappingV2026R0` in integration tests* + +``` +client.getShuttle().createShuttlePathMappingV2026R0(new ShuttlePathMappingCreateRequestV2026R0(resourceId, new ShuttlePathMappingAccountLocationInputV2026R0.Builder("/finance", new ShuttlePathMappingAccountInputV2026R0.Builder().email("user@example.com").build()).type(ShuttlePathMappingAccountLocationInputV2026R0TypeField.ACCOUNT).build())) +``` ### Arguments @@ -687,7 +756,10 @@ This operation is performed by calling function `getShuttlePathMappingByIdV2026R See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/get-shuttle-path-mappings-id/). -*Currently we don't have an example for calling `getShuttlePathMappingByIdV2026R0` in integration tests* + +``` +client.getShuttle().getShuttlePathMappingByIdV2026R0(resourceId) +``` ### Arguments @@ -715,7 +787,10 @@ This operation is performed by calling function `updateShuttlePathMappingByIdV20 See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/put-shuttle-path-mappings-id/). -*Currently we don't have an example for calling `updateShuttlePathMappingByIdV2026R0` in integration tests* + +``` +client.getShuttle().updateShuttlePathMappingByIdV2026R0(resourceId, new ShuttlePathMappingUpdateRequestV2026R0.Builder().isPathSkipped(true).build()) +``` ### Arguments @@ -744,7 +819,10 @@ This operation is performed by calling function `deleteShuttlePathMappingByIdV20 See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/delete-shuttle-path-mappings-id/). -*Currently we don't have an example for calling `deleteShuttlePathMappingByIdV2026R0` in integration tests* + +``` +client.getShuttle().deleteShuttlePathMappingByIdV2026R0(resourceId) +``` ### Arguments @@ -785,7 +863,10 @@ This operation is performed by calling function `createShuttlePathMappingImportV See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/post-shuttle-path-mapping-imports/). -*Currently we don't have an example for calling `createShuttlePathMappingImportV2026R0` in integration tests* + +``` +client.getShuttle().createShuttlePathMappingImportV2026R0(new ShuttlePathMappingImportCreateRequestV2026R0(resourceId, resourceId)) +``` ### Arguments @@ -844,7 +925,10 @@ This operation is performed by calling function `createShuttleSubjectMappingImpo See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/post-shuttle-subject-mapping-imports/). -*Currently we don't have an example for calling `createShuttleSubjectMappingImportV2026R0` in integration tests* + +``` +client.getShuttle().createShuttleSubjectMappingImportV2026R0(new ShuttleSubjectMappingImportCreateRequestV2026R0(resourceId, resourceId)) +``` ### Arguments @@ -876,7 +960,10 @@ This operation is performed by calling function `getShuttleSubjectMappingsV2026R See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/get-shuttle-subject-mappings/). -*Currently we don't have an example for calling `getShuttleSubjectMappingsV2026R0` in integration tests* + +``` +client.getShuttle().getShuttleSubjectMappingsV2026R0(new GetShuttleSubjectMappingsV2026R0QueryParams(resourceId)) +``` ### Arguments @@ -903,7 +990,10 @@ This operation is performed by calling function `createShuttleSubjectMappingV202 See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/post-shuttle-subject-mappings/). -*Currently we don't have an example for calling `createShuttleSubjectMappingV2026R0` in integration tests* + +``` +client.getShuttle().createShuttleSubjectMappingV2026R0(new ShuttleSubjectMappingCreateRequestV2026R0(resourceId, resourceId)) +``` ### Arguments @@ -930,7 +1020,10 @@ This operation is performed by calling function `getShuttleSubjectMappingByIdV20 See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/get-shuttle-subject-mappings-id/). -*Currently we don't have an example for calling `getShuttleSubjectMappingByIdV2026R0` in integration tests* + +``` +client.getShuttle().getShuttleSubjectMappingByIdV2026R0(resourceId) +``` ### Arguments @@ -958,7 +1051,10 @@ This operation is performed by calling function `updateShuttleSubjectMappingById See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/put-shuttle-subject-mappings-id/). -*Currently we don't have an example for calling `updateShuttleSubjectMappingByIdV2026R0` in integration tests* + +``` +client.getShuttle().updateShuttleSubjectMappingByIdV2026R0(resourceId, new ShuttleSubjectMappingUpdateRequestV2026R0.Builder().isSubjectSkipped(true).build()) +``` ### Arguments @@ -986,7 +1082,10 @@ This operation is performed by calling function `deleteShuttleSubjectMappingById See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/delete-shuttle-subject-mappings-id/). -*Currently we don't have an example for calling `deleteShuttleSubjectMappingByIdV2026R0` in integration tests* + +``` +client.getShuttle().deleteShuttleSubjectMappingByIdV2026R0(resourceId) +``` ### Arguments @@ -1014,7 +1113,10 @@ This operation is performed by calling function `getShuttleDiscoveredSubjectsV20 See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/get-shuttle-discovered-subjects/). -*Currently we don't have an example for calling `getShuttleDiscoveredSubjectsV2026R0` in integration tests* + +``` +client.getShuttle().getShuttleDiscoveredSubjectsV2026R0(new GetShuttleDiscoveredSubjectsV2026R0QueryParams(resourceId)) +``` ### Arguments @@ -1045,7 +1147,10 @@ This operation is performed by calling function `getShuttlePathEntriesV2026R0`. See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/get-shuttle-path-entries/). -*Currently we don't have an example for calling `getShuttlePathEntriesV2026R0` in integration tests* + +``` +client.getShuttle().getShuttlePathEntriesV2026R0(new GetShuttlePathEntriesV2026R0QueryParams(resourceId, GetShuttlePathEntriesV2026R0QueryParamsSideField.SOURCE)) +``` ### Arguments @@ -1073,7 +1178,10 @@ This operation is performed by calling function `getShuttleMappingErrorsV2026R0` See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/get-shuttle-mapping-errors/). -*Currently we don't have an example for calling `getShuttleMappingErrorsV2026R0` in integration tests* + +``` +client.getShuttle().getShuttleMappingErrorsV2026R0(new GetShuttleMappingErrorsV2026R0QueryParams(resourceId)) +``` ### Arguments @@ -1100,7 +1208,10 @@ This operation is performed by calling function `getShuttleReportsV2026R0`. See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/get-shuttle-reports/). -*Currently we don't have an example for calling `getShuttleReportsV2026R0` in integration tests* + +``` +client.getShuttle().getShuttleReportsV2026R0(new GetShuttleReportsV2026R0QueryParams(resourceId)) +``` ### Arguments @@ -1131,7 +1242,10 @@ This operation is performed by calling function `createShuttleReportV2026R0`. See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/post-shuttle-reports/). -*Currently we don't have an example for calling `createShuttleReportV2026R0` in integration tests* + +``` +client.getShuttle().createShuttleReportV2026R0(new ShuttleReportCreateRequestV2026R0(resourceId, ShuttleReportCreateRequestV2026R0FormatField.CSV, Arrays.asList("summary"))) +``` ### Arguments @@ -1162,7 +1276,10 @@ This operation is performed by calling function `getShuttleReportByIdV2026R0`. See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/get-shuttle-reports-id/). -*Currently we don't have an example for calling `getShuttleReportByIdV2026R0` in integration tests* + +``` +client.getShuttle().getShuttleReportByIdV2026R0(resourceId) +``` ### Arguments diff --git a/src/intTest/java/com/box/sdkgen/documentsplit/DocumentSplitITest.java b/src/intTest/java/com/box/sdkgen/documentsplit/DocumentSplitITest.java new file mode 100644 index 000000000..1d596d708 --- /dev/null +++ b/src/intTest/java/com/box/sdkgen/documentsplit/DocumentSplitITest.java @@ -0,0 +1,75 @@ +package com.box.sdkgen.documentsplit; + +import static com.box.sdkgen.commons.CommonsManager.createNewFolder; +import static com.box.sdkgen.commons.CommonsManager.getDefaultClient; +import static com.box.sdkgen.commons.CommonsManager.uploadNewFile; +import static com.box.sdkgen.internal.utils.UtilsManager.convertToString; +import static com.box.sdkgen.internal.utils.UtilsManager.getUuid; + +import com.box.sdkgen.client.BoxClient; +import com.box.sdkgen.managers.documentsplit.GetDocumentSplitsV2026R0QueryParams; +import com.box.sdkgen.managers.folders.DeleteFolderByIdQueryParams; +import com.box.sdkgen.schemas.filefull.FileFull; +import com.box.sdkgen.schemas.folderfull.FolderFull; +import com.box.sdkgen.schemas.v2026r0.documentsplitcreaterequestmanualv2026r0.DocumentSplitCreateRequestManualV2026R0; +import com.box.sdkgen.schemas.v2026r0.documentsplitcreaterequestmanualv2026r0.DocumentSplitCreateRequestManualV2026R0SplitTypeField; +import com.box.sdkgen.schemas.v2026r0.documentsplitcreaterequestv2026r0.DocumentSplitCreateRequestV2026R0; +import com.box.sdkgen.schemas.v2026r0.documentsplitcreaterequestv2026r0.DocumentSplitCreateRequestV2026R0InputSourceField; +import com.box.sdkgen.schemas.v2026r0.documentsplitcreateresponsev2026r0.DocumentSplitCreateResponseV2026R0; +import com.box.sdkgen.schemas.v2026r0.documentsplitpagerangev2026r0.DocumentSplitPageRangeV2026R0; +import com.box.sdkgen.schemas.v2026r0.documentsplitsv2026r0.DocumentSplitsV2026R0; +import com.box.sdkgen.schemas.v2026r0.documentsplitv2026r0.DocumentSplitV2026R0; +import java.util.Arrays; +import org.junit.jupiter.api.Test; + +public class DocumentSplitITest { + + private static final BoxClient client = getDefaultClient(); + + @Test + public void testCreateDocumentSplitV2026R0() { + FileFull file = uploadNewFile(); + FolderFull folder = createNewFolder(); + String externalId = getUuid(); + DocumentSplitCreateResponseV2026R0 createdDocumentSplit = + client + .getDocumentSplit() + .createDocumentSplitV2026R0( + new DocumentSplitCreateRequestV2026R0.Builder( + file.getId(), + folder.getId(), + DocumentSplitCreateRequestV2026R0InputSourceField.API, + new DocumentSplitCreateRequestManualV2026R0.Builder( + Arrays.asList(new DocumentSplitPageRangeV2026R0(1, 1))) + .splitType(DocumentSplitCreateRequestManualV2026R0SplitTypeField.MANUAL) + .build()) + .externalId(externalId) + .build()); + assert !(createdDocumentSplit.getId().equals("")); + assert convertToString(createdDocumentSplit.getType()).equals("document_split"); + DocumentSplitV2026R0 documentSplit = + client.getDocumentSplit().getDocumentSplitByIdV2026R0(createdDocumentSplit.getId()); + assert documentSplit.getId().equals(createdDocumentSplit.getId()); + assert convertToString(documentSplit.getType()).equals("document_split"); + assert documentSplit.getSourceFile().getId().equals(file.getId()); + assert documentSplit.getDestinationFolder().getId().equals(folder.getId()); + assert convertToString(documentSplit.getInputSource()).equals("api"); + assert !(convertToString(documentSplit.getStatus()).equals("")); + assert documentSplit.getExternalId().equals(externalId); + client + .getFolders() + .deleteFolderById( + folder.getId(), new DeleteFolderByIdQueryParams.Builder().recursive(true).build()); + client.getFiles().deleteFileById(file.getId()); + } + + @Test + public void testGetDocumentSplitsV2026R0() { + DocumentSplitsV2026R0 documentSplits = + client + .getDocumentSplit() + .getDocumentSplitsV2026R0( + new GetDocumentSplitsV2026R0QueryParams.Builder().limit(10L).build()); + assert documentSplits.getEntries().size() >= 0; + } +} diff --git a/src/intTest/java/com/box/sdkgen/shuttle/ShuttleITest.java b/src/intTest/java/com/box/sdkgen/shuttle/ShuttleITest.java new file mode 100644 index 000000000..72b9a58e7 --- /dev/null +++ b/src/intTest/java/com/box/sdkgen/shuttle/ShuttleITest.java @@ -0,0 +1,324 @@ +package com.box.sdkgen.shuttle; + +import static com.box.sdkgen.commons.CommonsManager.getDefaultClientWithUserSubject; +import static com.box.sdkgen.internal.utils.UtilsManager.convertToString; +import static com.box.sdkgen.internal.utils.UtilsManager.getEnvVar; +import static com.box.sdkgen.internal.utils.UtilsManager.getUuid; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import com.box.sdkgen.client.BoxClient; +import com.box.sdkgen.managers.shuttle.GetShuttleDiscoveredSubjectsV2026R0QueryParams; +import com.box.sdkgen.managers.shuttle.GetShuttleJobSchedulesV2026R0QueryParams; +import com.box.sdkgen.managers.shuttle.GetShuttleMappingErrorsV2026R0QueryParams; +import com.box.sdkgen.managers.shuttle.GetShuttlePathEntriesV2026R0QueryParams; +import com.box.sdkgen.managers.shuttle.GetShuttlePathEntriesV2026R0QueryParamsSideField; +import com.box.sdkgen.managers.shuttle.GetShuttlePathMappingsV2026R0QueryParams; +import com.box.sdkgen.managers.shuttle.GetShuttleReportsV2026R0QueryParams; +import com.box.sdkgen.managers.shuttle.GetShuttleRunsV2026R0QueryParams; +import com.box.sdkgen.managers.shuttle.GetShuttleSubjectMappingsV2026R0QueryParams; +import com.box.sdkgen.schemas.v2026r0.shuttleagentcredentialsv2026r0.ShuttleAgentCredentialsV2026R0; +import com.box.sdkgen.schemas.v2026r0.shuttlejobcreaterequestv2026r0.ShuttleJobCreateRequestV2026R0; +import com.box.sdkgen.schemas.v2026r0.shuttlejobcreaterequestv2026r0.ShuttleJobCreateRequestV2026R0JobTypeField; +import com.box.sdkgen.schemas.v2026r0.shuttlejobschedulecreaterequestv2026r0.ShuttleJobScheduleCreateRequestV2026R0; +import com.box.sdkgen.schemas.v2026r0.shuttlejobschedulecreaterequestv2026r0.ShuttleJobScheduleCreateRequestV2026R0RunModeField; +import com.box.sdkgen.schemas.v2026r0.shuttlejobschedulecreaterequestv2026r0.ShuttleJobScheduleCreateRequestV2026R0StateField; +import com.box.sdkgen.schemas.v2026r0.shuttlejobscheduletriggerbytimev2026r0.ShuttleJobScheduleTriggerByTimeV2026R0; +import com.box.sdkgen.schemas.v2026r0.shuttlejobscheduletriggerbytimev2026r0.ShuttleJobScheduleTriggerByTimeV2026R0RepeatField; +import com.box.sdkgen.schemas.v2026r0.shuttlejobscheduletriggerbytimev2026r0.ShuttleJobScheduleTriggerByTimeV2026R0TypeField; +import com.box.sdkgen.schemas.v2026r0.shuttlejobscheduleupdaterequestv2026r0.ShuttleJobScheduleUpdateRequestV2026R0; +import com.box.sdkgen.schemas.v2026r0.shuttlejobscheduleupdaterequestv2026r0.ShuttleJobScheduleUpdateRequestV2026R0RunModeField; +import com.box.sdkgen.schemas.v2026r0.shuttlejobsv2026r0.ShuttleJobsV2026R0; +import com.box.sdkgen.schemas.v2026r0.shuttlejobupdaterequestv2026r0.ShuttleJobUpdateRequestV2026R0; +import com.box.sdkgen.schemas.v2026r0.shuttlepathmappingaccountinputv2026r0.ShuttlePathMappingAccountInputV2026R0; +import com.box.sdkgen.schemas.v2026r0.shuttlepathmappingaccountlocationinputv2026r0.ShuttlePathMappingAccountLocationInputV2026R0; +import com.box.sdkgen.schemas.v2026r0.shuttlepathmappingaccountlocationinputv2026r0.ShuttlePathMappingAccountLocationInputV2026R0TypeField; +import com.box.sdkgen.schemas.v2026r0.shuttlepathmappingcreaterequestv2026r0.ShuttlePathMappingCreateRequestV2026R0; +import com.box.sdkgen.schemas.v2026r0.shuttlepathmappingimportcreaterequestv2026r0.ShuttlePathMappingImportCreateRequestV2026R0; +import com.box.sdkgen.schemas.v2026r0.shuttlepathmappingupdaterequestv2026r0.ShuttlePathMappingUpdateRequestV2026R0; +import com.box.sdkgen.schemas.v2026r0.shuttlereportcreaterequestv2026r0.ShuttleReportCreateRequestV2026R0; +import com.box.sdkgen.schemas.v2026r0.shuttlereportcreaterequestv2026r0.ShuttleReportCreateRequestV2026R0FormatField; +import com.box.sdkgen.schemas.v2026r0.shuttlerunsv2026r0.ShuttleRunsV2026R0; +import com.box.sdkgen.schemas.v2026r0.shuttlesubjectmappingcreaterequestv2026r0.ShuttleSubjectMappingCreateRequestV2026R0; +import com.box.sdkgen.schemas.v2026r0.shuttlesubjectmappingimportcreaterequestv2026r0.ShuttleSubjectMappingImportCreateRequestV2026R0; +import com.box.sdkgen.schemas.v2026r0.shuttlesubjectmappingupdaterequestv2026r0.ShuttleSubjectMappingUpdateRequestV2026R0; +import com.box.sdkgen.schemas.v2026r0.shuttlesystemcreaterequestv2026r0.ShuttleSystemCreateRequestV2026R0; +import com.box.sdkgen.schemas.v2026r0.shuttlesystemcreaterequestv2026r0.ShuttleSystemCreateRequestV2026R0SystemTypeField; +import com.box.sdkgen.schemas.v2026r0.shuttlesystemsv2026r0.ShuttleSystemsV2026R0; +import com.box.sdkgen.schemas.v2026r0.shuttlesystemupdaterequestv2026r0.ShuttleSystemUpdateRequestV2026R0; +import com.box.sdkgen.schemas.v2026r0.shuttlesystemv2026r0.ShuttleSystemV2026R0; +import java.util.Arrays; +import org.junit.jupiter.api.Test; + +public class ShuttleITest { + + private static final BoxClient client = getDefaultClientWithUserSubject(getEnvVar("USER_ID")); + + @Test + public void testCreateGetUpdateListDeleteShuttleSystemV2026R0() { + String systemName = getUuid(); + ShuttleSystemV2026R0 createdSystem = + client + .getShuttle() + .createShuttleSystemV2026R0( + new ShuttleSystemCreateRequestV2026R0.Builder(systemName) + .systemType(ShuttleSystemCreateRequestV2026R0SystemTypeField.WINDOWS) + .build()); + assert createdSystem.getName().equals(systemName); + assert createdSystem.getSystemType().equals("windows"); + assert convertToString(createdSystem.getType()).equals("shuttle_system"); + ShuttleSystemV2026R0 systemFromApi = + client.getShuttle().getShuttleSystemByIdV2026R0(createdSystem.getId()); + assert systemFromApi.getId().equals(createdSystem.getId()); + assert systemFromApi.getName().equals(systemName); + String updatedSystemName = getUuid(); + ShuttleSystemV2026R0 updatedSystem = + client + .getShuttle() + .updateShuttleSystemByIdV2026R0( + createdSystem.getId(), + new ShuttleSystemUpdateRequestV2026R0.Builder().name(updatedSystemName).build()); + assert updatedSystem.getName().equals(updatedSystemName); + ShuttleSystemsV2026R0 systems = client.getShuttle().getShuttleSystemsV2026R0(); + assert systems.getEntries().size() > 0; + ShuttleAgentCredentialsV2026R0 credentials = + client.getShuttle().createShuttleSystemIssueRegistrationTokenV2026R0(createdSystem.getId()); + assert !(credentials.getRegistrationToken().equals("")); + client.getShuttle().deleteShuttleSystemByIdV2026R0(createdSystem.getId()); + assertThrows( + RuntimeException.class, + () -> client.getShuttle().getShuttleSystemByIdV2026R0(createdSystem.getId())); + } + + @Test + public void testShuttleJobsWithNonExistentIdV2026R0() { + String resourceId = "123456"; + ShuttleJobsV2026R0 jobs = client.getShuttle().getShuttleJobsV2026R0(); + assert jobs.getEntries().size() >= 0; + assertThrows( + RuntimeException.class, + () -> + client + .getShuttle() + .createShuttleJobV2026R0( + new ShuttleJobCreateRequestV2026R0( + getUuid(), + ShuttleJobCreateRequestV2026R0JobTypeField.TRANSFER, + resourceId))); + assertThrows( + RuntimeException.class, () -> client.getShuttle().getShuttleJobByIdV2026R0(resourceId)); + assertThrows( + RuntimeException.class, + () -> + client + .getShuttle() + .updateShuttleJobByIdV2026R0( + resourceId, + new ShuttleJobUpdateRequestV2026R0.Builder().name(getUuid()).build())); + assertThrows( + RuntimeException.class, () -> client.getShuttle().deleteShuttleJobByIdV2026R0(resourceId)); + assertThrows( + RuntimeException.class, () -> client.getShuttle().createShuttleJobStartV2026R0(resourceId)); + assertThrows( + RuntimeException.class, () -> client.getShuttle().createShuttleJobStopV2026R0(resourceId)); + assertThrows( + RuntimeException.class, + () -> client.getShuttle().createShuttleJobPrepareMigrationV2026R0(resourceId)); + } + + @Test + public void testShuttleRunsWithNonExistentIdV2026R0() { + String resourceId = "123456"; + ShuttleRunsV2026R0 runs = + client.getShuttle().getShuttleRunsV2026R0(new GetShuttleRunsV2026R0QueryParams(resourceId)); + assert runs.getEntries().size() >= 0; + assertThrows( + RuntimeException.class, () -> client.getShuttle().getShuttleRunByIdV2026R0(resourceId)); + } + + @Test + public void testShuttleMappingsWithNonExistentIdV2026R0() { + String resourceId = "123456"; + assertThrows( + RuntimeException.class, + () -> + client + .getShuttle() + .getShuttlePathMappingsV2026R0( + new GetShuttlePathMappingsV2026R0QueryParams(resourceId))); + assertThrows( + RuntimeException.class, + () -> client.getShuttle().getShuttlePathMappingByIdV2026R0(resourceId)); + assertThrows( + RuntimeException.class, + () -> + client + .getShuttle() + .updateShuttlePathMappingByIdV2026R0( + resourceId, + new ShuttlePathMappingUpdateRequestV2026R0.Builder() + .isPathSkipped(true) + .build())); + assertThrows( + RuntimeException.class, + () -> client.getShuttle().deleteShuttlePathMappingByIdV2026R0(resourceId)); + assertThrows( + RuntimeException.class, + () -> + client + .getShuttle() + .createShuttlePathMappingImportV2026R0( + new ShuttlePathMappingImportCreateRequestV2026R0(resourceId, resourceId))); + assertThrows( + RuntimeException.class, + () -> + client + .getShuttle() + .getShuttleSubjectMappingsV2026R0( + new GetShuttleSubjectMappingsV2026R0QueryParams(resourceId))); + assertThrows( + RuntimeException.class, + () -> + client + .getShuttle() + .createShuttleSubjectMappingV2026R0( + new ShuttleSubjectMappingCreateRequestV2026R0(resourceId, resourceId))); + assertThrows( + RuntimeException.class, + () -> client.getShuttle().getShuttleSubjectMappingByIdV2026R0(resourceId)); + assertThrows( + RuntimeException.class, + () -> + client + .getShuttle() + .updateShuttleSubjectMappingByIdV2026R0( + resourceId, + new ShuttleSubjectMappingUpdateRequestV2026R0.Builder() + .isSubjectSkipped(true) + .build())); + assertThrows( + RuntimeException.class, + () -> client.getShuttle().deleteShuttleSubjectMappingByIdV2026R0(resourceId)); + assertThrows( + RuntimeException.class, + () -> + client + .getShuttle() + .createShuttleSubjectMappingImportV2026R0( + new ShuttleSubjectMappingImportCreateRequestV2026R0(resourceId, resourceId))); + assertThrows( + RuntimeException.class, + () -> + client + .getShuttle() + .getShuttleDiscoveredSubjectsV2026R0( + new GetShuttleDiscoveredSubjectsV2026R0QueryParams(resourceId))); + assertThrows( + RuntimeException.class, + () -> + client + .getShuttle() + .getShuttlePathEntriesV2026R0( + new GetShuttlePathEntriesV2026R0QueryParams( + resourceId, GetShuttlePathEntriesV2026R0QueryParamsSideField.SOURCE))); + assertThrows( + RuntimeException.class, + () -> + client + .getShuttle() + .getShuttleMappingErrorsV2026R0( + new GetShuttleMappingErrorsV2026R0QueryParams(resourceId))); + } + + @Test + public void testShuttleReportsWithNonExistentIdV2026R0() { + String resourceId = "123456"; + assertThrows( + RuntimeException.class, + () -> + client + .getShuttle() + .getShuttleReportsV2026R0(new GetShuttleReportsV2026R0QueryParams(resourceId))); + assertThrows( + RuntimeException.class, + () -> + client + .getShuttle() + .createShuttleReportV2026R0( + new ShuttleReportCreateRequestV2026R0( + resourceId, + ShuttleReportCreateRequestV2026R0FormatField.CSV, + Arrays.asList("summary")))); + assertThrows( + RuntimeException.class, () -> client.getShuttle().getShuttleReportByIdV2026R0(resourceId)); + } + + @Test + public void testShuttleJobSchedulesWithNonExistentIdV2026R0() { + String resourceId = "123456"; + assertThrows( + RuntimeException.class, + () -> + client + .getShuttle() + .getShuttleJobSchedulesV2026R0( + new GetShuttleJobSchedulesV2026R0QueryParams(resourceId))); + assertThrows( + RuntimeException.class, + () -> client.getShuttle().getShuttleJobScheduleByIdV2026R0(resourceId)); + assertThrows( + RuntimeException.class, + () -> + client + .getShuttle() + .updateShuttleJobScheduleByIdV2026R0( + resourceId, + new ShuttleJobScheduleUpdateRequestV2026R0.Builder() + .runMode(ShuttleJobScheduleUpdateRequestV2026R0RunModeField.SIMULATION) + .build())); + assertThrows( + RuntimeException.class, + () -> client.getShuttle().deleteShuttleJobScheduleByIdV2026R0(resourceId)); + } + + @Test + public void testCreateShuttleJobScheduleWithNonExistentIdV2026R0() { + String resourceId = "123456"; + assertThrows( + RuntimeException.class, + () -> + client + .getShuttle() + .createShuttleJobScheduleV2026R0( + new ShuttleJobScheduleCreateRequestV2026R0.Builder( + resourceId, + ShuttleJobScheduleCreateRequestV2026R0RunModeField.TRANSFER, + new ShuttleJobScheduleTriggerByTimeV2026R0.Builder( + "2030-01-01T09:00:00", + "America/Los_Angeles", + ShuttleJobScheduleTriggerByTimeV2026R0RepeatField.DAILY) + .type(ShuttleJobScheduleTriggerByTimeV2026R0TypeField.BY_TIME) + .build()) + .state(ShuttleJobScheduleCreateRequestV2026R0StateField.PAUSED) + .build())); + } + + @Test + public void testCreateShuttlePathMappingWithNonExistentIdV2026R0() { + String resourceId = "123456"; + assertThrows( + RuntimeException.class, + () -> + client + .getShuttle() + .createShuttlePathMappingV2026R0( + new ShuttlePathMappingCreateRequestV2026R0( + resourceId, + new ShuttlePathMappingAccountLocationInputV2026R0.Builder( + "/finance", + new ShuttlePathMappingAccountInputV2026R0.Builder() + .email("user@example.com") + .build()) + .type(ShuttlePathMappingAccountLocationInputV2026R0TypeField.ACCOUNT) + .build()))); + } +} diff --git a/src/main/java/com/box/sdkgen/managers/legalholdpolicyassignments/CreateLegalHoldPolicyAssignmentRequestBody.java b/src/main/java/com/box/sdkgen/managers/legalholdpolicyassignments/CreateLegalHoldPolicyAssignmentRequestBody.java index e68601bb6..832d44288 100644 --- a/src/main/java/com/box/sdkgen/managers/legalholdpolicyassignments/CreateLegalHoldPolicyAssignmentRequestBody.java +++ b/src/main/java/com/box/sdkgen/managers/legalholdpolicyassignments/CreateLegalHoldPolicyAssignmentRequestBody.java @@ -1,8 +1,11 @@ package com.box.sdkgen.managers.legalholdpolicyassignments; +import com.box.sdkgen.internal.NullableFieldTracker; import com.box.sdkgen.internal.SerializableObject; +import com.box.sdkgen.schemas.legalholdpolicyassignmentfilterfield.LegalHoldPolicyAssignmentFilterField; import com.fasterxml.jackson.annotation.JsonFilter; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; import java.util.Objects; @JsonFilter("nullablePropertyFilter") @@ -16,6 +19,13 @@ public class CreateLegalHoldPolicyAssignmentRequestBody extends SerializableObje @JsonProperty("assign_to") protected final CreateLegalHoldPolicyAssignmentRequestBodyAssignToField assignTo; + /** + * List of metadata template field filters. Only required when `assign_to.type` is + * `metadata_template`. + */ + @JsonProperty("filter_fields") + protected List filterFields; + public CreateLegalHoldPolicyAssignmentRequestBody( @JsonProperty("policy_id") String policyId, @JsonProperty("assign_to") CreateLegalHoldPolicyAssignmentRequestBodyAssignToField assignTo) { @@ -24,6 +34,14 @@ public CreateLegalHoldPolicyAssignmentRequestBody( this.assignTo = assignTo; } + protected CreateLegalHoldPolicyAssignmentRequestBody(Builder builder) { + super(); + this.policyId = builder.policyId; + this.assignTo = builder.assignTo; + this.filterFields = builder.filterFields; + markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); + } + public String getPolicyId() { return policyId; } @@ -32,6 +50,10 @@ public CreateLegalHoldPolicyAssignmentRequestBodyAssignToField getAssignTo() { return assignTo; } + public List getFilterFields() { + return filterFields; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -42,12 +64,14 @@ public boolean equals(Object o) { } CreateLegalHoldPolicyAssignmentRequestBody casted = (CreateLegalHoldPolicyAssignmentRequestBody) o; - return Objects.equals(policyId, casted.policyId) && Objects.equals(assignTo, casted.assignTo); + return Objects.equals(policyId, casted.policyId) + && Objects.equals(assignTo, casted.assignTo) + && Objects.equals(filterFields, casted.filterFields); } @Override public int hashCode() { - return Objects.hash(policyId, assignTo); + return Objects.hash(policyId, assignTo, filterFields); } @Override @@ -60,6 +84,35 @@ public String toString() { + "assignTo='" + assignTo + '\'' + + ", " + + "filterFields='" + + filterFields + + '\'' + "}"; } + + public static class Builder extends NullableFieldTracker { + + protected final String policyId; + + protected final CreateLegalHoldPolicyAssignmentRequestBodyAssignToField assignTo; + + protected List filterFields; + + public Builder( + String policyId, CreateLegalHoldPolicyAssignmentRequestBodyAssignToField assignTo) { + super(); + this.policyId = policyId; + this.assignTo = assignTo; + } + + public Builder filterFields(List filterFields) { + this.filterFields = filterFields; + return this; + } + + public CreateLegalHoldPolicyAssignmentRequestBody build() { + return new CreateLegalHoldPolicyAssignmentRequestBody(this); + } + } } diff --git a/src/main/java/com/box/sdkgen/managers/legalholdpolicyassignments/CreateLegalHoldPolicyAssignmentRequestBodyAssignToTypeField.java b/src/main/java/com/box/sdkgen/managers/legalholdpolicyassignments/CreateLegalHoldPolicyAssignmentRequestBodyAssignToTypeField.java index 49c26f791..ef2795d66 100644 --- a/src/main/java/com/box/sdkgen/managers/legalholdpolicyassignments/CreateLegalHoldPolicyAssignmentRequestBodyAssignToTypeField.java +++ b/src/main/java/com/box/sdkgen/managers/legalholdpolicyassignments/CreateLegalHoldPolicyAssignmentRequestBodyAssignToTypeField.java @@ -18,7 +18,8 @@ public enum CreateLegalHoldPolicyAssignmentRequestBodyAssignToTypeField implemen FOLDER("folder"), USER("user"), OWNERSHIP("ownership"), - INTERACTIONS("interactions"); + INTERACTIONS("interactions"), + METADATA_TEMPLATE("metadata_template"); private final String value; diff --git a/src/main/java/com/box/sdkgen/managers/legalholdpolicyassignments/GetLegalHoldPolicyAssignmentsQueryParamsAssignToTypeField.java b/src/main/java/com/box/sdkgen/managers/legalholdpolicyassignments/GetLegalHoldPolicyAssignmentsQueryParamsAssignToTypeField.java index 5042a328d..034c02252 100644 --- a/src/main/java/com/box/sdkgen/managers/legalholdpolicyassignments/GetLegalHoldPolicyAssignmentsQueryParamsAssignToTypeField.java +++ b/src/main/java/com/box/sdkgen/managers/legalholdpolicyassignments/GetLegalHoldPolicyAssignmentsQueryParamsAssignToTypeField.java @@ -18,7 +18,8 @@ public enum GetLegalHoldPolicyAssignmentsQueryParamsAssignToTypeField implements FOLDER("folder"), USER("user"), OWNERSHIP("ownership"), - INTERACTIONS("interactions"); + INTERACTIONS("interactions"), + METADATA_TEMPLATE("metadata_template"); private final String value; diff --git a/src/main/java/com/box/sdkgen/managers/legalholdpolicyassignments/LegalHoldPolicyAssignmentsManager.java b/src/main/java/com/box/sdkgen/managers/legalholdpolicyassignments/LegalHoldPolicyAssignmentsManager.java index 68a707506..a09f200a8 100644 --- a/src/main/java/com/box/sdkgen/managers/legalholdpolicyassignments/LegalHoldPolicyAssignmentsManager.java +++ b/src/main/java/com/box/sdkgen/managers/legalholdpolicyassignments/LegalHoldPolicyAssignmentsManager.java @@ -81,8 +81,8 @@ public LegalHoldPolicyAssignments getLegalHoldPolicyAssignments( } /** - * Assign a legal hold to an item type of: file, file version, folder, user, ownership, or - * interactions. + * Assign a legal hold to an item type of: file, file version, folder, user, ownership, + * interactions, or metadata template. * * @param requestBody Request body of createLegalHoldPolicyAssignment method */ @@ -93,8 +93,8 @@ public LegalHoldPolicyAssignment createLegalHoldPolicyAssignment( } /** - * Assign a legal hold to an item type of: file, file version, folder, user, ownership, or - * interactions. + * Assign a legal hold to an item type of: file, file version, folder, user, ownership, + * interactions, or metadata template. * * @param requestBody Request body of createLegalHoldPolicyAssignment method * @param headers Headers of createLegalHoldPolicyAssignment method diff --git a/src/main/java/com/box/sdkgen/schemas/legalholdpolicy/LegalHoldPolicyAssignmentCountsField.java b/src/main/java/com/box/sdkgen/schemas/legalholdpolicy/LegalHoldPolicyAssignmentCountsField.java index dcd851041..b35645da5 100644 --- a/src/main/java/com/box/sdkgen/schemas/legalholdpolicy/LegalHoldPolicyAssignmentCountsField.java +++ b/src/main/java/com/box/sdkgen/schemas/legalholdpolicy/LegalHoldPolicyAssignmentCountsField.java @@ -28,6 +28,10 @@ public class LegalHoldPolicyAssignmentCountsField extends SerializableObject { /** The number of users this policy is applied to with the `interactions` type assignment. */ protected Long interactions; + /** The number of metadata templates this policy is applied to. */ + @JsonProperty("metadata_template") + protected Long metadataTemplate; + public LegalHoldPolicyAssignmentCountsField() { super(); } @@ -40,6 +44,7 @@ protected LegalHoldPolicyAssignmentCountsField(Builder builder) { this.fileVersion = builder.fileVersion; this.ownership = builder.ownership; this.interactions = builder.interactions; + this.metadataTemplate = builder.metadataTemplate; markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); } @@ -67,6 +72,10 @@ public Long getInteractions() { return interactions; } + public Long getMetadataTemplate() { + return metadataTemplate; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -81,12 +90,13 @@ public boolean equals(Object o) { && Objects.equals(file, casted.file) && Objects.equals(fileVersion, casted.fileVersion) && Objects.equals(ownership, casted.ownership) - && Objects.equals(interactions, casted.interactions); + && Objects.equals(interactions, casted.interactions) + && Objects.equals(metadataTemplate, casted.metadataTemplate); } @Override public int hashCode() { - return Objects.hash(user, folder, file, fileVersion, ownership, interactions); + return Objects.hash(user, folder, file, fileVersion, ownership, interactions, metadataTemplate); } @Override @@ -115,6 +125,10 @@ public String toString() { + "interactions='" + interactions + '\'' + + ", " + + "metadataTemplate='" + + metadataTemplate + + '\'' + "}"; } @@ -132,6 +146,8 @@ public static class Builder extends NullableFieldTracker { protected Long interactions; + protected Long metadataTemplate; + public Builder user(Long user) { this.user = user; return this; @@ -162,6 +178,11 @@ public Builder interactions(Long interactions) { return this; } + public Builder metadataTemplate(Long metadataTemplate) { + this.metadataTemplate = metadataTemplate; + return this; + } + public LegalHoldPolicyAssignmentCountsField build() { return new LegalHoldPolicyAssignmentCountsField(this); } diff --git a/src/main/java/com/box/sdkgen/schemas/legalholdpolicyassigneditem/LegalHoldPolicyAssignedItemTypeField.java b/src/main/java/com/box/sdkgen/schemas/legalholdpolicyassigneditem/LegalHoldPolicyAssignedItemTypeField.java index f2fa91840..41273bb8d 100644 --- a/src/main/java/com/box/sdkgen/schemas/legalholdpolicyassigneditem/LegalHoldPolicyAssignedItemTypeField.java +++ b/src/main/java/com/box/sdkgen/schemas/legalholdpolicyassigneditem/LegalHoldPolicyAssignedItemTypeField.java @@ -18,7 +18,8 @@ public enum LegalHoldPolicyAssignedItemTypeField implements Valuable { FOLDER("folder"), USER("user"), OWNERSHIP("ownership"), - INTERACTIONS("interactions"); + INTERACTIONS("interactions"), + METADATA_TEMPLATE("metadata_template"); private final String value; diff --git a/src/main/java/com/box/sdkgen/schemas/legalholdpolicyassignment/LegalHoldPolicyAssignment.java b/src/main/java/com/box/sdkgen/schemas/legalholdpolicyassignment/LegalHoldPolicyAssignment.java index 6a1a1db1f..1111e966a 100644 --- a/src/main/java/com/box/sdkgen/schemas/legalholdpolicyassignment/LegalHoldPolicyAssignment.java +++ b/src/main/java/com/box/sdkgen/schemas/legalholdpolicyassignment/LegalHoldPolicyAssignment.java @@ -4,6 +4,7 @@ import com.box.sdkgen.schemas.legalholdpolicyassigneditem.LegalHoldPolicyAssignedItem; import com.box.sdkgen.schemas.legalholdpolicyassignmentbase.LegalHoldPolicyAssignmentBase; import com.box.sdkgen.schemas.legalholdpolicyassignmentbase.LegalHoldPolicyAssignmentBaseTypeField; +import com.box.sdkgen.schemas.legalholdpolicyassignmentfilterfield.LegalHoldPolicyAssignmentFilterField; import com.box.sdkgen.schemas.legalholdpolicymini.LegalHoldPolicyMini; import com.box.sdkgen.schemas.usermini.UserMini; import com.box.sdkgen.serialization.json.EnumWrapper; @@ -12,11 +13,12 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import java.time.OffsetDateTime; +import java.util.List; import java.util.Objects; /** * Legal Hold Assignments are used to assign Legal Hold Policies to an item type of: Users, Folders, - * Files, File Versions, Ownership, or Interactions. + * Files, File Versions, Ownership, Interactions, or Metadata Templates. * *

Creating a Legal Hold Assignment puts a hold on the File-Versions that belong to the * Assignment's 'apply-to' entity. @@ -49,6 +51,13 @@ public class LegalHoldPolicyAssignment extends LegalHoldPolicyAssignmentBase { @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class) protected OffsetDateTime deletedAt; + /** + * List of metadata template field filters. Only present when `assigned_to.type` is + * `metadata_template`. + */ + @JsonProperty("filter_fields") + protected List filterFields; + public LegalHoldPolicyAssignment() { super(); } @@ -60,6 +69,7 @@ protected LegalHoldPolicyAssignment(Builder builder) { this.assignedBy = builder.assignedBy; this.assignedAt = builder.assignedAt; this.deletedAt = builder.deletedAt; + this.filterFields = builder.filterFields; markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); } @@ -83,6 +93,10 @@ public OffsetDateTime getDeletedAt() { return deletedAt; } + public List getFilterFields() { + return filterFields; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -98,12 +112,14 @@ public boolean equals(Object o) { && Objects.equals(assignedTo, casted.assignedTo) && Objects.equals(assignedBy, casted.assignedBy) && Objects.equals(assignedAt, casted.assignedAt) - && Objects.equals(deletedAt, casted.deletedAt); + && Objects.equals(deletedAt, casted.deletedAt) + && Objects.equals(filterFields, casted.filterFields); } @Override public int hashCode() { - return Objects.hash(id, type, legalHoldPolicy, assignedTo, assignedBy, assignedAt, deletedAt); + return Objects.hash( + id, type, legalHoldPolicy, assignedTo, assignedBy, assignedAt, deletedAt, filterFields); } @Override @@ -136,6 +152,10 @@ public String toString() { + "deletedAt='" + deletedAt + '\'' + + ", " + + "filterFields='" + + filterFields + + '\'' + "}"; } @@ -151,6 +171,8 @@ public static class Builder extends LegalHoldPolicyAssignmentBase.Builder { protected OffsetDateTime deletedAt; + protected List filterFields; + public Builder legalHoldPolicy(LegalHoldPolicyMini legalHoldPolicy) { this.legalHoldPolicy = legalHoldPolicy; return this; @@ -176,6 +198,11 @@ public Builder deletedAt(OffsetDateTime deletedAt) { return this; } + public Builder filterFields(List filterFields) { + this.filterFields = filterFields; + return this; + } + @Override public Builder id(String id) { this.id = id; diff --git a/src/main/java/com/box/sdkgen/schemas/legalholdpolicyassignmentfilterfield/LegalHoldPolicyAssignmentFilterField.java b/src/main/java/com/box/sdkgen/schemas/legalholdpolicyassignmentfilterfield/LegalHoldPolicyAssignmentFilterField.java new file mode 100644 index 000000000..6bfa23b15 --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/legalholdpolicyassignmentfilterfield/LegalHoldPolicyAssignmentFilterField.java @@ -0,0 +1,62 @@ +package com.box.sdkgen.schemas.legalholdpolicyassignmentfilterfield; + +import com.box.sdkgen.internal.SerializableObject; +import com.fasterxml.jackson.annotation.JsonFilter; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** A metadata template field filter for a legal hold policy assignment. */ +@JsonFilter("nullablePropertyFilter") +public class LegalHoldPolicyAssignmentFilterField extends SerializableObject { + + /** The ID of the metadata template field to filter on. */ + protected final String field; + + /** The value of the metadata template field to filter on. */ + protected final String value; + + public LegalHoldPolicyAssignmentFilterField( + @JsonProperty("field") String field, @JsonProperty("value") String value) { + super(); + this.field = field; + this.value = value; + } + + public String getField() { + return field; + } + + public String getValue() { + return value; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LegalHoldPolicyAssignmentFilterField casted = (LegalHoldPolicyAssignmentFilterField) o; + return Objects.equals(field, casted.field) && Objects.equals(value, casted.value); + } + + @Override + public int hashCode() { + return Objects.hash(field, value); + } + + @Override + public String toString() { + return "LegalHoldPolicyAssignmentFilterField{" + + "field='" + + field + + '\'' + + ", " + + "value='" + + value + + '\'' + + "}"; + } +}