(JSONXSBool JSONPPBool)];
use MooseX::Types::Moose qw(Bool);
class_type JSONXSBool, { class => 'JSON::XS::Boolean' };
class_type JSONPPBool, { class => 'JSON::PP::Boolean' };
coerce Bool, from JSON
XSBool, via { 0 + $_ };
coerce Bool, from JSONPPBool, via { 0 + $_ };
1;
__END__
=pod
=head1 NAME
Net::OpenXchange::Types - Moose type library for Net::OpenXchange
=head1 VERSION
version 0.001
rror_params},
});
Net::OpenXchange::X::OX is an exception class which is thrown when the JSON
response body from OpenXchange indicates an error.
=head1 ATTRIBUTES
=head2 error
Required, th
action => 'list',
columns => $self->columns
),
Content => encode_json(\@ids),
);
my $res = $self->_send($req);
return map { $self->class->thaw($_) } @{ $r
is an exception class used for errors on the HTTP
level that occur before decoding OpenXchange's JSON response body.
=head1 ATTRIBUTES
=head2 request
Required, instance of L<HTTP::Request|HTTP::Re
mespace::autoclean;
# ABSTRACT: Connection to OpenXchange server
use HTTP::Request::Common;
use JSON;
use LWP::UserAgent;
use Net::OpenXchange::X::HTTP;
use Net::OpenXchange::X::OX;
use URI;
has ur
eq,
response => $res,
}
);
}
my $resdataref = decode_json($res->content);
if ($resdataref->{error}) {
Net::OpenXchange::X::OX->throw(
ded
as well.
=head2 send
my $resdata = $conn->send($req);
Send the request and decodes the JSON response body. If there is an error, it
throws L<Net::OpenXchange::X::HTTP|Net::OpenXchange::X::H