Skip to content

Commit 25c9596

Browse files
box-sdk-buildbox-sdk-build
andauthored
feat: Add new Hubs APIs and Hubs items API (box/box-openapi#538) (#666)
Co-authored-by: box-sdk-build <box-sdk-build@box.com>
1 parent 8ca3302 commit 25c9596

22 files changed

+1880
-16
lines changed

.codegen.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "engineHash": "7d973e2", "specHash": "8402463", "version": "1.16.0" }
1+
{ "engineHash": "fe7a2b2", "specHash": "7871ded", "version": "1.16.0" }

docs/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ the SDK are available by topic:
3737
- [Folders](folders.md)
3838
- [Groups](groups.md)
3939
- [Hub collaborations](hubCollaborations.md)
40+
- [Hub items](hubItems.md)
4041
- [Hubs](hubs.md)
4142
- [Integration mappings](integrationMappings.md)
4243
- [Invites](invites.md)

docs/hubItems.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# HubItemsManager
2+
3+
- [Get hub items](#get-hub-items)
4+
- [Manage hub items](#manage-hub-items)
5+
6+
## Get hub items
7+
8+
Retrieves all items associated with a Hub.
9+
10+
This operation is performed by calling function `getHubItemsV2025R0`.
11+
12+
See the endpoint docs at
13+
[API Reference](https://developer.box.com/reference/v2025.0/get-hub-items/).
14+
15+
_Currently we don't have an example for calling `getHubItemsV2025R0` in integration tests_
16+
17+
### Arguments
18+
19+
- queryParams `GetHubItemsV2025R0QueryParams`
20+
- Query parameters of getHubItemsV2025R0 method
21+
- optionalsInput `GetHubItemsV2025R0OptionalsInput`
22+
-
23+
24+
### Returns
25+
26+
This function returns a value of type `HubItemsV2025R0`.
27+
28+
Retrieves the items associated with the specified Hub.
29+
30+
## Manage hub items
31+
32+
Adds and/or removes Hub items from a Hub.
33+
34+
This operation is performed by calling function `createHubManageItemV2025R0`.
35+
36+
See the endpoint docs at
37+
[API Reference](https://developer.box.com/reference/v2025.0/post-hubs-id-manage-items/).
38+
39+
_Currently we don't have an example for calling `createHubManageItemV2025R0` in integration tests_
40+
41+
### Arguments
42+
43+
- hubId `string`
44+
- The unique identifier that represent a hub. The ID for any hub can be determined by visiting this hub in the web application and copying the ID from the URL. For example, for the URL `https://*.app.box.com/hubs/123` the `hub_id` is `123`. Example: "12345"
45+
- requestBody `HubItemsManageRequestV2025R0`
46+
- Request body of createHubManageItemV2025R0 method
47+
- optionalsInput `CreateHubManageItemV2025R0OptionalsInput`
48+
-
49+
50+
### Returns
51+
52+
This function returns a value of type `HubItemsManageResponseV2025R0`.

docs/hubs.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
# HubsManager
22

33
- [List all hubs](#list-all-hubs)
4+
- [Create hub](#create-hub)
45
- [List all hubs for requesting enterprise](#list-all-hubs-for-requesting-enterprise)
56
- [Get hub information by ID](#get-hub-information-by-id)
7+
- [Update hub information by ID](#update-hub-information-by-id)
68
- [Delete hub](#delete-hub)
9+
- [Copy hub](#copy-hub)
710

811
## List all hubs
912

@@ -39,6 +42,30 @@ This function returns a value of type `HubsV2025R0`.
3942

4043
Returns all hubs for the given user or enterprise.
4144

45+
## Create hub
46+
47+
Creates a new Hub.
48+
49+
This operation is performed by calling function `createHubV2025R0`.
50+
51+
See the endpoint docs at
52+
[API Reference](https://developer.box.com/reference/v2025.0/post-hubs/).
53+
54+
_Currently we don't have an example for calling `createHubV2025R0` in integration tests_
55+
56+
### Arguments
57+
58+
- requestBody `HubCreateRequestV2025R0`
59+
- Request body of createHubV2025R0 method
60+
- optionalsInput `CreateHubV2025R0OptionalsInput`
61+
-
62+
63+
### Returns
64+
65+
This function returns a value of type `HubV2025R0`.
66+
67+
Returns a new Hub object.
68+
4269
## List all hubs for requesting enterprise
4370

4471
Retrieves all hubs for a given enterprise.
@@ -103,6 +130,32 @@ This function returns a value of type `HubV2025R0`.
103130

104131
Returns a hub object.
105132

133+
## Update hub information by ID
134+
135+
Updates a Hub. Can be used to change title, description, or Hub settings.
136+
137+
This operation is performed by calling function `updateHubByIdV2025R0`.
138+
139+
See the endpoint docs at
140+
[API Reference](https://developer.box.com/reference/v2025.0/put-hubs-id/).
141+
142+
_Currently we don't have an example for calling `updateHubByIdV2025R0` in integration tests_
143+
144+
### Arguments
145+
146+
- hubId `string`
147+
- The unique identifier that represent a hub. The ID for any hub can be determined by visiting this hub in the web application and copying the ID from the URL. For example, for the URL `https://*.app.box.com/hubs/123` the `hub_id` is `123`. Example: "12345"
148+
- requestBody `HubUpdateRequestV2025R0`
149+
- Request body of updateHubByIdV2025R0 method
150+
- optionalsInput `UpdateHubByIdV2025R0OptionalsInput`
151+
-
152+
153+
### Returns
154+
155+
This function returns a value of type `HubV2025R0`.
156+
157+
Returns a Hub object.
158+
106159
## Delete hub
107160

108161
Deletes a single hub.
@@ -131,3 +184,31 @@ This function returns a value of type `undefined`.
131184

132185
A blank response is returned if the hub was
133186
successfully deleted.
187+
188+
## Copy hub
189+
190+
Creates a copy of a Hub.
191+
192+
The original Hub will not be modified.
193+
194+
This operation is performed by calling function `createHubCopyV2025R0`.
195+
196+
See the endpoint docs at
197+
[API Reference](https://developer.box.com/reference/v2025.0/post-hubs-id-copy/).
198+
199+
_Currently we don't have an example for calling `createHubCopyV2025R0` in integration tests_
200+
201+
### Arguments
202+
203+
- hubId `string`
204+
- The unique identifier that represent a hub. The ID for any hub can be determined by visiting this hub in the web application and copying the ID from the URL. For example, for the URL `https://*.app.box.com/hubs/123` the `hub_id` is `123`. Example: "12345"
205+
- requestBody `HubCopyRequestV2025R0`
206+
- Request body of createHubCopyV2025R0 method
207+
- optionalsInput `CreateHubCopyV2025R0OptionalsInput`
208+
-
209+
210+
### Returns
211+
212+
This function returns a value of type `HubV2025R0`.
213+
214+
Returns a new Hub object.

package-lock.json

Lines changed: 16 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/client.generated.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ import { DocgenTemplateManager } from './managers/docgenTemplate.generated.js';
7878
import { DocgenManager } from './managers/docgen.generated.js';
7979
import { HubsManager } from './managers/hubs.generated.js';
8080
import { HubCollaborationsManager } from './managers/hubCollaborations.generated.js';
81+
import { HubItemsManager } from './managers/hubItems.generated.js';
8182
import { ShieldListsManager } from './managers/shieldLists.generated.js';
8283
import { Authentication } from './networking/auth.generated.js';
8384
import { NetworkSession } from './networking/network.generated.js';
@@ -176,6 +177,7 @@ export class BoxClient {
176177
readonly docgen: DocgenManager;
177178
readonly hubs: HubsManager;
178179
readonly hubCollaborations: HubCollaborationsManager;
180+
readonly hubItems: HubItemsManager;
179181
readonly shieldLists: ShieldListsManager;
180182
constructor(
181183
fields: Omit<
@@ -256,6 +258,7 @@ export class BoxClient {
256258
| 'docgen'
257259
| 'hubs'
258260
| 'hubCollaborations'
261+
| 'hubItems'
259262
| 'shieldLists'
260263
| 'networkSession'
261264
| 'makeRequest'
@@ -585,6 +588,10 @@ export class BoxClient {
585588
auth: this.auth,
586589
networkSession: this.networkSession,
587590
});
591+
this.hubItems = new HubItemsManager({
592+
auth: this.auth,
593+
networkSession: this.networkSession,
594+
});
588595
this.shieldLists = new ShieldListsManager({
589596
auth: this.auth,
590597
networkSession: this.networkSession,

0 commit comments

Comments
 (0)