na::Request::VERSION = '0.003';
}
# ABSTRACT: Asana Request Class
use MooX qw(
+HTTP::Request
+JSON
+URI
+URI::QueryParam
);
has api_key => (
is => 'ro',
required => 1,
);
has to => (
is =>
uest { shift->_http_request }
has json => (
is => 'ro',
lazy => 1,
builder => 1,
);
sub _build_json {
my $json = JSON->new;
$json->allow_nonref;
return $json;
}
sub _build__http_request {
my
string;
if ($self->method ne 'GET') {
push @headers, ('Content-type', 'application/json');
$body = $self->json->encode({ data => $self->data });
} elsif (%data) {
warn 'Request includes %data
sponse::VERSION = '0.003';
}
# ABSTRACT: Asana Response Class
use MooX qw(
+WWW::Asana::Error
+JSON
);
use Class::Load ':all';
with 'WWW::Asana::Role::HasClient';
has request => (
is => 'ro',
@_;
return [] unless $self->has_errors;
my @errors;
if (defined $self->json_decoded_body->{errors}) {
for (@{$self->json_decoded_body->{errors}}) {
push @errors, WWW::Asana::Error->new(
m
f $self->code == 500;
}
has json => (
is => 'ro',
lazy => 1,
builder => 1,
);
sub _build_json {
my $json = JSON->new;
$json->allow_nonref;
return $json;
}
has json_decoded_body => (
is => 'r