WWW::Asana - Client Class for accessing Asana API
version 0.003
my $asana = WWW::Asana->new( api_key => $asana_api_key, ); my $me = $asana->me; print $me->email; for (@{$asana->users}) { print $_->name; } my $current_me = $me->reload; my @workspaces = @{$me->workspaces}; my @tasks = @{$some_workspace->tasks($me)}; my @projects = @{$some_workspace->projects}; my @tags = @{$some_workspace->tags}; my $new_task = $some_workspace->create_task({ name => 'Test out WWW::Asana', notes => 'really cool library, should test it out', assignee => $me, }); $new_task->completed(1); $new_task->due_on($new_task->created_at + DateTime::Duration->new( days => 1 )); my $new_version_of_task = $new_task->update; $new_task->add_project($some_project); $new_task->add_tag($some_tag); my $story = $new_task->comment('I still didnt made it, DAMN!'); print $story->created_by->name;
This library gives an abstract to access the API of the Asana issue system.
API Key for the account given on the Account Settings of your Asana (see under API)
Version of the API in use, so far only 1.0 is supported and this is also the default value here.
Base of the URL of the Asana API, the default value here is.
LWP::UserAgent object used for the HTTP requests.
The user agent string used for the "useragent" object.
The timeout value in seconds used for the "useragent" object, defaults to default value of LWP::UserAgent.
Request class used to generate the request. Defaults to WWW::Asana::Request.
Response class used to handle the response of the request. Defaults to WWW::Asana::Response.
Takes a WWW::Asana::Request object and gives back a WWW::Asana::Response. If not given a WWW::Asana::Request, then it will pass the arguments to "get_request" to get one.
TODO: Adding an auto-retry option on reaching limits
Takes "base_uri", "version" and the arguments and joins them together with /.
Generates a WWW::Asana::Request out of the parameter. The first parameter is target class name given without the WWW::Asana:: namespace. The second parameter is the method to use for the generated request, the other parameters are taken as part of the URL on the Asana API. If additional is given a HashRef at the end of the parameters, then those are used as data for the request.
This method is actually executing a request specified by all parameters beside the first one, which are given to "get_request". On this response then is called "to" in WWW::Asana::Response with the first parameter as argument. The result of this is given back, the type then depends on the parameter for the "to" in WWW::Asana::Response function.
Makes a request to /users/me and gives back a WWW::Asana::User of yourself.
Makes a request to /users and gives back an arrayref of WWW::Asana::User with all the users of the system.
Makes a request to /users/ together with the first argument given, which needs to be an Asana user id. It gives back a WWW::Asana::User of the given user..