/**
  * Helper method to execute deferred HTTP requests.
  *
  * @param $request Google_Http_Request|Google_Http_Batch
  * @throws Google_Exception
  * @return object of the type of the expected class or array.
  */
 public function execute($request)
 {
     if ($request instanceof App_Google_Http_Request) {
         $request->setUserAgent($this->getApplicationName() . " " . self::USER_AGENT_SUFFIX . $this->getLibraryVersion());
         if (!$this->getClassConfig("Google_Http_Request", "disable_gzip")) {
             $request->enableGzip();
         }
         $request->maybeMoveParametersToBody();
         return App_Google_Http_REST::execute($this, $request);
     } else {
         if ($request instanceof App_Google_Http_Batch) {
             return $request->execute();
         } else {
             throw new App_Google_Exception("Do not know how to execute this type of object.");
         }
     }
 }