NAME
WebService::Toggl::Role::Item - Create roles for all WebService::Toggl::API Items
SYNOPSIS
package WebService::Toggl::API::Tag;
use WebService::Toggl::Role::Item as => 'JsonItem';
use Moo;
with 'WebService::Toggl::API';
use namespace::clean;
with JsonItem(
bools => [ qw() ],
strings => [ qw(name) ],
integers => [ qw(id wid) ],
);
sub api_path { 'tags' }
sub api_id { shift->id }
DESCRIPTION
This package constructs dynamic roles for WebService::Toggl::API objects representing individual Items. The calling class gives it a list of boolean fields, a list of string fields, and a list of integer fields. This package will then construct type-checked accessors for all the provided attributes to fetch them from the raw response. Calling the constructed attributes will cause an API request to be made, unless the raw data already exists in the object.
Provided Attributes
raw
The raw data returned from an API request.
Wrapped Methods
my_url
Returns the API URL for the object.
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>