o;
with qw/
Google::Client::Role::Token
Google::Client::Role::FurlAgent
/;
use Carp;
use Cpanel::JSON::XS;
has base_url => (
is => 'ro',
default => 'https://www.googleapis.com/drive/v3/files
ovided") unless ($id);
$content = $content ? encode_json($content) : undef;
my $url = $self->_url("/$id/copy", $params);
my $json = $self->_request(
method => 'POST',
url
=> $url,
content => $content
);
return $json;
}
sub create {
my ($self, $params, $content) = @_;
unless ( $content && %$content ) {
confess("No content provided to cr
e::FurlAgent::VERSION = '0.005';
use strict;
use warnings;
use Moo::Role;
use Carp;
use Cpanel::JSON::XS;
use Furl;
use URI;
has ua => (
is => 'ro',
default => sub { return Furl->new(); }
)
parameters
# accepted by L<Furl::request|https://metacpan.org/pod/Furl>. Returns the responses
# JSON.
# Will add an Authorization header with the access_token attributes value to the request.
# Can
h an error if the response code was not a successful one, or if there was
# an error decoding the JSON data. For requests that do not return any content, will
# just return undef to indicate we have r
le->set_cache_key('user-10-access-token');
# eg: use a Google::Client::Files client:
my $json = $google->files->list(); # lists all files available by calling: GET https://www.googleapis.com/