NAME

WebService::Toggl::Report::Summary - Toggl summary report object

SYNOPSIS

use WebService::Toggl;
my $toggl = WebService::Toggl->new({api_key => 'foo'});

my $report = $toggl->summary({
  workspace_id => 1234,
  grouping => 'projects', subgrouping => 'time_entries',
});

say $report->total_billable;  # billable milliseconds
for $project (@{ $report->data }) {
  say "Time Entries For project $project->{title}{project}:";
  for my $item (@{ $project->{items} }) {
    say $item->{title}{time_entry} . " took "
      . ($entry->{time} / 1000) . " seconds";
  }
}

DESCRIPTION

This module is a wrapper object around the Toggl summary report described here. It returns a report of properties that are grouped and subgrouped according to the specified request attributes.

REQUEST ATTRIBUTES

Request attributes common to all reports are detailed in the ::Role::Request pod.

grouping / subgrouping

The primary and secondary grouping properties. Defaults to projects and time_entries respectively. The following combinations are valid:

+--------------------------------------------------------+
|           |                Group                       |
|           +--------------+--------------+--------------+
|           | projects     | clients      | users        |
+-----------+--------------+--------------+--------------+
|           | time_entries | time_entries | time_entries |
| Valid     | tasks        | tasks        | tasks        |
| Subgroups | users        | users        |              |
|           |              | projects     | projects     |
|           |              |              | clients      |
+-----------+--------------+--------------+--------------+

subgrouping_ids

Boolean that determines if an ids key containing a comma-separated list of subgroup ids will be added each group in the data key.

grouped_time_entry_ids

Boolean that determines if a time_entry_ids key containing a comma-separated list of time entry IDs will be added each group in the data key.

RESPONSE ATTRIBUTES

Response attributes common to all reports are detailed in the ::Role::Request pod.

::Report::Summary returns no additional response attributes.

REPORT DATA

The data() attribute of a ::Report::Summary object is an arrayref of grouping hashrefs. Each group hashref will contain id, title, and items keys. The items key holds an arrayref of the requested subgrouping objects. For a detailed description of the contents of this structure, see the Toggl API docs.

LICENSE

Copyright (C) Fitz Elliott.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

AUTHOR

Fitz Elliott <felliott@fiskur.org>