Skip to content

Commit

Permalink
docs: Update collaboration resource (box/box-openapi#483)
Browse files Browse the repository at this point in the history
  • Loading branch information
box-sdk-build committed Nov 20, 2024
1 parent 345d0cf commit 261f416
Show file tree
Hide file tree
Showing 15 changed files with 473 additions and 185 deletions.
2 changes: 1 addition & 1 deletion .codegen.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "engineHash": "6ae899a", "specHash": "c2c76f3", "version": "0.1.1" }
{ "engineHash": "6ae899a", "specHash": "6d5f53e", "version": "0.1.1" }
2 changes: 1 addition & 1 deletion docs/collections.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ See the endpoint docs at

### Returns

This function returns a value of type `Items`.
This function returns a value of type `ItemsOffsetPaginated`.

Returns an array of items in the collection.

Expand Down
4 changes: 2 additions & 2 deletions docs/listcollaborations.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ client.getListCollaborations().getCollaborations(new GetCollaborationsQueryParam

### Returns

This function returns a value of type `Collaborations`.
This function returns a value of type `CollaborationsOffsetPaginated`.

Returns a collection of pending collaboration objects.

Expand Down Expand Up @@ -144,7 +144,7 @@ client.getListCollaborations().getGroupCollaborations(group.getId())

### Returns

This function returns a value of type `Collaborations`.
This function returns a value of type `CollaborationsOffsetPaginated`.

Returns a collection of collaboration objects. If there are no
collaborations, an empty collection will be returned.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import com.box.sdkgen.networking.network.NetworkSession;
import com.box.sdkgen.schemas.collection.Collection;
import com.box.sdkgen.schemas.collections.Collections;
import com.box.sdkgen.schemas.items.Items;
import com.box.sdkgen.schemas.itemsoffsetpaginated.ItemsOffsetPaginated;
import com.box.sdkgen.serialization.json.JsonManager;
import java.util.Map;

Expand Down Expand Up @@ -68,20 +68,22 @@ public Collections getCollections(
return JsonManager.deserialize(response.getData(), Collections.class);
}

public Items getCollectionItems(String collectionId) {
public ItemsOffsetPaginated getCollectionItems(String collectionId) {
return getCollectionItems(
collectionId, new GetCollectionItemsQueryParams(), new GetCollectionItemsHeaders());
}

public Items getCollectionItems(String collectionId, GetCollectionItemsQueryParams queryParams) {
public ItemsOffsetPaginated getCollectionItems(
String collectionId, GetCollectionItemsQueryParams queryParams) {
return getCollectionItems(collectionId, queryParams, new GetCollectionItemsHeaders());
}

public Items getCollectionItems(String collectionId, GetCollectionItemsHeaders headers) {
public ItemsOffsetPaginated getCollectionItems(
String collectionId, GetCollectionItemsHeaders headers) {
return getCollectionItems(collectionId, new GetCollectionItemsQueryParams(), headers);
}

public Items getCollectionItems(
public ItemsOffsetPaginated getCollectionItems(
String collectionId,
GetCollectionItemsQueryParams queryParams,
GetCollectionItemsHeaders headers) {
Expand All @@ -108,7 +110,7 @@ public Items getCollectionItems(
.auth(this.auth)
.networkSession(this.networkSession)
.build());
return JsonManager.deserialize(response.getData(), Items.class);
return JsonManager.deserialize(response.getData(), ItemsOffsetPaginated.class);
}

public Collection getCollectionById(String collectionId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,53 @@ public class GetFolderCollaborationsQueryParams {

public List<String> fields;

public Long limit;

public String marker;

public GetFolderCollaborationsQueryParams() {}

protected GetFolderCollaborationsQueryParams(GetFolderCollaborationsQueryParamsBuilder builder) {
this.fields = builder.fields;
this.limit = builder.limit;
this.marker = builder.marker;
}

public List<String> getFields() {
return fields;
}

public Long getLimit() {
return limit;
}

public String getMarker() {
return marker;
}

public static class GetFolderCollaborationsQueryParamsBuilder {

protected List<String> fields;

protected Long limit;

protected String marker;

public GetFolderCollaborationsQueryParamsBuilder fields(List<String> fields) {
this.fields = fields;
return this;
}

public GetFolderCollaborationsQueryParamsBuilder limit(Long limit) {
this.limit = limit;
return this;
}

public GetFolderCollaborationsQueryParamsBuilder marker(String marker) {
this.marker = marker;
return this;
}

public GetFolderCollaborationsQueryParams build() {
return new GetFolderCollaborationsQueryParams(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import com.box.sdkgen.networking.fetch.FetchResponse;
import com.box.sdkgen.networking.network.NetworkSession;
import com.box.sdkgen.schemas.collaborations.Collaborations;
import com.box.sdkgen.schemas.collaborationsoffsetpaginated.CollaborationsOffsetPaginated;
import com.box.sdkgen.serialization.json.JsonManager;
import java.util.Map;

Expand Down Expand Up @@ -94,7 +95,11 @@ public Collaborations getFolderCollaborations(
GetFolderCollaborationsQueryParams queryParams,
GetFolderCollaborationsHeaders headers) {
Map<String, String> queryParamsMap =
prepareParams(mapOf(entryOf("fields", convertToString(queryParams.getFields()))));
prepareParams(
mapOf(
entryOf("fields", convertToString(queryParams.getFields())),
entryOf("limit", convertToString(queryParams.getLimit())),
entryOf("marker", convertToString(queryParams.getMarker()))));
Map<String, String> headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
FetchResponse response =
fetch(
Expand All @@ -115,11 +120,11 @@ public Collaborations getFolderCollaborations(
return JsonManager.deserialize(response.getData(), Collaborations.class);
}

public Collaborations getCollaborations(GetCollaborationsQueryParams queryParams) {
public CollaborationsOffsetPaginated getCollaborations(GetCollaborationsQueryParams queryParams) {
return getCollaborations(queryParams, new GetCollaborationsHeaders());
}

public Collaborations getCollaborations(
public CollaborationsOffsetPaginated getCollaborations(
GetCollaborationsQueryParams queryParams, GetCollaborationsHeaders headers) {
Map<String, String> queryParamsMap =
prepareParams(
Expand All @@ -141,25 +146,25 @@ public Collaborations getCollaborations(
.auth(this.auth)
.networkSession(this.networkSession)
.build());
return JsonManager.deserialize(response.getData(), Collaborations.class);
return JsonManager.deserialize(response.getData(), CollaborationsOffsetPaginated.class);
}

public Collaborations getGroupCollaborations(String groupId) {
public CollaborationsOffsetPaginated getGroupCollaborations(String groupId) {
return getGroupCollaborations(
groupId, new GetGroupCollaborationsQueryParams(), new GetGroupCollaborationsHeaders());
}

public Collaborations getGroupCollaborations(
public CollaborationsOffsetPaginated getGroupCollaborations(
String groupId, GetGroupCollaborationsQueryParams queryParams) {
return getGroupCollaborations(groupId, queryParams, new GetGroupCollaborationsHeaders());
}

public Collaborations getGroupCollaborations(
public CollaborationsOffsetPaginated getGroupCollaborations(
String groupId, GetGroupCollaborationsHeaders headers) {
return getGroupCollaborations(groupId, new GetGroupCollaborationsQueryParams(), headers);
}

public Collaborations getGroupCollaborations(
public CollaborationsOffsetPaginated getGroupCollaborations(
String groupId,
GetGroupCollaborationsQueryParams queryParams,
GetGroupCollaborationsHeaders headers) {
Expand All @@ -185,7 +190,7 @@ public Collaborations getGroupCollaborations(
.auth(this.auth)
.networkSession(this.networkSession)
.build());
return JsonManager.deserialize(response.getData(), Collaborations.class);
return JsonManager.deserialize(response.getData(), CollaborationsOffsetPaginated.class);
}

public Authentication getAuth() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,57 @@ public class GetMetadataTemplatesByInstanceIdQueryParams {

public final String metadataInstanceId;

public String marker;

public Long limit;

public GetMetadataTemplatesByInstanceIdQueryParams(String metadataInstanceId) {
this.metadataInstanceId = metadataInstanceId;
}

protected GetMetadataTemplatesByInstanceIdQueryParams(
GetMetadataTemplatesByInstanceIdQueryParamsBuilder builder) {
this.metadataInstanceId = builder.metadataInstanceId;
this.marker = builder.marker;
this.limit = builder.limit;
}

public String getMetadataInstanceId() {
return metadataInstanceId;
}

public String getMarker() {
return marker;
}

public Long getLimit() {
return limit;
}

public static class GetMetadataTemplatesByInstanceIdQueryParamsBuilder {

protected final String metadataInstanceId;

protected String marker;

protected Long limit;

public GetMetadataTemplatesByInstanceIdQueryParamsBuilder(String metadataInstanceId) {
this.metadataInstanceId = metadataInstanceId;
}

public GetMetadataTemplatesByInstanceIdQueryParamsBuilder marker(String marker) {
this.marker = marker;
return this;
}

public GetMetadataTemplatesByInstanceIdQueryParamsBuilder limit(Long limit) {
this.limit = limit;
return this;
}

public GetMetadataTemplatesByInstanceIdQueryParams build() {
return new GetMetadataTemplatesByInstanceIdQueryParams(this);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ public MetadataTemplates getMetadataTemplatesByInstanceId(
prepareParams(
mapOf(
entryOf(
"metadata_instance_id", convertToString(queryParams.getMetadataInstanceId()))));
"metadata_instance_id", convertToString(queryParams.getMetadataInstanceId())),
entryOf("marker", convertToString(queryParams.getMarker())),
entryOf("limit", convertToString(queryParams.getLimit()))));
Map<String, String> headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
FetchResponse response =
fetch(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,6 @@ public class Collaborations {
@JsonProperty("prev_marker")
protected String prevMarker;

@JsonProperty("total_count")
protected Long totalCount;

protected Long offset;

protected List<CollaborationsOrderField> order;

protected List<Collaboration> entries;

public Collaborations() {}
Expand All @@ -30,9 +23,6 @@ protected Collaborations(CollaborationsBuilder builder) {
this.limit = builder.limit;
this.nextMarker = builder.nextMarker;
this.prevMarker = builder.prevMarker;
this.totalCount = builder.totalCount;
this.offset = builder.offset;
this.order = builder.order;
this.entries = builder.entries;
}

Expand All @@ -48,18 +38,6 @@ public String getPrevMarker() {
return prevMarker;
}

public Long getTotalCount() {
return totalCount;
}

public Long getOffset() {
return offset;
}

public List<CollaborationsOrderField> getOrder() {
return order;
}

public List<Collaboration> getEntries() {
return entries;
}
Expand All @@ -76,15 +54,12 @@ public boolean equals(Object o) {
return Objects.equals(limit, casted.limit)
&& Objects.equals(nextMarker, casted.nextMarker)
&& Objects.equals(prevMarker, casted.prevMarker)
&& Objects.equals(totalCount, casted.totalCount)
&& Objects.equals(offset, casted.offset)
&& Objects.equals(order, casted.order)
&& Objects.equals(entries, casted.entries);
}

@Override
public int hashCode() {
return Objects.hash(limit, nextMarker, prevMarker, totalCount, offset, order, entries);
return Objects.hash(limit, nextMarker, prevMarker, entries);
}

@Override
Expand All @@ -102,18 +77,6 @@ public String toString() {
+ prevMarker
+ '\''
+ ", "
+ "totalCount='"
+ totalCount
+ '\''
+ ", "
+ "offset='"
+ offset
+ '\''
+ ", "
+ "order='"
+ order
+ '\''
+ ", "
+ "entries='"
+ entries
+ '\''
Expand All @@ -128,12 +91,6 @@ public static class CollaborationsBuilder {

protected String prevMarker;

protected Long totalCount;

protected Long offset;

protected List<CollaborationsOrderField> order;

protected List<Collaboration> entries;

public CollaborationsBuilder limit(Long limit) {
Expand All @@ -151,21 +108,6 @@ public CollaborationsBuilder prevMarker(String prevMarker) {
return this;
}

public CollaborationsBuilder totalCount(Long totalCount) {
this.totalCount = totalCount;
return this;
}

public CollaborationsBuilder offset(Long offset) {
this.offset = offset;
return this;
}

public CollaborationsBuilder order(List<CollaborationsOrderField> order) {
this.order = order;
return this;
}

public CollaborationsBuilder entries(List<Collaboration> entries) {
this.entries = entries;
return this;
Expand Down
Loading

0 comments on commit 261f416

Please sign in to comment.