Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add file request support #869

Merged
merged 7 commits into from
Feb 22, 2021
Merged
Show file tree
Hide file tree
Changes from 4 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
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
# Changelog

## Next Release

__New Features and Enhancements:__

- Add file request support ([#869](https://github.com/box/box-java-sdk/pull/869))

## 2.53.0 [2021-01-08]

__New Features and Enhancements:__

- Add offset and limit parameters to `BoxFolder.getChildren` ([#861]https://github.com/box/box-java-sdk/pull/861)
- Add offset and limit parameters to `BoxFolder.getChildren` ([#861](https://github.com/box/box-java-sdk/pull/861))

## 2.52.0 [2020-11-24]

Expand Down
72 changes: 72 additions & 0 deletions doc/file_requests.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
File Requests
=============

File request objects represent a file request associated with a folder.

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

- [Get a File Request's Information](#get-a-file-requests-information)
- [Copy a File Request's Information](#copy-a-file-requests-information)
- [Update a File Request's Information](#update-a-file-requests-information)
- [Delete a File Request](#delete-a-file-request)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

Get a File Requests's Information
sujaygarlanka marked this conversation as resolved.
Show resolved Hide resolved
------------------------

Calling [`getInfo()`][get-info] returns information on a file request.

```java
BoxFileRequest fileRequest = new BoxFileRequest(api, "id");
BoxFileRequest.Info fileRequestInfo = fileRequest.getInfo();
```

[get-info]: http://opensource.box.com/box-java-sdk/javadoc/com/box/sdk/BoxFileRequest.html#getInfo

Copy a File Request's Information
---------------------------

Calling [`copyInfo(BoxFileRequest.Info info, String folderId)`][copy-info] copies an existing file request that is already present
on one folder, and applies it to another folder.

```java
BoxFileRequest fileRequest = new BoxFileRequest(api, "id");
BoxFileRequest.Info fileRequestInfo = fileRequest.new Info();
fileRequestInfo.setDescription("Following documents are requested for your process");
fileRequestInfo.setIsDescriptionRequired(true);
fileRequestInfo.setStatus(BoxFileRequest.Status.ACTIVE);
fileRequestInfo = fileRequest.copyInfo(fileRequestInfo, "folderId");
```

[copy-info]: http://opensource.box.com/box-java-sdk/javadoc/com/box/sdk/BoxTask.html#copyInfo

Update a File Request's Information
---------------------------

Calling [`updateInfo(BoxFileRequest.Info info)`][update-info] updates a file request. This can be used to activate
or deactivate a file request.

```java
BoxFileRequest fileRequest = new BoxFileRequest(api, "id");
BoxFileRequest.Info fileRequestInfo = fileRequest.new Info();
fileRequestInfo.setDescription("Following documents are requested for your process");
fileRequestInfo.setIsDescriptionRequired(true);
fileRequestInfo.setStatus(BoxFileRequest.Status.ACTIVE);
fileRequestInfo = fileRequest.updateInfo(fileRequestInfo);
```

[update-info]: http://opensource.box.com/box-java-sdk/javadoc/com/box/sdk/BoxFileRequest.html#updateInfo

Delete a File Request
-------------

Calling [`delete()`][delete] deletes a file request permanently.

```java
BoxFileRequest fileRequest = new BoxFileRequest(api, "id");
fileRequest.delete();
```

[delete]: https://box.github.io/box-java-sdk/javadoc/com/box/sdk/BoxFileRequest.html#delete
Loading