AM role functionality
=head1 VERSION
version 0.002
=head1 DESCRIPTION
Coming soon.
=cut
use JSON::MaybeXS;
use Time::Moment;
use Log::Any qw($log);
=head1 METHODS
=cut
sub new {
my ($class,
Requesting credentials from [%s]", "$uri");
$self->ua->get($uri)->then(sub {
my $data = $self->json->decode(shift);
return Future->fail("Invalid return code", iam => $data->{Code}, $data) unless
uri} }
sub build_uri { my $self = shift; URI->new(join '', $self->base_uri, @_) }
sub json { shift->{json} ||= JSON::MaybeXS->new }
sub ua { shift->{ua} // die "no user agent provided" }
1;
__END__