0

The official documentation says:

/*
 * @param Google_Service_Drive $service Drive API service instance.
 */
$service->files->untrash($fileId);

But there is no such method in the library, if I call this I get:

[Error]                                                                  
  Call to undefined method Google\Service\Drive\Resource\Files::untrash()

My client library version is:

"google/apiclient": "^2.12.1",
gvlasov
  • 18,638
  • 21
  • 74
  • 110

1 Answers1

1

Client library version 2.12.1 uses Google Drive API v3, this new version doesn't have an untrashed() method but you can use update() instead, try this:

$FileMetadata = new Google_Service_Drive_DriveFile(
    array(
        'trashed' => false
    )
);

$service->files->update($fileId,$FileMetadata);

I found this post with additional examples of the differences between v2 and v3. You can also find more samples for this new version here.

Bryan Monterrosa
  • 1,385
  • 1
  • 3
  • 13