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

box / box-java-sdk-gen / #519

05 Sep 2025 11:11AM UTC coverage: 36.589% (-1.6%) from 38.212%
#519

push

github

web-flow
docs: Brand Hubs as Box Hubs (box/box-openapi#553) (#435)

18347 of 50144 relevant lines covered (36.59%)

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) {
38
    return getHubCollaborationsV2025R0(queryParams, new GetHubCollaborationsV2025R0Headers());
×
39
  }
40

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

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

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

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

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

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

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

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

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