module Toggl::Api::Task
Public Instance Methods
create_task(name, pid, options={})
click to toggle source
name: The name of the task (string, required, unique in project) pid: project ID for the task (integer, required)
wid: workspace ID, where the task will be saved (integer, project's workspace id is used when not supplied) uid: user ID, to whom the task is assigned to (integer, not required) estimated_seconds: estimated duration of task in seconds (integer, not required) active: whether the task is done or not (boolean, by default true) at: timestamp that is sent in the response for PUT, indicates the time task was last updated
# File lib/toggl_api/api/task.rb, line 13 def create_task(name, pid, options={}) post "/tasks", {"tag" => {"name" => name,"pid" =>pid}.merge(options)} end
delete_task(tid)
click to toggle source
# File lib/toggl_api/api/task.rb, line 30 def delete_task(tid) tids = tids.join(',') if tids.is_a?(Array) delete "/tasks/#{tids}" end
Also aliased as: bulk_delete_tasks
get_task(tid)
click to toggle source
# File lib/toggl_api/api/task.rb, line 17 def get_task(tid) get "/tasks/#{tid}" end
Also aliased as: task
update_task(tids, options)
click to toggle source
# File lib/toggl_api/api/task.rb, line 22 def update_task(tids, options) options = Hashie::Mash.new options tids = tids.join(',') if tids.is_a?(Array) put "/tasks/#{tids}",(options.key?(:task) ? options : {:task => options}) end
Also aliased as: bulk_update_tasks