Skip to content
Merged
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": "18868e7", "specHash": "f899bf6", "version": "10.9.0" }
{ "engineHash": "c571efa", "specHash": "f899bf6", "version": "10.9.0" }
1 change: 1 addition & 0 deletions .github/workflows/build-and-test-daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ jobs:
SLACK_AUTOMATION_USER_ID: ${{ secrets.SLACK_AUTOMATION_USER_ID }}
SLACK_ORG_ID: ${{ secrets.SLACK_ORG_ID }}
SLACK_PARTNER_ITEM_ID: ${{ secrets.SLACK_PARTNER_ITEM_ID }}
AUTOMATE_WORKFLOW_FOLDER_ID: ${{ secrets.AUTOMATE_WORKFLOW_FOLDER_ID }}
run: ./gradlew check --stacktrace
- name: Coverage
env:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ jobs:
SLACK_AUTOMATION_USER_ID: ${{ secrets.SLACK_AUTOMATION_USER_ID }}
SLACK_ORG_ID: ${{ secrets.SLACK_ORG_ID }}
SLACK_PARTNER_ITEM_ID: ${{ secrets.SLACK_PARTNER_ITEM_ID }}
AUTOMATE_WORKFLOW_FOLDER_ID: ${{ secrets.AUTOMATE_WORKFLOW_FOLDER_ID }}
run: ./gradlew check --stacktrace
- name: Smoke Tests
if: ${{ !startsWith(github.head_ref, 'codegen-release') && github.actor != 'dependabot[bot]' }}
Expand Down
10 changes: 8 additions & 2 deletions docs/automateworkflows.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ This operation is performed by calling function `getAutomateWorkflowsV2026R0`.
See the endpoint docs at
[API Reference](https://developer.box.com/reference/v2026.0/get-automate-workflows/).

*Currently we don't have an example for calling `getAutomateWorkflowsV2026R0` in integration tests*
<!-- sample get_automate_workflows_v2026.0 -->
```
adminClient.getAutomateWorkflows().getAutomateWorkflowsV2026R0(new GetAutomateWorkflowsV2026R0QueryParams(workflowFolderId))
```

### Arguments

Expand All @@ -40,7 +43,10 @@ This operation is performed by calling function `createAutomateWorkflowStartV202
See the endpoint docs at
[API Reference](https://developer.box.com/reference/v2026.0/post-automate-workflows-id-start/).

*Currently we don't have an example for calling `createAutomateWorkflowStartV2026R0` in integration tests*
<!-- sample post_automate_workflows_id_start_v2026.0 -->
```
adminClient.getAutomateWorkflows().createAutomateWorkflowStartV2026R0(workflowAction.getWorkflow().getId(), new AutomateWorkflowStartRequestV2026R0(workflowAction.getId(), Arrays.asList(workflowFileId)))
```

### Arguments

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

import static com.box.sdkgen.commons.CommonsManager.getDefaultClient;
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.generateByteStream;
import static com.box.sdkgen.internal.utils.UtilsManager.getEnvVar;
import static com.box.sdkgen.internal.utils.UtilsManager.getUuid;

import com.box.sdkgen.client.BoxClient;
import com.box.sdkgen.managers.automateworkflows.GetAutomateWorkflowsV2026R0QueryParams;
import com.box.sdkgen.managers.uploads.UploadFileRequestBody;
import com.box.sdkgen.managers.uploads.UploadFileRequestBodyAttributesField;
import com.box.sdkgen.managers.uploads.UploadFileRequestBodyAttributesParentField;
import com.box.sdkgen.schemas.filefull.FileFull;
import com.box.sdkgen.schemas.files.Files;
import com.box.sdkgen.schemas.v2026r0.automateworkflowactionv2026r0.AutomateWorkflowActionV2026R0;
import com.box.sdkgen.schemas.v2026r0.automateworkflowstartrequestv2026r0.AutomateWorkflowStartRequestV2026R0;
import com.box.sdkgen.schemas.v2026r0.automateworkflowsv2026r0.AutomateWorkflowsV2026R0;
import java.util.Arrays;
import org.junit.jupiter.api.Test;

public class AutomateWorkflowsITest {

private static final BoxClient client = getDefaultClient();

@Test
public void testAutomateWorkflows() {
BoxClient adminClient = getDefaultClientWithUserSubject(getEnvVar("USER_ID"));
String workflowFolderId = getEnvVar("AUTOMATE_WORKFLOW_FOLDER_ID");
Files uploadedFiles =
adminClient
.getUploads()
.uploadFile(
new UploadFileRequestBody(
new UploadFileRequestBodyAttributesField(
getUuid(),
new UploadFileRequestBodyAttributesParentField(workflowFolderId)),
generateByteStream(1024 * 1024)));
FileFull file = uploadedFiles.getEntries().get(0);
String workflowFileId = file.getId();
AutomateWorkflowsV2026R0 automateWorkflows =
adminClient
.getAutomateWorkflows()
.getAutomateWorkflowsV2026R0(
new GetAutomateWorkflowsV2026R0QueryParams(workflowFolderId));
assert automateWorkflows.getEntries().size() == 1;
AutomateWorkflowActionV2026R0 workflowAction = automateWorkflows.getEntries().get(0);
assert convertToString(workflowAction.getType()).equals("workflow_action");
assert convertToString(workflowAction.getActionType()).equals("run_workflow");
assert convertToString(workflowAction.getWorkflow().getType()).equals("workflow");
adminClient
.getAutomateWorkflows()
.createAutomateWorkflowStartV2026R0(
workflowAction.getWorkflow().getId(),
new AutomateWorkflowStartRequestV2026R0(
workflowAction.getId(), Arrays.asList(workflowFileId)));
}
}
Loading