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

box / box-java-sdk / #6457

26 Mar 2026 04:24PM UTC coverage: 12.691% (-0.1%) from 12.818%
#6457

Pull #1756

github

web-flow
Merge 8ec3acf17 into bbedeaa86
Pull Request #1756: feat(boxsdkgen): Enable new hubs endpoints (box/box-codegen#930)

0 of 657 new or added lines in 25 files covered. (0.0%)

2 existing lines in 1 file now uncovered.

8374 of 65985 relevant lines covered (12.69%)

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/hubdocument/HubDocumentManager.java
1
package com.box.sdkgen.managers.hubdocument;
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.hubdocumentblocksv2025r0.HubDocumentBlocksV2025R0;
15
import com.box.sdkgen.schemas.v2025r0.hubdocumentpagesv2025r0.HubDocumentPagesV2025R0;
16
import com.box.sdkgen.serialization.json.JsonManager;
17
import java.util.Map;
18

19
public class HubDocumentManager {
20

21
  public Authentication auth;
22

23
  public NetworkSession networkSession;
24

NEW
25
  public HubDocumentManager() {
×
NEW
26
    this.networkSession = new NetworkSession();
×
NEW
27
  }
×
28

NEW
29
  protected HubDocumentManager(Builder builder) {
×
NEW
30
    this.auth = builder.auth;
×
NEW
31
    this.networkSession = builder.networkSession;
×
NEW
32
  }
×
33

34
  /**
35
   * Retrieves a list of Hub Document Pages for the specified hub. Includes both root-level pages
36
   * and sub pages.
37
   *
38
   * @param queryParams Query parameters of getHubDocumentPagesV2025R0 method
39
   */
40
  public HubDocumentPagesV2025R0 getHubDocumentPagesV2025R0(
41
      GetHubDocumentPagesV2025R0QueryParams queryParams) {
NEW
42
    return getHubDocumentPagesV2025R0(queryParams, new GetHubDocumentPagesV2025R0Headers());
×
43
  }
44

45
  /**
46
   * Retrieves a list of Hub Document Pages for the specified hub. Includes both root-level pages
47
   * and sub pages.
48
   *
49
   * @param queryParams Query parameters of getHubDocumentPagesV2025R0 method
50
   * @param headers Headers of getHubDocumentPagesV2025R0 method
51
   */
52
  public HubDocumentPagesV2025R0 getHubDocumentPagesV2025R0(
53
      GetHubDocumentPagesV2025R0QueryParams queryParams,
54
      GetHubDocumentPagesV2025R0Headers headers) {
NEW
55
    Map<String, String> queryParamsMap =
×
NEW
56
        prepareParams(
×
NEW
57
            mapOf(
×
NEW
58
                entryOf("hub_id", convertToString(queryParams.getHubId())),
×
NEW
59
                entryOf("marker", convertToString(queryParams.getMarker())),
×
NEW
60
                entryOf("limit", convertToString(queryParams.getLimit()))));
×
NEW
61
    Map<String, String> headersMap =
×
NEW
62
        prepareParams(
×
NEW
63
            mergeMaps(
×
NEW
64
                mapOf(entryOf("box-version", convertToString(headers.getBoxVersion()))),
×
NEW
65
                headers.getExtraHeaders()));
×
NEW
66
    FetchResponse response =
×
67
        this.networkSession
NEW
68
            .getNetworkClient()
×
NEW
69
            .fetch(
×
70
                new FetchOptions.Builder(
NEW
71
                        String.join(
×
72
                            "",
NEW
73
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
74
                            "/2.0/hub_document_pages"),
75
                        "GET")
NEW
76
                    .params(queryParamsMap)
×
NEW
77
                    .headers(headersMap)
×
NEW
78
                    .responseFormat(ResponseFormat.JSON)
×
NEW
79
                    .auth(this.auth)
×
NEW
80
                    .networkSession(this.networkSession)
×
NEW
81
                    .build());
×
NEW
82
    return JsonManager.deserialize(response.getData(), HubDocumentPagesV2025R0.class);
×
83
  }
84

85
  /**
86
   * Retrieves a sorted list of all Hub Document Blocks on a specified page in the hub document,
87
   * excluding items. Blocks are hierarchically organized by their `parent_id`. Blocks are sorted in
88
   * order based on user specification in the user interface. The response will only include content
89
   * blocks that belong to the specified page. This will not include sub pages or sub page content
90
   * blocks.
91
   *
92
   * @param queryParams Query parameters of getHubDocumentBlocksV2025R0 method
93
   */
94
  public HubDocumentBlocksV2025R0 getHubDocumentBlocksV2025R0(
95
      GetHubDocumentBlocksV2025R0QueryParams queryParams) {
NEW
96
    return getHubDocumentBlocksV2025R0(queryParams, new GetHubDocumentBlocksV2025R0Headers());
×
97
  }
98

99
  /**
100
   * Retrieves a sorted list of all Hub Document Blocks on a specified page in the hub document,
101
   * excluding items. Blocks are hierarchically organized by their `parent_id`. Blocks are sorted in
102
   * order based on user specification in the user interface. The response will only include content
103
   * blocks that belong to the specified page. This will not include sub pages or sub page content
104
   * blocks.
105
   *
106
   * @param queryParams Query parameters of getHubDocumentBlocksV2025R0 method
107
   * @param headers Headers of getHubDocumentBlocksV2025R0 method
108
   */
109
  public HubDocumentBlocksV2025R0 getHubDocumentBlocksV2025R0(
110
      GetHubDocumentBlocksV2025R0QueryParams queryParams,
111
      GetHubDocumentBlocksV2025R0Headers headers) {
NEW
112
    Map<String, String> queryParamsMap =
×
NEW
113
        prepareParams(
×
NEW
114
            mapOf(
×
NEW
115
                entryOf("hub_id", convertToString(queryParams.getHubId())),
×
NEW
116
                entryOf("page_id", convertToString(queryParams.getPageId())),
×
NEW
117
                entryOf("marker", convertToString(queryParams.getMarker())),
×
NEW
118
                entryOf("limit", convertToString(queryParams.getLimit()))));
×
NEW
119
    Map<String, String> headersMap =
×
NEW
120
        prepareParams(
×
NEW
121
            mergeMaps(
×
NEW
122
                mapOf(entryOf("box-version", convertToString(headers.getBoxVersion()))),
×
NEW
123
                headers.getExtraHeaders()));
×
NEW
124
    FetchResponse response =
×
125
        this.networkSession
NEW
126
            .getNetworkClient()
×
NEW
127
            .fetch(
×
128
                new FetchOptions.Builder(
NEW
129
                        String.join(
×
130
                            "",
NEW
131
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
132
                            "/2.0/hub_document_blocks"),
133
                        "GET")
NEW
134
                    .params(queryParamsMap)
×
NEW
135
                    .headers(headersMap)
×
NEW
136
                    .responseFormat(ResponseFormat.JSON)
×
NEW
137
                    .auth(this.auth)
×
NEW
138
                    .networkSession(this.networkSession)
×
NEW
139
                    .build());
×
NEW
140
    return JsonManager.deserialize(response.getData(), HubDocumentBlocksV2025R0.class);
×
141
  }
142

143
  public Authentication getAuth() {
NEW
144
    return auth;
×
145
  }
146

147
  public NetworkSession getNetworkSession() {
NEW
148
    return networkSession;
×
149
  }
150

151
  public static class Builder {
152

153
    protected Authentication auth;
154

155
    protected NetworkSession networkSession;
156

NEW
157
    public Builder() {}
×
158

159
    public Builder auth(Authentication auth) {
NEW
160
      this.auth = auth;
×
NEW
161
      return this;
×
162
    }
163

164
    public Builder networkSession(NetworkSession networkSession) {
NEW
165
      this.networkSession = networkSession;
×
NEW
166
      return this;
×
167
    }
168

169
    public HubDocumentManager build() {
NEW
170
      if (this.networkSession == null) {
×
NEW
171
        this.networkSession = new NetworkSession();
×
172
      }
NEW
173
      return new HubDocumentManager(this);
×
174
    }
175
  }
176
}
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