TasksModule

public class TasksModule

Provides Tasks management

Tasks

  • Fetches a specific task.

    Declaration

    Swift

    public func get(
        taskId: String,
        fields: [String]? = nil,
        completion: @escaping Callback<Task>
    )

    Parameters

    taskId

    The ID of the task.

    fields

    Comma-separated list of fields to include in the response.

    completion

    Returns a full task object or an error.

  • 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

    fileId

    The ID of the file this task is associated with.

    action

    The action the task assignee will be prompted to do. Must be review for an approval task and complete for a general task

    message

    An optional message to include with the task.

    dueAt

    When this task is due.

    completionRule

    The rule that determines whether a task is completed (default value set by API if not passed is all_assignees)

    fields

    Comma-separated list of fields to include in the response.

    completion

    Returns 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

    taskId

    The ID of the updated task.

    action

    The action the task assignee will be prompted to do. Must be review for an approval task and complete for a general task

    message

    An optional message to include with the task.

    dueAt

    When this task is due.

    completionRule

    The rule that determines whether a task is completed (default value set by API if not passed is all_assignees)

    fields

    Comma-separated list of fields to include in the response.

    completion

    Returns a full task object or an error.

  • Permanently deletes a specific task.

    Declaration

    Swift

    public func delete(
        taskId: String,
        completion: @escaping Callback<Void>
    )

    Parameters

    taskId

    The ID of the deleted task.

    completion

    Returns a full task object or an error.

Task Assignments

  • Fetches a specific task assignment.

    Declaration

    Swift

    public func getAssignment(
        taskAssignmentId: String,
        fields: [String]? = nil,
        completion: @escaping Callback<TaskAssignment>
    )

    Parameters

    taskAssignmentId

    The ID of the task assignment.

    fields

    Comma-separated list of fields to include in the response.

    completion

    Returns 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

    taskId

    The ID of the task this assignment is for.

    userId

    The ID of the user this assignment is for.

    fields

    Comma-separated list of fields to include in the response.

    completion

    Returns 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

    taskId

    The ID of the task this assignment is for.

    login

    Optional. The login email address for the user this assignment is for.

    fields

    Comma-separated list of fields to include in the response.

    completion

    Returns 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

    taskAssignmentId

    The ID of the task assignment.

    message

    An optional message to include with the task.

    resolutionState

    Optional. 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.

    completion

    Returns a full task assignment object or an error.

  • Permanently deletes a specific task.

    Declaration

    Swift

    public func deleteAssignment(
        taskAssignmentId: String,
        completion: @escaping Callback<Void>
    )

    Parameters

    taskId

    The ID of the deleted task.

    completion

    Returns a success or an error if task assignment can’t be deleted.

  • Fetches a all task assignments for particular task.

    Declaration

    Swift

    public func listAssignments(
        forTaskId taskId: String,
        completion: @escaping Callback<[TaskAssignment]>
    )

    Parameters

    taskAssignmentId

    The ID of the task assignment.

    completion

    Returns a list of task assignments for some task or an error.