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

box / box-java-sdk-gen / #262

23 Jun 2025 02:39PM UTC coverage: 34.829% (-0.9%) from 35.719%
#262

push

github

web-flow
feat: add hubs API beta endpoints (box/box-openapi#531) (#341)

36 of 1240 new or added lines in 43 files covered. (2.9%)

7 existing lines in 3 files now uncovered.

16196 of 46502 relevant lines covered (34.83%)

0.35 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

NEW
27
  public HubCollaborationsManager() {
×
NEW
28
    this.networkSession = new NetworkSession();
×
NEW
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) {
NEW
38
    return getHubCollaborationsV2025R0(queryParams, new GetHubCollaborationsV2025R0Headers());
×
39
  }
40

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

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

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

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

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

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

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

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

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

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

208
  public NetworkSession getNetworkSession() {
NEW
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