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

box / box-java-sdk / #6244

10 Feb 2026 05:27PM UTC coverage: 40.749% (+22.6%) from 18.192%
#6244

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

2146 existing lines in 544 files now uncovered.

7382 of 18116 relevant lines covered (40.75%)

0.46 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/skills/SkillsManager.java
1
package com.box.sdkgen.managers.skills;
2

3
import static com.box.sdkgen.internal.utils.UtilsManager.convertToString;
4
import static com.box.sdkgen.internal.utils.UtilsManager.mapOf;
5
import static com.box.sdkgen.internal.utils.UtilsManager.mergeMaps;
6
import static com.box.sdkgen.internal.utils.UtilsManager.prepareParams;
7

8
import com.box.sdkgen.networking.auth.Authentication;
9
import com.box.sdkgen.networking.fetchoptions.FetchOptions;
10
import com.box.sdkgen.networking.fetchoptions.ResponseFormat;
11
import com.box.sdkgen.networking.fetchresponse.FetchResponse;
12
import com.box.sdkgen.networking.network.NetworkSession;
13
import com.box.sdkgen.schemas.skillcardsmetadata.SkillCardsMetadata;
14
import com.box.sdkgen.serialization.json.JsonManager;
15
import java.util.List;
16
import java.util.Map;
17

18
public class SkillsManager {
19

20
  public Authentication auth;
21

22
  public NetworkSession networkSession;
23

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

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

33
  /**
34
   * List the Box Skills metadata cards that are attached to a file.
35
   *
36
   * @param fileId The unique identifier that represents a file.
37
   *     <p>The ID for any file can be determined by visiting a file in the web application and
38
   *     copying the ID from the URL. For example, for the URL `https://*.app.box.com/files/123` the
39
   *     `file_id` is `123`. Example: "12345"
40
   */
41
  public SkillCardsMetadata getBoxSkillCardsOnFile(String fileId) {
42
    return getBoxSkillCardsOnFile(fileId, new GetBoxSkillCardsOnFileHeaders());
×
43
  }
44

45
  /**
46
   * List the Box Skills metadata cards that are attached to a file.
47
   *
48
   * @param fileId The unique identifier that represents a file.
49
   *     <p>The ID for any file can be determined by visiting a file in the web application and
50
   *     copying the ID from the URL. For example, for the URL `https://*.app.box.com/files/123` the
51
   *     `file_id` is `123`. Example: "12345"
52
   * @param headers Headers of getBoxSkillCardsOnFile method
53
   */
54
  public SkillCardsMetadata getBoxSkillCardsOnFile(
55
      String fileId, GetBoxSkillCardsOnFileHeaders headers) {
56
    Map<String, String> headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
×
57
    FetchResponse response =
×
58
        this.networkSession
59
            .getNetworkClient()
×
60
            .fetch(
×
61
                new FetchOptions.Builder(
62
                        String.join(
×
63
                            "",
64
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
65
                            "/2.0/files/",
66
                            convertToString(fileId),
×
67
                            "/metadata/global/boxSkillsCards"),
68
                        "GET")
69
                    .headers(headersMap)
×
70
                    .responseFormat(ResponseFormat.JSON)
×
71
                    .auth(this.auth)
×
72
                    .networkSession(this.networkSession)
×
73
                    .build());
×
74
    return JsonManager.deserialize(response.getData(), SkillCardsMetadata.class);
×
75
  }
76

77
  /**
78
   * Applies one or more Box Skills metadata cards to a file.
79
   *
80
   * @param fileId The unique identifier that represents a file.
81
   *     <p>The ID for any file can be determined by visiting a file in the web application and
82
   *     copying the ID from the URL. For example, for the URL `https://*.app.box.com/files/123` the
83
   *     `file_id` is `123`. Example: "12345"
84
   * @param requestBody Request body of createBoxSkillCardsOnFile method
85
   */
86
  public SkillCardsMetadata createBoxSkillCardsOnFile(
87
      String fileId, CreateBoxSkillCardsOnFileRequestBody requestBody) {
88
    return createBoxSkillCardsOnFile(fileId, requestBody, new CreateBoxSkillCardsOnFileHeaders());
×
89
  }
90

91
  /**
92
   * Applies one or more Box Skills metadata cards to a file.
93
   *
94
   * @param fileId The unique identifier that represents a file.
95
   *     <p>The ID for any file can be determined by visiting a file in the web application and
96
   *     copying the ID from the URL. For example, for the URL `https://*.app.box.com/files/123` the
97
   *     `file_id` is `123`. Example: "12345"
98
   * @param requestBody Request body of createBoxSkillCardsOnFile method
99
   * @param headers Headers of createBoxSkillCardsOnFile method
100
   */
101
  public SkillCardsMetadata createBoxSkillCardsOnFile(
102
      String fileId,
103
      CreateBoxSkillCardsOnFileRequestBody requestBody,
104
      CreateBoxSkillCardsOnFileHeaders headers) {
105
    Map<String, String> headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
×
106
    FetchResponse response =
×
107
        this.networkSession
108
            .getNetworkClient()
×
109
            .fetch(
×
110
                new FetchOptions.Builder(
111
                        String.join(
×
112
                            "",
113
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
114
                            "/2.0/files/",
115
                            convertToString(fileId),
×
116
                            "/metadata/global/boxSkillsCards"),
117
                        "POST")
118
                    .headers(headersMap)
×
119
                    .data(JsonManager.serialize(requestBody))
×
120
                    .contentType("application/json")
×
121
                    .responseFormat(ResponseFormat.JSON)
×
122
                    .auth(this.auth)
×
123
                    .networkSession(this.networkSession)
×
124
                    .build());
×
125
    return JsonManager.deserialize(response.getData(), SkillCardsMetadata.class);
×
126
  }
127

128
  /**
129
   * Updates one or more Box Skills metadata cards to a file.
130
   *
131
   * @param fileId The unique identifier that represents a file.
132
   *     <p>The ID for any file can be determined by visiting a file in the web application and
133
   *     copying the ID from the URL. For example, for the URL `https://*.app.box.com/files/123` the
134
   *     `file_id` is `123`. Example: "12345"
135
   * @param requestBody Request body of updateBoxSkillCardsOnFile method
136
   */
137
  public SkillCardsMetadata updateBoxSkillCardsOnFile(
138
      String fileId, List<UpdateBoxSkillCardsOnFileRequestBody> requestBody) {
139
    return updateBoxSkillCardsOnFile(fileId, requestBody, new UpdateBoxSkillCardsOnFileHeaders());
×
140
  }
141

142
  /**
143
   * Updates one or more Box Skills metadata cards to a file.
144
   *
145
   * @param fileId The unique identifier that represents a file.
146
   *     <p>The ID for any file can be determined by visiting a file in the web application and
147
   *     copying the ID from the URL. For example, for the URL `https://*.app.box.com/files/123` the
148
   *     `file_id` is `123`. Example: "12345"
149
   * @param requestBody Request body of updateBoxSkillCardsOnFile method
150
   * @param headers Headers of updateBoxSkillCardsOnFile method
151
   */
152
  public SkillCardsMetadata updateBoxSkillCardsOnFile(
153
      String fileId,
154
      List<UpdateBoxSkillCardsOnFileRequestBody> requestBody,
155
      UpdateBoxSkillCardsOnFileHeaders headers) {
156
    Map<String, String> headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
×
157
    FetchResponse response =
×
158
        this.networkSession
159
            .getNetworkClient()
×
160
            .fetch(
×
161
                new FetchOptions.Builder(
162
                        String.join(
×
163
                            "",
164
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
165
                            "/2.0/files/",
166
                            convertToString(fileId),
×
167
                            "/metadata/global/boxSkillsCards"),
168
                        "PUT")
169
                    .headers(headersMap)
×
170
                    .data(JsonManager.serialize(requestBody))
×
171
                    .contentType("application/json-patch+json")
×
172
                    .responseFormat(ResponseFormat.JSON)
×
173
                    .auth(this.auth)
×
174
                    .networkSession(this.networkSession)
×
175
                    .build());
×
176
    return JsonManager.deserialize(response.getData(), SkillCardsMetadata.class);
×
177
  }
178

179
  /**
180
   * Removes any Box Skills cards metadata from a file.
181
   *
182
   * @param fileId The unique identifier that represents a file.
183
   *     <p>The ID for any file can be determined by visiting a file in the web application and
184
   *     copying the ID from the URL. For example, for the URL `https://*.app.box.com/files/123` the
185
   *     `file_id` is `123`. Example: "12345"
186
   */
187
  public void deleteBoxSkillCardsFromFile(String fileId) {
188
    deleteBoxSkillCardsFromFile(fileId, new DeleteBoxSkillCardsFromFileHeaders());
×
189
  }
×
190

191
  /**
192
   * Removes any Box Skills cards metadata from a file.
193
   *
194
   * @param fileId The unique identifier that represents a file.
195
   *     <p>The ID for any file can be determined by visiting a file in the web application and
196
   *     copying the ID from the URL. For example, for the URL `https://*.app.box.com/files/123` the
197
   *     `file_id` is `123`. Example: "12345"
198
   * @param headers Headers of deleteBoxSkillCardsFromFile method
199
   */
200
  public void deleteBoxSkillCardsFromFile(
201
      String fileId, DeleteBoxSkillCardsFromFileHeaders headers) {
202
    Map<String, String> headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
×
203
    FetchResponse response =
×
204
        this.networkSession
205
            .getNetworkClient()
×
206
            .fetch(
×
207
                new FetchOptions.Builder(
208
                        String.join(
×
209
                            "",
210
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
211
                            "/2.0/files/",
212
                            convertToString(fileId),
×
213
                            "/metadata/global/boxSkillsCards"),
214
                        "DELETE")
215
                    .headers(headersMap)
×
216
                    .responseFormat(ResponseFormat.NO_CONTENT)
×
217
                    .auth(this.auth)
×
218
                    .networkSession(this.networkSession)
×
219
                    .build());
×
220
  }
×
221

222
  /**
223
   * An alternative method that can be used to overwrite and update all Box Skill metadata cards on
224
   * a file.
225
   *
226
   * @param skillId The ID of the skill to apply this metadata for. Example: "33243242"
227
   * @param requestBody Request body of updateAllSkillCardsOnFile method
228
   */
229
  public void updateAllSkillCardsOnFile(
230
      String skillId, UpdateAllSkillCardsOnFileRequestBody requestBody) {
231
    updateAllSkillCardsOnFile(skillId, requestBody, new UpdateAllSkillCardsOnFileHeaders());
×
232
  }
×
233

234
  /**
235
   * An alternative method that can be used to overwrite and update all Box Skill metadata cards on
236
   * a file.
237
   *
238
   * @param skillId The ID of the skill to apply this metadata for. Example: "33243242"
239
   * @param requestBody Request body of updateAllSkillCardsOnFile method
240
   * @param headers Headers of updateAllSkillCardsOnFile method
241
   */
242
  public void updateAllSkillCardsOnFile(
243
      String skillId,
244
      UpdateAllSkillCardsOnFileRequestBody requestBody,
245
      UpdateAllSkillCardsOnFileHeaders headers) {
246
    Map<String, String> headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
×
247
    FetchResponse response =
×
248
        this.networkSession
249
            .getNetworkClient()
×
250
            .fetch(
×
251
                new FetchOptions.Builder(
252
                        String.join(
×
253
                            "",
254
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
255
                            "/2.0/skill_invocations/",
256
                            convertToString(skillId)),
×
257
                        "PUT")
258
                    .headers(headersMap)
×
259
                    .data(JsonManager.serialize(requestBody))
×
260
                    .contentType("application/json")
×
261
                    .responseFormat(ResponseFormat.NO_CONTENT)
×
262
                    .auth(this.auth)
×
263
                    .networkSession(this.networkSession)
×
264
                    .build());
×
265
  }
×
266

267
  public Authentication getAuth() {
268
    return auth;
×
269
  }
270

271
  public NetworkSession getNetworkSession() {
272
    return networkSession;
×
273
  }
274

275
  public static class Builder {
276

277
    protected Authentication auth;
278

279
    protected NetworkSession networkSession;
280

NEW
281
    public Builder() {}
×
282

283
    public Builder auth(Authentication auth) {
UNCOV
284
      this.auth = auth;
×
UNCOV
285
      return this;
×
286
    }
287

288
    public Builder networkSession(NetworkSession networkSession) {
UNCOV
289
      this.networkSession = networkSession;
×
UNCOV
290
      return this;
×
291
    }
292

293
    public SkillsManager build() {
NEW
294
      if (this.networkSession == null) {
×
NEW
295
        this.networkSession = new NetworkSession();
×
296
      }
297
      return new SkillsManager(this);
×
298
    }
299
  }
300
}
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