TasksModule
public class TasksModule
Provides Tasks management
-
Initializer
Declaration
Swift
public init(boxClient: BoxClient)Parameters
boxClientRequired for communicating with Box APIs.
-
Used to create a single task for single user on a single file.
Declaration
Swift
public func create( fileId: String, action: TaskAction, message: String? = nil, dueAt: Date? = nil, completionRule: TaskCompletionRule? = nil, fields: [String]? = nil, completion: @escaping Callback<Task> )Parameters
fileIdThe ID of the file this task is associated with.
actionThe action the task assignee will be prompted to do. Must be review for an approval task and complete for a general task
messageAn optional message to include with the task.
dueAtWhen this task is due.
completionRuleThe rule that determines whether a task is completed (default value set by API if not passed is all_assignees)
fieldsComma-separated list of fields to include in the response.
completionReturns a full task object or an error.
-
Updates a specific task.
Declaration
Swift
public func update( taskId: String, action: TaskAction, message: String? = nil, dueAt: Date? = nil, completionRule: TaskCompletionRule? = nil, fields: [String]? = nil, completion: @escaping Callback<Task> )Parameters
taskIdThe ID of the updated task.
actionThe action the task assignee will be prompted to do. Must be review for an approval task and complete for a general task
messageAn optional message to include with the task.
dueAtWhen this task is due.
completionRuleThe rule that determines whether a task is completed (default value set by API if not passed is all_assignees)
fieldsComma-separated list of fields to include in the response.
completionReturns a full task object or an error.
-
Fetches a specific task assignment.
Declaration
Swift
public func getAssignment( taskAssignmentId: String, fields: [String]? = nil, completion: @escaping Callback<TaskAssignment> )Parameters
taskAssignmentIdThe ID of the task assignment.
fieldsComma-separated list of fields to include in the response.
completionReturns a full task assignment object or an error.
-
Used to assign a task to a single user identified by userId. There can be multiple assignments on a given task.
Declaration
Swift
public func assign( taskId: String, userId: String, fields: [String]? = nil, completion: @escaping Callback<TaskAssignment> )Parameters
taskIdThe ID of the task this assignment is for.
userIdThe ID of the user this assignment is for.
fieldsComma-separated list of fields to include in the response.
completionReturns a full task assignment object or an error.
-
Used to assign a task to a single user identified by login. There can be multiple assignments on a given task.
Declaration
Swift
public func assignByEmail( taskId: String, email: String, fields: [String]? = nil, completion: @escaping Callback<TaskAssignment> )Parameters
taskIdThe ID of the task this assignment is for.
loginOptional. The login email address for the user this assignment is for.
fieldsComma-separated list of fields to include in the response.
completionReturns a full task assignment object or an error.
-
Used to update a task assignment.
Declaration
Swift
public func updateAssignment( taskAssignmentId: String, message: String? = nil, resolutionState: AssignmentState? = nil, completion: @escaping Callback<TaskAssignment> )Parameters
taskAssignmentIdThe ID of the task assignment.
messageAn optional message to include with the task.
resolutionStateOptional. The resolution state of task. When updating a task assignment, the resolution state depends on the action type of the task. If you want to update a review task, the resolution_state can be set to incomplete, approved, or rejected. A complete task can have a resolutionState of incomplete or completed.
completionReturns a full task assignment object or an error.
-
Fetches a all task assignments for particular task.
Declaration
Swift
public func listAssignments( forTaskId taskId: String, completion: @escaping Callback<[TaskAssignment]> )Parameters
taskAssignmentIdThe ID of the task assignment.
completionReturns a list of task assignments for some task or an error.
TasksModule Class Reference