VMware vCloud Director REST API.
This differs from L<VMware::vCloudDirector> in that it uses the JSON flavoured
version of the API, which has subtly different naming conventions (which is why
I didn'
der => '_build_id' );
has _partial_object => ( is => 'rw', isa => 'Bool', default => 0 );
has is_json => ( is => 'rw', isa => 'Bool', default => 0 );
# --------------------------------------
if ( $hash->{type} =~ m!^application/vnd\..*\.(\w+)\+(json|xml)$! );
$params->{is_json} = ( $2 eq 'json' ) ? 1 : 0;
}
# if this has a links section it is a
ndles => { all_links => 'elements', },
);
method _build_links () {
my @links = grep { $_->is_json } $self->all_links;
return \@links;
}
method _build_all_links () {
my @links;
if ( e
> 'ro', isa => 'Str', predicate => 'has_name' );
has type => ( is => 'ro', isa => 'Str' );
has is_json => ( is => 'ro', isa => 'Bool' );
# ------------------------------------------------------------
if ( $type =~ m!^application/vnd\..*\.(\w+)\+(json|xml)$! ) {
$params->{type} = $1;
$params->{is_json} = ( $2 eq 'json' ) ? 1 : 0;
}
}
}
::Signatures;
use MooseX::Types::Path::Tiny qw(Path);
use MooseX::Types::URI qw(Uri);
use Cpanel::JSON::XS;
use LWP::UserAgent::Determined;
use MIME::Base64;
use Mozilla::CA;
use Path::Tiny;
use Ref::
s/', $self->hostname ) ); }
method _build_default_accept_header () {
return ( 'application/*+json;version=' . $self->api_version );
}
method _debug (@parameters) { warn join( '', '# ', @parameter
--------------
has _json => (
is => 'ro',
isa => 'Cpanel::JSON::XS',
lazy => 1,
builder => '_build_json',
);
method _build_json () { return Cpanel::JSON::XS->new->utf8->al