• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

box / box-java-sdk / #6786

29 Apr 2026 03:28PM UTC coverage: 12.53% (-0.1%) from 12.64%
#6786

Pull #1814

github

web-flow
Merge 5bd0d2fb5 into cf0d67fa2
Pull Request #1814: test(boxsdkgen): Add tests for automate api (box/box-codegen#943)

0 of 542 new or added lines in 19 files covered. (0.0%)

18 existing lines in 9 files now uncovered.

8368 of 66786 relevant lines covered (12.53%)

0.13 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/main/java/com/box/sdkgen/managers/automateworkflows/AutomateWorkflowsManager.java
1
package com.box.sdkgen.managers.automateworkflows;
2

3
import static com.box.sdkgen.internal.utils.UtilsManager.convertToString;
4
import static com.box.sdkgen.internal.utils.UtilsManager.entryOf;
5
import static com.box.sdkgen.internal.utils.UtilsManager.mapOf;
6
import static com.box.sdkgen.internal.utils.UtilsManager.mergeMaps;
7
import static com.box.sdkgen.internal.utils.UtilsManager.prepareParams;
8

9
import com.box.sdkgen.networking.auth.Authentication;
10
import com.box.sdkgen.networking.fetchoptions.FetchOptions;
11
import com.box.sdkgen.networking.fetchoptions.ResponseFormat;
12
import com.box.sdkgen.networking.fetchresponse.FetchResponse;
13
import com.box.sdkgen.networking.network.NetworkSession;
14
import com.box.sdkgen.schemas.v2026r0.automateworkflowstartrequestv2026r0.AutomateWorkflowStartRequestV2026R0;
15
import com.box.sdkgen.schemas.v2026r0.automateworkflowsv2026r0.AutomateWorkflowsV2026R0;
16
import com.box.sdkgen.serialization.json.JsonManager;
17
import java.util.Map;
18

19
public class AutomateWorkflowsManager {
20

21
  public Authentication auth;
22

23
  public NetworkSession networkSession;
24

NEW
25
  public AutomateWorkflowsManager() {
×
NEW
26
    this.networkSession = new NetworkSession();
×
NEW
27
  }
×
28

NEW
29
  protected AutomateWorkflowsManager(Builder builder) {
×
NEW
30
    this.auth = builder.auth;
×
NEW
31
    this.networkSession = builder.networkSession;
×
NEW
32
  }
×
33

34
  /**
35
   * Returns workflow actions from Automate for a folder, using the `WORKFLOW` action category.
36
   *
37
   * @param queryParams Query parameters of getAutomateWorkflowsV2026R0 method
38
   */
39
  public AutomateWorkflowsV2026R0 getAutomateWorkflowsV2026R0(
40
      GetAutomateWorkflowsV2026R0QueryParams queryParams) {
NEW
41
    return getAutomateWorkflowsV2026R0(queryParams, new GetAutomateWorkflowsV2026R0Headers());
×
42
  }
43

44
  /**
45
   * Returns workflow actions from Automate for a folder, using the `WORKFLOW` action category.
46
   *
47
   * @param queryParams Query parameters of getAutomateWorkflowsV2026R0 method
48
   * @param headers Headers of getAutomateWorkflowsV2026R0 method
49
   */
50
  public AutomateWorkflowsV2026R0 getAutomateWorkflowsV2026R0(
51
      GetAutomateWorkflowsV2026R0QueryParams queryParams,
52
      GetAutomateWorkflowsV2026R0Headers headers) {
NEW
53
    Map<String, String> queryParamsMap =
×
NEW
54
        prepareParams(
×
NEW
55
            mapOf(
×
NEW
56
                entryOf("folder_id", convertToString(queryParams.getFolderId())),
×
NEW
57
                entryOf("limit", convertToString(queryParams.getLimit())),
×
NEW
58
                entryOf("marker", convertToString(queryParams.getMarker()))));
×
NEW
59
    Map<String, String> headersMap =
×
NEW
60
        prepareParams(
×
NEW
61
            mergeMaps(
×
NEW
62
                mapOf(entryOf("box-version", convertToString(headers.getBoxVersion()))),
×
NEW
63
                headers.getExtraHeaders()));
×
NEW
64
    FetchResponse response =
×
65
        this.networkSession
NEW
66
            .getNetworkClient()
×
NEW
67
            .fetch(
×
68
                new FetchOptions.Builder(
NEW
69
                        String.join(
×
70
                            "",
NEW
71
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
72
                            "/2.0/automate_workflows"),
73
                        "GET")
NEW
74
                    .params(queryParamsMap)
×
NEW
75
                    .headers(headersMap)
×
NEW
76
                    .responseFormat(ResponseFormat.JSON)
×
NEW
77
                    .auth(this.auth)
×
NEW
78
                    .networkSession(this.networkSession)
×
NEW
79
                    .build());
×
NEW
80
    return JsonManager.deserialize(response.getData(), AutomateWorkflowsV2026R0.class);
×
81
  }
82

83
  /**
84
   * Starts an Automate workflow manually by using a workflow action ID and file IDs.
85
   *
86
   * @param workflowId The ID of the workflow. Example: "12345"
87
   * @param requestBody Request body of createAutomateWorkflowStartV2026R0 method
88
   */
89
  public void createAutomateWorkflowStartV2026R0(
90
      String workflowId, AutomateWorkflowStartRequestV2026R0 requestBody) {
NEW
91
    createAutomateWorkflowStartV2026R0(
×
92
        workflowId, requestBody, new CreateAutomateWorkflowStartV2026R0Headers());
NEW
93
  }
×
94

95
  /**
96
   * Starts an Automate workflow manually by using a workflow action ID and file IDs.
97
   *
98
   * @param workflowId The ID of the workflow. Example: "12345"
99
   * @param requestBody Request body of createAutomateWorkflowStartV2026R0 method
100
   * @param headers Headers of createAutomateWorkflowStartV2026R0 method
101
   */
102
  public void createAutomateWorkflowStartV2026R0(
103
      String workflowId,
104
      AutomateWorkflowStartRequestV2026R0 requestBody,
105
      CreateAutomateWorkflowStartV2026R0Headers headers) {
NEW
106
    Map<String, String> headersMap =
×
NEW
107
        prepareParams(
×
NEW
108
            mergeMaps(
×
NEW
109
                mapOf(entryOf("box-version", convertToString(headers.getBoxVersion()))),
×
NEW
110
                headers.getExtraHeaders()));
×
NEW
111
    FetchResponse response =
×
112
        this.networkSession
NEW
113
            .getNetworkClient()
×
NEW
114
            .fetch(
×
115
                new FetchOptions.Builder(
NEW
116
                        String.join(
×
117
                            "",
NEW
118
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
119
                            "/2.0/automate_workflows/",
NEW
120
                            convertToString(workflowId),
×
121
                            "/start"),
122
                        "POST")
NEW
123
                    .headers(headersMap)
×
NEW
124
                    .data(JsonManager.serialize(requestBody))
×
NEW
125
                    .contentType("application/json")
×
NEW
126
                    .responseFormat(ResponseFormat.NO_CONTENT)
×
NEW
127
                    .auth(this.auth)
×
NEW
128
                    .networkSession(this.networkSession)
×
NEW
129
                    .build());
×
NEW
130
  }
×
131

132
  public Authentication getAuth() {
NEW
133
    return auth;
×
134
  }
135

136
  public NetworkSession getNetworkSession() {
NEW
137
    return networkSession;
×
138
  }
139

140
  public static class Builder {
141

142
    protected Authentication auth;
143

144
    protected NetworkSession networkSession;
145

NEW
146
    public Builder() {}
×
147

148
    public Builder auth(Authentication auth) {
NEW
149
      this.auth = auth;
×
NEW
150
      return this;
×
151
    }
152

153
    public Builder networkSession(NetworkSession networkSession) {
NEW
154
      this.networkSession = networkSession;
×
NEW
155
      return this;
×
156
    }
157

158
    public AutomateWorkflowsManager build() {
NEW
159
      if (this.networkSession == null) {
×
NEW
160
        this.networkSession = new NetworkSession();
×
161
      }
NEW
162
      return new AutomateWorkflowsManager(this);
×
163
    }
164
  }
165
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc