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

box / box-java-sdk / #6370

19 Mar 2026 11:44AM UTC coverage: 12.801% (-0.01%) from 12.813%
#6370

Pull #1740

github

web-flow
Merge ca1892ead into fb1714773
Pull Request #1740: fix(boxsdkgen): feat: Add Hub Document API (part 2) (box/box-openapi#588)

0 of 63 new or added lines in 5 files covered. (0.0%)

2 existing lines in 2 files now uncovered.

8368 of 65370 relevant lines covered (12.8%)

0.13 hits per line

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

0.0
/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) {
×
31
    this.auth = builder.auth;
×
32
    this.networkSession = builder.networkSession;
×
33
  }
×
34

35
  /**
36
   * Retrieves all items associated with a Box Hub.
37
   *
38
   * @param queryParams Query parameters of getHubItemsV2025R0 method
39
   */
40
  public HubItemsV2025R0 getHubItemsV2025R0(GetHubItemsV2025R0QueryParams queryParams) {
41
    return getHubItemsV2025R0(queryParams, new GetHubItemsV2025R0Headers());
×
42
  }
43

44
  /**
45
   * Retrieves all items associated with a Box Hub.
46
   *
47
   * @param queryParams Query parameters of getHubItemsV2025R0 method
48
   * @param headers Headers of getHubItemsV2025R0 method
49
   */
50
  public HubItemsV2025R0 getHubItemsV2025R0(
51
      GetHubItemsV2025R0QueryParams queryParams, GetHubItemsV2025R0Headers headers) {
52
    Map<String, String> queryParamsMap =
×
53
        prepareParams(
×
54
            mapOf(
×
55
                entryOf("hub_id", convertToString(queryParams.getHubId())),
×
NEW
56
                entryOf("parent_id", convertToString(queryParams.getParentId())),
×
57
                entryOf("marker", convertToString(queryParams.getMarker())),
×
58
                entryOf("limit", convertToString(queryParams.getLimit()))));
×
59
    Map<String, String> headersMap =
×
60
        prepareParams(
×
61
            mergeMaps(
×
62
                mapOf(entryOf("box-version", convertToString(headers.getBoxVersion()))),
×
63
                headers.getExtraHeaders()));
×
64
    FetchResponse response =
×
65
        this.networkSession
66
            .getNetworkClient()
×
67
            .fetch(
×
68
                new FetchOptions.Builder(
69
                        String.join(
×
70
                            "", this.networkSession.getBaseUrls().getBaseUrl(), "/2.0/hub_items"),
×
71
                        "GET")
72
                    .params(queryParamsMap)
×
73
                    .headers(headersMap)
×
74
                    .responseFormat(ResponseFormat.JSON)
×
75
                    .auth(this.auth)
×
76
                    .networkSession(this.networkSession)
×
77
                    .build());
×
78
    return JsonManager.deserialize(response.getData(), HubItemsV2025R0.class);
×
79
  }
80

81
  /**
82
   * Adds and/or removes Box Hub items from a Box Hub.
83
   *
84
   * @param hubId The unique identifier that represent a hub.
85
   *     <p>The ID for any hub can be determined by visiting this hub in the web application and
86
   *     copying the ID from the URL. For example, for the URL `https://*.app.box.com/hubs/123` the
87
   *     `hub_id` is `123`. Example: "12345"
88
   * @param requestBody Request body of manageHubItemsV2025R0 method
89
   */
90
  public HubItemsManageResponseV2025R0 manageHubItemsV2025R0(
91
      String hubId, HubItemsManageRequestV2025R0 requestBody) {
92
    return manageHubItemsV2025R0(hubId, requestBody, new ManageHubItemsV2025R0Headers());
×
93
  }
94

95
  /**
96
   * Adds and/or removes Box Hub items from a Box Hub.
97
   *
98
   * @param hubId The unique identifier that represent a hub.
99
   *     <p>The ID for any hub can be determined by visiting this hub in the web application and
100
   *     copying the ID from the URL. For example, for the URL `https://*.app.box.com/hubs/123` the
101
   *     `hub_id` is `123`. Example: "12345"
102
   * @param requestBody Request body of manageHubItemsV2025R0 method
103
   * @param headers Headers of manageHubItemsV2025R0 method
104
   */
105
  public HubItemsManageResponseV2025R0 manageHubItemsV2025R0(
106
      String hubId,
107
      HubItemsManageRequestV2025R0 requestBody,
108
      ManageHubItemsV2025R0Headers headers) {
109
    Map<String, String> headersMap =
×
110
        prepareParams(
×
111
            mergeMaps(
×
112
                mapOf(entryOf("box-version", convertToString(headers.getBoxVersion()))),
×
113
                headers.getExtraHeaders()));
×
114
    FetchResponse response =
×
115
        this.networkSession
116
            .getNetworkClient()
×
117
            .fetch(
×
118
                new FetchOptions.Builder(
119
                        String.join(
×
120
                            "",
121
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
122
                            "/2.0/hubs/",
123
                            convertToString(hubId),
×
124
                            "/manage_items"),
125
                        "POST")
126
                    .headers(headersMap)
×
127
                    .data(JsonManager.serialize(requestBody))
×
128
                    .contentType("application/json")
×
129
                    .responseFormat(ResponseFormat.JSON)
×
130
                    .auth(this.auth)
×
131
                    .networkSession(this.networkSession)
×
132
                    .build());
×
133
    return JsonManager.deserialize(response.getData(), HubItemsManageResponseV2025R0.class);
×
134
  }
135

136
  public Authentication getAuth() {
137
    return auth;
×
138
  }
139

140
  public NetworkSession getNetworkSession() {
141
    return networkSession;
×
142
  }
143

144
  public static class Builder {
145

146
    protected Authentication auth;
147

148
    protected NetworkSession networkSession;
149

150
    public Builder() {}
×
151

152
    public Builder auth(Authentication auth) {
153
      this.auth = auth;
×
154
      return this;
×
155
    }
156

157
    public Builder networkSession(NetworkSession networkSession) {
158
      this.networkSession = networkSession;
×
159
      return this;
×
160
    }
161

162
    public HubItemsManager build() {
163
      if (this.networkSession == null) {
×
164
        this.networkSession = new NetworkSession();
×
165
      }
166
      return new HubItemsManager(this);
×
167
    }
168
  }
169
}
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