Module: TeamworkApi::API::TaskLists

Included in:
Client
Defined in:
lib/teamwork_api/api/task_lists.rb

Overview

Client methods for TaskLists developer.teamwork.com/projects/task-lists

Instance Method Summary collapse

Instance Method Details

#create_task_list(project_id, args) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/teamwork_api/api/task_lists.rb', line 8

def create_task_list(project_id, args)
  args =
    API.params(args)
       .required(:name)
       .optional(
         :private,
         :pinned,
         :'milestone-id',
         :description,
         :'todo-list-template-id',
         :'todo-list-template-start-date',
         :'todo-list-template-keep-off-weekends',
         :'todo-list-template-assignments'
       ).to_h

  response = post "projects/#{project_id}/tasklists.json", tasklist: args
  response['TASKLISTID']&.to_i
end

#delete_task_list(task_list_id) ⇒ Object



40
41
42
# File 'lib/teamwork_api/api/task_lists.rb', line 40

def delete_task_list(task_list_id)
  delete "/tasklists/#{task_list_id}.json"
end

#task_list(task_list_id) ⇒ Object

def update_task_list(task_list_id, args) end



30
31
32
33
# File 'lib/teamwork_api/api/task_lists.rb', line 30

def task_list(task_list_id)
  response = get "/tasklists/#{task_list_id}.json"
  response.body['todo-list']
end

#task_listsObject



35
36
37
38
# File 'lib/teamwork_api/api/task_lists.rb', line 35

def task_lists
  response = get '/tasklists.json'
  response.body['tasklists']
end