example/GoogleUpload.php
protected function remove_duplicated($file)
    {
        $response = $this->service->files->listFiles([
            'q' => "'$this->folder_id' in parents and name contains '$file' and trashed=false",
        ]);

        foreach ($response->files as $found) {
            return $this->service->files->delete($found->id);
        }
    }
protected function remove_duplicated($file)
    {
        $response = $this->service->files->listFiles([
            'q' => "'$this->folder_id' in parents and name contains '$file' and trashed=false",
        ]);

        foreach ($response->files as $found) {
            return $this->service->files->delete($found->id);
        }
    }
protected function remove_duplicated ( $ file ) { $ response = $ this -> service -> files -> listFiles ( [ 'q' => "'$this->folder_id' in parents and name contains '$file' and trashed=false" , ] ) ; foreach ( $ response -> files as $ found ) { return $ this -> service -> files -> delete ( $ found -> id ) ; } }
remove duplicated files before adding new ones
again thats because google use 'id' not 'name'.

note that we cant search for files as bulk "a limitation in the drive Api it self"
so instead we call this method from a loop with all the files we want to remove

also note the some of the api methods are from the v2 even if we are using v3 in this example
google docs are often mis-guiding
https://developers.google.com/drive/v2/reference/
https://developers.google.com/drive/v3/web/search-parameters

@return [type] [description]
remove duplicated files before adding new ones again thats because google use id not name .