Google::RestApi::Setup;
use File::Basename qw( dirname );
use Furl ();
use JSON::MaybeXS qw( decode_json encode_json JSON );
use List::Util ();
use Log::Log4perl qw( get_logger );
use Module::Load q
ntent};
my $request_json = defined $request_content ? encode_json($request_content) : (),
my @headers;
push(@headers, 'Content-Type' => 'application/json') if $request_json;
push(@headers, @{
));
my $req = HTTP::Request->new(
$request->{method}, $request->{uri}, \@headers, $request_json
);
# this is where the action is.
my ($response, $tries, $last_error) = $self->_api($req);
$p->{method} = 'post';
$p->{uri} = ':batchUpdate';
my $api = $self->api(%$p);
# grab the json decoded replies from the response.
my $responses = delete $api->{replies};
# present the resp
: 1161285259
# range: {}
# requestingUserCanEdit: !!perl/scalar:JSON::PP::Boolean 1
# warningOnly: !!perl/scalar:JSON::PP::Boolean 1
# - {}
# - {}
# submit_requests needs to be called by t
unt;
my $sa = Google::RestApi::Auth::ServiceAccount->new(
account_file => <path_to_account_json_file>,
scope => ['http://spreadsheets.google.com/feeds/'],
);
# generate an access
_); } @$range;
my $flat = join(', ', @flat);
return "[ $flat ]";
}
# changes perl boolean to json boolean.
sub bool {
my $bool = shift;
return 'true' if !defined $bool; # bold() should turn