original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: Prevent writers from sharing.
  
  @param \repository_googledocs\rest $client Authenticated client.
  @param string $fileid The file we are updating.
  @return boolean
docstring_tokens: Prevent writers from sharing .