• 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

19.67
/src/main/java/com/box/sdkgen/managers/hubitems/HubItemsManager.java
1
package com.box.sdkgen.managers.hubitems;
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.hubitemsmanagerequestv2025r0.HubItemsManageRequestV2025R0;
15
import com.box.sdkgen.schemas.v2025r0.hubitemsmanageresponsev2025r0.HubItemsManageResponseV2025R0;
16
import com.box.sdkgen.schemas.v2025r0.hubitemsv2025r0.HubItemsV2025R0;
17
import com.box.sdkgen.serialization.json.JsonManager;
18
import java.util.Map;
19

20
public class HubItemsManager {
21

22
  public Authentication auth;
23

24
  public NetworkSession networkSession;
25

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

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

35
  public HubItemsV2025R0 getHubItemsV2025R0(GetHubItemsV2025R0QueryParams queryParams) {
36
    return getHubItemsV2025R0(queryParams, new GetHubItemsV2025R0Headers());
×
37
  }
38

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

69
  public HubItemsManageResponseV2025R0 manageHubItemsV2025R0(
70
      String hubId, HubItemsManageRequestV2025R0 requestBody) {
71
    return manageHubItemsV2025R0(hubId, requestBody, new ManageHubItemsV2025R0Headers());
×
72
  }
73

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

105
  public Authentication getAuth() {
106
    return auth;
×
107
  }
108

109
  public NetworkSession getNetworkSession() {
110
    return networkSession;
×
111
  }
112

113
  public static class Builder {
114

115
    protected Authentication auth;
116

117
    protected NetworkSession networkSession;
118

119
    public Builder() {
1✔
120
      this.networkSession = new NetworkSession();
1✔
121
    }
1✔
122

123
    public Builder auth(Authentication auth) {
124
      this.auth = auth;
1✔
125
      return this;
1✔
126
    }
127

128
    public Builder networkSession(NetworkSession networkSession) {
129
      this.networkSession = networkSession;
1✔
130
      return this;
1✔
131
    }
132

133
    public HubItemsManager build() {
134
      return new HubItemsManager(this);
1✔
135
    }
136
  }
137
}
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