Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .codegen.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "engineHash": "3ba449c", "specHash": "ec8720b", "version": "0.1.0" }
{ "engineHash": "4673277", "specHash": "ec8720b", "version": "0.1.0" }
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
ENTERPRISE_ID: ${{ secrets.ENTERPRISE_ID }}
BOX_FILE_REQUEST_ID: ${{ secrets.BOX_FILE_REQUEST_ID }}
BOX_EXTERNAL_USER_EMAIL: ${{ secrets.BOX_EXTERNAL_USER_EMAIL }}
BOX_EXTERNAL_USER_ID: ${{ secrets.BOX_EXTERNAL_USER_ID }}
APP_ITEM_ASSOCIATION_FILE_ID: ${{ secrets.APP_ITEM_ASSOCIATION_FILE_ID }}
APP_ITEM_ASSOCIATION_FOLDER_ID: ${{ secrets.APP_ITEM_ASSOCIATION_FOLDER_ID }}
WORKFLOW_FOLDER_ID: ${{ secrets.WORKFLOW_FOLDER_ID }}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ Now select `Authorization` and submit application to be reviewed by account admi
download your app configuration settings as JSON.
2. Encode configuration file to Base64, e.g. using command: `base64 -i path_to_json_file`
3. Set environment variable: `JWT_CONFIG_BASE_64` with base64 encoded jwt configuration file
4. Set environment variable: `BOX_FILE_REQUEST_ID` with ID of file request already created in the user account, `BOX_EXTERNAL_USER_EMAIL` with email of free external user which not belongs to any enterprise.
4. Set environment variable: `BOX_FILE_REQUEST_ID` with ID of file request already created in the user account, `BOX_EXTERNAL_USER_EMAIL` with email of free external user which not belongs to any enterprise and `BOX_EXTERNAL_USER_ID` with its ID.
5. Set environment variable: `WORKFLOW_FOLDER_ID` with the ID of the Relay workflow that deletes the file that triggered the workflow. The workflow should have a manual start to be able to start it from the API.
6. Set environment variable: `APP_ITEM_ASSOCIATION_FILE_ID` to the ID of the file with associated app item and `APP_ITEM_ASSOCIATION_FOLDER_ID` to the ID of the folder with associated app item.
7. Set environment variable: `APP_ITEM_SHARED_LINK` to the shared link associated with app item.
Expand Down
5 changes: 4 additions & 1 deletion docs/externalusers.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ This operation is performed by calling function `submitJobToDeleteExternalUsersV
See the endpoint docs at
[API Reference](https://developer.box.com/reference/v2025.0/post-external-users-submit-delete-job/).

*Currently we don't have an example for calling `submitJobToDeleteExternalUsersV2025R0` in integration tests*
<!-- sample post_external_users_submit_delete_job_v2025.0 -->
```
client.getExternalUsers().submitJobToDeleteExternalUsersV2025R0(new ExternalUsersSubmitDeleteJobRequestV2025R0(Arrays.asList(new UserReferenceV2025R0(getEnvVar("BOX_EXTERNAL_USER_ID")))))
```

### Arguments

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package com.box.sdkgen.test.externalusers;

import static com.box.sdkgen.internal.utils.UtilsManager.getEnvVar;
import static com.box.sdkgen.test.commons.CommonsManager.getDefaultClientWithUserSubject;
import static com.box.sdkgen.test.commons.CommonsManager.uploadNewFile;

import com.box.sdkgen.client.BoxClient;
import com.box.sdkgen.managers.usercollaborations.CreateCollaborationRequestBody;
import com.box.sdkgen.managers.usercollaborations.CreateCollaborationRequestBodyAccessibleByField;
import com.box.sdkgen.managers.usercollaborations.CreateCollaborationRequestBodyAccessibleByTypeField;
import com.box.sdkgen.managers.usercollaborations.CreateCollaborationRequestBodyItemField;
import com.box.sdkgen.managers.usercollaborations.CreateCollaborationRequestBodyItemTypeField;
import com.box.sdkgen.managers.usercollaborations.CreateCollaborationRequestBodyRoleField;
import com.box.sdkgen.schemas.collaboration.Collaboration;
import com.box.sdkgen.schemas.filefull.FileFull;
import com.box.sdkgen.schemas.v2025r0.externaluserssubmitdeletejobrequestv2025r0.ExternalUsersSubmitDeleteJobRequestV2025R0;
import com.box.sdkgen.schemas.v2025r0.externaluserssubmitdeletejobresponsev2025r0.ExternalUsersSubmitDeleteJobResponseV2025R0;
import com.box.sdkgen.schemas.v2025r0.userreferencev2025r0.UserReferenceV2025R0;
import java.util.Arrays;
import org.junit.jupiter.api.Test;

public class ExternalUsersITest {

private static final BoxClient client = getDefaultClientWithUserSubject(getEnvVar("USER_ID"));

@Test
public void testSubmitJobToDeleteExternalUsers() {
FileFull file = uploadNewFile();
Collaboration fileCollaboration =
client
.getUserCollaborations()
.createCollaboration(
new CreateCollaborationRequestBody(
new CreateCollaborationRequestBodyItemField.Builder()
.type(CreateCollaborationRequestBodyItemTypeField.FILE)
.id(file.getId())
.build(),
new CreateCollaborationRequestBodyAccessibleByField.Builder(
CreateCollaborationRequestBodyAccessibleByTypeField.USER)
.id(getEnvVar("BOX_EXTERNAL_USER_ID"))
.build(),
CreateCollaborationRequestBodyRoleField.EDITOR));
ExternalUsersSubmitDeleteJobResponseV2025R0 externalUsersJobDeleteResponse =
client
.getExternalUsers()
.submitJobToDeleteExternalUsersV2025R0(
new ExternalUsersSubmitDeleteJobRequestV2025R0(
Arrays.asList(new UserReferenceV2025R0(getEnvVar("BOX_EXTERNAL_USER_ID")))));
assert externalUsersJobDeleteResponse.getEntries().size() == 1;
assert externalUsersJobDeleteResponse.getEntries().get(0).getStatus() == 202;
client.getFiles().deleteFileById(file.getId());
}
}