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

box / box-java-sdk-gen / #164

30 May 2025 01:03PM UTC coverage: 35.088% (-0.6%) from 35.646%
#164

Pull #323

github

web-flow
Merge 6f62dee1b into 55711f79b
Pull Request #323: docs: Shield Lists documentation (box/box-openapi#528)

21 of 746 new or added lines in 32 files covered. (2.82%)

9 existing lines in 8 files now uncovered.

15641 of 44576 relevant lines covered (35.09%)

0.35 hits per line

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

9.26
/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

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

31
  protected ShieldListsManager(ShieldListsManagerBuilder builder) {
1✔
32
    this.auth = builder.auth;
1✔
33
    this.networkSession = builder.networkSession;
1✔
34
  }
1✔
35

36
  public ShieldListsV2025R0 getShieldListsV2025R0() {
NEW
37
    return getShieldListsV2025R0(new GetShieldListsV2025R0Headers());
×
38
  }
39

40
  public ShieldListsV2025R0 getShieldListsV2025R0(GetShieldListsV2025R0Headers headers) {
NEW
41
    Map<String, String> headersMap =
×
NEW
42
        prepareParams(
×
NEW
43
            mergeMaps(
×
NEW
44
                mapOf(entryOf("box-version", convertToString(headers.getBoxVersion()))),
×
NEW
45
                headers.getExtraHeaders()));
×
NEW
46
    FetchResponse response =
×
47
        this.networkSession
NEW
48
            .getNetworkClient()
×
NEW
49
            .fetch(
×
50
                new FetchOptions.FetchOptionsBuilder(
NEW
51
                        String.join(
×
52
                            "",
NEW
53
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
54
                            "/2.0/shield_lists"),
55
                        "GET")
NEW
56
                    .headers(headersMap)
×
NEW
57
                    .responseFormat(ResponseFormat.JSON)
×
NEW
58
                    .auth(this.auth)
×
NEW
59
                    .networkSession(this.networkSession)
×
NEW
60
                    .build());
×
NEW
61
    return JsonManager.deserialize(response.getData(), ShieldListsV2025R0.class);
×
62
  }
63

64
  public ShieldListV2025R0 createShieldListV2025R0(ShieldListsCreateV2025R0 requestBody) {
NEW
65
    return createShieldListV2025R0(requestBody, new CreateShieldListV2025R0Headers());
×
66
  }
67

68
  public ShieldListV2025R0 createShieldListV2025R0(
69
      ShieldListsCreateV2025R0 requestBody, CreateShieldListV2025R0Headers headers) {
NEW
70
    Map<String, String> headersMap =
×
NEW
71
        prepareParams(
×
NEW
72
            mergeMaps(
×
NEW
73
                mapOf(entryOf("box-version", convertToString(headers.getBoxVersion()))),
×
NEW
74
                headers.getExtraHeaders()));
×
NEW
75
    FetchResponse response =
×
76
        this.networkSession
NEW
77
            .getNetworkClient()
×
NEW
78
            .fetch(
×
79
                new FetchOptions.FetchOptionsBuilder(
NEW
80
                        String.join(
×
81
                            "",
NEW
82
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
83
                            "/2.0/shield_lists"),
84
                        "POST")
NEW
85
                    .headers(headersMap)
×
NEW
86
                    .data(JsonManager.serialize(requestBody))
×
NEW
87
                    .contentType("application/json")
×
NEW
88
                    .responseFormat(ResponseFormat.JSON)
×
NEW
89
                    .auth(this.auth)
×
NEW
90
                    .networkSession(this.networkSession)
×
NEW
91
                    .build());
×
NEW
92
    return JsonManager.deserialize(response.getData(), ShieldListV2025R0.class);
×
93
  }
94

95
  public ShieldListV2025R0 getShieldListByIdV2025R0(String shieldListId) {
NEW
96
    return getShieldListByIdV2025R0(shieldListId, new GetShieldListByIdV2025R0Headers());
×
97
  }
98

99
  public ShieldListV2025R0 getShieldListByIdV2025R0(
100
      String shieldListId, GetShieldListByIdV2025R0Headers headers) {
NEW
101
    Map<String, String> headersMap =
×
NEW
102
        prepareParams(
×
NEW
103
            mergeMaps(
×
NEW
104
                mapOf(entryOf("box-version", convertToString(headers.getBoxVersion()))),
×
NEW
105
                headers.getExtraHeaders()));
×
NEW
106
    FetchResponse response =
×
107
        this.networkSession
NEW
108
            .getNetworkClient()
×
NEW
109
            .fetch(
×
110
                new FetchOptions.FetchOptionsBuilder(
NEW
111
                        String.join(
×
112
                            "",
NEW
113
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
114
                            "/2.0/shield_lists/",
NEW
115
                            convertToString(shieldListId)),
×
116
                        "GET")
NEW
117
                    .headers(headersMap)
×
NEW
118
                    .responseFormat(ResponseFormat.JSON)
×
NEW
119
                    .auth(this.auth)
×
NEW
120
                    .networkSession(this.networkSession)
×
NEW
121
                    .build());
×
NEW
122
    return JsonManager.deserialize(response.getData(), ShieldListV2025R0.class);
×
123
  }
124

125
  public void deleteShieldListByIdV2025R0(String shieldListId) {
NEW
126
    deleteShieldListByIdV2025R0(shieldListId, new DeleteShieldListByIdV2025R0Headers());
×
NEW
127
  }
×
128

129
  public void deleteShieldListByIdV2025R0(
130
      String shieldListId, DeleteShieldListByIdV2025R0Headers headers) {
NEW
131
    Map<String, String> headersMap =
×
NEW
132
        prepareParams(
×
NEW
133
            mergeMaps(
×
NEW
134
                mapOf(entryOf("box-version", convertToString(headers.getBoxVersion()))),
×
NEW
135
                headers.getExtraHeaders()));
×
NEW
136
    FetchResponse response =
×
137
        this.networkSession
NEW
138
            .getNetworkClient()
×
NEW
139
            .fetch(
×
140
                new FetchOptions.FetchOptionsBuilder(
NEW
141
                        String.join(
×
142
                            "",
NEW
143
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
144
                            "/2.0/shield_lists/",
NEW
145
                            convertToString(shieldListId)),
×
146
                        "DELETE")
NEW
147
                    .headers(headersMap)
×
NEW
148
                    .responseFormat(ResponseFormat.NO_CONTENT)
×
NEW
149
                    .auth(this.auth)
×
NEW
150
                    .networkSession(this.networkSession)
×
NEW
151
                    .build());
×
NEW
152
  }
×
153

154
  public ShieldListV2025R0 updateShieldListByIdV2025R0(
155
      String shieldListId, ShieldListsUpdateV2025R0 requestBody) {
NEW
156
    return updateShieldListByIdV2025R0(
×
157
        shieldListId, requestBody, new UpdateShieldListByIdV2025R0Headers());
158
  }
159

160
  public ShieldListV2025R0 updateShieldListByIdV2025R0(
161
      String shieldListId,
162
      ShieldListsUpdateV2025R0 requestBody,
163
      UpdateShieldListByIdV2025R0Headers headers) {
NEW
164
    Map<String, String> headersMap =
×
NEW
165
        prepareParams(
×
NEW
166
            mergeMaps(
×
NEW
167
                mapOf(entryOf("box-version", convertToString(headers.getBoxVersion()))),
×
NEW
168
                headers.getExtraHeaders()));
×
NEW
169
    FetchResponse response =
×
170
        this.networkSession
NEW
171
            .getNetworkClient()
×
NEW
172
            .fetch(
×
173
                new FetchOptions.FetchOptionsBuilder(
NEW
174
                        String.join(
×
175
                            "",
NEW
176
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
177
                            "/2.0/shield_lists/",
NEW
178
                            convertToString(shieldListId)),
×
179
                        "PUT")
NEW
180
                    .headers(headersMap)
×
NEW
181
                    .data(JsonManager.serialize(requestBody))
×
NEW
182
                    .contentType("application/json")
×
NEW
183
                    .responseFormat(ResponseFormat.JSON)
×
NEW
184
                    .auth(this.auth)
×
NEW
185
                    .networkSession(this.networkSession)
×
NEW
186
                    .build());
×
NEW
187
    return JsonManager.deserialize(response.getData(), ShieldListV2025R0.class);
×
188
  }
189

190
  public Authentication getAuth() {
NEW
191
    return auth;
×
192
  }
193

194
  public NetworkSession getNetworkSession() {
NEW
195
    return networkSession;
×
196
  }
197

198
  public static class ShieldListsManagerBuilder {
1✔
199

200
    protected Authentication auth;
201

202
    protected NetworkSession networkSession;
203

204
    public ShieldListsManagerBuilder auth(Authentication auth) {
205
      this.auth = auth;
1✔
206
      return this;
1✔
207
    }
208

209
    public ShieldListsManagerBuilder networkSession(NetworkSession networkSession) {
210
      this.networkSession = networkSession;
1✔
211
      return this;
1✔
212
    }
213

214
    public ShieldListsManager build() {
215
      return new ShieldListsManager(this);
1✔
216
    }
217
  }
218
}
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