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

box / box-java-sdk / #4766

04 Sep 2025 02:54PM UTC coverage: 37.239% (-1.6%) from 38.858%
#4766

push

github

web-flow
feat: Support event with long polling (box/box-codegen#807) (#1409)

32 of 420 new or added lines in 7 files covered. (7.62%)

800 existing lines in 66 files now uncovered.

18480 of 49626 relevant lines covered (37.24%)

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) {
UNCOV
36
    return getHubItemsV2025R0(queryParams, new GetHubItemsV2025R0Headers());
×
37
  }
38

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

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

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