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

box / box-java-sdk-gen / #139

27 May 2025 02:07PM UTC coverage: 35.529% (+0.2%) from 35.312%
#139

Pull #316

github

web-flow
Merge 4b1c927d5 into 7ea98521c
Pull Request #316: docs: legal holds param update (box/box-openapi#526)

38 of 77 new or added lines in 15 files covered. (49.35%)

9 existing lines in 7 files now uncovered.

15585 of 43866 relevant lines covered (35.53%)

0.36 hits per line

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

91.26
/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(DocgenManagerBuilder builder) {
1✔
33
    this.auth = builder.auth;
1✔
34
    this.networkSession = builder.networkSession;
1✔
35
  }
1✔
36

37
  public DocGenJobV2025R0 getDocgenJobByIdV2025R0(String jobId) {
38
    return getDocgenJobByIdV2025R0(jobId, new GetDocgenJobByIdV2025R0Headers());
1✔
39
  }
40

41
  public DocGenJobV2025R0 getDocgenJobByIdV2025R0(
42
      String jobId, GetDocgenJobByIdV2025R0Headers headers) {
43
    Map<String, String> headersMap =
1✔
44
        prepareParams(
1✔
45
            mergeMaps(
1✔
46
                mapOf(entryOf("box-version", convertToString(headers.getBoxVersion()))),
1✔
47
                headers.getExtraHeaders()));
1✔
48
    FetchResponse response =
1✔
49
        this.networkSession
50
            .getNetworkClient()
1✔
51
            .fetch(
1✔
52
                new FetchOptions.FetchOptionsBuilder(
53
                        String.join(
1✔
54
                            "",
55
                            this.networkSession.getBaseUrls().getBaseUrl(),
1✔
56
                            "/2.0/docgen_jobs/",
57
                            convertToString(jobId)),
1✔
58
                        "GET")
59
                    .headers(headersMap)
1✔
60
                    .responseFormat(ResponseFormat.JSON)
1✔
61
                    .auth(this.auth)
1✔
62
                    .networkSession(this.networkSession)
1✔
63
                    .build());
1✔
64
    return JsonManager.deserialize(response.getData(), DocGenJobV2025R0.class);
1✔
65
  }
66

67
  public DocGenJobsFullV2025R0 getDocgenJobsV2025R0() {
UNCOV
68
    return getDocgenJobsV2025R0(
×
69
        new GetDocgenJobsV2025R0QueryParams(), new GetDocgenJobsV2025R0Headers());
70
  }
71

72
  public DocGenJobsFullV2025R0 getDocgenJobsV2025R0(GetDocgenJobsV2025R0QueryParams queryParams) {
73
    return getDocgenJobsV2025R0(queryParams, new GetDocgenJobsV2025R0Headers());
1✔
74
  }
75

76
  public DocGenJobsFullV2025R0 getDocgenJobsV2025R0(GetDocgenJobsV2025R0Headers headers) {
77
    return getDocgenJobsV2025R0(new GetDocgenJobsV2025R0QueryParams(), headers);
×
78
  }
79

80
  public DocGenJobsFullV2025R0 getDocgenJobsV2025R0(
81
      GetDocgenJobsV2025R0QueryParams queryParams, GetDocgenJobsV2025R0Headers headers) {
82
    Map<String, String> queryParamsMap =
1✔
83
        prepareParams(
1✔
84
            mapOf(
1✔
85
                entryOf("marker", convertToString(queryParams.getMarker())),
1✔
86
                entryOf("limit", convertToString(queryParams.getLimit()))));
1✔
87
    Map<String, String> headersMap =
1✔
88
        prepareParams(
1✔
89
            mergeMaps(
1✔
90
                mapOf(entryOf("box-version", convertToString(headers.getBoxVersion()))),
1✔
91
                headers.getExtraHeaders()));
1✔
92
    FetchResponse response =
1✔
93
        this.networkSession
94
            .getNetworkClient()
1✔
95
            .fetch(
1✔
96
                new FetchOptions.FetchOptionsBuilder(
97
                        String.join(
1✔
98
                            "", this.networkSession.getBaseUrls().getBaseUrl(), "/2.0/docgen_jobs"),
1✔
99
                        "GET")
100
                    .params(queryParamsMap)
1✔
101
                    .headers(headersMap)
1✔
102
                    .responseFormat(ResponseFormat.JSON)
1✔
103
                    .auth(this.auth)
1✔
104
                    .networkSession(this.networkSession)
1✔
105
                    .build());
1✔
106
    return JsonManager.deserialize(response.getData(), DocGenJobsFullV2025R0.class);
1✔
107
  }
108

109
  public DocGenJobsV2025R0 getDocgenBatchJobByIdV2025R0(String batchId) {
110
    return getDocgenBatchJobByIdV2025R0(
1✔
111
        batchId,
112
        new GetDocgenBatchJobByIdV2025R0QueryParams(),
113
        new GetDocgenBatchJobByIdV2025R0Headers());
114
  }
115

116
  public DocGenJobsV2025R0 getDocgenBatchJobByIdV2025R0(
117
      String batchId, GetDocgenBatchJobByIdV2025R0QueryParams queryParams) {
118
    return getDocgenBatchJobByIdV2025R0(
×
119
        batchId, queryParams, new GetDocgenBatchJobByIdV2025R0Headers());
120
  }
121

122
  public DocGenJobsV2025R0 getDocgenBatchJobByIdV2025R0(
123
      String batchId, GetDocgenBatchJobByIdV2025R0Headers headers) {
124
    return getDocgenBatchJobByIdV2025R0(
×
125
        batchId, new GetDocgenBatchJobByIdV2025R0QueryParams(), headers);
126
  }
127

128
  public DocGenJobsV2025R0 getDocgenBatchJobByIdV2025R0(
129
      String batchId,
130
      GetDocgenBatchJobByIdV2025R0QueryParams queryParams,
131
      GetDocgenBatchJobByIdV2025R0Headers headers) {
132
    Map<String, String> queryParamsMap =
1✔
133
        prepareParams(
1✔
134
            mapOf(
1✔
135
                entryOf("marker", convertToString(queryParams.getMarker())),
1✔
136
                entryOf("limit", convertToString(queryParams.getLimit()))));
1✔
137
    Map<String, String> headersMap =
1✔
138
        prepareParams(
1✔
139
            mergeMaps(
1✔
140
                mapOf(entryOf("box-version", convertToString(headers.getBoxVersion()))),
1✔
141
                headers.getExtraHeaders()));
1✔
142
    FetchResponse response =
1✔
143
        this.networkSession
144
            .getNetworkClient()
1✔
145
            .fetch(
1✔
146
                new FetchOptions.FetchOptionsBuilder(
147
                        String.join(
1✔
148
                            "",
149
                            this.networkSession.getBaseUrls().getBaseUrl(),
1✔
150
                            "/2.0/docgen_batch_jobs/",
151
                            convertToString(batchId)),
1✔
152
                        "GET")
153
                    .params(queryParamsMap)
1✔
154
                    .headers(headersMap)
1✔
155
                    .responseFormat(ResponseFormat.JSON)
1✔
156
                    .auth(this.auth)
1✔
157
                    .networkSession(this.networkSession)
1✔
158
                    .build());
1✔
159
    return JsonManager.deserialize(response.getData(), DocGenJobsV2025R0.class);
1✔
160
  }
161

162
  public DocGenBatchBaseV2025R0 createDocgenBatchV2025R0(
163
      DocGenBatchCreateRequestV2025R0 requestBody) {
164
    return createDocgenBatchV2025R0(requestBody, new CreateDocgenBatchV2025R0Headers());
1✔
165
  }
166

167
  public DocGenBatchBaseV2025R0 createDocgenBatchV2025R0(
168
      DocGenBatchCreateRequestV2025R0 requestBody, CreateDocgenBatchV2025R0Headers headers) {
169
    Map<String, String> headersMap =
1✔
170
        prepareParams(
1✔
171
            mergeMaps(
1✔
172
                mapOf(entryOf("box-version", convertToString(headers.getBoxVersion()))),
1✔
173
                headers.getExtraHeaders()));
1✔
174
    FetchResponse response =
1✔
175
        this.networkSession
176
            .getNetworkClient()
1✔
177
            .fetch(
1✔
178
                new FetchOptions.FetchOptionsBuilder(
179
                        String.join(
1✔
180
                            "",
181
                            this.networkSession.getBaseUrls().getBaseUrl(),
1✔
182
                            "/2.0/docgen_batches"),
183
                        "POST")
184
                    .headers(headersMap)
1✔
185
                    .data(JsonManager.serialize(requestBody))
1✔
186
                    .contentType("application/json")
1✔
187
                    .responseFormat(ResponseFormat.JSON)
1✔
188
                    .auth(this.auth)
1✔
189
                    .networkSession(this.networkSession)
1✔
190
                    .build());
1✔
191
    return JsonManager.deserialize(response.getData(), DocGenBatchBaseV2025R0.class);
1✔
192
  }
193

194
  public Authentication getAuth() {
195
    return auth;
×
196
  }
197

198
  public NetworkSession getNetworkSession() {
199
    return networkSession;
×
200
  }
201

202
  public static class DocgenManagerBuilder {
1✔
203

204
    protected Authentication auth;
205

206
    protected NetworkSession networkSession;
207

208
    public DocgenManagerBuilder auth(Authentication auth) {
209
      this.auth = auth;
1✔
210
      return this;
1✔
211
    }
212

213
    public DocgenManagerBuilder networkSession(NetworkSession networkSession) {
214
      this.networkSession = networkSession;
1✔
215
      return this;
1✔
216
    }
217

218
    public DocgenManager build() {
219
      return new DocgenManager(this);
1✔
220
    }
221
  }
222
}
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