::SSH::Key;
#for requesting
use LWP::UserAgent;
use LWP::Protocol::https;
#for dealing with JSON
use JSON::XS;
#for printing pretty deaths
use Data::Dumper qw//;
#DigitalOcean packages
use Digital
#set json header
$req->header('Content-Type' => 'application/json');
#put json in body
my $json_coder = JSON::XS->new->ascii->allow_nonref;
my $req_body = $json_coder
($req_body);
}
my $response = $self->ua->request($req);
my $json;
if($response->content) {
$json = JSON::XS->new->utf8->decode($response->content);
#die with DigitalO
use strict;
package DigitalOcean::Response;
use Mouse;
has json => (
is => 'ro',
isa => 'Any',
);
has status_code => (
is => 'rw',
isa => 'Num',
);
has status_message => (
is =
equired => 1,
);
has type_name => (
is => 'rw',
isa => 'Str',
required => 1,
);
has json_key => (
is => 'rw',
isa => 'Str',
required => 1,
);
has objects => (
is => 'r
ts
$self->objects($self->DigitalOcean->_decode_many($self->type_name, $self->response->json->{$self->json_key}));
$self->_init_obj;
if($self->response->links and $self->response->links->