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

box / box-java-sdk / #4766

04 Sep 2025 02:54PM UTC coverage: 37.239% (-1.6%) from 38.858%
#4766

push

github

web-flow
feat: Support event with long polling (box/box-codegen#807) (#1409)

32 of 420 new or added lines in 7 files covered. (7.62%)

800 existing lines in 66 files now uncovered.

18480 of 49626 relevant lines covered (37.24%)

0.37 hits per line

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

10.26
/src/main/java/com/box/sdkgen/managers/hubcollaborations/HubCollaborationsManager.java
1
package com.box.sdkgen.managers.hubcollaborations;
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.hubcollaborationcreaterequestv2025r0.HubCollaborationCreateRequestV2025R0;
15
import com.box.sdkgen.schemas.v2025r0.hubcollaborationsv2025r0.HubCollaborationsV2025R0;
16
import com.box.sdkgen.schemas.v2025r0.hubcollaborationupdaterequestv2025r0.HubCollaborationUpdateRequestV2025R0;
17
import com.box.sdkgen.schemas.v2025r0.hubcollaborationv2025r0.HubCollaborationV2025R0;
18
import com.box.sdkgen.serialization.json.JsonManager;
19
import java.util.Map;
20

21
public class HubCollaborationsManager {
22

23
  public Authentication auth;
24

25
  public NetworkSession networkSession;
26

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

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

36
  public HubCollaborationsV2025R0 getHubCollaborationsV2025R0(
37
      GetHubCollaborationsV2025R0QueryParams queryParams) {
UNCOV
38
    return getHubCollaborationsV2025R0(queryParams, new GetHubCollaborationsV2025R0Headers());
×
39
  }
40

41
  public HubCollaborationsV2025R0 getHubCollaborationsV2025R0(
42
      GetHubCollaborationsV2025R0QueryParams queryParams,
43
      GetHubCollaborationsV2025R0Headers headers) {
UNCOV
44
    Map<String, String> queryParamsMap =
×
UNCOV
45
        prepareParams(
×
UNCOV
46
            mapOf(
×
UNCOV
47
                entryOf("hub_id", convertToString(queryParams.getHubId())),
×
UNCOV
48
                entryOf("marker", convertToString(queryParams.getMarker())),
×
UNCOV
49
                entryOf("limit", convertToString(queryParams.getLimit()))));
×
UNCOV
50
    Map<String, String> headersMap =
×
UNCOV
51
        prepareParams(
×
UNCOV
52
            mergeMaps(
×
UNCOV
53
                mapOf(entryOf("box-version", convertToString(headers.getBoxVersion()))),
×
UNCOV
54
                headers.getExtraHeaders()));
×
UNCOV
55
    FetchResponse response =
×
56
        this.networkSession
UNCOV
57
            .getNetworkClient()
×
UNCOV
58
            .fetch(
×
59
                new FetchOptions.Builder(
UNCOV
60
                        String.join(
×
61
                            "",
UNCOV
62
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
63
                            "/2.0/hub_collaborations"),
64
                        "GET")
UNCOV
65
                    .params(queryParamsMap)
×
UNCOV
66
                    .headers(headersMap)
×
UNCOV
67
                    .responseFormat(ResponseFormat.JSON)
×
UNCOV
68
                    .auth(this.auth)
×
UNCOV
69
                    .networkSession(this.networkSession)
×
UNCOV
70
                    .build());
×
UNCOV
71
    return JsonManager.deserialize(response.getData(), HubCollaborationsV2025R0.class);
×
72
  }
73

74
  public HubCollaborationV2025R0 createHubCollaborationV2025R0(
75
      HubCollaborationCreateRequestV2025R0 requestBody) {
UNCOV
76
    return createHubCollaborationV2025R0(requestBody, new CreateHubCollaborationV2025R0Headers());
×
77
  }
78

79
  public HubCollaborationV2025R0 createHubCollaborationV2025R0(
80
      HubCollaborationCreateRequestV2025R0 requestBody,
81
      CreateHubCollaborationV2025R0Headers headers) {
UNCOV
82
    Map<String, String> headersMap =
×
UNCOV
83
        prepareParams(
×
UNCOV
84
            mergeMaps(
×
UNCOV
85
                mapOf(entryOf("box-version", convertToString(headers.getBoxVersion()))),
×
UNCOV
86
                headers.getExtraHeaders()));
×
UNCOV
87
    FetchResponse response =
×
88
        this.networkSession
UNCOV
89
            .getNetworkClient()
×
UNCOV
90
            .fetch(
×
91
                new FetchOptions.Builder(
UNCOV
92
                        String.join(
×
93
                            "",
UNCOV
94
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
95
                            "/2.0/hub_collaborations"),
96
                        "POST")
UNCOV
97
                    .headers(headersMap)
×
UNCOV
98
                    .data(JsonManager.serialize(requestBody))
×
UNCOV
99
                    .contentType("application/json")
×
UNCOV
100
                    .responseFormat(ResponseFormat.JSON)
×
UNCOV
101
                    .auth(this.auth)
×
UNCOV
102
                    .networkSession(this.networkSession)
×
UNCOV
103
                    .build());
×
UNCOV
104
    return JsonManager.deserialize(response.getData(), HubCollaborationV2025R0.class);
×
105
  }
106

107
  public HubCollaborationV2025R0 getHubCollaborationByIdV2025R0(String hubCollaborationId) {
UNCOV
108
    return getHubCollaborationByIdV2025R0(
×
109
        hubCollaborationId, new GetHubCollaborationByIdV2025R0Headers());
110
  }
111

112
  public HubCollaborationV2025R0 getHubCollaborationByIdV2025R0(
113
      String hubCollaborationId, GetHubCollaborationByIdV2025R0Headers headers) {
UNCOV
114
    Map<String, String> headersMap =
×
UNCOV
115
        prepareParams(
×
UNCOV
116
            mergeMaps(
×
UNCOV
117
                mapOf(entryOf("box-version", convertToString(headers.getBoxVersion()))),
×
UNCOV
118
                headers.getExtraHeaders()));
×
UNCOV
119
    FetchResponse response =
×
120
        this.networkSession
UNCOV
121
            .getNetworkClient()
×
UNCOV
122
            .fetch(
×
123
                new FetchOptions.Builder(
UNCOV
124
                        String.join(
×
125
                            "",
UNCOV
126
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
127
                            "/2.0/hub_collaborations/",
UNCOV
128
                            convertToString(hubCollaborationId)),
×
129
                        "GET")
UNCOV
130
                    .headers(headersMap)
×
UNCOV
131
                    .responseFormat(ResponseFormat.JSON)
×
UNCOV
132
                    .auth(this.auth)
×
UNCOV
133
                    .networkSession(this.networkSession)
×
UNCOV
134
                    .build());
×
UNCOV
135
    return JsonManager.deserialize(response.getData(), HubCollaborationV2025R0.class);
×
136
  }
137

138
  public HubCollaborationV2025R0 updateHubCollaborationByIdV2025R0(
139
      String hubCollaborationId, HubCollaborationUpdateRequestV2025R0 requestBody) {
UNCOV
140
    return updateHubCollaborationByIdV2025R0(
×
141
        hubCollaborationId, requestBody, new UpdateHubCollaborationByIdV2025R0Headers());
142
  }
143

144
  public HubCollaborationV2025R0 updateHubCollaborationByIdV2025R0(
145
      String hubCollaborationId,
146
      HubCollaborationUpdateRequestV2025R0 requestBody,
147
      UpdateHubCollaborationByIdV2025R0Headers headers) {
UNCOV
148
    Map<String, String> headersMap =
×
UNCOV
149
        prepareParams(
×
UNCOV
150
            mergeMaps(
×
UNCOV
151
                mapOf(entryOf("box-version", convertToString(headers.getBoxVersion()))),
×
UNCOV
152
                headers.getExtraHeaders()));
×
UNCOV
153
    FetchResponse response =
×
154
        this.networkSession
UNCOV
155
            .getNetworkClient()
×
UNCOV
156
            .fetch(
×
157
                new FetchOptions.Builder(
UNCOV
158
                        String.join(
×
159
                            "",
UNCOV
160
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
161
                            "/2.0/hub_collaborations/",
UNCOV
162
                            convertToString(hubCollaborationId)),
×
163
                        "PUT")
UNCOV
164
                    .headers(headersMap)
×
UNCOV
165
                    .data(JsonManager.serialize(requestBody))
×
UNCOV
166
                    .contentType("application/json")
×
UNCOV
167
                    .responseFormat(ResponseFormat.JSON)
×
UNCOV
168
                    .auth(this.auth)
×
UNCOV
169
                    .networkSession(this.networkSession)
×
UNCOV
170
                    .build());
×
UNCOV
171
    return JsonManager.deserialize(response.getData(), HubCollaborationV2025R0.class);
×
172
  }
173

174
  public void deleteHubCollaborationByIdV2025R0(String hubCollaborationId) {
UNCOV
175
    deleteHubCollaborationByIdV2025R0(
×
176
        hubCollaborationId, new DeleteHubCollaborationByIdV2025R0Headers());
UNCOV
177
  }
×
178

179
  public void deleteHubCollaborationByIdV2025R0(
180
      String hubCollaborationId, DeleteHubCollaborationByIdV2025R0Headers headers) {
UNCOV
181
    Map<String, String> headersMap =
×
UNCOV
182
        prepareParams(
×
UNCOV
183
            mergeMaps(
×
UNCOV
184
                mapOf(entryOf("box-version", convertToString(headers.getBoxVersion()))),
×
UNCOV
185
                headers.getExtraHeaders()));
×
UNCOV
186
    FetchResponse response =
×
187
        this.networkSession
UNCOV
188
            .getNetworkClient()
×
UNCOV
189
            .fetch(
×
190
                new FetchOptions.Builder(
UNCOV
191
                        String.join(
×
192
                            "",
UNCOV
193
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
194
                            "/2.0/hub_collaborations/",
UNCOV
195
                            convertToString(hubCollaborationId)),
×
196
                        "DELETE")
UNCOV
197
                    .headers(headersMap)
×
UNCOV
198
                    .responseFormat(ResponseFormat.NO_CONTENT)
×
UNCOV
199
                    .auth(this.auth)
×
UNCOV
200
                    .networkSession(this.networkSession)
×
UNCOV
201
                    .build());
×
UNCOV
202
  }
×
203

204
  public Authentication getAuth() {
205
    return auth;
×
206
  }
207

208
  public NetworkSession getNetworkSession() {
209
    return networkSession;
×
210
  }
211

212
  public static class Builder {
213

214
    protected Authentication auth;
215

216
    protected NetworkSession networkSession;
217

218
    public Builder() {
1✔
219
      this.networkSession = new NetworkSession();
1✔
220
    }
1✔
221

222
    public Builder auth(Authentication auth) {
223
      this.auth = auth;
1✔
224
      return this;
1✔
225
    }
226

227
    public Builder networkSession(NetworkSession networkSession) {
228
      this.networkSession = networkSession;
1✔
229
      return this;
1✔
230
    }
231

232
    public HubCollaborationsManager build() {
233
      return new HubCollaborationsManager(this);
1✔
234
    }
235
  }
236
}
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