<?php

if (class_exists('Google_Client', false)) {
    // Prevent error with preloading in PHP 7.4
    // @see https://github.com/googleapis/google-api-php-client/issues/1976
    return;
}

$classMap = [
    'SheetWise\Vendor\Google\\Client' => 'Google_Client',
    'SheetWise\Vendor\Google\\Service' => 'Google_Service',
    'SheetWise\Vendor\Google\\AccessToken\\Revoke' => 'Google_AccessToken_Revoke',
    'SheetWise\Vendor\Google\\AccessToken\\Verify' => 'Google_AccessToken_Verify',
    'SheetWise\Vendor\Google\\Model' => 'Google_Model',
    'SheetWise\Vendor\Google\\Utils\\UriTemplate' => 'Google_Utils_UriTemplate',
    'SheetWise\Vendor\Google\\AuthHandler\\Guzzle6AuthHandler' => 'Google_AuthHandler_Guzzle6AuthHandler',
    'SheetWise\Vendor\Google\\AuthHandler\\Guzzle7AuthHandler' => 'Google_AuthHandler_Guzzle7AuthHandler',
    'SheetWise\Vendor\Google\\AuthHandler\\AuthHandlerFactory' => 'Google_AuthHandler_AuthHandlerFactory',
    'SheetWise\Vendor\Google\\Http\\Batch' => 'Google_Http_Batch',
    'SheetWise\Vendor\Google\\Http\\MediaFileUpload' => 'Google_Http_MediaFileUpload',
    'SheetWise\Vendor\Google\\Http\\REST' => 'Google_Http_REST',
    'SheetWise\Vendor\Google\\Task\\Retryable' => 'Google_Task_Retryable',
    'SheetWise\Vendor\Google\\Task\\Exception' => 'Google_Task_Exception',
    'SheetWise\Vendor\Google\\Task\\Runner' => 'Google_Task_Runner',
    'SheetWise\Vendor\Google\\Collection' => 'Google_Collection',
    'SheetWise\Vendor\Google\\Service\\Exception' => 'Google_Service_Exception',
    'SheetWise\Vendor\Google\\Service\\Resource' => 'Google_Service_Resource',
    'SheetWise\Vendor\Google\\Exception' => 'Google_Exception',
];

foreach ($classMap as $class => $alias) {
    class_alias($class, $alias);
}

/**
 * This class needs to be defined explicitly as scripts must be recognized by
 * the autoloader.
 */
class Google_Task_Composer extends \SheetWise\Vendor\Google\Task\Composer
{
}

/** @phpstan-ignore-next-line */
if (\false) {
    class Google_AccessToken_Revoke extends \SheetWise\Vendor\Google\AccessToken\Revoke
    {
    }
    class Google_AccessToken_Verify extends \SheetWise\Vendor\Google\AccessToken\Verify
    {
    }
    class Google_AuthHandler_AuthHandlerFactory extends \SheetWise\Vendor\Google\AuthHandler\AuthHandlerFactory
    {
    }
    class Google_AuthHandler_Guzzle6AuthHandler extends \SheetWise\Vendor\Google\AuthHandler\Guzzle6AuthHandler
    {
    }
    class Google_AuthHandler_Guzzle7AuthHandler extends \SheetWise\Vendor\Google\AuthHandler\Guzzle7AuthHandler
    {
    }
    class Google_Client extends \SheetWise\Vendor\Google\Client
    {
    }
    class Google_Collection extends \SheetWise\Vendor\Google\Collection
    {
    }
    class Google_Exception extends \SheetWise\Vendor\Google\Exception
    {
    }
    class Google_Http_Batch extends \SheetWise\Vendor\Google\Http\Batch
    {
    }
    class Google_Http_MediaFileUpload extends \SheetWise\Vendor\Google\Http\MediaFileUpload
    {
    }
    class Google_Http_REST extends \SheetWise\Vendor\Google\Http\REST
    {
    }
    class Google_Model extends \SheetWise\Vendor\Google\Model
    {
    }
    class Google_Service extends \SheetWise\Vendor\Google\Service
    {
    }
    class Google_Service_Exception extends \SheetWise\Vendor\Google\Service\Exception
    {
    }
    class Google_Service_Resource extends \SheetWise\Vendor\Google\Service\Resource
    {
    }
    class Google_Task_Exception extends \SheetWise\Vendor\Google\Task\Exception
    {
    }
    interface Google_Task_Retryable extends \SheetWise\Vendor\Google\Task\Retryable
    {
    }
    class Google_Task_Runner extends \SheetWise\Vendor\Google\Task\Runner
    {
    }
    class Google_Utils_UriTemplate extends \SheetWise\Vendor\Google\Utils\UriTemplate
    {
    }
}
