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

box / box-java-sdk / #6244

10 Feb 2026 05:27PM UTC coverage: 40.749% (+22.6%) from 18.192%
#6244

push

github

web-flow
fix(boxsdkgen): Move assigning default values from builder constructor to `build()` method (box/box-codegen#922) (#1712)

0 of 1677 new or added lines in 569 files covered. (0.0%)

2146 existing lines in 544 files now uncovered.

7382 of 18116 relevant lines covered (40.75%)

0.46 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/docgen/DocgenManager.java
1
package com.box.sdkgen.managers.docgen;
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.v2025r0.docgenbatchbasev2025r0.DocGenBatchBaseV2025R0;
15
import com.box.sdkgen.schemas.v2025r0.docgenbatchcreaterequestv2025r0.DocGenBatchCreateRequestV2025R0;
16
import com.box.sdkgen.schemas.v2025r0.docgenjobsfullv2025r0.DocGenJobsFullV2025R0;
17
import com.box.sdkgen.schemas.v2025r0.docgenjobsv2025r0.DocGenJobsV2025R0;
18
import com.box.sdkgen.schemas.v2025r0.docgenjobv2025r0.DocGenJobV2025R0;
19
import com.box.sdkgen.serialization.json.JsonManager;
20
import java.util.Map;
21

22
public class DocgenManager {
23

24
  public Authentication auth;
25

26
  public NetworkSession networkSession;
27

28
  public DocgenManager() {
×
29
    this.networkSession = new NetworkSession();
×
30
  }
×
31

32
  protected DocgenManager(Builder builder) {
×
33
    this.auth = builder.auth;
×
34
    this.networkSession = builder.networkSession;
×
35
  }
×
36

37
  /**
38
   * Get details of the Box Doc Gen job.
39
   *
40
   * @param jobId Box Doc Gen job ID. Example: 123
41
   */
42
  public DocGenJobV2025R0 getDocgenJobByIdV2025R0(String jobId) {
43
    return getDocgenJobByIdV2025R0(jobId, new GetDocgenJobByIdV2025R0Headers());
×
44
  }
45

46
  /**
47
   * Get details of the Box Doc Gen job.
48
   *
49
   * @param jobId Box Doc Gen job ID. Example: 123
50
   * @param headers Headers of getDocgenJobByIdV2025R0 method
51
   */
52
  public DocGenJobV2025R0 getDocgenJobByIdV2025R0(
53
      String jobId, GetDocgenJobByIdV2025R0Headers headers) {
54
    Map<String, String> headersMap =
×
55
        prepareParams(
×
56
            mergeMaps(
×
57
                mapOf(entryOf("box-version", convertToString(headers.getBoxVersion()))),
×
58
                headers.getExtraHeaders()));
×
59
    FetchResponse response =
×
60
        this.networkSession
61
            .getNetworkClient()
×
62
            .fetch(
×
63
                new FetchOptions.Builder(
64
                        String.join(
×
65
                            "",
66
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
67
                            "/2.0/docgen_jobs/",
68
                            convertToString(jobId)),
×
69
                        "GET")
70
                    .headers(headersMap)
×
71
                    .responseFormat(ResponseFormat.JSON)
×
72
                    .auth(this.auth)
×
73
                    .networkSession(this.networkSession)
×
74
                    .build());
×
75
    return JsonManager.deserialize(response.getData(), DocGenJobV2025R0.class);
×
76
  }
77

78
  /** Lists all Box Doc Gen jobs for a user. */
79
  public DocGenJobsFullV2025R0 getDocgenJobsV2025R0() {
80
    return getDocgenJobsV2025R0(
×
81
        new GetDocgenJobsV2025R0QueryParams(), new GetDocgenJobsV2025R0Headers());
82
  }
83

84
  /**
85
   * Lists all Box Doc Gen jobs for a user.
86
   *
87
   * @param queryParams Query parameters of getDocgenJobsV2025R0 method
88
   */
89
  public DocGenJobsFullV2025R0 getDocgenJobsV2025R0(GetDocgenJobsV2025R0QueryParams queryParams) {
90
    return getDocgenJobsV2025R0(queryParams, new GetDocgenJobsV2025R0Headers());
×
91
  }
92

93
  /**
94
   * Lists all Box Doc Gen jobs for a user.
95
   *
96
   * @param headers Headers of getDocgenJobsV2025R0 method
97
   */
98
  public DocGenJobsFullV2025R0 getDocgenJobsV2025R0(GetDocgenJobsV2025R0Headers headers) {
99
    return getDocgenJobsV2025R0(new GetDocgenJobsV2025R0QueryParams(), headers);
×
100
  }
101

102
  /**
103
   * Lists all Box Doc Gen jobs for a user.
104
   *
105
   * @param queryParams Query parameters of getDocgenJobsV2025R0 method
106
   * @param headers Headers of getDocgenJobsV2025R0 method
107
   */
108
  public DocGenJobsFullV2025R0 getDocgenJobsV2025R0(
109
      GetDocgenJobsV2025R0QueryParams queryParams, GetDocgenJobsV2025R0Headers headers) {
110
    Map<String, String> queryParamsMap =
×
111
        prepareParams(
×
112
            mapOf(
×
113
                entryOf("marker", convertToString(queryParams.getMarker())),
×
114
                entryOf("limit", convertToString(queryParams.getLimit()))));
×
115
    Map<String, String> headersMap =
×
116
        prepareParams(
×
117
            mergeMaps(
×
118
                mapOf(entryOf("box-version", convertToString(headers.getBoxVersion()))),
×
119
                headers.getExtraHeaders()));
×
120
    FetchResponse response =
×
121
        this.networkSession
122
            .getNetworkClient()
×
123
            .fetch(
×
124
                new FetchOptions.Builder(
125
                        String.join(
×
126
                            "", this.networkSession.getBaseUrls().getBaseUrl(), "/2.0/docgen_jobs"),
×
127
                        "GET")
128
                    .params(queryParamsMap)
×
129
                    .headers(headersMap)
×
130
                    .responseFormat(ResponseFormat.JSON)
×
131
                    .auth(this.auth)
×
132
                    .networkSession(this.networkSession)
×
133
                    .build());
×
134
    return JsonManager.deserialize(response.getData(), DocGenJobsFullV2025R0.class);
×
135
  }
136

137
  /**
138
   * Lists Box Doc Gen jobs in a batch.
139
   *
140
   * @param batchId Box Doc Gen batch ID. Example: 123
141
   */
142
  public DocGenJobsV2025R0 getDocgenBatchJobByIdV2025R0(String batchId) {
143
    return getDocgenBatchJobByIdV2025R0(
×
144
        batchId,
145
        new GetDocgenBatchJobByIdV2025R0QueryParams(),
146
        new GetDocgenBatchJobByIdV2025R0Headers());
147
  }
148

149
  /**
150
   * Lists Box Doc Gen jobs in a batch.
151
   *
152
   * @param batchId Box Doc Gen batch ID. Example: 123
153
   * @param queryParams Query parameters of getDocgenBatchJobByIdV2025R0 method
154
   */
155
  public DocGenJobsV2025R0 getDocgenBatchJobByIdV2025R0(
156
      String batchId, GetDocgenBatchJobByIdV2025R0QueryParams queryParams) {
157
    return getDocgenBatchJobByIdV2025R0(
×
158
        batchId, queryParams, new GetDocgenBatchJobByIdV2025R0Headers());
159
  }
160

161
  /**
162
   * Lists Box Doc Gen jobs in a batch.
163
   *
164
   * @param batchId Box Doc Gen batch ID. Example: 123
165
   * @param headers Headers of getDocgenBatchJobByIdV2025R0 method
166
   */
167
  public DocGenJobsV2025R0 getDocgenBatchJobByIdV2025R0(
168
      String batchId, GetDocgenBatchJobByIdV2025R0Headers headers) {
169
    return getDocgenBatchJobByIdV2025R0(
×
170
        batchId, new GetDocgenBatchJobByIdV2025R0QueryParams(), headers);
171
  }
172

173
  /**
174
   * Lists Box Doc Gen jobs in a batch.
175
   *
176
   * @param batchId Box Doc Gen batch ID. Example: 123
177
   * @param queryParams Query parameters of getDocgenBatchJobByIdV2025R0 method
178
   * @param headers Headers of getDocgenBatchJobByIdV2025R0 method
179
   */
180
  public DocGenJobsV2025R0 getDocgenBatchJobByIdV2025R0(
181
      String batchId,
182
      GetDocgenBatchJobByIdV2025R0QueryParams queryParams,
183
      GetDocgenBatchJobByIdV2025R0Headers headers) {
184
    Map<String, String> queryParamsMap =
×
185
        prepareParams(
×
186
            mapOf(
×
187
                entryOf("marker", convertToString(queryParams.getMarker())),
×
188
                entryOf("limit", convertToString(queryParams.getLimit()))));
×
189
    Map<String, String> headersMap =
×
190
        prepareParams(
×
191
            mergeMaps(
×
192
                mapOf(entryOf("box-version", convertToString(headers.getBoxVersion()))),
×
193
                headers.getExtraHeaders()));
×
194
    FetchResponse response =
×
195
        this.networkSession
196
            .getNetworkClient()
×
197
            .fetch(
×
198
                new FetchOptions.Builder(
199
                        String.join(
×
200
                            "",
201
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
202
                            "/2.0/docgen_batch_jobs/",
203
                            convertToString(batchId)),
×
204
                        "GET")
205
                    .params(queryParamsMap)
×
206
                    .headers(headersMap)
×
207
                    .responseFormat(ResponseFormat.JSON)
×
208
                    .auth(this.auth)
×
209
                    .networkSession(this.networkSession)
×
210
                    .build());
×
211
    return JsonManager.deserialize(response.getData(), DocGenJobsV2025R0.class);
×
212
  }
213

214
  /**
215
   * Generates a document using a Box Doc Gen template.
216
   *
217
   * @param requestBody Request body of createDocgenBatchV2025R0 method
218
   */
219
  public DocGenBatchBaseV2025R0 createDocgenBatchV2025R0(
220
      DocGenBatchCreateRequestV2025R0 requestBody) {
221
    return createDocgenBatchV2025R0(requestBody, new CreateDocgenBatchV2025R0Headers());
×
222
  }
223

224
  /**
225
   * Generates a document using a Box Doc Gen template.
226
   *
227
   * @param requestBody Request body of createDocgenBatchV2025R0 method
228
   * @param headers Headers of createDocgenBatchV2025R0 method
229
   */
230
  public DocGenBatchBaseV2025R0 createDocgenBatchV2025R0(
231
      DocGenBatchCreateRequestV2025R0 requestBody, CreateDocgenBatchV2025R0Headers headers) {
232
    Map<String, String> headersMap =
×
233
        prepareParams(
×
234
            mergeMaps(
×
235
                mapOf(entryOf("box-version", convertToString(headers.getBoxVersion()))),
×
236
                headers.getExtraHeaders()));
×
237
    FetchResponse response =
×
238
        this.networkSession
239
            .getNetworkClient()
×
240
            .fetch(
×
241
                new FetchOptions.Builder(
242
                        String.join(
×
243
                            "",
244
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
245
                            "/2.0/docgen_batches"),
246
                        "POST")
247
                    .headers(headersMap)
×
248
                    .data(JsonManager.serialize(requestBody))
×
249
                    .contentType("application/json")
×
250
                    .responseFormat(ResponseFormat.JSON)
×
251
                    .auth(this.auth)
×
252
                    .networkSession(this.networkSession)
×
253
                    .build());
×
254
    return JsonManager.deserialize(response.getData(), DocGenBatchBaseV2025R0.class);
×
255
  }
256

257
  public Authentication getAuth() {
258
    return auth;
×
259
  }
260

261
  public NetworkSession getNetworkSession() {
262
    return networkSession;
×
263
  }
264

265
  public static class Builder {
266

267
    protected Authentication auth;
268

269
    protected NetworkSession networkSession;
270

NEW
271
    public Builder() {}
×
272

273
    public Builder auth(Authentication auth) {
UNCOV
274
      this.auth = auth;
×
UNCOV
275
      return this;
×
276
    }
277

278
    public Builder networkSession(NetworkSession networkSession) {
UNCOV
279
      this.networkSession = networkSession;
×
UNCOV
280
      return this;
×
281
    }
282

283
    public DocgenManager build() {
NEW
284
      if (this.networkSession == null) {
×
NEW
285
        this.networkSession = new NetworkSession();
×
286
      }
287
      return new DocgenManager(this);
×
288
    }
289
  }
290
}
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