Skip to content

Commit 9587c29

Browse files
committed
feat: Hub items API (box/box-openapi#538)
1 parent 715ac24 commit 9587c29

31 files changed

+2401
-1
lines changed

.codegen.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "engineHash": "fe7a2b2", "specHash": "719cda2", "version": "0.7.0" }
1+
{ "engineHash": "fe7a2b2", "specHash": "7871ded", "version": "0.7.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
* [Folderwatermarks](folderwatermarks.md)
3838
* [Groups](groups.md)
3939
* [Hubcollaborations](hubcollaborations.md)
40+
* [Hubitems](hubitems.md)
4041
* [Hubs](hubs.md)
4142
* [Integrationmappings](integrationmappings.md)
4243
* [Invites](invites.md)

docs/hubitems.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# HubItemsManager
2+
3+
4+
- [Get hub items](#get-hub-items)
5+
- [Manage hub items](#manage-hub-items)
6+
7+
## Get hub items
8+
9+
Retrieves all items associated with a Hub.
10+
11+
This operation is performed by calling function `getHubItemsV2025R0`.
12+
13+
See the endpoint docs at
14+
[API Reference](https://developer.box.com/reference/v2025.0/get-hub-items/).
15+
16+
*Currently we don't have an example for calling `getHubItemsV2025R0` in integration tests*
17+
18+
### Arguments
19+
20+
- queryParams `GetHubItemsV2025R0QueryParams`
21+
- Query parameters of getHubItemsV2025R0 method
22+
- headers `GetHubItemsV2025R0Headers`
23+
- Headers of getHubItemsV2025R0 method
24+
25+
26+
### Returns
27+
28+
This function returns a value of type `HubItemsV2025R0`.
29+
30+
Retrieves the items associated with the specified Hub.
31+
32+
33+
## Manage hub items
34+
35+
Adds and/or removes Hub items from a Hub.
36+
37+
This operation is performed by calling function `createHubManageItemV2025R0`.
38+
39+
See the endpoint docs at
40+
[API Reference](https://developer.box.com/reference/v2025.0/post-hubs-id-manage-items/).
41+
42+
*Currently we don't have an example for calling `createHubManageItemV2025R0` in integration tests*
43+
44+
### Arguments
45+
46+
- hubId `String`
47+
- 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"
48+
- requestBody `HubItemsManageRequestV2025R0`
49+
- Request body of createHubManageItemV2025R0 method
50+
- headers `CreateHubManageItemV2025R0Headers`
51+
- Headers of createHubManageItemV2025R0 method
52+
53+
54+
### Returns
55+
56+
This function returns a value of type `HubItemsManageResponseV2025R0`.
57+
58+
59+
60+

docs/hubs.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22

33

44
- [List all hubs](#list-all-hubs)
5+
- [Create hub](#create-hub)
56
- [List all hubs for requesting enterprise](#list-all-hubs-for-requesting-enterprise)
67
- [Get hub information by ID](#get-hub-information-by-id)
8+
- [Update hub information by ID](#update-hub-information-by-id)
79
- [Delete hub](#delete-hub)
10+
- [Copy hub](#copy-hub)
811

912
## List all hubs
1013

@@ -35,6 +38,32 @@ This function returns a value of type `HubsV2025R0`.
3538
Returns all hubs for the given user or enterprise.
3639

3740

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

4069
Retrieves all hubs for a given enterprise.
@@ -96,6 +125,34 @@ This function returns a value of type `HubV2025R0`.
96125
Returns a hub object.
97126

98127

128+
## Update hub information by ID
129+
130+
Updates a Hub. Can be used to change title, description, or Hub settings.
131+
132+
This operation is performed by calling function `updateHubByIdV2025R0`.
133+
134+
See the endpoint docs at
135+
[API Reference](https://developer.box.com/reference/v2025.0/put-hubs-id/).
136+
137+
*Currently we don't have an example for calling `updateHubByIdV2025R0` in integration tests*
138+
139+
### Arguments
140+
141+
- hubId `String`
142+
- 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"
143+
- requestBody `HubUpdateRequestV2025R0`
144+
- Request body of updateHubByIdV2025R0 method
145+
- headers `UpdateHubByIdV2025R0Headers`
146+
- Headers of updateHubByIdV2025R0 method
147+
148+
149+
### Returns
150+
151+
This function returns a value of type `HubV2025R0`.
152+
153+
Returns a Hub object.
154+
155+
99156
## Delete hub
100157

101158
Deletes a single hub.
@@ -126,3 +183,33 @@ A blank response is returned if the hub was
126183
successfully deleted.
127184

128185

186+
## Copy hub
187+
188+
Creates a copy of a Hub.
189+
190+
The original Hub will not be modified.
191+
192+
This operation is performed by calling function `createHubCopyV2025R0`.
193+
194+
See the endpoint docs at
195+
[API Reference](https://developer.box.com/reference/v2025.0/post-hubs-id-copy/).
196+
197+
*Currently we don't have an example for calling `createHubCopyV2025R0` in integration tests*
198+
199+
### Arguments
200+
201+
- hubId `String`
202+
- 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"
203+
- requestBody `HubCopyRequestV2025R0`
204+
- Request body of createHubCopyV2025R0 method
205+
- headers `CreateHubCopyV2025R0Headers`
206+
- Headers of createHubCopyV2025R0 method
207+
208+
209+
### Returns
210+
211+
This function returns a value of type `HubV2025R0`.
212+
213+
Returns a new Hub object.
214+
215+

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import com.box.sdkgen.managers.folderwatermarks.FolderWatermarksManager;
3636
import com.box.sdkgen.managers.groups.GroupsManager;
3737
import com.box.sdkgen.managers.hubcollaborations.HubCollaborationsManager;
38+
import com.box.sdkgen.managers.hubitems.HubItemsManager;
3839
import com.box.sdkgen.managers.hubs.HubsManager;
3940
import com.box.sdkgen.managers.integrationmappings.IntegrationMappingsManager;
4041
import com.box.sdkgen.managers.invites.InvitesManager;
@@ -248,6 +249,8 @@ public class BoxClient {
248249

249250
public final HubCollaborationsManager hubCollaborations;
250251

252+
public final HubItemsManager hubItems;
253+
251254
public final ShieldListsManager shieldLists;
252255

253256
public BoxClient(Authentication auth) {
@@ -569,6 +572,8 @@ public BoxClient(Authentication auth) {
569572
.auth(this.auth)
570573
.networkSession(this.networkSession)
571574
.build();
575+
this.hubItems =
576+
new HubItemsManager.Builder().auth(this.auth).networkSession(this.networkSession).build();
572577
this.shieldLists =
573578
new ShieldListsManager.Builder()
574579
.auth(this.auth)
@@ -895,6 +900,8 @@ protected BoxClient(Builder builder) {
895900
.auth(this.auth)
896901
.networkSession(this.networkSession)
897902
.build();
903+
this.hubItems =
904+
new HubItemsManager.Builder().auth(this.auth).networkSession(this.networkSession).build();
898905
this.shieldLists =
899906
new ShieldListsManager.Builder()
900907
.auth(this.auth)
@@ -1273,6 +1280,10 @@ public HubCollaborationsManager getHubCollaborations() {
12731280
return hubCollaborations;
12741281
}
12751282

1283+
public HubItemsManager getHubItems() {
1284+
return hubItems;
1285+
}
1286+
12761287
public ShieldListsManager getShieldLists() {
12771288
return shieldLists;
12781289
}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
package com.box.sdkgen.managers.hubitems;
2+
3+
import static com.box.sdkgen.internal.utils.UtilsManager.mapOf;
4+
5+
import com.box.sdkgen.parameters.v2025r0.boxversionheaderv2025r0.BoxVersionHeaderV2025R0;
6+
import com.box.sdkgen.serialization.json.EnumWrapper;
7+
import java.util.Map;
8+
9+
public class CreateHubManageItemV2025R0Headers {
10+
11+
public EnumWrapper<BoxVersionHeaderV2025R0> boxVersion;
12+
13+
public Map<String, String> extraHeaders;
14+
15+
public CreateHubManageItemV2025R0Headers() {
16+
this.boxVersion = new EnumWrapper<BoxVersionHeaderV2025R0>(BoxVersionHeaderV2025R0._2025_0);
17+
this.extraHeaders = mapOf();
18+
}
19+
20+
protected CreateHubManageItemV2025R0Headers(Builder builder) {
21+
this.boxVersion = builder.boxVersion;
22+
this.extraHeaders = builder.extraHeaders;
23+
}
24+
25+
public EnumWrapper<BoxVersionHeaderV2025R0> getBoxVersion() {
26+
return boxVersion;
27+
}
28+
29+
public Map<String, String> getExtraHeaders() {
30+
return extraHeaders;
31+
}
32+
33+
public static class Builder {
34+
35+
protected EnumWrapper<BoxVersionHeaderV2025R0> boxVersion;
36+
37+
protected Map<String, String> extraHeaders;
38+
39+
public Builder() {
40+
this.boxVersion = new EnumWrapper<BoxVersionHeaderV2025R0>(BoxVersionHeaderV2025R0._2025_0);
41+
this.extraHeaders = mapOf();
42+
}
43+
44+
public Builder boxVersion(BoxVersionHeaderV2025R0 boxVersion) {
45+
this.boxVersion = new EnumWrapper<BoxVersionHeaderV2025R0>(boxVersion);
46+
return this;
47+
}
48+
49+
public Builder boxVersion(EnumWrapper<BoxVersionHeaderV2025R0> boxVersion) {
50+
this.boxVersion = boxVersion;
51+
return this;
52+
}
53+
54+
public Builder extraHeaders(Map<String, String> extraHeaders) {
55+
this.extraHeaders = extraHeaders;
56+
return this;
57+
}
58+
59+
public CreateHubManageItemV2025R0Headers build() {
60+
return new CreateHubManageItemV2025R0Headers(this);
61+
}
62+
}
63+
}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
package com.box.sdkgen.managers.hubitems;
2+
3+
import static com.box.sdkgen.internal.utils.UtilsManager.mapOf;
4+
5+
import com.box.sdkgen.parameters.v2025r0.boxversionheaderv2025r0.BoxVersionHeaderV2025R0;
6+
import com.box.sdkgen.serialization.json.EnumWrapper;
7+
import java.util.Map;
8+
9+
public class GetHubItemsV2025R0Headers {
10+
11+
public EnumWrapper<BoxVersionHeaderV2025R0> boxVersion;
12+
13+
public Map<String, String> extraHeaders;
14+
15+
public GetHubItemsV2025R0Headers() {
16+
this.boxVersion = new EnumWrapper<BoxVersionHeaderV2025R0>(BoxVersionHeaderV2025R0._2025_0);
17+
this.extraHeaders = mapOf();
18+
}
19+
20+
protected GetHubItemsV2025R0Headers(Builder builder) {
21+
this.boxVersion = builder.boxVersion;
22+
this.extraHeaders = builder.extraHeaders;
23+
}
24+
25+
public EnumWrapper<BoxVersionHeaderV2025R0> getBoxVersion() {
26+
return boxVersion;
27+
}
28+
29+
public Map<String, String> getExtraHeaders() {
30+
return extraHeaders;
31+
}
32+
33+
public static class Builder {
34+
35+
protected EnumWrapper<BoxVersionHeaderV2025R0> boxVersion;
36+
37+
protected Map<String, String> extraHeaders;
38+
39+
public Builder() {
40+
this.boxVersion = new EnumWrapper<BoxVersionHeaderV2025R0>(BoxVersionHeaderV2025R0._2025_0);
41+
this.extraHeaders = mapOf();
42+
}
43+
44+
public Builder boxVersion(BoxVersionHeaderV2025R0 boxVersion) {
45+
this.boxVersion = new EnumWrapper<BoxVersionHeaderV2025R0>(boxVersion);
46+
return this;
47+
}
48+
49+
public Builder boxVersion(EnumWrapper<BoxVersionHeaderV2025R0> boxVersion) {
50+
this.boxVersion = boxVersion;
51+
return this;
52+
}
53+
54+
public Builder extraHeaders(Map<String, String> extraHeaders) {
55+
this.extraHeaders = extraHeaders;
56+
return this;
57+
}
58+
59+
public GetHubItemsV2025R0Headers build() {
60+
return new GetHubItemsV2025R0Headers(this);
61+
}
62+
}
63+
}

0 commit comments

Comments
 (0)