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

box / box-java-sdk / #5922

17 Dec 2025 05:03PM UTC coverage: 35.498% (-0.4%) from 35.917%
#5922

push

github

web-flow
fix: add taxonomy to Metadata Field (read) definition (box/box-openapi#572) (#1644)

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

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

535 existing lines in 31 files now uncovered.

18926 of 53316 relevant lines covered (35.5%)

0.35 hits per line

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

91.18
/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() {
UNCOV
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) {
UNCOV
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
   * @param archiveId The ID of the archive. Example: "982312"
159
   */
160
  public void deleteArchiveByIdV2025R0(String archiveId) {
161
    deleteArchiveByIdV2025R0(archiveId, new DeleteArchiveByIdV2025R0Headers());
1✔
162
  }
1✔
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 =
1✔
175
        prepareParams(
1✔
176
            mergeMaps(
1✔
177
                mapOf(entryOf("box-version", convertToString(headers.getBoxVersion()))),
1✔
178
                headers.getExtraHeaders()));
1✔
179
    FetchResponse response =
1✔
180
        this.networkSession
181
            .getNetworkClient()
1✔
182
            .fetch(
1✔
183
                new FetchOptions.Builder(
184
                        String.join(
1✔
185
                            "",
186
                            this.networkSession.getBaseUrls().getBaseUrl(),
1✔
187
                            "/2.0/archives/",
188
                            convertToString(archiveId)),
1✔
189
                        "DELETE")
190
                    .headers(headersMap)
1✔
191
                    .responseFormat(ResponseFormat.NO_CONTENT)
1✔
192
                    .auth(this.auth)
1✔
193
                    .networkSession(this.networkSession)
1✔
194
                    .build());
1✔
195
  }
1✔
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) {
UNCOV
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());
1✔
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) {
UNCOV
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 =
1✔
255
        prepareParams(
1✔
256
            mergeMaps(
1✔
257
                mapOf(entryOf("box-version", convertToString(headers.getBoxVersion()))),
1✔
258
                headers.getExtraHeaders()));
1✔
259
    FetchResponse response =
1✔
260
        this.networkSession
261
            .getNetworkClient()
1✔
262
            .fetch(
1✔
263
                new FetchOptions.Builder(
264
                        String.join(
1✔
265
                            "",
266
                            this.networkSession.getBaseUrls().getBaseUrl(),
1✔
267
                            "/2.0/archives/",
268
                            convertToString(archiveId)),
1✔
269
                        "PUT")
270
                    .headers(headersMap)
1✔
271
                    .data(JsonManager.serialize(requestBody))
1✔
272
                    .contentType("application/json")
1✔
273
                    .responseFormat(ResponseFormat.JSON)
1✔
274
                    .auth(this.auth)
1✔
275
                    .networkSession(this.networkSession)
1✔
276
                    .build());
1✔
277
    return JsonManager.deserialize(response.getData(), ArchiveV2025R0.class);
1✔
278
  }
279

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

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

288
  public static class Builder {
289

290
    protected Authentication auth;
291

292
    protected NetworkSession networkSession;
293

294
    public Builder() {
1✔
295
      this.networkSession = new NetworkSession();
1✔
296
    }
1✔
297

298
    public Builder auth(Authentication auth) {
299
      this.auth = auth;
1✔
300
      return this;
1✔
301
    }
302

303
    public Builder networkSession(NetworkSession networkSession) {
304
      this.networkSession = networkSession;
1✔
305
      return this;
1✔
306
    }
307

308
    public ArchivesManager build() {
309
      return new ArchivesManager(this);
1✔
310
    }
311
  }
312
}
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

© 2025 Coveralls, Inc