Initial commit
This commit is contained in:
7
wp-content/plugins/wp-mail-smtp/vendor/autoload.php
vendored
Normal file
7
wp-content/plugins/wp-mail-smtp/vendor/autoload.php
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
// autoload.php @generated by Composer
|
||||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInit4589a9f05a03f0a29add21e0e493a064::getLoader();
|
445
wp-content/plugins/wp-mail-smtp/vendor/composer/ClassLoader.php
vendored
Normal file
445
wp-content/plugins/wp-mail-smtp/vendor/composer/ClassLoader.php
vendored
Normal file
@ -0,0 +1,445 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Composer.
|
||||
*
|
||||
* (c) Nils Adermann <naderman@naderman.de>
|
||||
* Jordi Boggiano <j.boggiano@seld.be>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
/**
|
||||
* ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
|
||||
*
|
||||
* $loader = new \Composer\Autoload\ClassLoader();
|
||||
*
|
||||
* // register classes with namespaces
|
||||
* $loader->add('Symfony\Component', __DIR__.'/component');
|
||||
* $loader->add('Symfony', __DIR__.'/framework');
|
||||
*
|
||||
* // activate the autoloader
|
||||
* $loader->register();
|
||||
*
|
||||
* // to enable searching the include path (eg. for PEAR packages)
|
||||
* $loader->setUseIncludePath(true);
|
||||
*
|
||||
* In this example, if you try to use a class in the Symfony\Component
|
||||
* namespace or one of its children (Symfony\Component\Console for instance),
|
||||
* the autoloader will first look for the class under the component/
|
||||
* directory, and it will then fallback to the framework/ directory if not
|
||||
* found before giving up.
|
||||
*
|
||||
* This class is loosely based on the Symfony UniversalClassLoader.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
* @author Jordi Boggiano <j.boggiano@seld.be>
|
||||
* @see http://www.php-fig.org/psr/psr-0/
|
||||
* @see http://www.php-fig.org/psr/psr-4/
|
||||
*/
|
||||
class ClassLoader
|
||||
{
|
||||
// PSR-4
|
||||
private $prefixLengthsPsr4 = array();
|
||||
private $prefixDirsPsr4 = array();
|
||||
private $fallbackDirsPsr4 = array();
|
||||
|
||||
// PSR-0
|
||||
private $prefixesPsr0 = array();
|
||||
private $fallbackDirsPsr0 = array();
|
||||
|
||||
private $useIncludePath = false;
|
||||
private $classMap = array();
|
||||
private $classMapAuthoritative = false;
|
||||
private $missingClasses = array();
|
||||
private $apcuPrefix;
|
||||
|
||||
public function getPrefixes()
|
||||
{
|
||||
if (!empty($this->prefixesPsr0)) {
|
||||
return call_user_func_array('array_merge', $this->prefixesPsr0);
|
||||
}
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
public function getPrefixesPsr4()
|
||||
{
|
||||
return $this->prefixDirsPsr4;
|
||||
}
|
||||
|
||||
public function getFallbackDirs()
|
||||
{
|
||||
return $this->fallbackDirsPsr0;
|
||||
}
|
||||
|
||||
public function getFallbackDirsPsr4()
|
||||
{
|
||||
return $this->fallbackDirsPsr4;
|
||||
}
|
||||
|
||||
public function getClassMap()
|
||||
{
|
||||
return $this->classMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $classMap Class to filename map
|
||||
*/
|
||||
public function addClassMap(array $classMap)
|
||||
{
|
||||
if ($this->classMap) {
|
||||
$this->classMap = array_merge($this->classMap, $classMap);
|
||||
} else {
|
||||
$this->classMap = $classMap;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a set of PSR-0 directories for a given prefix, either
|
||||
* appending or prepending to the ones previously set for this prefix.
|
||||
*
|
||||
* @param string $prefix The prefix
|
||||
* @param array|string $paths The PSR-0 root directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
*/
|
||||
public function add($prefix, $paths, $prepend = false)
|
||||
{
|
||||
if (!$prefix) {
|
||||
if ($prepend) {
|
||||
$this->fallbackDirsPsr0 = array_merge(
|
||||
(array) $paths,
|
||||
$this->fallbackDirsPsr0
|
||||
);
|
||||
} else {
|
||||
$this->fallbackDirsPsr0 = array_merge(
|
||||
$this->fallbackDirsPsr0,
|
||||
(array) $paths
|
||||
);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$first = $prefix[0];
|
||||
if (!isset($this->prefixesPsr0[$first][$prefix])) {
|
||||
$this->prefixesPsr0[$first][$prefix] = (array) $paths;
|
||||
|
||||
return;
|
||||
}
|
||||
if ($prepend) {
|
||||
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
||||
(array) $paths,
|
||||
$this->prefixesPsr0[$first][$prefix]
|
||||
);
|
||||
} else {
|
||||
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
||||
$this->prefixesPsr0[$first][$prefix],
|
||||
(array) $paths
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a set of PSR-4 directories for a given namespace, either
|
||||
* appending or prepending to the ones previously set for this namespace.
|
||||
*
|
||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||
* @param array|string $paths The PSR-4 base directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public function addPsr4($prefix, $paths, $prepend = false)
|
||||
{
|
||||
if (!$prefix) {
|
||||
// Register directories for the root namespace.
|
||||
if ($prepend) {
|
||||
$this->fallbackDirsPsr4 = array_merge(
|
||||
(array) $paths,
|
||||
$this->fallbackDirsPsr4
|
||||
);
|
||||
} else {
|
||||
$this->fallbackDirsPsr4 = array_merge(
|
||||
$this->fallbackDirsPsr4,
|
||||
(array) $paths
|
||||
);
|
||||
}
|
||||
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
|
||||
// Register directories for a new namespace.
|
||||
$length = strlen($prefix);
|
||||
if ('\\' !== $prefix[$length - 1]) {
|
||||
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
||||
}
|
||||
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
||||
$this->prefixDirsPsr4[$prefix] = (array) $paths;
|
||||
} elseif ($prepend) {
|
||||
// Prepend directories for an already registered namespace.
|
||||
$this->prefixDirsPsr4[$prefix] = array_merge(
|
||||
(array) $paths,
|
||||
$this->prefixDirsPsr4[$prefix]
|
||||
);
|
||||
} else {
|
||||
// Append directories for an already registered namespace.
|
||||
$this->prefixDirsPsr4[$prefix] = array_merge(
|
||||
$this->prefixDirsPsr4[$prefix],
|
||||
(array) $paths
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a set of PSR-0 directories for a given prefix,
|
||||
* replacing any others previously set for this prefix.
|
||||
*
|
||||
* @param string $prefix The prefix
|
||||
* @param array|string $paths The PSR-0 base directories
|
||||
*/
|
||||
public function set($prefix, $paths)
|
||||
{
|
||||
if (!$prefix) {
|
||||
$this->fallbackDirsPsr0 = (array) $paths;
|
||||
} else {
|
||||
$this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a set of PSR-4 directories for a given namespace,
|
||||
* replacing any others previously set for this namespace.
|
||||
*
|
||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||
* @param array|string $paths The PSR-4 base directories
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public function setPsr4($prefix, $paths)
|
||||
{
|
||||
if (!$prefix) {
|
||||
$this->fallbackDirsPsr4 = (array) $paths;
|
||||
} else {
|
||||
$length = strlen($prefix);
|
||||
if ('\\' !== $prefix[$length - 1]) {
|
||||
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
||||
}
|
||||
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
||||
$this->prefixDirsPsr4[$prefix] = (array) $paths;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Turns on searching the include path for class files.
|
||||
*
|
||||
* @param bool $useIncludePath
|
||||
*/
|
||||
public function setUseIncludePath($useIncludePath)
|
||||
{
|
||||
$this->useIncludePath = $useIncludePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Can be used to check if the autoloader uses the include path to check
|
||||
* for classes.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getUseIncludePath()
|
||||
{
|
||||
return $this->useIncludePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Turns off searching the prefix and fallback directories for classes
|
||||
* that have not been registered with the class map.
|
||||
*
|
||||
* @param bool $classMapAuthoritative
|
||||
*/
|
||||
public function setClassMapAuthoritative($classMapAuthoritative)
|
||||
{
|
||||
$this->classMapAuthoritative = $classMapAuthoritative;
|
||||
}
|
||||
|
||||
/**
|
||||
* Should class lookup fail if not found in the current class map?
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isClassMapAuthoritative()
|
||||
{
|
||||
return $this->classMapAuthoritative;
|
||||
}
|
||||
|
||||
/**
|
||||
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
|
||||
*
|
||||
* @param string|null $apcuPrefix
|
||||
*/
|
||||
public function setApcuPrefix($apcuPrefix)
|
||||
{
|
||||
$this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* The APCu prefix in use, or null if APCu caching is not enabled.
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getApcuPrefix()
|
||||
{
|
||||
return $this->apcuPrefix;
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers this instance as an autoloader.
|
||||
*
|
||||
* @param bool $prepend Whether to prepend the autoloader or not
|
||||
*/
|
||||
public function register($prepend = false)
|
||||
{
|
||||
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unregisters this instance as an autoloader.
|
||||
*/
|
||||
public function unregister()
|
||||
{
|
||||
spl_autoload_unregister(array($this, 'loadClass'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the given class or interface.
|
||||
*
|
||||
* @param string $class The name of the class
|
||||
* @return bool|null True if loaded, null otherwise
|
||||
*/
|
||||
public function loadClass($class)
|
||||
{
|
||||
if ($file = $this->findFile($class)) {
|
||||
includeFile($file);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the path to the file where the class is defined.
|
||||
*
|
||||
* @param string $class The name of the class
|
||||
*
|
||||
* @return string|false The path if found, false otherwise
|
||||
*/
|
||||
public function findFile($class)
|
||||
{
|
||||
// class map lookup
|
||||
if (isset($this->classMap[$class])) {
|
||||
return $this->classMap[$class];
|
||||
}
|
||||
if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
|
||||
return false;
|
||||
}
|
||||
if (null !== $this->apcuPrefix) {
|
||||
$file = apcu_fetch($this->apcuPrefix.$class, $hit);
|
||||
if ($hit) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
|
||||
$file = $this->findFileWithExtension($class, '.php');
|
||||
|
||||
// Search for Hack files if we are running on HHVM
|
||||
if (false === $file && defined('HHVM_VERSION')) {
|
||||
$file = $this->findFileWithExtension($class, '.hh');
|
||||
}
|
||||
|
||||
if (null !== $this->apcuPrefix) {
|
||||
apcu_add($this->apcuPrefix.$class, $file);
|
||||
}
|
||||
|
||||
if (false === $file) {
|
||||
// Remember that this class does not exist.
|
||||
$this->missingClasses[$class] = true;
|
||||
}
|
||||
|
||||
return $file;
|
||||
}
|
||||
|
||||
private function findFileWithExtension($class, $ext)
|
||||
{
|
||||
// PSR-4 lookup
|
||||
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
|
||||
|
||||
$first = $class[0];
|
||||
if (isset($this->prefixLengthsPsr4[$first])) {
|
||||
$subPath = $class;
|
||||
while (false !== $lastPos = strrpos($subPath, '\\')) {
|
||||
$subPath = substr($subPath, 0, $lastPos);
|
||||
$search = $subPath . '\\';
|
||||
if (isset($this->prefixDirsPsr4[$search])) {
|
||||
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
|
||||
foreach ($this->prefixDirsPsr4[$search] as $dir) {
|
||||
if (file_exists($file = $dir . $pathEnd)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// PSR-4 fallback dirs
|
||||
foreach ($this->fallbackDirsPsr4 as $dir) {
|
||||
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
|
||||
// PSR-0 lookup
|
||||
if (false !== $pos = strrpos($class, '\\')) {
|
||||
// namespaced class name
|
||||
$logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
|
||||
. strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
|
||||
} else {
|
||||
// PEAR-like class name
|
||||
$logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
|
||||
}
|
||||
|
||||
if (isset($this->prefixesPsr0[$first])) {
|
||||
foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
|
||||
if (0 === strpos($class, $prefix)) {
|
||||
foreach ($dirs as $dir) {
|
||||
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// PSR-0 fallback dirs
|
||||
foreach ($this->fallbackDirsPsr0 as $dir) {
|
||||
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
|
||||
// PSR-0 include paths.
|
||||
if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
|
||||
return $file;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope isolated include.
|
||||
*
|
||||
* Prevents access to $this/self from included files.
|
||||
*/
|
||||
function includeFile($file)
|
||||
{
|
||||
include $file;
|
||||
}
|
11
wp-content/plugins/wp-mail-smtp/vendor/composer/autoload_classmap.php
vendored
Normal file
11
wp-content/plugins/wp-mail-smtp/vendor/composer/autoload_classmap.php
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
// autoload_classmap.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(dirname(__FILE__));
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'Google_Service_Exception' => $vendorDir . '/google/apiclient/src/Google/Service/Exception.php',
|
||||
'Google_Service_Resource' => $vendorDir . '/google/apiclient/src/Google/Service/Resource.php',
|
||||
);
|
14
wp-content/plugins/wp-mail-smtp/vendor/composer/autoload_files.php
vendored
Normal file
14
wp-content/plugins/wp-mail-smtp/vendor/composer/autoload_files.php
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
// autoload_files.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(dirname(__FILE__));
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php',
|
||||
'a0edc8309cc5e1d60e3047b5df6b7052' => $vendorDir . '/guzzlehttp/psr7/src/functions_include.php',
|
||||
'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php',
|
||||
'37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php',
|
||||
'decc78cc4436b1292c6c0d151b19445c' => $vendorDir . '/phpseclib/phpseclib/phpseclib/bootstrap.php',
|
||||
);
|
11
wp-content/plugins/wp-mail-smtp/vendor/composer/autoload_namespaces.php
vendored
Normal file
11
wp-content/plugins/wp-mail-smtp/vendor/composer/autoload_namespaces.php
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
// autoload_namespaces.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(dirname(__FILE__));
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'Google_Service_' => array($vendorDir . '/google/apiclient-services/src'),
|
||||
'Google_' => array($vendorDir . '/google/apiclient/src'),
|
||||
);
|
22
wp-content/plugins/wp-mail-smtp/vendor/composer/autoload_psr4.php
vendored
Normal file
22
wp-content/plugins/wp-mail-smtp/vendor/composer/autoload_psr4.php
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
// autoload_psr4.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(dirname(__FILE__));
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'phpseclib\\' => array($vendorDir . '/phpseclib/phpseclib/phpseclib'),
|
||||
'WPMailSMTP\\' => array($baseDir . '/src'),
|
||||
'SendinBlue\\Client\\' => array($vendorDir . '/sendinblue/api-v3-sdk/lib'),
|
||||
'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'),
|
||||
'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src'),
|
||||
'Psr\\Cache\\' => array($vendorDir . '/psr/cache/src'),
|
||||
'Monolog\\' => array($vendorDir . '/monolog/monolog/src/Monolog'),
|
||||
'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'),
|
||||
'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'),
|
||||
'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'),
|
||||
'Google\\Auth\\' => array($vendorDir . '/google/auth/src'),
|
||||
'Firebase\\JWT\\' => array($vendorDir . '/firebase/php-jwt/src'),
|
||||
'Composer\\Installers\\' => array($vendorDir . '/composer/installers/src/Composer/Installers'),
|
||||
);
|
70
wp-content/plugins/wp-mail-smtp/vendor/composer/autoload_real.php
vendored
Normal file
70
wp-content/plugins/wp-mail-smtp/vendor/composer/autoload_real.php
vendored
Normal file
@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInit4589a9f05a03f0a29add21e0e493a064
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
public static function loadClassLoader($class)
|
||||
{
|
||||
if ('Composer\Autoload\ClassLoader' === $class) {
|
||||
require __DIR__ . '/ClassLoader.php';
|
||||
}
|
||||
}
|
||||
|
||||
public static function getLoader()
|
||||
{
|
||||
if (null !== self::$loader) {
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInit4589a9f05a03f0a29add21e0e493a064', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit4589a9f05a03f0a29add21e0e493a064', 'loadClassLoader'));
|
||||
|
||||
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
||||
if ($useStaticLoader) {
|
||||
require_once __DIR__ . '/autoload_static.php';
|
||||
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit4589a9f05a03f0a29add21e0e493a064::getInitializer($loader));
|
||||
} else {
|
||||
$map = require __DIR__ . '/autoload_namespaces.php';
|
||||
foreach ($map as $namespace => $path) {
|
||||
$loader->set($namespace, $path);
|
||||
}
|
||||
|
||||
$map = require __DIR__ . '/autoload_psr4.php';
|
||||
foreach ($map as $namespace => $path) {
|
||||
$loader->setPsr4($namespace, $path);
|
||||
}
|
||||
|
||||
$classMap = require __DIR__ . '/autoload_classmap.php';
|
||||
if ($classMap) {
|
||||
$loader->addClassMap($classMap);
|
||||
}
|
||||
}
|
||||
|
||||
$loader->register(true);
|
||||
|
||||
if ($useStaticLoader) {
|
||||
$includeFiles = Composer\Autoload\ComposerStaticInit4589a9f05a03f0a29add21e0e493a064::$files;
|
||||
} else {
|
||||
$includeFiles = require __DIR__ . '/autoload_files.php';
|
||||
}
|
||||
foreach ($includeFiles as $fileIdentifier => $file) {
|
||||
composerRequire4589a9f05a03f0a29add21e0e493a064($fileIdentifier, $file);
|
||||
}
|
||||
|
||||
return $loader;
|
||||
}
|
||||
}
|
||||
|
||||
function composerRequire4589a9f05a03f0a29add21e0e493a064($fileIdentifier, $file)
|
||||
{
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
require $file;
|
||||
|
||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
||||
}
|
||||
}
|
141
wp-content/plugins/wp-mail-smtp/vendor/composer/autoload_static.php
vendored
Normal file
141
wp-content/plugins/wp-mail-smtp/vendor/composer/autoload_static.php
vendored
Normal file
@ -0,0 +1,141 @@
|
||||
<?php
|
||||
|
||||
// autoload_static.php @generated by Composer
|
||||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInit4589a9f05a03f0a29add21e0e493a064
|
||||
{
|
||||
public static $files = array (
|
||||
'7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php',
|
||||
'a0edc8309cc5e1d60e3047b5df6b7052' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/functions_include.php',
|
||||
'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php',
|
||||
'37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php',
|
||||
'decc78cc4436b1292c6c0d151b19445c' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/bootstrap.php',
|
||||
);
|
||||
|
||||
public static $prefixLengthsPsr4 = array (
|
||||
'p' =>
|
||||
array (
|
||||
'phpseclib\\' => 10,
|
||||
),
|
||||
'W' =>
|
||||
array (
|
||||
'WPMailSMTP\\' => 11,
|
||||
),
|
||||
'S' =>
|
||||
array (
|
||||
'SendinBlue\\Client\\' => 18,
|
||||
),
|
||||
'P' =>
|
||||
array (
|
||||
'Psr\\Log\\' => 8,
|
||||
'Psr\\Http\\Message\\' => 17,
|
||||
'Psr\\Cache\\' => 10,
|
||||
),
|
||||
'M' =>
|
||||
array (
|
||||
'Monolog\\' => 8,
|
||||
),
|
||||
'G' =>
|
||||
array (
|
||||
'GuzzleHttp\\Psr7\\' => 16,
|
||||
'GuzzleHttp\\Promise\\' => 19,
|
||||
'GuzzleHttp\\' => 11,
|
||||
'Google\\Auth\\' => 12,
|
||||
),
|
||||
'F' =>
|
||||
array (
|
||||
'Firebase\\JWT\\' => 13,
|
||||
),
|
||||
'C' =>
|
||||
array (
|
||||
'Composer\\Installers\\' => 20,
|
||||
),
|
||||
);
|
||||
|
||||
public static $prefixDirsPsr4 = array (
|
||||
'phpseclib\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib',
|
||||
),
|
||||
'WPMailSMTP\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/../..' . '/src',
|
||||
),
|
||||
'SendinBlue\\Client\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/sendinblue/api-v3-sdk/lib',
|
||||
),
|
||||
'Psr\\Log\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/psr/log/Psr/Log',
|
||||
),
|
||||
'Psr\\Http\\Message\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/psr/http-message/src',
|
||||
),
|
||||
'Psr\\Cache\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/psr/cache/src',
|
||||
),
|
||||
'Monolog\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/monolog/monolog/src/Monolog',
|
||||
),
|
||||
'GuzzleHttp\\Psr7\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/guzzlehttp/psr7/src',
|
||||
),
|
||||
'GuzzleHttp\\Promise\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/guzzlehttp/promises/src',
|
||||
),
|
||||
'GuzzleHttp\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/guzzlehttp/guzzle/src',
|
||||
),
|
||||
'Google\\Auth\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/google/auth/src',
|
||||
),
|
||||
'Firebase\\JWT\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/firebase/php-jwt/src',
|
||||
),
|
||||
'Composer\\Installers\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers',
|
||||
),
|
||||
);
|
||||
|
||||
public static $prefixesPsr0 = array (
|
||||
'G' =>
|
||||
array (
|
||||
'Google_Service_' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/google/apiclient-services/src',
|
||||
),
|
||||
'Google_' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/google/apiclient/src',
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
public static $classMap = array (
|
||||
'Google_Service_Exception' => __DIR__ . '/..' . '/google/apiclient/src/Google/Service/Exception.php',
|
||||
'Google_Service_Resource' => __DIR__ . '/..' . '/google/apiclient/src/Google/Service/Resource.php',
|
||||
);
|
||||
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit4589a9f05a03f0a29add21e0e493a064::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit4589a9f05a03f0a29add21e0e493a064::$prefixDirsPsr4;
|
||||
$loader->prefixesPsr0 = ComposerStaticInit4589a9f05a03f0a29add21e0e493a064::$prefixesPsr0;
|
||||
$loader->classMap = ComposerStaticInit4589a9f05a03f0a29add21e0e493a064::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
}
|
203
wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/LICENSE
vendored
Normal file
203
wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/LICENSE
vendored
Normal file
@ -0,0 +1,203 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
|
1219
wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail.php
vendored
Normal file
1219
wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail.php
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,48 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
class Google_Service_Gmail_AutoForwarding extends Google_Model
|
||||
{
|
||||
public $disposition;
|
||||
public $emailAddress;
|
||||
public $enabled;
|
||||
|
||||
public function setDisposition($disposition)
|
||||
{
|
||||
$this->disposition = $disposition;
|
||||
}
|
||||
public function getDisposition()
|
||||
{
|
||||
return $this->disposition;
|
||||
}
|
||||
public function setEmailAddress($emailAddress)
|
||||
{
|
||||
$this->emailAddress = $emailAddress;
|
||||
}
|
||||
public function getEmailAddress()
|
||||
{
|
||||
return $this->emailAddress;
|
||||
}
|
||||
public function setEnabled($enabled)
|
||||
{
|
||||
$this->enabled = $enabled;
|
||||
}
|
||||
public function getEnabled()
|
||||
{
|
||||
return $this->enabled;
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
class Google_Service_Gmail_BatchDeleteMessagesRequest extends Google_Collection
|
||||
{
|
||||
protected $collection_key = 'ids';
|
||||
public $ids;
|
||||
|
||||
public function setIds($ids)
|
||||
{
|
||||
$this->ids = $ids;
|
||||
}
|
||||
public function getIds()
|
||||
{
|
||||
return $this->ids;
|
||||
}
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
class Google_Service_Gmail_BatchModifyMessagesRequest extends Google_Collection
|
||||
{
|
||||
protected $collection_key = 'removeLabelIds';
|
||||
public $addLabelIds;
|
||||
public $ids;
|
||||
public $removeLabelIds;
|
||||
|
||||
public function setAddLabelIds($addLabelIds)
|
||||
{
|
||||
$this->addLabelIds = $addLabelIds;
|
||||
}
|
||||
public function getAddLabelIds()
|
||||
{
|
||||
return $this->addLabelIds;
|
||||
}
|
||||
public function setIds($ids)
|
||||
{
|
||||
$this->ids = $ids;
|
||||
}
|
||||
public function getIds()
|
||||
{
|
||||
return $this->ids;
|
||||
}
|
||||
public function setRemoveLabelIds($removeLabelIds)
|
||||
{
|
||||
$this->removeLabelIds = $removeLabelIds;
|
||||
}
|
||||
public function getRemoveLabelIds()
|
||||
{
|
||||
return $this->removeLabelIds;
|
||||
}
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
class Google_Service_Gmail_Delegate extends Google_Model
|
||||
{
|
||||
public $delegateEmail;
|
||||
public $verificationStatus;
|
||||
|
||||
public function setDelegateEmail($delegateEmail)
|
||||
{
|
||||
$this->delegateEmail = $delegateEmail;
|
||||
}
|
||||
public function getDelegateEmail()
|
||||
{
|
||||
return $this->delegateEmail;
|
||||
}
|
||||
public function setVerificationStatus($verificationStatus)
|
||||
{
|
||||
$this->verificationStatus = $verificationStatus;
|
||||
}
|
||||
public function getVerificationStatus()
|
||||
{
|
||||
return $this->verificationStatus;
|
||||
}
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
class Google_Service_Gmail_Draft extends Google_Model
|
||||
{
|
||||
public $id;
|
||||
protected $messageType = 'Google_Service_Gmail_Message';
|
||||
protected $messageDataType = '';
|
||||
|
||||
public function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
}
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
/**
|
||||
* @param Google_Service_Gmail_Message
|
||||
*/
|
||||
public function setMessage(Google_Service_Gmail_Message $message)
|
||||
{
|
||||
$this->message = $message;
|
||||
}
|
||||
/**
|
||||
* @return Google_Service_Gmail_Message
|
||||
*/
|
||||
public function getMessage()
|
||||
{
|
||||
return $this->message;
|
||||
}
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
class Google_Service_Gmail_Filter extends Google_Model
|
||||
{
|
||||
protected $actionType = 'Google_Service_Gmail_FilterAction';
|
||||
protected $actionDataType = '';
|
||||
protected $criteriaType = 'Google_Service_Gmail_FilterCriteria';
|
||||
protected $criteriaDataType = '';
|
||||
public $id;
|
||||
|
||||
/**
|
||||
* @param Google_Service_Gmail_FilterAction
|
||||
*/
|
||||
public function setAction(Google_Service_Gmail_FilterAction $action)
|
||||
{
|
||||
$this->action = $action;
|
||||
}
|
||||
/**
|
||||
* @return Google_Service_Gmail_FilterAction
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return $this->action;
|
||||
}
|
||||
/**
|
||||
* @param Google_Service_Gmail_FilterCriteria
|
||||
*/
|
||||
public function setCriteria(Google_Service_Gmail_FilterCriteria $criteria)
|
||||
{
|
||||
$this->criteria = $criteria;
|
||||
}
|
||||
/**
|
||||
* @return Google_Service_Gmail_FilterCriteria
|
||||
*/
|
||||
public function getCriteria()
|
||||
{
|
||||
return $this->criteria;
|
||||
}
|
||||
public function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
}
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
class Google_Service_Gmail_FilterAction extends Google_Collection
|
||||
{
|
||||
protected $collection_key = 'removeLabelIds';
|
||||
public $addLabelIds;
|
||||
public $forward;
|
||||
public $removeLabelIds;
|
||||
|
||||
public function setAddLabelIds($addLabelIds)
|
||||
{
|
||||
$this->addLabelIds = $addLabelIds;
|
||||
}
|
||||
public function getAddLabelIds()
|
||||
{
|
||||
return $this->addLabelIds;
|
||||
}
|
||||
public function setForward($forward)
|
||||
{
|
||||
$this->forward = $forward;
|
||||
}
|
||||
public function getForward()
|
||||
{
|
||||
return $this->forward;
|
||||
}
|
||||
public function setRemoveLabelIds($removeLabelIds)
|
||||
{
|
||||
$this->removeLabelIds = $removeLabelIds;
|
||||
}
|
||||
public function getRemoveLabelIds()
|
||||
{
|
||||
return $this->removeLabelIds;
|
||||
}
|
||||
}
|
@ -0,0 +1,102 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
class Google_Service_Gmail_FilterCriteria extends Google_Model
|
||||
{
|
||||
public $excludeChats;
|
||||
public $from;
|
||||
public $hasAttachment;
|
||||
public $negatedQuery;
|
||||
public $query;
|
||||
public $size;
|
||||
public $sizeComparison;
|
||||
public $subject;
|
||||
public $to;
|
||||
|
||||
public function setExcludeChats($excludeChats)
|
||||
{
|
||||
$this->excludeChats = $excludeChats;
|
||||
}
|
||||
public function getExcludeChats()
|
||||
{
|
||||
return $this->excludeChats;
|
||||
}
|
||||
public function setFrom($from)
|
||||
{
|
||||
$this->from = $from;
|
||||
}
|
||||
public function getFrom()
|
||||
{
|
||||
return $this->from;
|
||||
}
|
||||
public function setHasAttachment($hasAttachment)
|
||||
{
|
||||
$this->hasAttachment = $hasAttachment;
|
||||
}
|
||||
public function getHasAttachment()
|
||||
{
|
||||
return $this->hasAttachment;
|
||||
}
|
||||
public function setNegatedQuery($negatedQuery)
|
||||
{
|
||||
$this->negatedQuery = $negatedQuery;
|
||||
}
|
||||
public function getNegatedQuery()
|
||||
{
|
||||
return $this->negatedQuery;
|
||||
}
|
||||
public function setQuery($query)
|
||||
{
|
||||
$this->query = $query;
|
||||
}
|
||||
public function getQuery()
|
||||
{
|
||||
return $this->query;
|
||||
}
|
||||
public function setSize($size)
|
||||
{
|
||||
$this->size = $size;
|
||||
}
|
||||
public function getSize()
|
||||
{
|
||||
return $this->size;
|
||||
}
|
||||
public function setSizeComparison($sizeComparison)
|
||||
{
|
||||
$this->sizeComparison = $sizeComparison;
|
||||
}
|
||||
public function getSizeComparison()
|
||||
{
|
||||
return $this->sizeComparison;
|
||||
}
|
||||
public function setSubject($subject)
|
||||
{
|
||||
$this->subject = $subject;
|
||||
}
|
||||
public function getSubject()
|
||||
{
|
||||
return $this->subject;
|
||||
}
|
||||
public function setTo($to)
|
||||
{
|
||||
$this->to = $to;
|
||||
}
|
||||
public function getTo()
|
||||
{
|
||||
return $this->to;
|
||||
}
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
class Google_Service_Gmail_ForwardingAddress extends Google_Model
|
||||
{
|
||||
public $forwardingEmail;
|
||||
public $verificationStatus;
|
||||
|
||||
public function setForwardingEmail($forwardingEmail)
|
||||
{
|
||||
$this->forwardingEmail = $forwardingEmail;
|
||||
}
|
||||
public function getForwardingEmail()
|
||||
{
|
||||
return $this->forwardingEmail;
|
||||
}
|
||||
public function setVerificationStatus($verificationStatus)
|
||||
{
|
||||
$this->verificationStatus = $verificationStatus;
|
||||
}
|
||||
public function getVerificationStatus()
|
||||
{
|
||||
return $this->verificationStatus;
|
||||
}
|
||||
}
|
@ -0,0 +1,111 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
class Google_Service_Gmail_History extends Google_Collection
|
||||
{
|
||||
protected $collection_key = 'messagesDeleted';
|
||||
public $id;
|
||||
protected $labelsAddedType = 'Google_Service_Gmail_HistoryLabelAdded';
|
||||
protected $labelsAddedDataType = 'array';
|
||||
protected $labelsRemovedType = 'Google_Service_Gmail_HistoryLabelRemoved';
|
||||
protected $labelsRemovedDataType = 'array';
|
||||
protected $messagesType = 'Google_Service_Gmail_Message';
|
||||
protected $messagesDataType = 'array';
|
||||
protected $messagesAddedType = 'Google_Service_Gmail_HistoryMessageAdded';
|
||||
protected $messagesAddedDataType = 'array';
|
||||
protected $messagesDeletedType = 'Google_Service_Gmail_HistoryMessageDeleted';
|
||||
protected $messagesDeletedDataType = 'array';
|
||||
|
||||
public function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
}
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
/**
|
||||
* @param Google_Service_Gmail_HistoryLabelAdded
|
||||
*/
|
||||
public function setLabelsAdded($labelsAdded)
|
||||
{
|
||||
$this->labelsAdded = $labelsAdded;
|
||||
}
|
||||
/**
|
||||
* @return Google_Service_Gmail_HistoryLabelAdded
|
||||
*/
|
||||
public function getLabelsAdded()
|
||||
{
|
||||
return $this->labelsAdded;
|
||||
}
|
||||
/**
|
||||
* @param Google_Service_Gmail_HistoryLabelRemoved
|
||||
*/
|
||||
public function setLabelsRemoved($labelsRemoved)
|
||||
{
|
||||
$this->labelsRemoved = $labelsRemoved;
|
||||
}
|
||||
/**
|
||||
* @return Google_Service_Gmail_HistoryLabelRemoved
|
||||
*/
|
||||
public function getLabelsRemoved()
|
||||
{
|
||||
return $this->labelsRemoved;
|
||||
}
|
||||
/**
|
||||
* @param Google_Service_Gmail_Message
|
||||
*/
|
||||
public function setMessages($messages)
|
||||
{
|
||||
$this->messages = $messages;
|
||||
}
|
||||
/**
|
||||
* @return Google_Service_Gmail_Message
|
||||
*/
|
||||
public function getMessages()
|
||||
{
|
||||
return $this->messages;
|
||||
}
|
||||
/**
|
||||
* @param Google_Service_Gmail_HistoryMessageAdded
|
||||
*/
|
||||
public function setMessagesAdded($messagesAdded)
|
||||
{
|
||||
$this->messagesAdded = $messagesAdded;
|
||||
}
|
||||
/**
|
||||
* @return Google_Service_Gmail_HistoryMessageAdded
|
||||
*/
|
||||
public function getMessagesAdded()
|
||||
{
|
||||
return $this->messagesAdded;
|
||||
}
|
||||
/**
|
||||
* @param Google_Service_Gmail_HistoryMessageDeleted
|
||||
*/
|
||||
public function setMessagesDeleted($messagesDeleted)
|
||||
{
|
||||
$this->messagesDeleted = $messagesDeleted;
|
||||
}
|
||||
/**
|
||||
* @return Google_Service_Gmail_HistoryMessageDeleted
|
||||
*/
|
||||
public function getMessagesDeleted()
|
||||
{
|
||||
return $this->messagesDeleted;
|
||||
}
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
class Google_Service_Gmail_HistoryLabelAdded extends Google_Collection
|
||||
{
|
||||
protected $collection_key = 'labelIds';
|
||||
public $labelIds;
|
||||
protected $messageType = 'Google_Service_Gmail_Message';
|
||||
protected $messageDataType = '';
|
||||
|
||||
public function setLabelIds($labelIds)
|
||||
{
|
||||
$this->labelIds = $labelIds;
|
||||
}
|
||||
public function getLabelIds()
|
||||
{
|
||||
return $this->labelIds;
|
||||
}
|
||||
/**
|
||||
* @param Google_Service_Gmail_Message
|
||||
*/
|
||||
public function setMessage(Google_Service_Gmail_Message $message)
|
||||
{
|
||||
$this->message = $message;
|
||||
}
|
||||
/**
|
||||
* @return Google_Service_Gmail_Message
|
||||
*/
|
||||
public function getMessage()
|
||||
{
|
||||
return $this->message;
|
||||
}
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
class Google_Service_Gmail_HistoryLabelRemoved extends Google_Collection
|
||||
{
|
||||
protected $collection_key = 'labelIds';
|
||||
public $labelIds;
|
||||
protected $messageType = 'Google_Service_Gmail_Message';
|
||||
protected $messageDataType = '';
|
||||
|
||||
public function setLabelIds($labelIds)
|
||||
{
|
||||
$this->labelIds = $labelIds;
|
||||
}
|
||||
public function getLabelIds()
|
||||
{
|
||||
return $this->labelIds;
|
||||
}
|
||||
/**
|
||||
* @param Google_Service_Gmail_Message
|
||||
*/
|
||||
public function setMessage(Google_Service_Gmail_Message $message)
|
||||
{
|
||||
$this->message = $message;
|
||||
}
|
||||
/**
|
||||
* @return Google_Service_Gmail_Message
|
||||
*/
|
||||
public function getMessage()
|
||||
{
|
||||
return $this->message;
|
||||
}
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
class Google_Service_Gmail_HistoryMessageAdded extends Google_Model
|
||||
{
|
||||
protected $messageType = 'Google_Service_Gmail_Message';
|
||||
protected $messageDataType = '';
|
||||
|
||||
/**
|
||||
* @param Google_Service_Gmail_Message
|
||||
*/
|
||||
public function setMessage(Google_Service_Gmail_Message $message)
|
||||
{
|
||||
$this->message = $message;
|
||||
}
|
||||
/**
|
||||
* @return Google_Service_Gmail_Message
|
||||
*/
|
||||
public function getMessage()
|
||||
{
|
||||
return $this->message;
|
||||
}
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
class Google_Service_Gmail_HistoryMessageDeleted extends Google_Model
|
||||
{
|
||||
protected $messageType = 'Google_Service_Gmail_Message';
|
||||
protected $messageDataType = '';
|
||||
|
||||
/**
|
||||
* @param Google_Service_Gmail_Message
|
||||
*/
|
||||
public function setMessage(Google_Service_Gmail_Message $message)
|
||||
{
|
||||
$this->message = $message;
|
||||
}
|
||||
/**
|
||||
* @return Google_Service_Gmail_Message
|
||||
*/
|
||||
public function getMessage()
|
||||
{
|
||||
return $this->message;
|
||||
}
|
||||
}
|
@ -0,0 +1,57 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
class Google_Service_Gmail_ImapSettings extends Google_Model
|
||||
{
|
||||
public $autoExpunge;
|
||||
public $enabled;
|
||||
public $expungeBehavior;
|
||||
public $maxFolderSize;
|
||||
|
||||
public function setAutoExpunge($autoExpunge)
|
||||
{
|
||||
$this->autoExpunge = $autoExpunge;
|
||||
}
|
||||
public function getAutoExpunge()
|
||||
{
|
||||
return $this->autoExpunge;
|
||||
}
|
||||
public function setEnabled($enabled)
|
||||
{
|
||||
$this->enabled = $enabled;
|
||||
}
|
||||
public function getEnabled()
|
||||
{
|
||||
return $this->enabled;
|
||||
}
|
||||
public function setExpungeBehavior($expungeBehavior)
|
||||
{
|
||||
$this->expungeBehavior = $expungeBehavior;
|
||||
}
|
||||
public function getExpungeBehavior()
|
||||
{
|
||||
return $this->expungeBehavior;
|
||||
}
|
||||
public function setMaxFolderSize($maxFolderSize)
|
||||
{
|
||||
$this->maxFolderSize = $maxFolderSize;
|
||||
}
|
||||
public function getMaxFolderSize()
|
||||
{
|
||||
return $this->maxFolderSize;
|
||||
}
|
||||
}
|
118
wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Label.php
vendored
Normal file
118
wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Label.php
vendored
Normal file
@ -0,0 +1,118 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
class Google_Service_Gmail_Label extends Google_Model
|
||||
{
|
||||
protected $colorType = 'Google_Service_Gmail_LabelColor';
|
||||
protected $colorDataType = '';
|
||||
public $id;
|
||||
public $labelListVisibility;
|
||||
public $messageListVisibility;
|
||||
public $messagesTotal;
|
||||
public $messagesUnread;
|
||||
public $name;
|
||||
public $threadsTotal;
|
||||
public $threadsUnread;
|
||||
public $type;
|
||||
|
||||
/**
|
||||
* @param Google_Service_Gmail_LabelColor
|
||||
*/
|
||||
public function setColor(Google_Service_Gmail_LabelColor $color)
|
||||
{
|
||||
$this->color = $color;
|
||||
}
|
||||
/**
|
||||
* @return Google_Service_Gmail_LabelColor
|
||||
*/
|
||||
public function getColor()
|
||||
{
|
||||
return $this->color;
|
||||
}
|
||||
public function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
}
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
public function setLabelListVisibility($labelListVisibility)
|
||||
{
|
||||
$this->labelListVisibility = $labelListVisibility;
|
||||
}
|
||||
public function getLabelListVisibility()
|
||||
{
|
||||
return $this->labelListVisibility;
|
||||
}
|
||||
public function setMessageListVisibility($messageListVisibility)
|
||||
{
|
||||
$this->messageListVisibility = $messageListVisibility;
|
||||
}
|
||||
public function getMessageListVisibility()
|
||||
{
|
||||
return $this->messageListVisibility;
|
||||
}
|
||||
public function setMessagesTotal($messagesTotal)
|
||||
{
|
||||
$this->messagesTotal = $messagesTotal;
|
||||
}
|
||||
public function getMessagesTotal()
|
||||
{
|
||||
return $this->messagesTotal;
|
||||
}
|
||||
public function setMessagesUnread($messagesUnread)
|
||||
{
|
||||
$this->messagesUnread = $messagesUnread;
|
||||
}
|
||||
public function getMessagesUnread()
|
||||
{
|
||||
return $this->messagesUnread;
|
||||
}
|
||||
public function setName($name)
|
||||
{
|
||||
$this->name = $name;
|
||||
}
|
||||
public function getName()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
public function setThreadsTotal($threadsTotal)
|
||||
{
|
||||
$this->threadsTotal = $threadsTotal;
|
||||
}
|
||||
public function getThreadsTotal()
|
||||
{
|
||||
return $this->threadsTotal;
|
||||
}
|
||||
public function setThreadsUnread($threadsUnread)
|
||||
{
|
||||
$this->threadsUnread = $threadsUnread;
|
||||
}
|
||||
public function getThreadsUnread()
|
||||
{
|
||||
return $this->threadsUnread;
|
||||
}
|
||||
public function setType($type)
|
||||
{
|
||||
$this->type = $type;
|
||||
}
|
||||
public function getType()
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
class Google_Service_Gmail_LabelColor extends Google_Model
|
||||
{
|
||||
public $backgroundColor;
|
||||
public $textColor;
|
||||
|
||||
public function setBackgroundColor($backgroundColor)
|
||||
{
|
||||
$this->backgroundColor = $backgroundColor;
|
||||
}
|
||||
public function getBackgroundColor()
|
||||
{
|
||||
return $this->backgroundColor;
|
||||
}
|
||||
public function setTextColor($textColor)
|
||||
{
|
||||
$this->textColor = $textColor;
|
||||
}
|
||||
public function getTextColor()
|
||||
{
|
||||
return $this->textColor;
|
||||
}
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
class Google_Service_Gmail_LanguageSettings extends Google_Model
|
||||
{
|
||||
public $displayLanguage;
|
||||
|
||||
public function setDisplayLanguage($displayLanguage)
|
||||
{
|
||||
$this->displayLanguage = $displayLanguage;
|
||||
}
|
||||
public function getDisplayLanguage()
|
||||
{
|
||||
return $this->displayLanguage;
|
||||
}
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
class Google_Service_Gmail_ListDelegatesResponse extends Google_Collection
|
||||
{
|
||||
protected $collection_key = 'delegates';
|
||||
protected $delegatesType = 'Google_Service_Gmail_Delegate';
|
||||
protected $delegatesDataType = 'array';
|
||||
|
||||
/**
|
||||
* @param Google_Service_Gmail_Delegate
|
||||
*/
|
||||
public function setDelegates($delegates)
|
||||
{
|
||||
$this->delegates = $delegates;
|
||||
}
|
||||
/**
|
||||
* @return Google_Service_Gmail_Delegate
|
||||
*/
|
||||
public function getDelegates()
|
||||
{
|
||||
return $this->delegates;
|
||||
}
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
class Google_Service_Gmail_ListDraftsResponse extends Google_Collection
|
||||
{
|
||||
protected $collection_key = 'drafts';
|
||||
protected $draftsType = 'Google_Service_Gmail_Draft';
|
||||
protected $draftsDataType = 'array';
|
||||
public $nextPageToken;
|
||||
public $resultSizeEstimate;
|
||||
|
||||
/**
|
||||
* @param Google_Service_Gmail_Draft
|
||||
*/
|
||||
public function setDrafts($drafts)
|
||||
{
|
||||
$this->drafts = $drafts;
|
||||
}
|
||||
/**
|
||||
* @return Google_Service_Gmail_Draft
|
||||
*/
|
||||
public function getDrafts()
|
||||
{
|
||||
return $this->drafts;
|
||||
}
|
||||
public function setNextPageToken($nextPageToken)
|
||||
{
|
||||
$this->nextPageToken = $nextPageToken;
|
||||
}
|
||||
public function getNextPageToken()
|
||||
{
|
||||
return $this->nextPageToken;
|
||||
}
|
||||
public function setResultSizeEstimate($resultSizeEstimate)
|
||||
{
|
||||
$this->resultSizeEstimate = $resultSizeEstimate;
|
||||
}
|
||||
public function getResultSizeEstimate()
|
||||
{
|
||||
return $this->resultSizeEstimate;
|
||||
}
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
class Google_Service_Gmail_ListFiltersResponse extends Google_Collection
|
||||
{
|
||||
protected $collection_key = 'filter';
|
||||
protected $filterType = 'Google_Service_Gmail_Filter';
|
||||
protected $filterDataType = 'array';
|
||||
|
||||
/**
|
||||
* @param Google_Service_Gmail_Filter
|
||||
*/
|
||||
public function setFilter($filter)
|
||||
{
|
||||
$this->filter = $filter;
|
||||
}
|
||||
/**
|
||||
* @return Google_Service_Gmail_Filter
|
||||
*/
|
||||
public function getFilter()
|
||||
{
|
||||
return $this->filter;
|
||||
}
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
class Google_Service_Gmail_ListForwardingAddressesResponse extends Google_Collection
|
||||
{
|
||||
protected $collection_key = 'forwardingAddresses';
|
||||
protected $forwardingAddressesType = 'Google_Service_Gmail_ForwardingAddress';
|
||||
protected $forwardingAddressesDataType = 'array';
|
||||
|
||||
/**
|
||||
* @param Google_Service_Gmail_ForwardingAddress
|
||||
*/
|
||||
public function setForwardingAddresses($forwardingAddresses)
|
||||
{
|
||||
$this->forwardingAddresses = $forwardingAddresses;
|
||||
}
|
||||
/**
|
||||
* @return Google_Service_Gmail_ForwardingAddress
|
||||
*/
|
||||
public function getForwardingAddresses()
|
||||
{
|
||||
return $this->forwardingAddresses;
|
||||
}
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
class Google_Service_Gmail_ListHistoryResponse extends Google_Collection
|
||||
{
|
||||
protected $collection_key = 'history';
|
||||
protected $historyType = 'Google_Service_Gmail_History';
|
||||
protected $historyDataType = 'array';
|
||||
public $historyId;
|
||||
public $nextPageToken;
|
||||
|
||||
/**
|
||||
* @param Google_Service_Gmail_History
|
||||
*/
|
||||
public function setHistory($history)
|
||||
{
|
||||
$this->history = $history;
|
||||
}
|
||||
/**
|
||||
* @return Google_Service_Gmail_History
|
||||
*/
|
||||
public function getHistory()
|
||||
{
|
||||
return $this->history;
|
||||
}
|
||||
public function setHistoryId($historyId)
|
||||
{
|
||||
$this->historyId = $historyId;
|
||||
}
|
||||
public function getHistoryId()
|
||||
{
|
||||
return $this->historyId;
|
||||
}
|
||||
public function setNextPageToken($nextPageToken)
|
||||
{
|
||||
$this->nextPageToken = $nextPageToken;
|
||||
}
|
||||
public function getNextPageToken()
|
||||
{
|
||||
return $this->nextPageToken;
|
||||
}
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
class Google_Service_Gmail_ListLabelsResponse extends Google_Collection
|
||||
{
|
||||
protected $collection_key = 'labels';
|
||||
protected $labelsType = 'Google_Service_Gmail_Label';
|
||||
protected $labelsDataType = 'array';
|
||||
|
||||
/**
|
||||
* @param Google_Service_Gmail_Label
|
||||
*/
|
||||
public function setLabels($labels)
|
||||
{
|
||||
$this->labels = $labels;
|
||||
}
|
||||
/**
|
||||
* @return Google_Service_Gmail_Label
|
||||
*/
|
||||
public function getLabels()
|
||||
{
|
||||
return $this->labels;
|
||||
}
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
class Google_Service_Gmail_ListMessagesResponse extends Google_Collection
|
||||
{
|
||||
protected $collection_key = 'messages';
|
||||
protected $messagesType = 'Google_Service_Gmail_Message';
|
||||
protected $messagesDataType = 'array';
|
||||
public $nextPageToken;
|
||||
public $resultSizeEstimate;
|
||||
|
||||
/**
|
||||
* @param Google_Service_Gmail_Message
|
||||
*/
|
||||
public function setMessages($messages)
|
||||
{
|
||||
$this->messages = $messages;
|
||||
}
|
||||
/**
|
||||
* @return Google_Service_Gmail_Message
|
||||
*/
|
||||
public function getMessages()
|
||||
{
|
||||
return $this->messages;
|
||||
}
|
||||
public function setNextPageToken($nextPageToken)
|
||||
{
|
||||
$this->nextPageToken = $nextPageToken;
|
||||
}
|
||||
public function getNextPageToken()
|
||||
{
|
||||
return $this->nextPageToken;
|
||||
}
|
||||
public function setResultSizeEstimate($resultSizeEstimate)
|
||||
{
|
||||
$this->resultSizeEstimate = $resultSizeEstimate;
|
||||
}
|
||||
public function getResultSizeEstimate()
|
||||
{
|
||||
return $this->resultSizeEstimate;
|
||||
}
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
class Google_Service_Gmail_ListSendAsResponse extends Google_Collection
|
||||
{
|
||||
protected $collection_key = 'sendAs';
|
||||
protected $sendAsType = 'Google_Service_Gmail_SendAs';
|
||||
protected $sendAsDataType = 'array';
|
||||
|
||||
/**
|
||||
* @param Google_Service_Gmail_SendAs
|
||||
*/
|
||||
public function setSendAs($sendAs)
|
||||
{
|
||||
$this->sendAs = $sendAs;
|
||||
}
|
||||
/**
|
||||
* @return Google_Service_Gmail_SendAs
|
||||
*/
|
||||
public function getSendAs()
|
||||
{
|
||||
return $this->sendAs;
|
||||
}
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
class Google_Service_Gmail_ListSmimeInfoResponse extends Google_Collection
|
||||
{
|
||||
protected $collection_key = 'smimeInfo';
|
||||
protected $smimeInfoType = 'Google_Service_Gmail_SmimeInfo';
|
||||
protected $smimeInfoDataType = 'array';
|
||||
|
||||
/**
|
||||
* @param Google_Service_Gmail_SmimeInfo
|
||||
*/
|
||||
public function setSmimeInfo($smimeInfo)
|
||||
{
|
||||
$this->smimeInfo = $smimeInfo;
|
||||
}
|
||||
/**
|
||||
* @return Google_Service_Gmail_SmimeInfo
|
||||
*/
|
||||
public function getSmimeInfo()
|
||||
{
|
||||
return $this->smimeInfo;
|
||||
}
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
class Google_Service_Gmail_ListThreadsResponse extends Google_Collection
|
||||
{
|
||||
protected $collection_key = 'threads';
|
||||
public $nextPageToken;
|
||||
public $resultSizeEstimate;
|
||||
protected $threadsType = 'Google_Service_Gmail_Thread';
|
||||
protected $threadsDataType = 'array';
|
||||
|
||||
public function setNextPageToken($nextPageToken)
|
||||
{
|
||||
$this->nextPageToken = $nextPageToken;
|
||||
}
|
||||
public function getNextPageToken()
|
||||
{
|
||||
return $this->nextPageToken;
|
||||
}
|
||||
public function setResultSizeEstimate($resultSizeEstimate)
|
||||
{
|
||||
$this->resultSizeEstimate = $resultSizeEstimate;
|
||||
}
|
||||
public function getResultSizeEstimate()
|
||||
{
|
||||
return $this->resultSizeEstimate;
|
||||
}
|
||||
/**
|
||||
* @param Google_Service_Gmail_Thread
|
||||
*/
|
||||
public function setThreads($threads)
|
||||
{
|
||||
$this->threads = $threads;
|
||||
}
|
||||
/**
|
||||
* @return Google_Service_Gmail_Thread
|
||||
*/
|
||||
public function getThreads()
|
||||
{
|
||||
return $this->threads;
|
||||
}
|
||||
}
|
@ -0,0 +1,110 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
class Google_Service_Gmail_Message extends Google_Collection
|
||||
{
|
||||
protected $collection_key = 'labelIds';
|
||||
public $historyId;
|
||||
public $id;
|
||||
public $internalDate;
|
||||
public $labelIds;
|
||||
protected $payloadType = 'Google_Service_Gmail_MessagePart';
|
||||
protected $payloadDataType = '';
|
||||
public $raw;
|
||||
public $sizeEstimate;
|
||||
public $snippet;
|
||||
public $threadId;
|
||||
|
||||
public function setHistoryId($historyId)
|
||||
{
|
||||
$this->historyId = $historyId;
|
||||
}
|
||||
public function getHistoryId()
|
||||
{
|
||||
return $this->historyId;
|
||||
}
|
||||
public function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
}
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
public function setInternalDate($internalDate)
|
||||
{
|
||||
$this->internalDate = $internalDate;
|
||||
}
|
||||
public function getInternalDate()
|
||||
{
|
||||
return $this->internalDate;
|
||||
}
|
||||
public function setLabelIds($labelIds)
|
||||
{
|
||||
$this->labelIds = $labelIds;
|
||||
}
|
||||
public function getLabelIds()
|
||||
{
|
||||
return $this->labelIds;
|
||||
}
|
||||
/**
|
||||
* @param Google_Service_Gmail_MessagePart
|
||||
*/
|
||||
public function setPayload(Google_Service_Gmail_MessagePart $payload)
|
||||
{
|
||||
$this->payload = $payload;
|
||||
}
|
||||
/**
|
||||
* @return Google_Service_Gmail_MessagePart
|
||||
*/
|
||||
public function getPayload()
|
||||
{
|
||||
return $this->payload;
|
||||
}
|
||||
public function setRaw($raw)
|
||||
{
|
||||
$this->raw = $raw;
|
||||
}
|
||||
public function getRaw()
|
||||
{
|
||||
return $this->raw;
|
||||
}
|
||||
public function setSizeEstimate($sizeEstimate)
|
||||
{
|
||||
$this->sizeEstimate = $sizeEstimate;
|
||||
}
|
||||
public function getSizeEstimate()
|
||||
{
|
||||
return $this->sizeEstimate;
|
||||
}
|
||||
public function setSnippet($snippet)
|
||||
{
|
||||
$this->snippet = $snippet;
|
||||
}
|
||||
public function getSnippet()
|
||||
{
|
||||
return $this->snippet;
|
||||
}
|
||||
public function setThreadId($threadId)
|
||||
{
|
||||
$this->threadId = $threadId;
|
||||
}
|
||||
public function getThreadId()
|
||||
{
|
||||
return $this->threadId;
|
||||
}
|
||||
}
|
@ -0,0 +1,97 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
class Google_Service_Gmail_MessagePart extends Google_Collection
|
||||
{
|
||||
protected $collection_key = 'parts';
|
||||
protected $bodyType = 'Google_Service_Gmail_MessagePartBody';
|
||||
protected $bodyDataType = '';
|
||||
public $filename;
|
||||
protected $headersType = 'Google_Service_Gmail_MessagePartHeader';
|
||||
protected $headersDataType = 'array';
|
||||
public $mimeType;
|
||||
public $partId;
|
||||
protected $partsType = 'Google_Service_Gmail_MessagePart';
|
||||
protected $partsDataType = 'array';
|
||||
|
||||
/**
|
||||
* @param Google_Service_Gmail_MessagePartBody
|
||||
*/
|
||||
public function setBody(Google_Service_Gmail_MessagePartBody $body)
|
||||
{
|
||||
$this->body = $body;
|
||||
}
|
||||
/**
|
||||
* @return Google_Service_Gmail_MessagePartBody
|
||||
*/
|
||||
public function getBody()
|
||||
{
|
||||
return $this->body;
|
||||
}
|
||||
public function setFilename($filename)
|
||||
{
|
||||
$this->filename = $filename;
|
||||
}
|
||||
public function getFilename()
|
||||
{
|
||||
return $this->filename;
|
||||
}
|
||||
/**
|
||||
* @param Google_Service_Gmail_MessagePartHeader
|
||||
*/
|
||||
public function setHeaders($headers)
|
||||
{
|
||||
$this->headers = $headers;
|
||||
}
|
||||
/**
|
||||
* @return Google_Service_Gmail_MessagePartHeader
|
||||
*/
|
||||
public function getHeaders()
|
||||
{
|
||||
return $this->headers;
|
||||
}
|
||||
public function setMimeType($mimeType)
|
||||
{
|
||||
$this->mimeType = $mimeType;
|
||||
}
|
||||
public function getMimeType()
|
||||
{
|
||||
return $this->mimeType;
|
||||
}
|
||||
public function setPartId($partId)
|
||||
{
|
||||
$this->partId = $partId;
|
||||
}
|
||||
public function getPartId()
|
||||
{
|
||||
return $this->partId;
|
||||
}
|
||||
/**
|
||||
* @param Google_Service_Gmail_MessagePart
|
||||
*/
|
||||
public function setParts($parts)
|
||||
{
|
||||
$this->parts = $parts;
|
||||
}
|
||||
/**
|
||||
* @return Google_Service_Gmail_MessagePart
|
||||
*/
|
||||
public function getParts()
|
||||
{
|
||||
return $this->parts;
|
||||
}
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
class Google_Service_Gmail_MessagePartBody extends Google_Model
|
||||
{
|
||||
public $attachmentId;
|
||||
public $data;
|
||||
public $size;
|
||||
|
||||
public function setAttachmentId($attachmentId)
|
||||
{
|
||||
$this->attachmentId = $attachmentId;
|
||||
}
|
||||
public function getAttachmentId()
|
||||
{
|
||||
return $this->attachmentId;
|
||||
}
|
||||
public function setData($data)
|
||||
{
|
||||
$this->data = $data;
|
||||
}
|
||||
public function getData()
|
||||
{
|
||||
return $this->data;
|
||||
}
|
||||
public function setSize($size)
|
||||
{
|
||||
$this->size = $size;
|
||||
}
|
||||
public function getSize()
|
||||
{
|
||||
return $this->size;
|
||||
}
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
class Google_Service_Gmail_MessagePartHeader extends Google_Model
|
||||
{
|
||||
public $name;
|
||||
public $value;
|
||||
|
||||
public function setName($name)
|
||||
{
|
||||
$this->name = $name;
|
||||
}
|
||||
public function getName()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
public function setValue($value)
|
||||
{
|
||||
$this->value = $value;
|
||||
}
|
||||
public function getValue()
|
||||
{
|
||||
return $this->value;
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
class Google_Service_Gmail_ModifyMessageRequest extends Google_Collection
|
||||
{
|
||||
protected $collection_key = 'removeLabelIds';
|
||||
public $addLabelIds;
|
||||
public $removeLabelIds;
|
||||
|
||||
public function setAddLabelIds($addLabelIds)
|
||||
{
|
||||
$this->addLabelIds = $addLabelIds;
|
||||
}
|
||||
public function getAddLabelIds()
|
||||
{
|
||||
return $this->addLabelIds;
|
||||
}
|
||||
public function setRemoveLabelIds($removeLabelIds)
|
||||
{
|
||||
$this->removeLabelIds = $removeLabelIds;
|
||||
}
|
||||
public function getRemoveLabelIds()
|
||||
{
|
||||
return $this->removeLabelIds;
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
class Google_Service_Gmail_ModifyThreadRequest extends Google_Collection
|
||||
{
|
||||
protected $collection_key = 'removeLabelIds';
|
||||
public $addLabelIds;
|
||||
public $removeLabelIds;
|
||||
|
||||
public function setAddLabelIds($addLabelIds)
|
||||
{
|
||||
$this->addLabelIds = $addLabelIds;
|
||||
}
|
||||
public function getAddLabelIds()
|
||||
{
|
||||
return $this->addLabelIds;
|
||||
}
|
||||
public function setRemoveLabelIds($removeLabelIds)
|
||||
{
|
||||
$this->removeLabelIds = $removeLabelIds;
|
||||
}
|
||||
public function getRemoveLabelIds()
|
||||
{
|
||||
return $this->removeLabelIds;
|
||||
}
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
class Google_Service_Gmail_PopSettings extends Google_Model
|
||||
{
|
||||
public $accessWindow;
|
||||
public $disposition;
|
||||
|
||||
public function setAccessWindow($accessWindow)
|
||||
{
|
||||
$this->accessWindow = $accessWindow;
|
||||
}
|
||||
public function getAccessWindow()
|
||||
{
|
||||
return $this->accessWindow;
|
||||
}
|
||||
public function setDisposition($disposition)
|
||||
{
|
||||
$this->disposition = $disposition;
|
||||
}
|
||||
public function getDisposition()
|
||||
{
|
||||
return $this->disposition;
|
||||
}
|
||||
}
|
@ -0,0 +1,57 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
class Google_Service_Gmail_Profile extends Google_Model
|
||||
{
|
||||
public $emailAddress;
|
||||
public $historyId;
|
||||
public $messagesTotal;
|
||||
public $threadsTotal;
|
||||
|
||||
public function setEmailAddress($emailAddress)
|
||||
{
|
||||
$this->emailAddress = $emailAddress;
|
||||
}
|
||||
public function getEmailAddress()
|
||||
{
|
||||
return $this->emailAddress;
|
||||
}
|
||||
public function setHistoryId($historyId)
|
||||
{
|
||||
$this->historyId = $historyId;
|
||||
}
|
||||
public function getHistoryId()
|
||||
{
|
||||
return $this->historyId;
|
||||
}
|
||||
public function setMessagesTotal($messagesTotal)
|
||||
{
|
||||
$this->messagesTotal = $messagesTotal;
|
||||
}
|
||||
public function getMessagesTotal()
|
||||
{
|
||||
return $this->messagesTotal;
|
||||
}
|
||||
public function setThreadsTotal($threadsTotal)
|
||||
{
|
||||
$this->threadsTotal = $threadsTotal;
|
||||
}
|
||||
public function getThreadsTotal()
|
||||
{
|
||||
return $this->threadsTotal;
|
||||
}
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* The "users" collection of methods.
|
||||
* Typical usage is:
|
||||
* <code>
|
||||
* $gmailService = new Google_Service_Gmail(...);
|
||||
* $users = $gmailService->users;
|
||||
* </code>
|
||||
*/
|
||||
class Google_Service_Gmail_Resource_Users extends Google_Service_Resource
|
||||
{
|
||||
/**
|
||||
* Gets the current user's Gmail profile. (users.getProfile)
|
||||
*
|
||||
* @param string $userId The user's email address. The special value me can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param array $optParams Optional parameters.
|
||||
* @return Google_Service_Gmail_Profile
|
||||
*/
|
||||
public function getProfile($userId, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('getProfile', array($params), "Google_Service_Gmail_Profile");
|
||||
}
|
||||
/**
|
||||
* Stop receiving push notifications for the given user mailbox. (users.stop)
|
||||
*
|
||||
* @param string $userId The user's email address. The special value me can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param array $optParams Optional parameters.
|
||||
*/
|
||||
public function stop($userId, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('stop', array($params));
|
||||
}
|
||||
/**
|
||||
* Set up or update a push notification watch on the given user mailbox.
|
||||
* (users.watch)
|
||||
*
|
||||
* @param string $userId The user's email address. The special value me can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param Google_Service_Gmail_WatchRequest $postBody
|
||||
* @param array $optParams Optional parameters.
|
||||
* @return Google_Service_Gmail_WatchResponse
|
||||
*/
|
||||
public function watch($userId, Google_Service_Gmail_WatchRequest $postBody, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId, 'postBody' => $postBody);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('watch', array($params), "Google_Service_Gmail_WatchResponse");
|
||||
}
|
||||
}
|
@ -0,0 +1,130 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* The "drafts" collection of methods.
|
||||
* Typical usage is:
|
||||
* <code>
|
||||
* $gmailService = new Google_Service_Gmail(...);
|
||||
* $drafts = $gmailService->drafts;
|
||||
* </code>
|
||||
*/
|
||||
class Google_Service_Gmail_Resource_UsersDrafts extends Google_Service_Resource
|
||||
{
|
||||
/**
|
||||
* Creates a new draft with the DRAFT label. (drafts.create)
|
||||
*
|
||||
* @param string $userId The user's email address. The special value me can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param Google_Service_Gmail_Draft $postBody
|
||||
* @param array $optParams Optional parameters.
|
||||
* @return Google_Service_Gmail_Draft
|
||||
*/
|
||||
public function create($userId, Google_Service_Gmail_Draft $postBody, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId, 'postBody' => $postBody);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('create', array($params), "Google_Service_Gmail_Draft");
|
||||
}
|
||||
/**
|
||||
* Immediately and permanently deletes the specified draft. Does not simply
|
||||
* trash it. (drafts.delete)
|
||||
*
|
||||
* @param string $userId The user's email address. The special value me can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param string $id The ID of the draft to delete.
|
||||
* @param array $optParams Optional parameters.
|
||||
*/
|
||||
public function delete($userId, $id, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId, 'id' => $id);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('delete', array($params));
|
||||
}
|
||||
/**
|
||||
* Gets the specified draft. (drafts.get)
|
||||
*
|
||||
* @param string $userId The user's email address. The special value me can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param string $id The ID of the draft to retrieve.
|
||||
* @param array $optParams Optional parameters.
|
||||
*
|
||||
* @opt_param string format The format to return the draft in.
|
||||
* @return Google_Service_Gmail_Draft
|
||||
*/
|
||||
public function get($userId, $id, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId, 'id' => $id);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('get', array($params), "Google_Service_Gmail_Draft");
|
||||
}
|
||||
/**
|
||||
* Lists the drafts in the user's mailbox. (drafts.listUsersDrafts)
|
||||
*
|
||||
* @param string $userId The user's email address. The special value me can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param array $optParams Optional parameters.
|
||||
*
|
||||
* @opt_param bool includeSpamTrash Include drafts from SPAM and TRASH in the
|
||||
* results.
|
||||
* @opt_param string maxResults Maximum number of drafts to return.
|
||||
* @opt_param string pageToken Page token to retrieve a specific page of results
|
||||
* in the list.
|
||||
* @opt_param string q Only return draft messages matching the specified query.
|
||||
* Supports the same query format as the Gmail search box. For example,
|
||||
* "from:someuser@example.com rfc822msgid: is:unread".
|
||||
* @return Google_Service_Gmail_ListDraftsResponse
|
||||
*/
|
||||
public function listUsersDrafts($userId, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('list', array($params), "Google_Service_Gmail_ListDraftsResponse");
|
||||
}
|
||||
/**
|
||||
* Sends the specified, existing draft to the recipients in the To, Cc, and Bcc
|
||||
* headers. (drafts.send)
|
||||
*
|
||||
* @param string $userId The user's email address. The special value me can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param Google_Service_Gmail_Draft $postBody
|
||||
* @param array $optParams Optional parameters.
|
||||
* @return Google_Service_Gmail_Message
|
||||
*/
|
||||
public function send($userId, Google_Service_Gmail_Draft $postBody, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId, 'postBody' => $postBody);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('send', array($params), "Google_Service_Gmail_Message");
|
||||
}
|
||||
/**
|
||||
* Replaces a draft's content. (drafts.update)
|
||||
*
|
||||
* @param string $userId The user's email address. The special value me can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param string $id The ID of the draft to update.
|
||||
* @param Google_Service_Gmail_Draft $postBody
|
||||
* @param array $optParams Optional parameters.
|
||||
* @return Google_Service_Gmail_Draft
|
||||
*/
|
||||
public function update($userId, $id, Google_Service_Gmail_Draft $postBody, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId, 'id' => $id, 'postBody' => $postBody);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('update', array($params), "Google_Service_Gmail_Draft");
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* The "history" collection of methods.
|
||||
* Typical usage is:
|
||||
* <code>
|
||||
* $gmailService = new Google_Service_Gmail(...);
|
||||
* $history = $gmailService->history;
|
||||
* </code>
|
||||
*/
|
||||
class Google_Service_Gmail_Resource_UsersHistory extends Google_Service_Resource
|
||||
{
|
||||
/**
|
||||
* Lists the history of all changes to the given mailbox. History results are
|
||||
* returned in chronological order (increasing historyId).
|
||||
* (history.listUsersHistory)
|
||||
*
|
||||
* @param string $userId The user's email address. The special value me can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param array $optParams Optional parameters.
|
||||
*
|
||||
* @opt_param string historyTypes History types to be returned by the function
|
||||
* @opt_param string labelId Only return messages with a label matching the ID.
|
||||
* @opt_param string maxResults The maximum number of history records to return.
|
||||
* @opt_param string pageToken Page token to retrieve a specific page of results
|
||||
* in the list.
|
||||
* @opt_param string startHistoryId Required. Returns history records after the
|
||||
* specified startHistoryId. The supplied startHistoryId should be obtained from
|
||||
* the historyId of a message, thread, or previous list response. History IDs
|
||||
* increase chronologically but are not contiguous with random gaps in between
|
||||
* valid IDs. Supplying an invalid or out of date startHistoryId typically
|
||||
* returns an HTTP 404 error code. A historyId is typically valid for at least a
|
||||
* week, but in some rare circumstances may be valid for only a few hours. If
|
||||
* you receive an HTTP 404 error response, your application should perform a
|
||||
* full sync. If you receive no nextPageToken in the response, there are no
|
||||
* updates to retrieve and you can store the returned historyId for a future
|
||||
* request.
|
||||
* @return Google_Service_Gmail_ListHistoryResponse
|
||||
*/
|
||||
public function listUsersHistory($userId, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('list', array($params), "Google_Service_Gmail_ListHistoryResponse");
|
||||
}
|
||||
}
|
@ -0,0 +1,120 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* The "labels" collection of methods.
|
||||
* Typical usage is:
|
||||
* <code>
|
||||
* $gmailService = new Google_Service_Gmail(...);
|
||||
* $labels = $gmailService->labels;
|
||||
* </code>
|
||||
*/
|
||||
class Google_Service_Gmail_Resource_UsersLabels extends Google_Service_Resource
|
||||
{
|
||||
/**
|
||||
* Creates a new label. (labels.create)
|
||||
*
|
||||
* @param string $userId The user's email address. The special value me can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param Google_Service_Gmail_Label $postBody
|
||||
* @param array $optParams Optional parameters.
|
||||
* @return Google_Service_Gmail_Label
|
||||
*/
|
||||
public function create($userId, Google_Service_Gmail_Label $postBody, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId, 'postBody' => $postBody);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('create', array($params), "Google_Service_Gmail_Label");
|
||||
}
|
||||
/**
|
||||
* Immediately and permanently deletes the specified label and removes it from
|
||||
* any messages and threads that it is applied to. (labels.delete)
|
||||
*
|
||||
* @param string $userId The user's email address. The special value me can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param string $id The ID of the label to delete.
|
||||
* @param array $optParams Optional parameters.
|
||||
*/
|
||||
public function delete($userId, $id, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId, 'id' => $id);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('delete', array($params));
|
||||
}
|
||||
/**
|
||||
* Gets the specified label. (labels.get)
|
||||
*
|
||||
* @param string $userId The user's email address. The special value me can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param string $id The ID of the label to retrieve.
|
||||
* @param array $optParams Optional parameters.
|
||||
* @return Google_Service_Gmail_Label
|
||||
*/
|
||||
public function get($userId, $id, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId, 'id' => $id);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('get', array($params), "Google_Service_Gmail_Label");
|
||||
}
|
||||
/**
|
||||
* Lists all labels in the user's mailbox. (labels.listUsersLabels)
|
||||
*
|
||||
* @param string $userId The user's email address. The special value me can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param array $optParams Optional parameters.
|
||||
* @return Google_Service_Gmail_ListLabelsResponse
|
||||
*/
|
||||
public function listUsersLabels($userId, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('list', array($params), "Google_Service_Gmail_ListLabelsResponse");
|
||||
}
|
||||
/**
|
||||
* Updates the specified label. This method supports patch semantics.
|
||||
* (labels.patch)
|
||||
*
|
||||
* @param string $userId The user's email address. The special value me can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param string $id The ID of the label to update.
|
||||
* @param Google_Service_Gmail_Label $postBody
|
||||
* @param array $optParams Optional parameters.
|
||||
* @return Google_Service_Gmail_Label
|
||||
*/
|
||||
public function patch($userId, $id, Google_Service_Gmail_Label $postBody, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId, 'id' => $id, 'postBody' => $postBody);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('patch', array($params), "Google_Service_Gmail_Label");
|
||||
}
|
||||
/**
|
||||
* Updates the specified label. (labels.update)
|
||||
*
|
||||
* @param string $userId The user's email address. The special value me can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param string $id The ID of the label to update.
|
||||
* @param Google_Service_Gmail_Label $postBody
|
||||
* @param array $optParams Optional parameters.
|
||||
* @return Google_Service_Gmail_Label
|
||||
*/
|
||||
public function update($userId, $id, Google_Service_Gmail_Label $postBody, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId, 'id' => $id, 'postBody' => $postBody);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('update', array($params), "Google_Service_Gmail_Label");
|
||||
}
|
||||
}
|
@ -0,0 +1,229 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* The "messages" collection of methods.
|
||||
* Typical usage is:
|
||||
* <code>
|
||||
* $gmailService = new Google_Service_Gmail(...);
|
||||
* $messages = $gmailService->messages;
|
||||
* </code>
|
||||
*/
|
||||
class Google_Service_Gmail_Resource_UsersMessages extends Google_Service_Resource
|
||||
{
|
||||
/**
|
||||
* Deletes many messages by message ID. Provides no guarantees that messages
|
||||
* were not already deleted or even existed at all. (messages.batchDelete)
|
||||
*
|
||||
* @param string $userId The user's email address. The special value me can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param Google_Service_Gmail_BatchDeleteMessagesRequest $postBody
|
||||
* @param array $optParams Optional parameters.
|
||||
*/
|
||||
public function batchDelete($userId, Google_Service_Gmail_BatchDeleteMessagesRequest $postBody, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId, 'postBody' => $postBody);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('batchDelete', array($params));
|
||||
}
|
||||
/**
|
||||
* Modifies the labels on the specified messages. (messages.batchModify)
|
||||
*
|
||||
* @param string $userId The user's email address. The special value me can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param Google_Service_Gmail_BatchModifyMessagesRequest $postBody
|
||||
* @param array $optParams Optional parameters.
|
||||
*/
|
||||
public function batchModify($userId, Google_Service_Gmail_BatchModifyMessagesRequest $postBody, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId, 'postBody' => $postBody);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('batchModify', array($params));
|
||||
}
|
||||
/**
|
||||
* Immediately and permanently deletes the specified message. This operation
|
||||
* cannot be undone. Prefer messages.trash instead. (messages.delete)
|
||||
*
|
||||
* @param string $userId The user's email address. The special value me can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param string $id The ID of the message to delete.
|
||||
* @param array $optParams Optional parameters.
|
||||
*/
|
||||
public function delete($userId, $id, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId, 'id' => $id);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('delete', array($params));
|
||||
}
|
||||
/**
|
||||
* Gets the specified message. (messages.get)
|
||||
*
|
||||
* @param string $userId The user's email address. The special value me can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param string $id The ID of the message to retrieve.
|
||||
* @param array $optParams Optional parameters.
|
||||
*
|
||||
* @opt_param string format The format to return the message in.
|
||||
* @opt_param string metadataHeaders When given and format is METADATA, only
|
||||
* include headers specified.
|
||||
* @return Google_Service_Gmail_Message
|
||||
*/
|
||||
public function get($userId, $id, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId, 'id' => $id);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('get', array($params), "Google_Service_Gmail_Message");
|
||||
}
|
||||
/**
|
||||
* Imports a message into only this user's mailbox, with standard email delivery
|
||||
* scanning and classification similar to receiving via SMTP. Does not send a
|
||||
* message. (messages.import)
|
||||
*
|
||||
* @param string $userId The user's email address. The special value me can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param Google_Service_Gmail_Message $postBody
|
||||
* @param array $optParams Optional parameters.
|
||||
*
|
||||
* @opt_param bool deleted Mark the email as permanently deleted (not TRASH) and
|
||||
* only visible in Google Vault to a Vault administrator. Only used for G Suite
|
||||
* accounts.
|
||||
* @opt_param string internalDateSource Source for Gmail's internal date of the
|
||||
* message.
|
||||
* @opt_param bool neverMarkSpam Ignore the Gmail spam classifier decision and
|
||||
* never mark this email as SPAM in the mailbox.
|
||||
* @opt_param bool processForCalendar Process calendar invites in the email and
|
||||
* add any extracted meetings to the Google Calendar for this user.
|
||||
* @return Google_Service_Gmail_Message
|
||||
*/
|
||||
public function import($userId, Google_Service_Gmail_Message $postBody, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId, 'postBody' => $postBody);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('import', array($params), "Google_Service_Gmail_Message");
|
||||
}
|
||||
/**
|
||||
* Directly inserts a message into only this user's mailbox similar to IMAP
|
||||
* APPEND, bypassing most scanning and classification. Does not send a message.
|
||||
* (messages.insert)
|
||||
*
|
||||
* @param string $userId The user's email address. The special value me can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param Google_Service_Gmail_Message $postBody
|
||||
* @param array $optParams Optional parameters.
|
||||
*
|
||||
* @opt_param bool deleted Mark the email as permanently deleted (not TRASH) and
|
||||
* only visible in Google Vault to a Vault administrator. Only used for G Suite
|
||||
* accounts.
|
||||
* @opt_param string internalDateSource Source for Gmail's internal date of the
|
||||
* message.
|
||||
* @return Google_Service_Gmail_Message
|
||||
*/
|
||||
public function insert($userId, Google_Service_Gmail_Message $postBody, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId, 'postBody' => $postBody);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('insert', array($params), "Google_Service_Gmail_Message");
|
||||
}
|
||||
/**
|
||||
* Lists the messages in the user's mailbox. (messages.listUsersMessages)
|
||||
*
|
||||
* @param string $userId The user's email address. The special value me can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param array $optParams Optional parameters.
|
||||
*
|
||||
* @opt_param bool includeSpamTrash Include messages from SPAM and TRASH in the
|
||||
* results.
|
||||
* @opt_param string labelIds Only return messages with labels that match all of
|
||||
* the specified label IDs.
|
||||
* @opt_param string maxResults Maximum number of messages to return.
|
||||
* @opt_param string pageToken Page token to retrieve a specific page of results
|
||||
* in the list.
|
||||
* @opt_param string q Only return messages matching the specified query.
|
||||
* Supports the same query format as the Gmail search box. For example,
|
||||
* "from:someuser@example.com rfc822msgid: is:unread". Parameter cannot be used
|
||||
* when accessing the api using the gmail.metadata scope.
|
||||
* @return Google_Service_Gmail_ListMessagesResponse
|
||||
*/
|
||||
public function listUsersMessages($userId, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('list', array($params), "Google_Service_Gmail_ListMessagesResponse");
|
||||
}
|
||||
/**
|
||||
* Modifies the labels on the specified message. (messages.modify)
|
||||
*
|
||||
* @param string $userId The user's email address. The special value me can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param string $id The ID of the message to modify.
|
||||
* @param Google_Service_Gmail_ModifyMessageRequest $postBody
|
||||
* @param array $optParams Optional parameters.
|
||||
* @return Google_Service_Gmail_Message
|
||||
*/
|
||||
public function modify($userId, $id, Google_Service_Gmail_ModifyMessageRequest $postBody, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId, 'id' => $id, 'postBody' => $postBody);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('modify', array($params), "Google_Service_Gmail_Message");
|
||||
}
|
||||
/**
|
||||
* Sends the specified message to the recipients in the To, Cc, and Bcc headers.
|
||||
* (messages.send)
|
||||
*
|
||||
* @param string $userId The user's email address. The special value me can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param Google_Service_Gmail_Message $postBody
|
||||
* @param array $optParams Optional parameters.
|
||||
* @return Google_Service_Gmail_Message
|
||||
*/
|
||||
public function send($userId, Google_Service_Gmail_Message $postBody, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId, 'postBody' => $postBody);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('send', array($params), "Google_Service_Gmail_Message");
|
||||
}
|
||||
/**
|
||||
* Moves the specified message to the trash. (messages.trash)
|
||||
*
|
||||
* @param string $userId The user's email address. The special value me can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param string $id The ID of the message to Trash.
|
||||
* @param array $optParams Optional parameters.
|
||||
* @return Google_Service_Gmail_Message
|
||||
*/
|
||||
public function trash($userId, $id, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId, 'id' => $id);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('trash', array($params), "Google_Service_Gmail_Message");
|
||||
}
|
||||
/**
|
||||
* Removes the specified message from the trash. (messages.untrash)
|
||||
*
|
||||
* @param string $userId The user's email address. The special value me can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param string $id The ID of the message to remove from Trash.
|
||||
* @param array $optParams Optional parameters.
|
||||
* @return Google_Service_Gmail_Message
|
||||
*/
|
||||
public function untrash($userId, $id, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId, 'id' => $id);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('untrash', array($params), "Google_Service_Gmail_Message");
|
||||
}
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* The "attachments" collection of methods.
|
||||
* Typical usage is:
|
||||
* <code>
|
||||
* $gmailService = new Google_Service_Gmail(...);
|
||||
* $attachments = $gmailService->attachments;
|
||||
* </code>
|
||||
*/
|
||||
class Google_Service_Gmail_Resource_UsersMessagesAttachments extends Google_Service_Resource
|
||||
{
|
||||
/**
|
||||
* Gets the specified message attachment. (attachments.get)
|
||||
*
|
||||
* @param string $userId The user's email address. The special value me can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param string $messageId The ID of the message containing the attachment.
|
||||
* @param string $id The ID of the attachment.
|
||||
* @param array $optParams Optional parameters.
|
||||
* @return Google_Service_Gmail_MessagePartBody
|
||||
*/
|
||||
public function get($userId, $messageId, $id, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId, 'messageId' => $messageId, 'id' => $id);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('get', array($params), "Google_Service_Gmail_MessagePartBody");
|
||||
}
|
||||
}
|
@ -0,0 +1,184 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* The "settings" collection of methods.
|
||||
* Typical usage is:
|
||||
* <code>
|
||||
* $gmailService = new Google_Service_Gmail(...);
|
||||
* $settings = $gmailService->settings;
|
||||
* </code>
|
||||
*/
|
||||
class Google_Service_Gmail_Resource_UsersSettings extends Google_Service_Resource
|
||||
{
|
||||
/**
|
||||
* Gets the auto-forwarding setting for the specified account.
|
||||
* (settings.getAutoForwarding)
|
||||
*
|
||||
* @param string $userId User's email address. The special value "me" can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param array $optParams Optional parameters.
|
||||
* @return Google_Service_Gmail_AutoForwarding
|
||||
*/
|
||||
public function getAutoForwarding($userId, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('getAutoForwarding', array($params), "Google_Service_Gmail_AutoForwarding");
|
||||
}
|
||||
/**
|
||||
* Gets IMAP settings. (settings.getImap)
|
||||
*
|
||||
* @param string $userId User's email address. The special value "me" can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param array $optParams Optional parameters.
|
||||
* @return Google_Service_Gmail_ImapSettings
|
||||
*/
|
||||
public function getImap($userId, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('getImap', array($params), "Google_Service_Gmail_ImapSettings");
|
||||
}
|
||||
/**
|
||||
* Gets language settings. (settings.getLanguage)
|
||||
*
|
||||
* @param string $userId User's email address. The special value "me" can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param array $optParams Optional parameters.
|
||||
* @return Google_Service_Gmail_LanguageSettings
|
||||
*/
|
||||
public function getLanguage($userId, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('getLanguage', array($params), "Google_Service_Gmail_LanguageSettings");
|
||||
}
|
||||
/**
|
||||
* Gets POP settings. (settings.getPop)
|
||||
*
|
||||
* @param string $userId User's email address. The special value "me" can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param array $optParams Optional parameters.
|
||||
* @return Google_Service_Gmail_PopSettings
|
||||
*/
|
||||
public function getPop($userId, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('getPop', array($params), "Google_Service_Gmail_PopSettings");
|
||||
}
|
||||
/**
|
||||
* Gets vacation responder settings. (settings.getVacation)
|
||||
*
|
||||
* @param string $userId User's email address. The special value "me" can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param array $optParams Optional parameters.
|
||||
* @return Google_Service_Gmail_VacationSettings
|
||||
*/
|
||||
public function getVacation($userId, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('getVacation', array($params), "Google_Service_Gmail_VacationSettings");
|
||||
}
|
||||
/**
|
||||
* Updates the auto-forwarding setting for the specified account. A verified
|
||||
* forwarding address must be specified when auto-forwarding is enabled.
|
||||
*
|
||||
* This method is only available to service account clients that have been
|
||||
* delegated domain-wide authority. (settings.updateAutoForwarding)
|
||||
*
|
||||
* @param string $userId User's email address. The special value "me" can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param Google_Service_Gmail_AutoForwarding $postBody
|
||||
* @param array $optParams Optional parameters.
|
||||
* @return Google_Service_Gmail_AutoForwarding
|
||||
*/
|
||||
public function updateAutoForwarding($userId, Google_Service_Gmail_AutoForwarding $postBody, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId, 'postBody' => $postBody);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('updateAutoForwarding', array($params), "Google_Service_Gmail_AutoForwarding");
|
||||
}
|
||||
/**
|
||||
* Updates IMAP settings. (settings.updateImap)
|
||||
*
|
||||
* @param string $userId User's email address. The special value "me" can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param Google_Service_Gmail_ImapSettings $postBody
|
||||
* @param array $optParams Optional parameters.
|
||||
* @return Google_Service_Gmail_ImapSettings
|
||||
*/
|
||||
public function updateImap($userId, Google_Service_Gmail_ImapSettings $postBody, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId, 'postBody' => $postBody);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('updateImap', array($params), "Google_Service_Gmail_ImapSettings");
|
||||
}
|
||||
/**
|
||||
* Updates language settings.
|
||||
*
|
||||
* If successful, the return object contains the displayLanguage that was saved
|
||||
* for the user, which may differ from the value passed into the request. This
|
||||
* is because the requested displayLanguage may not be directly supported by
|
||||
* Gmail but have a close variant that is, and so the variant may be chosen and
|
||||
* saved instead. (settings.updateLanguage)
|
||||
*
|
||||
* @param string $userId User's email address. The special value "me" can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param Google_Service_Gmail_LanguageSettings $postBody
|
||||
* @param array $optParams Optional parameters.
|
||||
* @return Google_Service_Gmail_LanguageSettings
|
||||
*/
|
||||
public function updateLanguage($userId, Google_Service_Gmail_LanguageSettings $postBody, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId, 'postBody' => $postBody);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('updateLanguage', array($params), "Google_Service_Gmail_LanguageSettings");
|
||||
}
|
||||
/**
|
||||
* Updates POP settings. (settings.updatePop)
|
||||
*
|
||||
* @param string $userId User's email address. The special value "me" can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param Google_Service_Gmail_PopSettings $postBody
|
||||
* @param array $optParams Optional parameters.
|
||||
* @return Google_Service_Gmail_PopSettings
|
||||
*/
|
||||
public function updatePop($userId, Google_Service_Gmail_PopSettings $postBody, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId, 'postBody' => $postBody);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('updatePop', array($params), "Google_Service_Gmail_PopSettings");
|
||||
}
|
||||
/**
|
||||
* Updates vacation responder settings. (settings.updateVacation)
|
||||
*
|
||||
* @param string $userId User's email address. The special value "me" can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param Google_Service_Gmail_VacationSettings $postBody
|
||||
* @param array $optParams Optional parameters.
|
||||
* @return Google_Service_Gmail_VacationSettings
|
||||
*/
|
||||
public function updateVacation($userId, Google_Service_Gmail_VacationSettings $postBody, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId, 'postBody' => $postBody);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('updateVacation', array($params), "Google_Service_Gmail_VacationSettings");
|
||||
}
|
||||
}
|
@ -0,0 +1,119 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* The "delegates" collection of methods.
|
||||
* Typical usage is:
|
||||
* <code>
|
||||
* $gmailService = new Google_Service_Gmail(...);
|
||||
* $delegates = $gmailService->delegates;
|
||||
* </code>
|
||||
*/
|
||||
class Google_Service_Gmail_Resource_UsersSettingsDelegates extends Google_Service_Resource
|
||||
{
|
||||
/**
|
||||
* Adds a delegate with its verification status set directly to accepted,
|
||||
* without sending any verification email. The delegate user must be a member of
|
||||
* the same G Suite organization as the delegator user.
|
||||
*
|
||||
* Gmail imposes limtations on the number of delegates and delegators each user
|
||||
* in a G Suite organization can have. These limits depend on your organization,
|
||||
* but in general each user can have up to 25 delegates and up to 10 delegators.
|
||||
*
|
||||
* Note that a delegate user must be referred to by their primary email address,
|
||||
* and not an email alias.
|
||||
*
|
||||
* Also note that when a new delegate is created, there may be up to a one
|
||||
* minute delay before the new delegate is available for use.
|
||||
*
|
||||
* This method is only available to service account clients that have been
|
||||
* delegated domain-wide authority. (delegates.create)
|
||||
*
|
||||
* @param string $userId User's email address. The special value "me" can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param Google_Service_Gmail_Delegate $postBody
|
||||
* @param array $optParams Optional parameters.
|
||||
* @return Google_Service_Gmail_Delegate
|
||||
*/
|
||||
public function create($userId, Google_Service_Gmail_Delegate $postBody, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId, 'postBody' => $postBody);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('create', array($params), "Google_Service_Gmail_Delegate");
|
||||
}
|
||||
/**
|
||||
* Removes the specified delegate (which can be of any verification status), and
|
||||
* revokes any verification that may have been required for using it.
|
||||
*
|
||||
* Note that a delegate user must be referred to by their primary email address,
|
||||
* and not an email alias.
|
||||
*
|
||||
* This method is only available to service account clients that have been
|
||||
* delegated domain-wide authority. (delegates.delete)
|
||||
*
|
||||
* @param string $userId User's email address. The special value "me" can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param string $delegateEmail The email address of the user to be removed as a
|
||||
* delegate.
|
||||
* @param array $optParams Optional parameters.
|
||||
*/
|
||||
public function delete($userId, $delegateEmail, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId, 'delegateEmail' => $delegateEmail);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('delete', array($params));
|
||||
}
|
||||
/**
|
||||
* Gets the specified delegate.
|
||||
*
|
||||
* Note that a delegate user must be referred to by their primary email address,
|
||||
* and not an email alias.
|
||||
*
|
||||
* This method is only available to service account clients that have been
|
||||
* delegated domain-wide authority. (delegates.get)
|
||||
*
|
||||
* @param string $userId User's email address. The special value "me" can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param string $delegateEmail The email address of the user whose delegate
|
||||
* relationship is to be retrieved.
|
||||
* @param array $optParams Optional parameters.
|
||||
* @return Google_Service_Gmail_Delegate
|
||||
*/
|
||||
public function get($userId, $delegateEmail, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId, 'delegateEmail' => $delegateEmail);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('get', array($params), "Google_Service_Gmail_Delegate");
|
||||
}
|
||||
/**
|
||||
* Lists the delegates for the specified account.
|
||||
*
|
||||
* This method is only available to service account clients that have been
|
||||
* delegated domain-wide authority. (delegates.listUsersSettingsDelegates)
|
||||
*
|
||||
* @param string $userId User's email address. The special value "me" can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param array $optParams Optional parameters.
|
||||
* @return Google_Service_Gmail_ListDelegatesResponse
|
||||
*/
|
||||
public function listUsersSettingsDelegates($userId, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('list', array($params), "Google_Service_Gmail_ListDelegatesResponse");
|
||||
}
|
||||
}
|
@ -0,0 +1,86 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* The "filters" collection of methods.
|
||||
* Typical usage is:
|
||||
* <code>
|
||||
* $gmailService = new Google_Service_Gmail(...);
|
||||
* $filters = $gmailService->filters;
|
||||
* </code>
|
||||
*/
|
||||
class Google_Service_Gmail_Resource_UsersSettingsFilters extends Google_Service_Resource
|
||||
{
|
||||
/**
|
||||
* Creates a filter. (filters.create)
|
||||
*
|
||||
* @param string $userId User's email address. The special value "me" can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param Google_Service_Gmail_Filter $postBody
|
||||
* @param array $optParams Optional parameters.
|
||||
* @return Google_Service_Gmail_Filter
|
||||
*/
|
||||
public function create($userId, Google_Service_Gmail_Filter $postBody, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId, 'postBody' => $postBody);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('create', array($params), "Google_Service_Gmail_Filter");
|
||||
}
|
||||
/**
|
||||
* Deletes a filter. (filters.delete)
|
||||
*
|
||||
* @param string $userId User's email address. The special value "me" can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param string $id The ID of the filter to be deleted.
|
||||
* @param array $optParams Optional parameters.
|
||||
*/
|
||||
public function delete($userId, $id, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId, 'id' => $id);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('delete', array($params));
|
||||
}
|
||||
/**
|
||||
* Gets a filter. (filters.get)
|
||||
*
|
||||
* @param string $userId User's email address. The special value "me" can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param string $id The ID of the filter to be fetched.
|
||||
* @param array $optParams Optional parameters.
|
||||
* @return Google_Service_Gmail_Filter
|
||||
*/
|
||||
public function get($userId, $id, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId, 'id' => $id);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('get', array($params), "Google_Service_Gmail_Filter");
|
||||
}
|
||||
/**
|
||||
* Lists the message filters of a Gmail user. (filters.listUsersSettingsFilters)
|
||||
*
|
||||
* @param string $userId User's email address. The special value "me" can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param array $optParams Optional parameters.
|
||||
* @return Google_Service_Gmail_ListFiltersResponse
|
||||
*/
|
||||
public function listUsersSettingsFilters($userId, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('list', array($params), "Google_Service_Gmail_ListFiltersResponse");
|
||||
}
|
||||
}
|
@ -0,0 +1,97 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* The "forwardingAddresses" collection of methods.
|
||||
* Typical usage is:
|
||||
* <code>
|
||||
* $gmailService = new Google_Service_Gmail(...);
|
||||
* $forwardingAddresses = $gmailService->forwardingAddresses;
|
||||
* </code>
|
||||
*/
|
||||
class Google_Service_Gmail_Resource_UsersSettingsForwardingAddresses extends Google_Service_Resource
|
||||
{
|
||||
/**
|
||||
* Creates a forwarding address. If ownership verification is required, a
|
||||
* message will be sent to the recipient and the resource's verification status
|
||||
* will be set to pending; otherwise, the resource will be created with
|
||||
* verification status set to accepted.
|
||||
*
|
||||
* This method is only available to service account clients that have been
|
||||
* delegated domain-wide authority. (forwardingAddresses.create)
|
||||
*
|
||||
* @param string $userId User's email address. The special value "me" can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param Google_Service_Gmail_ForwardingAddress $postBody
|
||||
* @param array $optParams Optional parameters.
|
||||
* @return Google_Service_Gmail_ForwardingAddress
|
||||
*/
|
||||
public function create($userId, Google_Service_Gmail_ForwardingAddress $postBody, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId, 'postBody' => $postBody);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('create', array($params), "Google_Service_Gmail_ForwardingAddress");
|
||||
}
|
||||
/**
|
||||
* Deletes the specified forwarding address and revokes any verification that
|
||||
* may have been required.
|
||||
*
|
||||
* This method is only available to service account clients that have been
|
||||
* delegated domain-wide authority. (forwardingAddresses.delete)
|
||||
*
|
||||
* @param string $userId User's email address. The special value "me" can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param string $forwardingEmail The forwarding address to be deleted.
|
||||
* @param array $optParams Optional parameters.
|
||||
*/
|
||||
public function delete($userId, $forwardingEmail, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId, 'forwardingEmail' => $forwardingEmail);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('delete', array($params));
|
||||
}
|
||||
/**
|
||||
* Gets the specified forwarding address. (forwardingAddresses.get)
|
||||
*
|
||||
* @param string $userId User's email address. The special value "me" can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param string $forwardingEmail The forwarding address to be retrieved.
|
||||
* @param array $optParams Optional parameters.
|
||||
* @return Google_Service_Gmail_ForwardingAddress
|
||||
*/
|
||||
public function get($userId, $forwardingEmail, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId, 'forwardingEmail' => $forwardingEmail);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('get', array($params), "Google_Service_Gmail_ForwardingAddress");
|
||||
}
|
||||
/**
|
||||
* Lists the forwarding addresses for the specified account.
|
||||
* (forwardingAddresses.listUsersSettingsForwardingAddresses)
|
||||
*
|
||||
* @param string $userId User's email address. The special value "me" can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param array $optParams Optional parameters.
|
||||
* @return Google_Service_Gmail_ListForwardingAddressesResponse
|
||||
*/
|
||||
public function listUsersSettingsForwardingAddresses($userId, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('list', array($params), "Google_Service_Gmail_ListForwardingAddressesResponse");
|
||||
}
|
||||
}
|
@ -0,0 +1,162 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* The "sendAs" collection of methods.
|
||||
* Typical usage is:
|
||||
* <code>
|
||||
* $gmailService = new Google_Service_Gmail(...);
|
||||
* $sendAs = $gmailService->sendAs;
|
||||
* </code>
|
||||
*/
|
||||
class Google_Service_Gmail_Resource_UsersSettingsSendAs extends Google_Service_Resource
|
||||
{
|
||||
/**
|
||||
* Creates a custom "from" send-as alias. If an SMTP MSA is specified, Gmail
|
||||
* will attempt to connect to the SMTP service to validate the configuration
|
||||
* before creating the alias. If ownership verification is required for the
|
||||
* alias, a message will be sent to the email address and the resource's
|
||||
* verification status will be set to pending; otherwise, the resource will be
|
||||
* created with verification status set to accepted. If a signature is provided,
|
||||
* Gmail will sanitize the HTML before saving it with the alias.
|
||||
*
|
||||
* This method is only available to service account clients that have been
|
||||
* delegated domain-wide authority. (sendAs.create)
|
||||
*
|
||||
* @param string $userId User's email address. The special value "me" can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param Google_Service_Gmail_SendAs $postBody
|
||||
* @param array $optParams Optional parameters.
|
||||
* @return Google_Service_Gmail_SendAs
|
||||
*/
|
||||
public function create($userId, Google_Service_Gmail_SendAs $postBody, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId, 'postBody' => $postBody);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('create', array($params), "Google_Service_Gmail_SendAs");
|
||||
}
|
||||
/**
|
||||
* Deletes the specified send-as alias. Revokes any verification that may have
|
||||
* been required for using it.
|
||||
*
|
||||
* This method is only available to service account clients that have been
|
||||
* delegated domain-wide authority. (sendAs.delete)
|
||||
*
|
||||
* @param string $userId User's email address. The special value "me" can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param string $sendAsEmail The send-as alias to be deleted.
|
||||
* @param array $optParams Optional parameters.
|
||||
*/
|
||||
public function delete($userId, $sendAsEmail, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId, 'sendAsEmail' => $sendAsEmail);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('delete', array($params));
|
||||
}
|
||||
/**
|
||||
* Gets the specified send-as alias. Fails with an HTTP 404 error if the
|
||||
* specified address is not a member of the collection. (sendAs.get)
|
||||
*
|
||||
* @param string $userId User's email address. The special value "me" can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param string $sendAsEmail The send-as alias to be retrieved.
|
||||
* @param array $optParams Optional parameters.
|
||||
* @return Google_Service_Gmail_SendAs
|
||||
*/
|
||||
public function get($userId, $sendAsEmail, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId, 'sendAsEmail' => $sendAsEmail);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('get', array($params), "Google_Service_Gmail_SendAs");
|
||||
}
|
||||
/**
|
||||
* Lists the send-as aliases for the specified account. The result includes the
|
||||
* primary send-as address associated with the account as well as any custom
|
||||
* "from" aliases. (sendAs.listUsersSettingsSendAs)
|
||||
*
|
||||
* @param string $userId User's email address. The special value "me" can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param array $optParams Optional parameters.
|
||||
* @return Google_Service_Gmail_ListSendAsResponse
|
||||
*/
|
||||
public function listUsersSettingsSendAs($userId, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('list', array($params), "Google_Service_Gmail_ListSendAsResponse");
|
||||
}
|
||||
/**
|
||||
* Updates a send-as alias. If a signature is provided, Gmail will sanitize the
|
||||
* HTML before saving it with the alias.
|
||||
*
|
||||
* Addresses other than the primary address for the account can only be updated
|
||||
* by service account clients that have been delegated domain-wide authority.
|
||||
* This method supports patch semantics. (sendAs.patch)
|
||||
*
|
||||
* @param string $userId User's email address. The special value "me" can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param string $sendAsEmail The send-as alias to be updated.
|
||||
* @param Google_Service_Gmail_SendAs $postBody
|
||||
* @param array $optParams Optional parameters.
|
||||
* @return Google_Service_Gmail_SendAs
|
||||
*/
|
||||
public function patch($userId, $sendAsEmail, Google_Service_Gmail_SendAs $postBody, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId, 'sendAsEmail' => $sendAsEmail, 'postBody' => $postBody);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('patch', array($params), "Google_Service_Gmail_SendAs");
|
||||
}
|
||||
/**
|
||||
* Updates a send-as alias. If a signature is provided, Gmail will sanitize the
|
||||
* HTML before saving it with the alias.
|
||||
*
|
||||
* Addresses other than the primary address for the account can only be updated
|
||||
* by service account clients that have been delegated domain-wide authority.
|
||||
* (sendAs.update)
|
||||
*
|
||||
* @param string $userId User's email address. The special value "me" can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param string $sendAsEmail The send-as alias to be updated.
|
||||
* @param Google_Service_Gmail_SendAs $postBody
|
||||
* @param array $optParams Optional parameters.
|
||||
* @return Google_Service_Gmail_SendAs
|
||||
*/
|
||||
public function update($userId, $sendAsEmail, Google_Service_Gmail_SendAs $postBody, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId, 'sendAsEmail' => $sendAsEmail, 'postBody' => $postBody);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('update', array($params), "Google_Service_Gmail_SendAs");
|
||||
}
|
||||
/**
|
||||
* Sends a verification email to the specified send-as alias address. The
|
||||
* verification status must be pending.
|
||||
*
|
||||
* This method is only available to service account clients that have been
|
||||
* delegated domain-wide authority. (sendAs.verify)
|
||||
*
|
||||
* @param string $userId User's email address. The special value "me" can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param string $sendAsEmail The send-as alias to be verified.
|
||||
* @param array $optParams Optional parameters.
|
||||
*/
|
||||
public function verify($userId, $sendAsEmail, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId, 'sendAsEmail' => $sendAsEmail);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('verify', array($params));
|
||||
}
|
||||
}
|
@ -0,0 +1,115 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* The "smimeInfo" collection of methods.
|
||||
* Typical usage is:
|
||||
* <code>
|
||||
* $gmailService = new Google_Service_Gmail(...);
|
||||
* $smimeInfo = $gmailService->smimeInfo;
|
||||
* </code>
|
||||
*/
|
||||
class Google_Service_Gmail_Resource_UsersSettingsSendAsSmimeInfo extends Google_Service_Resource
|
||||
{
|
||||
/**
|
||||
* Deletes the specified S/MIME config for the specified send-as alias.
|
||||
* (smimeInfo.delete)
|
||||
*
|
||||
* @param string $userId The user's email address. The special value me can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param string $sendAsEmail The email address that appears in the "From:"
|
||||
* header for mail sent using this alias.
|
||||
* @param string $id The immutable ID for the SmimeInfo.
|
||||
* @param array $optParams Optional parameters.
|
||||
*/
|
||||
public function delete($userId, $sendAsEmail, $id, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId, 'sendAsEmail' => $sendAsEmail, 'id' => $id);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('delete', array($params));
|
||||
}
|
||||
/**
|
||||
* Gets the specified S/MIME config for the specified send-as alias.
|
||||
* (smimeInfo.get)
|
||||
*
|
||||
* @param string $userId The user's email address. The special value me can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param string $sendAsEmail The email address that appears in the "From:"
|
||||
* header for mail sent using this alias.
|
||||
* @param string $id The immutable ID for the SmimeInfo.
|
||||
* @param array $optParams Optional parameters.
|
||||
* @return Google_Service_Gmail_SmimeInfo
|
||||
*/
|
||||
public function get($userId, $sendAsEmail, $id, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId, 'sendAsEmail' => $sendAsEmail, 'id' => $id);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('get', array($params), "Google_Service_Gmail_SmimeInfo");
|
||||
}
|
||||
/**
|
||||
* Insert (upload) the given S/MIME config for the specified send-as alias. Note
|
||||
* that pkcs12 format is required for the key. (smimeInfo.insert)
|
||||
*
|
||||
* @param string $userId The user's email address. The special value me can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param string $sendAsEmail The email address that appears in the "From:"
|
||||
* header for mail sent using this alias.
|
||||
* @param Google_Service_Gmail_SmimeInfo $postBody
|
||||
* @param array $optParams Optional parameters.
|
||||
* @return Google_Service_Gmail_SmimeInfo
|
||||
*/
|
||||
public function insert($userId, $sendAsEmail, Google_Service_Gmail_SmimeInfo $postBody, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId, 'sendAsEmail' => $sendAsEmail, 'postBody' => $postBody);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('insert', array($params), "Google_Service_Gmail_SmimeInfo");
|
||||
}
|
||||
/**
|
||||
* Lists S/MIME configs for the specified send-as alias.
|
||||
* (smimeInfo.listUsersSettingsSendAsSmimeInfo)
|
||||
*
|
||||
* @param string $userId The user's email address. The special value me can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param string $sendAsEmail The email address that appears in the "From:"
|
||||
* header for mail sent using this alias.
|
||||
* @param array $optParams Optional parameters.
|
||||
* @return Google_Service_Gmail_ListSmimeInfoResponse
|
||||
*/
|
||||
public function listUsersSettingsSendAsSmimeInfo($userId, $sendAsEmail, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId, 'sendAsEmail' => $sendAsEmail);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('list', array($params), "Google_Service_Gmail_ListSmimeInfoResponse");
|
||||
}
|
||||
/**
|
||||
* Sets the default S/MIME config for the specified send-as alias.
|
||||
* (smimeInfo.setDefault)
|
||||
*
|
||||
* @param string $userId The user's email address. The special value me can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param string $sendAsEmail The email address that appears in the "From:"
|
||||
* header for mail sent using this alias.
|
||||
* @param string $id The immutable ID for the SmimeInfo.
|
||||
* @param array $optParams Optional parameters.
|
||||
*/
|
||||
public function setDefault($userId, $sendAsEmail, $id, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId, 'sendAsEmail' => $sendAsEmail, 'id' => $id);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('setDefault', array($params));
|
||||
}
|
||||
}
|
@ -0,0 +1,135 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* The "threads" collection of methods.
|
||||
* Typical usage is:
|
||||
* <code>
|
||||
* $gmailService = new Google_Service_Gmail(...);
|
||||
* $threads = $gmailService->threads;
|
||||
* </code>
|
||||
*/
|
||||
class Google_Service_Gmail_Resource_UsersThreads extends Google_Service_Resource
|
||||
{
|
||||
/**
|
||||
* Immediately and permanently deletes the specified thread. This operation
|
||||
* cannot be undone. Prefer threads.trash instead. (threads.delete)
|
||||
*
|
||||
* @param string $userId The user's email address. The special value me can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param string $id ID of the Thread to delete.
|
||||
* @param array $optParams Optional parameters.
|
||||
*/
|
||||
public function delete($userId, $id, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId, 'id' => $id);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('delete', array($params));
|
||||
}
|
||||
/**
|
||||
* Gets the specified thread. (threads.get)
|
||||
*
|
||||
* @param string $userId The user's email address. The special value me can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param string $id The ID of the thread to retrieve.
|
||||
* @param array $optParams Optional parameters.
|
||||
*
|
||||
* @opt_param string format The format to return the messages in.
|
||||
* @opt_param string metadataHeaders When given and format is METADATA, only
|
||||
* include headers specified.
|
||||
* @return Google_Service_Gmail_Thread
|
||||
*/
|
||||
public function get($userId, $id, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId, 'id' => $id);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('get', array($params), "Google_Service_Gmail_Thread");
|
||||
}
|
||||
/**
|
||||
* Lists the threads in the user's mailbox. (threads.listUsersThreads)
|
||||
*
|
||||
* @param string $userId The user's email address. The special value me can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param array $optParams Optional parameters.
|
||||
*
|
||||
* @opt_param bool includeSpamTrash Include threads from SPAM and TRASH in the
|
||||
* results.
|
||||
* @opt_param string labelIds Only return threads with labels that match all of
|
||||
* the specified label IDs.
|
||||
* @opt_param string maxResults Maximum number of threads to return.
|
||||
* @opt_param string pageToken Page token to retrieve a specific page of results
|
||||
* in the list.
|
||||
* @opt_param string q Only return threads matching the specified query.
|
||||
* Supports the same query format as the Gmail search box. For example,
|
||||
* "from:someuser@example.com rfc822msgid: is:unread". Parameter cannot be used
|
||||
* when accessing the api using the gmail.metadata scope.
|
||||
* @return Google_Service_Gmail_ListThreadsResponse
|
||||
*/
|
||||
public function listUsersThreads($userId, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('list', array($params), "Google_Service_Gmail_ListThreadsResponse");
|
||||
}
|
||||
/**
|
||||
* Modifies the labels applied to the thread. This applies to all messages in
|
||||
* the thread. (threads.modify)
|
||||
*
|
||||
* @param string $userId The user's email address. The special value me can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param string $id The ID of the thread to modify.
|
||||
* @param Google_Service_Gmail_ModifyThreadRequest $postBody
|
||||
* @param array $optParams Optional parameters.
|
||||
* @return Google_Service_Gmail_Thread
|
||||
*/
|
||||
public function modify($userId, $id, Google_Service_Gmail_ModifyThreadRequest $postBody, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId, 'id' => $id, 'postBody' => $postBody);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('modify', array($params), "Google_Service_Gmail_Thread");
|
||||
}
|
||||
/**
|
||||
* Moves the specified thread to the trash. (threads.trash)
|
||||
*
|
||||
* @param string $userId The user's email address. The special value me can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param string $id The ID of the thread to Trash.
|
||||
* @param array $optParams Optional parameters.
|
||||
* @return Google_Service_Gmail_Thread
|
||||
*/
|
||||
public function trash($userId, $id, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId, 'id' => $id);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('trash', array($params), "Google_Service_Gmail_Thread");
|
||||
}
|
||||
/**
|
||||
* Removes the specified thread from the trash. (threads.untrash)
|
||||
*
|
||||
* @param string $userId The user's email address. The special value me can be
|
||||
* used to indicate the authenticated user.
|
||||
* @param string $id The ID of the thread to remove from Trash.
|
||||
* @param array $optParams Optional parameters.
|
||||
* @return Google_Service_Gmail_Thread
|
||||
*/
|
||||
public function untrash($userId, $id, $optParams = array())
|
||||
{
|
||||
$params = array('userId' => $userId, 'id' => $id);
|
||||
$params = array_merge($params, $optParams);
|
||||
return $this->call('untrash', array($params), "Google_Service_Gmail_Thread");
|
||||
}
|
||||
}
|
109
wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/SendAs.php
vendored
Normal file
109
wp-content/plugins/wp-mail-smtp/vendor/google/apiclient-services/src/Google/Service/Gmail/SendAs.php
vendored
Normal file
@ -0,0 +1,109 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
class Google_Service_Gmail_SendAs extends Google_Model
|
||||
{
|
||||
public $displayName;
|
||||
public $isDefault;
|
||||
public $isPrimary;
|
||||
public $replyToAddress;
|
||||
public $sendAsEmail;
|
||||
public $signature;
|
||||
protected $smtpMsaType = 'Google_Service_Gmail_SmtpMsa';
|
||||
protected $smtpMsaDataType = '';
|
||||
public $treatAsAlias;
|
||||
public $verificationStatus;
|
||||
|
||||
public function setDisplayName($displayName)
|
||||
{
|
||||
$this->displayName = $displayName;
|
||||
}
|
||||
public function getDisplayName()
|
||||
{
|
||||
return $this->displayName;
|
||||
}
|
||||
public function setIsDefault($isDefault)
|
||||
{
|
||||
$this->isDefault = $isDefault;
|
||||
}
|
||||
public function getIsDefault()
|
||||
{
|
||||
return $this->isDefault;
|
||||
}
|
||||
public function setIsPrimary($isPrimary)
|
||||
{
|
||||
$this->isPrimary = $isPrimary;
|
||||
}
|
||||
public function getIsPrimary()
|
||||
{
|
||||
return $this->isPrimary;
|
||||
}
|
||||
public function setReplyToAddress($replyToAddress)
|
||||
{
|
||||
$this->replyToAddress = $replyToAddress;
|
||||
}
|
||||
public function getReplyToAddress()
|
||||
{
|
||||
return $this->replyToAddress;
|
||||
}
|
||||
public function setSendAsEmail($sendAsEmail)
|
||||
{
|
||||
$this->sendAsEmail = $sendAsEmail;
|
||||
}
|
||||
public function getSendAsEmail()
|
||||
{
|
||||
return $this->sendAsEmail;
|
||||
}
|
||||
public function setSignature($signature)
|
||||
{
|
||||
$this->signature = $signature;
|
||||
}
|
||||
public function getSignature()
|
||||
{
|
||||
return $this->signature;
|
||||
}
|
||||
/**
|
||||
* @param Google_Service_Gmail_SmtpMsa
|
||||
*/
|
||||
public function setSmtpMsa(Google_Service_Gmail_SmtpMsa $smtpMsa)
|
||||
{
|
||||
$this->smtpMsa = $smtpMsa;
|
||||
}
|
||||
/**
|
||||
* @return Google_Service_Gmail_SmtpMsa
|
||||
*/
|
||||
public function getSmtpMsa()
|
||||
{
|
||||
return $this->smtpMsa;
|
||||
}
|
||||
public function setTreatAsAlias($treatAsAlias)
|
||||
{
|
||||
$this->treatAsAlias = $treatAsAlias;
|
||||
}
|
||||
public function getTreatAsAlias()
|
||||
{
|
||||
return $this->treatAsAlias;
|
||||
}
|
||||
public function setVerificationStatus($verificationStatus)
|
||||
{
|
||||
$this->verificationStatus = $verificationStatus;
|
||||
}
|
||||
public function getVerificationStatus()
|
||||
{
|
||||
return $this->verificationStatus;
|
||||
}
|
||||
}
|
@ -0,0 +1,84 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
class Google_Service_Gmail_SmimeInfo extends Google_Model
|
||||
{
|
||||
public $encryptedKeyPassword;
|
||||
public $expiration;
|
||||
public $id;
|
||||
public $isDefault;
|
||||
public $issuerCn;
|
||||
public $pem;
|
||||
public $pkcs12;
|
||||
|
||||
public function setEncryptedKeyPassword($encryptedKeyPassword)
|
||||
{
|
||||
$this->encryptedKeyPassword = $encryptedKeyPassword;
|
||||
}
|
||||
public function getEncryptedKeyPassword()
|
||||
{
|
||||
return $this->encryptedKeyPassword;
|
||||
}
|
||||
public function setExpiration($expiration)
|
||||
{
|
||||
$this->expiration = $expiration;
|
||||
}
|
||||
public function getExpiration()
|
||||
{
|
||||
return $this->expiration;
|
||||
}
|
||||
public function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
}
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
public function setIsDefault($isDefault)
|
||||
{
|
||||
$this->isDefault = $isDefault;
|
||||
}
|
||||
public function getIsDefault()
|
||||
{
|
||||
return $this->isDefault;
|
||||
}
|
||||
public function setIssuerCn($issuerCn)
|
||||
{
|
||||
$this->issuerCn = $issuerCn;
|
||||
}
|
||||
public function getIssuerCn()
|
||||
{
|
||||
return $this->issuerCn;
|
||||
}
|
||||
public function setPem($pem)
|
||||
{
|
||||
$this->pem = $pem;
|
||||
}
|
||||
public function getPem()
|
||||
{
|
||||
return $this->pem;
|
||||
}
|
||||
public function setPkcs12($pkcs12)
|
||||
{
|
||||
$this->pkcs12 = $pkcs12;
|
||||
}
|
||||
public function getPkcs12()
|
||||
{
|
||||
return $this->pkcs12;
|
||||
}
|
||||
}
|
@ -0,0 +1,66 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
class Google_Service_Gmail_SmtpMsa extends Google_Model
|
||||
{
|
||||
public $host;
|
||||
public $password;
|
||||
public $port;
|
||||
public $securityMode;
|
||||
public $username;
|
||||
|
||||
public function setHost($host)
|
||||
{
|
||||
$this->host = $host;
|
||||
}
|
||||
public function getHost()
|
||||
{
|
||||
return $this->host;
|
||||
}
|
||||
public function setPassword($password)
|
||||
{
|
||||
$this->password = $password;
|
||||
}
|
||||
public function getPassword()
|
||||
{
|
||||
return $this->password;
|
||||
}
|
||||
public function setPort($port)
|
||||
{
|
||||
$this->port = $port;
|
||||
}
|
||||
public function getPort()
|
||||
{
|
||||
return $this->port;
|
||||
}
|
||||
public function setSecurityMode($securityMode)
|
||||
{
|
||||
$this->securityMode = $securityMode;
|
||||
}
|
||||
public function getSecurityMode()
|
||||
{
|
||||
return $this->securityMode;
|
||||
}
|
||||
public function setUsername($username)
|
||||
{
|
||||
$this->username = $username;
|
||||
}
|
||||
public function getUsername()
|
||||
{
|
||||
return $this->username;
|
||||
}
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
class Google_Service_Gmail_Thread extends Google_Collection
|
||||
{
|
||||
protected $collection_key = 'messages';
|
||||
public $historyId;
|
||||
public $id;
|
||||
protected $messagesType = 'Google_Service_Gmail_Message';
|
||||
protected $messagesDataType = 'array';
|
||||
public $snippet;
|
||||
|
||||
public function setHistoryId($historyId)
|
||||
{
|
||||
$this->historyId = $historyId;
|
||||
}
|
||||
public function getHistoryId()
|
||||
{
|
||||
return $this->historyId;
|
||||
}
|
||||
public function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
}
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
/**
|
||||
* @param Google_Service_Gmail_Message
|
||||
*/
|
||||
public function setMessages($messages)
|
||||
{
|
||||
$this->messages = $messages;
|
||||
}
|
||||
/**
|
||||
* @return Google_Service_Gmail_Message
|
||||
*/
|
||||
public function getMessages()
|
||||
{
|
||||
return $this->messages;
|
||||
}
|
||||
public function setSnippet($snippet)
|
||||
{
|
||||
$this->snippet = $snippet;
|
||||
}
|
||||
public function getSnippet()
|
||||
{
|
||||
return $this->snippet;
|
||||
}
|
||||
}
|
@ -0,0 +1,93 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
class Google_Service_Gmail_VacationSettings extends Google_Model
|
||||
{
|
||||
public $enableAutoReply;
|
||||
public $endTime;
|
||||
public $responseBodyHtml;
|
||||
public $responseBodyPlainText;
|
||||
public $responseSubject;
|
||||
public $restrictToContacts;
|
||||
public $restrictToDomain;
|
||||
public $startTime;
|
||||
|
||||
public function setEnableAutoReply($enableAutoReply)
|
||||
{
|
||||
$this->enableAutoReply = $enableAutoReply;
|
||||
}
|
||||
public function getEnableAutoReply()
|
||||
{
|
||||
return $this->enableAutoReply;
|
||||
}
|
||||
public function setEndTime($endTime)
|
||||
{
|
||||
$this->endTime = $endTime;
|
||||
}
|
||||
public function getEndTime()
|
||||
{
|
||||
return $this->endTime;
|
||||
}
|
||||
public function setResponseBodyHtml($responseBodyHtml)
|
||||
{
|
||||
$this->responseBodyHtml = $responseBodyHtml;
|
||||
}
|
||||
public function getResponseBodyHtml()
|
||||
{
|
||||
return $this->responseBodyHtml;
|
||||
}
|
||||
public function setResponseBodyPlainText($responseBodyPlainText)
|
||||
{
|
||||
$this->responseBodyPlainText = $responseBodyPlainText;
|
||||
}
|
||||
public function getResponseBodyPlainText()
|
||||
{
|
||||
return $this->responseBodyPlainText;
|
||||
}
|
||||
public function setResponseSubject($responseSubject)
|
||||
{
|
||||
$this->responseSubject = $responseSubject;
|
||||
}
|
||||
public function getResponseSubject()
|
||||
{
|
||||
return $this->responseSubject;
|
||||
}
|
||||
public function setRestrictToContacts($restrictToContacts)
|
||||
{
|
||||
$this->restrictToContacts = $restrictToContacts;
|
||||
}
|
||||
public function getRestrictToContacts()
|
||||
{
|
||||
return $this->restrictToContacts;
|
||||
}
|
||||
public function setRestrictToDomain($restrictToDomain)
|
||||
{
|
||||
$this->restrictToDomain = $restrictToDomain;
|
||||
}
|
||||
public function getRestrictToDomain()
|
||||
{
|
||||
return $this->restrictToDomain;
|
||||
}
|
||||
public function setStartTime($startTime)
|
||||
{
|
||||
$this->startTime = $startTime;
|
||||
}
|
||||
public function getStartTime()
|
||||
{
|
||||
return $this->startTime;
|
||||
}
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
class Google_Service_Gmail_WatchRequest extends Google_Collection
|
||||
{
|
||||
protected $collection_key = 'labelIds';
|
||||
public $labelFilterAction;
|
||||
public $labelIds;
|
||||
public $topicName;
|
||||
|
||||
public function setLabelFilterAction($labelFilterAction)
|
||||
{
|
||||
$this->labelFilterAction = $labelFilterAction;
|
||||
}
|
||||
public function getLabelFilterAction()
|
||||
{
|
||||
return $this->labelFilterAction;
|
||||
}
|
||||
public function setLabelIds($labelIds)
|
||||
{
|
||||
$this->labelIds = $labelIds;
|
||||
}
|
||||
public function getLabelIds()
|
||||
{
|
||||
return $this->labelIds;
|
||||
}
|
||||
public function setTopicName($topicName)
|
||||
{
|
||||
$this->topicName = $topicName;
|
||||
}
|
||||
public function getTopicName()
|
||||
{
|
||||
return $this->topicName;
|
||||
}
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
class Google_Service_Gmail_WatchResponse extends Google_Model
|
||||
{
|
||||
public $expiration;
|
||||
public $historyId;
|
||||
|
||||
public function setExpiration($expiration)
|
||||
{
|
||||
$this->expiration = $expiration;
|
||||
}
|
||||
public function getExpiration()
|
||||
{
|
||||
return $this->expiration;
|
||||
}
|
||||
public function setHistoryId($historyId)
|
||||
{
|
||||
$this->historyId = $historyId;
|
||||
}
|
||||
public function getHistoryId()
|
||||
{
|
||||
return $this->historyId;
|
||||
}
|
||||
}
|
203
wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/LICENSE
vendored
Normal file
203
wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/LICENSE
vendored
Normal file
@ -0,0 +1,203 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
|
78
wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/AccessToken/Revoke.php
vendored
Normal file
78
wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/AccessToken/Revoke.php
vendored
Normal file
@ -0,0 +1,78 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright 2008 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
use Google\Auth\HttpHandler\HttpHandlerFactory;
|
||||
use GuzzleHttp\ClientInterface;
|
||||
use GuzzleHttp\Psr7;
|
||||
use GuzzleHttp\Psr7\Request;
|
||||
|
||||
/**
|
||||
* Wrapper around Google Access Tokens which provides convenience functions
|
||||
*
|
||||
*/
|
||||
class Google_AccessToken_Revoke
|
||||
{
|
||||
/**
|
||||
* @var GuzzleHttp\ClientInterface The http client
|
||||
*/
|
||||
private $http;
|
||||
|
||||
/**
|
||||
* Instantiates the class, but does not initiate the login flow, leaving it
|
||||
* to the discretion of the caller.
|
||||
*/
|
||||
public function __construct(ClientInterface $http = null)
|
||||
{
|
||||
$this->http = $http;
|
||||
}
|
||||
|
||||
/**
|
||||
* Revoke an OAuth2 access token or refresh token. This method will revoke the current access
|
||||
* token, if a token isn't provided.
|
||||
*
|
||||
* @param string|array $token The token (access token or a refresh token) that should be revoked.
|
||||
* @return boolean Returns True if the revocation was successful, otherwise False.
|
||||
*/
|
||||
public function revokeToken($token)
|
||||
{
|
||||
if (is_array($token)) {
|
||||
if (isset($token['refresh_token'])) {
|
||||
$token = $token['refresh_token'];
|
||||
} else {
|
||||
$token = $token['access_token'];
|
||||
}
|
||||
}
|
||||
|
||||
$body = Psr7\stream_for(http_build_query(array('token' => $token)));
|
||||
$request = new Request(
|
||||
'POST',
|
||||
Google_Client::OAUTH2_REVOKE_URI,
|
||||
[
|
||||
'Cache-Control' => 'no-store',
|
||||
'Content-Type' => 'application/x-www-form-urlencoded',
|
||||
],
|
||||
$body
|
||||
);
|
||||
|
||||
$httpHandler = HttpHandlerFactory::build($this->http);
|
||||
|
||||
$response = $httpHandler($request);
|
||||
|
||||
return $response->getStatusCode() == 200;
|
||||
}
|
||||
}
|
273
wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/AccessToken/Verify.php
vendored
Normal file
273
wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/AccessToken/Verify.php
vendored
Normal file
@ -0,0 +1,273 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright 2008 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
use Firebase\JWT\ExpiredException as ExpiredExceptionV3;
|
||||
use Firebase\JWT\SignatureInvalidException;
|
||||
use GuzzleHttp\Client;
|
||||
use GuzzleHttp\ClientInterface;
|
||||
use Psr\Cache\CacheItemPoolInterface;
|
||||
use Google\Auth\Cache\MemoryCacheItemPool;
|
||||
use Stash\Driver\FileSystem;
|
||||
use Stash\Pool;
|
||||
|
||||
/**
|
||||
* Wrapper around Google Access Tokens which provides convenience functions
|
||||
*
|
||||
*/
|
||||
class Google_AccessToken_Verify
|
||||
{
|
||||
const FEDERATED_SIGNON_CERT_URL = 'https://www.googleapis.com/oauth2/v3/certs';
|
||||
const OAUTH2_ISSUER = 'accounts.google.com';
|
||||
const OAUTH2_ISSUER_HTTPS = 'https://accounts.google.com';
|
||||
|
||||
/**
|
||||
* @var GuzzleHttp\ClientInterface The http client
|
||||
*/
|
||||
private $http;
|
||||
|
||||
/**
|
||||
* @var Psr\Cache\CacheItemPoolInterface cache class
|
||||
*/
|
||||
private $cache;
|
||||
|
||||
/**
|
||||
* Instantiates the class, but does not initiate the login flow, leaving it
|
||||
* to the discretion of the caller.
|
||||
*/
|
||||
public function __construct(
|
||||
ClientInterface $http = null,
|
||||
CacheItemPoolInterface $cache = null,
|
||||
$jwt = null
|
||||
) {
|
||||
if (null === $http) {
|
||||
$http = new Client();
|
||||
}
|
||||
|
||||
if (null === $cache) {
|
||||
$cache = new MemoryCacheItemPool;
|
||||
}
|
||||
|
||||
$this->http = $http;
|
||||
$this->cache = $cache;
|
||||
$this->jwt = $jwt ?: $this->getJwtService();
|
||||
}
|
||||
|
||||
/**
|
||||
* Verifies an id token and returns the authenticated apiLoginTicket.
|
||||
* Throws an exception if the id token is not valid.
|
||||
* The audience parameter can be used to control which id tokens are
|
||||
* accepted. By default, the id token must have been issued to this OAuth2 client.
|
||||
*
|
||||
* @param $audience
|
||||
* @return array the token payload, if successful
|
||||
*/
|
||||
public function verifyIdToken($idToken, $audience = null)
|
||||
{
|
||||
if (empty($idToken)) {
|
||||
throw new LogicException('id_token cannot be null');
|
||||
}
|
||||
|
||||
// set phpseclib constants if applicable
|
||||
$this->setPhpsecConstants();
|
||||
|
||||
// Check signature
|
||||
$certs = $this->getFederatedSignOnCerts();
|
||||
foreach ($certs as $cert) {
|
||||
$bigIntClass = $this->getBigIntClass();
|
||||
$rsaClass = $this->getRsaClass();
|
||||
$modulus = new $bigIntClass($this->jwt->urlsafeB64Decode($cert['n']), 256);
|
||||
$exponent = new $bigIntClass($this->jwt->urlsafeB64Decode($cert['e']), 256);
|
||||
|
||||
$rsa = new $rsaClass();
|
||||
$rsa->loadKey(array('n' => $modulus, 'e' => $exponent));
|
||||
|
||||
try {
|
||||
$payload = $this->jwt->decode(
|
||||
$idToken,
|
||||
$rsa->getPublicKey(),
|
||||
array('RS256')
|
||||
);
|
||||
|
||||
if (property_exists($payload, 'aud')) {
|
||||
if ($audience && $payload->aud != $audience) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// support HTTP and HTTPS issuers
|
||||
// @see https://developers.google.com/identity/sign-in/web/backend-auth
|
||||
$issuers = array(self::OAUTH2_ISSUER, self::OAUTH2_ISSUER_HTTPS);
|
||||
if (!isset($payload->iss) || !in_array($payload->iss, $issuers)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return (array) $payload;
|
||||
} catch (ExpiredException $e) {
|
||||
return false;
|
||||
} catch (ExpiredExceptionV3 $e) {
|
||||
return false;
|
||||
} catch (SignatureInvalidException $e) {
|
||||
// continue
|
||||
} catch (DomainException $e) {
|
||||
// continue
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private function getCache()
|
||||
{
|
||||
return $this->cache;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve and cache a certificates file.
|
||||
*
|
||||
* @param $url string location
|
||||
* @throws Google_Exception
|
||||
* @return array certificates
|
||||
*/
|
||||
private function retrieveCertsFromLocation($url)
|
||||
{
|
||||
// If we're retrieving a local file, just grab it.
|
||||
if (0 !== strpos($url, 'http')) {
|
||||
if (!$file = file_get_contents($url)) {
|
||||
throw new Google_Exception(
|
||||
"Failed to retrieve verification certificates: '" .
|
||||
$url . "'."
|
||||
);
|
||||
}
|
||||
|
||||
return json_decode($file, true);
|
||||
}
|
||||
|
||||
$response = $this->http->get($url);
|
||||
|
||||
if ($response->getStatusCode() == 200) {
|
||||
return json_decode((string) $response->getBody(), true);
|
||||
}
|
||||
throw new Google_Exception(
|
||||
sprintf(
|
||||
'Failed to retrieve verification certificates: "%s".',
|
||||
$response->getBody()->getContents()
|
||||
),
|
||||
$response->getStatusCode()
|
||||
);
|
||||
}
|
||||
|
||||
// Gets federated sign-on certificates to use for verifying identity tokens.
|
||||
// Returns certs as array structure, where keys are key ids, and values
|
||||
// are PEM encoded certificates.
|
||||
private function getFederatedSignOnCerts()
|
||||
{
|
||||
$certs = null;
|
||||
if ($cache = $this->getCache()) {
|
||||
$cacheItem = $cache->getItem('federated_signon_certs_v3');
|
||||
$certs = $cacheItem->get();
|
||||
}
|
||||
|
||||
|
||||
if (!$certs) {
|
||||
$certs = $this->retrieveCertsFromLocation(
|
||||
self::FEDERATED_SIGNON_CERT_URL
|
||||
);
|
||||
|
||||
if ($cache) {
|
||||
$cacheItem->expiresAt(new DateTime('+1 hour'));
|
||||
$cacheItem->set($certs);
|
||||
$cache->save($cacheItem);
|
||||
}
|
||||
}
|
||||
|
||||
if (!isset($certs['keys'])) {
|
||||
throw new InvalidArgumentException(
|
||||
'federated sign-on certs expects "keys" to be set'
|
||||
);
|
||||
}
|
||||
|
||||
return $certs['keys'];
|
||||
}
|
||||
|
||||
private function getJwtService()
|
||||
{
|
||||
$jwtClass = 'JWT';
|
||||
if (class_exists('\Firebase\JWT\JWT')) {
|
||||
$jwtClass = 'Firebase\JWT\JWT';
|
||||
}
|
||||
|
||||
if (property_exists($jwtClass, 'leeway') && $jwtClass::$leeway < 1) {
|
||||
// Ensures JWT leeway is at least 1
|
||||
// @see https://github.com/google/google-api-php-client/issues/827
|
||||
$jwtClass::$leeway = 1;
|
||||
}
|
||||
|
||||
return new $jwtClass;
|
||||
}
|
||||
|
||||
private function getRsaClass()
|
||||
{
|
||||
if (class_exists('phpseclib\Crypt\RSA')) {
|
||||
return 'phpseclib\Crypt\RSA';
|
||||
}
|
||||
|
||||
return 'Crypt_RSA';
|
||||
}
|
||||
|
||||
private function getBigIntClass()
|
||||
{
|
||||
if (class_exists('phpseclib\Math\BigInteger')) {
|
||||
return 'phpseclib\Math\BigInteger';
|
||||
}
|
||||
|
||||
return 'Math_BigInteger';
|
||||
}
|
||||
|
||||
private function getOpenSslConstant()
|
||||
{
|
||||
if (class_exists('phpseclib\Crypt\RSA')) {
|
||||
return 'phpseclib\Crypt\RSA::MODE_OPENSSL';
|
||||
}
|
||||
|
||||
if (class_exists('Crypt_RSA')) {
|
||||
return 'CRYPT_RSA_MODE_OPENSSL';
|
||||
}
|
||||
|
||||
throw new \Exception('Cannot find RSA class');
|
||||
}
|
||||
|
||||
/**
|
||||
* phpseclib calls "phpinfo" by default, which requires special
|
||||
* whitelisting in the AppEngine VM environment. This function
|
||||
* sets constants to bypass the need for phpseclib to check phpinfo
|
||||
*
|
||||
* @see phpseclib/Math/BigInteger
|
||||
* @see https://github.com/GoogleCloudPlatform/getting-started-php/issues/85
|
||||
*/
|
||||
private function setPhpsecConstants()
|
||||
{
|
||||
if (filter_var(getenv('GAE_VM'), FILTER_VALIDATE_BOOLEAN)) {
|
||||
if (!defined('MATH_BIGINTEGER_OPENSSL_ENABLED')) {
|
||||
define('MATH_BIGINTEGER_OPENSSL_ENABLED', true);
|
||||
}
|
||||
if (!defined('CRYPT_RSA_MODE')) {
|
||||
define('CRYPT_RSA_MODE', constant($this->getOpenSslConstant()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2015 Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
use GuzzleHttp\Client;
|
||||
use GuzzleHttp\ClientInterface;
|
||||
|
||||
class Google_AuthHandler_AuthHandlerFactory
|
||||
{
|
||||
/**
|
||||
* Builds out a default http handler for the installed version of guzzle.
|
||||
*
|
||||
* @return Google_AuthHandler_Guzzle5AuthHandler|Google_AuthHandler_Guzzle6AuthHandler
|
||||
* @throws Exception
|
||||
*/
|
||||
public static function build($cache = null, array $cacheConfig = [])
|
||||
{
|
||||
$version = ClientInterface::VERSION;
|
||||
|
||||
switch ($version[0]) {
|
||||
case '5':
|
||||
return new Google_AuthHandler_Guzzle5AuthHandler($cache, $cacheConfig);
|
||||
case '6':
|
||||
return new Google_AuthHandler_Guzzle6AuthHandler($cache, $cacheConfig);
|
||||
default:
|
||||
throw new Exception('Version not supported');
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,99 @@
|
||||
<?php
|
||||
|
||||
use Google\Auth\CredentialsLoader;
|
||||
use Google\Auth\HttpHandler\HttpHandlerFactory;
|
||||
use Google\Auth\FetchAuthTokenCache;
|
||||
use Google\Auth\Subscriber\AuthTokenSubscriber;
|
||||
use Google\Auth\Subscriber\ScopedAccessTokenSubscriber;
|
||||
use Google\Auth\Subscriber\SimpleSubscriber;
|
||||
use GuzzleHttp\Client;
|
||||
use GuzzleHttp\ClientInterface;
|
||||
use Psr\Cache\CacheItemPoolInterface;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class Google_AuthHandler_Guzzle5AuthHandler
|
||||
{
|
||||
protected $cache;
|
||||
protected $cacheConfig;
|
||||
|
||||
public function __construct(CacheItemPoolInterface $cache = null, array $cacheConfig = [])
|
||||
{
|
||||
$this->cache = $cache;
|
||||
$this->cacheConfig = $cacheConfig;
|
||||
}
|
||||
|
||||
public function attachCredentials(
|
||||
ClientInterface $http,
|
||||
CredentialsLoader $credentials,
|
||||
callable $tokenCallback = null
|
||||
) {
|
||||
// use the provided cache
|
||||
if ($this->cache) {
|
||||
$credentials = new FetchAuthTokenCache(
|
||||
$credentials,
|
||||
$this->cacheConfig,
|
||||
$this->cache
|
||||
);
|
||||
}
|
||||
// if we end up needing to make an HTTP request to retrieve credentials, we
|
||||
// can use our existing one, but we need to throw exceptions so the error
|
||||
// bubbles up.
|
||||
$authHttp = $this->createAuthHttp($http);
|
||||
$authHttpHandler = HttpHandlerFactory::build($authHttp);
|
||||
$subscriber = new AuthTokenSubscriber(
|
||||
$credentials,
|
||||
$authHttpHandler,
|
||||
$tokenCallback
|
||||
);
|
||||
|
||||
$http->setDefaultOption('auth', 'google_auth');
|
||||
$http->getEmitter()->attach($subscriber);
|
||||
|
||||
return $http;
|
||||
}
|
||||
|
||||
public function attachToken(ClientInterface $http, array $token, array $scopes)
|
||||
{
|
||||
$tokenFunc = function ($scopes) use ($token) {
|
||||
return $token['access_token'];
|
||||
};
|
||||
|
||||
$subscriber = new ScopedAccessTokenSubscriber(
|
||||
$tokenFunc,
|
||||
$scopes,
|
||||
$this->cacheConfig,
|
||||
$this->cache
|
||||
);
|
||||
|
||||
$http->setDefaultOption('auth', 'scoped');
|
||||
$http->getEmitter()->attach($subscriber);
|
||||
|
||||
return $http;
|
||||
}
|
||||
|
||||
public function attachKey(ClientInterface $http, $key)
|
||||
{
|
||||
$subscriber = new SimpleSubscriber(['key' => $key]);
|
||||
|
||||
$http->setDefaultOption('auth', 'simple');
|
||||
$http->getEmitter()->attach($subscriber);
|
||||
|
||||
return $http;
|
||||
}
|
||||
|
||||
private function createAuthHttp(ClientInterface $http)
|
||||
{
|
||||
return new Client(
|
||||
[
|
||||
'base_url' => $http->getBaseUrl(),
|
||||
'defaults' => [
|
||||
'exceptions' => true,
|
||||
'verify' => $http->getDefaultOption('verify'),
|
||||
'proxy' => $http->getDefaultOption('proxy'),
|
||||
]
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,106 @@
|
||||
<?php
|
||||
|
||||
use Google\Auth\CredentialsLoader;
|
||||
use Google\Auth\HttpHandler\HttpHandlerFactory;
|
||||
use Google\Auth\FetchAuthTokenCache;
|
||||
use Google\Auth\Middleware\AuthTokenMiddleware;
|
||||
use Google\Auth\Middleware\ScopedAccessTokenMiddleware;
|
||||
use Google\Auth\Middleware\SimpleMiddleware;
|
||||
use GuzzleHttp\Client;
|
||||
use GuzzleHttp\ClientInterface;
|
||||
use Psr\Cache\CacheItemPoolInterface;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class Google_AuthHandler_Guzzle6AuthHandler
|
||||
{
|
||||
protected $cache;
|
||||
protected $cacheConfig;
|
||||
|
||||
public function __construct(CacheItemPoolInterface $cache = null, array $cacheConfig = [])
|
||||
{
|
||||
$this->cache = $cache;
|
||||
$this->cacheConfig = $cacheConfig;
|
||||
}
|
||||
|
||||
public function attachCredentials(
|
||||
ClientInterface $http,
|
||||
CredentialsLoader $credentials,
|
||||
callable $tokenCallback = null
|
||||
) {
|
||||
// use the provided cache
|
||||
if ($this->cache) {
|
||||
$credentials = new FetchAuthTokenCache(
|
||||
$credentials,
|
||||
$this->cacheConfig,
|
||||
$this->cache
|
||||
);
|
||||
}
|
||||
// if we end up needing to make an HTTP request to retrieve credentials, we
|
||||
// can use our existing one, but we need to throw exceptions so the error
|
||||
// bubbles up.
|
||||
$authHttp = $this->createAuthHttp($http);
|
||||
$authHttpHandler = HttpHandlerFactory::build($authHttp);
|
||||
$middleware = new AuthTokenMiddleware(
|
||||
$credentials,
|
||||
$authHttpHandler,
|
||||
$tokenCallback
|
||||
);
|
||||
|
||||
$config = $http->getConfig();
|
||||
$config['handler']->remove('google_auth');
|
||||
$config['handler']->push($middleware, 'google_auth');
|
||||
$config['auth'] = 'google_auth';
|
||||
$http = new Client($config);
|
||||
|
||||
return $http;
|
||||
}
|
||||
|
||||
public function attachToken(ClientInterface $http, array $token, array $scopes)
|
||||
{
|
||||
$tokenFunc = function ($scopes) use ($token) {
|
||||
return $token['access_token'];
|
||||
};
|
||||
|
||||
$middleware = new ScopedAccessTokenMiddleware(
|
||||
$tokenFunc,
|
||||
$scopes,
|
||||
$this->cacheConfig,
|
||||
$this->cache
|
||||
);
|
||||
|
||||
$config = $http->getConfig();
|
||||
$config['handler']->remove('google_auth');
|
||||
$config['handler']->push($middleware, 'google_auth');
|
||||
$config['auth'] = 'scoped';
|
||||
$http = new Client($config);
|
||||
|
||||
return $http;
|
||||
}
|
||||
|
||||
public function attachKey(ClientInterface $http, $key)
|
||||
{
|
||||
$middleware = new SimpleMiddleware(['key' => $key]);
|
||||
|
||||
$config = $http->getConfig();
|
||||
$config['handler']->remove('google_auth');
|
||||
$config['handler']->push($middleware, 'google_auth');
|
||||
$config['auth'] = 'simple';
|
||||
$http = new Client($config);
|
||||
|
||||
return $http;
|
||||
}
|
||||
|
||||
private function createAuthHttp(ClientInterface $http)
|
||||
{
|
||||
return new Client(
|
||||
[
|
||||
'base_uri' => $http->getConfig('base_uri'),
|
||||
'exceptions' => true,
|
||||
'verify' => $http->getConfig('verify'),
|
||||
'proxy' => $http->getConfig('proxy'),
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
1139
wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Client.php
vendored
Normal file
1139
wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Client.php
vendored
Normal file
File diff suppressed because it is too large
Load Diff
100
wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Collection.php
vendored
Normal file
100
wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Collection.php
vendored
Normal file
@ -0,0 +1,100 @@
|
||||
<?php
|
||||
|
||||
if (!class_exists('Google_Client')) {
|
||||
require_once __DIR__ . '/autoload.php';
|
||||
}
|
||||
|
||||
/**
|
||||
* Extension to the regular Google_Model that automatically
|
||||
* exposes the items array for iteration, so you can just
|
||||
* iterate over the object rather than a reference inside.
|
||||
*/
|
||||
class Google_Collection extends Google_Model implements Iterator, Countable
|
||||
{
|
||||
protected $collection_key = 'items';
|
||||
|
||||
public function rewind()
|
||||
{
|
||||
if (isset($this->{$this->collection_key})
|
||||
&& is_array($this->{$this->collection_key})) {
|
||||
reset($this->{$this->collection_key});
|
||||
}
|
||||
}
|
||||
|
||||
public function current()
|
||||
{
|
||||
$this->coerceType($this->key());
|
||||
if (is_array($this->{$this->collection_key})) {
|
||||
return current($this->{$this->collection_key});
|
||||
}
|
||||
}
|
||||
|
||||
public function key()
|
||||
{
|
||||
if (isset($this->{$this->collection_key})
|
||||
&& is_array($this->{$this->collection_key})) {
|
||||
return key($this->{$this->collection_key});
|
||||
}
|
||||
}
|
||||
|
||||
public function next()
|
||||
{
|
||||
return next($this->{$this->collection_key});
|
||||
}
|
||||
|
||||
public function valid()
|
||||
{
|
||||
$key = $this->key();
|
||||
return $key !== null && $key !== false;
|
||||
}
|
||||
|
||||
public function count()
|
||||
{
|
||||
if (!isset($this->{$this->collection_key})) {
|
||||
return 0;
|
||||
}
|
||||
return count($this->{$this->collection_key});
|
||||
}
|
||||
|
||||
public function offsetExists($offset)
|
||||
{
|
||||
if (!is_numeric($offset)) {
|
||||
return parent::offsetExists($offset);
|
||||
}
|
||||
return isset($this->{$this->collection_key}[$offset]);
|
||||
}
|
||||
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
if (!is_numeric($offset)) {
|
||||
return parent::offsetGet($offset);
|
||||
}
|
||||
$this->coerceType($offset);
|
||||
return $this->{$this->collection_key}[$offset];
|
||||
}
|
||||
|
||||
public function offsetSet($offset, $value)
|
||||
{
|
||||
if (!is_numeric($offset)) {
|
||||
return parent::offsetSet($offset, $value);
|
||||
}
|
||||
$this->{$this->collection_key}[$offset] = $value;
|
||||
}
|
||||
|
||||
public function offsetUnset($offset)
|
||||
{
|
||||
if (!is_numeric($offset)) {
|
||||
return parent::offsetUnset($offset);
|
||||
}
|
||||
unset($this->{$this->collection_key}[$offset]);
|
||||
}
|
||||
|
||||
private function coerceType($offset)
|
||||
{
|
||||
$keyType = $this->keyType($this->collection_key);
|
||||
if ($keyType && !is_object($this->{$this->collection_key}[$offset])) {
|
||||
$this->{$this->collection_key}[$offset] =
|
||||
new $keyType($this->{$this->collection_key}[$offset]);
|
||||
}
|
||||
}
|
||||
}
|
20
wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Exception.php
vendored
Normal file
20
wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Exception.php
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2013 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
class Google_Exception extends Exception
|
||||
{
|
||||
}
|
253
wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Http/Batch.php
vendored
Normal file
253
wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Http/Batch.php
vendored
Normal file
@ -0,0 +1,253 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2012 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
use GuzzleHttp\Psr7;
|
||||
use GuzzleHttp\Psr7\Request;
|
||||
use GuzzleHttp\Psr7\Response;
|
||||
use Psr\Http\Message\RequestInterface;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
|
||||
/**
|
||||
* Class to handle batched requests to the Google API service.
|
||||
*
|
||||
* Note that calls to `Google_Http_Batch::execute()` do not clear the queued
|
||||
* requests. To start a new batch, be sure to create a new instance of this
|
||||
* class.
|
||||
*/
|
||||
class Google_Http_Batch
|
||||
{
|
||||
const BATCH_PATH = 'batch';
|
||||
|
||||
private static $CONNECTION_ESTABLISHED_HEADERS = array(
|
||||
"HTTP/1.0 200 Connection established\r\n\r\n",
|
||||
"HTTP/1.1 200 Connection established\r\n\r\n",
|
||||
);
|
||||
|
||||
/** @var string Multipart Boundary. */
|
||||
private $boundary;
|
||||
|
||||
/** @var array service requests to be executed. */
|
||||
private $requests = array();
|
||||
|
||||
/** @var Google_Client */
|
||||
private $client;
|
||||
|
||||
private $rootUrl;
|
||||
|
||||
private $batchPath;
|
||||
|
||||
public function __construct(
|
||||
Google_Client $client,
|
||||
$boundary = false,
|
||||
$rootUrl = null,
|
||||
$batchPath = null
|
||||
) {
|
||||
$this->client = $client;
|
||||
$this->boundary = $boundary ?: mt_rand();
|
||||
$this->rootUrl = rtrim($rootUrl ?: $this->client->getConfig('base_path'), '/');
|
||||
$this->batchPath = $batchPath ?: self::BATCH_PATH;
|
||||
}
|
||||
|
||||
public function add(RequestInterface $request, $key = false)
|
||||
{
|
||||
if (false == $key) {
|
||||
$key = mt_rand();
|
||||
}
|
||||
|
||||
$this->requests[$key] = $request;
|
||||
}
|
||||
|
||||
public function execute()
|
||||
{
|
||||
$body = '';
|
||||
$classes = array();
|
||||
$batchHttpTemplate = <<<EOF
|
||||
--%s
|
||||
Content-Type: application/http
|
||||
Content-Transfer-Encoding: binary
|
||||
MIME-Version: 1.0
|
||||
Content-ID: %s
|
||||
|
||||
%s
|
||||
%s%s
|
||||
|
||||
|
||||
EOF;
|
||||
|
||||
/** @var Google_Http_Request $req */
|
||||
foreach ($this->requests as $key => $request) {
|
||||
$firstLine = sprintf(
|
||||
'%s %s HTTP/%s',
|
||||
$request->getMethod(),
|
||||
$request->getRequestTarget(),
|
||||
$request->getProtocolVersion()
|
||||
);
|
||||
|
||||
$content = (string) $request->getBody();
|
||||
|
||||
$headers = '';
|
||||
foreach ($request->getHeaders() as $name => $values) {
|
||||
$headers .= sprintf("%s:%s\r\n", $name, implode(', ', $values));
|
||||
}
|
||||
|
||||
$body .= sprintf(
|
||||
$batchHttpTemplate,
|
||||
$this->boundary,
|
||||
$key,
|
||||
$firstLine,
|
||||
$headers,
|
||||
$content ? "\n".$content : ''
|
||||
);
|
||||
|
||||
$classes['response-' . $key] = $request->getHeaderLine('X-Php-Expected-Class');
|
||||
}
|
||||
|
||||
$body .= "--{$this->boundary}--";
|
||||
$body = trim($body);
|
||||
$url = $this->rootUrl . '/' . $this->batchPath;
|
||||
$headers = array(
|
||||
'Content-Type' => sprintf('multipart/mixed; boundary=%s', $this->boundary),
|
||||
'Content-Length' => strlen($body),
|
||||
);
|
||||
|
||||
$request = new Request(
|
||||
'POST',
|
||||
$url,
|
||||
$headers,
|
||||
$body
|
||||
);
|
||||
|
||||
$response = $this->client->execute($request);
|
||||
|
||||
return $this->parseResponse($response, $classes);
|
||||
}
|
||||
|
||||
public function parseResponse(ResponseInterface $response, $classes = array())
|
||||
{
|
||||
$contentType = $response->getHeaderLine('content-type');
|
||||
$contentType = explode(';', $contentType);
|
||||
$boundary = false;
|
||||
foreach ($contentType as $part) {
|
||||
$part = explode('=', $part, 2);
|
||||
if (isset($part[0]) && 'boundary' == trim($part[0])) {
|
||||
$boundary = $part[1];
|
||||
}
|
||||
}
|
||||
|
||||
$body = (string) $response->getBody();
|
||||
if (!empty($body)) {
|
||||
$body = str_replace("--$boundary--", "--$boundary", $body);
|
||||
$parts = explode("--$boundary", $body);
|
||||
$responses = array();
|
||||
$requests = array_values($this->requests);
|
||||
|
||||
foreach ($parts as $i => $part) {
|
||||
$part = trim($part);
|
||||
if (!empty($part)) {
|
||||
list($rawHeaders, $part) = explode("\r\n\r\n", $part, 2);
|
||||
$headers = $this->parseRawHeaders($rawHeaders);
|
||||
|
||||
$status = substr($part, 0, strpos($part, "\n"));
|
||||
$status = explode(" ", $status);
|
||||
$status = $status[1];
|
||||
|
||||
list($partHeaders, $partBody) = $this->parseHttpResponse($part, false);
|
||||
$response = new Response(
|
||||
$status,
|
||||
$partHeaders,
|
||||
Psr7\stream_for($partBody)
|
||||
);
|
||||
|
||||
// Need content id.
|
||||
$key = $headers['content-id'];
|
||||
|
||||
try {
|
||||
$response = Google_Http_REST::decodeHttpResponse($response, $requests[$i-1]);
|
||||
} catch (Google_Service_Exception $e) {
|
||||
// Store the exception as the response, so successful responses
|
||||
// can be processed.
|
||||
$response = $e;
|
||||
}
|
||||
|
||||
$responses[$key] = $response;
|
||||
}
|
||||
}
|
||||
|
||||
return $responses;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private function parseRawHeaders($rawHeaders)
|
||||
{
|
||||
$headers = array();
|
||||
$responseHeaderLines = explode("\r\n", $rawHeaders);
|
||||
foreach ($responseHeaderLines as $headerLine) {
|
||||
if ($headerLine && strpos($headerLine, ':') !== false) {
|
||||
list($header, $value) = explode(': ', $headerLine, 2);
|
||||
$header = strtolower($header);
|
||||
if (isset($headers[$header])) {
|
||||
$headers[$header] .= "\n" . $value;
|
||||
} else {
|
||||
$headers[$header] = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $headers;
|
||||
}
|
||||
|
||||
/**
|
||||
* Used by the IO lib and also the batch processing.
|
||||
*
|
||||
* @param $respData
|
||||
* @param $headerSize
|
||||
* @return array
|
||||
*/
|
||||
private function parseHttpResponse($respData, $headerSize)
|
||||
{
|
||||
// check proxy header
|
||||
foreach (self::$CONNECTION_ESTABLISHED_HEADERS as $established_header) {
|
||||
if (stripos($respData, $established_header) !== false) {
|
||||
// existed, remove it
|
||||
$respData = str_ireplace($established_header, '', $respData);
|
||||
// Subtract the proxy header size unless the cURL bug prior to 7.30.0
|
||||
// is present which prevented the proxy header size from being taken into
|
||||
// account.
|
||||
// @TODO look into this
|
||||
// if (!$this->needsQuirk()) {
|
||||
// $headerSize -= strlen($established_header);
|
||||
// }
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($headerSize) {
|
||||
$responseBody = substr($respData, $headerSize);
|
||||
$responseHeaders = substr($respData, 0, $headerSize);
|
||||
} else {
|
||||
$responseSegments = explode("\r\n\r\n", $respData, 2);
|
||||
$responseHeaders = $responseSegments[0];
|
||||
$responseBody = isset($responseSegments[1]) ? $responseSegments[1] :
|
||||
null;
|
||||
}
|
||||
|
||||
$responseHeaders = $this->parseRawHeaders($responseHeaders);
|
||||
|
||||
return array($responseHeaders, $responseBody);
|
||||
}
|
||||
}
|
351
wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Http/MediaFileUpload.php
vendored
Normal file
351
wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Http/MediaFileUpload.php
vendored
Normal file
@ -0,0 +1,351 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2012 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
use GuzzleHttp\Psr7;
|
||||
use GuzzleHttp\Psr7\Request;
|
||||
use GuzzleHttp\Psr7\Uri;
|
||||
use Psr\Http\Message\RequestInterface;
|
||||
|
||||
/**
|
||||
* Manage large file uploads, which may be media but can be any type
|
||||
* of sizable data.
|
||||
*/
|
||||
class Google_Http_MediaFileUpload
|
||||
{
|
||||
const UPLOAD_MEDIA_TYPE = 'media';
|
||||
const UPLOAD_MULTIPART_TYPE = 'multipart';
|
||||
const UPLOAD_RESUMABLE_TYPE = 'resumable';
|
||||
|
||||
/** @var string $mimeType */
|
||||
private $mimeType;
|
||||
|
||||
/** @var string $data */
|
||||
private $data;
|
||||
|
||||
/** @var bool $resumable */
|
||||
private $resumable;
|
||||
|
||||
/** @var int $chunkSize */
|
||||
private $chunkSize;
|
||||
|
||||
/** @var int $size */
|
||||
private $size;
|
||||
|
||||
/** @var string $resumeUri */
|
||||
private $resumeUri;
|
||||
|
||||
/** @var int $progress */
|
||||
private $progress;
|
||||
|
||||
/** @var Google_Client */
|
||||
private $client;
|
||||
|
||||
/** @var Psr\Http\Message\RequestInterface */
|
||||
private $request;
|
||||
|
||||
/** @var string */
|
||||
private $boundary;
|
||||
|
||||
/**
|
||||
* Result code from last HTTP call
|
||||
* @var int
|
||||
*/
|
||||
private $httpResultCode;
|
||||
|
||||
/**
|
||||
* @param $mimeType string
|
||||
* @param $data string The bytes you want to upload.
|
||||
* @param $resumable bool
|
||||
* @param bool $chunkSize File will be uploaded in chunks of this many bytes.
|
||||
* only used if resumable=True
|
||||
*/
|
||||
public function __construct(
|
||||
Google_Client $client,
|
||||
RequestInterface $request,
|
||||
$mimeType,
|
||||
$data,
|
||||
$resumable = false,
|
||||
$chunkSize = false
|
||||
) {
|
||||
$this->client = $client;
|
||||
$this->request = $request;
|
||||
$this->mimeType = $mimeType;
|
||||
$this->data = $data;
|
||||
$this->resumable = $resumable;
|
||||
$this->chunkSize = $chunkSize;
|
||||
$this->progress = 0;
|
||||
|
||||
$this->process();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the size of the file that is being uploaded.
|
||||
* @param $size - int file size in bytes
|
||||
*/
|
||||
public function setFileSize($size)
|
||||
{
|
||||
$this->size = $size;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the progress on the upload
|
||||
* @return int progress in bytes uploaded.
|
||||
*/
|
||||
public function getProgress()
|
||||
{
|
||||
return $this->progress;
|
||||
}
|
||||
|
||||
/**
|
||||
* Send the next part of the file to upload.
|
||||
* @param [$chunk] the next set of bytes to send. If false will used $data passed
|
||||
* at construct time.
|
||||
*/
|
||||
public function nextChunk($chunk = false)
|
||||
{
|
||||
$resumeUri = $this->getResumeUri();
|
||||
|
||||
if (false == $chunk) {
|
||||
$chunk = substr($this->data, $this->progress, $this->chunkSize);
|
||||
}
|
||||
|
||||
$lastBytePos = $this->progress + strlen($chunk) - 1;
|
||||
$headers = array(
|
||||
'content-range' => "bytes $this->progress-$lastBytePos/$this->size",
|
||||
'content-length' => strlen($chunk),
|
||||
'expect' => '',
|
||||
);
|
||||
|
||||
$request = new Request(
|
||||
'PUT',
|
||||
$resumeUri,
|
||||
$headers,
|
||||
Psr7\stream_for($chunk)
|
||||
);
|
||||
|
||||
return $this->makePutRequest($request);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the HTTP result code from the last call made.
|
||||
* @return int code
|
||||
*/
|
||||
public function getHttpResultCode()
|
||||
{
|
||||
return $this->httpResultCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends a PUT-Request to google drive and parses the response,
|
||||
* setting the appropiate variables from the response()
|
||||
*
|
||||
* @param Google_Http_Request $httpRequest the Reuqest which will be send
|
||||
*
|
||||
* @return false|mixed false when the upload is unfinished or the decoded http response
|
||||
*
|
||||
*/
|
||||
private function makePutRequest(RequestInterface $request)
|
||||
{
|
||||
$response = $this->client->execute($request);
|
||||
$this->httpResultCode = $response->getStatusCode();
|
||||
|
||||
if (308 == $this->httpResultCode) {
|
||||
// Track the amount uploaded.
|
||||
$range = $response->getHeaderLine('range');
|
||||
if ($range) {
|
||||
$range_array = explode('-', $range);
|
||||
$this->progress = $range_array[1] + 1;
|
||||
}
|
||||
|
||||
// Allow for changing upload URLs.
|
||||
$location = $response->getHeaderLine('location');
|
||||
if ($location) {
|
||||
$this->resumeUri = $location;
|
||||
}
|
||||
|
||||
// No problems, but upload not complete.
|
||||
return false;
|
||||
}
|
||||
|
||||
return Google_Http_REST::decodeHttpResponse($response, $this->request);
|
||||
}
|
||||
|
||||
/**
|
||||
* Resume a previously unfinished upload
|
||||
* @param $resumeUri the resume-URI of the unfinished, resumable upload.
|
||||
*/
|
||||
public function resume($resumeUri)
|
||||
{
|
||||
$this->resumeUri = $resumeUri;
|
||||
$headers = array(
|
||||
'content-range' => "bytes */$this->size",
|
||||
'content-length' => 0,
|
||||
);
|
||||
$httpRequest = new Request(
|
||||
'PUT',
|
||||
$this->resumeUri,
|
||||
$headers
|
||||
);
|
||||
|
||||
return $this->makePutRequest($httpRequest);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Psr\Http\Message\RequestInterface $request
|
||||
* @visible for testing
|
||||
*/
|
||||
private function process()
|
||||
{
|
||||
$this->transformToUploadUrl();
|
||||
$request = $this->request;
|
||||
|
||||
$postBody = '';
|
||||
$contentType = false;
|
||||
|
||||
$meta = (string) $request->getBody();
|
||||
$meta = is_string($meta) ? json_decode($meta, true) : $meta;
|
||||
|
||||
$uploadType = $this->getUploadType($meta);
|
||||
$request = $request->withUri(
|
||||
Uri::withQueryValue($request->getUri(), 'uploadType', $uploadType)
|
||||
);
|
||||
|
||||
$mimeType = $this->mimeType ?: $request->getHeaderLine('content-type');
|
||||
|
||||
if (self::UPLOAD_RESUMABLE_TYPE == $uploadType) {
|
||||
$contentType = $mimeType;
|
||||
$postBody = is_string($meta) ? $meta : json_encode($meta);
|
||||
} else if (self::UPLOAD_MEDIA_TYPE == $uploadType) {
|
||||
$contentType = $mimeType;
|
||||
$postBody = $this->data;
|
||||
} else if (self::UPLOAD_MULTIPART_TYPE == $uploadType) {
|
||||
// This is a multipart/related upload.
|
||||
$boundary = $this->boundary ?: mt_rand();
|
||||
$boundary = str_replace('"', '', $boundary);
|
||||
$contentType = 'multipart/related; boundary=' . $boundary;
|
||||
$related = "--$boundary\r\n";
|
||||
$related .= "Content-Type: application/json; charset=UTF-8\r\n";
|
||||
$related .= "\r\n" . json_encode($meta) . "\r\n";
|
||||
$related .= "--$boundary\r\n";
|
||||
$related .= "Content-Type: $mimeType\r\n";
|
||||
$related .= "Content-Transfer-Encoding: base64\r\n";
|
||||
$related .= "\r\n" . base64_encode($this->data) . "\r\n";
|
||||
$related .= "--$boundary--";
|
||||
$postBody = $related;
|
||||
}
|
||||
|
||||
$request = $request->withBody(Psr7\stream_for($postBody));
|
||||
|
||||
if (isset($contentType) && $contentType) {
|
||||
$request = $request->withHeader('content-type', $contentType);
|
||||
}
|
||||
|
||||
return $this->request = $request;
|
||||
}
|
||||
|
||||
/**
|
||||
* Valid upload types:
|
||||
* - resumable (UPLOAD_RESUMABLE_TYPE)
|
||||
* - media (UPLOAD_MEDIA_TYPE)
|
||||
* - multipart (UPLOAD_MULTIPART_TYPE)
|
||||
* @param $meta
|
||||
* @return string
|
||||
* @visible for testing
|
||||
*/
|
||||
public function getUploadType($meta)
|
||||
{
|
||||
if ($this->resumable) {
|
||||
return self::UPLOAD_RESUMABLE_TYPE;
|
||||
}
|
||||
|
||||
if (false == $meta && $this->data) {
|
||||
return self::UPLOAD_MEDIA_TYPE;
|
||||
}
|
||||
|
||||
return self::UPLOAD_MULTIPART_TYPE;
|
||||
}
|
||||
|
||||
public function getResumeUri()
|
||||
{
|
||||
if (null === $this->resumeUri) {
|
||||
$this->resumeUri = $this->fetchResumeUri();
|
||||
}
|
||||
|
||||
return $this->resumeUri;
|
||||
}
|
||||
|
||||
private function fetchResumeUri()
|
||||
{
|
||||
$body = $this->request->getBody();
|
||||
if ($body) {
|
||||
$headers = array(
|
||||
'content-type' => 'application/json; charset=UTF-8',
|
||||
'content-length' => $body->getSize(),
|
||||
'x-upload-content-type' => $this->mimeType,
|
||||
'x-upload-content-length' => $this->size,
|
||||
'expect' => '',
|
||||
);
|
||||
foreach ($headers as $key => $value) {
|
||||
$this->request = $this->request->withHeader($key, $value);
|
||||
}
|
||||
}
|
||||
|
||||
$response = $this->client->execute($this->request, false);
|
||||
$location = $response->getHeaderLine('location');
|
||||
$code = $response->getStatusCode();
|
||||
|
||||
if (200 == $code && true == $location) {
|
||||
return $location;
|
||||
}
|
||||
|
||||
$message = $code;
|
||||
$body = json_decode((string) $this->request->getBody(), true);
|
||||
if (isset($body['error']['errors'])) {
|
||||
$message .= ': ';
|
||||
foreach ($body['error']['errors'] as $error) {
|
||||
$message .= "{$error['domain']}, {$error['message']};";
|
||||
}
|
||||
$message = rtrim($message, ';');
|
||||
}
|
||||
|
||||
$error = "Failed to start the resumable upload (HTTP {$message})";
|
||||
$this->client->getLogger()->error($error);
|
||||
|
||||
throw new Google_Exception($error);
|
||||
}
|
||||
|
||||
private function transformToUploadUrl()
|
||||
{
|
||||
$parts = parse_url((string) $this->request->getUri());
|
||||
if (!isset($parts['path'])) {
|
||||
$parts['path'] = '';
|
||||
}
|
||||
$parts['path'] = '/upload' . $parts['path'];
|
||||
$uri = Uri::fromParts($parts);
|
||||
$this->request = $this->request->withUri($uri);
|
||||
}
|
||||
|
||||
public function setChunkSize($chunkSize)
|
||||
{
|
||||
$this->chunkSize = $chunkSize;
|
||||
}
|
||||
|
||||
public function getRequest()
|
||||
{
|
||||
return $this->request;
|
||||
}
|
||||
}
|
182
wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Http/REST.php
vendored
Normal file
182
wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Http/REST.php
vendored
Normal file
@ -0,0 +1,182 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2010 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
use Google\Auth\HttpHandler\HttpHandlerFactory;
|
||||
use GuzzleHttp\ClientInterface;
|
||||
use GuzzleHttp\Exception\RequestException;
|
||||
use GuzzleHttp\Psr7\Response;
|
||||
use Psr\Http\Message\RequestInterface;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
|
||||
/**
|
||||
* This class implements the RESTful transport of apiServiceRequest()'s
|
||||
*/
|
||||
class Google_Http_REST
|
||||
{
|
||||
/**
|
||||
* Executes a Psr\Http\Message\RequestInterface and (if applicable) automatically retries
|
||||
* when errors occur.
|
||||
*
|
||||
* @param Google_Client $client
|
||||
* @param Psr\Http\Message\RequestInterface $req
|
||||
* @return array decoded result
|
||||
* @throws Google_Service_Exception on server side error (ie: not authenticated,
|
||||
* invalid or malformed post body, invalid url)
|
||||
*/
|
||||
public static function execute(
|
||||
ClientInterface $client,
|
||||
RequestInterface $request,
|
||||
$expectedClass = null,
|
||||
$config = array(),
|
||||
$retryMap = null
|
||||
) {
|
||||
$runner = new Google_Task_Runner(
|
||||
$config,
|
||||
sprintf('%s %s', $request->getMethod(), (string) $request->getUri()),
|
||||
array(get_class(), 'doExecute'),
|
||||
array($client, $request, $expectedClass)
|
||||
);
|
||||
|
||||
if (null !== $retryMap) {
|
||||
$runner->setRetryMap($retryMap);
|
||||
}
|
||||
|
||||
return $runner->run();
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes a Psr\Http\Message\RequestInterface
|
||||
*
|
||||
* @param Google_Client $client
|
||||
* @param Psr\Http\Message\RequestInterface $request
|
||||
* @return array decoded result
|
||||
* @throws Google_Service_Exception on server side error (ie: not authenticated,
|
||||
* invalid or malformed post body, invalid url)
|
||||
*/
|
||||
public static function doExecute(ClientInterface $client, RequestInterface $request, $expectedClass = null)
|
||||
{
|
||||
try {
|
||||
$httpHandler = HttpHandlerFactory::build($client);
|
||||
$response = $httpHandler($request);
|
||||
} catch (RequestException $e) {
|
||||
// if Guzzle throws an exception, catch it and handle the response
|
||||
if (!$e->hasResponse()) {
|
||||
throw $e;
|
||||
}
|
||||
|
||||
$response = $e->getResponse();
|
||||
// specific checking for Guzzle 5: convert to PSR7 response
|
||||
if ($response instanceof \GuzzleHttp\Message\ResponseInterface) {
|
||||
$response = new Response(
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders() ?: [],
|
||||
$response->getBody(),
|
||||
$response->getProtocolVersion(),
|
||||
$response->getReasonPhrase()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return self::decodeHttpResponse($response, $request, $expectedClass);
|
||||
}
|
||||
|
||||
/**
|
||||
* Decode an HTTP Response.
|
||||
* @static
|
||||
* @throws Google_Service_Exception
|
||||
* @param Psr\Http\Message\RequestInterface $response The http response to be decoded.
|
||||
* @param Psr\Http\Message\ResponseInterface $response
|
||||
* @return mixed|null
|
||||
*/
|
||||
public static function decodeHttpResponse(
|
||||
ResponseInterface $response,
|
||||
RequestInterface $request = null,
|
||||
$expectedClass = null
|
||||
) {
|
||||
$code = $response->getStatusCode();
|
||||
|
||||
// retry strategy
|
||||
if (intVal($code) >= 400) {
|
||||
// if we errored out, it should be safe to grab the response body
|
||||
$body = (string) $response->getBody();
|
||||
|
||||
// Check if we received errors, and add those to the Exception for convenience
|
||||
throw new Google_Service_Exception($body, $code, null, self::getResponseErrors($body));
|
||||
}
|
||||
|
||||
// Ensure we only pull the entire body into memory if the request is not
|
||||
// of media type
|
||||
$body = self::decodeBody($response, $request);
|
||||
|
||||
if ($expectedClass = self::determineExpectedClass($expectedClass, $request)) {
|
||||
$json = json_decode($body, true);
|
||||
|
||||
return new $expectedClass($json);
|
||||
}
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
private static function decodeBody(ResponseInterface $response, RequestInterface $request = null)
|
||||
{
|
||||
if (self::isAltMedia($request)) {
|
||||
// don't decode the body, it's probably a really long string
|
||||
return '';
|
||||
}
|
||||
|
||||
return (string) $response->getBody();
|
||||
}
|
||||
|
||||
private static function determineExpectedClass($expectedClass, RequestInterface $request = null)
|
||||
{
|
||||
// "false" is used to explicitly prevent an expected class from being returned
|
||||
if (false === $expectedClass) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// if we don't have a request, we just use what's passed in
|
||||
if (null === $request) {
|
||||
return $expectedClass;
|
||||
}
|
||||
|
||||
// return what we have in the request header if one was not supplied
|
||||
return $expectedClass ?: $request->getHeaderLine('X-Php-Expected-Class');
|
||||
}
|
||||
|
||||
private static function getResponseErrors($body)
|
||||
{
|
||||
$json = json_decode($body, true);
|
||||
|
||||
if (isset($json['error']['errors'])) {
|
||||
return $json['error']['errors'];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private static function isAltMedia(RequestInterface $request = null)
|
||||
{
|
||||
if ($request && $qs = $request->getUri()->getQuery()) {
|
||||
parse_str($qs, $query);
|
||||
if (isset($query['alt']) && $query['alt'] == 'media') {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
317
wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Model.php
vendored
Normal file
317
wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Model.php
vendored
Normal file
@ -0,0 +1,317 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2011 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* This class defines attributes, valid values, and usage which is generated
|
||||
* from a given json schema.
|
||||
* http://tools.ietf.org/html/draft-zyp-json-schema-03#section-5
|
||||
*
|
||||
*/
|
||||
class Google_Model implements ArrayAccess
|
||||
{
|
||||
/**
|
||||
* If you need to specify a NULL JSON value, use Google_Model::NULL_VALUE
|
||||
* instead - it will be replaced when converting to JSON with a real null.
|
||||
*/
|
||||
const NULL_VALUE = "{}gapi-php-null";
|
||||
protected $internal_gapi_mappings = array();
|
||||
protected $modelData = array();
|
||||
protected $processed = array();
|
||||
|
||||
/**
|
||||
* Polymorphic - accepts a variable number of arguments dependent
|
||||
* on the type of the model subclass.
|
||||
*/
|
||||
final public function __construct()
|
||||
{
|
||||
if (func_num_args() == 1 && is_array(func_get_arg(0))) {
|
||||
// Initialize the model with the array's contents.
|
||||
$array = func_get_arg(0);
|
||||
$this->mapTypes($array);
|
||||
}
|
||||
$this->gapiInit();
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter that handles passthrough access to the data array, and lazy object creation.
|
||||
* @param string $key Property name.
|
||||
* @return mixed The value if any, or null.
|
||||
*/
|
||||
public function __get($key)
|
||||
{
|
||||
$keyType = $this->keyType($key);
|
||||
$keyDataType = $this->dataType($key);
|
||||
if ($keyType && !isset($this->processed[$key])) {
|
||||
if (isset($this->modelData[$key])) {
|
||||
$val = $this->modelData[$key];
|
||||
} elseif ($keyDataType == 'array' || $keyDataType == 'map') {
|
||||
$val = array();
|
||||
} else {
|
||||
$val = null;
|
||||
}
|
||||
|
||||
if ($this->isAssociativeArray($val)) {
|
||||
if ($keyDataType && 'map' == $keyDataType) {
|
||||
foreach ($val as $arrayKey => $arrayItem) {
|
||||
$this->modelData[$key][$arrayKey] =
|
||||
new $keyType($arrayItem);
|
||||
}
|
||||
} else {
|
||||
$this->modelData[$key] = new $keyType($val);
|
||||
}
|
||||
} else if (is_array($val)) {
|
||||
$arrayObject = array();
|
||||
foreach ($val as $arrayIndex => $arrayItem) {
|
||||
$arrayObject[$arrayIndex] = new $keyType($arrayItem);
|
||||
}
|
||||
$this->modelData[$key] = $arrayObject;
|
||||
}
|
||||
$this->processed[$key] = true;
|
||||
}
|
||||
|
||||
return isset($this->modelData[$key]) ? $this->modelData[$key] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize this object's properties from an array.
|
||||
*
|
||||
* @param array $array Used to seed this object's properties.
|
||||
* @return void
|
||||
*/
|
||||
protected function mapTypes($array)
|
||||
{
|
||||
// Hard initialise simple types, lazy load more complex ones.
|
||||
foreach ($array as $key => $val) {
|
||||
if ($keyType = $this->keyType($key)) {
|
||||
$dataType = $this->dataType($key);
|
||||
if ($dataType == 'array' || $dataType == 'map') {
|
||||
$this->$key = array();
|
||||
foreach ($val as $itemKey => $itemVal) {
|
||||
if ($itemVal instanceof $keyType) {
|
||||
$this->{$key}[$itemKey] = $itemVal;
|
||||
} else {
|
||||
$this->{$key}[$itemKey] = new $keyType($itemVal);
|
||||
}
|
||||
}
|
||||
} elseif ($val instanceof $keyType) {
|
||||
$this->$key = $val;
|
||||
} else {
|
||||
$this->$key = new $keyType($val);
|
||||
}
|
||||
unset($array[$key]);
|
||||
} elseif (property_exists($this, $key)) {
|
||||
$this->$key = $val;
|
||||
unset($array[$key]);
|
||||
} elseif (property_exists($this, $camelKey = $this->camelCase($key))) {
|
||||
// This checks if property exists as camelCase, leaving it in array as snake_case
|
||||
// in case of backwards compatibility issues.
|
||||
$this->$camelKey = $val;
|
||||
}
|
||||
}
|
||||
$this->modelData = $array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Blank initialiser to be used in subclasses to do post-construction initialisation - this
|
||||
* avoids the need for subclasses to have to implement the variadics handling in their
|
||||
* constructors.
|
||||
*/
|
||||
protected function gapiInit()
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a simplified object suitable for straightforward
|
||||
* conversion to JSON. This is relatively expensive
|
||||
* due to the usage of reflection, but shouldn't be called
|
||||
* a whole lot, and is the most straightforward way to filter.
|
||||
*/
|
||||
public function toSimpleObject()
|
||||
{
|
||||
$object = new stdClass();
|
||||
|
||||
// Process all other data.
|
||||
foreach ($this->modelData as $key => $val) {
|
||||
$result = $this->getSimpleValue($val);
|
||||
if ($result !== null) {
|
||||
$object->$key = $this->nullPlaceholderCheck($result);
|
||||
}
|
||||
}
|
||||
|
||||
// Process all public properties.
|
||||
$reflect = new ReflectionObject($this);
|
||||
$props = $reflect->getProperties(ReflectionProperty::IS_PUBLIC);
|
||||
foreach ($props as $member) {
|
||||
$name = $member->getName();
|
||||
$result = $this->getSimpleValue($this->$name);
|
||||
if ($result !== null) {
|
||||
$name = $this->getMappedName($name);
|
||||
$object->$name = $this->nullPlaceholderCheck($result);
|
||||
}
|
||||
}
|
||||
|
||||
return $object;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle different types of values, primarily
|
||||
* other objects and map and array data types.
|
||||
*/
|
||||
private function getSimpleValue($value)
|
||||
{
|
||||
if ($value instanceof Google_Model) {
|
||||
return $value->toSimpleObject();
|
||||
} else if (is_array($value)) {
|
||||
$return = array();
|
||||
foreach ($value as $key => $a_value) {
|
||||
$a_value = $this->getSimpleValue($a_value);
|
||||
if ($a_value !== null) {
|
||||
$key = $this->getMappedName($key);
|
||||
$return[$key] = $this->nullPlaceholderCheck($a_value);
|
||||
}
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether the value is the null placeholder and return true null.
|
||||
*/
|
||||
private function nullPlaceholderCheck($value)
|
||||
{
|
||||
if ($value === self::NULL_VALUE) {
|
||||
return null;
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* If there is an internal name mapping, use that.
|
||||
*/
|
||||
private function getMappedName($key)
|
||||
{
|
||||
if (isset($this->internal_gapi_mappings, $this->internal_gapi_mappings[$key])) {
|
||||
$key = $this->internal_gapi_mappings[$key];
|
||||
}
|
||||
return $key;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true only if the array is associative.
|
||||
* @param array $array
|
||||
* @return bool True if the array is associative.
|
||||
*/
|
||||
protected function isAssociativeArray($array)
|
||||
{
|
||||
if (!is_array($array)) {
|
||||
return false;
|
||||
}
|
||||
$keys = array_keys($array);
|
||||
foreach ($keys as $key) {
|
||||
if (is_string($key)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify if $obj is an array.
|
||||
* @throws Google_Exception Thrown if $obj isn't an array.
|
||||
* @param array $obj Items that should be validated.
|
||||
* @param string $method Method expecting an array as an argument.
|
||||
*/
|
||||
public function assertIsArray($obj, $method)
|
||||
{
|
||||
if ($obj && !is_array($obj)) {
|
||||
throw new Google_Exception(
|
||||
"Incorrect parameter type passed to $method(). Expected an array."
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public function offsetExists($offset)
|
||||
{
|
||||
return isset($this->$offset) || isset($this->modelData[$offset]);
|
||||
}
|
||||
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return isset($this->$offset) ?
|
||||
$this->$offset :
|
||||
$this->__get($offset);
|
||||
}
|
||||
|
||||
public function offsetSet($offset, $value)
|
||||
{
|
||||
if (property_exists($this, $offset)) {
|
||||
$this->$offset = $value;
|
||||
} else {
|
||||
$this->modelData[$offset] = $value;
|
||||
$this->processed[$offset] = true;
|
||||
}
|
||||
}
|
||||
|
||||
public function offsetUnset($offset)
|
||||
{
|
||||
unset($this->modelData[$offset]);
|
||||
}
|
||||
|
||||
protected function keyType($key)
|
||||
{
|
||||
$keyType = $key . "Type";
|
||||
|
||||
// ensure keyType is a valid class
|
||||
if (property_exists($this, $keyType) && class_exists($this->$keyType)) {
|
||||
return $this->$keyType;
|
||||
}
|
||||
}
|
||||
|
||||
protected function dataType($key)
|
||||
{
|
||||
$dataType = $key . "DataType";
|
||||
|
||||
if (property_exists($this, $dataType)) {
|
||||
return $this->$dataType;
|
||||
}
|
||||
}
|
||||
|
||||
public function __isset($key)
|
||||
{
|
||||
return isset($this->modelData[$key]);
|
||||
}
|
||||
|
||||
public function __unset($key)
|
||||
{
|
||||
unset($this->modelData[$key]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a string to camelCase
|
||||
* @param string $value
|
||||
* @return string
|
||||
*/
|
||||
private function camelCase($value)
|
||||
{
|
||||
$value = ucwords(str_replace(array('-', '_'), ' ', $value));
|
||||
$value = str_replace(' ', '', $value);
|
||||
$value[0] = strtolower($value[0]);
|
||||
return $value;
|
||||
}
|
||||
}
|
56
wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Service.php
vendored
Normal file
56
wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Service.php
vendored
Normal file
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2010 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
class Google_Service
|
||||
{
|
||||
public $batchPath;
|
||||
public $rootUrl;
|
||||
public $version;
|
||||
public $servicePath;
|
||||
public $availableScopes;
|
||||
public $resource;
|
||||
private $client;
|
||||
|
||||
public function __construct(Google_Client $client)
|
||||
{
|
||||
$this->client = $client;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the associated Google_Client class.
|
||||
* @return Google_Client
|
||||
*/
|
||||
public function getClient()
|
||||
{
|
||||
return $this->client;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new HTTP Batch handler for this service
|
||||
*
|
||||
* @return Google_Http_Batch
|
||||
*/
|
||||
public function createBatch()
|
||||
{
|
||||
return new Google_Http_Batch(
|
||||
$this->client,
|
||||
false,
|
||||
$this->rootUrl,
|
||||
$this->batchPath
|
||||
);
|
||||
}
|
||||
}
|
68
wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Service/Exception.php
vendored
Normal file
68
wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Service/Exception.php
vendored
Normal file
@ -0,0 +1,68 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
class Google_Service_Exception extends Google_Exception
|
||||
{
|
||||
/**
|
||||
* Optional list of errors returned in a JSON body of an HTTP error response.
|
||||
*/
|
||||
protected $errors = array();
|
||||
|
||||
/**
|
||||
* Override default constructor to add the ability to set $errors and a retry
|
||||
* map.
|
||||
*
|
||||
* @param string $message
|
||||
* @param int $code
|
||||
* @param Exception|null $previous
|
||||
* @param [{string, string}] errors List of errors returned in an HTTP
|
||||
* response. Defaults to [].
|
||||
* @param array|null $retryMap Map of errors with retry counts.
|
||||
*/
|
||||
public function __construct(
|
||||
$message,
|
||||
$code = 0,
|
||||
Exception $previous = null,
|
||||
$errors = array()
|
||||
) {
|
||||
if (version_compare(PHP_VERSION, '5.3.0') >= 0) {
|
||||
parent::__construct($message, $code, $previous);
|
||||
} else {
|
||||
parent::__construct($message, $code);
|
||||
}
|
||||
|
||||
$this->errors = $errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* An example of the possible errors returned.
|
||||
*
|
||||
* {
|
||||
* "domain": "global",
|
||||
* "reason": "authError",
|
||||
* "message": "Invalid Credentials",
|
||||
* "locationType": "header",
|
||||
* "location": "Authorization",
|
||||
* }
|
||||
*
|
||||
* @return [{string, string}] List of errors return in an HTTP response or [].
|
||||
*/
|
||||
public function getErrors()
|
||||
{
|
||||
return $this->errors;
|
||||
}
|
||||
}
|
302
wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Service/Resource.php
vendored
Normal file
302
wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Service/Resource.php
vendored
Normal file
@ -0,0 +1,302 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2010 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
use GuzzleHttp\Psr7\Request;
|
||||
|
||||
/**
|
||||
* Implements the actual methods/resources of the discovered Google API using magic function
|
||||
* calling overloading (__call()), which on call will see if the method name (plus.activities.list)
|
||||
* is available in this service, and if so construct an apiHttpRequest representing it.
|
||||
*
|
||||
*/
|
||||
class Google_Service_Resource
|
||||
{
|
||||
// Valid query parameters that work, but don't appear in discovery.
|
||||
private $stackParameters = array(
|
||||
'alt' => array('type' => 'string', 'location' => 'query'),
|
||||
'fields' => array('type' => 'string', 'location' => 'query'),
|
||||
'trace' => array('type' => 'string', 'location' => 'query'),
|
||||
'userIp' => array('type' => 'string', 'location' => 'query'),
|
||||
'quotaUser' => array('type' => 'string', 'location' => 'query'),
|
||||
'data' => array('type' => 'string', 'location' => 'body'),
|
||||
'mimeType' => array('type' => 'string', 'location' => 'header'),
|
||||
'uploadType' => array('type' => 'string', 'location' => 'query'),
|
||||
'mediaUpload' => array('type' => 'complex', 'location' => 'query'),
|
||||
'prettyPrint' => array('type' => 'string', 'location' => 'query'),
|
||||
);
|
||||
|
||||
/** @var string $rootUrl */
|
||||
private $rootUrl;
|
||||
|
||||
/** @var Google_Client $client */
|
||||
private $client;
|
||||
|
||||
/** @var string $serviceName */
|
||||
private $serviceName;
|
||||
|
||||
/** @var string $servicePath */
|
||||
private $servicePath;
|
||||
|
||||
/** @var string $resourceName */
|
||||
private $resourceName;
|
||||
|
||||
/** @var array $methods */
|
||||
private $methods;
|
||||
|
||||
public function __construct($service, $serviceName, $resourceName, $resource)
|
||||
{
|
||||
$this->rootUrl = $service->rootUrl;
|
||||
$this->client = $service->getClient();
|
||||
$this->servicePath = $service->servicePath;
|
||||
$this->serviceName = $serviceName;
|
||||
$this->resourceName = $resourceName;
|
||||
$this->methods = is_array($resource) && isset($resource['methods']) ?
|
||||
$resource['methods'] :
|
||||
array($resourceName => $resource);
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO: This function needs simplifying.
|
||||
* @param $name
|
||||
* @param $arguments
|
||||
* @param $expectedClass - optional, the expected class name
|
||||
* @return Google_Http_Request|expectedClass
|
||||
* @throws Google_Exception
|
||||
*/
|
||||
public function call($name, $arguments, $expectedClass = null)
|
||||
{
|
||||
if (! isset($this->methods[$name])) {
|
||||
$this->client->getLogger()->error(
|
||||
'Service method unknown',
|
||||
array(
|
||||
'service' => $this->serviceName,
|
||||
'resource' => $this->resourceName,
|
||||
'method' => $name
|
||||
)
|
||||
);
|
||||
|
||||
throw new Google_Exception(
|
||||
"Unknown function: " .
|
||||
"{$this->serviceName}->{$this->resourceName}->{$name}()"
|
||||
);
|
||||
}
|
||||
$method = $this->methods[$name];
|
||||
$parameters = $arguments[0];
|
||||
|
||||
// postBody is a special case since it's not defined in the discovery
|
||||
// document as parameter, but we abuse the param entry for storing it.
|
||||
$postBody = null;
|
||||
if (isset($parameters['postBody'])) {
|
||||
if ($parameters['postBody'] instanceof Google_Model) {
|
||||
// In the cases the post body is an existing object, we want
|
||||
// to use the smart method to create a simple object for
|
||||
// for JSONification.
|
||||
$parameters['postBody'] = $parameters['postBody']->toSimpleObject();
|
||||
} else if (is_object($parameters['postBody'])) {
|
||||
// If the post body is another kind of object, we will try and
|
||||
// wrangle it into a sensible format.
|
||||
$parameters['postBody'] =
|
||||
$this->convertToArrayAndStripNulls($parameters['postBody']);
|
||||
}
|
||||
$postBody = (array) $parameters['postBody'];
|
||||
unset($parameters['postBody']);
|
||||
}
|
||||
|
||||
// TODO: optParams here probably should have been
|
||||
// handled already - this may well be redundant code.
|
||||
if (isset($parameters['optParams'])) {
|
||||
$optParams = $parameters['optParams'];
|
||||
unset($parameters['optParams']);
|
||||
$parameters = array_merge($parameters, $optParams);
|
||||
}
|
||||
|
||||
if (!isset($method['parameters'])) {
|
||||
$method['parameters'] = array();
|
||||
}
|
||||
|
||||
$method['parameters'] = array_merge(
|
||||
$this->stackParameters,
|
||||
$method['parameters']
|
||||
);
|
||||
|
||||
foreach ($parameters as $key => $val) {
|
||||
if ($key != 'postBody' && ! isset($method['parameters'][$key])) {
|
||||
$this->client->getLogger()->error(
|
||||
'Service parameter unknown',
|
||||
array(
|
||||
'service' => $this->serviceName,
|
||||
'resource' => $this->resourceName,
|
||||
'method' => $name,
|
||||
'parameter' => $key
|
||||
)
|
||||
);
|
||||
throw new Google_Exception("($name) unknown parameter: '$key'");
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($method['parameters'] as $paramName => $paramSpec) {
|
||||
if (isset($paramSpec['required']) &&
|
||||
$paramSpec['required'] &&
|
||||
! isset($parameters[$paramName])
|
||||
) {
|
||||
$this->client->getLogger()->error(
|
||||
'Service parameter missing',
|
||||
array(
|
||||
'service' => $this->serviceName,
|
||||
'resource' => $this->resourceName,
|
||||
'method' => $name,
|
||||
'parameter' => $paramName
|
||||
)
|
||||
);
|
||||
throw new Google_Exception("($name) missing required param: '$paramName'");
|
||||
}
|
||||
if (isset($parameters[$paramName])) {
|
||||
$value = $parameters[$paramName];
|
||||
$parameters[$paramName] = $paramSpec;
|
||||
$parameters[$paramName]['value'] = $value;
|
||||
unset($parameters[$paramName]['required']);
|
||||
} else {
|
||||
// Ensure we don't pass nulls.
|
||||
unset($parameters[$paramName]);
|
||||
}
|
||||
}
|
||||
|
||||
$this->client->getLogger()->info(
|
||||
'Service Call',
|
||||
array(
|
||||
'service' => $this->serviceName,
|
||||
'resource' => $this->resourceName,
|
||||
'method' => $name,
|
||||
'arguments' => $parameters,
|
||||
)
|
||||
);
|
||||
|
||||
// build the service uri
|
||||
$url = $this->createRequestUri(
|
||||
$method['path'],
|
||||
$parameters
|
||||
);
|
||||
|
||||
// NOTE: because we're creating the request by hand,
|
||||
// and because the service has a rootUrl property
|
||||
// the "base_uri" of the Http Client is not accounted for
|
||||
$request = new Request(
|
||||
$method['httpMethod'],
|
||||
$url,
|
||||
['content-type' => 'application/json'],
|
||||
$postBody ? json_encode($postBody) : ''
|
||||
);
|
||||
|
||||
// support uploads
|
||||
if (isset($parameters['data'])) {
|
||||
$mimeType = isset($parameters['mimeType'])
|
||||
? $parameters['mimeType']['value']
|
||||
: 'application/octet-stream';
|
||||
$data = $parameters['data']['value'];
|
||||
$upload = new Google_Http_MediaFileUpload($this->client, $request, $mimeType, $data);
|
||||
|
||||
// pull down the modified request
|
||||
$request = $upload->getRequest();
|
||||
}
|
||||
|
||||
// if this is a media type, we will return the raw response
|
||||
// rather than using an expected class
|
||||
if (isset($parameters['alt']) && $parameters['alt']['value'] == 'media') {
|
||||
$expectedClass = null;
|
||||
}
|
||||
|
||||
// if the client is marked for deferring, rather than
|
||||
// execute the request, return the response
|
||||
if ($this->client->shouldDefer()) {
|
||||
// @TODO find a better way to do this
|
||||
$request = $request
|
||||
->withHeader('X-Php-Expected-Class', $expectedClass);
|
||||
|
||||
return $request;
|
||||
}
|
||||
|
||||
return $this->client->execute($request, $expectedClass);
|
||||
}
|
||||
|
||||
protected function convertToArrayAndStripNulls($o)
|
||||
{
|
||||
$o = (array) $o;
|
||||
foreach ($o as $k => $v) {
|
||||
if ($v === null) {
|
||||
unset($o[$k]);
|
||||
} elseif (is_object($v) || is_array($v)) {
|
||||
$o[$k] = $this->convertToArrayAndStripNulls($o[$k]);
|
||||
}
|
||||
}
|
||||
return $o;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse/expand request parameters and create a fully qualified
|
||||
* request uri.
|
||||
* @static
|
||||
* @param string $restPath
|
||||
* @param array $params
|
||||
* @return string $requestUrl
|
||||
*/
|
||||
public function createRequestUri($restPath, $params)
|
||||
{
|
||||
// Override the default servicePath address if the $restPath use a /
|
||||
if ('/' == substr($restPath, 0, 1)) {
|
||||
$requestUrl = substr($restPath, 1);
|
||||
} else {
|
||||
$requestUrl = $this->servicePath . $restPath;
|
||||
}
|
||||
|
||||
// code for leading slash
|
||||
if ($this->rootUrl) {
|
||||
if ('/' !== substr($this->rootUrl, -1) && '/' !== substr($requestUrl, 0, 1)) {
|
||||
$requestUrl = '/' . $requestUrl;
|
||||
}
|
||||
$requestUrl = $this->rootUrl . $requestUrl;
|
||||
}
|
||||
$uriTemplateVars = array();
|
||||
$queryVars = array();
|
||||
foreach ($params as $paramName => $paramSpec) {
|
||||
if ($paramSpec['type'] == 'boolean') {
|
||||
$paramSpec['value'] = $paramSpec['value'] ? 'true' : 'false';
|
||||
}
|
||||
if ($paramSpec['location'] == 'path') {
|
||||
$uriTemplateVars[$paramName] = $paramSpec['value'];
|
||||
} else if ($paramSpec['location'] == 'query') {
|
||||
if (is_array($paramSpec['value'])) {
|
||||
foreach ($paramSpec['value'] as $value) {
|
||||
$queryVars[] = $paramName . '=' . rawurlencode(rawurldecode($value));
|
||||
}
|
||||
} else {
|
||||
$queryVars[] = $paramName . '=' . rawurlencode(rawurldecode($paramSpec['value']));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (count($uriTemplateVars)) {
|
||||
$uriTemplateParser = new Google_Utils_UriTemplate();
|
||||
$requestUrl = $uriTemplateParser->parse($requestUrl, $uriTemplateVars);
|
||||
}
|
||||
|
||||
if (count($queryVars)) {
|
||||
$requestUrl .= '?' . implode($queryVars, '&');
|
||||
}
|
||||
|
||||
return $requestUrl;
|
||||
}
|
||||
}
|
20
wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Task/Exception.php
vendored
Normal file
20
wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Task/Exception.php
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
class Google_Task_Exception extends Google_Exception
|
||||
{
|
||||
}
|
24
wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Task/Retryable.php
vendored
Normal file
24
wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Task/Retryable.php
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Interface for checking how many times a given task can be retried following
|
||||
* a failure.
|
||||
*/
|
||||
interface Google_Task_Retryable
|
||||
{
|
||||
}
|
281
wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Task/Runner.php
vendored
Normal file
281
wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Task/Runner.php
vendored
Normal file
@ -0,0 +1,281 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* A task runner with exponential backoff support.
|
||||
*
|
||||
* @see https://developers.google.com/drive/web/handle-errors#implementing_exponential_backoff
|
||||
*/
|
||||
class Google_Task_Runner
|
||||
{
|
||||
const TASK_RETRY_NEVER = 0;
|
||||
const TASK_RETRY_ONCE = 1;
|
||||
const TASK_RETRY_ALWAYS = -1;
|
||||
|
||||
/**
|
||||
* @var integer $maxDelay The max time (in seconds) to wait before a retry.
|
||||
*/
|
||||
private $maxDelay = 60;
|
||||
/**
|
||||
* @var integer $delay The previous delay from which the next is calculated.
|
||||
*/
|
||||
private $delay = 1;
|
||||
|
||||
/**
|
||||
* @var integer $factor The base number for the exponential back off.
|
||||
*/
|
||||
private $factor = 2;
|
||||
/**
|
||||
* @var float $jitter A random number between -$jitter and $jitter will be
|
||||
* added to $factor on each iteration to allow for a better distribution of
|
||||
* retries.
|
||||
*/
|
||||
private $jitter = 0.5;
|
||||
|
||||
/**
|
||||
* @var integer $attempts The number of attempts that have been tried so far.
|
||||
*/
|
||||
private $attempts = 0;
|
||||
/**
|
||||
* @var integer $maxAttempts The max number of attempts allowed.
|
||||
*/
|
||||
private $maxAttempts = 1;
|
||||
|
||||
/**
|
||||
* @var callable $action The task to run and possibly retry.
|
||||
*/
|
||||
private $action;
|
||||
/**
|
||||
* @var array $arguments The task arguments.
|
||||
*/
|
||||
private $arguments;
|
||||
|
||||
/**
|
||||
* @var array $retryMap Map of errors with retry counts.
|
||||
*/
|
||||
protected $retryMap = [
|
||||
'500' => self::TASK_RETRY_ALWAYS,
|
||||
'503' => self::TASK_RETRY_ALWAYS,
|
||||
'rateLimitExceeded' => self::TASK_RETRY_ALWAYS,
|
||||
'userRateLimitExceeded' => self::TASK_RETRY_ALWAYS,
|
||||
6 => self::TASK_RETRY_ALWAYS, // CURLE_COULDNT_RESOLVE_HOST
|
||||
7 => self::TASK_RETRY_ALWAYS, // CURLE_COULDNT_CONNECT
|
||||
28 => self::TASK_RETRY_ALWAYS, // CURLE_OPERATION_TIMEOUTED
|
||||
35 => self::TASK_RETRY_ALWAYS, // CURLE_SSL_CONNECT_ERROR
|
||||
52 => self::TASK_RETRY_ALWAYS // CURLE_GOT_NOTHING
|
||||
];
|
||||
|
||||
/**
|
||||
* Creates a new task runner with exponential backoff support.
|
||||
*
|
||||
* @param array $config The task runner config
|
||||
* @param string $name The name of the current task (used for logging)
|
||||
* @param callable $action The task to run and possibly retry
|
||||
* @param array $arguments The task arguments
|
||||
* @throws Google_Task_Exception when misconfigured
|
||||
*/
|
||||
public function __construct(
|
||||
$config,
|
||||
$name,
|
||||
$action,
|
||||
array $arguments = array()
|
||||
) {
|
||||
if (isset($config['initial_delay'])) {
|
||||
if ($config['initial_delay'] < 0) {
|
||||
throw new Google_Task_Exception(
|
||||
'Task configuration `initial_delay` must not be negative.'
|
||||
);
|
||||
}
|
||||
|
||||
$this->delay = $config['initial_delay'];
|
||||
}
|
||||
|
||||
if (isset($config['max_delay'])) {
|
||||
if ($config['max_delay'] <= 0) {
|
||||
throw new Google_Task_Exception(
|
||||
'Task configuration `max_delay` must be greater than 0.'
|
||||
);
|
||||
}
|
||||
|
||||
$this->maxDelay = $config['max_delay'];
|
||||
}
|
||||
|
||||
if (isset($config['factor'])) {
|
||||
if ($config['factor'] <= 0) {
|
||||
throw new Google_Task_Exception(
|
||||
'Task configuration `factor` must be greater than 0.'
|
||||
);
|
||||
}
|
||||
|
||||
$this->factor = $config['factor'];
|
||||
}
|
||||
|
||||
if (isset($config['jitter'])) {
|
||||
if ($config['jitter'] <= 0) {
|
||||
throw new Google_Task_Exception(
|
||||
'Task configuration `jitter` must be greater than 0.'
|
||||
);
|
||||
}
|
||||
|
||||
$this->jitter = $config['jitter'];
|
||||
}
|
||||
|
||||
if (isset($config['retries'])) {
|
||||
if ($config['retries'] < 0) {
|
||||
throw new Google_Task_Exception(
|
||||
'Task configuration `retries` must not be negative.'
|
||||
);
|
||||
}
|
||||
$this->maxAttempts += $config['retries'];
|
||||
}
|
||||
|
||||
if (!is_callable($action)) {
|
||||
throw new Google_Task_Exception(
|
||||
'Task argument `$action` must be a valid callable.'
|
||||
);
|
||||
}
|
||||
|
||||
$this->action = $action;
|
||||
$this->arguments = $arguments;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a retry can be attempted.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function canAttempt()
|
||||
{
|
||||
return $this->attempts < $this->maxAttempts;
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs the task and (if applicable) automatically retries when errors occur.
|
||||
*
|
||||
* @return mixed
|
||||
* @throws Google_Task_Retryable on failure when no retries are available.
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
while ($this->attempt()) {
|
||||
try {
|
||||
return call_user_func_array($this->action, $this->arguments);
|
||||
} catch (Google_Service_Exception $exception) {
|
||||
$allowedRetries = $this->allowedRetries(
|
||||
$exception->getCode(),
|
||||
$exception->getErrors()
|
||||
);
|
||||
|
||||
if (!$this->canAttempt() || !$allowedRetries) {
|
||||
throw $exception;
|
||||
}
|
||||
|
||||
if ($allowedRetries > 0) {
|
||||
$this->maxAttempts = min(
|
||||
$this->maxAttempts,
|
||||
$this->attempts + $allowedRetries
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs a task once, if possible. This is useful for bypassing the `run()`
|
||||
* loop.
|
||||
*
|
||||
* NOTE: If this is not the first attempt, this function will sleep in
|
||||
* accordance to the backoff configurations before running the task.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function attempt()
|
||||
{
|
||||
if (!$this->canAttempt()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($this->attempts > 0) {
|
||||
$this->backOff();
|
||||
}
|
||||
|
||||
$this->attempts++;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sleeps in accordance to the backoff configurations.
|
||||
*/
|
||||
private function backOff()
|
||||
{
|
||||
$delay = $this->getDelay();
|
||||
|
||||
usleep($delay * 1000000);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the delay (in seconds) for the current backoff period.
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
private function getDelay()
|
||||
{
|
||||
$jitter = $this->getJitter();
|
||||
$factor = $this->attempts > 1 ? $this->factor + $jitter : 1 + abs($jitter);
|
||||
|
||||
return $this->delay = min($this->maxDelay, $this->delay * $factor);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the current jitter (random number between -$this->jitter and
|
||||
* $this->jitter).
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
private function getJitter()
|
||||
{
|
||||
return $this->jitter * 2 * mt_rand() / mt_getrandmax() - $this->jitter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the number of times the associated task can be retried.
|
||||
*
|
||||
* NOTE: -1 is returned if the task can be retried indefinitely
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function allowedRetries($code, $errors = array())
|
||||
{
|
||||
if (isset($this->retryMap[$code])) {
|
||||
return $this->retryMap[$code];
|
||||
}
|
||||
|
||||
if (
|
||||
!empty($errors) &&
|
||||
isset($errors[0]['reason'], $this->retryMap[$errors[0]['reason']])
|
||||
) {
|
||||
return $this->retryMap[$errors[0]['reason']];
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public function setRetryMap($retryMap)
|
||||
{
|
||||
$this->retryMap = $retryMap;
|
||||
}
|
||||
}
|
333
wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Utils/UriTemplate.php
vendored
Normal file
333
wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/Utils/UriTemplate.php
vendored
Normal file
@ -0,0 +1,333 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2013 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implementation of levels 1-3 of the URI Template spec.
|
||||
* @see http://tools.ietf.org/html/rfc6570
|
||||
*/
|
||||
class Google_Utils_UriTemplate
|
||||
{
|
||||
const TYPE_MAP = "1";
|
||||
const TYPE_LIST = "2";
|
||||
const TYPE_SCALAR = "4";
|
||||
|
||||
/**
|
||||
* @var $operators array
|
||||
* These are valid at the start of a template block to
|
||||
* modify the way in which the variables inside are
|
||||
* processed.
|
||||
*/
|
||||
private $operators = array(
|
||||
"+" => "reserved",
|
||||
"/" => "segments",
|
||||
"." => "dotprefix",
|
||||
"#" => "fragment",
|
||||
";" => "semicolon",
|
||||
"?" => "form",
|
||||
"&" => "continuation"
|
||||
);
|
||||
|
||||
/**
|
||||
* @var reserved array
|
||||
* These are the characters which should not be URL encoded in reserved
|
||||
* strings.
|
||||
*/
|
||||
private $reserved = array(
|
||||
"=", ",", "!", "@", "|", ":", "/", "?", "#",
|
||||
"[", "]",'$', "&", "'", "(", ")", "*", "+", ";"
|
||||
);
|
||||
private $reservedEncoded = array(
|
||||
"%3D", "%2C", "%21", "%40", "%7C", "%3A", "%2F", "%3F",
|
||||
"%23", "%5B", "%5D", "%24", "%26", "%27", "%28", "%29",
|
||||
"%2A", "%2B", "%3B"
|
||||
);
|
||||
|
||||
public function parse($string, array $parameters)
|
||||
{
|
||||
return $this->resolveNextSection($string, $parameters);
|
||||
}
|
||||
|
||||
/**
|
||||
* This function finds the first matching {...} block and
|
||||
* executes the replacement. It then calls itself to find
|
||||
* subsequent blocks, if any.
|
||||
*/
|
||||
private function resolveNextSection($string, $parameters)
|
||||
{
|
||||
$start = strpos($string, "{");
|
||||
if ($start === false) {
|
||||
return $string;
|
||||
}
|
||||
$end = strpos($string, "}");
|
||||
if ($end === false) {
|
||||
return $string;
|
||||
}
|
||||
$string = $this->replace($string, $start, $end, $parameters);
|
||||
return $this->resolveNextSection($string, $parameters);
|
||||
}
|
||||
|
||||
private function replace($string, $start, $end, $parameters)
|
||||
{
|
||||
// We know a data block will have {} round it, so we can strip that.
|
||||
$data = substr($string, $start + 1, $end - $start - 1);
|
||||
|
||||
// If the first character is one of the reserved operators, it effects
|
||||
// the processing of the stream.
|
||||
if (isset($this->operators[$data[0]])) {
|
||||
$op = $this->operators[$data[0]];
|
||||
$data = substr($data, 1);
|
||||
$prefix = "";
|
||||
$prefix_on_missing = false;
|
||||
|
||||
switch ($op) {
|
||||
case "reserved":
|
||||
// Reserved means certain characters should not be URL encoded
|
||||
$data = $this->replaceVars($data, $parameters, ",", null, true);
|
||||
break;
|
||||
case "fragment":
|
||||
// Comma separated with fragment prefix. Bare values only.
|
||||
$prefix = "#";
|
||||
$prefix_on_missing = true;
|
||||
$data = $this->replaceVars($data, $parameters, ",", null, true);
|
||||
break;
|
||||
case "segments":
|
||||
// Slash separated data. Bare values only.
|
||||
$prefix = "/";
|
||||
$data =$this->replaceVars($data, $parameters, "/");
|
||||
break;
|
||||
case "dotprefix":
|
||||
// Dot separated data. Bare values only.
|
||||
$prefix = ".";
|
||||
$prefix_on_missing = true;
|
||||
$data = $this->replaceVars($data, $parameters, ".");
|
||||
break;
|
||||
case "semicolon":
|
||||
// Semicolon prefixed and separated. Uses the key name
|
||||
$prefix = ";";
|
||||
$data = $this->replaceVars($data, $parameters, ";", "=", false, true, false);
|
||||
break;
|
||||
case "form":
|
||||
// Standard URL format. Uses the key name
|
||||
$prefix = "?";
|
||||
$data = $this->replaceVars($data, $parameters, "&", "=");
|
||||
break;
|
||||
case "continuation":
|
||||
// Standard URL, but with leading ampersand. Uses key name.
|
||||
$prefix = "&";
|
||||
$data = $this->replaceVars($data, $parameters, "&", "=");
|
||||
break;
|
||||
}
|
||||
|
||||
// Add the initial prefix character if data is valid.
|
||||
if ($data || ($data !== false && $prefix_on_missing)) {
|
||||
$data = $prefix . $data;
|
||||
}
|
||||
|
||||
} else {
|
||||
// If no operator we replace with the defaults.
|
||||
$data = $this->replaceVars($data, $parameters);
|
||||
}
|
||||
// This is chops out the {...} and replaces with the new section.
|
||||
return substr($string, 0, $start) . $data . substr($string, $end + 1);
|
||||
}
|
||||
|
||||
private function replaceVars(
|
||||
$section,
|
||||
$parameters,
|
||||
$sep = ",",
|
||||
$combine = null,
|
||||
$reserved = false,
|
||||
$tag_empty = false,
|
||||
$combine_on_empty = true
|
||||
) {
|
||||
if (strpos($section, ",") === false) {
|
||||
// If we only have a single value, we can immediately process.
|
||||
return $this->combine(
|
||||
$section,
|
||||
$parameters,
|
||||
$sep,
|
||||
$combine,
|
||||
$reserved,
|
||||
$tag_empty,
|
||||
$combine_on_empty
|
||||
);
|
||||
} else {
|
||||
// If we have multiple values, we need to split and loop over them.
|
||||
// Each is treated individually, then glued together with the
|
||||
// separator character.
|
||||
$vars = explode(",", $section);
|
||||
return $this->combineList(
|
||||
$vars,
|
||||
$sep,
|
||||
$parameters,
|
||||
$combine,
|
||||
$reserved,
|
||||
false, // Never emit empty strings in multi-param replacements
|
||||
$combine_on_empty
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public function combine(
|
||||
$key,
|
||||
$parameters,
|
||||
$sep,
|
||||
$combine,
|
||||
$reserved,
|
||||
$tag_empty,
|
||||
$combine_on_empty
|
||||
) {
|
||||
$length = false;
|
||||
$explode = false;
|
||||
$skip_final_combine = false;
|
||||
$value = false;
|
||||
|
||||
// Check for length restriction.
|
||||
if (strpos($key, ":") !== false) {
|
||||
list($key, $length) = explode(":", $key);
|
||||
}
|
||||
|
||||
// Check for explode parameter.
|
||||
if ($key[strlen($key) - 1] == "*") {
|
||||
$explode = true;
|
||||
$key = substr($key, 0, -1);
|
||||
$skip_final_combine = true;
|
||||
}
|
||||
|
||||
// Define the list separator.
|
||||
$list_sep = $explode ? $sep : ",";
|
||||
|
||||
if (isset($parameters[$key])) {
|
||||
$data_type = $this->getDataType($parameters[$key]);
|
||||
switch ($data_type) {
|
||||
case self::TYPE_SCALAR:
|
||||
$value = $this->getValue($parameters[$key], $length);
|
||||
break;
|
||||
case self::TYPE_LIST:
|
||||
$values = array();
|
||||
foreach ($parameters[$key] as $pkey => $pvalue) {
|
||||
$pvalue = $this->getValue($pvalue, $length);
|
||||
if ($combine && $explode) {
|
||||
$values[$pkey] = $key . $combine . $pvalue;
|
||||
} else {
|
||||
$values[$pkey] = $pvalue;
|
||||
}
|
||||
}
|
||||
$value = implode($list_sep, $values);
|
||||
if ($value == '') {
|
||||
return '';
|
||||
}
|
||||
break;
|
||||
case self::TYPE_MAP:
|
||||
$values = array();
|
||||
foreach ($parameters[$key] as $pkey => $pvalue) {
|
||||
$pvalue = $this->getValue($pvalue, $length);
|
||||
if ($explode) {
|
||||
$pkey = $this->getValue($pkey, $length);
|
||||
$values[] = $pkey . "=" . $pvalue; // Explode triggers = combine.
|
||||
} else {
|
||||
$values[] = $pkey;
|
||||
$values[] = $pvalue;
|
||||
}
|
||||
}
|
||||
$value = implode($list_sep, $values);
|
||||
if ($value == '') {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else if ($tag_empty) {
|
||||
// If we are just indicating empty values with their key name, return that.
|
||||
return $key;
|
||||
} else {
|
||||
// Otherwise we can skip this variable due to not being defined.
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($reserved) {
|
||||
$value = str_replace($this->reservedEncoded, $this->reserved, $value);
|
||||
}
|
||||
|
||||
// If we do not need to include the key name, we just return the raw
|
||||
// value.
|
||||
if (!$combine || $skip_final_combine) {
|
||||
return $value;
|
||||
}
|
||||
|
||||
// Else we combine the key name: foo=bar, if value is not the empty string.
|
||||
return $key . ($value != '' || $combine_on_empty ? $combine . $value : '');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the type of a passed in value
|
||||
*/
|
||||
private function getDataType($data)
|
||||
{
|
||||
if (is_array($data)) {
|
||||
reset($data);
|
||||
if (key($data) !== 0) {
|
||||
return self::TYPE_MAP;
|
||||
}
|
||||
return self::TYPE_LIST;
|
||||
}
|
||||
return self::TYPE_SCALAR;
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility function that merges multiple combine calls
|
||||
* for multi-key templates.
|
||||
*/
|
||||
private function combineList(
|
||||
$vars,
|
||||
$sep,
|
||||
$parameters,
|
||||
$combine,
|
||||
$reserved,
|
||||
$tag_empty,
|
||||
$combine_on_empty
|
||||
) {
|
||||
$ret = array();
|
||||
foreach ($vars as $var) {
|
||||
$response = $this->combine(
|
||||
$var,
|
||||
$parameters,
|
||||
$sep,
|
||||
$combine,
|
||||
$reserved,
|
||||
$tag_empty,
|
||||
$combine_on_empty
|
||||
);
|
||||
if ($response === false) {
|
||||
continue;
|
||||
}
|
||||
$ret[] = $response;
|
||||
}
|
||||
return implode($sep, $ret);
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility function to encode and trim values
|
||||
*/
|
||||
private function getValue($value, $length)
|
||||
{
|
||||
if ($length) {
|
||||
$value = substr($value, 0, $length);
|
||||
}
|
||||
$value = rawurlencode($value);
|
||||
return $value;
|
||||
}
|
||||
}
|
21
wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/autoload.php
vendored
Normal file
21
wp-content/plugins/wp-mail-smtp/vendor/google/apiclient/src/Google/autoload.php
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* THIS FILE IS FOR BACKWARDS COMPATIBLITY ONLY
|
||||
*
|
||||
* If you were not already including this file in your project, please ignore it
|
||||
*/
|
||||
|
||||
$file = __DIR__ . '/../../vendor/autoload.php';
|
||||
|
||||
if (!file_exists($file)) {
|
||||
$exception = 'This library must be installed via composer or by downloading the full package.';
|
||||
$exception .= ' See the instructions at https://github.com/google/google-api-php-client#installation.';
|
||||
throw new Exception($exception);
|
||||
}
|
||||
|
||||
$error = 'google-api-php-client\'s autoloader was moved to vendor/autoload.php in 2.0.0. This ';
|
||||
$error .= 'redirect will be removed in 2.1. Please adjust your code to use the new location.';
|
||||
trigger_error($error, E_USER_DEPRECATED);
|
||||
|
||||
require_once $file;
|
202
wp-content/plugins/wp-mail-smtp/vendor/google/auth/COPYING
vendored
Normal file
202
wp-content/plugins/wp-mail-smtp/vendor/google/auth/COPYING
vendored
Normal file
@ -0,0 +1,202 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright 2015 Google Inc.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
203
wp-content/plugins/wp-mail-smtp/vendor/google/auth/LICENSE
vendored
Normal file
203
wp-content/plugins/wp-mail-smtp/vendor/google/auth/LICENSE
vendored
Normal file
@ -0,0 +1,203 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
|
34
wp-content/plugins/wp-mail-smtp/vendor/google/auth/autoload.php
vendored
Normal file
34
wp-content/plugins/wp-mail-smtp/vendor/google/auth/autoload.php
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
function oauth2client_php_autoload($className)
|
||||
{
|
||||
$classPath = explode('_', $className);
|
||||
if ($classPath[0] != 'Google') {
|
||||
return;
|
||||
}
|
||||
if (count($classPath) > 3) {
|
||||
// Maximum class file path depth in this project is 3.
|
||||
$classPath = array_slice($classPath, 0, 3);
|
||||
}
|
||||
$filePath = dirname(__FILE__) . '/src/' . implode('/', $classPath) . '.php';
|
||||
if (file_exists($filePath)) {
|
||||
require_once $filePath;
|
||||
}
|
||||
}
|
||||
|
||||
spl_autoload_register('oauth2client_php_autoload');
|
320
wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/AccessToken.php
vendored
Normal file
320
wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/AccessToken.php
vendored
Normal file
@ -0,0 +1,320 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2019 Google LLC
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Google\Auth;
|
||||
|
||||
use Firebase\JWT\ExpiredException;
|
||||
use Firebase\JWT\JWT;
|
||||
use Firebase\JWT\SignatureInvalidException;
|
||||
use Google\Auth\Cache\MemoryCacheItemPool;
|
||||
use Google\Auth\HttpHandler\HttpClientCache;
|
||||
use Google\Auth\HttpHandler\HttpHandlerFactory;
|
||||
use GuzzleHttp\Psr7;
|
||||
use GuzzleHttp\Psr7\Request;
|
||||
use phpseclib\Crypt\RSA;
|
||||
use phpseclib\Math\BigInteger;
|
||||
use Psr\Cache\CacheItemPoolInterface;
|
||||
|
||||
/**
|
||||
* Wrapper around Google Access Tokens which provides convenience functions.
|
||||
*
|
||||
* @experimental
|
||||
*/
|
||||
class AccessToken
|
||||
{
|
||||
const FEDERATED_SIGNON_CERT_URL = 'https://www.googleapis.com/oauth2/v3/certs';
|
||||
const OAUTH2_ISSUER = 'accounts.google.com';
|
||||
const OAUTH2_ISSUER_HTTPS = 'https://accounts.google.com';
|
||||
const OAUTH2_REVOKE_URI = 'https://oauth2.googleapis.com/revoke';
|
||||
|
||||
/**
|
||||
* @var callable
|
||||
*/
|
||||
private $httpHandler;
|
||||
|
||||
/**
|
||||
* @var CacheItemPoolInterface
|
||||
*/
|
||||
private $cache;
|
||||
|
||||
/**
|
||||
* @param callable $httpHandler [optional] An HTTP Handler to deliver PSR-7 requests.
|
||||
* @param CacheItemPoolInterface $cache [optional] A PSR-6 compatible cache implementation.
|
||||
*/
|
||||
public function __construct(
|
||||
callable $httpHandler = null,
|
||||
CacheItemPoolInterface $cache = null
|
||||
) {
|
||||
// @codeCoverageIgnoreStart
|
||||
if (!class_exists('phpseclib\Crypt\RSA')) {
|
||||
throw new \RuntimeException('Please require phpseclib/phpseclib v2 to use this utility.');
|
||||
}
|
||||
// @codeCoverageIgnoreEnd
|
||||
|
||||
$this->httpHandler = $httpHandler
|
||||
?: HttpHandlerFactory::build(HttpClientCache::getHttpClient());
|
||||
$this->cache = $cache ?: new MemoryCacheItemPool();
|
||||
$this->configureJwtService();
|
||||
|
||||
// set phpseclib constants if applicable
|
||||
$this->setPhpsecConstants();
|
||||
}
|
||||
|
||||
/**
|
||||
* Verifies an id token and returns the authenticated apiLoginTicket.
|
||||
* Throws an exception if the id token is not valid.
|
||||
* The audience parameter can be used to control which id tokens are
|
||||
* accepted. By default, the id token must have been issued to this OAuth2 client.
|
||||
*
|
||||
* @param string $token The JSON Web Token to be verified.
|
||||
* @param array $options [optional] {
|
||||
* Configuration options.
|
||||
*
|
||||
* @type string $audience The indended recipient of the token.
|
||||
* @type string $certsLocation The location (remote or local) from which
|
||||
* to retrieve certificates, if not cached. This value should only be
|
||||
* provided in limited circumstances in which you are sure of the
|
||||
* behavior.
|
||||
* }
|
||||
* @return array|bool the token payload, if successful, or false if not.
|
||||
* @throws \InvalidArgumentException If certs could not be retrieved from a local file.
|
||||
* @throws \InvalidArgumentException If received certs are in an invalid format.
|
||||
* @throws \RuntimeException If certs could not be retrieved from a remote location.
|
||||
*/
|
||||
public function verify($token, array $options = [])
|
||||
{
|
||||
$audience = isset($options['audience'])
|
||||
? $options['audience']
|
||||
: null;
|
||||
$certsLocation = isset($options['certsLocation'])
|
||||
? $options['certsLocation']
|
||||
: self::FEDERATED_SIGNON_CERT_URL;
|
||||
|
||||
unset($options['audience'], $options['certsLocation']);
|
||||
|
||||
// Check signature against each available cert.
|
||||
// allow the loop to complete unless a known bad result is encountered.
|
||||
$certs = $this->getFederatedSignOnCerts($certsLocation, $options);
|
||||
foreach ($certs as $cert) {
|
||||
$rsa = new RSA();
|
||||
$rsa->loadKey([
|
||||
'n' => new BigInteger($this->callJwtStatic('urlsafeB64Decode', [
|
||||
$cert['n']
|
||||
]), 256),
|
||||
'e' => new BigInteger($this->callJwtStatic('urlsafeB64Decode', [
|
||||
$cert['e']
|
||||
]), 256)
|
||||
]);
|
||||
|
||||
try {
|
||||
$pubkey = $rsa->getPublicKey();
|
||||
$payload = $this->callJwtStatic('decode', [
|
||||
$token,
|
||||
$pubkey,
|
||||
['RS256']
|
||||
]);
|
||||
|
||||
if (property_exists($payload, 'aud')) {
|
||||
if ($audience && $payload->aud != $audience) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// support HTTP and HTTPS issuers
|
||||
// @see https://developers.google.com/identity/sign-in/web/backend-auth
|
||||
$issuers = [self::OAUTH2_ISSUER, self::OAUTH2_ISSUER_HTTPS];
|
||||
if (!isset($payload->iss) || !in_array($payload->iss, $issuers)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return (array) $payload;
|
||||
} catch (ExpiredException $e) {
|
||||
return false;
|
||||
} catch (\ExpiredException $e) {
|
||||
// (firebase/php-jwt 2)
|
||||
return false;
|
||||
} catch (SignatureInvalidException $e) {
|
||||
// continue
|
||||
} catch (\SignatureInvalidException $e) {
|
||||
// continue (firebase/php-jwt 2)
|
||||
} catch (\DomainException $e) {
|
||||
// continue
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Revoke an OAuth2 access token or refresh token. This method will revoke the current access
|
||||
* token, if a token isn't provided.
|
||||
*
|
||||
* @param string|array $token The token (access token or a refresh token) that should be revoked.
|
||||
* @param array $options [optional] Configuration options.
|
||||
* @return boolean Returns True if the revocation was successful, otherwise False.
|
||||
*/
|
||||
public function revoke($token, array $options = [])
|
||||
{
|
||||
if (is_array($token)) {
|
||||
if (isset($token['refresh_token'])) {
|
||||
$token = $token['refresh_token'];
|
||||
} else {
|
||||
$token = $token['access_token'];
|
||||
}
|
||||
}
|
||||
|
||||
$body = Psr7\stream_for(http_build_query(['token' => $token]));
|
||||
$request = new Request('POST', self::OAUTH2_REVOKE_URI, [
|
||||
'Cache-Control' => 'no-store',
|
||||
'Content-Type' => 'application/x-www-form-urlencoded',
|
||||
], $body);
|
||||
|
||||
$httpHandler = $this->httpHandler;
|
||||
|
||||
$response = $httpHandler($request, $options);
|
||||
|
||||
return $response->getStatusCode() == 200;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets federated sign-on certificates to use for verifying identity tokens.
|
||||
* Returns certs as array structure, where keys are key ids, and values
|
||||
* are PEM encoded certificates.
|
||||
*
|
||||
* @param string $location The location from which to retrieve certs.
|
||||
* @param array $options [optional] Configuration options.
|
||||
* @return array
|
||||
* @throws \InvalidArgumentException If received certs are in an invalid format.
|
||||
*/
|
||||
private function getFederatedSignOnCerts($location, array $options = [])
|
||||
{
|
||||
$cacheItem = $this->cache->getItem('federated_signon_certs_v3');
|
||||
$certs = $cacheItem ? $cacheItem->get() : null;
|
||||
|
||||
$gotNewCerts = false;
|
||||
if (!$certs) {
|
||||
$certs = $this->retrieveCertsFromLocation($location, $options);
|
||||
|
||||
$gotNewCerts = true;
|
||||
}
|
||||
|
||||
if (!isset($certs['keys'])) {
|
||||
throw new \InvalidArgumentException(
|
||||
'federated sign-on certs expects "keys" to be set'
|
||||
);
|
||||
}
|
||||
|
||||
// Push caching off until after verifying certs are in a valid format.
|
||||
// Don't want to cache bad data.
|
||||
if ($gotNewCerts) {
|
||||
$cacheItem->expiresAt(new \DateTime('+1 hour'));
|
||||
$cacheItem->set($certs);
|
||||
$this->cache->save($cacheItem);
|
||||
}
|
||||
|
||||
return $certs['keys'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve and cache a certificates file.
|
||||
*
|
||||
* @param $url string location
|
||||
* @param array $options [optional] Configuration options.
|
||||
* @throws \RuntimeException
|
||||
* @return array certificates
|
||||
* @throws \InvalidArgumentException If certs could not be retrieved from a local file.
|
||||
* @throws \RuntimeException If certs could not be retrieved from a remote location.
|
||||
*/
|
||||
private function retrieveCertsFromLocation($url, array $options = [])
|
||||
{
|
||||
// If we're retrieving a local file, just grab it.
|
||||
if (strpos($url, 'http') !== 0) {
|
||||
if (!file_exists($url)) {
|
||||
throw new \InvalidArgumentException(sprintf(
|
||||
'Failed to retrieve verification certificates from path: %s.',
|
||||
$url
|
||||
));
|
||||
}
|
||||
|
||||
return json_decode(file_get_contents($url), true);
|
||||
}
|
||||
|
||||
$httpHandler = $this->httpHandler;
|
||||
$response = $httpHandler(new Request('GET', $url), $options);
|
||||
|
||||
if ($response->getStatusCode() == 200) {
|
||||
return json_decode((string) $response->getBody(), true);
|
||||
}
|
||||
|
||||
throw new \RuntimeException(sprintf(
|
||||
'Failed to retrieve verification certificates: "%s".',
|
||||
$response->getBody()->getContents()
|
||||
), $response->getStatusCode());
|
||||
}
|
||||
|
||||
/**
|
||||
* Set required defaults for JWT.
|
||||
*/
|
||||
private function configureJwtService()
|
||||
{
|
||||
$class = class_exists('Firebase\JWT\JWT')
|
||||
? 'Firebase\JWT\JWT'
|
||||
: '\JWT';
|
||||
|
||||
if (property_exists($class, 'leeway') && $class::$leeway < 1) {
|
||||
// Ensures JWT leeway is at least 1
|
||||
// @see https://github.com/google/google-api-php-client/issues/827
|
||||
$class::$leeway = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* phpseclib calls "phpinfo" by default, which requires special
|
||||
* whitelisting in the AppEngine VM environment. This function
|
||||
* sets constants to bypass the need for phpseclib to check phpinfo
|
||||
*
|
||||
* @see phpseclib/Math/BigInteger
|
||||
* @see https://github.com/GoogleCloudPlatform/getting-started-php/issues/85
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
private function setPhpsecConstants()
|
||||
{
|
||||
if (filter_var(getenv('GAE_VM'), FILTER_VALIDATE_BOOLEAN)) {
|
||||
if (!defined('MATH_BIGINTEGER_OPENSSL_ENABLED')) {
|
||||
define('MATH_BIGINTEGER_OPENSSL_ENABLED', true);
|
||||
}
|
||||
if (!defined('CRYPT_RSA_MODE')) {
|
||||
define('CRYPT_RSA_MODE', RSA::MODE_OPENSSL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a hook to mock calls to the JWT static methods.
|
||||
*
|
||||
* @param string $method
|
||||
* @param array $args
|
||||
* @return mixed
|
||||
*/
|
||||
protected function callJwtStatic($method, array $args = [])
|
||||
{
|
||||
$class = class_exists('Firebase\JWT\JWT')
|
||||
? 'Firebase\JWT\JWT'
|
||||
: 'JWT';
|
||||
return call_user_func_array([$class, $method], $args);
|
||||
}
|
||||
}
|
185
wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/ApplicationDefaultCredentials.php
vendored
Normal file
185
wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/ApplicationDefaultCredentials.php
vendored
Normal file
@ -0,0 +1,185 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2015 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Google\Auth;
|
||||
|
||||
use DomainException;
|
||||
use Google\Auth\Credentials\AppIdentityCredentials;
|
||||
use Google\Auth\Credentials\GCECredentials;
|
||||
use Google\Auth\HttpHandler\HttpClientCache;
|
||||
use Google\Auth\HttpHandler\HttpHandlerFactory;
|
||||
use Google\Auth\Middleware\AuthTokenMiddleware;
|
||||
use Google\Auth\Subscriber\AuthTokenSubscriber;
|
||||
use GuzzleHttp\Client;
|
||||
use Psr\Cache\CacheItemPoolInterface;
|
||||
|
||||
/**
|
||||
* ApplicationDefaultCredentials obtains the default credentials for
|
||||
* authorizing a request to a Google service.
|
||||
*
|
||||
* Application Default Credentials are described here:
|
||||
* https://developers.google.com/accounts/docs/application-default-credentials
|
||||
*
|
||||
* This class implements the search for the application default credentials as
|
||||
* described in the link.
|
||||
*
|
||||
* It provides three factory methods:
|
||||
* - #get returns the computed credentials object
|
||||
* - #getSubscriber returns an AuthTokenSubscriber built from the credentials object
|
||||
* - #getMiddleware returns an AuthTokenMiddleware built from the credentials object
|
||||
*
|
||||
* This allows it to be used as follows with GuzzleHttp\Client:
|
||||
*
|
||||
* use Google\Auth\ApplicationDefaultCredentials;
|
||||
* use GuzzleHttp\Client;
|
||||
* use GuzzleHttp\HandlerStack;
|
||||
*
|
||||
* $middleware = ApplicationDefaultCredentials::getMiddleware(
|
||||
* 'https://www.googleapis.com/auth/taskqueue'
|
||||
* );
|
||||
* $stack = HandlerStack::create();
|
||||
* $stack->push($middleware);
|
||||
*
|
||||
* $client = new Client([
|
||||
* 'handler' => $stack,
|
||||
* 'base_uri' => 'https://www.googleapis.com/taskqueue/v1beta2/projects/',
|
||||
* 'auth' => 'google_auth' // authorize all requests
|
||||
* ]);
|
||||
*
|
||||
* $res = $client->get('myproject/taskqueues/myqueue');
|
||||
*/
|
||||
class ApplicationDefaultCredentials
|
||||
{
|
||||
/**
|
||||
* Obtains an AuthTokenSubscriber that uses the default FetchAuthTokenInterface
|
||||
* implementation to use in this environment.
|
||||
*
|
||||
* If supplied, $scope is used to in creating the credentials instance if
|
||||
* this does not fallback to the compute engine defaults.
|
||||
*
|
||||
* @param string|array scope the scope of the access request, expressed
|
||||
* either as an Array or as a space-delimited String.
|
||||
* @param callable $httpHandler callback which delivers psr7 request
|
||||
* @param array $cacheConfig configuration for the cache when it's present
|
||||
* @param CacheItemPoolInterface $cache an implementation of CacheItemPoolInterface
|
||||
*
|
||||
* @return AuthTokenSubscriber
|
||||
*
|
||||
* @throws DomainException if no implementation can be obtained.
|
||||
*/
|
||||
public static function getSubscriber(
|
||||
$scope = null,
|
||||
callable $httpHandler = null,
|
||||
array $cacheConfig = null,
|
||||
CacheItemPoolInterface $cache = null
|
||||
) {
|
||||
$creds = self::getCredentials($scope, $httpHandler, $cacheConfig, $cache);
|
||||
|
||||
return new AuthTokenSubscriber($creds, $httpHandler);
|
||||
}
|
||||
|
||||
/**
|
||||
* Obtains an AuthTokenMiddleware that uses the default FetchAuthTokenInterface
|
||||
* implementation to use in this environment.
|
||||
*
|
||||
* If supplied, $scope is used to in creating the credentials instance if
|
||||
* this does not fallback to the compute engine defaults.
|
||||
*
|
||||
* @param string|array scope the scope of the access request, expressed
|
||||
* either as an Array or as a space-delimited String.
|
||||
* @param callable $httpHandler callback which delivers psr7 request
|
||||
* @param array $cacheConfig configuration for the cache when it's present
|
||||
* @param CacheItemPoolInterface $cache
|
||||
*
|
||||
* @return AuthTokenMiddleware
|
||||
*
|
||||
* @throws DomainException if no implementation can be obtained.
|
||||
*/
|
||||
public static function getMiddleware(
|
||||
$scope = null,
|
||||
callable $httpHandler = null,
|
||||
array $cacheConfig = null,
|
||||
CacheItemPoolInterface $cache = null
|
||||
) {
|
||||
$creds = self::getCredentials($scope, $httpHandler, $cacheConfig, $cache);
|
||||
|
||||
return new AuthTokenMiddleware($creds, $httpHandler);
|
||||
}
|
||||
|
||||
/**
|
||||
* Obtains the default FetchAuthTokenInterface implementation to use
|
||||
* in this environment.
|
||||
*
|
||||
* If supplied, $scope is used to in creating the credentials instance if
|
||||
* this does not fallback to the Compute Engine defaults.
|
||||
*
|
||||
* @param string|array scope the scope of the access request, expressed
|
||||
* either as an Array or as a space-delimited String.
|
||||
* @param callable $httpHandler callback which delivers psr7 request
|
||||
* @param array $cacheConfig configuration for the cache when it's present
|
||||
* @param CacheItemPoolInterface $cache
|
||||
*
|
||||
* @return CredentialsLoader
|
||||
*
|
||||
* @throws DomainException if no implementation can be obtained.
|
||||
*/
|
||||
public static function getCredentials(
|
||||
$scope = null,
|
||||
callable $httpHandler = null,
|
||||
array $cacheConfig = null,
|
||||
CacheItemPoolInterface $cache = null
|
||||
) {
|
||||
$creds = null;
|
||||
$jsonKey = CredentialsLoader::fromEnv()
|
||||
?: CredentialsLoader::fromWellKnownFile();
|
||||
|
||||
if (!$httpHandler) {
|
||||
if (!($client = HttpClientCache::getHttpClient())) {
|
||||
$client = new Client();
|
||||
HttpClientCache::setHttpClient($client);
|
||||
}
|
||||
|
||||
$httpHandler = HttpHandlerFactory::build($client);
|
||||
}
|
||||
|
||||
if (!is_null($jsonKey)) {
|
||||
$creds = CredentialsLoader::makeCredentials($scope, $jsonKey);
|
||||
} elseif (AppIdentityCredentials::onAppEngine() && !GCECredentials::onAppEngineFlexible()) {
|
||||
$creds = new AppIdentityCredentials($scope);
|
||||
} elseif (GCECredentials::onGce($httpHandler)) {
|
||||
$creds = new GCECredentials(null, $scope);
|
||||
}
|
||||
|
||||
if (is_null($creds)) {
|
||||
throw new \DomainException(self::notFound());
|
||||
}
|
||||
if (!is_null($cache)) {
|
||||
$creds = new FetchAuthTokenCache($creds, $cacheConfig, $cache);
|
||||
}
|
||||
return $creds;
|
||||
}
|
||||
|
||||
private static function notFound()
|
||||
{
|
||||
$msg = 'Could not load the default credentials. Browse to ';
|
||||
$msg .= 'https://developers.google.com';
|
||||
$msg .= '/accounts/docs/application-default-credentials';
|
||||
$msg .= ' for more information';
|
||||
|
||||
return $msg;
|
||||
}
|
||||
}
|
24
wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Cache/InvalidArgumentException.php
vendored
Normal file
24
wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Cache/InvalidArgumentException.php
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2016 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Google\Auth\Cache;
|
||||
|
||||
use Psr\Cache\InvalidArgumentException as PsrInvalidArgumentException;
|
||||
|
||||
class InvalidArgumentException extends \InvalidArgumentException implements PsrInvalidArgumentException
|
||||
{
|
||||
}
|
190
wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Cache/Item.php
vendored
Normal file
190
wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Cache/Item.php
vendored
Normal file
@ -0,0 +1,190 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2016 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Google\Auth\Cache;
|
||||
|
||||
use Psr\Cache\CacheItemInterface;
|
||||
|
||||
/**
|
||||
* A cache item.
|
||||
*/
|
||||
final class Item implements CacheItemInterface
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $key;
|
||||
|
||||
/**
|
||||
* @var mixed
|
||||
*/
|
||||
private $value;
|
||||
|
||||
/**
|
||||
* @var \DateTime|null
|
||||
*/
|
||||
private $expiration;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
private $isHit = false;
|
||||
|
||||
/**
|
||||
* @param string $key
|
||||
*/
|
||||
public function __construct($key)
|
||||
{
|
||||
$this->key = $key;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getKey()
|
||||
{
|
||||
return $this->key;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get()
|
||||
{
|
||||
return $this->isHit() ? $this->value : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function isHit()
|
||||
{
|
||||
if (!$this->isHit) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($this->expiration === null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return $this->currentTime()->getTimestamp() < $this->expiration->getTimestamp();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function set($value)
|
||||
{
|
||||
$this->isHit = true;
|
||||
$this->value = $value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function expiresAt($expiration)
|
||||
{
|
||||
if ($this->isValidExpiration($expiration)) {
|
||||
$this->expiration = $expiration;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
$implementationMessage = interface_exists('DateTimeInterface')
|
||||
? 'implement interface DateTimeInterface'
|
||||
: 'be an instance of DateTime';
|
||||
|
||||
$error = sprintf(
|
||||
'Argument 1 passed to %s::expiresAt() must %s, %s given',
|
||||
get_class($this),
|
||||
$implementationMessage,
|
||||
gettype($expiration)
|
||||
);
|
||||
|
||||
$this->handleError($error);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function expiresAfter($time)
|
||||
{
|
||||
if (is_int($time)) {
|
||||
$this->expiration = $this->currentTime()->add(new \DateInterval("PT{$time}S"));
|
||||
} elseif ($time instanceof \DateInterval) {
|
||||
$this->expiration = $this->currentTime()->add($time);
|
||||
} elseif ($time === null) {
|
||||
$this->expiration = $time;
|
||||
} else {
|
||||
$message = 'Argument 1 passed to %s::expiresAfter() must be an ' .
|
||||
'instance of DateInterval or of the type integer, %s given';
|
||||
$error = sprintf($message, get_class($this), gettype($time));
|
||||
|
||||
$this->handleError($error);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles an error.
|
||||
*
|
||||
* @param string $error
|
||||
* @throws \TypeError
|
||||
*/
|
||||
private function handleError($error)
|
||||
{
|
||||
if (class_exists('TypeError')) {
|
||||
throw new \TypeError($error);
|
||||
}
|
||||
|
||||
trigger_error($error, E_USER_ERROR);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if an expiration is valid based on the rules defined by PSR6.
|
||||
*
|
||||
* @param mixed $expiration
|
||||
* @return bool
|
||||
*/
|
||||
private function isValidExpiration($expiration)
|
||||
{
|
||||
if ($expiration === null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// We test for two types here due to the fact the DateTimeInterface
|
||||
// was not introduced until PHP 5.5. Checking for the DateTime type as
|
||||
// well allows us to support 5.4.
|
||||
if ($expiration instanceof \DateTimeInterface) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($expiration instanceof \DateTime) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function currentTime()
|
||||
{
|
||||
return new \DateTime('now', new \DateTimeZone('UTC'));
|
||||
}
|
||||
}
|
154
wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Cache/MemoryCacheItemPool.php
vendored
Normal file
154
wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Cache/MemoryCacheItemPool.php
vendored
Normal file
@ -0,0 +1,154 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2016 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Google\Auth\Cache;
|
||||
|
||||
use Psr\Cache\CacheItemInterface;
|
||||
use Psr\Cache\CacheItemPoolInterface;
|
||||
|
||||
/**
|
||||
* Simple in-memory cache implementation.
|
||||
*/
|
||||
final class MemoryCacheItemPool implements CacheItemPoolInterface
|
||||
{
|
||||
/**
|
||||
* @var CacheItemInterface[]
|
||||
*/
|
||||
private $items;
|
||||
|
||||
/**
|
||||
* @var CacheItemInterface[]
|
||||
*/
|
||||
private $deferredItems;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getItem($key)
|
||||
{
|
||||
return current($this->getItems([$key]));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getItems(array $keys = [])
|
||||
{
|
||||
$items = [];
|
||||
|
||||
foreach ($keys as $key) {
|
||||
$items[$key] = $this->hasItem($key) ? clone $this->items[$key] : new Item($key);
|
||||
}
|
||||
|
||||
return $items;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function hasItem($key)
|
||||
{
|
||||
$this->isValidKey($key);
|
||||
|
||||
return isset($this->items[$key]) && $this->items[$key]->isHit();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function clear()
|
||||
{
|
||||
$this->items = [];
|
||||
$this->deferredItems = [];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function deleteItem($key)
|
||||
{
|
||||
return $this->deleteItems([$key]);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function deleteItems(array $keys)
|
||||
{
|
||||
array_walk($keys, [$this, 'isValidKey']);
|
||||
|
||||
foreach ($keys as $key) {
|
||||
unset($this->items[$key]);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function save(CacheItemInterface $item)
|
||||
{
|
||||
$this->items[$item->getKey()] = $item;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function saveDeferred(CacheItemInterface $item)
|
||||
{
|
||||
$this->deferredItems[$item->getKey()] = $item;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function commit()
|
||||
{
|
||||
foreach ($this->deferredItems as $item) {
|
||||
$this->save($item);
|
||||
}
|
||||
|
||||
$this->deferredItems = [];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if the provided key is valid.
|
||||
*
|
||||
* @param string $key
|
||||
* @return bool
|
||||
* @throws InvalidArgumentException
|
||||
*/
|
||||
private function isValidKey($key)
|
||||
{
|
||||
$invalidCharacters = '{}()/\\\\@:';
|
||||
|
||||
if (!is_string($key) || preg_match("#[$invalidCharacters]#", $key)) {
|
||||
throw new InvalidArgumentException('The provided key is not valid: ' . var_export($key, true));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
244
wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Cache/SysVCacheItemPool.php
vendored
Normal file
244
wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Cache/SysVCacheItemPool.php
vendored
Normal file
@ -0,0 +1,244 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2018 Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
namespace Google\Auth\Cache;
|
||||
|
||||
use Psr\Cache\CacheItemInterface;
|
||||
use Psr\Cache\CacheItemPoolInterface;
|
||||
|
||||
/**
|
||||
* SystemV shared memory based CacheItemPool implementation.
|
||||
*
|
||||
* This CacheItemPool implementation can be used among multiple processes, but
|
||||
* it doesn't provide any locking mechanism. If multiple processes write to
|
||||
* this ItemPool, you have to avoid race condition manually in your code.
|
||||
*/
|
||||
class SysVCacheItemPool implements CacheItemPoolInterface
|
||||
{
|
||||
const VAR_KEY = 1;
|
||||
|
||||
const DEFAULT_PROJ = 'A';
|
||||
|
||||
const DEFAULT_MEMSIZE = 10000;
|
||||
|
||||
const DEFAULT_PERM = 0600;
|
||||
|
||||
/** @var int */
|
||||
private $sysvKey;
|
||||
|
||||
/**
|
||||
* @var CacheItemInterface[]
|
||||
*/
|
||||
private $items;
|
||||
|
||||
/**
|
||||
* @var CacheItemInterface[]
|
||||
*/
|
||||
private $deferredItems;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
private $options;
|
||||
|
||||
/*
|
||||
* @var bool
|
||||
*/
|
||||
private $hasLoadedItems = false;
|
||||
|
||||
/**
|
||||
* Create a SystemV shared memory based CacheItemPool.
|
||||
*
|
||||
* @param array $options [optional] {
|
||||
* Configuration options.
|
||||
*
|
||||
* @type int $variableKey The variable key for getting the data from
|
||||
* the shared memory. **Defaults to** 1.
|
||||
* @type string $proj The project identifier for ftok. This needs to
|
||||
* be a one character string. **Defaults to** 'A'.
|
||||
* @type int $memsize The memory size in bytes for shm_attach.
|
||||
* **Defaults to** 10000.
|
||||
* @type int $perm The permission for shm_attach. **Defaults to** 0600.
|
||||
*/
|
||||
public function __construct($options = [])
|
||||
{
|
||||
if (! extension_loaded('sysvshm')) {
|
||||
throw \RuntimeException(
|
||||
'sysvshm extension is required to use this ItemPool');
|
||||
}
|
||||
$this->options = $options + [
|
||||
'variableKey' => self::VAR_KEY,
|
||||
'proj' => self::DEFAULT_PROJ,
|
||||
'memsize' => self::DEFAULT_MEMSIZE,
|
||||
'perm' => self::DEFAULT_PERM
|
||||
];
|
||||
$this->items = [];
|
||||
$this->deferredItems = [];
|
||||
$this->sysvKey = ftok(__FILE__, $this->options['proj']);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getItem($key)
|
||||
{
|
||||
$this->loadItems();
|
||||
return current($this->getItems([$key]));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getItems(array $keys = [])
|
||||
{
|
||||
$this->loadItems();
|
||||
$items = [];
|
||||
foreach ($keys as $key) {
|
||||
$items[$key] = $this->hasItem($key) ?
|
||||
clone $this->items[$key] :
|
||||
new Item($key);
|
||||
}
|
||||
return $items;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function hasItem($key)
|
||||
{
|
||||
$this->loadItems();
|
||||
return isset($this->items[$key]) && $this->items[$key]->isHit();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function clear()
|
||||
{
|
||||
$this->items = [];
|
||||
$this->deferredItems = [];
|
||||
return $this->saveCurrentItems();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function deleteItem($key)
|
||||
{
|
||||
return $this->deleteItems([$key]);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function deleteItems(array $keys)
|
||||
{
|
||||
if (!$this->hasLoadedItems) {
|
||||
$this->loadItems();
|
||||
}
|
||||
|
||||
foreach ($keys as $key) {
|
||||
unset($this->items[$key]);
|
||||
}
|
||||
return $this->saveCurrentItems();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function save(CacheItemInterface $item)
|
||||
{
|
||||
if (!$this->hasLoadedItems) {
|
||||
$this->loadItems();
|
||||
}
|
||||
|
||||
$this->items[$item->getKey()] = $item;
|
||||
return $this->saveCurrentItems();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function saveDeferred(CacheItemInterface $item)
|
||||
{
|
||||
$this->deferredItems[$item->getKey()] = $item;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function commit()
|
||||
{
|
||||
foreach ($this->deferredItems as $item) {
|
||||
if ($this->save($item) === false) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
$this->deferredItems = [];
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Save the current items.
|
||||
*
|
||||
* @return bool true when success, false upon failure
|
||||
*/
|
||||
private function saveCurrentItems()
|
||||
{
|
||||
$shmid = shm_attach(
|
||||
$this->sysvKey,
|
||||
$this->options['memsize'],
|
||||
$this->options['perm']
|
||||
);
|
||||
if ($shmid !== false) {
|
||||
$ret = shm_put_var(
|
||||
$shmid,
|
||||
$this->options['variableKey'],
|
||||
$this->items
|
||||
);
|
||||
shm_detach($shmid);
|
||||
return $ret;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load the items from the shared memory.
|
||||
*
|
||||
* @return bool true when success, false upon failure
|
||||
*/
|
||||
private function loadItems()
|
||||
{
|
||||
$shmid = shm_attach(
|
||||
$this->sysvKey,
|
||||
$this->options['memsize'],
|
||||
$this->options['perm']
|
||||
);
|
||||
if ($shmid !== false) {
|
||||
$data = @shm_get_var($shmid, $this->options['variableKey']);
|
||||
if (!empty($data)) {
|
||||
$this->items = $data;
|
||||
} else {
|
||||
$this->items = [];
|
||||
}
|
||||
shm_detach($shmid);
|
||||
$this->hasLoadedItems = true;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
83
wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/CacheTrait.php
vendored
Normal file
83
wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/CacheTrait.php
vendored
Normal file
@ -0,0 +1,83 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2015 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Google\Auth;
|
||||
|
||||
trait CacheTrait
|
||||
{
|
||||
private $maxKeyLength = 64;
|
||||
|
||||
/**
|
||||
* Gets the cached value if it is present in the cache when that is
|
||||
* available.
|
||||
*/
|
||||
private function getCachedValue($k)
|
||||
{
|
||||
if (is_null($this->cache)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$key = $this->getFullCacheKey($k);
|
||||
if (is_null($key)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$cacheItem = $this->cache->getItem($key);
|
||||
if ($cacheItem->isHit()) {
|
||||
return $cacheItem->get();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the value in the cache when that is available.
|
||||
*/
|
||||
private function setCachedValue($k, $v)
|
||||
{
|
||||
if (is_null($this->cache)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$key = $this->getFullCacheKey($k);
|
||||
if (is_null($key)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$cacheItem = $this->cache->getItem($key);
|
||||
$cacheItem->set($v);
|
||||
$cacheItem->expiresAfter($this->cacheConfig['lifetime']);
|
||||
return $this->cache->save($cacheItem);
|
||||
}
|
||||
|
||||
private function getFullCacheKey($key)
|
||||
{
|
||||
if (is_null($key)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$key = $this->cacheConfig['prefix'] . $key;
|
||||
|
||||
// ensure we do not have illegal characters
|
||||
$key = preg_replace('|[^a-zA-Z0-9_\.!]|', '', $key);
|
||||
|
||||
// Hash keys if they exceed $maxKeyLength (defaults to 64)
|
||||
if ($this->maxKeyLength && strlen($key) > $this->maxKeyLength) {
|
||||
$key = substr(hash('sha256', $key), 0, $this->maxKeyLength);
|
||||
}
|
||||
|
||||
return $key;
|
||||
}
|
||||
}
|
201
wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Credentials/AppIdentityCredentials.php
vendored
Normal file
201
wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Credentials/AppIdentityCredentials.php
vendored
Normal file
@ -0,0 +1,201 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2015 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Google\Auth\Credentials;
|
||||
|
||||
/*
|
||||
* The AppIdentityService class is automatically defined on App Engine,
|
||||
* so including this dependency is not necessary, and will result in a
|
||||
* PHP fatal error in the App Engine environment.
|
||||
*/
|
||||
use google\appengine\api\app_identity\AppIdentityService;
|
||||
use Google\Auth\CredentialsLoader;
|
||||
use Google\Auth\SignBlobInterface;
|
||||
|
||||
/**
|
||||
* AppIdentityCredentials supports authorization on Google App Engine.
|
||||
*
|
||||
* It can be used to authorize requests using the AuthTokenMiddleware or
|
||||
* AuthTokenSubscriber, but will only succeed if being run on App Engine:
|
||||
*
|
||||
* use Google\Auth\Credentials\AppIdentityCredentials;
|
||||
* use Google\Auth\Middleware\AuthTokenMiddleware;
|
||||
* use GuzzleHttp\Client;
|
||||
* use GuzzleHttp\HandlerStack;
|
||||
*
|
||||
* $gae = new AppIdentityCredentials('https://www.googleapis.com/auth/books');
|
||||
* $middleware = new AuthTokenMiddleware($gae);
|
||||
* $stack = HandlerStack::create();
|
||||
* $stack->push($middleware);
|
||||
*
|
||||
* $client = new Client([
|
||||
* 'handler' => $stack,
|
||||
* 'base_uri' => 'https://www.googleapis.com/books/v1',
|
||||
* 'auth' => 'google_auth'
|
||||
* ]);
|
||||
*
|
||||
* $res = $client->get('volumes?q=Henry+David+Thoreau&country=US');
|
||||
*/
|
||||
class AppIdentityCredentials extends CredentialsLoader implements SignBlobInterface
|
||||
{
|
||||
/**
|
||||
* Result of fetchAuthToken.
|
||||
*
|
||||
* @array
|
||||
*/
|
||||
protected $lastReceivedToken;
|
||||
|
||||
/**
|
||||
* Array of OAuth2 scopes to be requested.
|
||||
*/
|
||||
private $scope;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $clientName;
|
||||
|
||||
public function __construct($scope = array())
|
||||
{
|
||||
$this->scope = $scope;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if this an App Engine instance, by accessing the
|
||||
* SERVER_SOFTWARE environment variable (prod) or the APPENGINE_RUNTIME
|
||||
* environment variable (dev).
|
||||
*
|
||||
* @return true if this an App Engine Instance, false otherwise
|
||||
*/
|
||||
public static function onAppEngine()
|
||||
{
|
||||
$appEngineProduction = isset($_SERVER['SERVER_SOFTWARE']) &&
|
||||
0 === strpos($_SERVER['SERVER_SOFTWARE'], 'Google App Engine');
|
||||
if ($appEngineProduction) {
|
||||
return true;
|
||||
}
|
||||
$appEngineDevAppServer = isset($_SERVER['APPENGINE_RUNTIME']) &&
|
||||
$_SERVER['APPENGINE_RUNTIME'] == 'php';
|
||||
if ($appEngineDevAppServer) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements FetchAuthTokenInterface#fetchAuthToken.
|
||||
*
|
||||
* Fetches the auth tokens using the AppIdentityService if available.
|
||||
* As the AppIdentityService uses protobufs to fetch the access token,
|
||||
* the GuzzleHttp\ClientInterface instance passed in will not be used.
|
||||
*
|
||||
* @param callable $httpHandler callback which delivers psr7 request
|
||||
*
|
||||
* @return array A set of auth related metadata, containing the following
|
||||
* keys:
|
||||
* - access_token (string)
|
||||
* - expiration_time (string)
|
||||
*/
|
||||
public function fetchAuthToken(callable $httpHandler = null)
|
||||
{
|
||||
try {
|
||||
$this->checkAppEngineContext();
|
||||
} catch (\Exception $e) {
|
||||
return [];
|
||||
}
|
||||
|
||||
// AppIdentityService expects an array when multiple scopes are supplied
|
||||
$scope = is_array($this->scope) ? $this->scope : explode(' ', $this->scope);
|
||||
|
||||
$token = AppIdentityService::getAccessToken($scope);
|
||||
$this->lastReceivedToken = $token;
|
||||
|
||||
return $token;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sign a string using AppIdentityService.
|
||||
*
|
||||
* @param string $stringToSign The string to sign.
|
||||
* @param bool $forceOpenSsl [optional] Does not apply to this credentials
|
||||
* type.
|
||||
* @return string The signature, base64-encoded.
|
||||
* @throws \Exception If AppEngine SDK or mock is not available.
|
||||
*/
|
||||
public function signBlob($stringToSign, $forceOpenSsl = false)
|
||||
{
|
||||
$this->checkAppEngineContext();
|
||||
|
||||
return base64_encode(AppIdentityService::signForApp($stringToSign)['signature']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the client name from AppIdentityService.
|
||||
*
|
||||
* Subsequent calls to this method will return a cached value.
|
||||
*
|
||||
* @param callable $httpHandler Not used in this implementation.
|
||||
* @return string
|
||||
* @throws \Exception If AppEngine SDK or mock is not available.
|
||||
*/
|
||||
public function getClientName(callable $httpHandler = null)
|
||||
{
|
||||
$this->checkAppEngineContext();
|
||||
|
||||
if (!$this->clientName) {
|
||||
$this->clientName = AppIdentityService::getServiceAccountName();
|
||||
}
|
||||
|
||||
return $this->clientName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array|null
|
||||
*/
|
||||
public function getLastReceivedToken()
|
||||
{
|
||||
if ($this->lastReceivedToken) {
|
||||
return [
|
||||
'access_token' => $this->lastReceivedToken['access_token'],
|
||||
'expires_at' => $this->lastReceivedToken['expiration_time'],
|
||||
];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Caching is handled by the underlying AppIdentityService, return empty string
|
||||
* to prevent caching.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCacheKey()
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
private function checkAppEngineContext()
|
||||
{
|
||||
if (!self::onAppEngine() || !class_exists('google\appengine\api\app_identity\AppIdentityService')) {
|
||||
throw new \Exception(
|
||||
'This class must be run in App Engine, or you must include the AppIdentityService '
|
||||
. 'mock class defined in tests/mocks/AppIdentityService.php'
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
373
wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Credentials/GCECredentials.php
vendored
Normal file
373
wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Credentials/GCECredentials.php
vendored
Normal file
@ -0,0 +1,373 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2015 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Google\Auth\Credentials;
|
||||
|
||||
use Google\Auth\CredentialsLoader;
|
||||
use Google\Auth\HttpHandler\HttpClientCache;
|
||||
use Google\Auth\HttpHandler\HttpHandlerFactory;
|
||||
use Google\Auth\Iam;
|
||||
use Google\Auth\SignBlobInterface;
|
||||
use GuzzleHttp\Exception\ClientException;
|
||||
use GuzzleHttp\Exception\RequestException;
|
||||
use GuzzleHttp\Exception\ServerException;
|
||||
use GuzzleHttp\Psr7\Request;
|
||||
|
||||
/**
|
||||
* GCECredentials supports authorization on Google Compute Engine.
|
||||
*
|
||||
* It can be used to authorize requests using the AuthTokenMiddleware, but will
|
||||
* only succeed if being run on GCE:
|
||||
*
|
||||
* use Google\Auth\Credentials\GCECredentials;
|
||||
* use Google\Auth\Middleware\AuthTokenMiddleware;
|
||||
* use GuzzleHttp\Client;
|
||||
* use GuzzleHttp\HandlerStack;
|
||||
*
|
||||
* $gce = new GCECredentials();
|
||||
* $middleware = new AuthTokenMiddleware($gce);
|
||||
* $stack = HandlerStack::create();
|
||||
* $stack->push($middleware);
|
||||
*
|
||||
* $client = new Client([
|
||||
* 'handler' => $stack,
|
||||
* 'base_uri' => 'https://www.googleapis.com/taskqueue/v1beta2/projects/',
|
||||
* 'auth' => 'google_auth'
|
||||
* ]);
|
||||
*
|
||||
* $res = $client->get('myproject/taskqueues/myqueue');
|
||||
*/
|
||||
class GCECredentials extends CredentialsLoader implements SignBlobInterface
|
||||
{
|
||||
const cacheKey = 'GOOGLE_AUTH_PHP_GCE';
|
||||
|
||||
/**
|
||||
* The metadata IP address on appengine instances.
|
||||
*
|
||||
* The IP is used instead of the domain 'metadata' to avoid slow responses
|
||||
* when not on Compute Engine.
|
||||
*/
|
||||
const METADATA_IP = '169.254.169.254';
|
||||
|
||||
/**
|
||||
* The metadata path of the default token.
|
||||
*/
|
||||
const TOKEN_URI_PATH = 'v1/instance/service-accounts/default/token';
|
||||
|
||||
/**
|
||||
* The metadata path of the client ID.
|
||||
*/
|
||||
const CLIENT_ID_URI_PATH = 'v1/instance/service-accounts/default/email';
|
||||
|
||||
/**
|
||||
* The header whose presence indicates GCE presence.
|
||||
*/
|
||||
const FLAVOR_HEADER = 'Metadata-Flavor';
|
||||
|
||||
/**
|
||||
* Note: the explicit `timeout` and `tries` below is a workaround. The underlying
|
||||
* issue is that resolving an unknown host on some networks will take
|
||||
* 20-30 seconds; making this timeout short fixes the issue, but
|
||||
* could lead to false negatives in the event that we are on GCE, but
|
||||
* the metadata resolution was particularly slow. The latter case is
|
||||
* "unlikely" since the expected 4-nines time is about 0.5 seconds.
|
||||
* This allows us to limit the total ping maximum timeout to 1.5 seconds
|
||||
* for developer desktop scenarios.
|
||||
*/
|
||||
const MAX_COMPUTE_PING_TRIES = 3;
|
||||
const COMPUTE_PING_CONNECTION_TIMEOUT_S = 0.5;
|
||||
|
||||
/**
|
||||
* Flag used to ensure that the onGCE test is only done once;.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
private $hasCheckedOnGce = false;
|
||||
|
||||
/**
|
||||
* Flag that stores the value of the onGCE check.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
private $isOnGce = false;
|
||||
|
||||
/**
|
||||
* Result of fetchAuthToken.
|
||||
*/
|
||||
protected $lastReceivedToken;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $clientName;
|
||||
|
||||
/**
|
||||
* @var Iam|null
|
||||
*/
|
||||
private $iam;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $tokenUri;
|
||||
|
||||
/**
|
||||
* @param Iam $iam [optional] An IAM instance.
|
||||
* @param string|array $scope [optional] the scope of the access request,
|
||||
* expressed either as an array or as a space-delimited string.
|
||||
*/
|
||||
public function __construct(Iam $iam = null, $scope = null)
|
||||
{
|
||||
$this->iam = $iam;
|
||||
|
||||
$tokenUri = self::getTokenUri();
|
||||
if ($scope) {
|
||||
if (is_string($scope)) {
|
||||
$scope = explode(' ', $scope);
|
||||
}
|
||||
|
||||
$scope = implode(',', $scope);
|
||||
|
||||
$tokenUri = $tokenUri . '?scopes='. $scope;
|
||||
}
|
||||
|
||||
$this->tokenUri = $tokenUri;
|
||||
}
|
||||
|
||||
/**
|
||||
* The full uri for accessing the default token.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getTokenUri()
|
||||
{
|
||||
$base = 'http://' . self::METADATA_IP . '/computeMetadata/';
|
||||
|
||||
return $base . self::TOKEN_URI_PATH;
|
||||
}
|
||||
|
||||
/**
|
||||
* The full uri for accessing the default service account.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getClientNameUri()
|
||||
{
|
||||
$base = 'http://' . self::METADATA_IP . '/computeMetadata/';
|
||||
|
||||
return $base . self::CLIENT_ID_URI_PATH;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if this an App Engine Flexible instance, by accessing the
|
||||
* GAE_INSTANCE environment variable.
|
||||
*
|
||||
* @return true if this an App Engine Flexible Instance, false otherwise
|
||||
*/
|
||||
public static function onAppEngineFlexible()
|
||||
{
|
||||
return substr(getenv('GAE_INSTANCE'), 0, 4) === 'aef-';
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if this a GCE instance, by accessing the expected metadata
|
||||
* host.
|
||||
* If $httpHandler is not specified a the default HttpHandler is used.
|
||||
*
|
||||
* @param callable $httpHandler callback which delivers psr7 request
|
||||
*
|
||||
* @return true if this a GCEInstance false otherwise
|
||||
*/
|
||||
public static function onGce(callable $httpHandler = null)
|
||||
{
|
||||
$httpHandler = $httpHandler
|
||||
?: HttpHandlerFactory::build(HttpClientCache::getHttpClient());
|
||||
|
||||
$checkUri = 'http://' . self::METADATA_IP;
|
||||
for ($i = 1; $i <= self::MAX_COMPUTE_PING_TRIES; $i++) {
|
||||
try {
|
||||
// Comment from: oauth2client/client.py
|
||||
//
|
||||
// Note: the explicit `timeout` below is a workaround. The underlying
|
||||
// issue is that resolving an unknown host on some networks will take
|
||||
// 20-30 seconds; making this timeout short fixes the issue, but
|
||||
// could lead to false negatives in the event that we are on GCE, but
|
||||
// the metadata resolution was particularly slow. The latter case is
|
||||
// "unlikely".
|
||||
$resp = $httpHandler(
|
||||
new Request(
|
||||
'GET',
|
||||
$checkUri,
|
||||
[self::FLAVOR_HEADER => 'Google']
|
||||
),
|
||||
['timeout' => self::COMPUTE_PING_CONNECTION_TIMEOUT_S]
|
||||
);
|
||||
|
||||
return $resp->getHeaderLine(self::FLAVOR_HEADER) == 'Google';
|
||||
} catch (ClientException $e) {
|
||||
} catch (ServerException $e) {
|
||||
} catch (RequestException $e) {
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements FetchAuthTokenInterface#fetchAuthToken.
|
||||
*
|
||||
* Fetches the auth tokens from the GCE metadata host if it is available.
|
||||
* If $httpHandler is not specified a the default HttpHandler is used.
|
||||
*
|
||||
* @param callable $httpHandler callback which delivers psr7 request
|
||||
*
|
||||
* @return array A set of auth related metadata, containing the following
|
||||
* keys:
|
||||
* - access_token (string)
|
||||
* - expires_in (int)
|
||||
* - token_type (string)
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function fetchAuthToken(callable $httpHandler = null)
|
||||
{
|
||||
$httpHandler = $httpHandler
|
||||
?: HttpHandlerFactory::build(HttpClientCache::getHttpClient());
|
||||
|
||||
if (!$this->hasCheckedOnGce) {
|
||||
$this->isOnGce = self::onGce($httpHandler);
|
||||
$this->hasCheckedOnGce = true;
|
||||
}
|
||||
if (!$this->isOnGce) {
|
||||
return array(); // return an empty array with no access token
|
||||
}
|
||||
|
||||
$json = $this->getFromMetadata($httpHandler, $this->tokenUri);
|
||||
if (null === $json = json_decode($json, true)) {
|
||||
throw new \Exception('Invalid JSON response');
|
||||
}
|
||||
|
||||
// store this so we can retrieve it later
|
||||
$this->lastReceivedToken = $json;
|
||||
$this->lastReceivedToken['expires_at'] = time() + $json['expires_in'];
|
||||
|
||||
return $json;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getCacheKey()
|
||||
{
|
||||
return self::cacheKey;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array|null
|
||||
*/
|
||||
public function getLastReceivedToken()
|
||||
{
|
||||
if ($this->lastReceivedToken) {
|
||||
return [
|
||||
'access_token' => $this->lastReceivedToken['access_token'],
|
||||
'expires_at' => $this->lastReceivedToken['expires_at'],
|
||||
];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the client name from GCE metadata.
|
||||
*
|
||||
* Subsequent calls will return a cached value.
|
||||
*
|
||||
* @param callable $httpHandler callback which delivers psr7 request
|
||||
* @return string
|
||||
*/
|
||||
public function getClientName(callable $httpHandler = null)
|
||||
{
|
||||
if ($this->clientName) {
|
||||
return $this->clientName;
|
||||
}
|
||||
|
||||
$httpHandler = $httpHandler
|
||||
?: HttpHandlerFactory::build(HttpClientCache::getHttpClient());
|
||||
|
||||
if (!$this->hasCheckedOnGce) {
|
||||
$this->isOnGce = self::onGce($httpHandler);
|
||||
$this->hasCheckedOnGce = true;
|
||||
}
|
||||
|
||||
if (!$this->isOnGce) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$this->clientName = $this->getFromMetadata($httpHandler, self::getClientNameUri());
|
||||
|
||||
return $this->clientName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sign a string using the default service account private key.
|
||||
*
|
||||
* This implementation uses IAM's signBlob API.
|
||||
*
|
||||
* @see https://cloud.google.com/iam/credentials/reference/rest/v1/projects.serviceAccounts/signBlob SignBlob
|
||||
*
|
||||
* @param string $stringToSign The string to sign.
|
||||
* @param bool $forceOpenSsl [optional] Does not apply to this credentials
|
||||
* type.
|
||||
* @return string
|
||||
*/
|
||||
public function signBlob($stringToSign, $forceOpenSsl = false)
|
||||
{
|
||||
$httpHandler = HttpHandlerFactory::build(HttpClientCache::getHttpClient());
|
||||
|
||||
// Providing a signer is useful for testing, but it's undocumented
|
||||
// because it's not something a user would generally need to do.
|
||||
$signer = $this->iam ?: new Iam($httpHandler);
|
||||
|
||||
$email = $this->getClientName($httpHandler);
|
||||
|
||||
$previousToken = $this->getLastReceivedToken();
|
||||
$accessToken = $previousToken
|
||||
? $previousToken['access_token']
|
||||
: $this->fetchAuthToken($httpHandler)['access_token'];
|
||||
|
||||
return $signer->signBlob($email, $accessToken, $stringToSign);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch the value of a GCE metadata server URI.
|
||||
*
|
||||
* @param callable $httpHandler An HTTP Handler to deliver PSR7 requests.
|
||||
* @param string $uri The metadata URI.
|
||||
* @return string
|
||||
*/
|
||||
private function getFromMetadata(callable $httpHandler, $uri)
|
||||
{
|
||||
$resp = $httpHandler(
|
||||
new Request(
|
||||
'GET',
|
||||
$uri,
|
||||
[self::FLAVOR_HEADER => 'Google']
|
||||
)
|
||||
);
|
||||
|
||||
return (string) $resp->getBody();
|
||||
}
|
||||
}
|
89
wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Credentials/IAMCredentials.php
vendored
Normal file
89
wp-content/plugins/wp-mail-smtp/vendor/google/auth/src/Credentials/IAMCredentials.php
vendored
Normal file
@ -0,0 +1,89 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2015 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Google\Auth\Credentials;
|
||||
|
||||
/**
|
||||
* Authenticates requests using IAM credentials.
|
||||
*/
|
||||
class IAMCredentials
|
||||
{
|
||||
const SELECTOR_KEY = 'x-goog-iam-authority-selector';
|
||||
const TOKEN_KEY = 'x-goog-iam-authorization-token';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $selector;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $token;
|
||||
|
||||
/**
|
||||
* @param $selector string the IAM selector
|
||||
* @param $token string the IAM token
|
||||
*/
|
||||
public function __construct($selector, $token)
|
||||
{
|
||||
if (!is_string($selector)) {
|
||||
throw new \InvalidArgumentException(
|
||||
'selector must be a string');
|
||||
}
|
||||
if (!is_string($token)) {
|
||||
throw new \InvalidArgumentException(
|
||||
'token must be a string');
|
||||
}
|
||||
|
||||
$this->selector = $selector;
|
||||
$this->token = $token;
|
||||
}
|
||||
|
||||
/**
|
||||
* export a callback function which updates runtime metadata.
|
||||
*
|
||||
* @return array updateMetadata function
|
||||
*/
|
||||
public function getUpdateMetadataFunc()
|
||||
{
|
||||
return array($this, 'updateMetadata');
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates metadata with the appropriate header metadata.
|
||||
*
|
||||
* @param array $metadata metadata hashmap
|
||||
* @param string $unusedAuthUri optional auth uri
|
||||
* @param callable $httpHandler callback which delivers psr7 request
|
||||
* Note: this param is unused here, only included here for
|
||||
* consistency with other credentials class
|
||||
*
|
||||
* @return array updated metadata hashmap
|
||||
*/
|
||||
public function updateMetadata(
|
||||
$metadata,
|
||||
$unusedAuthUri = null,
|
||||
callable $httpHandler = null
|
||||
) {
|
||||
$metadata_copy = $metadata;
|
||||
$metadata_copy[self::SELECTOR_KEY] = $this->selector;
|
||||
$metadata_copy[self::TOKEN_KEY] = $this->token;
|
||||
|
||||
return $metadata_copy;
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user