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

box / box-java-sdk-gen / #243

23 Jun 2025 12:23PM UTC coverage: 35.94% (+0.2%) from 35.722%
#243

Pull #344

github

web-flow
Merge 9eec99550 into 8c4ecda2f
Pull Request #344: chore: Update .codegen.json with commit hash of codegen and openapi spec

446 of 1240 new or added lines in 43 files covered. (35.97%)

8 existing lines in 5 files now uncovered.

16713 of 46502 relevant lines covered (35.94%)

0.36 hits per line

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

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

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

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

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

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

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

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

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

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