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

box / box-java-sdk / #6311

27 Feb 2026 04:09PM UTC coverage: 34.848% (+0.004%) from 34.844%
#6311

push

github

web-flow
docs: Update description for delete archives endpoint (box/box-openapi#585) (#1733)

Co-authored-by: box-sdk-build <box-sdk-build@box.com>

18722 of 53725 relevant lines covered (34.85%)

0.35 hits per line

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

86.27
/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) {
1✔
30
    this.auth = builder.auth;
1✔
31
    this.networkSession = builder.networkSession;
1✔
32
  }
1✔
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());
1✔
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 =
1✔
80
        prepareParams(
1✔
81
            mapOf(
1✔
82
                entryOf("limit", convertToString(queryParams.getLimit())),
1✔
83
                entryOf("marker", convertToString(queryParams.getMarker()))));
1✔
84
    Map<String, String> headersMap =
1✔
85
        prepareParams(
1✔
86
            mergeMaps(
1✔
87
                mapOf(entryOf("box-version", convertToString(headers.getBoxVersion()))),
1✔
88
                headers.getExtraHeaders()));
1✔
89
    FetchResponse response =
1✔
90
        this.networkSession
91
            .getNetworkClient()
1✔
92
            .fetch(
1✔
93
                new FetchOptions.Builder(
94
                        String.join(
1✔
95
                            "", this.networkSession.getBaseUrls().getBaseUrl(), "/2.0/archives"),
1✔
96
                        "GET")
97
                    .params(queryParamsMap)
1✔
98
                    .headers(headersMap)
1✔
99
                    .responseFormat(ResponseFormat.JSON)
1✔
100
                    .auth(this.auth)
1✔
101
                    .networkSession(this.networkSession)
1✔
102
                    .build());
1✔
103
    return JsonManager.deserialize(response.getData(), ArchivesV2025R0.class);
1✔
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());
1✔
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 =
1✔
130
        prepareParams(
1✔
131
            mergeMaps(
1✔
132
                mapOf(entryOf("box-version", convertToString(headers.getBoxVersion()))),
1✔
133
                headers.getExtraHeaders()));
1✔
134
    FetchResponse response =
1✔
135
        this.networkSession
136
            .getNetworkClient()
1✔
137
            .fetch(
1✔
138
                new FetchOptions.Builder(
139
                        String.join(
1✔
140
                            "", this.networkSession.getBaseUrls().getBaseUrl(), "/2.0/archives"),
1✔
141
                        "POST")
142
                    .headers(headersMap)
1✔
143
                    .data(JsonManager.serialize(requestBody))
1✔
144
                    .contentType("application/json")
1✔
145
                    .responseFormat(ResponseFormat.JSON)
1✔
146
                    .auth(this.auth)
1✔
147
                    .networkSession(this.networkSession)
1✔
148
                    .build());
1✔
149
    return JsonManager.deserialize(response.getData(), ArchiveV2025R0.class);
1✔
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
   * <p>&lt;Danger&gt; This endpoint is currently unavailable. Please contact support for
159
   * assistance. &lt;/Danger&gt;
160
   *
161
   * @param archiveId The ID of the archive. Example: "982312"
162
   */
163
  public void deleteArchiveByIdV2025R0(String archiveId) {
164
    deleteArchiveByIdV2025R0(archiveId, new DeleteArchiveByIdV2025R0Headers());
×
165
  }
×
166

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

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

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

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

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

286
  public Authentication getAuth() {
287
    return auth;
×
288
  }
289

290
  public NetworkSession getNetworkSession() {
291
    return networkSession;
×
292
  }
293

294
  public static class Builder {
295

296
    protected Authentication auth;
297

298
    protected NetworkSession networkSession;
299

300
    public Builder() {}
1✔
301

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

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

312
    public ArchivesManager build() {
313
      if (this.networkSession == null) {
1✔
314
        this.networkSession = new NetworkSession();
×
315
      }
316
      return new ArchivesManager(this);
1✔
317
    }
318
  }
319
}
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