I am trying to create a new Shared Drive using the Google PHP API.
I am using the code which is in the Google API docs (https://developers.google.com/drive/api/v3/manage-shareddrives) but this is returning an error.
require_once ('vendor/autoload.php');
$driveMetadata = new Google_Service_Drive_Drive(array(
'name' => 'Project Resources'));
$requestId = Uuid::uuid4()->toString();
$drive = $driveService->drives->create($requestId, $driveMetadata, array(
'fields' => 'id'));
printf("Drive ID: %s\n", $drive->id);
This should be returning the Drive ID but instead I receive the following error:
Fatal error: Class 'Google_Service_Drive_Drive' not found in /home//public_html/blocks/google-api-php-client/test.php on line 31
Is the code example in the Google Docs incorrect or am I being stupid?