Request Object.
Once the object has been made, an HTTP call to the CloudFlare API
is made. The JSON returned is used to construct a Response object
loaded from Response:: with the same name as the
package WebService::CloudFlare::Host::Role::Response;
use Moose::Role;
use JSON;
use Data::Dumper;
use Moose::Util::TypeConstraints;
requires 'res_map';
sub BUILDARGS {
my ( $class, $http ) = @_
00."
unless $http->code == 200;
my $json = decode_json( $http->content );
my %map = $class->res_map;
my $args = { __JSON__ => $json };
%map = __PACKAGE__->add_map_defaults( %
tmp_json = $json;
for my $elem ( @elems ) {
next OUTER unless exists $tmp_json->{$elem};
$tmp_json = $tmp_json->{$elem};
}
$args->{$key} = $tmp_json;
is => 'rw', isa => 'Str', required => 0 );
# JSON boolean values, coerced into 1|0 (Not Required)
has [qw/ zone_deleted /]
=> ( is => 'ro', isa => 'json_bool', coerce => 1, required => 0 );
1;
has [qw/ zones /]
=> ( is => 'rw', isa => 'ArrayRef[Str]|Undef', required => 0 );
has [qw/ user_exists user_authed /]
=> ( is => 'rw', isa => 'json_bool', required => 1, coerce => 1 );
1;
shRef[Str]|Undef', required => 0 );
# JSON boolean values, coerced into 1|0 (Not Required)
has [qw/ zone_exists zone_hosted /]
=> ( is => 'ro', isa => 'json_bool', required => 0, coerce => 1 );