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

box / box-java-sdk / #6241

10 Feb 2026 05:27PM UTC coverage: 24.324% (+11.5%) from 12.84%
#6241

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%)

2130 existing lines in 537 files now uncovered.

7388 of 30373 relevant lines covered (24.32%)

0.28 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/archives/ArchivesManager.java
1
package com.box.sdkgen.managers.archives;
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.archivesv2025r0.ArchivesV2025R0;
15
import com.box.sdkgen.schemas.v2025r0.archivev2025r0.ArchiveV2025R0;
16
import com.box.sdkgen.serialization.json.JsonManager;
17
import java.util.Map;
18

19
public class ArchivesManager {
20

21
  public Authentication auth;
22

23
  public NetworkSession networkSession;
24

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

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

34
  /**
35
   * Retrieves archives for an enterprise.
36
   *
37
   * <p>To learn more about the archive APIs, see the [Archive API
38
   * Guide](https://developer.box.com/guides/archives).
39
   */
40
  public ArchivesV2025R0 getArchivesV2025R0() {
41
    return getArchivesV2025R0(new GetArchivesV2025R0QueryParams(), new GetArchivesV2025R0Headers());
×
42
  }
43

44
  /**
45
   * Retrieves archives for an enterprise.
46
   *
47
   * <p>To learn more about the archive APIs, see the [Archive API
48
   * Guide](https://developer.box.com/guides/archives).
49
   *
50
   * @param queryParams Query parameters of getArchivesV2025R0 method
51
   */
52
  public ArchivesV2025R0 getArchivesV2025R0(GetArchivesV2025R0QueryParams queryParams) {
53
    return getArchivesV2025R0(queryParams, new GetArchivesV2025R0Headers());
×
54
  }
55

56
  /**
57
   * Retrieves archives for an enterprise.
58
   *
59
   * <p>To learn more about the archive APIs, see the [Archive API
60
   * Guide](https://developer.box.com/guides/archives).
61
   *
62
   * @param headers Headers of getArchivesV2025R0 method
63
   */
64
  public ArchivesV2025R0 getArchivesV2025R0(GetArchivesV2025R0Headers headers) {
65
    return getArchivesV2025R0(new GetArchivesV2025R0QueryParams(), headers);
×
66
  }
67

68
  /**
69
   * Retrieves archives for an enterprise.
70
   *
71
   * <p>To learn more about the archive APIs, see the [Archive API
72
   * Guide](https://developer.box.com/guides/archives).
73
   *
74
   * @param queryParams Query parameters of getArchivesV2025R0 method
75
   * @param headers Headers of getArchivesV2025R0 method
76
   */
77
  public ArchivesV2025R0 getArchivesV2025R0(
78
      GetArchivesV2025R0QueryParams queryParams, GetArchivesV2025R0Headers headers) {
79
    Map<String, String> queryParamsMap =
×
80
        prepareParams(
×
81
            mapOf(
×
82
                entryOf("limit", convertToString(queryParams.getLimit())),
×
83
                entryOf("marker", convertToString(queryParams.getMarker()))));
×
84
    Map<String, String> headersMap =
×
85
        prepareParams(
×
86
            mergeMaps(
×
87
                mapOf(entryOf("box-version", convertToString(headers.getBoxVersion()))),
×
88
                headers.getExtraHeaders()));
×
89
    FetchResponse response =
×
90
        this.networkSession
91
            .getNetworkClient()
×
92
            .fetch(
×
93
                new FetchOptions.Builder(
94
                        String.join(
×
95
                            "", this.networkSession.getBaseUrls().getBaseUrl(), "/2.0/archives"),
×
96
                        "GET")
97
                    .params(queryParamsMap)
×
98
                    .headers(headersMap)
×
99
                    .responseFormat(ResponseFormat.JSON)
×
100
                    .auth(this.auth)
×
101
                    .networkSession(this.networkSession)
×
102
                    .build());
×
103
    return JsonManager.deserialize(response.getData(), ArchivesV2025R0.class);
×
104
  }
105

106
  /**
107
   * Creates an archive.
108
   *
109
   * <p>To learn more about the archive APIs, see the [Archive API
110
   * Guide](https://developer.box.com/guides/archives).
111
   *
112
   * @param requestBody Request body of createArchiveV2025R0 method
113
   */
114
  public ArchiveV2025R0 createArchiveV2025R0(CreateArchiveV2025R0RequestBody requestBody) {
115
    return createArchiveV2025R0(requestBody, new CreateArchiveV2025R0Headers());
×
116
  }
117

118
  /**
119
   * Creates an archive.
120
   *
121
   * <p>To learn more about the archive APIs, see the [Archive API
122
   * Guide](https://developer.box.com/guides/archives).
123
   *
124
   * @param requestBody Request body of createArchiveV2025R0 method
125
   * @param headers Headers of createArchiveV2025R0 method
126
   */
127
  public ArchiveV2025R0 createArchiveV2025R0(
128
      CreateArchiveV2025R0RequestBody requestBody, CreateArchiveV2025R0Headers headers) {
129
    Map<String, String> headersMap =
×
130
        prepareParams(
×
131
            mergeMaps(
×
132
                mapOf(entryOf("box-version", convertToString(headers.getBoxVersion()))),
×
133
                headers.getExtraHeaders()));
×
134
    FetchResponse response =
×
135
        this.networkSession
136
            .getNetworkClient()
×
137
            .fetch(
×
138
                new FetchOptions.Builder(
139
                        String.join(
×
140
                            "", this.networkSession.getBaseUrls().getBaseUrl(), "/2.0/archives"),
×
141
                        "POST")
142
                    .headers(headersMap)
×
143
                    .data(JsonManager.serialize(requestBody))
×
144
                    .contentType("application/json")
×
145
                    .responseFormat(ResponseFormat.JSON)
×
146
                    .auth(this.auth)
×
147
                    .networkSession(this.networkSession)
×
148
                    .build());
×
149
    return JsonManager.deserialize(response.getData(), ArchiveV2025R0.class);
×
150
  }
151

152
  /**
153
   * Permanently deletes an archive.
154
   *
155
   * <p>To learn more about the archive APIs, see the [Archive API
156
   * Guide](https://developer.box.com/guides/archives).
157
   *
158
   * @param archiveId The ID of the archive. Example: "982312"
159
   */
160
  public void deleteArchiveByIdV2025R0(String archiveId) {
161
    deleteArchiveByIdV2025R0(archiveId, new DeleteArchiveByIdV2025R0Headers());
×
162
  }
×
163

164
  /**
165
   * Permanently deletes an archive.
166
   *
167
   * <p>To learn more about the archive APIs, see the [Archive API
168
   * Guide](https://developer.box.com/guides/archives).
169
   *
170
   * @param archiveId The ID of the archive. Example: "982312"
171
   * @param headers Headers of deleteArchiveByIdV2025R0 method
172
   */
173
  public void deleteArchiveByIdV2025R0(String archiveId, DeleteArchiveByIdV2025R0Headers headers) {
174
    Map<String, String> headersMap =
×
175
        prepareParams(
×
176
            mergeMaps(
×
177
                mapOf(entryOf("box-version", convertToString(headers.getBoxVersion()))),
×
178
                headers.getExtraHeaders()));
×
179
    FetchResponse response =
×
180
        this.networkSession
181
            .getNetworkClient()
×
182
            .fetch(
×
183
                new FetchOptions.Builder(
184
                        String.join(
×
185
                            "",
186
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
187
                            "/2.0/archives/",
188
                            convertToString(archiveId)),
×
189
                        "DELETE")
190
                    .headers(headersMap)
×
191
                    .responseFormat(ResponseFormat.NO_CONTENT)
×
192
                    .auth(this.auth)
×
193
                    .networkSession(this.networkSession)
×
194
                    .build());
×
195
  }
×
196

197
  /**
198
   * Updates an archive.
199
   *
200
   * <p>To learn more about the archive APIs, see the [Archive API
201
   * Guide](https://developer.box.com/guides/archives).
202
   *
203
   * @param archiveId The ID of the archive. Example: "982312"
204
   */
205
  public ArchiveV2025R0 updateArchiveByIdV2025R0(String archiveId) {
206
    return updateArchiveByIdV2025R0(
×
207
        archiveId,
208
        new UpdateArchiveByIdV2025R0RequestBody(),
209
        new UpdateArchiveByIdV2025R0Headers());
210
  }
211

212
  /**
213
   * Updates an archive.
214
   *
215
   * <p>To learn more about the archive APIs, see the [Archive API
216
   * Guide](https://developer.box.com/guides/archives).
217
   *
218
   * @param archiveId The ID of the archive. Example: "982312"
219
   * @param requestBody Request body of updateArchiveByIdV2025R0 method
220
   */
221
  public ArchiveV2025R0 updateArchiveByIdV2025R0(
222
      String archiveId, UpdateArchiveByIdV2025R0RequestBody requestBody) {
223
    return updateArchiveByIdV2025R0(archiveId, requestBody, new UpdateArchiveByIdV2025R0Headers());
×
224
  }
225

226
  /**
227
   * Updates an archive.
228
   *
229
   * <p>To learn more about the archive APIs, see the [Archive API
230
   * Guide](https://developer.box.com/guides/archives).
231
   *
232
   * @param archiveId The ID of the archive. Example: "982312"
233
   * @param headers Headers of updateArchiveByIdV2025R0 method
234
   */
235
  public ArchiveV2025R0 updateArchiveByIdV2025R0(
236
      String archiveId, UpdateArchiveByIdV2025R0Headers headers) {
237
    return updateArchiveByIdV2025R0(archiveId, new UpdateArchiveByIdV2025R0RequestBody(), headers);
×
238
  }
239

240
  /**
241
   * Updates an archive.
242
   *
243
   * <p>To learn more about the archive APIs, see the [Archive API
244
   * Guide](https://developer.box.com/guides/archives).
245
   *
246
   * @param archiveId The ID of the archive. Example: "982312"
247
   * @param requestBody Request body of updateArchiveByIdV2025R0 method
248
   * @param headers Headers of updateArchiveByIdV2025R0 method
249
   */
250
  public ArchiveV2025R0 updateArchiveByIdV2025R0(
251
      String archiveId,
252
      UpdateArchiveByIdV2025R0RequestBody requestBody,
253
      UpdateArchiveByIdV2025R0Headers headers) {
254
    Map<String, String> headersMap =
×
255
        prepareParams(
×
256
            mergeMaps(
×
257
                mapOf(entryOf("box-version", convertToString(headers.getBoxVersion()))),
×
258
                headers.getExtraHeaders()));
×
259
    FetchResponse response =
×
260
        this.networkSession
261
            .getNetworkClient()
×
262
            .fetch(
×
263
                new FetchOptions.Builder(
264
                        String.join(
×
265
                            "",
266
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
267
                            "/2.0/archives/",
268
                            convertToString(archiveId)),
×
269
                        "PUT")
270
                    .headers(headersMap)
×
271
                    .data(JsonManager.serialize(requestBody))
×
272
                    .contentType("application/json")
×
273
                    .responseFormat(ResponseFormat.JSON)
×
274
                    .auth(this.auth)
×
275
                    .networkSession(this.networkSession)
×
276
                    .build());
×
277
    return JsonManager.deserialize(response.getData(), ArchiveV2025R0.class);
×
278
  }
279

280
  public Authentication getAuth() {
281
    return auth;
×
282
  }
283

284
  public NetworkSession getNetworkSession() {
285
    return networkSession;
×
286
  }
287

288
  public static class Builder {
289

290
    protected Authentication auth;
291

292
    protected NetworkSession networkSession;
293

NEW
294
    public Builder() {}
×
295

296
    public Builder auth(Authentication auth) {
UNCOV
297
      this.auth = auth;
×
UNCOV
298
      return this;
×
299
    }
300

301
    public Builder networkSession(NetworkSession networkSession) {
UNCOV
302
      this.networkSession = networkSession;
×
UNCOV
303
      return this;
×
304
    }
305

306
    public ArchivesManager build() {
NEW
307
      if (this.networkSession == null) {
×
NEW
308
        this.networkSession = new NetworkSession();
×
309
      }
310
      return new ArchivesManager(this);
×
311
    }
312
  }
313
}
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