File Coverage

blib/lib/WebService/Toggl/API/Task.pm
Criterion Covered Total %
statement 9 11 81.8
branch n/a
condition n/a
subroutine 3 5 60.0
pod n/a
total 12 16 75.0


line stmt bran cond sub pod time code
1             package WebService::Toggl::API::Task;
2              
3 1     1   1068 use WebService::Toggl::Role::Item as => 'JsonItem';
  1         1  
  1         6  
4              
5 1     1   36 use Moo;
  1         2  
  1         4  
6             with 'WebService::Toggl::Role::API';
7 1     1   374 use namespace::clean;
  1         2  
  1         4  
8              
9             with JsonItem(
10             bools => [ qw(active) ],
11             strings => [ qw(name) ],
12             integers => [ qw(pid wid uid estimated_seconds tracked_seconds) ],
13             timestamps => [ qw(at) ],
14             floats => [ qw() ],
15             );
16              
17              
18 0     0     sub api_path { 'tasks' }
19 0     0     sub api_id { shift->id }
20              
21              
22              
23             1;
24             __END__
25              
26              
27             Tasks are available only for pro workspaces.
28              
29             Task has the following properties
30              
31             name: The name of the task (string, required, unique in project)
32             pid: project ID for the task (integer, required)
33             wid: workspace ID, where the task will be saved (integer, project's workspace id is used when not supplied)
34             uid: user ID, to whom the task is assigned to (integer, not required)
35             estimated_seconds: estimated duration of task in seconds (integer, not required)
36             active: whether the task is done or not (boolean, by default true)
37             at: timestamp that is sent in the response for PUT, indicates the time task was last updated
38             tracked_seconds: total time tracked (in seconds) for the task
39              
40             Workspace id (wid) and project id (pid) can't be changed on update.