NAME

WWW::Google::Drive - Used to modify Google Drive data for service account (server-to-server)

SYNOPSIS

use WWW::Google::Drive;

my $gd = WWW::Google::Drive->new( 
    secret_json => 'YourProject.json',

     # Set the Google user to impersonate. 
     # Your Google Business Administrator must have already set up 
     # your Client ID as a trusted app in order to use this successfully.
    user_as => 'name@domain.com' #(optional)
);
my $children = $gd->children('/MyDocs');

foreach my $item (@{$children}){
    print "File name: $item->{name}\n";
}

DESCRIPTION

WWW::Google::Drive authenticates with a Google Drive service account (server-to-server) and offers several convenient methods to list, retrieve and modify the data stored in the google drive.

Refer: https://developers.google.com/identity/protocols/OAuth2ServiceAccount for creating a service account and the client_secret json file.

Refer: https://developers.google.com/drive/v3/reference/ for list of file properties, response values, query_params and body_params.

METHODS

Error handling

In case of an error while retrieving information from the Google Drive API, the methods above will return undef and a more detailed error message can be obtained by calling the error() method:

print "An error occurred: ", $gd->error();

LOGGING/DEBUGGING

WWW::Google::Drive is Log4perl-enabled. To find out what's going on under the hood, turn on Log4perl:

use Log::Log4perl qw(:easy);
Log::Log4perl->easy_init($DEBUG);

REPOSITORY

https://github.com/dinesh-it/www-google-drive

SEE ALSO

Net::Google::Drive::Simple Net::GoogleDrive

LICENSE

Copyright 2016 by Dinesh Dharmalingam, all rights reserved. This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.

AUTHORS

Dinesh D, <dinesh@exceleron.com>