Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
# Changelog

## Next Release

__New Features and Enhancements:__

- Add support for search param to get shared link items ([#855](https://github.com/box/box-java-sdk/pull/855))

## 2.51.1 [2020-11-12]

__Bug Fixes:__
Expand Down
24 changes: 24 additions & 0 deletions src/main/java/com/box/sdk/BoxSearchParameters.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public class BoxSearchParameters {
private BoxMetadataFilter metadataFilter;
private String sort;
private String direction;
private Boolean includeRecentSharedLinks;
/**
* Creates a Box Search Parameters Objects without query set, specific for Metadata Only Searches.
*/
Expand Down Expand Up @@ -60,6 +61,7 @@ public boolean clearParameters() {
this.metadataFilter = null;
this.sort = null;
this.direction = null;
this.includeRecentSharedLinks = null;
return true;
}
/**
Expand Down Expand Up @@ -277,6 +279,23 @@ public String getDirection() {
return this.direction;
}

/**
* Set the include recent shared links field to determine whether to include items accessible only via shared link
* in the Box Search results.
* @param includeRecentSharedLinks Whether to include items accessible only via shared link in the response.
*/
public void setIncludeRecentSharedLinks(Boolean includeRecentSharedLinks) {
this.includeRecentSharedLinks = includeRecentSharedLinks;
}

/**
* Retrieves the include recent shared links field.
* @return The include recent shared links field.
*/
public Boolean getIncludeRecentSharedLinks() {
return this.includeRecentSharedLinks;
}

/**
* Checks String to see if the parameter is null.
* @param paramValue Object that will be checked if null.
Expand Down Expand Up @@ -399,6 +418,11 @@ public QueryStringBuilder getQueryParameters() {
if (!this.isNullOrEmpty(this.direction)) {
builder.appendParam("direction", this.direction);
}

//Include Recent Shared Links
if (!this.isNullOrEmpty(this.includeRecentSharedLinks)) {
builder.appendParam("include_recent_shared_links", this.includeRecentSharedLinks.toString());
}
return builder;
}
}