protected function prevent_writers_from_sharing_file(\repository_googledocs\rest $client, $fileid) {
        // We don't want anyone but Moodle to change the sharing settings.
        $params = [
            'fileid' => $fileid
        ];
        $update = [
            'writersCanShare' => false
        ];
        $response = $client->call('update', $params, json_encode($update));
        if (empty($response->id)) {
            $details = 'Cannot prevent writers from sharing document: ' . $fileid;
            throw new repository_exception('errorwhilecommunicatingwith', 'repository', '', $details);
        }
        return true;
    }
protected function prevent_writers_from_sharing_file(\repository_googledocs\rest $client, $fileid) {
        // We don't want anyone but Moodle to change the sharing settings.
        $params = [
            'fileid' => $fileid
        ];
        $update = [
            'writersCanShare' => false
        ];
        $response = $client->call('update', $params, json_encode($update));
        if (empty($response->id)) {
            $details = 'Cannot prevent writers from sharing document: ' . $fileid;
            throw new repository_exception('errorwhilecommunicatingwith', 'repository', '', $details);
        }
        return true;
    }
protected function prevent_writers_from_sharing_file ( \ repository_googledocs \ rest $ client , $ fileid ) { // We don't want anyone but Moodle to change the sharing settings. $ params = [ 'fileid' => $ fileid ] ; $ update = [ 'writersCanShare' => false ] ; $ response = $ client -> call ( 'update' , $ params , json_encode ( $ update ) ) ; if ( empty ( $ response -> id ) ) { $ details = 'Cannot prevent writers from sharing document: ' . $ fileid ; throw new repository_exception ( 'errorwhilecommunicatingwith' , 'repository' , '' , $ details ) ; } return true ; }
Prevent writers from sharing.

@param \repository_googledocs\rest $client Authenticated client.
@param string $fileid The file we are updating.
@return boolean
Prevent writers from sharing .