@BoxResourceType(value="task") public class BoxTask extends BoxResource
Modifier and Type | Class and Description |
---|---|
static class |
BoxTask.Action
Enumerates the possible actions that a task can have.
|
class |
BoxTask.Info
Contains information about a BoxTask.
|
Constructor and Description |
---|
BoxTask(BoxAPIConnection api,
String id)
Constructs a BoxTask for a task with a given ID.
|
Modifier and Type | Method and Description |
---|---|
BoxTaskAssignment.Info |
addAssignment(BoxUser assignTo)
Adds a new assignment to this task.
|
BoxTaskAssignment.Info |
addAssignmentByLogin(String assignToLogin)
Adds a new assignment to this task using user's login as identifier.
|
void |
delete()
Deletes this task.
|
Iterable<BoxTaskAssignment.Info> |
getAllAssignments(String... fields)
Gets an iterable of all the assignments of this task.
|
List<BoxTaskAssignment.Info> |
getAssignments()
Gets any assignments for this task.
|
BoxTask.Info |
getInfo()
Gets information about this task.
|
BoxTask.Info |
getInfo(String... fields)
Gets information about this task.
|
void |
updateInfo(BoxTask.Info info)
Updates the information about this task with any info fields that have been modified locally.
|
equals, getAPI, getID, getResourceType, hashCode
public BoxTask(BoxAPIConnection api, String id)
api
- the API connection to be used by the task.id
- the ID of the task.public void delete()
public BoxTaskAssignment.Info addAssignment(BoxUser assignTo)
assignTo
- the user to assign the assignment to.public BoxTaskAssignment.Info addAssignmentByLogin(String assignToLogin)
assignToLogin
- the login of user to assign the task to.public List<BoxTaskAssignment.Info> getAssignments()
public Iterable<BoxTaskAssignment.Info> getAllAssignments(String... fields)
fields
- the fields to retrieve.public BoxTask.Info getInfo()
public BoxTask.Info getInfo(String... fields)
fields
- the fields to retrieve.public void updateInfo(BoxTask.Info info)
The only fields that will be updated are the ones that have been modified locally. For example, the following code won't update any information (or even send a network request) since none of the info's fields were changed:
BoxTask task = new BoxTask(api, id); BoxTask.Info info = task.getInfo(); task.updateInfo(info);
info
- the updated info.