eX::Params::Validate;
use URI;
use LWP::UserAgent;
use JSON::Any;
use WWW::3Taps::API::Types qw( Source Category Location Timestamp JSONMap
JSONBoolean Retvals List Dimension ReferenceType Notificat
}
);
has _json_handler => (
is => 'rw',
default => sub { JSON::Any->new( utf8 => 1, allow_nonref => 1 ) },
handles => {
_from_json => 'from_json',
_to_json => 'to_json'
},
);
execTimeMs => 325,
# numResults => 141087,
# success => bless( do { \( my $o = 1 ) }, 'JSON::XS::Boolean' )
# results => [
# {
# category => "VAUT",
# externalU
n Timestamp JSONMap
JSONBoolean Retvals List Dimension ReferenceType
NotificationFormat )
];
use MooseX::Types::Moose qw(Int Str ArrayRef HashRef Any);
use DateTimeX::Easy;
use JSON::Any;
subt
'must be a valid date' };
subtype JSONMap,
as Str,
where { eval { ref( JSON::Any->new(utf8 => 1)->from_json($_) ) eq 'HASH'} },
message { 'must be a valid JSON map of key/value pairs' };
subty
{ 'Must be "source", "category", or "location"'};
subtype JSONBoolean,
as Str,
where {/^true|false$/ },
message { 'Must contain a json boolean: "true" or "false"' };
subtype NotificationFormat