ibute
of the constructor
=head1 RESULTS
Results are returned as a Perl HashRef representing the JSON returned by the API.
=head1 SEE ALSO
L<https://apidocs.cloudhealthtech.com/>
There is a CLI wr
_api_id' },
{ name => 'api_version' },
{ name => 'name' },
] }
sub _url_params { [ ] }
sub _method { 'GET' }
sub _url { 'https://chapi.cloudhealthtech.com/api/search.json' }
1;
ge CloudHealth::API::ResultParser;
use Moo;
use JSON::MaybeXS;
use CloudHealth::API::Error;
has parser => (is => 'ro', default => sub { JSON::MaybeXS->new });
sub result2return {
my ($
oudHealth::API::Error->throw(
type => 'UnparseableResponse',
message => 'Can\'t parse JSON content',
detail => $response->content,
) if ($@);
my $message;
if (defined $s
:Tiny;
use JSON::MaybeXS;
use Module::Runtime qw/require_module/;
use CloudHealth::API::Error;
use CloudHealth::API::HTTPRequest;
has _json => (is => 'ro', default => sub { JSON::MaybeXS->n
(defined $body_struct) ? ('Content-Type' => 'application/json') : (),
Accept => 'application/json',
});
$req->content($self->_json->encode($body_struct)) if (defined $body_struct);