Skip to content

Commit eaf27d0

Browse files
docs: Update collaboration resource (box/box-openapi#483) (#68)
1 parent 345d0cf commit eaf27d0

File tree

15 files changed

+473
-185
lines changed

15 files changed

+473
-185
lines changed

.codegen.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "engineHash": "6ae899a", "specHash": "c2c76f3", "version": "0.1.1" }
1+
{ "engineHash": "6ae899a", "specHash": "6d5f53e", "version": "0.1.1" }

docs/collections.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ See the endpoint docs at
5858

5959
### Returns
6060

61-
This function returns a value of type `Items`.
61+
This function returns a value of type `ItemsOffsetPaginated`.
6262

6363
Returns an array of items in the collection.
6464

docs/listcollaborations.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ client.getListCollaborations().getCollaborations(new GetCollaborationsQueryParam
106106

107107
### Returns
108108

109-
This function returns a value of type `Collaborations`.
109+
This function returns a value of type `CollaborationsOffsetPaginated`.
110110

111111
Returns a collection of pending collaboration objects.
112112

@@ -144,7 +144,7 @@ client.getListCollaborations().getGroupCollaborations(group.getId())
144144

145145
### Returns
146146

147-
This function returns a value of type `Collaborations`.
147+
This function returns a value of type `CollaborationsOffsetPaginated`.
148148

149149
Returns a collection of collaboration objects. If there are no
150150
collaborations, an empty collection will be returned.

src/main/java/com/box/sdkgen/managers/collections/CollectionsManager.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import com.box.sdkgen.networking.network.NetworkSession;
1414
import com.box.sdkgen.schemas.collection.Collection;
1515
import com.box.sdkgen.schemas.collections.Collections;
16-
import com.box.sdkgen.schemas.items.Items;
16+
import com.box.sdkgen.schemas.itemsoffsetpaginated.ItemsOffsetPaginated;
1717
import com.box.sdkgen.serialization.json.JsonManager;
1818
import java.util.Map;
1919

@@ -68,20 +68,22 @@ public Collections getCollections(
6868
return JsonManager.deserialize(response.getData(), Collections.class);
6969
}
7070

71-
public Items getCollectionItems(String collectionId) {
71+
public ItemsOffsetPaginated getCollectionItems(String collectionId) {
7272
return getCollectionItems(
7373
collectionId, new GetCollectionItemsQueryParams(), new GetCollectionItemsHeaders());
7474
}
7575

76-
public Items getCollectionItems(String collectionId, GetCollectionItemsQueryParams queryParams) {
76+
public ItemsOffsetPaginated getCollectionItems(
77+
String collectionId, GetCollectionItemsQueryParams queryParams) {
7778
return getCollectionItems(collectionId, queryParams, new GetCollectionItemsHeaders());
7879
}
7980

80-
public Items getCollectionItems(String collectionId, GetCollectionItemsHeaders headers) {
81+
public ItemsOffsetPaginated getCollectionItems(
82+
String collectionId, GetCollectionItemsHeaders headers) {
8183
return getCollectionItems(collectionId, new GetCollectionItemsQueryParams(), headers);
8284
}
8385

84-
public Items getCollectionItems(
86+
public ItemsOffsetPaginated getCollectionItems(
8587
String collectionId,
8688
GetCollectionItemsQueryParams queryParams,
8789
GetCollectionItemsHeaders headers) {
@@ -108,7 +110,7 @@ public Items getCollectionItems(
108110
.auth(this.auth)
109111
.networkSession(this.networkSession)
110112
.build());
111-
return JsonManager.deserialize(response.getData(), Items.class);
113+
return JsonManager.deserialize(response.getData(), ItemsOffsetPaginated.class);
112114
}
113115

114116
public Collection getCollectionById(String collectionId) {

src/main/java/com/box/sdkgen/managers/listcollaborations/GetFolderCollaborationsQueryParams.java

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,53 @@ public class GetFolderCollaborationsQueryParams {
66

77
public List<String> fields;
88

9+
public Long limit;
10+
11+
public String marker;
12+
913
public GetFolderCollaborationsQueryParams() {}
1014

1115
protected GetFolderCollaborationsQueryParams(GetFolderCollaborationsQueryParamsBuilder builder) {
1216
this.fields = builder.fields;
17+
this.limit = builder.limit;
18+
this.marker = builder.marker;
1319
}
1420

1521
public List<String> getFields() {
1622
return fields;
1723
}
1824

25+
public Long getLimit() {
26+
return limit;
27+
}
28+
29+
public String getMarker() {
30+
return marker;
31+
}
32+
1933
public static class GetFolderCollaborationsQueryParamsBuilder {
2034

2135
protected List<String> fields;
2236

37+
protected Long limit;
38+
39+
protected String marker;
40+
2341
public GetFolderCollaborationsQueryParamsBuilder fields(List<String> fields) {
2442
this.fields = fields;
2543
return this;
2644
}
2745

46+
public GetFolderCollaborationsQueryParamsBuilder limit(Long limit) {
47+
this.limit = limit;
48+
return this;
49+
}
50+
51+
public GetFolderCollaborationsQueryParamsBuilder marker(String marker) {
52+
this.marker = marker;
53+
return this;
54+
}
55+
2856
public GetFolderCollaborationsQueryParams build() {
2957
return new GetFolderCollaborationsQueryParams(this);
3058
}

src/main/java/com/box/sdkgen/managers/listcollaborations/ListCollaborationsManager.java

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import com.box.sdkgen.networking.fetch.FetchResponse;
1313
import com.box.sdkgen.networking.network.NetworkSession;
1414
import com.box.sdkgen.schemas.collaborations.Collaborations;
15+
import com.box.sdkgen.schemas.collaborationsoffsetpaginated.CollaborationsOffsetPaginated;
1516
import com.box.sdkgen.serialization.json.JsonManager;
1617
import java.util.Map;
1718

@@ -94,7 +95,11 @@ public Collaborations getFolderCollaborations(
9495
GetFolderCollaborationsQueryParams queryParams,
9596
GetFolderCollaborationsHeaders headers) {
9697
Map<String, String> queryParamsMap =
97-
prepareParams(mapOf(entryOf("fields", convertToString(queryParams.getFields()))));
98+
prepareParams(
99+
mapOf(
100+
entryOf("fields", convertToString(queryParams.getFields())),
101+
entryOf("limit", convertToString(queryParams.getLimit())),
102+
entryOf("marker", convertToString(queryParams.getMarker()))));
98103
Map<String, String> headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
99104
FetchResponse response =
100105
fetch(
@@ -115,11 +120,11 @@ public Collaborations getFolderCollaborations(
115120
return JsonManager.deserialize(response.getData(), Collaborations.class);
116121
}
117122

118-
public Collaborations getCollaborations(GetCollaborationsQueryParams queryParams) {
123+
public CollaborationsOffsetPaginated getCollaborations(GetCollaborationsQueryParams queryParams) {
119124
return getCollaborations(queryParams, new GetCollaborationsHeaders());
120125
}
121126

122-
public Collaborations getCollaborations(
127+
public CollaborationsOffsetPaginated getCollaborations(
123128
GetCollaborationsQueryParams queryParams, GetCollaborationsHeaders headers) {
124129
Map<String, String> queryParamsMap =
125130
prepareParams(
@@ -141,25 +146,25 @@ public Collaborations getCollaborations(
141146
.auth(this.auth)
142147
.networkSession(this.networkSession)
143148
.build());
144-
return JsonManager.deserialize(response.getData(), Collaborations.class);
149+
return JsonManager.deserialize(response.getData(), CollaborationsOffsetPaginated.class);
145150
}
146151

147-
public Collaborations getGroupCollaborations(String groupId) {
152+
public CollaborationsOffsetPaginated getGroupCollaborations(String groupId) {
148153
return getGroupCollaborations(
149154
groupId, new GetGroupCollaborationsQueryParams(), new GetGroupCollaborationsHeaders());
150155
}
151156

152-
public Collaborations getGroupCollaborations(
157+
public CollaborationsOffsetPaginated getGroupCollaborations(
153158
String groupId, GetGroupCollaborationsQueryParams queryParams) {
154159
return getGroupCollaborations(groupId, queryParams, new GetGroupCollaborationsHeaders());
155160
}
156161

157-
public Collaborations getGroupCollaborations(
162+
public CollaborationsOffsetPaginated getGroupCollaborations(
158163
String groupId, GetGroupCollaborationsHeaders headers) {
159164
return getGroupCollaborations(groupId, new GetGroupCollaborationsQueryParams(), headers);
160165
}
161166

162-
public Collaborations getGroupCollaborations(
167+
public CollaborationsOffsetPaginated getGroupCollaborations(
163168
String groupId,
164169
GetGroupCollaborationsQueryParams queryParams,
165170
GetGroupCollaborationsHeaders headers) {
@@ -185,7 +190,7 @@ public Collaborations getGroupCollaborations(
185190
.auth(this.auth)
186191
.networkSession(this.networkSession)
187192
.build());
188-
return JsonManager.deserialize(response.getData(), Collaborations.class);
193+
return JsonManager.deserialize(response.getData(), CollaborationsOffsetPaginated.class);
189194
}
190195

191196
public Authentication getAuth() {

src/main/java/com/box/sdkgen/managers/metadatatemplates/GetMetadataTemplatesByInstanceIdQueryParams.java

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,57 @@ public class GetMetadataTemplatesByInstanceIdQueryParams {
44

55
public final String metadataInstanceId;
66

7+
public String marker;
8+
9+
public Long limit;
10+
711
public GetMetadataTemplatesByInstanceIdQueryParams(String metadataInstanceId) {
812
this.metadataInstanceId = metadataInstanceId;
913
}
1014

15+
protected GetMetadataTemplatesByInstanceIdQueryParams(
16+
GetMetadataTemplatesByInstanceIdQueryParamsBuilder builder) {
17+
this.metadataInstanceId = builder.metadataInstanceId;
18+
this.marker = builder.marker;
19+
this.limit = builder.limit;
20+
}
21+
1122
public String getMetadataInstanceId() {
1223
return metadataInstanceId;
1324
}
25+
26+
public String getMarker() {
27+
return marker;
28+
}
29+
30+
public Long getLimit() {
31+
return limit;
32+
}
33+
34+
public static class GetMetadataTemplatesByInstanceIdQueryParamsBuilder {
35+
36+
protected final String metadataInstanceId;
37+
38+
protected String marker;
39+
40+
protected Long limit;
41+
42+
public GetMetadataTemplatesByInstanceIdQueryParamsBuilder(String metadataInstanceId) {
43+
this.metadataInstanceId = metadataInstanceId;
44+
}
45+
46+
public GetMetadataTemplatesByInstanceIdQueryParamsBuilder marker(String marker) {
47+
this.marker = marker;
48+
return this;
49+
}
50+
51+
public GetMetadataTemplatesByInstanceIdQueryParamsBuilder limit(Long limit) {
52+
this.limit = limit;
53+
return this;
54+
}
55+
56+
public GetMetadataTemplatesByInstanceIdQueryParams build() {
57+
return new GetMetadataTemplatesByInstanceIdQueryParams(this);
58+
}
59+
}
1460
}

src/main/java/com/box/sdkgen/managers/metadatatemplates/MetadataTemplatesManager.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ public MetadataTemplates getMetadataTemplatesByInstanceId(
4545
prepareParams(
4646
mapOf(
4747
entryOf(
48-
"metadata_instance_id", convertToString(queryParams.getMetadataInstanceId()))));
48+
"metadata_instance_id", convertToString(queryParams.getMetadataInstanceId())),
49+
entryOf("marker", convertToString(queryParams.getMarker())),
50+
entryOf("limit", convertToString(queryParams.getLimit()))));
4951
Map<String, String> headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
5052
FetchResponse response =
5153
fetch(

src/main/java/com/box/sdkgen/schemas/collaborations/Collaborations.java

Lines changed: 1 addition & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,6 @@ public class Collaborations {
1515
@JsonProperty("prev_marker")
1616
protected String prevMarker;
1717

18-
@JsonProperty("total_count")
19-
protected Long totalCount;
20-
21-
protected Long offset;
22-
23-
protected List<CollaborationsOrderField> order;
24-
2518
protected List<Collaboration> entries;
2619

2720
public Collaborations() {}
@@ -30,9 +23,6 @@ protected Collaborations(CollaborationsBuilder builder) {
3023
this.limit = builder.limit;
3124
this.nextMarker = builder.nextMarker;
3225
this.prevMarker = builder.prevMarker;
33-
this.totalCount = builder.totalCount;
34-
this.offset = builder.offset;
35-
this.order = builder.order;
3626
this.entries = builder.entries;
3727
}
3828

@@ -48,18 +38,6 @@ public String getPrevMarker() {
4838
return prevMarker;
4939
}
5040

51-
public Long getTotalCount() {
52-
return totalCount;
53-
}
54-
55-
public Long getOffset() {
56-
return offset;
57-
}
58-
59-
public List<CollaborationsOrderField> getOrder() {
60-
return order;
61-
}
62-
6341
public List<Collaboration> getEntries() {
6442
return entries;
6543
}
@@ -76,15 +54,12 @@ public boolean equals(Object o) {
7654
return Objects.equals(limit, casted.limit)
7755
&& Objects.equals(nextMarker, casted.nextMarker)
7856
&& Objects.equals(prevMarker, casted.prevMarker)
79-
&& Objects.equals(totalCount, casted.totalCount)
80-
&& Objects.equals(offset, casted.offset)
81-
&& Objects.equals(order, casted.order)
8257
&& Objects.equals(entries, casted.entries);
8358
}
8459

8560
@Override
8661
public int hashCode() {
87-
return Objects.hash(limit, nextMarker, prevMarker, totalCount, offset, order, entries);
62+
return Objects.hash(limit, nextMarker, prevMarker, entries);
8863
}
8964

9065
@Override
@@ -102,18 +77,6 @@ public String toString() {
10277
+ prevMarker
10378
+ '\''
10479
+ ", "
105-
+ "totalCount='"
106-
+ totalCount
107-
+ '\''
108-
+ ", "
109-
+ "offset='"
110-
+ offset
111-
+ '\''
112-
+ ", "
113-
+ "order='"
114-
+ order
115-
+ '\''
116-
+ ", "
11780
+ "entries='"
11881
+ entries
11982
+ '\''
@@ -128,12 +91,6 @@ public static class CollaborationsBuilder {
12891

12992
protected String prevMarker;
13093

131-
protected Long totalCount;
132-
133-
protected Long offset;
134-
135-
protected List<CollaborationsOrderField> order;
136-
13794
protected List<Collaboration> entries;
13895

13996
public CollaborationsBuilder limit(Long limit) {
@@ -151,21 +108,6 @@ public CollaborationsBuilder prevMarker(String prevMarker) {
151108
return this;
152109
}
153110

154-
public CollaborationsBuilder totalCount(Long totalCount) {
155-
this.totalCount = totalCount;
156-
return this;
157-
}
158-
159-
public CollaborationsBuilder offset(Long offset) {
160-
this.offset = offset;
161-
return this;
162-
}
163-
164-
public CollaborationsBuilder order(List<CollaborationsOrderField> order) {
165-
this.order = order;
166-
return this;
167-
}
168-
169111
public CollaborationsBuilder entries(List<Collaboration> entries) {
170112
this.entries = entries;
171113
return this;

0 commit comments

Comments
 (0)