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

box / box-java-sdk-gen / #541

05 Sep 2025 02:31PM UTC coverage: 7.451% (-29.2%) from 36.66%
#541

push

other

web-flow
chore: release version 0.8.1 (#437)

1 of 1 new or added line in 1 file covered. (100.0%)

14652 existing lines in 1191 files now uncovered.

3737 of 50151 relevant lines covered (7.45%)

0.07 hits per line

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

7.95
/src/main/java/com/box/sdkgen/managers/docgentemplate/DocgenTemplateManager.java
1
package com.box.sdkgen.managers.docgentemplate;
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.docgenjobsv2025r0.DocGenJobsV2025R0;
15
import com.box.sdkgen.schemas.v2025r0.docgentagsv2025r0.DocGenTagsV2025R0;
16
import com.box.sdkgen.schemas.v2025r0.docgentemplatebasev2025r0.DocGenTemplateBaseV2025R0;
17
import com.box.sdkgen.schemas.v2025r0.docgentemplatecreaterequestv2025r0.DocGenTemplateCreateRequestV2025R0;
18
import com.box.sdkgen.schemas.v2025r0.docgentemplatesv2025r0.DocGenTemplatesV2025R0;
19
import com.box.sdkgen.schemas.v2025r0.docgentemplatev2025r0.DocGenTemplateV2025R0;
20
import com.box.sdkgen.serialization.json.JsonManager;
21
import java.util.Map;
22

23
public class DocgenTemplateManager {
24

25
  public Authentication auth;
26

27
  public NetworkSession networkSession;
28

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

33
  protected DocgenTemplateManager(Builder builder) {
1✔
34
    this.auth = builder.auth;
1✔
35
    this.networkSession = builder.networkSession;
1✔
36
  }
1✔
37

38
  public DocGenTemplateBaseV2025R0 createDocgenTemplateV2025R0(
39
      DocGenTemplateCreateRequestV2025R0 requestBody) {
UNCOV
40
    return createDocgenTemplateV2025R0(requestBody, new CreateDocgenTemplateV2025R0Headers());
×
41
  }
42

43
  public DocGenTemplateBaseV2025R0 createDocgenTemplateV2025R0(
44
      DocGenTemplateCreateRequestV2025R0 requestBody, CreateDocgenTemplateV2025R0Headers headers) {
UNCOV
45
    Map<String, String> headersMap =
×
UNCOV
46
        prepareParams(
×
UNCOV
47
            mergeMaps(
×
UNCOV
48
                mapOf(entryOf("box-version", convertToString(headers.getBoxVersion()))),
×
UNCOV
49
                headers.getExtraHeaders()));
×
UNCOV
50
    FetchResponse response =
×
51
        this.networkSession
UNCOV
52
            .getNetworkClient()
×
UNCOV
53
            .fetch(
×
54
                new FetchOptions.Builder(
UNCOV
55
                        String.join(
×
56
                            "",
UNCOV
57
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
58
                            "/2.0/docgen_templates"),
59
                        "POST")
UNCOV
60
                    .headers(headersMap)
×
UNCOV
61
                    .data(JsonManager.serialize(requestBody))
×
UNCOV
62
                    .contentType("application/json")
×
UNCOV
63
                    .responseFormat(ResponseFormat.JSON)
×
UNCOV
64
                    .auth(this.auth)
×
UNCOV
65
                    .networkSession(this.networkSession)
×
UNCOV
66
                    .build());
×
UNCOV
67
    return JsonManager.deserialize(response.getData(), DocGenTemplateBaseV2025R0.class);
×
68
  }
69

70
  public DocGenTemplatesV2025R0 getDocgenTemplatesV2025R0() {
UNCOV
71
    return getDocgenTemplatesV2025R0(
×
72
        new GetDocgenTemplatesV2025R0QueryParams(), new GetDocgenTemplatesV2025R0Headers());
73
  }
74

75
  public DocGenTemplatesV2025R0 getDocgenTemplatesV2025R0(
76
      GetDocgenTemplatesV2025R0QueryParams queryParams) {
77
    return getDocgenTemplatesV2025R0(queryParams, new GetDocgenTemplatesV2025R0Headers());
×
78
  }
79

80
  public DocGenTemplatesV2025R0 getDocgenTemplatesV2025R0(
81
      GetDocgenTemplatesV2025R0Headers headers) {
82
    return getDocgenTemplatesV2025R0(new GetDocgenTemplatesV2025R0QueryParams(), headers);
×
83
  }
84

85
  public DocGenTemplatesV2025R0 getDocgenTemplatesV2025R0(
86
      GetDocgenTemplatesV2025R0QueryParams queryParams, GetDocgenTemplatesV2025R0Headers headers) {
UNCOV
87
    Map<String, String> queryParamsMap =
×
UNCOV
88
        prepareParams(
×
UNCOV
89
            mapOf(
×
UNCOV
90
                entryOf("marker", convertToString(queryParams.getMarker())),
×
UNCOV
91
                entryOf("limit", convertToString(queryParams.getLimit()))));
×
UNCOV
92
    Map<String, String> headersMap =
×
UNCOV
93
        prepareParams(
×
UNCOV
94
            mergeMaps(
×
UNCOV
95
                mapOf(entryOf("box-version", convertToString(headers.getBoxVersion()))),
×
UNCOV
96
                headers.getExtraHeaders()));
×
UNCOV
97
    FetchResponse response =
×
98
        this.networkSession
UNCOV
99
            .getNetworkClient()
×
UNCOV
100
            .fetch(
×
101
                new FetchOptions.Builder(
UNCOV
102
                        String.join(
×
103
                            "",
UNCOV
104
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
105
                            "/2.0/docgen_templates"),
106
                        "GET")
UNCOV
107
                    .params(queryParamsMap)
×
UNCOV
108
                    .headers(headersMap)
×
UNCOV
109
                    .responseFormat(ResponseFormat.JSON)
×
UNCOV
110
                    .auth(this.auth)
×
UNCOV
111
                    .networkSession(this.networkSession)
×
UNCOV
112
                    .build());
×
UNCOV
113
    return JsonManager.deserialize(response.getData(), DocGenTemplatesV2025R0.class);
×
114
  }
115

116
  public void deleteDocgenTemplateByIdV2025R0(String templateId) {
UNCOV
117
    deleteDocgenTemplateByIdV2025R0(templateId, new DeleteDocgenTemplateByIdV2025R0Headers());
×
UNCOV
118
  }
×
119

120
  public void deleteDocgenTemplateByIdV2025R0(
121
      String templateId, DeleteDocgenTemplateByIdV2025R0Headers headers) {
UNCOV
122
    Map<String, String> headersMap =
×
UNCOV
123
        prepareParams(
×
UNCOV
124
            mergeMaps(
×
UNCOV
125
                mapOf(entryOf("box-version", convertToString(headers.getBoxVersion()))),
×
UNCOV
126
                headers.getExtraHeaders()));
×
UNCOV
127
    FetchResponse response =
×
128
        this.networkSession
UNCOV
129
            .getNetworkClient()
×
UNCOV
130
            .fetch(
×
131
                new FetchOptions.Builder(
UNCOV
132
                        String.join(
×
133
                            "",
UNCOV
134
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
135
                            "/2.0/docgen_templates/",
UNCOV
136
                            convertToString(templateId)),
×
137
                        "DELETE")
UNCOV
138
                    .headers(headersMap)
×
UNCOV
139
                    .responseFormat(ResponseFormat.NO_CONTENT)
×
UNCOV
140
                    .auth(this.auth)
×
UNCOV
141
                    .networkSession(this.networkSession)
×
UNCOV
142
                    .build());
×
UNCOV
143
  }
×
144

145
  public DocGenTemplateV2025R0 getDocgenTemplateByIdV2025R0(String templateId) {
UNCOV
146
    return getDocgenTemplateByIdV2025R0(templateId, new GetDocgenTemplateByIdV2025R0Headers());
×
147
  }
148

149
  public DocGenTemplateV2025R0 getDocgenTemplateByIdV2025R0(
150
      String templateId, GetDocgenTemplateByIdV2025R0Headers headers) {
UNCOV
151
    Map<String, String> headersMap =
×
UNCOV
152
        prepareParams(
×
UNCOV
153
            mergeMaps(
×
UNCOV
154
                mapOf(entryOf("box-version", convertToString(headers.getBoxVersion()))),
×
UNCOV
155
                headers.getExtraHeaders()));
×
UNCOV
156
    FetchResponse response =
×
157
        this.networkSession
UNCOV
158
            .getNetworkClient()
×
UNCOV
159
            .fetch(
×
160
                new FetchOptions.Builder(
UNCOV
161
                        String.join(
×
162
                            "",
UNCOV
163
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
164
                            "/2.0/docgen_templates/",
UNCOV
165
                            convertToString(templateId)),
×
166
                        "GET")
UNCOV
167
                    .headers(headersMap)
×
UNCOV
168
                    .responseFormat(ResponseFormat.JSON)
×
UNCOV
169
                    .auth(this.auth)
×
UNCOV
170
                    .networkSession(this.networkSession)
×
UNCOV
171
                    .build());
×
UNCOV
172
    return JsonManager.deserialize(response.getData(), DocGenTemplateV2025R0.class);
×
173
  }
174

175
  public DocGenTagsV2025R0 getDocgenTemplateTagsV2025R0(String templateId) {
UNCOV
176
    return getDocgenTemplateTagsV2025R0(
×
177
        templateId,
178
        new GetDocgenTemplateTagsV2025R0QueryParams(),
179
        new GetDocgenTemplateTagsV2025R0Headers());
180
  }
181

182
  public DocGenTagsV2025R0 getDocgenTemplateTagsV2025R0(
183
      String templateId, GetDocgenTemplateTagsV2025R0QueryParams queryParams) {
184
    return getDocgenTemplateTagsV2025R0(
×
185
        templateId, queryParams, new GetDocgenTemplateTagsV2025R0Headers());
186
  }
187

188
  public DocGenTagsV2025R0 getDocgenTemplateTagsV2025R0(
189
      String templateId, GetDocgenTemplateTagsV2025R0Headers headers) {
190
    return getDocgenTemplateTagsV2025R0(
×
191
        templateId, new GetDocgenTemplateTagsV2025R0QueryParams(), headers);
192
  }
193

194
  public DocGenTagsV2025R0 getDocgenTemplateTagsV2025R0(
195
      String templateId,
196
      GetDocgenTemplateTagsV2025R0QueryParams queryParams,
197
      GetDocgenTemplateTagsV2025R0Headers headers) {
UNCOV
198
    Map<String, String> queryParamsMap =
×
UNCOV
199
        prepareParams(
×
UNCOV
200
            mapOf(
×
UNCOV
201
                entryOf("template_version_id", convertToString(queryParams.getTemplateVersionId())),
×
UNCOV
202
                entryOf("marker", convertToString(queryParams.getMarker())),
×
UNCOV
203
                entryOf("limit", convertToString(queryParams.getLimit()))));
×
UNCOV
204
    Map<String, String> headersMap =
×
UNCOV
205
        prepareParams(
×
UNCOV
206
            mergeMaps(
×
UNCOV
207
                mapOf(entryOf("box-version", convertToString(headers.getBoxVersion()))),
×
UNCOV
208
                headers.getExtraHeaders()));
×
UNCOV
209
    FetchResponse response =
×
210
        this.networkSession
UNCOV
211
            .getNetworkClient()
×
UNCOV
212
            .fetch(
×
213
                new FetchOptions.Builder(
UNCOV
214
                        String.join(
×
215
                            "",
UNCOV
216
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
217
                            "/2.0/docgen_templates/",
UNCOV
218
                            convertToString(templateId),
×
219
                            "/tags"),
220
                        "GET")
UNCOV
221
                    .params(queryParamsMap)
×
UNCOV
222
                    .headers(headersMap)
×
UNCOV
223
                    .responseFormat(ResponseFormat.JSON)
×
UNCOV
224
                    .auth(this.auth)
×
UNCOV
225
                    .networkSession(this.networkSession)
×
UNCOV
226
                    .build());
×
UNCOV
227
    return JsonManager.deserialize(response.getData(), DocGenTagsV2025R0.class);
×
228
  }
229

230
  public DocGenJobsV2025R0 getDocgenTemplateJobByIdV2025R0(String templateId) {
UNCOV
231
    return getDocgenTemplateJobByIdV2025R0(
×
232
        templateId,
233
        new GetDocgenTemplateJobByIdV2025R0QueryParams(),
234
        new GetDocgenTemplateJobByIdV2025R0Headers());
235
  }
236

237
  public DocGenJobsV2025R0 getDocgenTemplateJobByIdV2025R0(
238
      String templateId, GetDocgenTemplateJobByIdV2025R0QueryParams queryParams) {
239
    return getDocgenTemplateJobByIdV2025R0(
×
240
        templateId, queryParams, new GetDocgenTemplateJobByIdV2025R0Headers());
241
  }
242

243
  public DocGenJobsV2025R0 getDocgenTemplateJobByIdV2025R0(
244
      String templateId, GetDocgenTemplateJobByIdV2025R0Headers headers) {
245
    return getDocgenTemplateJobByIdV2025R0(
×
246
        templateId, new GetDocgenTemplateJobByIdV2025R0QueryParams(), headers);
247
  }
248

249
  public DocGenJobsV2025R0 getDocgenTemplateJobByIdV2025R0(
250
      String templateId,
251
      GetDocgenTemplateJobByIdV2025R0QueryParams queryParams,
252
      GetDocgenTemplateJobByIdV2025R0Headers headers) {
UNCOV
253
    Map<String, String> queryParamsMap =
×
UNCOV
254
        prepareParams(
×
UNCOV
255
            mapOf(
×
UNCOV
256
                entryOf("marker", convertToString(queryParams.getMarker())),
×
UNCOV
257
                entryOf("limit", convertToString(queryParams.getLimit()))));
×
UNCOV
258
    Map<String, String> headersMap =
×
UNCOV
259
        prepareParams(
×
UNCOV
260
            mergeMaps(
×
UNCOV
261
                mapOf(entryOf("box-version", convertToString(headers.getBoxVersion()))),
×
UNCOV
262
                headers.getExtraHeaders()));
×
UNCOV
263
    FetchResponse response =
×
264
        this.networkSession
UNCOV
265
            .getNetworkClient()
×
UNCOV
266
            .fetch(
×
267
                new FetchOptions.Builder(
UNCOV
268
                        String.join(
×
269
                            "",
UNCOV
270
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
271
                            "/2.0/docgen_template_jobs/",
UNCOV
272
                            convertToString(templateId)),
×
273
                        "GET")
UNCOV
274
                    .params(queryParamsMap)
×
UNCOV
275
                    .headers(headersMap)
×
UNCOV
276
                    .responseFormat(ResponseFormat.JSON)
×
UNCOV
277
                    .auth(this.auth)
×
UNCOV
278
                    .networkSession(this.networkSession)
×
UNCOV
279
                    .build());
×
UNCOV
280
    return JsonManager.deserialize(response.getData(), DocGenJobsV2025R0.class);
×
281
  }
282

283
  public Authentication getAuth() {
284
    return auth;
×
285
  }
286

287
  public NetworkSession getNetworkSession() {
288
    return networkSession;
×
289
  }
290

291
  public static class Builder {
292

293
    protected Authentication auth;
294

295
    protected NetworkSession networkSession;
296

297
    public Builder() {
1✔
298
      this.networkSession = new NetworkSession();
1✔
299
    }
1✔
300

301
    public Builder auth(Authentication auth) {
302
      this.auth = auth;
1✔
303
      return this;
1✔
304
    }
305

306
    public Builder networkSession(NetworkSession networkSession) {
307
      this.networkSession = networkSession;
1✔
308
      return this;
1✔
309
    }
310

311
    public DocgenTemplateManager build() {
312
      return new DocgenTemplateManager(this);
1✔
313
    }
314
  }
315
}
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