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

box / box-java-sdk-gen / #377

17 Jul 2025 10:13AM UTC coverage: 37.616% (-0.5%) from 38.09%
#377

Pull #365

github

web-flow
Merge 9587c29b7 into 715ac2415
Pull Request #365: feat: Hub items API (box/box-openapi#538)

16 of 722 new or added lines in 27 files covered. (2.22%)

6 existing lines in 2 files now uncovered.

18585 of 49407 relevant lines covered (37.62%)

0.38 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

NEW
26
  public HubItemsManager() {
×
NEW
27
    this.networkSession = new NetworkSession();
×
NEW
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) {
NEW
36
    return getHubItemsV2025R0(queryParams, new GetHubItemsV2025R0Headers());
×
37
  }
38

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

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

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

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

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