The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

AnyEvent::WebService::Tracks - Access Tracks' API from AnyEvent

VERSION

0.02

SYNOPSIS

  use AnyEvent::WebService::Tracks;

  my $tracks = AnyEvent::WebService::Tracks->new(
    url      => 'http://my.tracks.instance/',
    username => 'user',
    password => 'pa55w0rd',
  );

  $tracks->projects(sub {
    my ( $projects ) = @_;

    say foreach @$projects;
  });

  AnyEvent->condvar->recv;

DESCRIPTION

AnyEvent::WebService::Tracks talks to Tracks' API from an AnyEvent loop, using AnyEvent::HTTP.

Before you go ahead and use this module, please make sure you run the test suite against the Tracks version you'll be using; I developed this module against Tracks 1.7.2, so I can't really guarantee it'll work with any other version. If you find a bug when running against another version, please let me know and I'll try to fix it as long as it doesn't break other versions.

METHODS

AnyEvent::WebService::Tracks->new(%params)

Creates a new AnyEvent::WebService::Tracks object. %params must contain the url, username, and password parameters.

$tracks->projects($callback)

Retrieves the list of projects in the given Tracks installation and provides them to the given callback. If the call fails, then a falsy value and the error message are provided to the callback.

$tracks->create_project($name, $callback) =head2 $tracks->create_project(%params, $callback)

Creates a new project with the given name (a hash of parameters can be provided instead of just a scalar name if more flexibility is desired) and passes the new project object to the given callback. If the call fails, then a falsy value and the error message are provided to the callback.

$tracks->contexts($callback)

Retrieves the list of contexts in the given Tracks installation and provides them to the given callback. If the call fails, then a falsy value and the error message are provided to the callback.

$tracks->create_context($name, $callback) =head2 $tracks->create_context(%params, $callback)

Creates a new context with the given name (a hash of parameters can be provided instead of just a scalar name if more flexibility is desired) and passes the new context object to the given callback. If the call fails, then a falsy value and the error message are provided to the callback.

$tracks->todos($callback)

Retrieves the list of todos in the given Tracks installation and provides them to the given callback. If the call fails, then a falsy value and the error message are provided to the callback.

$tracks->create_todo($name, $context, $callback) =head2 $tracks->create_todo(%params, $callback)

Creates a new todo with the given name and context (a hash of parameters can be provided instead of just two scalars if more flexibility is desired) and passes the new todo object to the given callback. If the call fails, then a falsy value and the error message are provided to the callback.

AUTHOR

Rob Hoelz, rob at hoelz.ro

BUGS

Please report any bugs or feature requests to bug-AnyEvent-WebService-Tracks at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=AnyEvent-WebService-Tracks. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

COPYRIGHT & LICENSE

Copyright 2011 Rob Hoelz.

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

SEE ALSO

http://getontracks.org