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

box / box-java-sdk / #6243

10 Feb 2026 05:27PM UTC coverage: 18.192% (-17.5%) from 35.714%
#6243

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

2147 existing lines in 545 files now uncovered.

7388 of 40611 relevant lines covered (18.19%)

0.21 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/shieldlists/ShieldListsManager.java
1
package com.box.sdkgen.managers.shieldlists;
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.shieldlistscreatev2025r0.ShieldListsCreateV2025R0;
15
import com.box.sdkgen.schemas.v2025r0.shieldlistsupdatev2025r0.ShieldListsUpdateV2025R0;
16
import com.box.sdkgen.schemas.v2025r0.shieldlistsv2025r0.ShieldListsV2025R0;
17
import com.box.sdkgen.schemas.v2025r0.shieldlistv2025r0.ShieldListV2025R0;
18
import com.box.sdkgen.serialization.json.JsonManager;
19
import java.util.Map;
20

21
public class ShieldListsManager {
22

23
  public Authentication auth;
24

25
  public NetworkSession networkSession;
26

27
  public ShieldListsManager() {
×
28
    this.networkSession = new NetworkSession();
×
29
  }
×
30

31
  protected ShieldListsManager(Builder builder) {
×
32
    this.auth = builder.auth;
×
33
    this.networkSession = builder.networkSession;
×
34
  }
×
35

36
  /** Retrieves all shield lists in the enterprise. */
37
  public ShieldListsV2025R0 getShieldListsV2025R0() {
38
    return getShieldListsV2025R0(new GetShieldListsV2025R0Headers());
×
39
  }
40

41
  /**
42
   * Retrieves all shield lists in the enterprise.
43
   *
44
   * @param headers Headers of getShieldListsV2025R0 method
45
   */
46
  public ShieldListsV2025R0 getShieldListsV2025R0(GetShieldListsV2025R0Headers headers) {
47
    Map<String, String> headersMap =
×
48
        prepareParams(
×
49
            mergeMaps(
×
50
                mapOf(entryOf("box-version", convertToString(headers.getBoxVersion()))),
×
51
                headers.getExtraHeaders()));
×
52
    FetchResponse response =
×
53
        this.networkSession
54
            .getNetworkClient()
×
55
            .fetch(
×
56
                new FetchOptions.Builder(
57
                        String.join(
×
58
                            "",
59
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
60
                            "/2.0/shield_lists"),
61
                        "GET")
62
                    .headers(headersMap)
×
63
                    .responseFormat(ResponseFormat.JSON)
×
64
                    .auth(this.auth)
×
65
                    .networkSession(this.networkSession)
×
66
                    .build());
×
67
    return JsonManager.deserialize(response.getData(), ShieldListsV2025R0.class);
×
68
  }
69

70
  /**
71
   * Creates a shield list.
72
   *
73
   * @param requestBody Request body of createShieldListV2025R0 method
74
   */
75
  public ShieldListV2025R0 createShieldListV2025R0(ShieldListsCreateV2025R0 requestBody) {
76
    return createShieldListV2025R0(requestBody, new CreateShieldListV2025R0Headers());
×
77
  }
78

79
  /**
80
   * Creates a shield list.
81
   *
82
   * @param requestBody Request body of createShieldListV2025R0 method
83
   * @param headers Headers of createShieldListV2025R0 method
84
   */
85
  public ShieldListV2025R0 createShieldListV2025R0(
86
      ShieldListsCreateV2025R0 requestBody, CreateShieldListV2025R0Headers headers) {
87
    Map<String, String> headersMap =
×
88
        prepareParams(
×
89
            mergeMaps(
×
90
                mapOf(entryOf("box-version", convertToString(headers.getBoxVersion()))),
×
91
                headers.getExtraHeaders()));
×
92
    FetchResponse response =
×
93
        this.networkSession
94
            .getNetworkClient()
×
95
            .fetch(
×
96
                new FetchOptions.Builder(
97
                        String.join(
×
98
                            "",
99
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
100
                            "/2.0/shield_lists"),
101
                        "POST")
102
                    .headers(headersMap)
×
103
                    .data(JsonManager.serialize(requestBody))
×
104
                    .contentType("application/json")
×
105
                    .responseFormat(ResponseFormat.JSON)
×
106
                    .auth(this.auth)
×
107
                    .networkSession(this.networkSession)
×
108
                    .build());
×
109
    return JsonManager.deserialize(response.getData(), ShieldListV2025R0.class);
×
110
  }
111

112
  /**
113
   * Retrieves a single shield list by its ID.
114
   *
115
   * @param shieldListId The unique identifier that represents a shield list. The ID for any Shield
116
   *     List can be determined by the response from the endpoint fetching all shield lists for the
117
   *     enterprise. Example: "90fb0e17-c332-40ed-b4f9-fa8908fbbb24 "
118
   */
119
  public ShieldListV2025R0 getShieldListByIdV2025R0(String shieldListId) {
120
    return getShieldListByIdV2025R0(shieldListId, new GetShieldListByIdV2025R0Headers());
×
121
  }
122

123
  /**
124
   * Retrieves a single shield list by its ID.
125
   *
126
   * @param shieldListId The unique identifier that represents a shield list. The ID for any Shield
127
   *     List can be determined by the response from the endpoint fetching all shield lists for the
128
   *     enterprise. Example: "90fb0e17-c332-40ed-b4f9-fa8908fbbb24 "
129
   * @param headers Headers of getShieldListByIdV2025R0 method
130
   */
131
  public ShieldListV2025R0 getShieldListByIdV2025R0(
132
      String shieldListId, GetShieldListByIdV2025R0Headers headers) {
133
    Map<String, String> headersMap =
×
134
        prepareParams(
×
135
            mergeMaps(
×
136
                mapOf(entryOf("box-version", convertToString(headers.getBoxVersion()))),
×
137
                headers.getExtraHeaders()));
×
138
    FetchResponse response =
×
139
        this.networkSession
140
            .getNetworkClient()
×
141
            .fetch(
×
142
                new FetchOptions.Builder(
143
                        String.join(
×
144
                            "",
145
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
146
                            "/2.0/shield_lists/",
147
                            convertToString(shieldListId)),
×
148
                        "GET")
149
                    .headers(headersMap)
×
150
                    .responseFormat(ResponseFormat.JSON)
×
151
                    .auth(this.auth)
×
152
                    .networkSession(this.networkSession)
×
153
                    .build());
×
154
    return JsonManager.deserialize(response.getData(), ShieldListV2025R0.class);
×
155
  }
156

157
  /**
158
   * Delete a single shield list by its ID.
159
   *
160
   * @param shieldListId The unique identifier that represents a shield list. The ID for any Shield
161
   *     List can be determined by the response from the endpoint fetching all shield lists for the
162
   *     enterprise. Example: "90fb0e17-c332-40ed-b4f9-fa8908fbbb24 "
163
   */
164
  public void deleteShieldListByIdV2025R0(String shieldListId) {
165
    deleteShieldListByIdV2025R0(shieldListId, new DeleteShieldListByIdV2025R0Headers());
×
166
  }
×
167

168
  /**
169
   * Delete a single shield list by its ID.
170
   *
171
   * @param shieldListId The unique identifier that represents a shield list. The ID for any Shield
172
   *     List can be determined by the response from the endpoint fetching all shield lists for the
173
   *     enterprise. Example: "90fb0e17-c332-40ed-b4f9-fa8908fbbb24 "
174
   * @param headers Headers of deleteShieldListByIdV2025R0 method
175
   */
176
  public void deleteShieldListByIdV2025R0(
177
      String shieldListId, DeleteShieldListByIdV2025R0Headers headers) {
178
    Map<String, String> headersMap =
×
179
        prepareParams(
×
180
            mergeMaps(
×
181
                mapOf(entryOf("box-version", convertToString(headers.getBoxVersion()))),
×
182
                headers.getExtraHeaders()));
×
183
    FetchResponse response =
×
184
        this.networkSession
185
            .getNetworkClient()
×
186
            .fetch(
×
187
                new FetchOptions.Builder(
188
                        String.join(
×
189
                            "",
190
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
191
                            "/2.0/shield_lists/",
192
                            convertToString(shieldListId)),
×
193
                        "DELETE")
194
                    .headers(headersMap)
×
195
                    .responseFormat(ResponseFormat.NO_CONTENT)
×
196
                    .auth(this.auth)
×
197
                    .networkSession(this.networkSession)
×
198
                    .build());
×
199
  }
×
200

201
  /**
202
   * Updates a shield list.
203
   *
204
   * @param shieldListId The unique identifier that represents a shield list. The ID for any Shield
205
   *     List can be determined by the response from the endpoint fetching all shield lists for the
206
   *     enterprise. Example: "90fb0e17-c332-40ed-b4f9-fa8908fbbb24 "
207
   * @param requestBody Request body of updateShieldListByIdV2025R0 method
208
   */
209
  public ShieldListV2025R0 updateShieldListByIdV2025R0(
210
      String shieldListId, ShieldListsUpdateV2025R0 requestBody) {
211
    return updateShieldListByIdV2025R0(
×
212
        shieldListId, requestBody, new UpdateShieldListByIdV2025R0Headers());
213
  }
214

215
  /**
216
   * Updates a shield list.
217
   *
218
   * @param shieldListId The unique identifier that represents a shield list. The ID for any Shield
219
   *     List can be determined by the response from the endpoint fetching all shield lists for the
220
   *     enterprise. Example: "90fb0e17-c332-40ed-b4f9-fa8908fbbb24 "
221
   * @param requestBody Request body of updateShieldListByIdV2025R0 method
222
   * @param headers Headers of updateShieldListByIdV2025R0 method
223
   */
224
  public ShieldListV2025R0 updateShieldListByIdV2025R0(
225
      String shieldListId,
226
      ShieldListsUpdateV2025R0 requestBody,
227
      UpdateShieldListByIdV2025R0Headers headers) {
228
    Map<String, String> headersMap =
×
229
        prepareParams(
×
230
            mergeMaps(
×
231
                mapOf(entryOf("box-version", convertToString(headers.getBoxVersion()))),
×
232
                headers.getExtraHeaders()));
×
233
    FetchResponse response =
×
234
        this.networkSession
235
            .getNetworkClient()
×
236
            .fetch(
×
237
                new FetchOptions.Builder(
238
                        String.join(
×
239
                            "",
240
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
241
                            "/2.0/shield_lists/",
242
                            convertToString(shieldListId)),
×
243
                        "PUT")
244
                    .headers(headersMap)
×
245
                    .data(JsonManager.serialize(requestBody))
×
246
                    .contentType("application/json")
×
247
                    .responseFormat(ResponseFormat.JSON)
×
248
                    .auth(this.auth)
×
249
                    .networkSession(this.networkSession)
×
250
                    .build());
×
251
    return JsonManager.deserialize(response.getData(), ShieldListV2025R0.class);
×
252
  }
253

254
  public Authentication getAuth() {
255
    return auth;
×
256
  }
257

258
  public NetworkSession getNetworkSession() {
259
    return networkSession;
×
260
  }
261

262
  public static class Builder {
263

264
    protected Authentication auth;
265

266
    protected NetworkSession networkSession;
267

NEW
268
    public Builder() {}
×
269

270
    public Builder auth(Authentication auth) {
UNCOV
271
      this.auth = auth;
×
UNCOV
272
      return this;
×
273
    }
274

275
    public Builder networkSession(NetworkSession networkSession) {
UNCOV
276
      this.networkSession = networkSession;
×
UNCOV
277
      return this;
×
278
    }
279

280
    public ShieldListsManager build() {
NEW
281
      if (this.networkSession == null) {
×
NEW
282
        this.networkSession = new NetworkSession();
×
283
      }
284
      return new ShieldListsManager(this);
×
285
    }
286
  }
287
}
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