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

box / box-java-sdk / #5076

07 Oct 2025 12:35PM UTC coverage: 37.132% (+0.007%) from 37.125%
#5076

push

github

web-flow
test: Change `Event.additionalDetails` field assertion in events test (box/box-codegen#858) (#1491)

18454 of 49699 relevant lines covered (37.13%)

0.37 hits per line

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

95.45
/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) {
1✔
32
    this.auth = builder.auth;
1✔
33
    this.networkSession = builder.networkSession;
1✔
34
  }
1✔
35

36
  /** Retrieves all shield lists in the enterprise. */
37
  public ShieldListsV2025R0 getShieldListsV2025R0() {
38
    return getShieldListsV2025R0(new GetShieldListsV2025R0Headers());
1✔
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 =
1✔
48
        prepareParams(
1✔
49
            mergeMaps(
1✔
50
                mapOf(entryOf("box-version", convertToString(headers.getBoxVersion()))),
1✔
51
                headers.getExtraHeaders()));
1✔
52
    FetchResponse response =
1✔
53
        this.networkSession
54
            .getNetworkClient()
1✔
55
            .fetch(
1✔
56
                new FetchOptions.Builder(
57
                        String.join(
1✔
58
                            "",
59
                            this.networkSession.getBaseUrls().getBaseUrl(),
1✔
60
                            "/2.0/shield_lists"),
61
                        "GET")
62
                    .headers(headersMap)
1✔
63
                    .responseFormat(ResponseFormat.JSON)
1✔
64
                    .auth(this.auth)
1✔
65
                    .networkSession(this.networkSession)
1✔
66
                    .build());
1✔
67
    return JsonManager.deserialize(response.getData(), ShieldListsV2025R0.class);
1✔
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());
1✔
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 =
1✔
88
        prepareParams(
1✔
89
            mergeMaps(
1✔
90
                mapOf(entryOf("box-version", convertToString(headers.getBoxVersion()))),
1✔
91
                headers.getExtraHeaders()));
1✔
92
    FetchResponse response =
1✔
93
        this.networkSession
94
            .getNetworkClient()
1✔
95
            .fetch(
1✔
96
                new FetchOptions.Builder(
97
                        String.join(
1✔
98
                            "",
99
                            this.networkSession.getBaseUrls().getBaseUrl(),
1✔
100
                            "/2.0/shield_lists"),
101
                        "POST")
102
                    .headers(headersMap)
1✔
103
                    .data(JsonManager.serialize(requestBody))
1✔
104
                    .contentType("application/json")
1✔
105
                    .responseFormat(ResponseFormat.JSON)
1✔
106
                    .auth(this.auth)
1✔
107
                    .networkSession(this.networkSession)
1✔
108
                    .build());
1✔
109
    return JsonManager.deserialize(response.getData(), ShieldListV2025R0.class);
1✔
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());
1✔
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 =
1✔
134
        prepareParams(
1✔
135
            mergeMaps(
1✔
136
                mapOf(entryOf("box-version", convertToString(headers.getBoxVersion()))),
1✔
137
                headers.getExtraHeaders()));
1✔
138
    FetchResponse response =
1✔
139
        this.networkSession
140
            .getNetworkClient()
1✔
141
            .fetch(
1✔
142
                new FetchOptions.Builder(
143
                        String.join(
1✔
144
                            "",
145
                            this.networkSession.getBaseUrls().getBaseUrl(),
1✔
146
                            "/2.0/shield_lists/",
147
                            convertToString(shieldListId)),
1✔
148
                        "GET")
149
                    .headers(headersMap)
1✔
150
                    .responseFormat(ResponseFormat.JSON)
1✔
151
                    .auth(this.auth)
1✔
152
                    .networkSession(this.networkSession)
1✔
153
                    .build());
1✔
154
    return JsonManager.deserialize(response.getData(), ShieldListV2025R0.class);
1✔
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());
1✔
166
  }
1✔
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 =
1✔
179
        prepareParams(
1✔
180
            mergeMaps(
1✔
181
                mapOf(entryOf("box-version", convertToString(headers.getBoxVersion()))),
1✔
182
                headers.getExtraHeaders()));
1✔
183
    FetchResponse response =
1✔
184
        this.networkSession
185
            .getNetworkClient()
1✔
186
            .fetch(
1✔
187
                new FetchOptions.Builder(
188
                        String.join(
1✔
189
                            "",
190
                            this.networkSession.getBaseUrls().getBaseUrl(),
1✔
191
                            "/2.0/shield_lists/",
192
                            convertToString(shieldListId)),
1✔
193
                        "DELETE")
194
                    .headers(headersMap)
1✔
195
                    .responseFormat(ResponseFormat.NO_CONTENT)
1✔
196
                    .auth(this.auth)
1✔
197
                    .networkSession(this.networkSession)
1✔
198
                    .build());
1✔
199
  }
1✔
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(
1✔
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 =
1✔
229
        prepareParams(
1✔
230
            mergeMaps(
1✔
231
                mapOf(entryOf("box-version", convertToString(headers.getBoxVersion()))),
1✔
232
                headers.getExtraHeaders()));
1✔
233
    FetchResponse response =
1✔
234
        this.networkSession
235
            .getNetworkClient()
1✔
236
            .fetch(
1✔
237
                new FetchOptions.Builder(
238
                        String.join(
1✔
239
                            "",
240
                            this.networkSession.getBaseUrls().getBaseUrl(),
1✔
241
                            "/2.0/shield_lists/",
242
                            convertToString(shieldListId)),
1✔
243
                        "PUT")
244
                    .headers(headersMap)
1✔
245
                    .data(JsonManager.serialize(requestBody))
1✔
246
                    .contentType("application/json")
1✔
247
                    .responseFormat(ResponseFormat.JSON)
1✔
248
                    .auth(this.auth)
1✔
249
                    .networkSession(this.networkSession)
1✔
250
                    .build());
1✔
251
    return JsonManager.deserialize(response.getData(), ShieldListV2025R0.class);
1✔
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

268
    public Builder() {
1✔
269
      this.networkSession = new NetworkSession();
1✔
270
    }
1✔
271

272
    public Builder auth(Authentication auth) {
273
      this.auth = auth;
1✔
274
      return this;
1✔
275
    }
276

277
    public Builder networkSession(NetworkSession networkSession) {
278
      this.networkSession = networkSession;
1✔
279
      return this;
1✔
280
    }
281

282
    public ShieldListsManager build() {
283
      return new ShieldListsManager(this);
1✔
284
    }
285
  }
286
}
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