diff --git a/CHANGELOG.md b/CHANGELOG.md index de214b8aa..30d7db701 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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:__ diff --git a/src/main/java/com/box/sdk/BoxSearchParameters.java b/src/main/java/com/box/sdk/BoxSearchParameters.java index e3e0a1da8..764c5c116 100644 --- a/src/main/java/com/box/sdk/BoxSearchParameters.java +++ b/src/main/java/com/box/sdk/BoxSearchParameters.java @@ -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. */ @@ -60,6 +61,7 @@ public boolean clearParameters() { this.metadataFilter = null; this.sort = null; this.direction = null; + this.includeRecentSharedLinks = null; return true; } /** @@ -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. @@ -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; } }