Q:

php deleting files from google storage using google-api-php-client

Trying below code for deleting files from google storage but getting the error "An error occurred: (delete) missing required param: 'object'". I am sending the filesId like this $fileId = 1458180875815000.
$google-api-php-client :- getting the google service
// code for delete
$bucketName = "bucketname";
    $googleServiceStorage = new Google_Service_Storage($this->client);
    //$googleServiceStorage = new Google_Service_Storage_StorageObject();
    try 
    {
        $googleServiceStorage->objects->delete($bucketName,$companyId,
            [
            'object' => $companyId."/".$objectName,
            'generation' => $fileId,
            'alt' => "media"
            ]
        );
        //$bucketName,$companyId,$objectName,$fileId);
    } 
    catch (Exception $e) 
    {
        print "An error occurred: " . $e->getMessage();
    }
}

A:

Here is how I am deleting files from GCS
$bucket = 'my_main_bucket';
$file = 'path/to/file/image.jpg';

$this->service = new Google_Service_Storage($this->client);

try
{
    $this->service->objects->delete($bucket, $file);
}
catch (Google_Service_Exception $e)
{
    syslog(LOG_ERR, $e);
}

