package GCloud::CLIWrapper;
use Moose;
use JSON::MaybeXS;
use IPC::Open3;
use GCloud::CLIWrapper::Result;
our $VERSION = '0.01';
has gcloud => (is => 'ro', isa => 'Str', default => 'gclo
$self->input(undef, @command);
}
sub json {
my ($self, @command) = @_;
my $result = $self->run(@command);
my $struct = eval {
JSON->new->decode($result->output);
};
GCloud::CLIWrapper::Result->new(
rc => $result->rc,
output => $result->output,
json => $struct
);
}
sub input {
my ($self, $input, @params) = @_;
my @final_comma