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

box / box-java-sdk-gen / #96

09 May 2025 01:16PM UTC coverage: 35.312% (+0.1%) from 35.204%
#96

push

github

web-flow
fix: Fix conversion of `mdfilters` into query parameters (box/box-codegen#721) (#301)

5 of 7 new or added lines in 1 file covered. (71.43%)

287 existing lines in 27 files now uncovered.

15468 of 43804 relevant lines covered (35.31%)

0.35 hits per line

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

65.22
/src/main/java/com/box/sdkgen/managers/integrationmappings/IntegrationMappingsManager.java
1
package com.box.sdkgen.managers.integrationmappings;
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.integrationmapping.IntegrationMapping;
15
import com.box.sdkgen.schemas.integrationmappings.IntegrationMappings;
16
import com.box.sdkgen.schemas.integrationmappingslackcreaterequest.IntegrationMappingSlackCreateRequest;
17
import com.box.sdkgen.schemas.integrationmappingsteams.IntegrationMappingsTeams;
18
import com.box.sdkgen.schemas.integrationmappingteams.IntegrationMappingTeams;
19
import com.box.sdkgen.schemas.integrationmappingteamscreaterequest.IntegrationMappingTeamsCreateRequest;
20
import com.box.sdkgen.serialization.json.JsonManager;
21
import java.util.Map;
22

23
public class IntegrationMappingsManager {
24

25
  public Authentication auth;
26

27
  public NetworkSession networkSession;
28

29
  public IntegrationMappingsManager() {
×
30
    this.networkSession = new NetworkSession();
×
31
  }
×
32

33
  protected IntegrationMappingsManager(IntegrationMappingsManagerBuilder builder) {
1✔
34
    this.auth = builder.auth;
1✔
35
    this.networkSession = builder.networkSession;
1✔
36
  }
1✔
37

38
  public IntegrationMappings getSlackIntegrationMapping() {
39
    return getSlackIntegrationMapping(
1✔
40
        new GetSlackIntegrationMappingQueryParams(), new GetSlackIntegrationMappingHeaders());
41
  }
42

43
  public IntegrationMappings getSlackIntegrationMapping(
44
      GetSlackIntegrationMappingQueryParams queryParams) {
45
    return getSlackIntegrationMapping(queryParams, new GetSlackIntegrationMappingHeaders());
×
46
  }
47

48
  public IntegrationMappings getSlackIntegrationMapping(GetSlackIntegrationMappingHeaders headers) {
49
    return getSlackIntegrationMapping(new GetSlackIntegrationMappingQueryParams(), headers);
×
50
  }
51

52
  public IntegrationMappings getSlackIntegrationMapping(
53
      GetSlackIntegrationMappingQueryParams queryParams,
54
      GetSlackIntegrationMappingHeaders headers) {
55
    Map<String, String> queryParamsMap =
1✔
56
        prepareParams(
1✔
57
            mapOf(
1✔
58
                entryOf("marker", convertToString(queryParams.getMarker())),
1✔
59
                entryOf("limit", convertToString(queryParams.getLimit())),
1✔
60
                entryOf("partner_item_type", convertToString(queryParams.getPartnerItemType())),
1✔
61
                entryOf("partner_item_id", convertToString(queryParams.getPartnerItemId())),
1✔
62
                entryOf("box_item_id", convertToString(queryParams.getBoxItemId())),
1✔
63
                entryOf("box_item_type", convertToString(queryParams.getBoxItemType())),
1✔
64
                entryOf(
1✔
65
                    "is_manually_created", convertToString(queryParams.getIsManuallyCreated()))));
1✔
66
    Map<String, String> headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
1✔
67
    FetchResponse response =
1✔
68
        this.networkSession
69
            .getNetworkClient()
1✔
70
            .fetch(
1✔
71
                new FetchOptions.FetchOptionsBuilder(
72
                        String.join(
1✔
73
                            "",
74
                            this.networkSession.getBaseUrls().getBaseUrl(),
1✔
75
                            "/2.0/integration_mappings/slack"),
76
                        "GET")
77
                    .params(queryParamsMap)
1✔
78
                    .headers(headersMap)
1✔
79
                    .responseFormat(ResponseFormat.JSON)
1✔
80
                    .auth(this.auth)
1✔
81
                    .networkSession(this.networkSession)
1✔
82
                    .build());
1✔
83
    return JsonManager.deserialize(response.getData(), IntegrationMappings.class);
1✔
84
  }
85

86
  public IntegrationMapping createSlackIntegrationMapping(
87
      IntegrationMappingSlackCreateRequest requestBody) {
88
    return createSlackIntegrationMapping(requestBody, new CreateSlackIntegrationMappingHeaders());
×
89
  }
90

91
  public IntegrationMapping createSlackIntegrationMapping(
92
      IntegrationMappingSlackCreateRequest requestBody,
93
      CreateSlackIntegrationMappingHeaders headers) {
UNCOV
94
    Map<String, String> headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
×
UNCOV
95
    FetchResponse response =
×
96
        this.networkSession
UNCOV
97
            .getNetworkClient()
×
98
            .fetch(
×
99
                new FetchOptions.FetchOptionsBuilder(
UNCOV
100
                        String.join(
×
101
                            "",
UNCOV
102
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
103
                            "/2.0/integration_mappings/slack"),
104
                        "POST")
UNCOV
105
                    .headers(headersMap)
×
UNCOV
106
                    .data(JsonManager.serialize(requestBody))
×
UNCOV
107
                    .contentType("application/json")
×
UNCOV
108
                    .responseFormat(ResponseFormat.JSON)
×
UNCOV
109
                    .auth(this.auth)
×
UNCOV
110
                    .networkSession(this.networkSession)
×
UNCOV
111
                    .build());
×
112
    return JsonManager.deserialize(response.getData(), IntegrationMapping.class);
×
113
  }
114

115
  public IntegrationMapping updateSlackIntegrationMappingById(String integrationMappingId) {
116
    return updateSlackIntegrationMappingById(
×
117
        integrationMappingId,
118
        new UpdateSlackIntegrationMappingByIdRequestBody(),
119
        new UpdateSlackIntegrationMappingByIdHeaders());
120
  }
121

122
  public IntegrationMapping updateSlackIntegrationMappingById(
123
      String integrationMappingId, UpdateSlackIntegrationMappingByIdRequestBody requestBody) {
124
    return updateSlackIntegrationMappingById(
1✔
125
        integrationMappingId, requestBody, new UpdateSlackIntegrationMappingByIdHeaders());
126
  }
127

128
  public IntegrationMapping updateSlackIntegrationMappingById(
129
      String integrationMappingId, UpdateSlackIntegrationMappingByIdHeaders headers) {
130
    return updateSlackIntegrationMappingById(
×
131
        integrationMappingId, new UpdateSlackIntegrationMappingByIdRequestBody(), headers);
132
  }
133

134
  public IntegrationMapping updateSlackIntegrationMappingById(
135
      String integrationMappingId,
136
      UpdateSlackIntegrationMappingByIdRequestBody requestBody,
137
      UpdateSlackIntegrationMappingByIdHeaders headers) {
138
    Map<String, String> headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
1✔
139
    FetchResponse response =
1✔
140
        this.networkSession
141
            .getNetworkClient()
1✔
142
            .fetch(
1✔
143
                new FetchOptions.FetchOptionsBuilder(
144
                        String.join(
1✔
145
                            "",
146
                            this.networkSession.getBaseUrls().getBaseUrl(),
1✔
147
                            "/2.0/integration_mappings/slack/",
148
                            convertToString(integrationMappingId)),
1✔
149
                        "PUT")
150
                    .headers(headersMap)
1✔
151
                    .data(JsonManager.serialize(requestBody))
1✔
152
                    .contentType("application/json")
1✔
153
                    .responseFormat(ResponseFormat.JSON)
1✔
154
                    .auth(this.auth)
1✔
155
                    .networkSession(this.networkSession)
1✔
156
                    .build());
1✔
157
    return JsonManager.deserialize(response.getData(), IntegrationMapping.class);
1✔
158
  }
159

160
  public void deleteSlackIntegrationMappingById(String integrationMappingId) {
161
    deleteSlackIntegrationMappingById(
×
162
        integrationMappingId, new DeleteSlackIntegrationMappingByIdHeaders());
163
  }
×
164

165
  public void deleteSlackIntegrationMappingById(
166
      String integrationMappingId, DeleteSlackIntegrationMappingByIdHeaders headers) {
UNCOV
167
    Map<String, String> headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
×
UNCOV
168
    FetchResponse response =
×
169
        this.networkSession
UNCOV
170
            .getNetworkClient()
×
171
            .fetch(
×
172
                new FetchOptions.FetchOptionsBuilder(
UNCOV
173
                        String.join(
×
174
                            "",
UNCOV
175
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
176
                            "/2.0/integration_mappings/slack/",
UNCOV
177
                            convertToString(integrationMappingId)),
×
178
                        "DELETE")
UNCOV
179
                    .headers(headersMap)
×
UNCOV
180
                    .responseFormat(ResponseFormat.NO_CONTENT)
×
UNCOV
181
                    .auth(this.auth)
×
UNCOV
182
                    .networkSession(this.networkSession)
×
UNCOV
183
                    .build());
×
184
  }
×
185

186
  public IntegrationMappingsTeams getTeamsIntegrationMapping() {
187
    return getTeamsIntegrationMapping(
×
188
        new GetTeamsIntegrationMappingQueryParams(), new GetTeamsIntegrationMappingHeaders());
189
  }
190

191
  public IntegrationMappingsTeams getTeamsIntegrationMapping(
192
      GetTeamsIntegrationMappingQueryParams queryParams) {
193
    return getTeamsIntegrationMapping(queryParams, new GetTeamsIntegrationMappingHeaders());
×
194
  }
195

196
  public IntegrationMappingsTeams getTeamsIntegrationMapping(
197
      GetTeamsIntegrationMappingHeaders headers) {
198
    return getTeamsIntegrationMapping(new GetTeamsIntegrationMappingQueryParams(), headers);
×
199
  }
200

201
  public IntegrationMappingsTeams getTeamsIntegrationMapping(
202
      GetTeamsIntegrationMappingQueryParams queryParams,
203
      GetTeamsIntegrationMappingHeaders headers) {
204
    Map<String, String> queryParamsMap =
1✔
205
        prepareParams(
1✔
206
            mapOf(
1✔
207
                entryOf("partner_item_type", convertToString(queryParams.getPartnerItemType())),
1✔
208
                entryOf("partner_item_id", convertToString(queryParams.getPartnerItemId())),
1✔
209
                entryOf("box_item_id", convertToString(queryParams.getBoxItemId())),
1✔
210
                entryOf("box_item_type", convertToString(queryParams.getBoxItemType()))));
1✔
211
    Map<String, String> headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
1✔
212
    FetchResponse response =
1✔
213
        this.networkSession
214
            .getNetworkClient()
1✔
215
            .fetch(
×
216
                new FetchOptions.FetchOptionsBuilder(
217
                        String.join(
1✔
218
                            "",
219
                            this.networkSession.getBaseUrls().getBaseUrl(),
1✔
220
                            "/2.0/integration_mappings/teams"),
221
                        "GET")
222
                    .params(queryParamsMap)
1✔
223
                    .headers(headersMap)
1✔
224
                    .responseFormat(ResponseFormat.JSON)
1✔
225
                    .auth(this.auth)
1✔
226
                    .networkSession(this.networkSession)
1✔
227
                    .build());
1✔
228
    return JsonManager.deserialize(response.getData(), IntegrationMappingsTeams.class);
×
229
  }
230

231
  public IntegrationMappingTeams createTeamsIntegrationMapping(
232
      IntegrationMappingTeamsCreateRequest requestBody) {
233
    return createTeamsIntegrationMapping(requestBody, new CreateTeamsIntegrationMappingHeaders());
×
234
  }
235

236
  public IntegrationMappingTeams createTeamsIntegrationMapping(
237
      IntegrationMappingTeamsCreateRequest requestBody,
238
      CreateTeamsIntegrationMappingHeaders headers) {
239
    Map<String, String> headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
1✔
240
    FetchResponse response =
1✔
241
        this.networkSession
242
            .getNetworkClient()
1✔
243
            .fetch(
×
244
                new FetchOptions.FetchOptionsBuilder(
245
                        String.join(
1✔
246
                            "",
247
                            this.networkSession.getBaseUrls().getBaseUrl(),
1✔
248
                            "/2.0/integration_mappings/teams"),
249
                        "POST")
250
                    .headers(headersMap)
1✔
251
                    .data(JsonManager.serialize(requestBody))
1✔
252
                    .contentType("application/json")
1✔
253
                    .responseFormat(ResponseFormat.JSON)
1✔
254
                    .auth(this.auth)
1✔
255
                    .networkSession(this.networkSession)
1✔
256
                    .build());
1✔
257
    return JsonManager.deserialize(response.getData(), IntegrationMappingTeams.class);
×
258
  }
259

260
  public IntegrationMappingTeams updateTeamsIntegrationMappingById(String integrationMappingId) {
261
    return updateTeamsIntegrationMappingById(
×
262
        integrationMappingId,
263
        new UpdateTeamsIntegrationMappingByIdRequestBody(),
264
        new UpdateTeamsIntegrationMappingByIdHeaders());
265
  }
266

267
  public IntegrationMappingTeams updateTeamsIntegrationMappingById(
268
      String integrationMappingId, UpdateTeamsIntegrationMappingByIdRequestBody requestBody) {
269
    return updateTeamsIntegrationMappingById(
×
270
        integrationMappingId, requestBody, new UpdateTeamsIntegrationMappingByIdHeaders());
271
  }
272

273
  public IntegrationMappingTeams updateTeamsIntegrationMappingById(
274
      String integrationMappingId, UpdateTeamsIntegrationMappingByIdHeaders headers) {
275
    return updateTeamsIntegrationMappingById(
×
276
        integrationMappingId, new UpdateTeamsIntegrationMappingByIdRequestBody(), headers);
277
  }
278

279
  public IntegrationMappingTeams updateTeamsIntegrationMappingById(
280
      String integrationMappingId,
281
      UpdateTeamsIntegrationMappingByIdRequestBody requestBody,
282
      UpdateTeamsIntegrationMappingByIdHeaders headers) {
283
    Map<String, String> headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
1✔
284
    FetchResponse response =
1✔
285
        this.networkSession
286
            .getNetworkClient()
1✔
287
            .fetch(
×
288
                new FetchOptions.FetchOptionsBuilder(
289
                        String.join(
1✔
290
                            "",
291
                            this.networkSession.getBaseUrls().getBaseUrl(),
1✔
292
                            "/2.0/integration_mappings/teams/",
293
                            convertToString(integrationMappingId)),
1✔
294
                        "PUT")
295
                    .headers(headersMap)
1✔
296
                    .data(JsonManager.serialize(requestBody))
1✔
297
                    .contentType("application/json")
1✔
298
                    .responseFormat(ResponseFormat.JSON)
1✔
299
                    .auth(this.auth)
1✔
300
                    .networkSession(this.networkSession)
1✔
301
                    .build());
1✔
302
    return JsonManager.deserialize(response.getData(), IntegrationMappingTeams.class);
×
303
  }
304

305
  public void deleteTeamsIntegrationMappingById(String integrationMappingId) {
306
    deleteTeamsIntegrationMappingById(
×
307
        integrationMappingId, new DeleteTeamsIntegrationMappingByIdHeaders());
308
  }
×
309

310
  public void deleteTeamsIntegrationMappingById(
311
      String integrationMappingId, DeleteTeamsIntegrationMappingByIdHeaders headers) {
312
    Map<String, String> headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
1✔
313
    FetchResponse response =
1✔
314
        this.networkSession
315
            .getNetworkClient()
1✔
316
            .fetch(
×
317
                new FetchOptions.FetchOptionsBuilder(
318
                        String.join(
1✔
319
                            "",
320
                            this.networkSession.getBaseUrls().getBaseUrl(),
1✔
321
                            "/2.0/integration_mappings/teams/",
322
                            convertToString(integrationMappingId)),
1✔
323
                        "DELETE")
324
                    .headers(headersMap)
1✔
325
                    .responseFormat(ResponseFormat.NO_CONTENT)
1✔
326
                    .auth(this.auth)
1✔
327
                    .networkSession(this.networkSession)
1✔
328
                    .build());
1✔
329
  }
×
330

331
  public Authentication getAuth() {
332
    return auth;
×
333
  }
334

335
  public NetworkSession getNetworkSession() {
336
    return networkSession;
×
337
  }
338

339
  public static class IntegrationMappingsManagerBuilder {
1✔
340

341
    protected Authentication auth;
342

343
    protected NetworkSession networkSession;
344

345
    public IntegrationMappingsManagerBuilder auth(Authentication auth) {
346
      this.auth = auth;
1✔
347
      return this;
1✔
348
    }
349

350
    public IntegrationMappingsManagerBuilder networkSession(NetworkSession networkSession) {
351
      this.networkSession = networkSession;
1✔
352
      return this;
1✔
353
    }
354

355
    public IntegrationMappingsManager build() {
356
      return new IntegrationMappingsManager(this);
1✔
357
    }
358
  }
359
}
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