is there is any way to include files? I am writing PHP code in a rule, where I include another PHP file. 

include_once 'google-api-php-client/src/Google/autoload.php';


Where do I need to include files?
You can use module_load_include() to include a PHP file.

module_load_include('php', $type, 'includes/google-api-php-client/src/Google/autoload');


Where type can be either theme name or module name. I guess in this you are building some drupal module so it must be module type. In which case it will look for autoload.php file inside your name module directory. However internally it will do the require_once instead of include_once :)
You can use Libraries API module to include a php file. For this you will have to keep this google-api-php-client inside libraries folder. And you will perform these steps to implement it.

function hook_libraries_info() {
  $path = libraries_get_path('google-api-php-client');
  set_include_path($path."/src/" . PATH_SEPARATOR .  get_include_path());
  $libraries['google-api-php-client'] = array(
  'name' =&gt; 'Google OAuth2 Library',
  'vendor url' =&gt; 'http://code.google.com/p/google-api-php-client',
  'download url' =&gt; 'http://github.com/google/google-api-php-client/archive/master.zip',
  'version arguments' =&gt; array(
    'file' =&gt; 'src/Google/Client.php',
    'pattern' =&gt; '/LIBVER = "([0-9\.a-z]+)/',
    'lines' =&gt; 40,
  ),
  'versions' =&gt; array(
    '1.0.5-beta' =&gt; array(
      'files' =&gt; array(
        'php' =&gt; array(
          'src/Google/Client.php',
        )
      ),
    ),
    '1.1.5' =&gt; array(
      'files' =&gt; array(
        'php' =&gt; array(
          'src/Google/autoload.php',
        )
      )
    )
  ),
  'files' =&gt; array(
    'php' =&gt; array(
      'src/Google/Client.php',
    ),
   ),
  );
  return $libraries;
}


Note: The version is 1.0.5-beta, so you may need to change the version as per your API version.

Then to include this library in another module.

function hook_init() {
  $path = libraries_get_path('google-api-php-client');
  if ($path) {
    set_include_path($path."/src/" . PATH_SEPARATOR . get_include_path());
  }
}

Since it comes it composer.json/autoload.php you can use these modules to load it automatically from libraries folder.
X Autoload, Composer Autoload, Composer Vender Autoload, although you will still need to define the location inside your module.

&nbsp;

Using the XAutoload module

   function mymodule_libraries_info() {
     return array(
       'google-api-php-client' =&gt; array(
         'name' =&gt; 'Google Client Library',
         'xautoload' =&gt; function($adapter) {
           /** @var \Drupal\xautoload\Adapter\LocalDirectoryAdapter $adapter */
           // Scan sites/all/libraries/google-api-php-client/composer.json to look for
           // autoload information.
           $adapter-&gt;composerJson('composer.json');
         }
       )
     );
   }