* $oauth2Service = new Google\Service\Oauth2(...); * $v2 = $oauth2Service->v2; * */ class UserinfoV2 extends \Google\Service\Resource { } // Adding a class alias for backwards compatibility with the previous class name. class_alias(UserinfoV2::class, 'Google_Service_Oauth2_Resource_UserinfoV2');