Skip to content

Commit 1df6712

Browse files
committed
feat: add hubs API beta endpoints (box/box-openapi#531)
1 parent cb4a66d commit 1df6712

21 files changed

+3462
-10
lines changed

.codegen.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "engineHash": "8a2df34", "specHash": "4beed7d", "version": "1.16.0" }
1+
{ "engineHash": "8a2df34", "specHash": "bf48b24", "version": "1.16.0" }

docs/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ the SDK are available by topic:
3636
- [Folder watermarks](folderWatermarks.md)
3737
- [Folders](folders.md)
3838
- [Groups](groups.md)
39+
- [Hub collaborations](hubCollaborations.md)
40+
- [Hubs](hubs.md)
3941
- [Integration mappings](integrationMappings.md)
4042
- [Invites](invites.md)
4143
- [Legal hold policies](legalHoldPolicies.md)

docs/hubCollaborations.md

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
# HubCollaborationsManager
2+
3+
- [Get hub collaborations](#get-hub-collaborations)
4+
- [Create hub collaboration](#create-hub-collaboration)
5+
- [Get hub collaboration by collaboration ID](#get-hub-collaboration-by-collaboration-id)
6+
- [Update hub collaboration](#update-hub-collaboration)
7+
- [Remove hub collaboration](#remove-hub-collaboration)
8+
9+
## Get hub collaborations
10+
11+
Retrieves all collaborations for a hub.
12+
13+
This operation is performed by calling function `getHubCollaborationsV2025R0`.
14+
15+
See the endpoint docs at
16+
[API Reference](https://developer.box.com/reference/v2025.0/get-hub-collaborations/).
17+
18+
_Currently we don't have an example for calling `getHubCollaborationsV2025R0` in integration tests_
19+
20+
### Arguments
21+
22+
- queryParams `GetHubCollaborationsV2025R0QueryParams`
23+
- Query parameters of getHubCollaborationsV2025R0 method
24+
- optionalsInput `GetHubCollaborationsV2025R0OptionalsInput`
25+
-
26+
27+
### Returns
28+
29+
This function returns a value of type `HubCollaborationsV2025R0`.
30+
31+
Retrieves the collaborations associated with the specified hub.
32+
33+
## Create hub collaboration
34+
35+
Adds a collaboration for a single user or a single group to a hub.
36+
37+
Collaborations can be created using email address, user IDs, or group IDs.
38+
39+
This operation is performed by calling function `createHubCollaborationV2025R0`.
40+
41+
See the endpoint docs at
42+
[API Reference](https://developer.box.com/reference/v2025.0/post-hub-collaborations/).
43+
44+
_Currently we don't have an example for calling `createHubCollaborationV2025R0` in integration tests_
45+
46+
### Arguments
47+
48+
- requestBody `HubCollaborationCreateRequestV2025R0`
49+
- Request body of createHubCollaborationV2025R0 method
50+
- optionalsInput `CreateHubCollaborationV2025R0OptionalsInput`
51+
-
52+
53+
### Returns
54+
55+
This function returns a value of type `HubCollaborationV2025R0`.
56+
57+
Returns a new hub collaboration object.
58+
59+
## Get hub collaboration by collaboration ID
60+
61+
Retrieves details for a hub collaboration by collaboration ID.
62+
63+
This operation is performed by calling function `getHubCollaborationByIdV2025R0`.
64+
65+
See the endpoint docs at
66+
[API Reference](https://developer.box.com/reference/v2025.0/get-hub-collaborations-id/).
67+
68+
_Currently we don't have an example for calling `getHubCollaborationByIdV2025R0` in integration tests_
69+
70+
### Arguments
71+
72+
- hubCollaborationId `string`
73+
- The ID of the hub collaboration. Example: "1234"
74+
- optionalsInput `GetHubCollaborationByIdV2025R0OptionalsInput`
75+
-
76+
77+
### Returns
78+
79+
This function returns a value of type `HubCollaborationV2025R0`.
80+
81+
Returns a hub collaboration object.
82+
83+
## Update hub collaboration
84+
85+
Updates a hub collaboration.
86+
Can be used to change the hub role.
87+
88+
This operation is performed by calling function `updateHubCollaborationByIdV2025R0`.
89+
90+
See the endpoint docs at
91+
[API Reference](https://developer.box.com/reference/v2025.0/put-hub-collaborations-id/).
92+
93+
_Currently we don't have an example for calling `updateHubCollaborationByIdV2025R0` in integration tests_
94+
95+
### Arguments
96+
97+
- hubCollaborationId `string`
98+
- The ID of the hub collaboration. Example: "1234"
99+
- requestBody `HubCollaborationUpdateRequestV2025R0`
100+
- Request body of updateHubCollaborationByIdV2025R0 method
101+
- optionalsInput `UpdateHubCollaborationByIdV2025R0OptionalsInput`
102+
-
103+
104+
### Returns
105+
106+
This function returns a value of type `HubCollaborationV2025R0`.
107+
108+
Returns an updated hub collaboration object.
109+
110+
## Remove hub collaboration
111+
112+
Deletes a single hub collaboration.
113+
114+
This operation is performed by calling function `deleteHubCollaborationByIdV2025R0`.
115+
116+
See the endpoint docs at
117+
[API Reference](https://developer.box.com/reference/v2025.0/delete-hub-collaborations-id/).
118+
119+
_Currently we don't have an example for calling `deleteHubCollaborationByIdV2025R0` in integration tests_
120+
121+
### Arguments
122+
123+
- hubCollaborationId `string`
124+
- The ID of the hub collaboration. Example: "1234"
125+
- optionalsInput `DeleteHubCollaborationByIdV2025R0OptionalsInput`
126+
-
127+
128+
### Returns
129+
130+
This function returns a value of type `undefined`.
131+
132+
A blank response is returned if the hub collaboration was
133+
successfully deleted.

docs/hubs.md

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
# HubsManager
2+
3+
- [List all hubs](#list-all-hubs)
4+
- [List all hubs for requesting enterprise](#list-all-hubs-for-requesting-enterprise)
5+
- [Get hub information by ID](#get-hub-information-by-id)
6+
- [Delete hub](#delete-hub)
7+
8+
## List all hubs
9+
10+
Retrieves all hubs for requesting user.
11+
12+
This operation is performed by calling function `getHubsV2025R0`.
13+
14+
See the endpoint docs at
15+
[API Reference](https://developer.box.com/reference/v2025.0/get-hubs/).
16+
17+
_Currently we don't have an example for calling `getHubsV2025R0` in integration tests_
18+
19+
### Arguments
20+
21+
- queryParams `GetHubsV2025R0QueryParams`
22+
- Query parameters of getHubsV2025R0 method
23+
- headersInput `GetHubsV2025R0HeadersInput`
24+
- Headers of getHubsV2025R0 method
25+
- cancellationToken `undefined | CancellationToken`
26+
- Token used for request cancellation.
27+
28+
### Returns
29+
30+
This function returns a value of type `HubsV2025R0`.
31+
32+
Returns all hubs for the given user or enterprise.
33+
34+
## List all hubs for requesting enterprise
35+
36+
Retrieves all hubs for a given enterprise.
37+
38+
Admins or Hub Co-admins of an enterprise
39+
with GCM scope can make this call.
40+
41+
This operation is performed by calling function `getEnterpriseHubsV2025R0`.
42+
43+
See the endpoint docs at
44+
[API Reference](https://developer.box.com/reference/v2025.0/get-enterprise-hubs/).
45+
46+
_Currently we don't have an example for calling `getEnterpriseHubsV2025R0` in integration tests_
47+
48+
### Arguments
49+
50+
- queryParams `GetEnterpriseHubsV2025R0QueryParams`
51+
- Query parameters of getEnterpriseHubsV2025R0 method
52+
- headersInput `GetEnterpriseHubsV2025R0HeadersInput`
53+
- Headers of getEnterpriseHubsV2025R0 method
54+
- cancellationToken `undefined | CancellationToken`
55+
- Token used for request cancellation.
56+
57+
### Returns
58+
59+
This function returns a value of type `HubsV2025R0`.
60+
61+
Returns all hubs for the given user or enterprise.
62+
63+
## Get hub information by ID
64+
65+
Retrieves details for a hub by its ID.
66+
67+
This operation is performed by calling function `getHubByIdV2025R0`.
68+
69+
See the endpoint docs at
70+
[API Reference](https://developer.box.com/reference/v2025.0/get-hubs-id/).
71+
72+
_Currently we don't have an example for calling `getHubByIdV2025R0` in integration tests_
73+
74+
### Arguments
75+
76+
- hubId `string`
77+
- 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"
78+
- optionalsInput `GetHubByIdV2025R0OptionalsInput`
79+
-
80+
81+
### Returns
82+
83+
This function returns a value of type `HubV2025R0`.
84+
85+
Returns a hub object.
86+
87+
## Delete hub
88+
89+
Deletes a single hub.
90+
91+
This operation is performed by calling function `deleteHubByIdV2025R0`.
92+
93+
See the endpoint docs at
94+
[API Reference](https://developer.box.com/reference/v2025.0/delete-hubs-id/).
95+
96+
_Currently we don't have an example for calling `deleteHubByIdV2025R0` in integration tests_
97+
98+
### Arguments
99+
100+
- hubId `string`
101+
- 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"
102+
- optionalsInput `DeleteHubByIdV2025R0OptionalsInput`
103+
-
104+
105+
### Returns
106+
107+
This function returns a value of type `undefined`.
108+
109+
A blank response is returned if the hub was
110+
successfully deleted.

package-lock.json

Lines changed: 9 additions & 9 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: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ import { AiManager } from './managers/ai.generated.js';
7676
import { AiStudioManager } from './managers/aiStudio.generated.js';
7777
import { DocgenTemplateManager } from './managers/docgenTemplate.generated.js';
7878
import { DocgenManager } from './managers/docgen.generated.js';
79+
import { HubsManager } from './managers/hubs.generated.js';
80+
import { HubCollaborationsManager } from './managers/hubCollaborations.generated.js';
7981
import { ShieldListsManager } from './managers/shieldLists.generated.js';
8082
import { Authentication } from './networking/auth.generated.js';
8183
import { NetworkSession } from './networking/network.generated.js';
@@ -172,6 +174,8 @@ export class BoxClient {
172174
readonly aiStudio: AiStudioManager;
173175
readonly docgenTemplate: DocgenTemplateManager;
174176
readonly docgen: DocgenManager;
177+
readonly hubs: HubsManager;
178+
readonly hubCollaborations: HubCollaborationsManager;
175179
readonly shieldLists: ShieldListsManager;
176180
constructor(
177181
fields: Omit<
@@ -250,6 +254,8 @@ export class BoxClient {
250254
| 'aiStudio'
251255
| 'docgenTemplate'
252256
| 'docgen'
257+
| 'hubs'
258+
| 'hubCollaborations'
253259
| 'shieldLists'
254260
| 'networkSession'
255261
| 'makeRequest'
@@ -571,6 +577,14 @@ export class BoxClient {
571577
auth: this.auth,
572578
networkSession: this.networkSession,
573579
});
580+
this.hubs = new HubsManager({
581+
auth: this.auth,
582+
networkSession: this.networkSession,
583+
});
584+
this.hubCollaborations = new HubCollaborationsManager({
585+
auth: this.auth,
586+
networkSession: this.networkSession,
587+
});
574588
this.shieldLists = new ShieldListsManager({
575589
auth: this.auth,
576590
networkSession: this.networkSession,

0 commit comments

Comments
 (0)