Skip to content

Commit d895e58

Browse files
feat: add hubs API beta endpoints (box/box-openapi#531) (#341)
1 parent 8c4ecda commit d895e58

File tree

47 files changed

+4277
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+4277
-1
lines changed

.codegen.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "engineHash": "f5a9cc9", "specHash": "4beed7d", "version": "0.7.0" }
1+
{ "engineHash": "8a2df34", "specHash": "bf48b24", "version": "0.7.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
* [Folders](folders.md)
3737
* [Folderwatermarks](folderwatermarks.md)
3838
* [Groups](groups.md)
39+
* [Hubcollaborations](hubcollaborations.md)
40+
* [Hubs](hubs.md)
3941
* [Integrationmappings](integrationmappings.md)
4042
* [Invites](invites.md)
4143
* [Legalholdpolicies](legalholdpolicies.md)

docs/hubcollaborations.md

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

docs/hubs.md

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

src/main/java/com/box/sdkgen/client/BoxClient.java

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
import com.box.sdkgen.managers.folders.FoldersManager;
3535
import com.box.sdkgen.managers.folderwatermarks.FolderWatermarksManager;
3636
import com.box.sdkgen.managers.groups.GroupsManager;
37+
import com.box.sdkgen.managers.hubcollaborations.HubCollaborationsManager;
38+
import com.box.sdkgen.managers.hubs.HubsManager;
3739
import com.box.sdkgen.managers.integrationmappings.IntegrationMappingsManager;
3840
import com.box.sdkgen.managers.invites.InvitesManager;
3941
import com.box.sdkgen.managers.legalholdpolicies.LegalHoldPoliciesManager;
@@ -242,6 +244,10 @@ public class BoxClient {
242244

243245
public final DocgenManager docgen;
244246

247+
public final HubsManager hubs;
248+
249+
public final HubCollaborationsManager hubCollaborations;
250+
245251
public final ShieldListsManager shieldLists;
246252

247253
public BoxClient(Authentication auth) {
@@ -556,6 +562,13 @@ public BoxClient(Authentication auth) {
556562
.build();
557563
this.docgen =
558564
new DocgenManager.Builder().auth(this.auth).networkSession(this.networkSession).build();
565+
this.hubs =
566+
new HubsManager.Builder().auth(this.auth).networkSession(this.networkSession).build();
567+
this.hubCollaborations =
568+
new HubCollaborationsManager.Builder()
569+
.auth(this.auth)
570+
.networkSession(this.networkSession)
571+
.build();
559572
this.shieldLists =
560573
new ShieldListsManager.Builder()
561574
.auth(this.auth)
@@ -875,6 +888,13 @@ protected BoxClient(Builder builder) {
875888
.build();
876889
this.docgen =
877890
new DocgenManager.Builder().auth(this.auth).networkSession(this.networkSession).build();
891+
this.hubs =
892+
new HubsManager.Builder().auth(this.auth).networkSession(this.networkSession).build();
893+
this.hubCollaborations =
894+
new HubCollaborationsManager.Builder()
895+
.auth(this.auth)
896+
.networkSession(this.networkSession)
897+
.build();
878898
this.shieldLists =
879899
new ShieldListsManager.Builder()
880900
.auth(this.auth)
@@ -1245,6 +1265,14 @@ public DocgenManager getDocgen() {
12451265
return docgen;
12461266
}
12471267

1268+
public HubsManager getHubs() {
1269+
return hubs;
1270+
}
1271+
1272+
public HubCollaborationsManager getHubCollaborations() {
1273+
return hubCollaborations;
1274+
}
1275+
12481276
public ShieldListsManager getShieldLists() {
12491277
return shieldLists;
12501278
}

0 commit comments

Comments
 (0)